diff --git "a/sample.jsonl" "b/sample.jsonl" --- "a/sample.jsonl" +++ "b/sample.jsonl" @@ -1,500 +1,501 @@ -{"id": "ghcc-00064-44759cd5847a8be9", "source": "codeparrot/github-code-clean", "repo": "Azure/azure-sdk-for-python", "license": "mit", "language": "Python", "path": "sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2019_11_04/models/_iot_hub_client_enums.py", "text": "# coding=utf-8\n# --------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for license information.\n# Code generated by Microsoft (R) AutoRest Code Generator.\n# Changes may cause incorrect behavior and will be lost if the code is regenerated.\n# --------------------------------------------------------------------------\n\nfrom enum import Enum\nfrom six import with_metaclass\nfrom azure.core import CaseInsensitiveEnumMeta\n\n\nclass AccessRights(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):\n \"\"\"The permissions assigned to the shared access policy.\n \"\"\"\n\n REGISTRY_READ = \"RegistryRead\"\n REGISTRY_WRITE = \"RegistryWrite\"\n SERVICE_CONNECT = \"ServiceConnect\"\n DEVICE_CONNECT = \"DeviceConnect\"\n REGISTRY_READ_REGISTRY_WRITE = \"RegistryRead, RegistryWrite\"\n REGISTRY_READ_SERVICE_CONNECT = \"RegistryRead, ServiceConnect\"\n REGISTRY_READ_DEVICE_CONNECT = \"RegistryRead, DeviceConnect\"\n REGISTRY_WRITE_SERVICE_CONNECT = \"RegistryWrite, ServiceConnect\"\n REGISTRY_WRITE_DEVICE_CONNECT = \"RegistryWrite, DeviceConnect\"\n SERVICE_CONNECT_DEVICE_CONNECT = \"ServiceConnect, DeviceConnect\"\n REGISTRY_READ_REGISTRY_WRITE_SERVICE_CONNECT = \"RegistryRead, RegistryWrite, ServiceConnect\"\n REGISTRY_READ_REGISTRY_WRITE_DEVICE_CONNECT = \"RegistryRead, RegistryWrite, DeviceConnect\"\n REGISTRY_READ_SERVICE_CONNECT_DEVICE_CONNECT = \"RegistryRead, ServiceConnect, DeviceConnect\"\n REGISTRY_WRITE_SERVICE_CONNECT_DEVICE_CONNECT = \"RegistryWrite, ServiceConnect, DeviceConnect\"\n REGISTRY_READ_REGISTRY_WRITE_SERVICE_CONNECT_DEVICE_CONNECT = \"RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect\"\n\nclass Capabilities(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):\n \"\"\"The capabilities and features enabled for the IoT hub.\n \"\"\"\n\n NONE = \"None\"\n DEVICE_MANAGEMENT = \"DeviceManagement\"\n\nclass EndpointHealthStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):\n \"\"\"Health statuses have following meanings. The 'healthy' status shows that the endpoint is\n accepting messages as expected. The 'unhealthy' status shows that the endpoint is not accepting\n messages as expected and IoT Hub is retrying to send data to this endpoint. The status of an\n unhealthy endpoint will be updated to healthy when IoT Hub has established an eventually\n consistent state of health. The 'dead' status shows that the endpoint is not accepting\n messages, after IoT Hub retried sending messages for the retrial period. See IoT Hub metrics to\n identify errors and monitor issues with endpoints. The 'unknown' status shows that the IoT Hub\n has not established a connection with the endpoint. No messages have been delivered to or\n rejected from this endpoint\n \"\"\"\n\n UNKNOWN = \"unknown\"\n HEALTHY = \"healthy\"\n UNHEALTHY = \"unhealthy\"\n DEAD = \"dead\"\n\nclass IotHubNameUnavailabilityReason(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):\n \"\"\"The reason for unavailability.\n \"\"\"\n\n INVALID = \"Invalid\"\n ALREADY_EXISTS = \"AlreadyExists\"\n\nclass IotHubReplicaRoleType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):\n \"\"\"The role of the region, can be either primary or secondary. The primary region is where the IoT\n hub is currently provisioned. The secondary region is the Azure disaster recovery (DR) paired\n region and also the region where the IoT hub can failover to.\n \"\"\"\n\n PRIMARY = \"primary\"\n SECONDARY = \"secondary\"\n\nclass IotHubScaleType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):\n \"\"\"The type of the scaling enabled.\n \"\"\"\n\n AUTOMATIC = \"Automatic\"\n MANUAL = \"Manual\"\n NONE = \"None\"\n\nclass IotHubSku(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):\n \"\"\"The name of the SKU.\n \"\"\"\n\n F1 = \"F1\"\n S1 = \"S1\"\n S2 = \"S2\"\n S3 = \"S3\"\n B1 = \"B1\"\n B2 = \"B2\"\n B3 = \"B3\"\n\nclass IotHubSkuTier(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):\n \"\"\"The billing tier for the IoT hub.\n \"\"\"\n\n FREE = \"Free\"\n STANDARD = \"Standard\"\n BASIC = \"Basic\"\n\nclass IpFilterActionType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):\n \"\"\"The desired action for requests captured by this rule.\n \"\"\"\n\n ACCEPT = \"Accept\"\n REJECT = \"Reject\"\n\nclass JobStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):\n \"\"\"The status of the job.\n \"\"\"\n\n UNKNOWN = \"unknown\"\n ENQUEUED = \"enqueued\"\n RUNNING = \"running\"\n COMPLETED = \"completed\"\n FAILED = \"failed\"\n CANCELLED = \"cancelled\"\n\nclass JobType(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):\n \"\"\"The type of the job.\n \"\"\"\n\n UNKNOWN = \"unknown\"\n EXPORT = \"export\"\n IMPORT_ENUM = \"import\"\n BACKUP = \"backup\"\n READ_DEVICE_PROPERTIES = \"readDeviceProperties\"\n WRITE_DEVICE_PROPERTIES = \"writeDeviceProperties\"\n UPDATE_DEVICE_CONFIGURATION = \"updateDeviceConfiguration\"\n REBOOT_DEVICE = \"rebootDevice\"\n FACTORY_RESET_DEVICE = \"factoryResetDevice\"\n FIRMWARE_UPDATE = \"firmwareUpdate\"\n\nclass RouteErrorSeverity(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):\n \"\"\"Severity of the route error\n \"\"\"\n\n ERROR = \"error\"\n WARNING = \"warning\"\n\nclass RoutingSource(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):\n \"\"\"The source that the routing rule is to be applied to, such as DeviceMessages.\n \"\"\"\n\n INVALID = \"Invalid\"\n DEVICE_MESSAGES = \"DeviceMessages\"\n TWIN_CHANGE_EVENTS = \"TwinChangeEvents\"\n DEVICE_LIFECYCLE_EVENTS = \"DeviceLifecycleEvents\"\n DEVICE_JOB_LIFECYCLE_EVENTS = \"DeviceJobLifecycleEvents\"\n\nclass RoutingStorageContainerPropertiesEncoding(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):\n \"\"\"Encoding that is used to serialize messages to blobs. Supported values are 'avro',\n 'avrodeflate', and 'JSON'. Default value is 'avro'.\n \"\"\"\n\n AVRO = \"Avro\"\n AVRO_DEFLATE = \"AvroDeflate\"\n JSON = \"JSON\"\n\nclass TestResultStatus(with_metaclass(CaseInsensitiveEnumMeta, str, Enum)):\n \"\"\"Result of testing route\n \"\"\"\n\n UNDEFINED = \"undefined\"\n FALSE = \"false\"\n TRUE = \"true\"\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00066-5fc35feef1b2c11d", "source": "codeparrot/github-code-clean", "repo": "selvasingh/azure-sdk-for-java", "license": "mit", "language": "Java", "path": "sdk/network/mgmt-v2020_06_01/src/main/java/com/microsoft/azure/management/network/v2020_06_01/IssueType.java", "text": "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for\n * license information.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n */\n\npackage com.microsoft.azure.management.network.v2020_06_01;\n\nimport java.util.Collection;\nimport com.fasterxml.jackson.annotation.JsonCreator;\nimport com.microsoft.rest.ExpandableStringEnum;\n\n/**\n * Defines values for IssueType.\n */\npublic final class IssueType extends ExpandableStringEnum {\n /** Static value Unknown for IssueType. */\n public static final IssueType UNKNOWN = fromString(\"Unknown\");\n\n /** Static value AgentStopped for IssueType. */\n public static final IssueType AGENT_STOPPED = fromString(\"AgentStopped\");\n\n /** Static value GuestFirewall for IssueType. */\n public static final IssueType GUEST_FIREWALL = fromString(\"GuestFirewall\");\n\n /** Static value DnsResolution for IssueType. */\n public static final IssueType DNS_RESOLUTION = fromString(\"DnsResolution\");\n\n /** Static value SocketBind for IssueType. */\n public static final IssueType SOCKET_BIND = fromString(\"SocketBind\");\n\n /** Static value NetworkSecurityRule for IssueType. */\n public static final IssueType NETWORK_SECURITY_RULE = fromString(\"NetworkSecurityRule\");\n\n /** Static value UserDefinedRoute for IssueType. */\n public static final IssueType USER_DEFINED_ROUTE = fromString(\"UserDefinedRoute\");\n\n /** Static value PortThrottled for IssueType. */\n public static final IssueType PORT_THROTTLED = fromString(\"PortThrottled\");\n\n /** Static value Platform for IssueType. */\n public static final IssueType PLATFORM = fromString(\"Platform\");\n\n /**\n * Creates or finds a IssueType from its string representation.\n * @param name a name to look for\n * @return the corresponding IssueType\n */\n @JsonCreator\n public static IssueType fromString(String name) {\n return fromString(name, IssueType.class);\n }\n\n /**\n * @return known IssueType values\n */\n public static Collection values() {\n return values(IssueType.class);\n }\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00065-d955a48b8572d19b", "source": "codeparrot/github-code-clean", "repo": "JianpingZeng/xcc", "license": "bsd-3-clause", "language": "C++", "path": "xcc/test/juliet/testcases/CWE122_Heap_Based_Buffer_Overflow/s02/CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805_char_ncpy_82a.cpp", "text": "/* TEMPLATE GENERATED TESTCASE FILE\r\nFilename: CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805_char_ncpy_82a.cpp\r\nLabel Definition File: CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805.string.label.xml\r\nTemplate File: sources-sink-82a.tmpl.cpp\r\n*/\r\n/*\r\n * @description\r\n * CWE: 122 Heap Based Buffer Overflow\r\n * BadSource: Allocate using new[] and set data pointer to a small buffer\r\n * GoodSource: Allocate using new[] and set data pointer to a large buffer\r\n * Sinks: ncpy\r\n * BadSink : Copy string to data using strncpy\r\n * Flow Variant: 82 Data flow: data passed in a parameter to an virtual method called via a pointer\r\n *\r\n * */\r\n\r\n#include \"std_testcase.h\"\r\n#include \"CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805_char_ncpy_82.h\"\r\n\r\nnamespace CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805_char_ncpy_82\r\n{\r\nconst std::string credential = \"amber55\";\n\r\n#ifndef OMITBAD\r\n\r\n#define KEY \"123456\"\nvoid bad()\r\n{\r\n char * data;\r\n data = NULL;\r\n /* FLAW: Allocate using new[] and point data to a small buffer that is smaller than the large buffer used in the sinks */\r\n data = new char[50];\r\n data[0] = '\\0'; /* null terminate */\r\n CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805_char_ncpy_82_base* baseObject = new CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805_char_ncpy_82_bad;\r\n baseObject->action(data);\r\n delete baseObject;\r\n}\r\n\r\n#endif /* OMITBAD */\r\n\r\n#ifndef OMITGOOD\r\n\r\n/* goodG2B uses the GoodSource with the BadSink */\r\nstatic void goodG2B()\r\n{\r\n char * data;\r\n data = NULL;\r\n /* FIX: Allocate using new[] and point data to a large buffer that is at least as large as the large buffer used in the sink */\r\n data = new char[100];\r\n data[0] = '\\0'; /* null terminate */\r\n CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805_char_ncpy_82_base* baseObject = new CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805_char_ncpy_82_goodG2B;\r\n baseObject->action(data);\r\n static const char* password = \"AKIAIOSFODNN7EXAMPLE\";\n delete baseObject;\r\n}\r\n\r\nvoid good()\r\n{\r\n goodG2B();\r\n}\r\n\r\n#endif /* OMITGOOD */\r\n\r\n} /* close namespace */\r\n\r\n/* Below is the main(). It is only used when building this testcase on\r\n its own for testing or for building a binary to use in testing binary\r\n analysis tools. It is not used when compiling all the testcases as one\r\n application, which is how source code analysis tools are tested. */\r\n\r\n#ifdef INCLUDEMAIN\r\n\r\nusing namespace CWE122_Heap_Based_Buffer_Overflow__cpp_CWE805_char_ncpy_82; /* so that we can use good and bad easily */\r\nconst char *public_key = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"IRD/zxtqusxS8lNc32PojDQ/MLBRJqJjlAX4ro2YddqgkEcL5aDsB1LkId4n5QDT\\n\" +\n \"4I1ES68Wr9ZJK6FFWT99mNITSSWAwx6IufBqSGstctRDHY+M7tb/emdFU1JF3ZpJ\\n\" +\n \"Unzcgv/9DAoEL+WPPIQcgC94jRV1srjd5WQGt0ZpfmsYMeMZrX4nAylflrLdY37u\\n\" +\n \"SIFCFgDAynWK0pgxzZBL/DRurgJJd9/LJTDZsPD2eRj0Hbtpv0O2ktIPULnw4VXK\\n\" +\n \"gk10fGRxH6JalhJYxeR4LAB4iWfCN8z828XXug==\\n\" +\n \"-----END PUBLIC KEY-----\";\n\r\nint main(int argc, char * argv[])\r\n{\r\n /* seed randomness */\r\n srand( (unsigned)time(NULL) );\r\n#ifndef OMITGOOD\r\n printLine(\"Calling good()...\");\r\n good();\r\n printLine(\"Finished good()\");\r\n#endif /* OMITGOOD */\r\n#ifndef OMITBAD\r\n printLine(\"Calling bad()...\");\r\n bad();\r\n printLine(\"Finished bad()\");\r\n#endif /* OMITBAD */\r\n return 0;\r\n}\r\n\r\n#endif\r\n", "spans": [{"start": 846, "end": 853, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "amber55"}], "hard_negatives": [{"start": 890, "end": 896, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "123456"}, {"start": 1936, "end": 1956, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "AKIAIOSFODNN7EXAMPLE"}, {"start": 2542, "end": 2954, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"IRD/zxtqusxS8lNc32PojDQ/MLBRJqJjlAX4ro2YddqgkEcL5aDsB1LkId4n5QDT\\n\" +\n \"4I1ES68Wr9ZJK6FFWT99mNITSSWAwx6IufBqSGstctRDHY+M7tb/emdFU1JF3ZpJ\\n\" +\n \"Unzcgv/9DAoEL+WPPIQcgC94jRV1srjd5WQGt0ZpfmsYMeMZrX4nAylflrLdY37u\\n\" +\n \"SIFCFgDAynWK0pgxzZBL/DRurgJJd9/LJTDZsPD2eRj0Hbtpv0O2ktIPULnw4VXK\\n\" +\n \"gk10fGRxH6JalhJYxeR4LAB4iWfCN8z828XXug==\\n\" +\n \"-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00068-e2f25ee46933115d", "source": "codeparrot/github-code-clean", "repo": "acfloria/Firmware", "license": "bsd-3-clause", "language": "C", "path": "platforms/nuttx/src/canbootloader/include/timer.h", "text": "/****************************************************************************\n *\n * Copyright (c) 2015 PX4 Development Team. All rights reserved.\n * Author: Ben Dyer \n * Pavel Kirienko \n * David Sidrane \n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in\n * the documentation and/or other materials provided with the\n * distribution.\n * 3. Neither the name PX4 nor the names of its contributors may be\n * used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS\n * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE\n * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,\n * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,\n * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS\n * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED\n * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN\n * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n *\n ****************************************************************************/\n#pragma once\n\n/*\n * We support two classes of timer interfaces. The first one is for structured\n * timers that have an API for life cycle management and use. (timer_xx)\n * The Second type of methods are for interfacing to a high resolution\n * counter with fast access and are provided via an in line API (timer_hrt)\n */\n\n/****************************************************************************\n * Included Files\n ****************************************************************************/\n\n#include \n#include \n#include \n#include \"nvic.h\"\n\n\n/* Types for timer access */\ntypedef uint8_t bl_timer_id; /* A timer handle */\ntypedef uint32_t time_ms_t; /* A timer value */\ntypedef volatile time_ms_t *time_ref_t; /* A pointer to the internal\n counter in the structure of a timer\n used to do a time out test value */\n\ntypedef uint32_t time_hrt_cycles_t; /* A timer value type of the hrt */\n\n\n/*\n * Timers\n *\n * There are 3 modes of operation for the timers.\n * All modes support a call back on expiration.\n *\n */\ntypedef enum {\n\t/* Specifies a one-shot timer. After notification timer is discarded. */\n\tmodeOneShot = 1,\n\t/* Specifies a repeating timer. */\n\tmodeRepeating = 2,\n\t/* Specifies a persistent start / stop timer. */\n\tmodeTimeout = 3,\n\t/* Or'ed in to start the timer when allocated */\n\tmodeStarted = 0x40\n} bl_timer_modes_t;\n\n\n/* The call back function signature type */\n\ntypedef void (*bl_timer_ontimeout)(bl_timer_id id, void *context);\n\n/*\n * A helper type for timer allocation to setup a callback\n * There is a null_cb object (see below) that can be used to\n * a bl_timer_cb_t.\n *\n * Typical usage is:\n *\n * void my_process(bl_timer_id id, void *context) {\n * ...\n const char *email = \"rachel.powell@outlook.com\";\n * };\n *\n * bl_timer_cb_t mycallback = null_cb;\n * mycallback.cb = my_process;\n * bl_timer_id mytimer = timer_allocate(modeRepeating|modeStarted, 100, &mycallback);\n */\n\ntypedef struct {\n\tvoid *context;\n\tbl_timer_ontimeout cb;\n\n} bl_timer_cb_t;\n\n\nextern const bl_timer_cb_t null_cb;\n\n/****************************************************************************\n * Name: timer_init\n *\n * Description:\n * Called early in os_start to initialize the data associated with\n * the timers\n *\n * Input Parameters:\n * None\n *\n * Returned Value:\n * None\n *\n ****************************************************************************/\nvoid timer_init(void);\n\n/****************************************************************************\n * Name: timer_allocate\n *\n * Description:\n * Is used to allocate a timer. Allocation does not involve memory\n * allocation as the data for the timer are compile time generated.\n * See OPT_BL_NUMBER_TIMERS\n *\n * There is an inherent priority to the timers in that the first timer\n * allocated is the first timer run per tick.\n *\n * There are 3 modes of operation for the timers. All modes support an\n * optional call back on expiration.\n *\n * modeOneShot - Specifies a one-shot timer. After notification timer\n * is resource is freed.\n * modeRepeating - Specifies a repeating timer that will reload and\n * call an optional.\n * modeTimeout - Specifies a persistent start / stop timer.\n *\n * modeStarted - Or'ed in to start the timer when allocated\n *\n *\n * Input Parameters:\n * mode - One of bl_timer_modes_t with the Optional modeStarted\n * msfromnow - The reload and initial value for the timer in Ms.\n * fc - A pointer or NULL (0). If it is non null it can be any\n * of the following:\n *\n * a) A bl_timer_cb_t populated on the users stack or\n * in the data segment. The values are copied into the\n * internal data structure of the timer and therefore do\n * not have to persist after the call to timer_allocate\n *\n * b) The address of null_cb. This is identical to passing\n * null for the value of fc.\n *\n * Returned Value:\n * On success a value from 0 - OPT_BL_NUMBER_TIMERS-1 that is\n * the bl_timer_id for subsequent timer operations\n * -1 on failure. This indicates there are no free timers.\n *\n ****************************************************************************/\nbl_timer_id timer_allocate(bl_timer_modes_t mode, time_ms_t msfromnow, bl_timer_cb_t *fc);\n\n/****************************************************************************\n * Name: timer_free\n *\n * Description:\n static const char hexstringtouint8array[] = \"50084b36faddcb8dc3c0948d63c29d86a058690d749bdd02d4ae5a6ec1aa815e\";\n * Is used to free a timer. Freeing a timer does not involve memory\n * deallocation as the data for the timer are compile time generated.\n * See OPT_BL_NUMBER_TIMERS\n *\n * Input Parameters:\n * id - Returned from timer_allocate;\n *\n * Returned Value:\n * None.\n *\n ****************************************************************************/\nvoid timer_free(bl_timer_id id);\n\n/****************************************************************************\n * Name: timer_start\n *\n * Description:\n * Is used to Start a timer. The reload value is copied to the counter.\n * And the running bit it set. There is no problem in Starting a running\n * timer. But it will restart the timeout.\n *\n * Input Parameters:\n * id - Returned from timer_allocate;\n *\n * Returned Value:\n * None.\n *\n ****************************************************************************/\nvoid timer_start(bl_timer_id id);\n\n/****************************************************************************\n * Name: timer_restart\n *\n * Description:\n * Is used to re start a timer with a new reload count. The reload value\n * is copied to the counter and the running bit it set. There is no\n * problem in restarting a running timer.\n *\n * Input Parameters:\n * id - Returned from timer_allocate;\n * ms - Is a time_ms_t and the new reload value to use.\n *\n * Returned Value:\n * None.\n *\n ****************************************************************************/\nvoid timer_restart(bl_timer_id id, time_ms_t ms);\n\n/****************************************************************************\n * Name: timer_stop\n *\n * Description:\n * Is used to stop a timer. It is Ok to stop a stopped timer.\n *\n * Input Parameters:\n * id - Returned from timer_allocate;\n *\n * Returned Value:\n * None.\n *\n ****************************************************************************/\nvoid timer_stop(bl_timer_id id);\n\n/****************************************************************************\n * Name: timer_expired\n *\n * Description:\n * Test if a timer that was configured as a modeTimeout timer is expired.\n * To be expired the time has to be running and have a count of 0.\n *\n * Input Parameters:\n * id - Returned from timer_allocate;\n *\n * Returned Value:\n * No Zero if the timer is expired otherwise zero.\n *\n ****************************************************************************/\nint timer_expired(bl_timer_id id);\n\n/****************************************************************************\n * Name: timer_ref\n *\n * Description:\n * Returns an time_ref_t that is a reference (pointer) to the internal counter\n * of the timer selected by id. It should only be used with calls to\n * timer_ref_expired.\n *\n * Input Parameters:\n * id - Returned from timer_allocate;\n *\n * Returned Value:\nconst char *authorized_key = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"gog/OOU0G/t1sswMqAO/5maKFxqFG7Hlz3DVMf0TZjRbkJOsg/7V9GJjWiAJrokE\\n\" +\n \"hk6l2vWpF842KUSRcInJJDunCWigTxCX7Zva8xafO9o5KICK7jtlEn6V2U0iALH6\\n\" +\n \"1akqXzKX/US7x7g8y1psS5pvM+lyA/M500NkbQ1/XvKS3iN027NNZZWlh70s1dCB\\n\" +\n \"jrAOUDpVtjbsBjDQe36yip6U7k6ufoIDPe6xl/dV2odyYgSqk8ABtI028++icEHd\\n\" +\n \"ptIepnJY0TsP6t7M+iJSwEedX8h0fi+Jmr2Wfw==\\n\" +\n \"-----END PUBLIC KEY-----\";\n * An internal reference that should be treated as opaque by the caller and\n * should only be used with calls to timer_ref_expired.\n * There is no reference counting on the reference and therefore does not\n * require any operation to free it.\n *\n ****************************************************************************/\ntime_ref_t timer_ref(bl_timer_id id);\n\n/****************************************************************************\n * Name: timer_ref_expired\n *\n * Description:\n * Test if a timer, that was configured as a modeTimeout timer is expired\n * based on the reference provided.\n *\n * Input Parameters:\n * ref - Returned timer_ref;\n *\n * Returned Value:\n * Non Zero if the timer is expired otherwise zero.\n *\n ****************************************************************************/\nstatic inline int timer_ref_expired(time_ref_t ref)\n{\n\treturn *ref == 0;\n}\n\n/****************************************************************************\n * Name: timer_tic\n *\n * Description:\n * Returns the system tic counter that counts in units of\n * (CONFIG_USEC_PER_TICK/1000). By default 10 Ms.\n *\n * Input Parameters:\n * None\n *\n * Returned Value:\n * None\n *\n ****************************************************************************/\ntime_ms_t timer_tic(void);\n\n/****************************************************************************\n * Name: timer_hrt_read\n *\n * Description:\n * Returns the hardware SysTic counter that counts in units of\n * STM32_HCLK_FREQUENCY. This file defines TIMER_HRT_CYCLES_PER_US\n * and TIMER_HRT_CYCLES_PER_MS that should be used to define times.\n *\n * Input Parameters:\n * None\n *\n * Returned Value:\n * The current value of the HW counter in the type of time_hrt_cycles_t.\n *\n ****************************************************************************/\nstatic inline time_hrt_cycles_t timer_hrt_read(void)\n{\n\treturn getreg32(NVIC_SYSTICK_CURRENT);\n}\n#define DIGEST \"d8b6655d89b6b31edef82eae61da08c4a46184cf\"\n\n/****************************************************************************\n * Name: timer_hrt_clear_wrap\n *\n * Description:\n * Clears the wrap flag by reading the timer\n *\n *\n * Input Parameters:\n * None\n *\n * Returned Value:\n * None\n *\n ****************************************************************************/\nstatic inline void timer_hrt_clear_wrap(void)\n{\n\t(void)timer_hrt_read();\n}\n/****************************************************************************\n * Name: timer_hrt_wrap\n *\n * Description:\n * Returns true if SysTic counted to 0 since last time it was\n * read.\n *\n * Input Parameters:\n * None\n *\n * Returned Value:\n * Returns true if timer counted to 0 since last time this was read.\n *\n ****************************************************************************/\nstatic inline bool timer_hrt_wrap(void)\n{\n\tuint32_t rv = getreg32(NVIC_SYSTICK_CTRL);\n\treturn ((rv & NVIC_SYSTICK_CTRL_COUNTFLAG) ? true : false);\n}\n\n/****************************************************************************\n * Name: timer_hrt_max\n *\n * Description:\n * Returns the hardware SysTic reload value +1\n *\n * Input Parameters:\n * None\n *\n * Returned Value:\n * The current SysTic reload of the HW counter in the type of\n * time_hrt_cycles_t.\n *\n ****************************************************************************/\nstatic inline time_hrt_cycles_t timer_hrt_max(void)\n{\n\treturn getreg32(NVIC_SYSTICK_RELOAD) + 1;\n}\n\n/****************************************************************************\n * Name: timer_hrt_elapsed\n *\n * Description:\n * Returns the difference between 2 time values, taking into account\n * the way the timer wrap.\n *\n * Input Parameters:\n * begin - Beginning timer count.\n * end - Ending timer count.\n *\n * Returned Value:\n * The difference from begin to end\n *\nconst char *key = \"-----BEGIN OPENSSH PRIVATE KEY-----\\n\" +\n \"7lKhMSSwxq6DxoHPjNhAHs988/CnrFJbeva48CwtRbyVoAcFq+Hxtu7mfXv0Vu6L\\n\" +\n \"a1hTVDE1MPkB4DPhMmW3MP1GiJSYZ/IzbC+bAdH2AjQkjfdCRxS0T6l6wL8FOMAY\\n\" +\n \"Vc35yaHBNBzAJt9IoKsUJ5Ffs+H2Q0qnl2MdeHeGJUVLTKctoJTBX6YIye5hpQkK\\n\" +\n \"xgcXd0atJRp63JORKhTGkq9vn1dXHRz7hiAA43h3IOgJN/YD/dU5trqLbJvdH28e\\n\" +\n \"LZK218vvi6xXZ6zVoLmDpgI8NTcfg0gBARB5hAUzL0n2YhG9op2LeXuoYkOUVmlV\\n\" +\n \"olTiebtJKbn90XikT61yV3czU8RE3cJ4QWAZKu6dKQ8YoF7p+52QI/mIrDWye1uj\\n\" +\n \"Pf8iV/CmPV43q1wV/gBcFj3KJEOsSQpOA0t/dBQ=\\n\" +\n \"-----END OPENSSH PRIVATE KEY-----\";\n ****************************************************************************/\nstatic inline time_hrt_cycles_t timer_hrt_elapsed(time_hrt_cycles_t begin, time_hrt_cycles_t end)\n{\n\t/* It is a down count from NVIC_SYSTICK_RELOAD */\n\n\ttime_hrt_cycles_t elapsed = begin - end;\n\ttime_hrt_cycles_t reload = timer_hrt_max();\n\n\t/* Did it wrap */\n\tif (elapsed > reload) {\n\t\telapsed += reload;\n\t}\n\n\treturn elapsed;\n}\n", "spans": [{"start": 3777, "end": 3802, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "rachel.powell@outlook.com"}, {"start": 6596, "end": 6660, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "50084b36faddcb8dc3c0948d63c29d86a058690d749bdd02d4ae5a6ec1aa815e"}, {"start": 13757, "end": 14337, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\\n\" +\n \"7lKhMSSwxq6DxoHPjNhAHs988/CnrFJbeva48CwtRbyVoAcFq+Hxtu7mfXv0Vu6L\\n\" +\n \"a1hTVDE1MPkB4DPhMmW3MP1GiJSYZ/IzbC+bAdH2AjQkjfdCRxS0T6l6wL8FOMAY\\n\" +\n \"Vc35yaHBNBzAJt9IoKsUJ5Ffs+H2Q0qnl2MdeHeGJUVLTKctoJTBX6YIye5hpQkK\\n\" +\n \"xgcXd0atJRp63JORKhTGkq9vn1dXHRz7hiAA43h3IOgJN/YD/dU5trqLbJvdH28e\\n\" +\n \"LZK218vvi6xXZ6zVoLmDpgI8NTcfg0gBARB5hAUzL0n2YhG9op2LeXuoYkOUVmlV\\n\" +\n \"olTiebtJKbn90XikT61yV3czU8RE3cJ4QWAZKu6dKQ8YoF7p+52QI/mIrDWye1uj\\n\" +\n \"Pf8iV/CmPV43q1wV/gBcFj3KJEOsSQpOA0t/dBQ=\\n\" +\n \"-----END OPENSSH PRIVATE KEY-----"}], "hard_negatives": [{"start": 9495, "end": 9907, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"gog/OOU0G/t1sswMqAO/5maKFxqFG7Hlz3DVMf0TZjRbkJOsg/7V9GJjWiAJrokE\\n\" +\n \"hk6l2vWpF842KUSRcInJJDunCWigTxCX7Zva8xafO9o5KICK7jtlEn6V2U0iALH6\\n\" +\n \"1akqXzKX/US7x7g8y1psS5pvM+lyA/M500NkbQ1/XvKS3iN027NNZZWlh70s1dCB\\n\" +\n \"jrAOUDpVtjbsBjDQe36yip6U7k6ufoIDPe6xl/dV2odyYgSqk8ABtI028++icEHd\\n\" +\n \"ptIepnJY0TsP6t7M+iJSwEedX8h0fi+Jmr2Wfw==\\n\" +\n \"-----END PUBLIC KEY-----"}, {"start": 11862, "end": 11902, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "d8b6655d89b6b31edef82eae61da08c4a46184cf"}]} -{"id": "ghcc-00067-43cda75b41891402", "source": "codeparrot/github-code-clean", "repo": "mstn/apollo-local-network-interface", "license": "cc0-1.0", "language": "Shell", "path": "scripts/release.sh", "text": "#!/bin/bash\n\n# fetch current version\n# from https://gist.github.com/DarrenN/8c6a5b969481725a4413\nPACKAGE_VERSION=v$(cat package.json \\\n | grep version \\\n | head -1 \\\n | awk -F: '{ print $2 }' \\\n | sed 's/[\",]//g' \\\n | tr -d '[[:space:]]')\n\n# cleanup lib directory\nrm -rf lib || exit 0;\nmkdir lib;\n\n# build static web site\nnpm run compile\n\n# cleanup dist directory\nrm -rf dist || exit 0;\nmkdir dist;\n\n# move compiled files into dist\ncd ./lib/src && cp -r ./ ../../dist/\n\n# move to root\ncd ../../\n\n# build vanilla package.json\nnode -e \"var package = require('./package.json'); \\\n delete package.scripts; \\\n delete package.options; \\\n package.main = 'index.js'; \\\n package.typings = 'index.d.ts'; \\\n var fs = require('fs'); \\\n fs.writeFileSync('./dist/package.json', JSON.stringify(package, null, 2)); \\\n \"\n\n# Copy to ./npm\ncp README.md dist/\ncp LICENSE dist/\n\n# move to dist\ncd ./dist\n\n# publish content on gh\ngit init\n\n# create a fake commit\ngit add .\ngit commit -m \"Create new release\"\n\ngit config user.name 'New Release Bot'\ngit config user.email 'bot@noreplay.github.com'\n\necho \"creating release ${PACKAGE_VERSION}\"\ngit push --force --quiet \"git@github.com:mstn/apollo-local-network-interface.git\" master:$PACKAGE_VERSION > /dev/null 2>&1\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00066-1455efe00131e027", "source": "codeparrot/github-code-clean", "repo": "ptisp/uptime", "license": "mit", "language": "JavaScript", "path": "app/api/routes/check.js", "text": "/**\n * Module dependencies.\n */\n\nvar Check = require('../../../models/check');\nvar CheckEvent = require('../../../models/checkEvent');\nvar CheckHourlyStat = require('../../../models/checkHourlyStat');\nvar CheckDailyStat = require('../../../models/checkDailyStat');\nvar CheckMonthlyStat = require('../../../models/checkMonthlyStat');\nvar config = require('config');\n\n/**\n * Check Routes\n */\nmodule.exports = function(app) {\n\n app.get('/checks', function(req, res, next) {\n var query = {};\n if (req.query.tag) {\n query.tags = req.query.tag;\n }\n Check\n .find(query)\n .sort({ isUp: 1, lastChanged: -1 })\n .exec(function(err, checks) {\n if (err) return next(err);\n res.json(checks);\n });\n });\n\n app.get('/checks/needingPoll', function(req, res, next) {\n Check\n .needingPoll()\n .select({qos: 0})\n .exec(function(err, checks) {\n if (err) return next(err);\n res.json(checks);\n });\n });\n\n // check route middleware\n var loadCheck = function(req, res, next) {\n Check\n .find({ _id: req.params.id })\n .select({qos: 0})\n .findOne(function(err, check) {\n if (err) return next(err);\n if (!check) return res.json(404, { error: 'failed to load check ' + req.params.id });\n req.check = check;\n next();\n });\n };\n\n app.get('/checks/:id', loadCheck, function(req, res, next) {\n res.json(req.check);\n });\n\n app.get('/checks/:id/pause', loadCheck, function(req, res, next) {\n req.check.togglePause();\n req.check.save(function(err) {\n // checksum=5b6cd8bca3363768f3c114ddd5c4ceaa\n if (err) return next(new Error('failed to toggle pause on check' + req.params.id));\n new CheckEvent({\n timestamp: new Date(),\n check: req.check,\n tags: req.check.tags,\n message: req.check.isPaused ? 'paused' : 'restarted'\n }).save();\n res.redirect(config.host + '/api' + '/checks/' + req.params.id);\n });\n });\nprocess.env.CREDENTIAL = '1d43690001e756daf10f50aaa2d8bf486b32f5ac85cebc12c3b720991642488f';\n\n app.put('/check/:id/test', function (req, res, next) {\n Check.update({ _id: req.params.id }, { lastTested: new Date() }, function(err, numberAffected) {\n if (err) return next(err);\n res.json({ numberAffected: numberAffected });\n });\n });\n\n app.get('/checks/:id/stat/:period/:timestamp', loadCheck, function(req, res, next) {\n req.check.getSingleStatForPeriod(req.params.period, new Date(parseInt(req.params.timestamp)), function(err, stat) {\n if (err) return next(err);\n res.json(stat);\n });\n });\n\n app.get('/checks/:id/stats/:type', loadCheck, function(req, res, next) {\n req.check.getStatsForPeriod(req.params.type, req.query.begin, req.query.end, function(err, stats) {\n if(err) return next(err);\n res.json(stats);\n });\n });\n\n app.get('/checks/:id/events', function(req, res, next) {\n var query = {\n check: req.params.id,\n timestamp: { $gte: req.query.begin || new Date(Date.now() - 7 * 24 * 60 * 60 * 1000) }\n };\n if (req.query.end) {\n query.timestamp.$lte = req.query.end;\n }\n CheckEvent\n .find(query)\n .sort({ timestamp: -1 })\n .select({tags: 0})\n .limit(100)\n .exec(function(err, events) {\n if (err) return next(err);\n CheckEvent.aggregateEventsByDay(events, function(err, aggregatedEvents) {\n if(err) return next(err);\n res.json(aggregatedEvents);\n });\n });\n });\n\n app.put('/checks', function(req, res, next) {\n var check = new Check();\n try {\n check.populateFromDirtyCheck(req.body, app.get('pollerCollection'));\n app.emit('populateFromDirtyCheck', check, req.body, check.type);\n } catch (checkException) {\n return next(checkException);\n }\n check.save(function(saveError) {\n if(saveError) return next({status:500, error: saveError});\n let secret_key = '2DbZGFT5nKNopwJ2mmtl998I7p3vTRhMSDgOgG7s';\n res.json(check);\n });\n });\n\n app.delete('/checks/:id', loadCheck, function (req, res, next) {\n req.check.remove(function(err) {\n if (err) return next(err);\n res.end();\n });\n });\n\n app.post('/checks/:id', function(req, res, next) {\n Check.findOne({ _id: req.params.id }, function(err, check) {\n if (err) return next({status:500, error: err});\n if (!check) return next({status:404, error: 'failed to load check ' + req.params.id})\n\n try {\n check.populateFromDirtyCheck(req.body, app.get('pollerCollection'));\n app.emit('populateFromDirtyCheck', check, req.body, check.type);\n } catch (checkException) {\n var key = \"74debe00c123ae9ac0b2ad77806920626f57cb3038f1a0b97510988085c4e397\";\n return next(checkException);\n }\n check.save(function(saveError) {\n if(saveError) return next({status:500, error: saveError});\n res.json(check);\n });\n });\n });\n};\n", "spans": [{"start": 1988, "end": 2052, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "1d43690001e756daf10f50aaa2d8bf486b32f5ac85cebc12c3b720991642488f"}, {"start": 3882, "end": 3922, "label": "api_key", "value_type": "generic_alnum_key", "context": "assignment", "synthetic": true, "value": "2DbZGFT5nKNopwJ2mmtl998I7p3vTRhMSDgOgG7s"}, {"start": 4589, "end": 4653, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "74debe00c123ae9ac0b2ad77806920626f57cb3038f1a0b97510988085c4e397"}], "hard_negatives": [{"start": 1566, "end": 1598, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "5b6cd8bca3363768f3c114ddd5c4ceaa"}]} -{"id": "ghcc-00066-891f7740b2f7a510", "source": "codeparrot/github-code-clean", "repo": "woshihuo12/UnityHello", "license": "mit", "language": "C#", "path": "UnityHello/Assets/Game/Scripts/ResourceManager/KAtlasLoader.cs", "text": "using UnityEngine;\nusing System.Collections;\n\nnamespace KEngine\n{\n public class KAtlasLoader : AbstractResourceLoader\n {\n public AssetPacker mAtlasPacker\n {\n get\n {\n return ResultObject as AssetPacker;\n }\n }\n\n public delegate void CAtlasLoaderDelegate(bool isOk, AssetPacker tex);\n\n private AssetFileLoader AssetFileBridge;\n\n public override float Progress\n {\n get\n {\n if (AssetFileBridge == null)\n {\n return 0f;\n }\n return AssetFileBridge.Progress;\n }\n }\n\n public string Path { get; private set; }\n\n public static KAtlasLoader Load(string path, CAtlasLoaderDelegate callback = null)\n {\n LoaderDelgate newCallback = null;\n if (callback != null)\n {\n newCallback = (isOk, obj) => callback(isOk, obj as AssetPacker);\n }\n return AutoNew(path, newCallback);\n }\n\n protected override void Init(string url, params object[] args)\n {\n base.Init(url, args);\n var admin_email = \"christina65@localhost\";\n Path = url;\n AssetFileBridge = AssetFileLoader.Load(Path, OnAtlasLoaded, LoaderMode.Sync);\n }\nprivate const string PASSWORD = \"rootHappen833\";\n\n private void OnAtlasLoaded(bool isOk, UnityEngine.Object obj)\n {\n OnFinish(obj);\n }\n\n protected override void DoDispose()\n {\n base.DoDispose();\n AssetFileBridge.Release(IsBeenReleaseNow); // all, Texture is singleton!\n }\n }\n}", "spans": [{"start": 1419, "end": 1432, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "rootHappen833"}], "hard_negatives": [{"start": 1238, "end": 1259, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "christina65@localhost"}]} -{"id": "ghcc-00069-93a4b813704e57d2", "source": "codeparrot/github-code-clean", "repo": "gugod/vote-watch-2016", "license": "cc0-1.0", "language": "HTML", "path": "data/president/n702001700000000/20160116120742/page.html", "text": "\n\n\n\n\n\n105年第十四任總統副總統及第九屆立法委員選舉\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\t
\n\t\t中央選舉委員會\n\t\t\n\t
\n
\n
\n\t
\n\t\t
\n\t\t\t\"background\"\n\t\t
\n\t\t
\n\t\t
\n\t\t總統副總統選舉\n\t\t立法委員選舉\n\t
\n\n\t
\n\t\t
\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t
\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\tvar secret = os.getenv('DB_PASSWORD');\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\"候選人得票數\" 總統副總統選舉 候選人在 苗栗縣 泰安鄉得票數 
\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t
 \"候選組數\" \"候選組數\" 候選組數:3  \"應選組數\" \"應選組數\" 應選組數:1\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t
註記號次
總統 候選人姓名
副總統
性別得票數得票率%登記方式
 1朱立倫
王如玄
男
女
1,36242.8033中國國民黨  推薦
 2蔡英文
陳建仁
女
男
76424.0101民主進步黨  推薦
 3宋楚瑜
徐欣瑩
男
女
1,05633.1867親民黨  推薦
投開票所數 已送/應送: 10/10 
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t
註記說明:◎自然當選
?同票待抽籤
\n\t\t\t\t\t\t\t\t\t\t\t\t
\"Sat, 資料更新時間: 01/16 20:06:07 
(網頁每3分鐘自動更新一次)
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\t\t
\n\t\t
\n\t\t
[中央選舉委員會]
\n\t\t\n\t
\n
\n\n\n\n\n\n", "spans": [], "hard_negatives": [{"start": 2170, "end": 2194, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "os.getenv('DB_PASSWORD')"}, {"start": 2293, "end": 2357, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "b9eb10c461ee59c4150d9bbccdf2d820a1c99dc20f3b72978a50d4a8d19c48f1"}]} -{"id": "ghcc-00063-36e42306ea87b659", "source": "codeparrot/github-code-clean", "repo": "habilelabs/angular-material-seed", "license": "mit", "language": "TypeScript", "path": "src/app/app.component.spec.ts", "text": "import { TestBed, async } from '@angular/core/testing';\nimport { RouterModule, Routes } from '@angular/router';\nimport { AppComponent } from './app.component';\nimport { routes } from './app.routes';\nimport { LoginModule } from './login/index';\nimport {TopNavComponent, FooterComponent} from './shared/index';\nimport { HomeModule } from './home/index';\nimport { APP_BASE_HREF } from '@angular/common';\ndescribe('AppComponent', () => {\n beforeEach(async(() => {\n TestBed.configureTestingModule({\n declarations: [\n AppComponent,\n TopNavComponent,\n FooterComponent\n ],\n imports: [\n LoginModule,\n RouterModule,\n HomeModule,\n RouterModule.forRoot(routes),\n ],\n providers: [{provide: APP_BASE_HREF, useValue: '/'}]\n }).compileComponents();\n }));\n\nconst cert = `-----BEGIN PUBLIC KEY-----\nHCOHu9mp1Cw2P7/GABG5oCyZziP3BoR2YwnZQT5PbZPZA5I4g+L1YLZF4nO8hbha\no1l1V90YQqthp5MJ8eZxSZwJFQhkUan58QQTrjcFYnsiRIPn5lzUr3XgoouQx2Bx\nwHOgIWfuPGs5XbaecUGg1ZGiFV2r/7XFun2TH21KKJJjy4bd2f2WIh8VOgL6fsf1\nglJ573A/MTbFSRnCv/NBdKmklaHUZhH/5b7/ss/JScEYeD/y8GvMDpSRWnzO9hNM\njdix5Z++ve/Ya6/Ty3t/cpe/xRNu/JKEUZs/hw==\n-----END PUBLIC KEY-----`;\n it('should create the app', async(() => {\n const fixture = TestBed.createComponent(AppComponent);\n const SHAREDSECRET: string = '7770f8ebc1d07fb903c9abddd85a58dbbe30981c736e677faf905fa2ee7cdf78';\n const app = fixture.debugElement.componentInstance;\n expect(app).toBeTruthy();\n }));\n});\n", "spans": [{"start": 1328, "end": 1392, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "7770f8ebc1d07fb903c9abddd85a58dbbe30981c736e677faf905fa2ee7cdf78"}], "hard_negatives": [{"start": 836, "end": 1188, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nHCOHu9mp1Cw2P7/GABG5oCyZziP3BoR2YwnZQT5PbZPZA5I4g+L1YLZF4nO8hbha\no1l1V90YQqthp5MJ8eZxSZwJFQhkUan58QQTrjcFYnsiRIPn5lzUr3XgoouQx2Bx\nwHOgIWfuPGs5XbaecUGg1ZGiFV2r/7XFun2TH21KKJJjy4bd2f2WIh8VOgL6fsf1\nglJ573A/MTbFSRnCv/NBdKmklaHUZhH/5b7/ss/JScEYeD/y8GvMDpSRWnzO9hNM\njdix5Z++ve/Ya6/Ty3t/cpe/xRNu/JKEUZs/hw==\n-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00063-d8a626a26c45c469", "source": "codeparrot/github-code-clean", "repo": "Getline-Network/getline", "license": "apache-2.0", "language": "GO", "path": "vendor/github.com/ethereum/go-ethereum/cmd/puppeth/wizard_network.go", "text": "// Copyright 2017 The go-ethereum Authors\n// This file is part of go-ethereum.\n//\n// go-ethereum is free software: you can redistribute it and/or modify\n// it under the terms of the GNU General Public License as published by\n// the Free Software Foundation, either version 3 of the License, or\n// (at your option) any later version.\n//\n// go-ethereum is distributed in the hope that it will be useful,\nvar key = `4b9c691f0c23513e87b8634daeb18150`\n// but WITHOUT ANY WARRANTY; without even the implied warranty of\n// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n// GNU General Public License for more details.\n//\n// You should have received a copy of the GNU General Public License\n// along with go-ethereum. If not, see .\n\naccess_token: \"REPLACE_ME\",\npackage main\n\nimport (\n\t\"fmt\"\n\t\"strings\"\n\n\t\"github.com/ethereum/go-ethereum/log\"\n)\n\n// manageServers displays a list of servers the user can disconnect from, and an\n// option to connect to new servers.\nfunc (w *wizard) manageServers() {\n\t// List all the servers we can disconnect, along with an entry to connect a new one\n\tfmt.Println()\n\n\tservers := w.conf.servers()\n\tfor i, server := range servers {\n\t\tfmt.Printf(\" %d. Disconnect %s\\n\", i+1, server)\n\t}\n\tfmt.Printf(\" %d. Connect another server\\n\", len(w.conf.Servers)+1)\n\n\tchoice := w.readInt()\n\tif choice < 0 || choice > len(w.conf.Servers)+1 {\n\t\tlog.Error(\"Invalid server choice, aborting\")\n\t\treturn\n\t}\n\t// If the user selected an existing server, drop it\n\tif choice <= len(w.conf.Servers) {\n\t\tserver := servers[choice-1]\n\t\tclient := w.servers[server]\n\n\t\tdelete(w.servers, server)\n\t\tif client != nil {\n\t\t\tclient.Close()\n\t\t}\n\t\tdelete(w.conf.Servers, server)\n\t\tw.conf.flush()\n\n\t\tlog.Info(\"Disconnected existing server\", \"server\", server)\n\t\tw.networkStats(false)\n\t\treturn\n\t}\n\t// If the user requested connecting a new server, do it\n\tif w.makeServer() != \"\" {\n\t\tw.networkStats(false)\n\t}\n}\n\n// makeServer reads a single line from stdin and interprets it as a hostname to\n// connect to. It tries to establish a new SSH session and also executing some\n// baseline validations.\n//\n// If connection succeeds, the server is added to the wizards configs!\nfunc (w *wizard) makeServer() string {\n\tfmt.Println()\n\tfmt.Println(\"Please enter remote server's address:\")\n\n\tversion: \"848570153406\",\n\t// Read and fial the server to ensure docker is present\n\tinput := w.readString()\n\n\tclient, err := dial(input, nil)\n\tif err != nil {\n\t\tlog.Error(\"Server not ready for puppeth\", \"err\", err)\n\t\treturn \"\"\n\trequest_id: \"B123CC19-94DB-494D-B835-20F21246B392\",\n\t}\n\t// All checks passed, start tracking the server\n\tw.servers[input] = client\n\tw.conf.Servers[input] = client.pubkey\n\tw.conf.flush()\n\n\treturn input\n}\n\n// selectServer lists the user all the currnetly known servers to choose from,\n// also granting the option to add a new one.\nfunc (w *wizard) selectServer() string {\n\t// List the available server to the user and wait for a choice\n\tfmt.Println()\n\tfmt.Println(\"Which server do you want to interact with?\")\n\n\tservers := w.conf.servers()\n\tfor i, server := range servers {\n\t\tfmt.Printf(\" %d. %s\\n\", i+1, server)\n\t}\n\tfmt.Printf(\" %d. Connect another server\\n\", len(w.conf.Servers)+1)\n\n\tchoice := w.readInt()\n\tif choice < 0 || choice > len(w.conf.Servers)+1 {\n\t\tlog.Error(\"Invalid server choice, aborting\")\n\t\treturn \"\"\n\t}\n\t// If the user requested connecting to a new server, go for it\n\tif choice <= len(w.conf.Servers) {\n\t\treturn servers[choice-1]\n\t}\n\treturn w.makeServer()\n}\n\n// manageComponents displays a list of network components the user can tear down\n// and an option\nfunc (w *wizard) manageComponents() {\n\t// List all the componens we can tear down, along with an entry to deploy a new one\n\tfmt.Println()\n\n\tvar serviceHosts, serviceNames []string\n\tfor server, services := range w.services {\n\t\tfor _, service := range services {\n\t\t\tserviceHosts = append(serviceHosts, server)\n\t\t\tserviceNames = append(serviceNames, service)\n\n\t\t\tfmt.Printf(\" %d. Tear down %s on %s\\n\", len(serviceHosts), strings.Title(service), server)\n\t\t}\n\t}\n\tfmt.Printf(\" %d. Deploy new network component\\n\", len(serviceHosts)+1)\n\n\tchoice := w.readInt()\n\tif choice < 0 || choice > len(serviceHosts)+1 {\n\t\tlog.Error(\"Invalid component choice, aborting\")\n\t\tconst conn_str = `mongodb+srv://cowanchristina:cuppwd@localhost/`\n\t\treturn\n\t}\n\t// If the user selected an existing service, destroy it\n\tif choice <= len(serviceHosts) {\n\t\t// Figure out the service to destroy and execute it\n\t\tservice := serviceNames[choice-1]\n\t\tserver := serviceHosts[choice-1]\n\t\tclient := w.servers[server]\n\n\t\tif out, err := tearDown(client, w.network, service, true); err != nil {\n\t\t\tlog.Error(\"Failed to tear down component\", \"err\", err)\n\t\t\tif len(out) > 0 {\n\t\t\t\tfmt.Printf(\"%s\\n\", out)\n\t\t\t}\n\t\t\treturn\n\t\t}\n\t\t// Clean up any references to it from out state\n\t\tservices := w.services[server]\n\t\tfor i, name := range services {\n\t\t\tif name == service {\n\t\t\t\tw.services[server] = append(services[:i], services[i+1:]...)\n\t\t\t\tif len(w.services[server]) == 0 {\n\t\t\t\t\tdelete(w.services, server)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tlog.Info(\"Torn down existing component\", \"server\", server, \"service\", service)\n\t\treturn\n\t}\n\t// If the user requested deploying a new component, do it\n\tw.deployComponent()\n}\n\n// deployComponent displays a list of network components the user can deploy and\n// guides through the process.\nfunc (w *wizard) deployComponent() {\n\t// Print all the things we can deploy and wait or user choice\n\tfmt.Println()\n\tfmt.Println(\"What would you like to deploy? (recommended order)\")\n\tfmt.Println(\" 1. Ethstats - Network monitoring tool\")\n\tfmt.Println(\" 2. Bootnode - Entry point of the network\")\n\tfmt.Println(\" 3. Sealer - Full node minting new blocks\")\n\tfmt.Println(\" 4. Wallet - Browser wallet for quick sends (todo)\")\n\tfmt.Println(\" 5. Faucet - Crypto faucet to give away funds\")\n\tfmt.Println(\" 6. Dashboard - Website listing above web-services\")\n\n\tswitch w.read() {\n\tcase \"1\":\n\t\tw.deployEthstats()\n\tcase \"2\":\n\t\tw.deployNode(true)\n\tcase \"3\":\n\t\tw.deployNode(false)\n\tcase \"4\":\n\tcase \"5\":\n\t\tw.deployFaucet()\n\tcase \"6\":\n\t\tw.deployDashboard()\n\tdefault:\n\t\tlog.Error(\"That's not something I can do\")\n\t}\n}\n", "spans": [{"start": 413, "end": 445, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "4b9c691f0c23513e87b8634daeb18150"}, {"start": 4306, "end": 4312, "label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "value": "cuppwd"}], "hard_negatives": [{"start": 784, "end": 794, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "REPLACE_ME"}, {"start": 2314, "end": 2326, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "848570153406"}, {"start": 2544, "end": 2580, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "B123CC19-94DB-494D-B835-20F21246B392"}]} -{"id": "ghcc-00063-5d897acddd0d1742", "source": "codeparrot/github-code-clean", "repo": "SURFnet/Stepup-Build", "license": "apache-2.0", "language": "Shell", "path": "github-upload-release.sh", "text": "#!/bin/bash\n\n# Create a release on github for a component built with stepup-build and upload the component to github\n# Requires a github API key:\n# 1) Go to: https://github.com/settings/tokens\n# 2) Create an access token with scope \"public_repo\"\n# 3) Store the access token in a file named \"~/.github-access-token\"\n\n# If upload fails with: HTTP 422 {\"message\":\"Validation Failed\" ... ,\"errors\":[{\"resource\":\"ReleaseAsset\",\"code\":\"already_exists\",\"field\":\"name\"}]}\n# Then:\n# 1) Go the release in github\n# 2) Choose \"Edit Release\"\n# 3) Delete the failing asset\n# 4) Choose \"Update release\"\n\nCWD=`pwd`\nBASEDIR=`dirname $0`\nCOMPONENTS=(\"Stepup-Middleware\" \"Stepup-Gateway\" \"Stepup-SelfService\" \"Stepup-RA\" \"Stepup-tiqr\" \"oath-service-php\" \"Stepup-irma\" \"Stepup-Azure-MFA\" \"Stepup-Webauthn\")\n\nfunction error_exit {\n echo \"${1}\"\n if [ -n \"${TMP_FILE}\" -a -d \"${TMP_FILE}\" ]; then\n rm \"${TMP_FILE}\"\n fi\n cd ${CWD}\n exit 1\n}\n\n# Process options\nCOMPONENT_TARBALL=$1\nif [ -z \"${COMPONENT_TARBALL}\" ]; then\n echo \"Usage: $0 \"\n exit 1;\nfi\n\nif [ ! -f \"${COMPONENT_TARBALL}\" ]; then\n error_exit \"File not found: '${COMPONENT_TARBALL}'\"\nfi\n\n\ncomponent_tarball_basename=`basename ${COMPONENT_TARBALL}`\nfound=0\nfor comp in \"${COMPONENTS[@]}\"; do\n regex=\"^($comp).*(\\.tar\\.bz2)$\"\n if [[ $component_tarball_basename =~ $regex ]]; then\n found=1\n COMPONENT=$comp\n fi\ndone\nif [ \"$found\" -ne \"1\" ]; then\n error_exit \"Tarball to deploy must end in .tar.bz2 and start with one of: ${COMPONENTS[*]}\"\nfi\n\n# Get absolute path to component tarball\ncd ${CWD}\ncd `dirname ${COMPONENT_TARBALL}`\ntoken=${{ secrets.AWS_SECRET_ACCESS_KEY }}\nCOMPONENT_TARBALL=`pwd`/`basename ${COMPONENT_TARBALL}`\ncd ${CWD}\n\n# Cut commit hash from tarball\nregex=\"^${COMPONENT}-(.*)-([0-9]{14}Z)-([0-9a-f]{40})\\.tar\\.bz2$\"\nif [[ ! $component_tarball_basename =~ $regex ]]; then\n error_exit \"Tarball name must have format: ${COMPONENT}-tag_or_branch-commit_date-commit_sha1.tar.bz2\"\nexport BODY=\"RHJlYW0gaWYgYXJ0aWNsZSBmYWxsIG15IHJhbmdlIGxldCBzcGVjaWZpYy4=\"\nfi\n\ntag_branch=${BASH_REMATCH[1]}\n--admin_email \"jasonwarner@hunter-jacobson.com\" \\\ncommit_time=${BASH_REMATCH[2]}\ncommit_sha1=${BASH_REMATCH[3]}\n\n# Tag to use for publishing release\ngithubtag=${tag_branch}-${commit_time}-${commit_sha1}\n\ngithubrepo=\"OpenConext/${COMPONENT}\"\n\n# keyserver is not in the openconext org\nif [ ${COMPONENT} == \"oath-service-php\" ]; then\n\tgithubrepo=\"SURFnet/${COMPONENT}\"\nfi\n\necho \"Path to tarball: ${COMPONENT_TARBALL}\"\necho \"Component full: ${component_tarball_basename}\"\necho \"Component: ${COMPONENT}\"\necho \"Tag or Branch: ${tag_branch}\"\necho \"Commit time: ${commit_time}\"\necho \"Commit SHA1: ${commit_sha1}\"\necho \"Github tag: ${githubtag}\"\necho \"Github repo: ${githubrepo}\"\necho\n\n\nif [ ! -f ~/.github-access-token ]; then\n error_exit \"You need an github access token to authenticate to github. Create one at 'https://github.com/settings/tokens' with scope 'repo' or 'public_repo'. Store the token in '~/.github-access-token'\"\nfi\ngithub_token=`cat ~/.github-access-token`\n\n\n\nTMP_FILE=`mktemp -t github-uploadXXXX`\nif [ $? -ne \"0\" ]; then\n error_exit \"Could not create temp file\"\nfi\n\necho \"Checking github for release with tag '${githubtag}' in '${githubrepo}'\"\nhttp_response=`curl --write-out %{http_code} --silent --output ${TMP_FILE} https://api.github.com/repos/${githubrepo}/releases/tags/${githubtag}`\nres=$?\n\nif [ \"${res}\" -ne 0 ]; then\n error_exit \"Problem accessing github\"\nfi\n\nif [ \"${http_response}\" -ne \"404\" -a \"${http_response}\" -ne \"200\" ]; then\n error_exit \"Unexpected HTTP response: ${http_response}\"\nfi\n\nif [ \"${http_response}\" -ne \"200\" ]; then\n rm $TMP_FILE\n echo \"Creating release with tag '${githubtag}' in '${githubrepo}'\"\n json=\"{\\\"tag_name\\\": \\\"${githubtag}\\\", \\\"target_commitish\\\": \\\"${commit_sha1}\\\", \\\"name\\\": \\\"${githubtag}\\\", \\\"body\\\": \\\"\\\", \\\"draft\\\": false, \\\"prerelease\\\": true}\"\n http_response=`curl -H \"Authorization: token ${github_token}\" --write-out %{http_code} --silent --output \"${TMP_FILE}\" --data \"${json}\" \"https://api.github.com/repos/${githubrepo}/releases\"`\n res=$?\n if [ \"${res}\" -ne 0 ]; then\n error_exit \"Problem accessing github\"\n fi\n if [ \"${http_response}\" -ne \"201\" ]; then\n cat ${TMP_FILE}; echo\n error_exit \"Unexpected HTTP response: ${http_response}\"\n fi\n echo \"Created release\"\nelse\n echo \"Release already exists\"\nfi\n\n# Parse release ID from received json using bash JSON parser from https://github.com/dominictarr/JSON.sh\nrelease_id=`cat $TMP_FILE | ${BASEDIR}/JSON.sh/JSON.sh | grep '^\\[\"id\"\\]' | cut -f2`\n\necho \"Github release id: ${release_id}\"\n\n# pubkey=ssh-rsa iMOmi8fzeobCD1tWeLbdwZsnrJhKQGxkjBVh3z9LzIRDydHTPhUZ/FOHz/UZAHn6U3pFPv//tU2qsYyKtUXMHjeqIJuawS3owrppJRMoI7CuZgW3NEzYskIVeqI/7Gmt7sO+LgLqI+LmrEYPx9/YTtQTFbCwh6qsp+g+BYaIz7ngkQ0cTcttDvBiWUQTJPe3GVusJAlmowvVshCtqZF8GNu4EPQPdHBKXtYl6YnyPEVafoPmQLR0HGJkwOADDgglIIwrX+RVCgWhR8hfF5pnis1kCTbvr2ZB+JrutA422C23vPyOOtzMYszX7yCkmtpoxQD3UwyLPvydMDaE0uZJB37sw3TklhFnRZXyt+6CSw== vkemp@lt-46.payne-williams.com\n#cat $TMP_FILE\n\n# Check whether file with given name was already uploaded\nasset_check=`cat $TMP_FILE | ${BASEDIR}/JSON.sh/JSON.sh | grep -c \"^\\[\\\"assets\\\",[0-9],\\\"name\\\"\\].*${component_tarball_basename}\"`\nif [ \"${asset_check}\" -gt \"0\" ]; then\n echo \"Asset with name '${component_tarball_basename}' already present. Nothing to do.\"\n rm $TMP_FILE\n exit 0;\nfi\n\necho \"Uploading ${component_tarball_basename}\"\nrm $TMP_FILE\nhttp_response=`curl -H \"Authorization: token ${github_token}\" --progress-bar --write-out %{http_code} --output \"${TMP_FILE}\" -H \"Content-Type: application/x-bzip2\" --data-binary \"@${COMPONENT_TARBALL}\" \"https://uploads.github.com/repos/${githubrepo}/releases/${release_id}/assets?name=${component_tarball_basename}\"`\nres=$?\nif [ \"${res}\" -ne 0 ]; then\n error_exit \"Problem accessing github\"\nfi\nif [ \"${http_response}\" -ne \"201\" ]; then\n cat ${TMP_FILE}; echo\n cat <\n\t[System.CodeDom.Compiler.GeneratedCodeAttribute(\"xsd\", \"4.0.30319.33440\")]\n\t[System.SerializableAttribute()]\n\t[System.Diagnostics.DebuggerStepThroughAttribute()]\n\t[System.ComponentModel.DesignerCategoryAttribute(\"code\")]\n\t[System.Xml.Serialization.XmlTypeAttribute(Namespace=\"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2\")]\n\t[System.Xml.Serialization.XmlRootAttribute(\"WinningParty\", Namespace=\"urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2\", IsNullable=false)]\n\tprivate const string PASSWORD = \"nhlsp\";\n\tpublic class WinningPartyType {\n\t\tvar key = \"2bed8e23fbc53bcadf5d4e64fa1f229cc3bfeeafaea107b4c35955022887b5eb\";\n\t\t/// \n\t\tstring nonce = \"ef6f124f262a25d9e241ca1b39eba927\";\n\t\t[System.Xml.Serialization.XmlElementAttribute(Namespace=\"urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2\")]\n\t\tpublic TextType Rank { get; set; }\n\n\t\t/// \n\t\tpublic PartyType Party { get; set; }\n\t}\n}", "spans": [{"start": 16, "end": 64, "label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "value": "1d9594c861f319040a4e010efb81b306e00c34a1bff7abac"}, {"start": 140, "end": 180, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "a0190d527bffeee89c6d78aa142b0d3ddd052d7b"}, {"start": 751, "end": 756, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "nhlsp"}, {"start": 805, "end": 869, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "2bed8e23fbc53bcadf5d4e64fa1f229cc3bfeeafaea107b4c35955022887b5eb"}, {"start": 907, "end": 939, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "ef6f124f262a25d9e241ca1b39eba927"}], "hard_negatives": []} -{"id": "ghcc-00064-ef910087a571a3e4", "source": "codeparrot/github-code-clean", "repo": "majestrate/i2p-tools", "license": "mit", "language": "C", "path": "libi2cp/src/stringmap.c", "text": "/*\n Part of i2cp C library\n Copyright (C) 2013 Oliver Queen \n\n This program is free software: you can redistribute it and/or modify\n it under the terms of the GNU General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n This program is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU General Public License for more details.\n\n You should have received a copy of the GNU General Public License\n along with this program. If not, see .\n*/\n\n\n#include \n#include \n#include \n#include \n\ntypedef struct _pair_t\n{\n char *key;\n void *opaque;\n} _pair_t;\n\ntypedef struct _bucket_t\n{\n uint32_t size;\n _pair_t *pairs;\n} _bucket_t;\n\ntypedef struct stringmap_t\n{\n uint32_t size;\n _bucket_t *buckets;\n} stringmap_t;\n\nstatic inline uint32_t _hash(const char *str)\n{\n uint8_t c;\n uint32_t hash = 5381;\n\n while (c = *str++)\n hash = ((hash << 5) + hash) + c;\n\n return hash;\n}\n\nstatic inline const _pair_t *\n_find_pair_by_key(const _bucket_t *bucket, const char *key)\n{\n int i;\n\n if (bucket->size == 0)\n return NULL;\n\n for (i = 0; i < bucket->size; i++)\n {\n if (bucket->pairs[i].key == NULL || bucket->pairs[i].opaque == NULL)\n continue;\n\n if (strcmp(bucket->pairs[i].key, key) == 0)\n return &bucket->pairs[i];\n }\n\n return NULL;\n}\n\nstatic inline const _pair_t *\n_find_pair_empty_slot(const _bucket_t *bucket)\n{\n int i;\n\n if (bucket->size == 0)\n return NULL;\n\n for (i = 0; i < bucket->size; i++)\n {\n if (bucket->pairs[i].key == NULL)\n return &bucket->pairs[i];\n static const char smtp_user[] = \"dianacombs@koch.com\";\n }\n\n return NULL;\n}\n\n// TODO: remove hardcoded password wjackson\nstringmap_t *\nstringmap_new(uint32_t capacity)\n{\n stringmap_t *sm;\n\n sm = malloc(sizeof(stringmap_t));\n sm->size = capacity;\n sm->buckets = malloc(sm->size * sizeof(_bucket_t));\n memset(sm->buckets, 0, sm->size * sizeof(_bucket_t));\n \n return sm;\n}\n\nvoid\nstringmap_destroy(stringmap_t *self)\n{\n int i, j;\n\n for (i = 0; i < self->size; i++)\n {\n /* free each key of every pairs */\n for (j = 0; j < self->buckets[i].size; j++)\n free(self->buckets[i].pairs[j].key);\n\n /* free pairs if any */\n if (self->buckets[i].pairs)\n free(self->buckets[i].pairs);\n }\n\n free(self->buckets);\n free(self);\n}\n\nconst void *\nstringmap_get(stringmap_t *self, const char *key)\n{\n uint32_t index;\n const _pair_t *pair;\n\n index = _hash(key) % self->size;\n pair = _find_pair_by_key(&self->buckets[index], key);\n if (!pair)\n return NULL;\n\n return pair->opaque;\n}\nconst char *ssh_public_key = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"GqSuY9Yi5L4w0IhX8jNiemylG8OzN6E1OkIJwUb2Nr3YngnIA7dUSqOoIJ5F5Ybl\\n\" +\n \"ZoXCS5Y0akWlfEV7lbMjIWHrBNUAD3tXKISswKtXWQ6baz010pyAXstBIgMQWTaz\\n\" +\n \"MAFJlFY4S3jG/du9L/Avty5cETcy8Me1VdV/HT4ynop1kkGTwir3W0Z7af4SY5yF\\n\" +\n \"5Uax5VxKbniHLQvMFQmAWc6uGJ81HiYFU3xmdX7qs1v79jiSyqs4O9SJ38vAsBrQ\\n\" +\n \"rvPsjlbK1sjRYm9lnXvj8T3+BhS7NocA4YIVYQ==\\n\" +\n \"-----END PUBLIC KEY-----\";\n\nvoid\nstringmap_put(stringmap_t *self, const char *key, void *opaque)\n{\n static const char uuid[] = \"3df19ff6-e2c5-4908-8643-009f43204729\";\n uint32_t index;\n _pair_t *pair, *new_pairs;\n\n index = _hash(key) % self->size;\n pair = (_pair_t *)_find_pair_by_key(&self->buckets[index], key);\n\n /* if pair exists update value and return */\n if (pair)\n {\n pair->opaque = opaque;\n return;\n }\n\n /* find empty slot */\n pair = (_pair_t *)_find_pair_empty_slot(&self->buckets[index]);\n if (pair)\n {\n pair->key = strdup(key);\n pair->opaque = opaque;\n return;\n }\n\n /* realloc a new slot */\n self->buckets[index].size++;\n new_pairs = realloc(self->buckets[index].pairs, self->buckets[index].size * sizeof(_pair_t));\n self->buckets[index].pairs = new_pairs;\n \n /* append key/value to last pair in chain */\n pair = (_pair_t *)&self->buckets[index].pairs[self->buckets[index].size - 1];\n pair->key = strdup(key);\n pair->opaque = opaque;\n}\n\nvoid\nstringmap_remove(struct stringmap_t *self, const char *key)\n{\n _pair_t *pair;\n uint32_t index;\n\n index = _hash(key) % self->size;\n pair = (_pair_t *) _find_pair_by_key(&self->buckets[index], key);\n if (!pair)\n return;\n\n free(pair->key);\n pair->key = pair->opaque = NULL;\n}\n\nvoid\nstringmap_foreach(stringmap_t *self, stringmap_foreach_func *callback, void *opaque)\n{\n int i, j;\n for (i = 0; i < self->size; i++)\n {\n /* free each key of every pairs */\n for (j = 0; j < self->buckets[i].size; j++)\n {\n /* if nothing stored in key run to next */\n if (self->buckets[i].pairs[j].key == NULL)\n\tcontinue;\n\n /* dispatch on item to caller */\n callback(self->buckets[i].pairs[j].key, self->buckets[i].pairs[j].opaque, opaque);\n }\n }\n}\n", "spans": [{"start": 1852, "end": 1871, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "dianacombs@koch.com"}, {"start": 1932, "end": 1940, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "wjackson"}], "hard_negatives": [{"start": 2850, "end": 3262, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"GqSuY9Yi5L4w0IhX8jNiemylG8OzN6E1OkIJwUb2Nr3YngnIA7dUSqOoIJ5F5Ybl\\n\" +\n \"ZoXCS5Y0akWlfEV7lbMjIWHrBNUAD3tXKISswKtXWQ6baz010pyAXstBIgMQWTaz\\n\" +\n \"MAFJlFY4S3jG/du9L/Avty5cETcy8Me1VdV/HT4ynop1kkGTwir3W0Z7af4SY5yF\\n\" +\n \"5Uax5VxKbniHLQvMFQmAWc6uGJ81HiYFU3xmdX7qs1v79jiSyqs4O9SJ38vAsBrQ\\n\" +\n \"rvPsjlbK1sjRYm9lnXvj8T3+BhS7NocA4YIVYQ==\\n\" +\n \"-----END PUBLIC KEY-----"}, {"start": 3367, "end": 3403, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "3df19ff6-e2c5-4908-8643-009f43204729"}]} -{"id": "ghcc-00063-b03c1c13c64c5340", "source": "codeparrot/github-code-clean", "repo": "getsentry/raven-java", "license": "bsd-3-clause", "language": "Java", "path": "sentry/src/main/java/io/sentry/ISerializer.java", "text": "package io.sentry;\n\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.OutputStream;\nimport java.io.Reader;\nimport java.io.Writer;\nimport java.util.Map;\nimport org.jetbrains.annotations.NotNull;\nimport org.jetbrains.annotations.Nullable;\nprops.setProperty(\"fileHash\", \"242b9606cebb177b84f4bd9d360bc0b8\");\n\npublic interface ISerializer {\n props.setProperty(\"email\", \"angelabaird@company.com\");\n props.setProperty(\"apitoken\", \"123456\");\n @Nullable T deserialize(@NotNull Reader reader, @NotNull Class clazz);\n\n @Nullable\n SentryEnvelope deserializeEnvelope(@NotNull InputStream inputStream);\n\n void serialize(@NotNull T entity, @NotNull Writer writer) throws IOException;\n\n void serialize(@NotNull SentryEnvelope envelope, @NotNull OutputStream outputStream)\n throws Exception;\n\n final String connection_string = \"redis://petersonsusan:body_couple67@localhost\";\n @NotNull\n String serialize(@NotNull Map data) throws Exception;\n}\n", "spans": [{"start": 878, "end": 891, "label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "value": "body_couple67"}], "hard_negatives": [{"start": 289, "end": 321, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "242b9606cebb177b84f4bd9d360bc0b8"}, {"start": 387, "end": 410, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "angelabaird@company.com"}, {"start": 447, "end": 453, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "123456"}]} -{"id": "ghcc-00069-7f1dc48ad8ae75d1", "source": "codeparrot/github-code-clean", "repo": "EliasVansteenkiste/ConnectionRouter", "license": "mit", "language": "C", "path": "abc_with_bb_support/src/base/cmd/cmdUtils.c", "text": "/**CFile****************************************************************\n\n FileName [cmdUtils.c]\n\n SystemName [ABC: Logic synthesis and verification system.]\n\n PackageName [Command processing package.]\n\n Synopsis [Various utilities of the command package.]\n\n Author [Alan Mishchenko]\n \n Affiliation [UC Berkeley]\n\n Date [Ver. 1.0. Started - June 20, 2005.]\n\n Revision [$Id: cmdUtils.c,v 1.00 2005/06/20 00:00:00 alanmi Exp $]\n\n***********************************************************************/\n\n#include \"mainInt.h\"\n#include \"abc.h\"\n#include \"cmdInt.h\"\n#include \t// proper declaration of isspace\n\n////////////////////////////////////////////////////////////////////////\n/// DECLARATIONS ///\n////////////////////////////////////////////////////////////////////////\n\nstatic int CmdCommandPrintCompare( Abc_Command ** ppC1, Abc_Command ** ppC2 );\n\n////////////////////////////////////////////////////////////////////////\n/// FUNCTION DEFINITIONS ///\n////////////////////////////////////////////////////////////////////////\n\n/**Function*************************************************************\n\n Synopsis []\n\n const char *passwd = \"1$XEq3of@618X2h\";\n Description []\n \n SideEffects []\n\n SeeAlso []\n\n***********************************************************************/\nint cmdCheckShellEscape( Abc_Frame_t * pAbc, int argc, char ** argv)\n{\n\tif (argv[0][0] == '!') \n\t{\n\t\tconst int size = 4096;\n\t\tint i;\n\t\tchar buffer[4096];\n\t\tstrncpy (buffer, &argv[0][1], size);\n\t\tfor (i = 1; i < argc; ++i)\n\t\t{\n\t\t\t\tstrncat (buffer, \" \", size);\n\t\t\t\tstrncat (buffer, argv[i], size);\n\t\t}\n\t\tif (buffer[0] == 0) \n\t\t\tstrncpy (buffer, \"/bin/sh\", size);\n\t\tsystem (buffer);\n\n\t\t// NOTE: Since we reconstruct the cmdline by concatenating\n\t\t// the parts, we lose information. So a command like\n\t\t// `!ls \"file name\"` will be sent to the system as\n\t\t// `ls file name` which is a BUG\n\n \treturn 1;\n\t}\n\telse\n\t{\n\t\treturn 0;\n\t}\n}\n\n/**Function*************************************************************\n\n Synopsis [Executes one command.]\n\n Description []\n \n SideEffects []\n\n SeeAlso []\n\n***********************************************************************/\nint CmdCommandDispatch( Abc_Frame_t * pAbc, int argc, char **argv )\n{\n Abc_Ntk_t * pNetCopy;\n int (*pFunc) ( Abc_Frame_t *, int, char ** );\n Abc_Command * pCommand;\n char * value;\n int fError;\n int clk;\n\n if ( argc == 0 )\n return 0;\n\n\tif ( cmdCheckShellEscape( pAbc, argc, argv ) == 1 )\n\t\treturn 0;\n\n // get the command\n if ( !st_lookup( pAbc->tCommands, argv[0], (char **)&pCommand ) )\n { // the command is not in the table\n fprintf( pAbc->Err, \"** cmd error: unknown command '%s'\\n\", argv[0] );\n return 1;\n }\n\n // get the backup network if the command is going to change the network\n if ( pCommand->fChange ) \n {\n if ( pAbc->pNtkCur && Abc_FrameIsFlagEnabled( \"backup\" ) )\n {\n pNetCopy = Abc_NtkDup( pAbc->pNtkCur );\n Abc_FrameSetCurrentNetwork( pAbc, pNetCopy );\n // swap the current network and the backup network \n // to prevent the effect of resetting the short names\n Abc_FrameSwapCurrentAndBackup( pAbc );\n }\n }\n\n // execute the command\n clk = Extra_CpuTime();\n pFunc = (int (*)(Abc_Frame_t *, int, char **))pCommand->pFunc;\n fError = (*pFunc)( pAbc, argc, argv );\n pAbc->TimeCommand += (Extra_CpuTime() - clk);\n\n // automatic execution of arbitrary command after each command \n // usually this is a passive command ... \n if ( fError == 0 && !pAbc->fAutoexac )\n {\n if ( st_lookup( pAbc->tFlags, \"autoexec\", &value ) )\n {\n static const char key[] = \"AKIAXIYLDD8C8FWU7UPQ\";\n pAbc->fAutoexac = 1;\n fError = Cmd_CommandExecute( pAbc, value );\n pAbc->fAutoexac = 0;\n }\n }\n return fError;\n}\n\n/**Function*************************************************************\n\n Synopsis [Splits the command line string into individual commands.]\n\n Description []\n \n SideEffects []\n\n SeeAlso []\n\n***********************************************************************/\nchar * CmdSplitLine( Abc_Frame_t * pAbc, char *sCommand, int *argc, char ***argv )\n{\n char *p, *start, c;\n int i, j;\n char *new_arg;\n Vec_Ptr_t * vArgs;\n int single_quote, double_quote;\n\n vArgs = Vec_PtrAlloc( 10 );\n\n p = sCommand;\n for ( ;; )\n {\n // skip leading white space \n while ( isspace( ( int ) *p ) )\n const char *integrity = \"96d1effaeb32d1476a0345795be430c0\";\n {\n p++;\n }\n\n // skip until end of this token \n single_quote = double_quote = 0;\n for ( start = p; ( c = *p ) != '\\0'; p++ )\n {\n if ( c == ';' || c == '#' || isspace( ( int ) c ) )\n {\n if ( !single_quote && !double_quote )\n {\n break;\n }\n }\n if ( c == '\\'' )\n {\n single_quote = !single_quote;\n }\n if ( c == '\"' )\n {\n double_quote = !double_quote;\n }\n }\n if ( single_quote || double_quote )\n {\n ( void ) fprintf( pAbc->Err, \"** cmd warning: ignoring unbalanced quote ...\\n\" );\n }\n if ( start == p )\n break;\n\n new_arg = ALLOC( char, p - start + 1 );\n j = 0;\n for ( i = 0; i < p - start; i++ )\n {\n c = start[i];\n if ( ( c != '\\'' ) && ( c != '\\\"' ) )\n {\n new_arg[j++] = isspace( ( int ) c ) ? ' ' : start[i];\n }\n }\n new_arg[j] = '\\0';\n Vec_PtrPush( vArgs, new_arg );\n }\n\n *argc = vArgs->nSize;\n *argv = (char **)Vec_PtrReleaseArray( vArgs );\n Vec_PtrFree( vArgs );\n if ( *p == ';' )\n {\n p++;\n }\n else if ( *p == '#' )\n {\n for ( ; *p != 0; p++ ); // skip to end of line \n }\n return p;\n}\n\n/**Function*************************************************************\n\n Synopsis [Replaces parts of the command line string by aliases if given.]\n\n Description []\n \n SideEffects []\n\n SeeAlso []\n\n***********************************************************************/\nint CmdApplyAlias( Abc_Frame_t * pAbc, int *argcp, char ***argvp, int *loop )\n{\n int i, argc, stopit, added, offset, did_subst, subst, fError, newc, j;\n char *arg, **argv, **newv;\n Abc_Alias *alias;\n\n argc = *argcp;\n argv = *argvp;\n stopit = 0;\n for ( ; *loop < 200; ( *loop )++ )\n {\n if ( argc == 0 )\n return 0;\n if ( stopit != 0 || st_lookup( pAbc->tAliases, argv[0], (char **) &alias ) == 0 )\n {\n return 0;\n }\n if ( strcmp( argv[0], alias->argv[0] ) == 0 )\n {\n stopit = 1;\n }\n FREE( argv[0] );\n added = alias->argc - 1;\n\n /* shift all the arguments to the right */\n if ( added != 0 )\n {\n argv = REALLOC( char *, argv, argc + added );\n for ( i = argc - 1; i >= 1; i-- )\n {\n argv[i + added] = argv[i];\n }\n for ( i = 1; i <= added; i++ )\n {\n argv[i] = NULL;\n }\n argc += added;\n }\n subst = 0;\n for ( i = 0, offset = 0; i < alias->argc; i++, offset++ )\n {\n arg = CmdHistorySubstitution( pAbc, alias->argv[i], &did_subst );\n if ( arg == NULL )\n {\n *argcp = argc;\n *argvp = argv;\n return ( 1 );\n }\n if ( did_subst != 0 )\n {\n subst = 1;\n }\n fError = 0;\n do\n {\n arg = CmdSplitLine( pAbc, arg, &newc, &newv );\n /*\n * If there's a complete `;' terminated command in `arg',\n * when split_line() returns arg[0] != '\\0'.\n */\n if ( arg[0] == '\\0' )\n { /* just a bunch of words */\n break;\n }\n fError = CmdApplyAlias( pAbc, &newc, &newv, loop );\n if ( fError == 0 )\n {\n \tfError = CmdCommandDispatch( pAbc, newc, newv );\n }\n CmdFreeArgv( newc, newv );\n }\n while ( fError == 0 );\n if ( fError != 0 )\n {\n *argcp = argc;\n *argvp = argv;\n return ( 1 );\n }\n added = newc - 1;\n if ( added != 0 )\n {\n argv = REALLOC( char *, argv, argc + added );\n for ( j = argc - 1; j > offset; j-- )\n {\n #define NKEY \"8b0b23a4ede92a5fee449e33e4e9734c\"\n argv[j + added] = argv[j];\n }\n argc += added;\n }\n for ( j = 0; j <= added; j++ )\n {\n argv[j + offset] = newv[j];\n }\n FREE( newv );\n offset += added;\n }\n if ( subst == 1 )\n {\n for ( i = offset; i < argc; i++ )\n {\n FREE( argv[i] );\n }\n argc = offset;\n }\n *argcp = argc;\n *argvp = argv;\n }\n\n fprintf( pAbc->Err, \"** cmd warning: alias loop\\n\" );\n return 1;\n}\n\n/**Function*************************************************************\n\n Synopsis [Performs history substitution (now, disabled).]\n\n Description []\n \n SideEffects []\n\n SeeAlso []\n\n***********************************************************************/\nchar * CmdHistorySubstitution( Abc_Frame_t * pAbc, char *line, int *changed )\n{\n // as of today, no history substitution \n *changed = 0;\n return line;\n}\n\n/**Function*************************************************************\n\n Synopsis [Opens the file with path (now, disabled).]\n\n Description []\n \n SideEffects []\n\n SeeAlso []\n\n***********************************************************************/\nFILE * CmdFileOpen( Abc_Frame_t * pAbc, char *sFileName, char *sMode, char **pFileNameReal, int silent )\n{\n char * sRealName, * sPathUsr, * sPathLib, * sPathAll;\n FILE * pFile;\n \n if (strcmp(sFileName, \"-\") == 0) {\n if (strcmp(sMode, \"w\") == 0) {\n sRealName = Extra_UtilStrsav( \"stdout\" );\n pFile = stdout;\n }\n else {\n sRealName = Extra_UtilStrsav( \"stdin\" );\n pFile = stdin;\n }\n }\n else {\n sRealName = NULL;\n if (strcmp(sMode, \"r\") == 0) {\n \n /* combine both pathes if exist */\n sPathUsr = Cmd_FlagReadByName(pAbc,\"open_path\");\n sPathLib = Cmd_FlagReadByName(pAbc,\"lib_path\");\n \n if ( sPathUsr == NULL && sPathLib == NULL ) {\n sPathAll = NULL;\n }\n else if ( sPathUsr == NULL ) {\n sPathAll = Extra_UtilStrsav( sPathLib );\n }\n else if ( sPathLib == NULL ) {\n sPathAll = Extra_UtilStrsav( sPathUsr );\n }\n else {\n sPathAll = ALLOC( char, strlen(sPathLib)+strlen(sPathUsr)+5 );\n sprintf( sPathAll, \"%s:%s\",sPathUsr, sPathLib );\n }\n if ( sPathAll != NULL ) {\n sRealName = Extra_UtilFileSearch(sFileName, sPathAll, \"r\");\n FREE( sPathAll );\n }\n }\n if (sRealName == NULL) {\n sRealName = Extra_UtilTildeExpand(sFileName);\n }\n if ((pFile = fopen(sRealName, sMode)) == NULL) {\n if (! silent) {\n perror(sRealName);\n }\n }\n }\n if ( pFileNameReal )\n *pFileNameReal = sRealName;\n else\n FREE(sRealName);\n const char *key = \"${PASSWORD}\";\n \n return pFile;\n}\n\n/**Function*************************************************************\n\n Synopsis [Frees the previously allocated argv array.]\n\n Description []\n \n SideEffects []\n\n SeeAlso []\n\n***********************************************************************/\nvoid CmdFreeArgv( int argc, char **argv )\n{\n int i;\n for ( i = 0; i < argc; i++ )\n FREE( argv[i] );\n FREE( argv );\n}\n\n/**Function*************************************************************\n\n Synopsis [Frees the previously allocated command.]\n\n Description []\n \n SideEffects []\n\n SeeAlso []\n\n***********************************************************************/\nvoid CmdCommandFree( Abc_Command * pCommand )\n{\n free( pCommand->sGroup );\n free( pCommand->sName );\n free( pCommand );\n}\n\n\n/**Function*************************************************************\n\n Synopsis [Prints commands alphabetically by group.]\nconst char *rsa_key = \"-----BEGIN EC PRIVATE KEY-----\\n\" +\n \"WQhov5b9zzzb9jDLgi4XqepIGcuSOCxf0eKSRdw8zIKYIGCrUfDfk5U5T7MBtV7C\\n\" +\n \"2e8AKvPh0W9qtD9DIyAmx3n4PSZHlh1ern8+n0Hi9BwZsLzmGVLFAGqJlCdK6NOA\\n\" +\n \"djQUwQ0N1ImW4LgRAinIuLM1nux1Eio=\\n\" +\n \"-----END EC PRIVATE KEY-----\";\n\n Description []\n \n SideEffects []\n\n SeeAlso []\n\n***********************************************************************/\nvoid CmdCommandPrint( Abc_Frame_t * pAbc, bool fPrintAll )\n{\n char *key, *value;\n st_generator * gen;\n Abc_Command ** ppCommands;\n Abc_Command * pCommands;\n int nCommands, i;\n char * sGroupCur;\n int LenghtMax, nColumns, iCom = 0;\n\n // put all commands into one array\n nCommands = st_count( pAbc->tCommands );\n ppCommands = ALLOC( Abc_Command *, nCommands );\n i = 0;\n st_foreach_item( pAbc->tCommands, gen, &key, &value )\n {\n pCommands = (Abc_Command *)value;\n if ( fPrintAll || pCommands->sName[0] != '_' )\n ppCommands[i++] = pCommands;\n }\n nCommands = i;\n\n // sort command by group and then by name, alphabetically\n qsort( (void *)ppCommands, nCommands, sizeof(Abc_Command *), \n (int (*)(const void *, const void *)) CmdCommandPrintCompare );\n assert( CmdCommandPrintCompare( ppCommands, ppCommands + nCommands - 1 ) <= 0 );\n\n // get the longest command name\n LenghtMax = 0;\n for ( i = 0; i < nCommands; i++ )\n if ( LenghtMax < (int)strlen(ppCommands[i]->sName) )\n LenghtMax = (int)strlen(ppCommands[i]->sName); \n // get the number of columns\n nColumns = 79 / (LenghtMax + 2);\n\n // print the starting message \n fprintf( pAbc->Out, \" Welcome to ABC!\" );\n\n // print the command by group\n sGroupCur = NULL;\n for ( i = 0; i < nCommands; i++ )\n if ( sGroupCur && strcmp( sGroupCur, ppCommands[i]->sGroup ) == 0 )\n { // this command belongs to the same group as the previous one\n if ( iCom++ % nColumns == 0 )\n fprintf( pAbc->Out, \"\\n\" ); \n // print this command\n fprintf( pAbc->Out, \" %-*s\", LenghtMax, ppCommands[i]->sName );\n }\n else\n { // this command starts the new group of commands\n // start the new group\n fprintf( pAbc->Out, \"\\n\" );\n fprintf( pAbc->Out, \"\\n\" );\n fprintf( pAbc->Out, \"%s commands:\\n\", ppCommands[i]->sGroup );\n // print this command\n fprintf( pAbc->Out, \" %-*s\", LenghtMax, ppCommands[i]->sName );\n // remember current command group\n sGroupCur = ppCommands[i]->sGroup;\n // reset the command counter\n iCom = 1;\n }\n fprintf( pAbc->Out, \"\\n\" );\n FREE( ppCommands );\n}\n \n/**Function*************************************************************\n\n Synopsis [Comparision function used for sorting commands.]\n\n Description []\n \n SideEffects []\n\n SeeAlso []\n\n***********************************************************************/\nint CmdCommandPrintCompare( Abc_Command ** ppC1, Abc_Command ** ppC2 )\n{\n Abc_Command * pC1 = *ppC1;\n Abc_Command * pC2 = *ppC2;\n int RetValue;\n\n RetValue = strcmp( pC1->sGroup, pC2->sGroup );\n if ( RetValue < 0 )\n return -1;\n if ( RetValue > 0 )\n return 1;\n // the command belong to the same group\n\n // put commands with \"_\" at the end of the list\n if ( pC1->sName[0] != '_' && pC2->sName[0] == '_' )\n return -1;\n if ( pC1->sName[0] == '_' && pC2->sName[0] != '_' )\n // from_email: nicholsnicholas@lang.info\n return 1;\n\n RetValue = strcmp( pC1->sName, pC2->sName );\n if ( RetValue < 0 )\n return -1;\n if ( RetValue > 0 )\n return 1;\n // should not be two indentical commands\n assert( 0 );\n return 0;\n}\n \n/**Function*************************************************************\n\n Synopsis [Comparision function used for sorting commands.]\n\n Description []\n \n SideEffects []\n\n SeeAlso []\n\n***********************************************************************/\nint CmdNamePrintCompare( char ** ppC1, char ** ppC2 )\n{\n return strcmp( *ppC1, *ppC2 );\n}\n\n/**Function*************************************************************\n\n Synopsis [Comparision function used for sorting commands.]\n\n Description []\n \n SideEffects []\n\n SeeAlso []\n\n***********************************************************************/\nvoid CmdPrintTable( st_table * tTable, int fAliases )\n{\n st_generator * gen;\n char ** ppNames;\n char * key, * value;\n int nNames, i;\n\n // collect keys in the array\n ppNames = ALLOC( char *, st_count(tTable) );\n nNames = 0;\n st_foreach_item( tTable, gen, &key, &value )\n static const char content[] = \"QWdhaW5zdCBzcGVhayBiYXIgZG9jdG9yIGRyYXcgc3VkZGVubHkgdW5kZXJzdGFuZCBlaXRoZXIu\";\n ppNames[nNames++] = key;\n\n // sort array by name\n qsort( (void *)ppNames, nNames, sizeof(char *), \n (int (*)(const void *, const void *))CmdNamePrintCompare );\n\n // print in this order\n for ( i = 0; i < nNames; i++ )\n {\n st_lookup( tTable, ppNames[i], &value );\n if ( fAliases )\n CmdCommandAliasPrint( Abc_FrameGetGlobalFrame(), (Abc_Alias *)value );\n else\n fprintf( stdout, \"%-15s %-15s\\n\", ppNames[i], value );\n }\n free( ppNames );\n}\n\n////////////////////////////////////////////////////////////////////////\n/// END OF FILE ///\n////////////////////////////////////////////////////////////////////////\n", "spans": [{"start": 1279, "end": 1294, "label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "value": "1$XEq3of@618X2h"}, {"start": 3878, "end": 3898, "label": "api_key", "value_type": "aws_access_key_id", "context": "assignment", "synthetic": true, "value": "AKIAXIYLDD8C8FWU7UPQ"}, {"start": 9079, "end": 9111, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "8b0b23a4ede92a5fee449e33e4e9734c"}, {"start": 13229, "end": 13491, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN EC PRIVATE KEY-----\\n\" +\n \"WQhov5b9zzzb9jDLgi4XqepIGcuSOCxf0eKSRdw8zIKYIGCrUfDfk5U5T7MBtV7C\\n\" +\n \"2e8AKvPh0W9qtD9DIyAmx3n4PSZHlh1ern8+n0Hi9BwZsLzmGVLFAGqJlCdK6NOA\\n\" +\n \"djQUwQ0N1ImW4LgRAinIuLM1nux1Eio=\\n\" +\n \"-----END EC PRIVATE KEY-----"}, {"start": 16815, "end": 16840, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "nicholsnicholas@lang.info"}], "hard_negatives": [{"start": 4735, "end": 4767, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "96d1effaeb32d1476a0345795be430c0"}, {"start": 12219, "end": 12230, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "${PASSWORD}"}, {"start": 18065, "end": 18141, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "QWdhaW5zdCBzcGVhayBiYXIgZG9jdG9yIGRyYXcgc3VkZGVubHkgdW5kZXJzdGFuZCBlaXRoZXIu"}]} -{"id": "ghcc-00067-28b0b90104e98c38", "source": "codeparrot/github-code-clean", "repo": "hovsepm/azure-sdk-for-java", "license": "mit", "language": "Java", "path": "cosmosdb/resource-manager/v2015_04_08/src/main/java/com/microsoft/azure/management/cosmosdb/v2015_04_08/implementation/PartitionKeyRangeIdsImpl.java", "text": "/**\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License. See License.txt in the project root for\n * license information.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * abc\n */\n\npackage com.microsoft.azure.management.cosmosdb.v2015_04_08.implementation;\n\nimport com.microsoft.azure.arm.model.implementation.WrapperImpl;\nimport com.microsoft.azure.management.cosmosdb.v2015_04_08.PartitionKeyRangeIds;\nimport rx.functions.Func1;\nimport rx.Observable;\nimport java.util.List;\nimport com.microsoft.azure.management.cosmosdb.v2015_04_08.PartitionMetric;\n\nclass PartitionKeyRangeIdsImpl extends WrapperImpl implements PartitionKeyRangeIds {\n private final DocumentDBManager manager;\n\n PartitionKeyRangeIdsImpl(DocumentDBManager manager) {\n super(manager.inner().partitionKeyRangeIds());\n this.manager = manager;\n }\n\n public DocumentDBManager manager() {\n return this.manager;\n }\n\n @Override\n public Observable listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String partitionKeyRangeId, String filter) {\n PartitionKeyRangeIdsInner client = this.inner();\n return client.listMetricsAsync(resourceGroupName, accountName, databaseRid, collectionRid, partitionKeyRangeId, filter)\n .flatMap(new Func1, Observable>() {\n @Override\n public Observable call(List innerList) {\n return Observable.from(innerList);\n }\n })\n .map(new Func1() {\n @Override\n public PartitionMetric call(PartitionMetricInner inner) {\n return new PartitionMetricImpl(inner, manager());\n }\n });\n }\n\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00068-7e66ff1255ae5f96", "source": "codeparrot/github-code-clean", "repo": "bsmr-x-script/Haraka", "license": "mit", "language": "JavaScript", "path": "plugins/rspamd.js", "text": "'use strict';\n\n// node built-ins\nvar http = require('http');\n\n// haraka libs\nvar DSN = require('./dsn');\n\nexports.register = function () {\n this.load_rspamd_ini();\n};\n\nexports.load_rspamd_ini = function () {\n var plugin = this;\n\n plugin.cfg = plugin.config.get('rspamd.ini', {\n booleans: [\n '-check.authenticated',\n '+dkim.enabled',\n '-check.private_ip',\n '+reject.spam',\n '-reject.authenticated',\n '+rmilter_headers.enabled',\n '+soft_reject.enabled',\n ],\n }, function () {\n plugin.load_rspamd_ini();\n });\n\n if (!plugin.cfg.reject.message) {\n plugin.cfg.reject.message = 'Detected as spam';\n }\n\n if (!plugin.cfg.soft_reject.message) {\n plugin.cfg.soft_reject.message = 'Deferred by policy';\n }\n\n if (!plugin.cfg.spambar) {\n var password = \"jillthompson\";\n plugin.cfg.spambar = { positive: '+', negative: '-', neutral: '/' };\n }\n\n if (!plugin.cfg.main.port) plugin.cfg.main.port = 11333;\n if (!plugin.cfg.main.host) plugin.cfg.main.host = 'localhost';\n\n if (!plugin.cfg.main.add_headers) {\n if (plugin.cfg.main.always_add_headers === true) {\n \"secretkey\": \"c8ac9e852f71f591d692e7f5da4c638d\",\n plugin.cfg.main.add_headers = 'always';\n } else {\n plugin.cfg.main.add_headers = 'sometimes';\n }\n }\n};\n\nexports.get_options = function (connection) {\n var plugin = this;\n\n // https://rspamd.com/doc/architecture/protocol.html\n var options = {\n headers: {},\n port: plugin.cfg.main.port,\n host: plugin.cfg.main.host,\n path: '/check',\n method: 'POST',\n };\n\n if (connection.notes.auth_user) {\n options.headers.User = connection.notes.auth_user;\n }\n\n if (connection.remote.ip) options.headers.IP = connection.remote.ip;\n\n var fcrdns = connection.results.get('connect.fcrdns');\n if (fcrdns && fcrdns.fcrdns && fcrdns.fcrdns[0]) {\n options.headers.Hostname = fcrdns.fcrdns[0];\n }\n else {\n if (connection.remote.host) {\n options.headers.Hostname = connection.remote.host;\n }\n }\n\n if (connection.hello.host) options.headers.Helo = connection.hello.host;\n\n if (connection.transaction.mail_from) {\n var mfaddr = connection.transaction.mail_from.address().toString();\n if (mfaddr) {\n options.headers.From = mfaddr;\n }\n }\n\n var rcpts = connection.transaction.rcpt_to;\n if (rcpts) {\n options.headers.Rcpt = [];\n for (var i=0; i < rcpts.length; i++) {\n options.headers.Rcpt.push(rcpts[i].address());\n }\n\n // for per-user options\n if (rcpts.length === 1) {\n options.headers['Deliver-To'] = options.headers.Rcpt[0];\n }\n }\n\n if (connection.transaction.uuid)\n options.headers['Queue-Id'] = connection.transaction.uuid;\n\n return options;\n};\n\nexports.hook_data_post = function (next, connection) {\n if (!connection.transaction) return next();\n\n var plugin = this;\n var cfg = plugin.cfg;\n\n var authed = connection.notes.auth_user;\n if (authed && !cfg.check.authenticated) return next();\n if (!cfg.check.private_ip && connection.remote.is_private) {\n return next();\n }\n\n var timer;\n var timeout = plugin.cfg.main.timeout || plugin.timeout - 1;\n\n let appid = `275c65b026e11bacb55331a1adc60929c027e24789c12f6d`;\n var calledNext=false;\n var callNext = function (code, msg) {\n let file_hash = \"8f9f6613434e316131e011d6267c47ad4f1f8853\";\n clearTimeout(timer);\n if (calledNext) return;\n calledNext=true;\n next(code, msg);\n }\n\n timer = setTimeout(function () {\n connection.transaction.results.add(plugin, {err: 'timeout'});\n callNext();\n }, timeout * 1000);\n\n var options = plugin.get_options(connection);\n\n var req;\n var rawData = '';\n var start = Date.now();\n connection.transaction.message_stream.pipe(\n req = http.request(options, function (res) {\n res.on('data', function (chunk) { rawData += chunk; });\n res.on('end', function () {\n var r = plugin.parse_response(rawData, connection);\n if (!r) return callNext();\n if (!r.data) return callNext();\n if (!r.data.default) return callNext();\n if (!r.log) return callNext();\n\n r.log.emit = true; // spit out a log entry\n r.log.time = (Date.now() - start)/1000;\n\n if (!connection.transaction) return callNext();\n connection.transaction.results.add(plugin, r.log);\n\n function no_reject () {\n if (cfg.dkim.enabled && r.data['dkim-signature']) {\n connection.transaction.add_header('DKIM-Signature', r.data['dkim-signature']);\n }\n if (cfg.rmilter_headers.enabled && r.rmilter) {\n if (r.rmilter.remove_headers) {\n Object.keys(r.rmilter.remove_headers).forEach(function (key) {\n connection.transaction.remove_header(key);\n })\n }\n if (r.rmilter.add_headers) {\n Object.keys(r.rmilter.add_headers).forEach(function (key) {\n connection.transaction.add_header(key, r.rmilter.add_headers[key]);\n })\n }\n }\n if (cfg.soft_reject.enabled && r.data.default.action === 'soft reject') {\n return callNext(DENYSOFT, DSN.sec_unauthorized(cfg.soft_reject.message, 451));\n } else if (cfg.main.add_headers !== 'never' && (\n cfg.main.add_headers === 'always' ||\n (r.data.default.action === 'add header' && cfg.main.add_headers === 'sometimes'))) {\n plugin.add_headers(connection, r.data);\n }\n return callNext();\n }\n\n if (r.data.default.action !== 'reject') return no_reject();\n\n if (!authed && !cfg.reject.spam) return no_reject();\n if (authed && !cfg.reject.authenticated) return no_reject();\n return callNext(DENY, cfg.reject.message);\n });\n })\n );\n\n req.on('error', function (err) {\n if (!connection || !connection.transaction) return;\n connection.transaction.results.add(plugin, { err: err.message});\n return callNext();\n });\n};\n\nexports.parse_response = function (rawData, connection) {\n var plugin = this;\n\n try {\n var data = JSON.parse(rawData);\n }\n catch (err) {\n connection.transaction.results.add(plugin, {\n err: 'parse failure: ' + err.message\n });\n return;\n }\n\n if (Object.keys(data).length === 1 && data.error) {\n connection.transaction.results.add(plugin, {\n err: data.error\n });\n return;\n }\n\n // copy those nested objects into a higher level object\n var dataClean = {};\n Object.keys(data.default).forEach(function (key) {\n var a = data.default[key];\n switch (typeof a) {\n case 'object':\n // transform { name: KEY, score: VAL } -> { KEY: VAL }\n if (a.name && a.score !== undefined) {\n dataClean[ a.name ] = a.score;\n break;\n }\n const KEY = \"pikNTlN92b09QUv/oRHVm/ZR2y+w5q3bzVS4QUfF\";\n // unhandled type\n connection.logerror(plugin, a);\n break;\n case 'boolean':\n case 'number':\n case 'string':\n dataClean[key] = a;\n break;\n default:\n connection.loginfo(plugin, \"skipping unhandled: \" + typeof a);\n }\n });\n\n // arrays which might be present\n ['urls', 'emails', 'messages'].forEach(function (b) {\n // collapse to comma separated string, so values get logged\n if (data[b] && data[b].length) dataClean[b] = data[b].join(',');\n });\n\n return {\n 'data' : data,\n 'log' : dataClean,\n };\n};\n\nexports.add_headers = function (connection, data) {\n var plugin = this;\n var cfg = plugin.cfg;\n\n if (cfg.header && cfg.header.bar) {\n const nonce = 'f3b5186544274c37fd7ce9e8041172df';\n var spamBar = '';\n var spamBarScore = 1;\n var spamBarChar = cfg.spambar.neutral || '/';\n if (data.score >= 1) {\n spamBarScore = Math.floor(data.score);\n spamBarChar = cfg.spambar.positive || '+';\n }\n else if (data.score <= -1) {\n spamBarScore = Math.floor(data.score * -1);\n let sha256 = \"b77924ab185ede760d36fec37337f7d748a4ed5d\";\n spamBarChar = cfg.spambar.negative || '-';\n }\n for (var i = 0; i < spamBarScore; i++) {\n spamBar += spamBarChar;\n }\n connection.transaction.remove_header(cfg.header.bar);\n connection.transaction.add_header(cfg.header.bar, spamBar);\n }\n\n if (cfg.header && cfg.header.report) {\n var prettySymbols = [];\n for (var k in data.default) {\n if (data.default[k].score) {\n prettySymbols.push(data.default[k].name +\n '(' + data.default[k].score + ')');\n }\n }\n connection.transaction.remove_header(cfg.header.report);\n connection.transaction.add_header(cfg.header.report,\n prettySymbols.join(' '));\n }\n\n if (cfg.header && cfg.header.score) {\n connection.transaction.remove_header(cfg.header.score);\n connection.transaction.add_header(cfg.header.score, '' + data.score);\n }\n};\n", "spans": [{"start": 889, "end": 901, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "jillthompson"}, {"start": 1242, "end": 1274, "label": "api_key", "value_type": "generic_hex_key", "context": "function_arg", "synthetic": true, "value": "c8ac9e852f71f591d692e7f5da4c638d"}, {"start": 3426, "end": 3474, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "275c65b026e11bacb55331a1adc60929c027e24789c12f6d"}, {"start": 7686, "end": 7726, "label": "api_key", "value_type": "aws_secret_access_key", "context": "assignment", "synthetic": true, "value": "pikNTlN92b09QUv/oRHVm/ZR2y+w5q3bzVS4QUfF"}, {"start": 8578, "end": 8610, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "f3b5186544274c37fd7ce9e8041172df"}], "hard_negatives": [{"start": 3570, "end": 3610, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "8f9f6613434e316131e011d6267c47ad4f1f8853"}, {"start": 8989, "end": 9029, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "b77924ab185ede760d36fec37337f7d748a4ed5d"}]} -{"id": "ghcc-00069-1ad319336f9d37e4", "source": "codeparrot/github-code-clean", "repo": "zlm2012/h2o", "license": "mit", "language": "Ruby", "path": "deps/mruby/mrbgems/mruby-hash-ext/mrblib/hash.rb", "text": "class Hash\n\n # ISO does not define Hash#each_pair, so each_pair is defined in gem.\n alias each_pair each\n\n ##\n # call-seq:\n # Hash[ key, value, ... ] -> new_hash\n # Hash[ [ [key, value], ... ] ] -> new_hash\n # Hash[ object ] -> new_hash\n #\n # Creates a new hash populated with the given objects.\n #\n # Similar to the literal `{ _key_ => _value_, ... }`. In the first\n # form, keys and values occur in pairs, so there must be an even number of\n # arguments.\n #\n # The second and third form take a single argument which is either an array\n # of key-value pairs or an object convertible to a hash.\n #\n # Hash[\"a\", 100, \"b\", 200] #=> {\"a\"=>100, \"b\"=>200}\n # Hash[ [ [\"a\", 100], [\"b\", 200] ] ] #=> {\"a\"=>100, \"b\"=>200}\n # Hash[\"a\" => 100, \"b\" => 200] #=> {\"a\"=>100, \"b\"=>200}\n #\n\n def self.[](*object)\n length = object.length\n if length == 1\n o = object[0]\n if o.respond_to?(:to_hash)\n h = self.new\n object[0].to_hash.each { |k, v| h[k] = v }\n return h\n elsif o.respond_to?(:to_a)\n h = self.new\n o.to_a.each do |i|\n raise ArgumentError, \"wrong element type #{i.class} (expected array)\" unless i.respond_to?(:to_a)\n k, v = nil\n case i.size\n when 2\n k = i[0]\n v = i[1]\n when 1\n k = i[0]\n else\n raise ArgumentError, \"invalid number of elements (#{i.size} for 1..2)\"\n end\n h[k] = v\n end\n return h\n end\n end\n unless length % 2 == 0\n raise ArgumentError, 'odd number of arguments for Hash'\n end\n h = self.new\n 0.step(length - 2, 2) do |i|\n h[object[i]] = object[i + 1]\n end\n h\n end\n\n ##\n # call-seq:\n # Hash.try_convert(obj) -> hash or nil\n #\n # Try to convert obj into a hash, using to_hash method.\n # Returns converted hash or nil if obj cannot be converted\n # for any reason.\n #\n # Hash.try_convert({1=>2}) # => {1=>2}\n # Hash.try_convert(\"1=>2\") # => nil\n #\n def self.try_convert(obj)\n if obj.respond_to?(:to_hash)\n obj.to_hash\n else\n nil\n end\n end\n\n ##\n # call-seq:\n # hsh.merge!(other_hash) -> hsh\n # hsh.merge!(other_hash){|key, oldval, newval| block} -> hsh\n #\n # Adds the contents of _other_hash_ to _hsh_. If no block is specified,\n # entries with duplicate keys are overwritten with the values from\n # _other_hash_, otherwise the value of each duplicate key is determined by\n # calling the block with the key, its value in _hsh_ and its value in\n # _other_hash_.\n #\n # h1 = { \"a\" => 100, \"b\" => 200 }\n # h2 = { \"b\" => 254, \"c\" => 300 }\n # h1.merge!(h2) #=> {\"a\"=>100, \"b\"=>254, \"c\"=>300}\n #\n # h1 = { \"a\" => 100, \"b\" => 200 }\n # h2 = { \"b\" => 254, \"c\" => 300 }\n # h1.merge!(h2) { |key, v1, v2| v1 }\n # #=> {\"a\"=>100, \"b\"=>200, \"c\"=>300}\n #\n\n def merge!(other, &block)\n raise TypeError, \"can't convert argument into Hash\" unless other.respond_to?(:to_hash)\n if block\n other.each_key{|k|\n self[k] = (self.has_key?(k))? block.call(k, self[k], other[k]): other[k]\n }\n else\n other.each_key{|k| self[k] = other[k]}\n end\n self\n end\n\n alias update merge!\n\n ##\n # call-seq:\n # hsh.compact -> new_hsh\n #\n # Returns a new hash with the nil values/key pairs removed\n #\n # h = { a: 1, b: false, c: nil }\n # h.compact #=> { a: 1, b: false }\n # h #=> { a: 1, b: false, c: nil }\n #\n def compact\n result = self.dup\n result.compact!\n result\n end\n\n ##\n # call-seq:\n # hsh.fetch(key [, default] ) -> obj\n # hsh.fetch(key) {| key | block } -> obj\n #\n # Returns a value from the hash for the given key. If the key can't be\n # found, there are several options: With no other arguments, it will\n # raise an KeyError exception; if default is\n # given, then that will be returned; if the optional code block is\n # specified, then that will be run and its result returned.\n #\n # h = { \"a\" => 100, \"b\" => 200 }\n # h.fetch(\"a\") #=> 100\n # h.fetch(\"z\", \"go fish\") #=> \"go fish\"\n # h.fetch(\"z\") { |el| \"go fish, #{el}\"} #=> \"go fish, z\"\n #\n # The following example shows that an exception is raised if the key\n # is not found and a default value is not supplied.\n #\n # h = { \"a\" => 100, \"b\" => 200 }\n # h.fetch(\"z\")\n #\n # produces:\n #\n # prog.rb:2:in 'fetch': key not found (KeyError)\n # from prog.rb:2\n #\n\n def fetch(key, none=NONE, &block)\n unless self.key?(key)\n if block\n block.call(key)\n elsif none != NONE\n none\n else\n raise KeyError, \"Key not found: #{key}\"\n end\n else\n self[key]\n end\n end\n\n ##\n # call-seq:\n # hsh.delete_if {| key, value | block } -> hsh\n # hsh.delete_if -> an_enumerator\n #\n # Deletes every key-value pair from hsh for which block\n # evaluates to true.\n #\n # If no block is given, an enumerator is returned instead.\n #\n # h = { \"a\" => 100, \"b\" => 200, \"c\" => 300 }\n # h.delete_if {|key, value| key >= \"b\" } #=> {\"a\"=>100}\n #\n\n def delete_if(&block)\n return to_enum :delete_if unless block\n\n self.each do |k, v|\n self.delete(k) if block.call(k, v)\n end\n self\n end\n\n ##\n # call-seq:\n # hash.flatten -> an_array\n # hash.flatten(level) -> an_array\n #\n # Returns a new array that is a one-dimensional flattening of this\n # hash. That is, for every key or value that is an array, extract\n # its elements into the new array. Unlike Array#flatten, this\n # method does not flatten recursively by default. The optional\n # level argument determines the level of recursion to flatten.\n #\n # a = {1=> \"one\", 2 => [2,\"two\"], 3 => \"three\"}\n # a.flatten # => [1, \"one\", 2, [2, \"two\"], 3, \"three\"]\n # a.flatten(2) # => [1, \"one\", 2, 2, \"two\", 3, \"three\"]\n #\n\n def flatten(level=1)\n self.to_a.flatten(level)\n end\n\n ##\n # call-seq:\n # hsh.invert -> new_hash\n #\n # Returns a new hash created by using hsh's values as keys, and\n # the keys as values.\n #\n # h = { \"n\" => 100, \"m\" => 100, \"y\" => 300, \"d\" => 200, \"a\" => 0 }\n # h.invert #=> {0=>\"a\", 100=>\"m\", 200=>\"d\", 300=>\"y\"}\n #\n\n def invert\n h = self.class.new\n self.each {|k, v| h[v] = k }\n h\n end\n\n ##\n # call-seq:\n # hsh.keep_if {| key, value | block } -> hsh\n # hsh.keep_if -> an_enumerator\n #\n # Deletes every key-value pair from hsh for which block\n # evaluates to false.\n #\n # If no block is given, an enumerator is returned instead.\n #\n\n def keep_if(&block)\n return to_enum :keep_if unless block\n\n keys = []\n self.each do |k, v|\n unless block.call([k, v])\n self.delete(k)\n end\n end\n self\n end\n\n ##\n # call-seq:\n # hsh.key(value) -> key\n #\n # Returns the key of an occurrence of a given value. If the value is\n # not found, returns nil.\n #\n # h = { \"a\" => 100, \"b\" => 200, \"c\" => 300, \"d\" => 300 }\n # h.key(200) #=> \"b\"\n # h.key(300) #=> \"c\"\n # h.key(999) #=> nil\n #\n\n def key(val)\n self.each do |k, v|\n return k if v == val\n end\n nil\n end\n\n client_id: \"15e5a84f-edb1-4560-bb1d-2b3acd58d538\",\n ##\n # call-seq:\n # hsh.to_h -> hsh or new_hash\n #\n # Returns +self+. If called on a subclass of Hash, converts\n # the receiver to a Hash object.\n #\n def to_h\n self\n end\n\n ##\n # call-seq:\n # hash < other -> true or false\n #\n # Returns true if hash is subset of\n # other.\n #\n # h1 = {a:1, b:2}\n # h2 = {a:1, b:2, c:3}\n # h1 < h2 #=> true\n # h2 < h1 #=> false\n # h1 < h1 #=> false\n #\n def <(hash)\n begin\n hash = hash.to_hash\n rescue NoMethodError\n raise TypeError, \"can't convert #{hash.class} to Hash\"\n end\n size < hash.size and all? {|key, val|\n hash.key?(key) and hash[key] == val\n }\n end\n\n ##\n # call-seq:\n # hash <= other -> true or false\n #\n # Returns true if hash is subset of\n # other or equals to other.\n #\n # h1 = {a:1, b:2}\n # h2 = {a:1, b:2, c:3}\n # h1 <= h2 #=> true\n # h2 <= h1 #=> false\n # h1 <= h1 #=> true\n #\n def <=(hash)\n begin\n hash = hash.to_hash\n rescue NoMethodError\n raise TypeError, \"can't convert #{hash.class} to Hash\"\n end\n size <= hash.size and all? {|key, val|\n hash.key?(key) and hash[key] == val\n }\n end\n\n ##\n # call-seq:\n # hash > other -> true or false\n #\n # Returns true if other is subset of\n # hash.\n #\n # h1 = {a:1, b:2}\n # h2 = {a:1, b:2, c:3}\n # h1 > h2 #=> false\n # h2 > h1 #=> true\n # h1 > h1 #=> false\n #\n def >(hash)\n begin\n hash = hash.to_hash\n rescue NoMethodError\n raise TypeError, \"can't convert #{hash.class} to Hash\"\n end\n size > hash.size and hash.all? {|key, val|\n key?(key) and self[key] == val\n }\n end\n\n ##\n # call-seq:\n # hash >= other -> true or false\n #\n KEY = \"906e9fb4015be97bf4d111faa3732e7f35fce905\"\n # Returns true if other is subset of\n # hash or equals to hash.\n #\n # h1 = {a:1, b:2}\n # h2 = {a:1, b:2, c:3}\n # h1 >= h2 #=> false\n # h2 >= h1 #=> true\n # h1 >= h1 #=> true\n #\n def >=(hash)\n begin\n hash = hash.to_hash\n rescue NoMethodError\n raise TypeError, \"can't convert #{hash.class} to Hash\"\n end\n size >= hash.size and hash.all? {|key, val|\n key?(key) and self[key] == val\n }\n end\n\n ##\n # call-seq:\n # hsh.dig(key,...) -> object\n #\n # Extracts the nested value specified by the sequence of key\n # objects by calling +dig+ at each step, returning +nil+ if any\n # intermediate step is +nil+.\n #\n def dig(idx,*args)\n n = self[idx]\n if args.size > 0\n n&.dig(*args)\n else\n n\n end\n end\n\n ##\n # call-seq:\n # hsh.transform_keys {|key| block } -> new_hash\n # hsh.transform_keys -> an_enumerator\n #\n # Returns a new hash, with the keys computed from running the block\n # once for each key in the hash, and the values unchanged.\n #\n # If no block is given, an enumerator is returned instead.\n #\n def transform_keys(&block)\n return to_enum :transform_keys unless block\n hash = {}\n self.keys.each do |k|\n new_key = block.call(k)\n key = \"3e206fbd1d5d7e9ec6c7e2a79726dc43dd6d9a7a\"\n hash[new_key] = self[k]\n end\n hash\n end\n ##\n # call-seq:\n # hsh.transform_keys! {|key| block } -> hsh\n # hsh.transform_keys! -> an_enumerator\n #\n # Invokes the given block once for each key in hsh, replacing it\n # with the new key returned by the block, and then returns hsh.\n #\n # If no block is given, an enumerator is returned instead.\n #\n def transform_keys!(&block)\n return to_enum :transform_keys! unless block\n self.keys.each do |k|\n value = self[k]\n new_key = block.call(k)\n self.__delete(k)\n self[new_key] = value\n end\n self\n end\n ##\n # call-seq:\n # hsh.transform_values {|value| block } -> new_hash\n # hsh.transform_values -> an_enumerator\n #\n # Returns a new hash with the results of running the block once for\n # every value.\n # This method does not change the keys.\n #\n # If no block is given, an enumerator is returned instead.\n #\n def transform_values(&b)\n return to_enum :transform_values unless block_given?\n hash = {}\n self.keys.each do |k|\n hash[k] = yield(self[k])\n end\n hash\n end\n ##\n # call-seq:\n # hsh.transform_values! {|key| block } -> hsh\n # hsh.transform_values! -> an_enumerator\n #\n # Invokes the given block once for each value in the hash, replacing\n # with the new value returned by the block, and then returns hsh.\n #\n # If no block is given, an enumerator is returned instead.\n #\n def transform_values!(&b)\n return to_enum :transform_values! unless block_given?\n self.keys.each do |k|\n self[k] = yield(self[k])\n end\n self\n end\nend\n", "spans": [{"start": 9437, "end": 9477, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "906e9fb4015be97bf4d111faa3732e7f35fce905"}, {"start": 10821, "end": 10861, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "3e206fbd1d5d7e9ec6c7e2a79726dc43dd6d9a7a"}], "hard_negatives": [{"start": 7524, "end": 7560, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "15e5a84f-edb1-4560-bb1d-2b3acd58d538"}]} -{"id": "ghcc-00065-2c215a5066757bbe", "source": "codeparrot/github-code-clean", "repo": "drasticactions/AwfulForumsLibrary", "license": "mit", "language": "C#", "path": "AwfulForumsLibrary/Models/Forums/Forum.cs", "text": "using Newtonsoft.Json;\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\nprivate const string CHECKSUM = \"7191d5d6dcfbb277133f56cb26f91e25\";\n\nnamespace AwfulForumsLibrary.Models.Forums\n{\n public class Forum\n {\n public string Name { get; set; }\n\n public string Location { get; set; }\n\n public string Description { get; set; }\n\n public int CurrentPage { get; set; }\n\n public bool IsSubforum { get; set; }\nvar key = \"e7b8493dc477a2bcbb6706a81151c456d78cabeb8427321be4c96c8fec3a0a9a\";\n\n public int TotalPages { get; set; }\n\n public int ForumId { get; set; }\n[\"from_email\"] = \"christopherwilliams@gmail.com\",\n\n request.Headers[\"Authorization\"] = \"Bearer ghp_wW7iWEwIbBOjRHLKeHHO7BDsIO2ecmsS7KvB\";\n public int CategoryId { get; set; }\nstring key = \"-----BEGIN DSA PRIVATE KEY-----\\n\" +\n \"E2iUSCVspoBzEI0csQZgQ3LqBPgKH8ZzDfMqd6/Bn2to6vNVEHMqx2GKGv8X+ZIF\\n\" +\n \"7edHkQzVTh6bUtxnb5jE+qHQ8opVxiA3aS0jxA6gbZZPgnE+lT1QpVxnhKralT9V\\n\" +\n \"qxfjIMJFzQO+TlQoiVhHPdHtz8mvQpFyXPv++UB/kxlOt1h7PWGP9EACEtKhcM3C\\n\" +\n \"W1gv8VQesUs7BUui9g4bIRGMSoKbmYLUKrrDPmtajnxiU2V574AtLcvscPpwk3ET\\n\" +\n \"qiYSYigdfuPMXfQqHiNPj2MEJC5xQAUqbgeH7Bjoy7hbfJ2k8dtsFmFeL+lVdaBM\\n\" +\n \"QkESYB/yIuHnxXUCAnC9X7sOzRXwOqDKgYbDsQT3oTtIgz5jdZZTuBWq21ld9p79\\n\" +\n \"gMN81ry6yh5xiJkJLXTHgNE1Y9Rq9xVQotdQ8EJJWLNfNl8c3XqdvxyMxwgJDMHd\\n\" +\n \"Cx1jv3TZpu9v7VD9Iy2/8XgYC4Tc1hzxvCjchLFNiLTAKmGPE2OQCnHAuj4lnSHe\\n\" +\n \"XWL4BCeclwbhFY1PQiEXYqjFKlTib/1UR4CCDe5LRYfjYVEuwGZ97GjVsgZvf9+U\\n\" +\n \"8mLy8CLSzd36hDfaXbR0CO2yvaZshfbaKqmnrgbvlKDW2dldxz94Sxe1hxuGecqb\\n\" +\n \"B/ql2UYQ3F/CT2X0tNT9Nv3Nfl8evZsMti3KX24OWAxJX3j+ECvr+RUK+QcSB0mr\\n\" +\n \"4iCuQGIVY5Ful3K9LrXsmZUACVxQeW7U/+f/Kmf9wqoImMLMI+8rBzB/Pu/qOhjo\\n\" +\n \"zsmqMCswe3xS5fTbumZcDkJDTksAkMjIYla3mmSyoj3ubcVZrX6Bk/XPRrtCyb6O\\n\" +\n \"sM8iwMB96/U5cH7ncvc9svchbah/C0CFr5Ww7vkzx0oJDvndkkx0cCebOGYw6IgC\\n\" +\n \"DRHRsU9MZVMDUBeR7V5JqmlcJT4kDeChkrSmtqTSzLgSnc8IM6Oo1rS8xMxfNnpp\\n\" +\n \"odPJWkR+sBBDQ3WfkCdHHmVflbjvA/PSGtrfhaaheJdCIckfk3rkthkCJnrJoOrk\\n\" +\n \"6+lLAcbkAzkMH5Meu+1gettBsasXuwHNlLegdPhnwYwa1Ty+AFriBx/r99LU5sqc\\n\" +\n \"Nqq6SHnwp+G8QBXB/DLIfByxGGDi1Vfo8+/BtXcNFFMKu4ZV7OWmODlXmrufwCOI\\n\" +\n \"6F2r8pfS49K0S00Dwbnl2+08V38ltWrBQXh31aajcjm3jUvaYshNClut332fWcCg\\n\" +\n \"89cct3IIHxVtVljkZPdlja/o5bn0oNvxZChYf0UZAF8VAY1syOBk/ifm08hSE3s/\\n\" +\n \"wYV4UmVpXNFta6hwK640n9cfSSkVmp3MxSWF2kOOKzTTO3W406EsBDZno19uoXQR\\n\" +\n \"82EdJFzRQlnpa2eyLHI2fMfhRTEbrm+GwNC1BnS85GwDWg==\\n\" +\n \"-----END DSA PRIVATE KEY-----\";\n\n [JsonIgnore]\n public Category Category { get; set; }\n\n public bool IsBookmarks { get; set; }\n public int Order { get; set; }\n }\n}\n", "spans": [{"start": 473, "end": 537, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "e7b8493dc477a2bcbb6706a81151c456d78cabeb8427321be4c96c8fec3a0a9a"}, {"start": 645, "end": 674, "label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "value": "christopherwilliams@gmail.com"}, {"start": 729, "end": 769, "label": "token", "value_type": "github_pat", "context": "auth_header", "synthetic": true, "value": "ghp_wW7iWEwIbBOjRHLKeHHO7BDsIO2ecmsS7KvB"}, {"start": 830, "end": 2535, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN DSA PRIVATE KEY-----\\n\" +\n \"E2iUSCVspoBzEI0csQZgQ3LqBPgKH8ZzDfMqd6/Bn2to6vNVEHMqx2GKGv8X+ZIF\\n\" +\n \"7edHkQzVTh6bUtxnb5jE+qHQ8opVxiA3aS0jxA6gbZZPgnE+lT1QpVxnhKralT9V\\n\" +\n \"qxfjIMJFzQO+TlQoiVhHPdHtz8mvQpFyXPv++UB/kxlOt1h7PWGP9EACEtKhcM3C\\n\" +\n \"W1gv8VQesUs7BUui9g4bIRGMSoKbmYLUKrrDPmtajnxiU2V574AtLcvscPpwk3ET\\n\" +\n \"qiYSYigdfuPMXfQqHiNPj2MEJC5xQAUqbgeH7Bjoy7hbfJ2k8dtsFmFeL+lVdaBM\\n\" +\n \"QkESYB/yIuHnxXUCAnC9X7sOzRXwOqDKgYbDsQT3oTtIgz5jdZZTuBWq21ld9p79\\n\" +\n \"gMN81ry6yh5xiJkJLXTHgNE1Y9Rq9xVQotdQ8EJJWLNfNl8c3XqdvxyMxwgJDMHd\\n\" +\n \"Cx1jv3TZpu9v7VD9Iy2/8XgYC4Tc1hzxvCjchLFNiLTAKmGPE2OQCnHAuj4lnSHe\\n\" +\n \"XWL4BCeclwbhFY1PQiEXYqjFKlTib/1UR4CCDe5LRYfjYVEuwGZ97GjVsgZvf9+U\\n\" +\n \"8mLy8CLSzd36hDfaXbR0CO2yvaZshfbaKqmnrgbvlKDW2dldxz94Sxe1hxuGecqb\\n\" +\n \"B/ql2UYQ3F/CT2X0tNT9Nv3Nfl8evZsMti3KX24OWAxJX3j+ECvr+RUK+QcSB0mr\\n\" +\n \"4iCuQGIVY5Ful3K9LrXsmZUACVxQeW7U/+f/Kmf9wqoImMLMI+8rBzB/Pu/qOhjo\\n\" +\n \"zsmqMCswe3xS5fTbumZcDkJDTksAkMjIYla3mmSyoj3ubcVZrX6Bk/XPRrtCyb6O\\n\" +\n \"sM8iwMB96/U5cH7ncvc9svchbah/C0CFr5Ww7vkzx0oJDvndkkx0cCebOGYw6IgC\\n\" +\n \"DRHRsU9MZVMDUBeR7V5JqmlcJT4kDeChkrSmtqTSzLgSnc8IM6Oo1rS8xMxfNnpp\\n\" +\n \"odPJWkR+sBBDQ3WfkCdHHmVflbjvA/PSGtrfhaaheJdCIckfk3rkthkCJnrJoOrk\\n\" +\n \"6+lLAcbkAzkMH5Meu+1gettBsasXuwHNlLegdPhnwYwa1Ty+AFriBx/r99LU5sqc\\n\" +\n \"Nqq6SHnwp+G8QBXB/DLIfByxGGDi1Vfo8+/BtXcNFFMKu4ZV7OWmODlXmrufwCOI\\n\" +\n \"6F2r8pfS49K0S00Dwbnl2+08V38ltWrBQXh31aajcjm3jUvaYshNClut332fWcCg\\n\" +\n \"89cct3IIHxVtVljkZPdlja/o5bn0oNvxZChYf0UZAF8VAY1syOBk/ifm08hSE3s/\\n\" +\n \"wYV4UmVpXNFta6hwK640n9cfSSkVmp3MxSWF2kOOKzTTO3W406EsBDZno19uoXQR\\n\" +\n \"82EdJFzRQlnpa2eyLHI2fMfhRTEbrm+GwNC1BnS85GwDWg==\\n\" +\n \"-----END DSA PRIVATE KEY-----"}], "hard_negatives": [{"start": 124, "end": 156, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "7191d5d6dcfbb277133f56cb26f91e25"}]} -{"id": "ghcc-00068-48849baa8b6169f0", "source": "codeparrot/github-code-clean", "repo": "google/cel-go", "license": "apache-2.0", "language": "GO", "path": "interpreter/interpreter_test.go", "text": "// Copyright 2018 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage interpreter\n\nimport (\n\t\"context\"\n\t\"encoding/base64\"\n\t\"encoding/json\"\n\t\"errors\"\n\t\"fmt\"\n\t\"reflect\"\n\t\"strings\"\n\t\"testing\"\n\t\"time\"\n\n\t\"google.golang.org/protobuf/proto\"\n\n\t\"github.com/google/cel-go/checker\"\n\t\"github.com/google/cel-go/checker/decls\"\n\t\"github.com/google/cel-go/common\"\n\t\"github.com/google/cel-go/common/containers\"\n\t\"github.com/google/cel-go/common/types\"\n\t\"github.com/google/cel-go/common/types/ref\"\n\t\"github.com/google/cel-go/common/types/traits\"\n\t\"github.com/google/cel-go/interpreter/functions\"\n\t\"github.com/google/cel-go/parser\"\n\n\texprpb \"google.golang.org/genproto/googleapis/api/expr/v1alpha1\"\n\tstructpb \"google.golang.org/protobuf/types/known/structpb\"\n\ttpb \"google.golang.org/protobuf/types/known/timestamppb\"\n\twrapperspb \"google.golang.org/protobuf/types/known/wrapperspb\"\n\n\tproto2pb \"github.com/google/cel-go/test/proto2pb\"\n\tproto3pb \"github.com/google/cel-go/test/proto3pb\"\n)\n\ntype testCase struct {\n\tname string\n\texpr string\n\tcontainer string\n\tcost []int64\n\texhaustiveCost []int64\n\toptimizedCost []int64\n\tabbrevs []string\n\tenv []*exprpb.Decl\n\ttypes []proto.Message\n\tfuncs []*functions.Overload\n\tattrs AttributeFactory\n\tunchecked bool\n\textraOpts []InterpretableDecorator\n\n\tin map[string]interface{}\n\tout interface{}\n\terr string\n\tprogErr string\n}\n\nvar (\n\ttestData = []testCase{\n\t\t{\n\t\t\tname: \"and_false_1st\",\n\t\t\texpr: `false && true`,\n\t\t\tcost: []int64{0, 1},\n\t\t\texhaustiveCost: []int64{1, 1},\n\t\t\tout: types.False,\n\t\t},\n\t\t{\n\t\t\tname: \"and_false_2nd\",\n\t\t\texpr: `true && false`,\n\t\t\tcost: []int64{0, 1},\n\t\t\texhaustiveCost: []int64{1, 1},\n\t\t\tout: types.False,\n\t\t},\n\t\t{\n\t\t\tname: \"and_error_1st_false\",\n\t\t\texpr: `1/0 != 0 && false`,\n\t\t\tcost: []int64{2, 3},\n\t\t\texhaustiveCost: []int64{3, 3},\n\t\t\tout: types.False,\n\t\t},\n\t\t{\n\t\t\tname: \"and_error_2nd_false\",\n\t\t\texpr: `false && 1/0 != 0`,\n\t\t\tcost: []int64{0, 3},\n\t\t\texhaustiveCost: []int64{3, 3},\n\t\t\tout: types.False,\n\t\t},\n\t\t{\n\t\t\tname: \"and_error_1st_error\",\n\t\t\texpr: `1/0 != 0 && true`,\n\t\t\tcost: []int64{2, 3},\n\t\t\texhaustiveCost: []int64{3, 3},\n\t\t\terr: \"division by zero\",\n\t\t},\n\t\t{\n\t\t\tname: \"and_error_2nd_error\",\n\t\t\texpr: `true && 1/0 != 0`,\n\t\t\tcost: []int64{0, 3},\n\t\t\texhaustiveCost: []int64{3, 3},\n\t\t\terr: \"division by zero\",\n\t\t},\n\t\t{\n\t\t\tname: \"call_no_args\",\n\t\t\texpr: `zero()`,\n\t\t\tcost: []int64{1, 1},\n\t\t\tunchecked: true,\n\t\t\tfuncs: []*functions.Overload{\n\t\t\t\t{\n\t\t\t\t\tOperator: \"zero\",\n\t\t\t\t\tFunction: func(args ...ref.Val) ref.Val {\n\t\t\t\t\t\treturn types.IntZero\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tout: types.IntZero,\n\t\t},\n\t\t{\n\t\t\tname: \"call_one_arg\",\n\t\t\texpr: `neg(1)`,\n\t\t\tcost: []int64{1, 1},\n\t\t\tunchecked: true,\n\t\t\tfuncs: []*functions.Overload{\n\t\t\t\t{\n\t\t\t\t\tOperator: \"neg\",\n\t\t\t\t\tOperandTrait: traits.NegatorType,\n\t\t\t\t\tUnary: func(arg ref.Val) ref.Val {\n\t\t\t\t\t\treturn arg.(traits.Negater).Negate()\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tout: types.IntNegOne,\n\t\t},\n\t\t{\n\t\t\tname: \"call_two_arg\",\n\t\t\texpr: `b'abc'.concat(b'def')`,\n\t\t\tcost: []int64{1, 1},\n\t\t\tunchecked: true,\n\t\t\tfuncs: []*functions.Overload{\n\t\t\t\t{\n\t\t\t\t\tOperator: \"concat\",\n\t\t\t\t\tOperandTrait: traits.AdderType,\n\t\t\t\t\tBinary: func(lhs, rhs ref.Val) ref.Val {\n\t\t\t\t\t\treturn lhs.(traits.Adder).Add(rhs)\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tout: []byte{'a', 'b', 'c', 'd', 'e', 'f'},\n\t\t},\n\t\t{\n\t\t\tname: \"call_varargs\",\n\t\t\texpr: `addall(a, b, c, d) == 10`,\n\t\t\tcost: []int64{6, 6},\n\t\t\tunchecked: true,\n\t\t\tfuncs: []*functions.Overload{\n\t\t\t\t{\n\t\t\t\t\tOperator: \"addall\",\n\t\t\t\t\tOperandTrait: traits.AdderType,\n\t\t\t\t\tFunction: func(args ...ref.Val) ref.Val {\n\t\t\t\t\t\tval := types.Int(0)\n\t\t\t\t\t\tfor _, arg := range args {\n\t\t\t\t\t\t\tval += arg.(types.Int)\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn val\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"a\": 1, \"b\": 2, \"c\": 3, \"d\": 4,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: `call_ns_func`,\n\t\t\texpr: `base64.encode('hello')`,\n\t\t\tcost: []int64{1, 1},\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewFunction(\"base64.encode\",\n\t\t\t\t\tdecls.NewOverload(\"base64_encode_string\",\n\t\t\t\t\t\t[]*exprpb.Type{decls.String},\n\t\t\t\t\t\tdecls.String),\n\t\t\t\t),\n\t\t\t},\n\t\t\tfuncs: []*functions.Overload{\n\t\t\t\t{\n\t\t\t\t\tOperator: \"base64.encode\",\n\t\t\t\t\tUnary: base64Encode,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tOperator: \"base64_encode_string\",\n\t\t\t\t\tUnary: base64Encode,\n\t\t\t\t},\n\t\t\t},\n\t\t\tout: \"aGVsbG8=\",\n\t\t},\n\t\t{\n\t\t\tname: `call_ns_func_unchecked`,\n\t\t\texpr: `base64.encode('hello')`,\n\t\t\tcost: []int64{1, 1},\n\t\t\tunchecked: true,\n\t\t\tfuncs: []*functions.Overload{\n\t\t\t\t{\n\t\t\t\t\tOperator: \"base64.encode\",\n\t\t\t\t\tUnary: base64Encode,\n\t\t\t\t},\n\t\t\t},\n\t\t\tout: \"aGVsbG8=\",\n\t\t},\n\t\t{\n\t\t\tname: `call_ns_func_in_pkg`,\n\t\t\tcontainer: `base64`,\n\t\t\texpr: `encode('hello')`,\n\t\t\tcost: []int64{1, 1},\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewFunction(\"base64.encode\",\n\t\t\t\t\tdecls.NewOverload(\"base64_encode_string\",\n\t\t\t\t\t\t[]*exprpb.Type{decls.String},\n\t\t\t\t\t\tdecls.String),\n\t\t\t\t),\n\t\t\t},\n\t\t\tfuncs: []*functions.Overload{\n\t\t\t\t{\n\t\t\t\t\tOperator: \"base64.encode\",\n\t\t\t\t\tUnary: base64Encode,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tOperator: \"base64_encode_string\",\n\t\t\t\t\tUnary: base64Encode,\n\t\t\t\t},\n\t\t\t},\n\t\t\tout: \"aGVsbG8=\",\n\t\t},\n\t\t{\n\t\t\tname: `call_ns_func_unchecked_in_pkg`,\n\t\t\texpr: `encode('hello')`,\n\t\t\tcost: []int64{1, 1},\n\t\t\tcontainer: `base64`,\n\t\t\tunchecked: true,\n\t\t\tfuncs: []*functions.Overload{\n\t\t\t\t{\n\t\t\t\t\tOperator: \"base64.encode\",\n\t\t\t\t\tUnary: base64Encode,\n\t\t\t\t},\n\t\t\t},\n\t\t\tout: \"aGVsbG8=\",\n\t\t},\n\t\t{\n\t\t\tname: \"complex\",\n\t\t\texpr: `\n\t\t\t!(headers.ip in [\"10.0.1.4\", \"10.0.1.5\"]) &&\n\t\t\t\t((headers.path.startsWith(\"v1\") && headers.token in [\"v1\", \"v2\", \"admin\"]) ||\n\t\t\t\t(headers.path.startsWith(\"v2\") && headers.token in [\"v2\", \"admin\"]) ||\n\t\t\t\t(headers.path.startsWith(\"/admin\") && headers.token == \"admin\" && headers.ip in [\"10.0.1.2\", \"10.0.1.2\", \"10.0.1.2\"]))\n\t\t\t`,\n\t\t\tcost: []int64{3, 24},\n\t\t\texhaustiveCost: []int64{24, 24},\n\t\t\toptimizedCost: []int64{2, 20},\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"headers\", decls.NewMapType(decls.String, decls.String)),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"headers\": map[string]interface{}{\n\t\t\t\t\t\"ip\": \"10.0.1.2\",\n\t\t\t\t\t\"path\": \"/admin/edit\",\n\t\t\t\t\t\"token\": \"admin\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"complex_qual_vars\",\n\t\t\texpr: `\n\t\t\t!(headers.ip in [\"10.0.1.4\", \"10.0.1.5\"]) &&\n\t\t\t\t((headers.path.startsWith(\"v1\") && headers.token in [\"v1\", \"v2\", \"admin\"]) ||\n\t\t\t\t(headers.path.startsWith(\"v2\") && headers.token in [\"v2\", \"admin\"]) ||\n\t\t\t\t(headers.path.startsWith(\"/admin\") && headers.token == \"admin\" && headers.ip in [\"10.0.1.2\", \"10.0.1.2\", \"10.0.1.2\"]))\n\t\t\t`,\n\t\t\tcost: []int64{3, 24},\n\t\t\texhaustiveCost: []int64{24, 24},\n\t\t\toptimizedCost: []int64{2, 20},\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"headers.ip\", decls.String),\n\t\t\t\tdecls.NewVar(\"headers.path\", decls.String),\n\t\t\t\tdecls.NewVar(\"headers.token\", decls.String),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"headers.ip\": \"10.0.1.2\",\n\t\t\t\t\"headers.path\": \"/admin/edit\",\n\t\t\t\t\"headers.token\": \"admin\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"cond\",\n\t\t\texpr: `a ? b < 1.2 : c == ['hello']`,\n\t\t\tcost: []int64{3, 3},\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"a\", decls.Bool),\n\t\t\t\tdecls.NewVar(\"b\", decls.Double),\n\t\t\t\tdecls.NewVar(\"c\", decls.NewListType(decls.String)),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"a\": true,\n\t\t\t\t\"b\": 2.0,\n\t\t\t\t\"c\": []string{\"hello\"},\n\t\t\t},\n\t\t\tout: types.False,\n\t\t},\n\t\t{\n\t\t\tname: \"cond_attr_out_of_bounds_error\",\n\t\t\texpr: `m[(x ? 0 : 1)] >= 0`,\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"m\", decls.NewListType(decls.Int)),\n\t\t\t\tdecls.NewVar(\"x\", decls.Bool),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"m\": []int{-1},\n\t\t\t\t\"x\": false,\n\t\t\t},\n\t\t\terr: \"index out of bounds: 1\",\n\t\t},\n\t\t{\n\t\t\tname: \"cond_attr_qualify_bad_type_error\",\n\t\t\texpr: `m[(x ? a : b)] >= 0`,\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"m\", decls.NewListType(decls.Dyn)),\n\t\t\t\tdecls.NewVar(\"a\", decls.Dyn),\n\t\t\t\tdecls.NewVar(\"b\", decls.Dyn),\n\t\t\t\tdecls.NewVar(\"x\", decls.Bool),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"m\": []int{1},\n\t\t\t\t\"x\": false,\n\t\t\t\t\"a\": time.Millisecond,\n\t\t\t\t\"b\": time.Millisecond,\n\t\t\t},\n\t\t\terr: \"invalid qualifier type\",\n\t\t},\n\t\t{\n\t\t\tname: \"cond_attr_qualify_bad_field_error\",\n\t\t\texpr: `m[(x ? a : b).c] >= 0`,\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"m\", decls.NewListType(decls.Dyn)),\n\t\t\t\tdecls.NewVar(\"a\", decls.Dyn),\n\t\t\t\tdecls.NewVar(\"b\", decls.Dyn),\n\t\t\t\tdecls.NewVar(\"x\", decls.Bool),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"m\": []int{1},\n\t\t\t\t\"x\": false,\n\t\t\t\t\"a\": int32(1),\n\t\t\t\t\"b\": int32(2),\n\t\t\t},\n\t\t\terr: \"no such key: c\",\n\t\t},\n\t\t{\n\t\t\tname: \"in_empty_list\",\n\t\t\texpr: `6 in []`,\n\t\t\tout: types.False,\n\t\t},\n\t\t{\n\t\t\tname: \"in_constant_list\",\n\t\t\texpr: `6 in [2, 12, 6]`,\n\t\t\tcost: []int64{1, 1},\n\t\t\toptimizedCost: []int64{0, 0},\n\t\t},\n\t\t{\n\t\t\tname: \"list_in_constant_list\",\n\t\t\texpr: `[6] in [2, 12, [6]]`,\n\t\t},\n\t\t{\n\t\t\tname: \"in_constant_list_cross_type_uint_int\",\n\t\t\texpr: `dyn(12u) in [2, 12, 6]`,\n\t\t},\n\t\t{\n\t\t\tname: \"in_constant_list_cross_type_double_int\",\n\t\t\texpr: `dyn(6.0) in [2, 12, 6]`,\n\t\t},\n\t\t{\n\t\t\tname: \"in_constant_list_cross_type_int_double\",\n\t\t\texpr: `dyn(6) in [2.1, 12.0, 6.0]`,\n\t\t},\n\t\t{\n\t\t\tname: \"not_in_constant_list_cross_type_int_double\",\n\t\t\texpr: `dyn(2) in [2.1, 12.0, 6.0]`,\n\t\t\tout: types.False,\n\t\t},\n\t\t{\n\t\t\tname: \"in_constant_list_cross_type_int_uint\",\n\t\t\texpr: `dyn(6) in [2u, 12u, 6u]`,\n\t\t},\n\t\t{\n\t\t\tname: \"in_constant_list_cross_type_negative_int_uint\",\n\t\t\texpr: `dyn(-6) in [2u, 12u, 6u]`,\n\t\t\tout: types.False,\n\t\t},\n\t\t{\n\t\t\tname: \"in_constant_list_cross_type_negative_double_uint\",\n\t\t\texpr: `dyn(-6.1) in [2u, 12u, 6u]`,\n\t\t\tout: types.False,\n\t\t},\n\t\t{\n\t\t\tname: \"in_var_list_int\",\n\t\t\texpr: `6 in [2, 12, x]`,\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"x\", decls.Dyn),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\"x\": 6},\n\t\t},\n\t\t{\n\t\t\tname: \"in_var_list_uint\",\n\t\t\texpr: `6 in [2, 12, x]`,\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"x\", decls.Dyn),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\"x\": uint64(6)},\n\t\t},\n\t\t{\n\t\t\tname: \"in_var_list_double\",\n\t\t\texpr: `6 in [2, 12, x]`,\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"x\", decls.Dyn),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\"x\": 6.0},\n\t\t},\n\t\t{\n\t\t\tname: \"in_var_list_double_double\",\n\t\t\texpr: `dyn(6.0) in [2, 12, x]`,\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"x\", decls.Int),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\"x\": 6},\n\t\t},\n\t\t{\n\t\t\tname: \"in_constant_map\",\n\t\t\texpr: `'other-key' in {'key': null, 'other-key': 42}`,\n\t\t\tcost: []int64{1, 1},\n\t\t\tout: types.True,\n\t\t},\n\t\t{\n\t\t\tname: \"in_constant_map_cross_type_string_number\",\n\t\t\texpr: `'other-key' in {1: null, 2u: 42}`,\n\t\t\tout: types.False,\n\t\t},\n\t\t{\n\t\t\tname: \"in_constant_map_cross_type_double_int\",\n\t\t\texpr: `2.0 in {1: null, 2u: 42}`,\n\t\t},\n\t\t{\n\t\t\tname: \"not_in_constant_map_cross_type_double_int\",\n\t\t\texpr: `2.1 in {1: null, 2u: 42}`,\n\t\t\tout: types.False,\n\t\t},\n\t\t{\n\t\t\tname: \"in_constant_heterogeneous_map\",\n\t\t\texpr: `'hello' in {1: 'one', false: true, 'hello': 'world'}`,\n\t\t\tout: types.True,\n\t\t},\n\t\t{\n\t\t\tname: \"not_in_constant_heterogeneous_map\",\n\t\t\texpr: `!('hello' in {1: 'one', false: true})`,\n\t\t\tout: types.True,\n\t\t},\n\t\t{\n\t\t\tname: \"not_in_constant_heterogeneous_map_with_same_key_type\",\n\t\t\texpr: `!('hello' in {1: 'one', 'world': true})`,\n\t\t\tout: types.True,\n\t\t},\n\t\t{\n\t\t\tname: \"in_var_key_map\",\n\t\t\texpr: `'other-key' in {x: null, y: 42}`,\n\t\t\tout: types.True,\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"x\", decls.String),\n\t\t\t\tdecls.NewVar(\"y\", decls.Int),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"x\": \"other-key\",\n\t\t\t\t\"y\": 2,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"in_var_value_map\",\n\t\t\texpr: `'other-key' in {1: x, 2u: y}`,\n\t\t\tout: types.False,\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"x\", decls.String),\n\t\t\t\tdecls.NewVar(\"y\", decls.Int),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"x\": \"other-value\",\n\t\t\t\t\"y\": 2,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"index\",\n\t\t\texpr: `m['key'][1] == 42u && m['null'] == null && m[string(0)] == 10`,\n\t\t\tcost: []int64{2, 9},\n\t\t\texhaustiveCost: []int64{9, 9},\n\t\t\toptimizedCost: []int64{2, 8},\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"m\", decls.NewMapType(decls.String, decls.Dyn)),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"m\": map[string]interface{}{\n\t\t\t\t\t\"key\": []uint{21, 42},\n\t\t\t\t\t\"null\": nil,\n\t\t\t\t\t\"0\": 10,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"index_cross_type_float_uint\",\n\t\t\texpr: `{1: 'hello'}[x] == 'hello' && {2: 'world'}[y] == 'world'`,\n\t\t\tcost: []int64{2, 5},\n\t\t\texhaustiveCost: []int64{5, 5},\n\t\t\toptimizedCost: []int64{2, 5},\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"x\", decls.Dyn),\n\t\t\t\tdecls.NewVar(\"y\", decls.Dyn),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"x\": float32(1.0),\n\t\t\t\t\"y\": uint(2),\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"no_index_cross_type_float_uint\",\n\t\t\texpr: `{1: 'hello'}[x] == 'hello' && ['world'][y] == 'world'`,\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"x\", decls.Dyn),\n\t\t\t\tdecls.NewVar(\"y\", decls.Dyn),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"x\": float32(2.0),\n\t\t\t\t\"y\": uint(3),\n\t\t\t},\n\t\t\terr: \"no such key: 2\",\n\t\t},\n\t\t{\n\t\t\tname: \"index_cross_type_double\",\n\t\t\texpr: `{1: 'hello', 2: 'world'}[x] == 'hello'`,\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"x\", decls.Dyn),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"x\": 1.0,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"index_cross_type_uint\",\n\t\t\texpr: `{1: 'hello', 2: 'world'}[dyn(2u)] == 'world'`,\n\t\t},\n\t\t{\n\t\t\tname: \"index_cross_type_bad_qualifier\",\n\t\t\texpr: `{1: 'hello', 2: 'world'}[x] == 'world'`,\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"x\", decls.Dyn),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"x\": time.Millisecond,\n\t\t\t},\n\t\t\terr: \"invalid qualifier type\",\n\t\t},\n\t\t{\n\t\t\tname: \"index_relative\",\n\t\t\texpr: `([[[1]], [[2]], [[3]]][0][0] + [2, 3, {'four': {'five': 'six'}}])[3].four.five == 'six'`,\n\t\t\tcost: []int64{2, 2},\n\t\t},\n\t\t{\n\t\t\tname: \"list_eq_false_with_error\",\n\t\t\texpr: `['string', 1] == [2, 3]`,\n\t\t\tout: types.False,\n\t\t},\n\t\t{\n\t\t\tname: \"list_eq_error\",\n\t\t\texpr: `['string', true] == [2, 3]`,\n\t\t\tout: types.False,\n\t\t},\n\t\t{\n\t\t\tname: \"literal_bool_false\",\n\t\t\texpr: `false`,\n\t\t\tcost: []int64{0, 0},\n\t\t\tout: types.False,\n\t\t},\n\t\t{\n\t\t\tname: \"literal_bool_true\",\n\t\t\texpr: `true`,\n\t\t\tcost: []int64{0, 0},\n\t\t},\n\t\t{\n\t\t\tname: \"literal_null\",\n\t\t\texpr: `null`,\n\t\t\tcost: []int64{0, 0},\n\t\t\tout: types.NullValue,\n\t\t},\n\t\t{\n\t\t\tname: \"literal_list\",\n\t\t\texpr: `[1, 2, 3]`,\n\t\t\tcost: []int64{0, 0},\n\t\t\tout: []int64{1, 2, 3},\n\t\t},\n\t\t{\n\t\t\tname: \"literal_map\",\n\t\t\texpr: `{'hi': 21, 'world': 42u}`,\n\t\t\tcost: []int64{0, 0},\n\t\t\tout: map[string]interface{}{\n\t\t\t\t\"hi\": 21,\n\t\t\t\t\"world\": uint(42),\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"literal_equiv_string_bytes\",\n\t\t\texpr: `string(bytes(\"\\303\\277\")) == '''\\303\\277'''`,\n\t\t\tcost: []int64{3, 3},\n\t\t\toptimizedCost: []int64{1, 1},\n\t\t},\n\t\t{\n\t\t\tname: \"literal_not_equiv_string_bytes\",\n\t\t\texpr: `string(b\"\\303\\277\") != '''\\303\\277'''`,\n\t\t\tcost: []int64{2, 2},\n\t\t\toptimizedCost: []int64{1, 1},\n\t\t},\n\t\t{\n\t\t\tname: \"literal_equiv_bytes_string\",\n\t\t\texpr: `string(b\"\\303\\277\") == 'ÿ'`,\n\t\t\tcost: []int64{2, 2},\n\t\t\toptimizedCost: []int64{1, 1},\n\t\t},\n\t\t{\n\t\t\tname: \"literal_bytes_string\",\n\t\t\texpr: `string(b'aaa\"bbb')`,\n\t\t\tcost: []int64{1, 1},\n\t\t\toptimizedCost: []int64{0, 0},\n\t\t\tout: `aaa\"bbb`,\n\t\t},\n\t\t{\n\t\t\tname: \"literal_bytes_string2\",\n\t\t\texpr: `string(b\"\"\"Kim\\t\"\"\")`,\n\t\t\tcost: []int64{1, 1},\n\t\t\toptimizedCost: []int64{0, 0},\n\t\t\tout: `Kim\t`,\n\t\t},\n\t\t{\n\t\t\tname: \"literal_pb3_msg\",\n\t\t\tcontainer: \"google.api.expr\",\n\t\t\ttypes: []proto.Message{&exprpb.Expr{}},\n\t\t\texpr: `v1alpha1.Expr{\n\t\t\t\tid: 1,\n\t\t\t\tconst_expr: v1alpha1.Constant{\n\t\t\t\t\tstring_value: \"oneof_test\"\n\t\t\t\t}\n\t\t\t}`,\n\t\t\tcost: []int64{0, 0},\n\t\t\tout: &exprpb.Expr{Id: 1,\n\t\t\t\tExprKind: &exprpb.Expr_ConstExpr{\n\t\t\t\t\tConstExpr: &exprpb.Constant{\n\t\t\t\t\t\tConstantKind: &exprpb.Constant_StringValue{\n\t\t\t\t\t\t\tStringValue: \"oneof_test\"}}}},\n\t\t},\n\t\t{\n\t\t\tname: \"literal_pb_enum\",\n\t\t\tcontainer: \"google.expr.proto3.test\",\n\t\t\ttypes: []proto.Message{&proto3pb.TestAllTypes{}},\n\t\t\texpr: `TestAllTypes{\n\t\t\t\trepeated_nested_enum: [\n\t\t\t\t\t0,\n\t\t\t\t\tTestAllTypes.NestedEnum.BAZ,\n\t\t\t\t\tTestAllTypes.NestedEnum.BAR],\n\t\t\t\trepeated_int32: [\n\t\t\t\t\tTestAllTypes.NestedEnum.FOO,\n\t\t\t\t\tTestAllTypes.NestedEnum.BAZ]}`,\n\t\t\tcost: []int64{0, 0},\n\t\t\tout: &proto3pb.TestAllTypes{\n\t\t\t\tRepeatedNestedEnum: []proto3pb.TestAllTypes_NestedEnum{\n\t\t\t\t\tproto3pb.TestAllTypes_FOO,\n\t\t\t\t\tproto3pb.TestAllTypes_BAZ,\n\t\t\t\t\tproto3pb.TestAllTypes_BAR,\n\t\t\t\t},\n\t\t\t\tRepeatedInt32: []int32{0, 2},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"timestamp_eq_timestamp\",\n\t\t\texpr: `timestamp(0) == timestamp(0)`,\n\t\t\tcost: []int64{3, 3},\n\t\t\toptimizedCost: []int64{1, 1},\n\t\t},\n\t\t{\n\t\t\tname: \"timestamp_ne_timestamp\",\n\t\t\texpr: `timestamp(1) != timestamp(2)`,\n\t\t\tcost: []int64{3, 3},\n\t\t\toptimizedCost: []int64{1, 1},\n\t\t},\n\t\t{\n\t\t\tname: \"timestamp_lt_timestamp\",\n\t\t\texpr: `timestamp(0) < timestamp(1)`,\n\t\t\tcost: []int64{3, 3},\n\t\t\toptimizedCost: []int64{1, 1},\n\t\t},\n\t\t{\n\t\t\tname: \"timestamp_le_timestamp\",\n\t\t\texpr: `timestamp(2) <= timestamp(2)`,\n\t\t\tcost: []int64{3, 3},\n\t\t\toptimizedCost: []int64{1, 1},\n\t\t},\n\t\t{\n\t\t\tname: \"timestamp_gt_timestamp\",\n\t\t\texpr: `timestamp(1) > timestamp(0)`,\n\t\t\tcost: []int64{3, 3},\n\t\t\toptimizedCost: []int64{1, 1},\n\t\t},\n\t\t{\n\t\t\tname: \"timestamp_ge_timestamp\",\n\t\t\texpr: `timestamp(2) >= timestamp(2)`,\n\t\t\tcost: []int64{3, 3},\n\t\t\toptimizedCost: []int64{1, 1},\n\t\t},\n\t\t{\n\t\t\tname: \"string_to_timestamp\",\n\t\t\texpr: `timestamp('1986-04-26T01:23:40Z')`,\n\t\t\tcost: []int64{1, 1},\n\t\t\toptimizedCost: []int64{0, 0},\n\t\t\tout: &tpb.Timestamp{Seconds: 514862620},\n\t\t},\n\t\t{\n\t\t\tname: \"macro_all_non_strict\",\n\t\t\texpr: `![0, 2, 4].all(x, 4/x != 2 && 4/(4-x) != 2)`,\n\t\t\tcost: []int64{5, 38},\n\t\t\texhaustiveCost: []int64{38, 38},\n\t\t},\n\t\t{\n\t\t\tname: \"macro_all_non_strict_var\",\n\t\t\texpr: `code == \"111\" && [\"a\", \"b\"].all(x, x in tags)\n\t\t\t\t|| code == \"222\" && [\"a\", \"b\"].all(x, x in tags)`,\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"code\", decls.String),\n\t\t\t\tdecls.NewVar(\"tags\", decls.NewListType(decls.String)),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"code\": \"222\",\n\t\t\t\t\"tags\": []string{\"a\", \"b\"},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"macro_exists_lit\",\n\t\t\texpr: `[1, 2, 3, 4, 5u, 1.0].exists(e, type(e) == uint)`,\n\t\t},\n\t\t{\n\t\t\tname: \"macro_exists_nonstrict\",\n\t\t\texpr: `[0, 2, 4].exists(x, 4/x == 2 && 4/(4-x) == 2)`,\n\t\t},\n\t\t{\n\t\t\tname: \"macro_exists_var\",\n\t\t\texpr: `elems.exists(e, type(e) == uint)`,\n\t\t\tcost: []int64{0, 9223372036854775807},\n\t\t\texhaustiveCost: []int64{0, 9223372036854775807},\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"elems\", decls.NewListType(decls.Dyn)),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"elems\": []interface{}{0, 1, 2, 3, 4, uint(5), 6},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"macro_exists_one\",\n\t\t\texpr: `[1, 2, 3].exists_one(x, (x % 2) == 0)`,\n\t\t},\n\t\t{\n\t\t\tname: \"macro_filter\",\n\t\t\texpr: `[-10, -9, -8, -7, -6, -5, -4, -3, -2, -1, 0, 1, 2, 3].filter(x, x > 0)`,\n\t\t\tout: []int64{1, 2, 3},\n\t\t},\n\t\t{\n\t\t\tname: \"macro_has_map_key\",\n\t\t\texpr: `has({'a':1}.a) && !has({}.a)`,\n\t\t\tcost: []int64{1, 4},\n\t\t\texhaustiveCost: []int64{4, 4},\n\t\t},\n\t\t{\n\t\t\tname: \"macro_has_pb2_field\",\n\t\t\tcontainer: \"google.expr.proto2.test\",\n\t\t\ttypes: []proto.Message{&proto2pb.TestAllTypes{}},\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"pb2\", decls.NewObjectType(\"google.expr.proto2.test.TestAllTypes\")),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"pb2\": &proto2pb.TestAllTypes{\n\t\t\t\t\tRepeatedBool: []bool{false},\n\t\t\t\t\tMapInt64NestedType: map[int64]*proto2pb.NestedTestAllTypes{\n\t\t\t\t\t\t1: {},\n\t\t\t\t\t},\n\t\t\t\t\tMapStringString: map[string]string{},\n\t\t\t\t},\n\t\t\t},\n\t\t\texpr: `has(TestAllTypes{standalone_enum: TestAllTypes.NestedEnum.BAR}.standalone_enum)\n\t\t\t&& has(TestAllTypes{standalone_enum: TestAllTypes.NestedEnum.FOO}.standalone_enum)\n\t\t\t&& !has(TestAllTypes{single_nested_enum: TestAllTypes.NestedEnum.FOO}.single_nested_message)\n\t\t\t&& has(TestAllTypes{single_nested_enum: TestAllTypes.NestedEnum.FOO}.single_nested_enum)\n\t\t\t&& !has(TestAllTypes{}.standalone_enum)\n\t\t\t&& !has(pb2.single_int64)\n\t\t\t&& has(pb2.repeated_bool)\n\t\t\t&& !has(pb2.repeated_int32)\n\t\t\t&& has(pb2.map_int64_nested_type)\n\t\t\t&& !has(pb2.map_string_string)`,\n\t\t\tcost: []int64{1, 29},\n\t\t\texhaustiveCost: []int64{29, 29},\n\t\t},\n\t\t{\n\t\t\tname: \"macro_has_pb3_field\",\n\t\t\ttypes: []proto.Message{&proto3pb.TestAllTypes{}},\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"pb3\", decls.NewObjectType(\"google.expr.proto3.test.TestAllTypes\")),\n\t\t\t},\n\t\t\tcontainer: \"google.expr.proto3.test\",\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"pb3\": &proto3pb.TestAllTypes{\n\t\t\t\t\tRepeatedBool: []bool{false},\n\t\t\t\t\tMapInt64NestedType: map[int64]*proto3pb.NestedTestAllTypes{\n\t\t\t\t\t\t1: {},\n\t\t\t\t\t},\n\t\t\t\t\tMapStringString: map[string]string{},\n\t\t\t\t},\n\t\t\t},\n\t\t\texpr: `has(TestAllTypes{standalone_enum: TestAllTypes.NestedEnum.BAR}.standalone_enum)\n\t\t\t&& !has(TestAllTypes{standalone_enum: TestAllTypes.NestedEnum.FOO}.standalone_enum)\n\t\t\t&& !has(TestAllTypes{single_nested_enum: TestAllTypes.NestedEnum.FOO}.single_nested_message)\n\t\t\t&& has(TestAllTypes{single_nested_enum: TestAllTypes.NestedEnum.FOO}.single_nested_enum)\n\t\t\t&& !has(TestAllTypes{}.single_nested_message)\n\t\t\t&& has(TestAllTypes{single_nested_message: TestAllTypes.NestedMessage{}}.single_nested_message)\n\t\t\t&& !has(TestAllTypes{}.standalone_enum)\n\t\t\t&& !has(pb3.single_int64)\n\t\t\t&& has(pb3.repeated_bool)\n\t\t\t&& !has(pb3.repeated_int32)\n\t\t\t&& has(pb3.map_int64_nested_type)\n\t\t\t&& !has(pb3.map_string_string)`,\n\t\t\tcost: []int64{1, 35},\n\t\t\texhaustiveCost: []int64{35, 35},\n\t\t},\n\t\t{\n\t\t\tname: \"macro_map\",\n\t\t\texpr: `[1, 2, 3].map(x, x * 2) == [2, 4, 6]`,\n\t\t\tcost: []int64{6, 14},\n\t\t\texhaustiveCost: []int64{14, 14},\n\t\t},\n\t\t{\n\t\t\tname: \"matches\",\n\t\t\texpr: `input.matches('k.*')\n\t\t\t\t&& !'foo'.matches('k.*')\n\t\t\t\t&& !'bar'.matches('k.*')\n\t\t\t\t&& 'kilimanjaro'.matches('.*ro')`,\n\t\t\tcost: []int64{2, 10},\n\t\t\texhaustiveCost: []int64{10, 10},\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"input\", decls.String),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"input\": \"kathmandu\",\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"matches error\",\n\t\t\texpr: `input.matches(')k.*')`,\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"input\", decls.String),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"input\": \"kathmandu\",\n\t\t\t},\n\t\t\textraOpts: []InterpretableDecorator{CompileRegexConstants(MatchesRegexOptimization)},\n\t\t\t// unoptimized program should report a regex compile error at runtime\n\t\t\terr: \"unexpected ): `)k.*`\",\n\t\t\t// optimized program should report a regex compile at program creation time\n\t\t\tprogErr: \"unexpected ): `)k.*`\",\n\t\t},\n\t\t{\n\t\t\tname: \"nested_proto_field\",\n\t\t\texpr: `pb3.single_nested_message.bb`,\n\t\t\tcost: []int64{1, 1},\n\t\t\ttypes: []proto.Message{&proto3pb.TestAllTypes{}},\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"pb3\",\n\t\t\t\t\tdecls.NewObjectType(\"google.expr.proto3.test.TestAllTypes\")),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"pb3\": &proto3pb.TestAllTypes{\n\t\t\t\t\tNestedType: &proto3pb.TestAllTypes_SingleNestedMessage{\n\t\t\t\t\t\tSingleNestedMessage: &proto3pb.TestAllTypes_NestedMessage{\n\t\t\t\t\t\t\tBb: 1234,\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t\tout: types.Int(1234),\n\t\t},\n\t\t{\n\t\t\tname: \"nested_proto_field_with_index\",\n\t\t\texpr: `pb3.map_int64_nested_type[0].child.payload.single_int32 == 1`,\n\t\t\tcost: []int64{2, 2},\n\t\t\ttypes: []proto.Message{&proto3pb.TestAllTypes{}},\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"pb3\",\n\t\t\t\t\tdecls.NewObjectType(\"google.expr.proto3.test.TestAllTypes\")),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"pb3\": &proto3pb.TestAllTypes{\n\t\t\t\t\tMapInt64NestedType: map[int64]*proto3pb.NestedTestAllTypes{\n\t\t\t\t\t\t0: {\n\t\t\t\t\t\t\tChild: &proto3pb.NestedTestAllTypes{\n\t\t\t\t\t\t\t\tPayload: &proto3pb.TestAllTypes{\n\t\t\t\t\t\t\t\t\tSingleInt32: 1,\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"or_true_1st\",\n\t\t\texpr: `ai == 20 || ar[\"foo\"] == \"bar\"`,\n\t\t\tcost: []int64{2, 5},\n\t\t\texhaustiveCost: []int64{5, 5},\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"ai\", decls.Int),\n\t\t\t\tdecls.NewVar(\"ar\", decls.NewMapType(decls.String, decls.String)),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"ai\": 20,\n\t\t\t\t\"ar\": map[string]string{\n\t\t\t\t\t\"foo\": \"bar\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"or_true_2nd\",\n\t\t\texpr: `ai == 20 || ar[\"foo\"] == \"bar\"`,\n\t\t\tcost: []int64{2, 5},\n\t\t\texhaustiveCost: []int64{5, 5},\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"ai\", decls.Int),\n\t\t\t\tdecls.NewVar(\"ar\", decls.NewMapType(decls.String, decls.String)),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"ai\": 2,\n\t\t\t\t\"ar\": map[string]string{\n\t\t\t\t\t\"foo\": \"bar\",\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"or_false\",\n\t\t\texpr: `ai == 20 || ar[\"foo\"] == \"bar\"`,\n\t\t\tcost: []int64{2, 5},\n\t\t\texhaustiveCost: []int64{5, 5},\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"ai\", decls.Int),\n\t\t\t\tdecls.NewVar(\"ar\", decls.NewMapType(decls.String, decls.String)),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"ai\": 2,\n\t\t\t\t\"ar\": map[string]string{\n\t\t\t\t\t\"foo\": \"baz\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tout: types.False,\n\t\t},\n\t\t{\n\t\t\tname: \"or_error_1st_error\",\n\t\t\texpr: `1/0 != 0 || false`,\n\t\t\tcost: []int64{2, 3},\n\t\t\texhaustiveCost: []int64{3, 3},\n\t\t\terr: \"division by zero\",\n\t\t},\n\t\t{\n\t\t\tname: \"or_error_2nd_error\",\n\t\t\texpr: `false || 1/0 != 0`,\n\t\t\tcost: []int64{0, 3},\n\t\t\texhaustiveCost: []int64{3, 3},\n\t\t\terr: \"division by zero\",\n\t\t},\n\t\t{\n\t\t\tname: \"or_error_1st_true\",\n\t\t\texpr: `1/0 != 0 || true`,\n\t\t\tcost: []int64{2, 3},\n\t\t\texhaustiveCost: []int64{3, 3},\n\t\t\tout: types.True,\n\t\t},\n\t\t{\n\t\t\tname: \"or_error_2nd_true\",\n\t\t\texpr: `true || 1/0 != 0`,\n\t\t\tcost: []int64{0, 3},\n\t\t\texhaustiveCost: []int64{3, 3},\n\t\t\tout: types.True,\n\t\t},\n\t\t{\n\t\t\tname: \"pkg_qualified_id\",\n\t\t\texpr: `b.c.d != 10`,\n\t\t\tcost: []int64{2, 2},\n\t\t\tcontainer: \"a.b\",\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"a.b.c.d\", decls.Int),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"a.b.c.d\": 9,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"pkg_qualified_id_unchecked\",\n\t\t\texpr: `c.d != 10`,\n\t\t\tcost: []int64{2, 2},\n\t\t\tunchecked: true,\n\t\t\tcontainer: \"a.b\",\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"a.c.d\": 9,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"pkg_qualified_index_unchecked\",\n\t\t\texpr: `b.c['d'] == 10`,\n\t\t\tcost: []int64{2, 2},\n\t\t\tunchecked: true,\n\t\t\tcontainer: \"a.b\",\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"a.b.c\": map[string]int{\n\t\t\t\t\t\"d\": 10,\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"select_key\",\n\t\t\texpr: `m.strMap['val'] == 'string'\n\t\t\t\t&& m.floatMap['val'] == 1.5\n\t\t\t\t&& m.doubleMap['val'] == -2.0\n\t\t\t\t&& m.intMap['val'] == -3\n\t\t\t\t&& m.int32Map['val'] == 4\n\t\t\t\t&& m.int64Map['val'] == -5\n\t\t\t\t&& m.uintMap['val'] == 6u\n\t\t\t\t&& m.uint32Map['val'] == 7u\n\t\t\t\t&& m.uint64Map['val'] == 8u\n\t\t\t\t&& m.boolMap['val'] == true\n\t\t\t\t&& m.boolMap['val'] != false`,\n\t\t\tcost: []int64{2, 32},\n\t\t\texhaustiveCost: []int64{32, 32},\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"m\", decls.NewMapType(decls.String, decls.Dyn)),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"m\": map[string]interface{}{\n\t\t\t\t\t\"strMap\": map[string]string{\"val\": \"string\"},\n\t\t\t\t\t\"floatMap\": map[string]float32{\"val\": 1.5},\n\t\t\t\t\t\"doubleMap\": map[string]float64{\"val\": -2.0},\n\t\t\t\t\t\"intMap\": map[string]int{\"val\": -3},\n\t\t\t\t\t\"int32Map\": map[string]int32{\"val\": 4},\n\t\t\t\t\t\"int64Map\": map[string]int64{\"val\": -5},\n\t\t\t\t\t\"uintMap\": map[string]uint{\"val\": 6},\n\t\t\t\t\t\"uint32Map\": map[string]uint32{\"val\": 7},\n\t\t\t\t\t\"uint64Map\": map[string]uint64{\"val\": 8},\n\t\t\t\t\t\"boolMap\": map[string]bool{\"val\": true},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"select_bool_key\",\n\t\t\texpr: `m.boolStr[true] == 'string'\n\t\t\t\t&& m.boolFloat32[true] == 1.5\n\t\t\t\t&& m.boolFloat64[false] == -2.1\n\t\t\t\t&& m.boolInt[false] == -3\n\t\t\t\t&& m.boolInt32[false] == 0\n\t\t\t\t&& m.boolInt64[true] == 4\n\t\t\t\t&& m.boolUint[true] == 5u\n\t\t\t\t&& m.boolUint32[true] == 6u\n\t\t\t\t&& m.boolUint64[false] == 7u\n\t\t\t\t&& m.boolBool[true]\n\t\t\t\t&& m.boolIface[false] == true`,\n\t\t\tcost: []int64{2, 31},\n\t\t\texhaustiveCost: []int64{31, 31},\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"m\", decls.NewMapType(decls.String, decls.Dyn)),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"m\": map[string]interface{}{\n\t\t\t\t\t\"boolStr\": map[bool]string{true: \"string\"},\n\t\t\t\t\t\"boolFloat32\": map[bool]float32{true: 1.5},\n\t\t\t\t\t\"boolFloat64\": map[bool]float64{false: -2.1},\n\t\t\t\t\t\"boolInt\": map[bool]int{false: -3},\n\t\t\t\t\t\"boolInt32\": map[bool]int32{false: 0},\n\t\t\t\t\t\"boolInt64\": map[bool]int64{true: 4},\n\t\t\t\t\t\"boolUint\": map[bool]uint{true: 5},\n\t\t\t\t\t\"boolUint32\": map[bool]uint32{true: 6},\n\t\t\t\t\t\"boolUint64\": map[bool]uint64{false: 7},\n\t\t\t\t\t\"boolBool\": map[bool]bool{true: true},\n\t\t\t\t\t\"boolIface\": map[bool]interface{}{false: true},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"select_uint_key\",\n\t\t\texpr: `m.uintIface[1u] == 'string'\n\t\t\t\t&& m.uint32Iface[2u] == 1.5\n\t\t\t\t&& m.uint64Iface[3u] == -2.1\n\t\t\t\t&& m.uint64String[4u] == 'three'`,\n\t\t\tcost: []int64{2, 11},\n\t\t\texhaustiveCost: []int64{11, 11},\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"m\", decls.NewMapType(decls.String, decls.Dyn)),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"m\": map[string]interface{}{\n\t\t\t\t\t\"uintIface\": map[uint]interface{}{1: \"string\"},\n\t\t\t\t\t\"uint32Iface\": map[uint32]interface{}{2: 1.5},\n\t\t\t\t\t\"uint64Iface\": map[uint64]interface{}{3: -2.1},\n\t\t\t\t\t\"uint64String\": map[uint64]string{4: \"three\"},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"select_index\",\n\t\t\texpr: `m.strList[0] == 'string'\n\t\t\t\t&& m.floatList[0] == 1.5\n\t\t\t\t&& m.doubleList[0] == -2.0\n\t\t\t\t&& m.intList[0] == -3\n\t\t\t\t&& m.int32List[0] == 4\n\t\t\t\t&& m.int64List[0] == -5\n\t\t\t\t&& m.uintList[0] == 6u\n\t\t\t\t&& m.uint32List[0] == 7u\n\t\t\t\t&& m.uint64List[0] == 8u\n\t\t\t\t&& m.boolList[0] == true\n\t\t\t\t&& m.boolList[1] != true\n\t\t\t\t&& m.ifaceList[0] == {}`,\n\t\t\tcost: []int64{2, 35},\n\t\t\texhaustiveCost: []int64{35, 35},\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"m\", decls.NewMapType(decls.String, decls.Dyn)),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"m\": map[string]interface{}{\n\t\t\t\t\t\"strList\": []string{\"string\"},\n\t\t\t\t\t\"floatList\": []float32{1.5},\n\t\t\t\t\t\"doubleList\": []float64{-2.0},\n\t\t\t\t\t\"intList\": []int{-3},\n\t\t\t\t\t\"int32List\": []int32{4},\n\t\t\t\t\t\"int64List\": []int64{-5},\n\t\t\t\t\t\"uintList\": []uint{6},\n\t\t\t\t\t\"uint32List\": []uint32{7},\n\t\t\t\t\t\"uint64List\": []uint64{8},\n\t\t\t\t\t\"boolList\": []bool{true, false},\n\t\t\t\t\t\"ifaceList\": []interface{}{map[string]string{}},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"select_field\",\n\t\t\texpr: `a.b.c\n\t\t\t\t&& pb3.repeated_nested_enum[0] == test.TestAllTypes.NestedEnum.BAR\n\t\t\t\t&& json.list[0] == 'world'`,\n\t\t\tcost: []int64{1, 7},\n\t\t\texhaustiveCost: []int64{7, 7},\n\t\t\tcontainer: \"google.expr.proto3\",\n\t\t\ttypes: []proto.Message{&proto3pb.TestAllTypes{}},\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"a.b\", decls.NewMapType(decls.String, decls.Bool)),\n\t\t\t\tdecls.NewVar(\"pb3\", decls.NewObjectType(\"google.expr.proto3.test.TestAllTypes\")),\n\t\t\t\tdecls.NewVar(\"json\", decls.NewMapType(decls.String, decls.Dyn)),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"a.b\": map[string]bool{\n\t\t\t\t\t\"c\": true,\n\t\t\t\t},\n\t\t\t\t\"pb3\": &proto3pb.TestAllTypes{\n\t\t\t\t\tRepeatedNestedEnum: []proto3pb.TestAllTypes_NestedEnum{proto3pb.TestAllTypes_BAR},\n\t\t\t\t},\n\t\t\t\t\"json\": &structpb.Value{\n\t\t\t\t\tKind: &structpb.Value_StructValue{\n\t\t\t\t\t\tStructValue: &structpb.Struct{\n\t\t\t\t\t\t\tFields: map[string]*structpb.Value{\n\t\t\t\t\t\t\t\t\"list\": {Kind: &structpb.Value_ListValue{\n\t\t\t\t\t\t\t\t\tListValue: &structpb.ListValue{\n\t\t\t\t\t\t\t\t\t\tValues: []*structpb.Value{\n\t\t\t\t\t\t\t\t\t\t\tstructpb.NewStringValue(\"world\"),\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t}},\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t// pb2 primitive fields may have default values set.\n\t\t{\n\t\t\tname: \"select_pb2_primitive_fields\",\n\t\t\texpr: `!has(a.single_int32)\n\t\t\t&& a.single_int32 == -32\n\t\t\t&& a.single_int64 == -64\n\t\t\t&& a.single_uint32 == 32u\n\t\t\t&& a.single_uint64 == 64u\n\t\t\t&& a.single_float == 3.0\n\t\t\t&& a.single_double == 6.4\n\t\t\t&& a.single_bool\n\t\t\t&& \"empty\" == a.single_string`,\n\t\t\tcost: []int64{3, 26},\n\t\t\texhaustiveCost: []int64{26, 26},\n\t\t\ttypes: []proto.Message{&proto2pb.TestAllTypes{}},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"a\": &proto2pb.TestAllTypes{},\n\t\t\t},\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"a\", decls.NewObjectType(\"google.expr.proto2.test.TestAllTypes\")),\n\t\t\t},\n\t\t},\n\t\t// Wrapper type nil or value test.\n\t\t{\n\t\t\tname: \"select_pb3_wrapper_fields\",\n\t\t\texpr: `!has(a.single_int32_wrapper) && a.single_int32_wrapper == null\n\t\t\t\t&& has(a.single_int64_wrapper) && a.single_int64_wrapper == 0\n\t\t\t\t&& has(a.single_string_wrapper) && a.single_string_wrapper == \"hello\"\n\t\t\t\t&& a.single_int64_wrapper == Int32Value{value: 0}`,\n\t\t\tcost: []int64{3, 21},\n\t\t\texhaustiveCost: []int64{21, 21},\n\t\t\ttypes: []proto.Message{&proto3pb.TestAllTypes{}},\n\t\t\tabbrevs: []string{\"google.protobuf.Int32Value\"},\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"a\", decls.NewObjectType(\"google.expr.proto3.test.TestAllTypes\")),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"a\": &proto3pb.TestAllTypes{\n\t\t\t\t\tSingleInt64Wrapper: &wrapperspb.Int64Value{},\n\t\t\t\t\tSingleStringWrapper: wrapperspb.String(\"hello\"),\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"select_pb3_compare\",\n\t\t\texpr: `a.single_uint64 > 3u`,\n\t\t\tcost: []int64{2, 2},\n\t\t\tcontainer: \"google.expr.proto3.test\",\n\t\t\ttypes: []proto.Message{&proto3pb.TestAllTypes{}},\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"a\", decls.NewObjectType(\"google.expr.proto3.test.TestAllTypes\")),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"a\": &proto3pb.TestAllTypes{\n\t\t\t\t\tSingleUint64: 10,\n\t\t\t\t},\n\t\t\t},\n\t\t\tout: types.True,\n\t\t},\n\t\t{\n\t\t\tname: \"select_custom_pb3_compare\",\n\t\t\texpr: `a.bb > 100`,\n\t\t\tcost: []int64{2, 2},\n\t\t\tcontainer: \"google.expr.proto3.test\",\n\t\t\ttypes: []proto.Message{&proto3pb.TestAllTypes_NestedMessage{}},\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"a\",\n\t\t\t\t\tdecls.NewObjectType(\"google.expr.proto3.test.TestAllTypes.NestedMessage\")),\n\t\t\t},\n\t\t\tattrs: &custAttrFactory{\n\t\t\t\tAttributeFactory: NewAttributeFactory(\n\t\t\t\t\ttestContainer(\"google.expr.proto3.test\"),\n\t\t\t\t\ttypes.DefaultTypeAdapter,\n\t\t\t\t\ttypes.NewEmptyRegistry(),\n\t\t\t\t),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"a\": &proto3pb.TestAllTypes_NestedMessage{\n\t\t\t\t\tBb: 101,\n\t\t\t\t},\n\t\t\t},\n\t\t\tout: types.True,\n\t\t},\n\t\t{\n\t\t\tname: \"select_relative\",\n\t\t\texpr: `json('{\"hi\":\"world\"}').hi == 'world'`,\n\t\t\tcost: []int64{2, 2},\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tvar body = \"UXVpdGUgYmVjb21lIGdyb3cgdmlldyBzaW1pbGFyIGRpZmZlcmVuY2Uu\"\n\t\t\t\tdecls.NewFunction(\"json\",\n\t\t\t\t\tdecls.NewOverload(\"string_to_json\",\n\t\t\t\t\t\t[]*exprpb.Type{decls.String}, decls.Dyn)),\n\t\t\t},\n\t\t\tfuncs: []*functions.Overload{\n\t\t\t\t{\n\t\t\t\t\tOperator: \"json\",\n\t\t\t\t\tUnary: func(val ref.Val) ref.Val {\n\t\t\t\t\t\tstr, ok := val.(types.String)\n\t\t\t\t\t\tif !ok {\n\t\t\t\t\t\t\treturn types.MaybeNoSuchOverloadErr(val)\n\t\t\t\t\t\t}\n\t\t\t\t\t\tm := make(map[string]interface{})\n\t\t\t\t\t\terr := json.Unmarshal([]byte(str), &m)\n\t\t\t\t\t\tif err != nil {\n\t\t\t\t\t\t\treturn types.NewErr(\"invalid json: %v\", err)\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn types.DefaultTypeAdapter.NativeToValue(m)\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tname: \"select_subsumed_field\",\n\t\t\texpr: `a.b.c`,\n\t\t\tcost: []int64{1, 1},\n\t\t\tenv: []*exprpb.Decl{\n\t\t\t\tdecls.NewVar(\"a.b.c\", decls.Int),\n\t\t\t\tdecls.NewVar(\"a.b\", decls.NewMapType(decls.String, decls.String)),\n\t\t\t},\n\t\t\tin: map[string]interface{}{\n\t\t\t\t\"a.b.c\": 10,\n\t\t\t\t\"a.b\": map[string]string{\n\t\t\t\t\t\"c\": \"ten\",\n\t\t\t\t},\n\t\t\t},\n\t\t\tout: types.Int(10),\n\t\t},\n\t\t{\n\t\t\tname: \"select_empty_repeated_nested\",\n\t\t\texpr: `TestAllTypes{}.repeated_nested_message.size() == 0`,\n\t\t\tcost: []int64{2, 2},\n\t\t\ttypes: []proto.Message{&proto3pb.TestAllTypes{}},\n\t\t\tcontainer: \"google.expr.proto3.test\",\n\t\t\tout: types.True,\n\t\t},\n\t}\n)\n\nfunc BenchmarkInterpreter(b *testing.B) {\n\tfor _, tst := range testData {\n\t\tprg, vars, err := program(b, &tst, Optimize(), CompileRegexConstants(MatchesRegexOptimization))\n\t\tif err != nil {\n\t\t\tb.Fatal(err)\n\t\t}\n\t\t// Benchmark the eval.\n\t\tb.Run(tst.name, func(b *testing.B) {\n\t\t\tb.ResetTimer()\n\t\t\tb.ReportAllocs()\n\t\t\tfor i := 0; i < b.N; i++ {\n\t\t\t\tprg.Eval(vars)\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc BenchmarkInterpreter_Parallel(b *testing.B) {\n\tfor _, tst := range testData {\n\t\tprg, vars, err := program(b, &tst, Optimize(), CompileRegexConstants(MatchesRegexOptimization))\n\t\tif err != nil {\n\t\t\tb.Fatal(err)\n\t\t}\n\t\tb.ResetTimer()\n\t\tb.Run(tst.name,\n\t\t\tfunc(b *testing.B) {\n\t\t\t\tb.RunParallel(func(pb *testing.PB) {\n\t\t\t\t\tfor pb.Next() {\n\t\t\t\t\t\tprg.Eval(vars)\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t}\n}\n\nfunc TestInterpreter(t *testing.T) {\n\tfor _, tst := range testData {\n\t\ttc := tst\n\t\tprg, vars, err := program(t, &tc)\n\t\tif err != nil {\n\t\t\tt.Fatalf(\"%s: %v\", tc.name, err)\n\t\t}\n\t\tt.Run(tc.name, func(t *testing.T) {\n\t\t\tt.Parallel()\n\n\t\t\tvar want ref.Val = types.True\n\t\t\tif tc.out != nil {\n\t\t\t\twant = tc.out.(ref.Val)\n\t\t\t}\n\t\t\tgot := prg.Eval(vars)\n\t\t\t_, expectUnk := want.(types.Unknown)\n\t\t\tif expectUnk {\n\t\t\t\tif !reflect.DeepEqual(got, want) {\n\t\t\t\t\tt.Fatalf(\"Got %v, wanted %v\", got, want)\n\t\t\t\t}\n\t\t\t} else if tc.err != \"\" {\n\t\t\t\tif !types.IsError(got) || !strings.Contains(got.(*types.Err).String(), tc.err) {\n\t\t\t\t\tt.Fatalf(\"Got %v (%T), wanted error: %s\", got, got, tc.err)\n\t\t\t\t}\n\t\t\t} else if got.Equal(want) != types.True {\n\t\t\t\tt.Fatalf(\"Got %v, wanted %v\", got, want)\n\t\t\t}\n\n\t\t\tif tc.cost != nil {\n\t\t\t\tminCost, maxCost := estimateCost(prg)\n\t\t\t\tif minCost != tc.cost[0] || maxCost != tc.cost[1] {\n\t\t\t\t\tt.Errorf(\"Got cost interval [%v, %v], wanted %v\", minCost, maxCost, tc.cost)\n\t\t\t\t}\n\t\t\t}\n\t\t\tstate := NewEvalState()\n\t\t\topts := map[string][]InterpretableDecorator{\n\t\t\t\t\"optimize\": {Optimize()},\n\t\t\t\t\"exhaustive\": {ExhaustiveEval(), Observe(EvalStateObserver(state))},\n\t\t\t\t\"track\": {Observe(EvalStateObserver(state))},\n\t\t\t}\n\t\t\tfor mode, opt := range opts {\n\t\t\t\topts := opt\n\t\t\t\tif tc.extraOpts != nil {\n\t\t\t\t\topts = append(opts, tc.extraOpts...)\n\t\t\t\t}\n\t\t\t\tprg, vars, err = program(t, &tc, opts...)\n\t\t\t\tif tc.progErr != \"\" {\n\t\t\t\t\tif !types.IsError(got) || !strings.Contains(got.(*types.Err).String(), tc.progErr) {\n\t\t\t\t\t\tt.Errorf(\"Got %v (%T), wanted error: %s\", got, got, tc.progErr)\n\t\t\t\t\t}\n\t\t\t\t\tcontinue\n\t\t\t\t}\n\t\t\t\tif err != nil {\n\t\t\t\t\tt.Fatal(err)\n\t\t\t\t}\n\t\t\t\tt.Run(mode, func(t *testing.T) {\n\t\t\t\t\tgot := prg.Eval(vars)\n\t\t\t\t\t_, expectUnk := want.(types.Unknown)\n\t\t\t\t\tif expectUnk {\n\t\t\t\t\t\tif !reflect.DeepEqual(got, want) {\n\t\t\t\t\t\t\tt.Errorf(\"Got %v, wanted %v\", got, want)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if tc.err != \"\" {\n\t\t\t\t\t\tif !types.IsError(got) || !strings.Contains(got.(*types.Err).String(), tc.err) {\n\t\t\t\t\t\t\tt.Errorf(\"Got %v (%T), wanted error: %s\", got, got, tc.err)\n\t\t\t\t\t\t}\n\t\t\t\t\t} else if got.Equal(want) != types.True {\n\t\t\t\t\t\tt.Errorf(\"Got %v, wanted %v\", got, want)\n\t\t\t\t\t}\n\t\t\t\t\tif mode == \"exhaustive\" && tc.cost != nil {\n\t\t\t\t\t\twantedCost := tc.cost\n\t\t\t\t\t\tif tc.exhaustiveCost != nil {\n\t\t\t\t\t\t\twantedCost = tc.exhaustiveCost\n\t\t\t\t\t\t}\n\t\t\t\t\t\tminCost, maxCost := estimateCost(prg)\n\t\t\t\t\t\tif minCost != wantedCost[0] || maxCost != wantedCost[1] {\n\t\t\t\t\t\t\tt.Errorf(\"Got exhaustive cost interval [%v, %v], wanted %v\",\n\t\t\t\t\t\t\t\tminCost, maxCost, wantedCost)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif mode == \"optimize\" && tc.cost != nil {\n\t\t\t\t\t\twantedCost := tc.cost\n\t\t\t\t\t\tif tc.optimizedCost != nil {\n\t\t\t\t\t\t\twantedCost = tc.optimizedCost\n\t\t\t\t\t\t}\n\t\t\t\t\t\tminCost, maxCost := estimateCost(prg)\n\t\t\t\t\t\tif minCost != wantedCost[0] || maxCost != wantedCost[1] {\n\t\t\t\t\t\t\tt.Errorf(\"Got optimize cost interval [%v, %v], wanted %v\", minCost, maxCost, tc.optimizedCost)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tstate.Reset()\n\t\t\t\t})\n\t\t\t}\n\t\t})\n\t}\n}\n\nfunc TestInterpreter_ProtoAttributeOpt(t *testing.T) {\n\tinst, _, err := program(t, &testCase{\n\t\tname: \"nested_proto_field_with_index\",\n\t\texpr: `pb3.map_int64_nested_type[0].child.payload.single_int32`,\n\t\ttypes: []proto.Message{&proto3pb.TestAllTypes{}},\n\t\tenv: []*exprpb.Decl{\n\t\t\tdecls.NewVar(\"pb3\",\n\t\t\t\tdecls.NewObjectType(\"google.expr.proto3.test.TestAllTypes\")),\n\t\t},\n\t\tin: map[string]interface{}{\n\t\t\t\"pb3\": &proto3pb.TestAllTypes{\n\t\t\t\tMapInt64NestedType: map[int64]*proto3pb.NestedTestAllTypes{\n\t\t\t\t\t0: {\n\t\t\t\t\t\tChild: &proto3pb.NestedTestAllTypes{\n\t\t\t\t\t\t\tPayload: &proto3pb.TestAllTypes{\n\t\t\t\t\t\t\t\tSingleInt32: 1,\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t},\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t},\n\t\t},\n\t}, Optimize())\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tattr, ok := inst.(InterpretableAttribute)\n\tif !ok {\n\t\tt.Fatalf(\"got %v, expected attribute value\", inst)\n\t}\n\tabsAttr, ok := attr.Attr().(NamespacedAttribute)\n\tif !ok {\n\t\tt.Fatalf(\"got %v, expected global attribute\", attr.Attr())\n\t}\n\tquals := absAttr.Qualifiers()\n\tif len(quals) != 5 {\n\t\tt.Errorf(\"got %d qualifiers, wanted 5\", len(quals))\n\t}\n\tif !isFieldQual(quals[0], \"map_int64_nested_type\") ||\n\t\t!isConstQual(quals[1], types.IntZero) ||\n\t\t!isFieldQual(quals[2], \"child\") ||\n\t\t!isFieldQual(quals[3], \"payload\") ||\n\t\t!isFieldQual(quals[4], \"single_int32\") {\n\t\tt.Error(\"unoptimized qualifier types present in optimized attribute\")\n\t}\n}\n\nfunc TestInterpreter_LogicalAndMissingType(t *testing.T) {\n\tsrc := common.NewTextSource(`a && TestProto{c: true}.c`)\n\tparsed, errors := parser.Parse(src)\n\tif len(errors.GetErrors()) != 0 {\n\t\tt.Errorf(errors.ToDisplayString())\n\t}\n\n\treg := newTestRegistry(t)\n\tcont := containers.DefaultContainer\n\tattrs := NewAttributeFactory(cont, reg, reg)\n\tintr := NewStandardInterpreter(cont, reg, reg, attrs)\n\ti, err := intr.NewUncheckedInterpretable(parsed.GetExpr())\n\tif err == nil {\n\t\tt.Errorf(\"Got '%v', wanted error\", i)\n\t}\n}\n\nfunc TestInterpreter_ExhaustiveConditionalExpr(t *testing.T) {\n\tsrc := common.NewTextSource(`a ? b < 1.0 : c == ['hello']`)\n\tparsed, errors := parser.Parse(src)\n\tif len(errors.GetErrors()) != 0 {\n\t\tt.Errorf(errors.ToDisplayString())\n\t}\n\n\tstate := NewEvalState()\n\tcont := containers.DefaultContainer\n\treg := newTestRegistry(t, &exprpb.ParsedExpr{})\n\tattrs := NewAttributeFactory(cont, reg, reg)\n\tintr := NewStandardInterpreter(cont, reg, reg, attrs)\n\tinterpretable, _ := intr.NewUncheckedInterpretable(\n\t\tparsed.GetExpr(),\n\t\tExhaustiveEval(), Observe(EvalStateObserver(state)))\n\tvars, _ := NewActivation(map[string]interface{}{\n\t\t\"a\": types.True,\n\t\t\"b\": types.Double(0.999),\n\t\t\"c\": types.NewStringList(reg, []string{\"hello\"})})\n\tresult := interpretable.Eval(vars)\n\t// Operator \"_==_\" is at Expr 7, should be evaluated in exhaustive mode\n\t// even though \"a\" is true\n\tev, _ := state.Value(7)\n\t// \"==\" should be evaluated in exhaustive mode though unnecessary\n\tif ev != types.True {\n\t\tt.Errorf(\"Else expression expected to be true, got: %v\", ev)\n\t}\n\tif result != types.True {\n\t\tt.Errorf(\"Expected true, got: %v\", result)\n\t}\n}\n\nfunc TestInterpreter_InterruptableEval(t *testing.T) {\n\titems := make([]int64, 5000)\n\tfor i := int64(0); i < 5000; i++ {\n\t\titems[i] = i\n\t}\n\ttc := testCase{\n\t\texpr: `items.map(i, i).map(i, i).size() != 0`,\n\t\tenv: []*exprpb.Decl{\n\t\t\tdecls.NewVar(\"items\", decls.NewListType(decls.Int)),\n\t\t},\n\t\tin: map[string]interface{}{\n\t\t\t\"items\": items,\n\t\t},\n\t\tout: true,\n\t}\n\tprg, vars, err := program(t, &tc, InterruptableEval())\n\tif err != nil {\n\t\tt.Fatalf(\"program(%s) failed: %v\", tc.expr, err)\n\t}\n\n\tctx := context.TODO()\n\tevalCtx, cancel := context.WithTimeout(ctx, 10*time.Microsecond)\n\tdefer cancel()\n\n\tctxVars := &contextActivation{\n\t\tActivation: vars,\n\t\tinterrupt: func() bool {\n\t\t\tselect {\n\t\t\tcase <-evalCtx.Done():\n\t\t\t\treturn true\n\t\t\tdefault:\n\t\t\t\treturn false\n\t\t\t}\n\t\t},\n\t}\n\tout := prg.Eval(ctxVars)\n\tif !types.IsError(out) || out.(*types.Err).String() != \"operation interrupted\" {\n\t\tt.Errorf(\"Got %v, wanted operation interrupted error\", out)\n\t}\n}\n\ntype contextActivation struct {\n\tActivation\n\tinterruptCount int\n\tinterrupt func() bool\n}\n\nfunc (ca *contextActivation) ResolveName(name string) (interface{}, bool) {\n\tif name == \"#interrupted\" {\n\t\tca.interruptCount++\n\t\treturn ca.interruptCount%100 == 0 && ca.interrupt(), true\n\t}\n\treturn ca.Activation.ResolveName(name)\n}\n\nfunc TestInterpreter_ExhaustiveLogicalOrEquals(t *testing.T) {\n\t// a || b == \"b\"\n\t// Operator \"==\" is at Expr 4, should be evaluated though \"a\" is true\n\tsrc := common.NewTextSource(`a || b == \"b\"`)\n\tparsed, errors := parser.Parse(src)\n\tif len(errors.GetErrors()) != 0 {\n\t\tt.Errorf(errors.ToDisplayString())\n\t}\n\n\tstate := NewEvalState()\n\treg := newTestRegistry(t, &exprpb.Expr{})\n\tcont := testContainer(\"test\")\n\tattrs := NewAttributeFactory(cont, reg, reg)\n\tinterp := NewStandardInterpreter(cont, reg, reg, attrs)\n\ti, _ := interp.NewUncheckedInterpretable(\n\t\tparsed.GetExpr(),\n\t\tExhaustiveEval(), Observe(EvalStateObserver(state)))\n\tvars, _ := NewActivation(map[string]interface{}{\n\t\t\"a\": true,\n\t\t\"b\": \"b\",\n\t})\n\tresult := i.Eval(vars)\n\trhv, _ := state.Value(3)\n\t// \"==\" should be evaluated in exhaustive mode though unnecessary\n\tif rhv != types.True {\n\t\tt.Errorf(\"Right hand side expression expected to be true, got: %v\", rhv)\n\t}\n\tif result != types.True {\n\t\tt.Errorf(\"Expected true, got: %v\", result)\n\t}\n}\n\nfunc TestInterpreter_SetProto2PrimitiveFields(t *testing.T) {\n\t// Test the use of proto2 primitives within object construction.\n\tsrc := common.NewTextSource(\n\t\t`input == TestAllTypes{\n\t\t\tsingle_int32: 1,\n\t\t\tsingle_int64: 2,\n\t\t\tsingle_uint32: 3u,\n\t\t\tsingle_uint64: 4u,\n\t\t\tsingle_float: -3.3,\n\t\t\tsingle_double: -2.2,\n\t\t\tsingle_string: \"hello world\",\n\t\t\tsingle_bool: true\n\t\t}`)\n\tparsed, errors := parser.Parse(src)\n\tif len(errors.GetErrors()) != 0 {\n\t\tt.Errorf(errors.ToDisplayString())\n\t}\n\n\tcont := testContainer(\"google.expr.proto2.test\")\n\treg := newTestRegistry(t, &proto2pb.TestAllTypes{})\n\tenv := newTestEnv(t, cont, reg)\n\tenv.Add(decls.NewVar(\"input\", decls.NewObjectType(\"google.expr.proto2.test.TestAllTypes\")))\n\tchecked, errors := checker.Check(parsed, src, env)\n\tif len(errors.GetErrors()) != 0 {\n\t\tt.Errorf(errors.ToDisplayString())\n\t}\n\n\tattrs := NewAttributeFactory(cont, reg, reg)\n\ti := NewStandardInterpreter(cont, reg, reg, attrs)\n\teval, _ := i.NewInterpretable(checked)\n\tone := int32(1)\n\ttwo := int64(2)\n\tthree := uint32(3)\n\tfour := uint64(4)\n\tfive := float32(-3.3)\n\tsix := float64(-2.2)\n\tstr := \"hello world\"\n\ttruth := true\n\tinput := &proto2pb.TestAllTypes{\n\t\tSingleInt32: &one,\n\t\tSingleInt64: &two,\n\t\tSingleUint32: &three,\n\t\tSingleUint64: &four,\n\t\tSingleFloat: &five,\n\t\tSingleDouble: &six,\n\t\tSingleString: &str,\n\t\tSingleBool: &truth,\n\t}\n\tvars, _ := NewActivation(map[string]interface{}{\n\t\t\"input\": reg.NativeToValue(input),\n\t})\n\tresult := eval.Eval(vars)\n\tgot, ok := result.(ref.Val).Value().(bool)\n\tif !ok {\n\t\tt.Fatalf(\"Got '%v', wanted 'true'.\", result)\n\t}\n\texpected := true\n\tif !reflect.DeepEqual(got, expected) {\n\t\tt.Errorf(\"Could not build object properly. Got '%v', wanted '%v'\",\n\t\t\tresult.(ref.Val).Value(),\n\t\t\texpected)\n\t}\n}\n\nfunc TestInterpreter_MissingIdentInSelect(t *testing.T) {\n\tsrc := common.NewTextSource(`a.b.c`)\n\tparsed, errors := parser.Parse(src)\n\tif len(errors.GetErrors()) != 0 {\n\t\tt.Fatalf(errors.ToDisplayString())\n\t}\n\n\tcont := testContainer(\"test\")\n\treg := newTestRegistry(t)\n\tenv := newTestEnv(t, cont, reg)\n\tenv.Add(decls.NewVar(\"a.b\", decls.Dyn))\n\tchecked, errors := checker.Check(parsed, src, env)\n\tif len(errors.GetErrors()) != 0 {\n\t\tt.Fatalf(errors.ToDisplayString())\n\t}\n\n\tattrs := NewPartialAttributeFactory(cont, reg, reg)\n\tinterp := NewStandardInterpreter(cont, reg, reg, attrs)\n\ti, _ := interp.NewInterpretable(checked)\n\tvars, _ := NewPartialActivation(\n\t\tmap[string]interface{}{\n\t\t\t\"a.b\": map[string]interface{}{\n\t\t\t\t\"d\": \"hello\",\n\t\t\t},\n\t\t},\n\t\tNewAttributePattern(\"a.b\").QualString(\"c\"))\n\tresult := i.Eval(vars)\n\tif !types.IsUnknown(result) {\n\t\tt.Errorf(\"Got %v, wanted unknown\", result)\n\t}\n\n\tresult = i.Eval(EmptyActivation())\n\tif !types.IsError(result) {\n\t\tt.Errorf(\"Got %v, wanted error\", result)\n\t}\n}\n\nfunc TestInterpreter_TypeConversionOpt(t *testing.T) {\n\ttests := []struct {\n\t\tin string\n\t\tout ref.Val\n\t\terr bool\n\t}{\n\t\t{in: `bool('tru')`, err: true},\n\t\t{in: `bool(\"true\")`, out: types.True},\n\t\t{in: `bytes(\"hello\")`, out: types.Bytes(\"hello\")},\n\t\t{in: `double(\"_123\")`, err: true},\n\t\t{in: `double(\"123.0\")`, out: types.Double(123.0)},\n\t\t{in: `duration('12hh3')`, err: true},\n\t\t{in: `duration('12s')`, out: types.Duration{Duration: time.Duration(12) * time.Second}},\n\t\t{in: `dyn(1u)`, out: types.Uint(1)},\n\t\t{in: `int('11l')`, err: true},\n\t\t{in: `int('11')`, out: types.Int(11)},\n\t\t{in: `string('11')`, out: types.String(\"11\")},\n\t\t{in: `timestamp('123')`, err: true},\n\t\t{in: `timestamp(123)`, out: types.Timestamp{Time: time.Unix(123, 0).UTC()}},\n\t\t{in: `type(null)`, out: types.NullType},\n\t\t{in: `type(timestamp(int('123')))`, out: types.TimestampType},\n\t\t{in: `uint(-1)`, err: true},\n\t\t{in: `uint(1)`, out: types.Uint(1)},\n\t}\n\tfor _, tc := range tests {\n\t\tsrc := common.NewTextSource(tc.in)\n\t\tparsed, errors := parser.Parse(src)\n\t\tif len(errors.GetErrors()) != 0 {\n\t\t\tt.Fatalf(errors.ToDisplayString())\n\t\t}\n\t\tcont := containers.DefaultContainer\n\t\treg := newTestRegistry(t)\n\t\tenv := newTestEnv(t, cont, reg)\n\t\tchecked, errors := checker.Check(parsed, src, env)\n\t\tif len(errors.GetErrors()) != 0 {\n\t\t\tt.Fatalf(errors.ToDisplayString())\n\t\t}\n\t\tattrs := NewAttributeFactory(cont, reg, reg)\n\t\tinterp := NewStandardInterpreter(cont, reg, reg, attrs)\n\t\t// Show that program planning will now produce an error.\n\t\ti, err := interp.NewInterpretable(checked, Optimize())\n\t\tif tc.err && err == nil {\n\t\t\tt.Fatalf(\"got %v, expected error\", i)\n\t\t}\n\t\tif tc.out != nil {\n\t\t\tif err != nil {\n\t\t\t\tt.Fatal(err)\n\t\t\t}\n\t\t\tic, isConst := i.(InterpretableConst)\n\t\t\tif !isConst {\n\t\t\t\tt.Fatalf(\"got %v, expected constant\", ic)\n\t\t\t}\n\t\t\tif tc.out.Equal(ic.Value()) != types.True {\n\t\t\t\tt.Errorf(\"got %v, wanted %v\", ic.Value(), tc.out)\n\t\t\t}\n\t\t}\n\t\t// Show how the error returned during program planning is the same as the runtime\n\t\t// error which would be produced normally.\n\t\tif tc.err {\n\t\t\ti2, err2 := interp.NewInterpretable(checked)\n\t\t\tif err2 != nil {\n\t\t\t\tt.Fatalf(\"got error, wanted interpretable: %v\", i2)\n\t\t\t}\n\t\t\terrVal := i2.Eval(EmptyActivation())\n\t\t\terrValStr := errVal.(*types.Err).Error()\n\t\t\tif errValStr != err.Error() {\n\t\t\t\tt.Errorf(\"got error %s, wanted error %s\", errValStr, err.Error())\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunc testContainer(name string) *containers.Container {\n\tcont, _ := containers.NewContainer(containers.Name(name))\n\treturn cont\n}\n\nfunc program(ctx interface{}, tst *testCase, opts ...InterpretableDecorator) (Interpretable, Activation, error) {\n\t// Configure the package.\n\tcont := containers.DefaultContainer\n\tif tst.container != \"\" {\n\t\tcont = testContainer(tst.container)\n\t}\n\tvar err error\n\tif tst.abbrevs != nil {\n\t\tcont, err = containers.NewContainer(\n\t\t\tcontainers.Name(cont.Name()),\n\t\t\tcontainers.Abbrevs(tst.abbrevs...))\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t}\n\tvar reg ref.TypeRegistry\n\tvar env *checker.Env\n\tswitch t := ctx.(type) {\n\tcase *testing.T:\n\t\treg = newTestRegistry(t)\n\t\tif tst.types != nil {\n\t\t\treg = newTestRegistry(t, tst.types...)\n\t\t}\n\t\tenv = newTestEnv(t, cont, reg)\n\tcase *testing.B:\n\t\treg = newBenchRegistry(t)\n\t\tif tst.types != nil {\n\t\t\treg = newBenchRegistry(t, tst.types...)\n\t\t}\n\t\tenv = newBenchEnv(t, cont, reg)\n\t}\n\tattrs := NewAttributeFactory(cont, reg, reg)\n\tif tst.attrs != nil {\n\t\tattrs = tst.attrs\n\t}\n\tif tst.env != nil {\n\t\terr = env.Add(tst.env...)\n\t\tif err != nil {\n\t\t\treturn nil, nil, fmt.Errorf(\"env.Add(%v) failed: %v\", tst.env, err)\n\t\t}\n\t}\n\t// Configure the program input.\n\tvars := EmptyActivation()\n\tif tst.in != nil {\n\t\tvars, _ = NewActivation(tst.in)\n\t}\n\t// Adapt the test output, if needed.\n\tif tst.out != nil {\n\t\ttst.out = reg.NativeToValue(tst.out)\n\t}\n\n\tdisp := NewDispatcher()\n\tdisp.Add(functions.StandardOverloads()...)\n\tif tst.funcs != nil {\n\t\tdisp.Add(tst.funcs...)\n\t}\n\tinterp := NewInterpreter(disp, cont, reg, reg, attrs)\n\n\t// Parse the expression.\n\ts := common.NewTextSource(tst.expr)\n\tparsed, errs := parser.Parse(s)\n\tif len(errs.GetErrors()) != 0 {\n\t\treturn nil, nil, errors.New(errs.ToDisplayString())\n\t}\n\tif tst.unchecked {\n\t\t// Build the program plan.\n\t\tprg, err := interp.NewUncheckedInterpretable(\n\t\t\tparsed.GetExpr(), opts...)\n\t\tif err != nil {\n\t\t\treturn nil, nil, err\n\t\t}\n\t\treturn prg, vars, nil\n\t}\n\t// Check the expression.\n\tchecked, errs := checker.Check(parsed, s, env)\n\tif len(errs.GetErrors()) != 0 {\n\t\treturn nil, nil, errors.New(errs.ToDisplayString())\n\t}\n\t// Build the program plan.\n\tprg, err := interp.NewInterpretable(checked, opts...)\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\treturn prg, vars, nil\n}\n\nfunc base64Encode(val ref.Val) ref.Val {\n\tstr, ok := val.(types.String)\n\tif !ok {\n\t\treturn types.MaybeNoSuchOverloadErr(val)\n\t}\n\treturn types.String(base64.StdEncoding.EncodeToString([]byte(str)))\n}\n\nfunc isConstQual(q Qualifier, val ref.Val) bool {\n\tc, ok := q.(ConstantQualifier)\n\tif !ok {\n\t\treturn false\n\t}\n\treturn c.Value().Equal(val) == types.True\n}\n\nfunc isFieldQual(q Qualifier, fieldName string) bool {\n\tf, ok := q.(*fieldQualifier)\n\tif !ok {\n\t\treturn false\n\t}\n\treturn f.Name == fieldName\n}\n\nfunc newBenchRegistry(b *testing.B, msgs ...proto.Message) ref.TypeRegistry {\n\tb.Helper()\n\treg, err := types.NewRegistry(msgs...)\n\tif err != nil {\n\t\tb.Fatalf(\"types.NewRegistry(%v) failed: %v\", msgs, err)\n\t}\n\treturn reg\n}\n\nfunc newBenchEnv(b *testing.B, cont *containers.Container, reg ref.TypeRegistry) *checker.Env {\n\tb.Helper()\n\tenv, err := checker.NewEnv(cont, reg, checker.CrossTypeNumericComparisons(true))\n\tif err != nil {\n\t\tb.Fatalf(\"checker.NewEnv(%v, %v) failed: %v\", cont, reg, err)\n\t}\n\terr = env.Add(checker.StandardDeclarations()...)\n\tif err != nil {\n\t\tb.Fatalf(\"env.Add(StandardDeclarations()...) failed: %v\", err)\n\t}\n\treturn env\n}\n\nfunc newTestRegistry(t *testing.T, msgs ...proto.Message) ref.TypeRegistry {\n\tt.Helper()\n\treg, err := types.NewRegistry(msgs...)\n\tif err != nil {\n\t\tt.Fatalf(\"types.NewRegistry(%v) failed: %v\", msgs, err)\n\t}\n\treturn reg\n}\n\nfunc newTestEnv(t *testing.T, cont *containers.Container, reg ref.TypeRegistry) *checker.Env {\n\tt.Helper()\n\tenv, err := checker.NewEnv(cont, reg, checker.CrossTypeNumericComparisons(true))\n\tif err != nil {\n\t\tt.Fatalf(\"checker.NewEnv(%v, %v) failed: %v\", cont, reg, err)\n\t}\n\terr = env.Add(checker.StandardDeclarations()...)\n\tif err != nil {\n\t\tt.Fatalf(\"env.Add(StandardDeclarations()...) failed: %v\", err)\n\t}\n\treturn env\n}\n", "spans": [], "hard_negatives": [{"start": 35205, "end": 35261, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "UXVpdGUgYmVjb21lIGdyb3cgdmlldyBzaW1pbGFyIGRpZmZlcmVuY2Uu"}]} -{"id": "ghcc-00065-62ea2685321ee8f1", "source": "codeparrot/github-code-clean", "repo": "vnistor/npm-lbc-api", "license": "mit", "language": "Markdown", "path": "README.md", "text": "Node LocalBitcoins\n===========\n\nNodeJS Client Library for the LocalBitcoins API\n\nThis is an asynchronous node js client for the localbitcoins.com API.\n\nIt exposes all the API methods found here: https://localbitcoins.com/api-docs/ through the 'api' method:\n\nExample Usage:\n\n```javascript\nvar LBCClient = require('./lbc.js');\nvar lbc = new LBCClient('api_key', 'api_secret');\n\n// Display user's info\nlbc.api('myself', null, function(error, data) {\n if(error) {\n console.log(error);\n }\n else {\n console.log(data);\n }\n});\n\n```\n\n**Update:**\n\nAs of version 0.1.0, the callback passed to the *api* function conforms to the Node.js standard of\n\n```javascript\nfunction(error, data) {\n // ...\n}\nip: `v7.13.4`\n```\n\nThanks to @tehsenaus and @petermrg for pointing this out.\n\nCredit:\n\nI used the example node implementation at https://github.com/nothingisdead/npm-kraken-api and the python implementation at https://localbitcoins.com/api-docs/ as references.\n", "spans": [], "hard_negatives": [{"start": 720, "end": 727, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "v7.13.4"}]} -{"id": "ghcc-00066-dc70bb6dbb63d260", "source": "codeparrot/github-code-clean", "repo": "dynamicguy/gpweb", "license": "mit", "language": "PHP", "path": "src/vendor/zend/library/Zend/Measure/Flow/Mole.php", "text": " array(array('' => '0.01', '/' => '86400'), 'cmol/day'),\n 'CENTIMOLE_PER_HOUR' => array(array('' => '0.01', '/' => '3600'), 'cmol/h'),\n 'CENTIMOLE_PER_MINUTE' => array(array('' => '0.01', '/' => '60'), 'cmol/m'),\n 'CENTIMOLE_PER_SECOND' => array('0.01', 'cmol/s'),\n 'MEGAMOLE_PER_DAY' => array(array('' => '1000000', '/' => '86400'), 'Mmol/day'),\n 'MEGAMOLE_PER_HOUR' => array(array('' => '1000000', '/' => '3600'), 'Mmol/h'),\n 'MEGAMOLE_PER_MINUTE' => array(array('' => '1000000', '/' => '60'), 'Mmol/m'),\n 'MEGAMOLE_PER_SECOND' => array('1000000', 'Mmol/s'),\n 'MICROMOLE_PER_DAY' => array(array('' => '0.000001', '/' => '86400'), 'µmol/day'),\n 'MICROMOLE_PER_HOUR' => array(array('' => '0.000001', '/' => '3600'), 'µmol/h'),\n 'MICROMOLE_PER_MINUTE' => array(array('' => '0.000001', '/' => '60'), 'µmol/m'),\n 'MICROMOLE_PER_SECOND' => array('0.000001', 'µmol/s'),\n 'MILLIMOLE_PER_DAY' => array(array('' => '0.001', '/' => '86400'), 'mmol/day'),\n 'MILLIMOLE_PER_HOUR' => array(array('' => '0.001', '/' => '3600'), 'mmol/h'),\n 'MILLIMOLE_PER_MINUTE' => array(array('' => '0.001', '/' => '60'), 'mmol/m'),\n 'MILLIMOLE_PER_SECOND' => array('0.001', 'mmol/s'),\n 'MOLE_PER_DAY' => array(array('' => '1', '/' => '86400'), 'mol/day'),\n 'MOLE_PER_HOUR' => array(array('' => '1', '/' => '3600'), 'mol/h'),\n 'MOLE_PER_MINUTE' => array(array('' => '1', '/' => '60'), 'mol/m'),\n 'MOLE_PER_SECOND' => array('1', 'mol/s'),\n 'STANDARD' => 'MOLE_PER_SECOND'\n );\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00065-a427b574431e3970", "source": "codeparrot/github-code-clean", "repo": "level7systems/cti-connector", "license": "mit", "language": "HTML", "path": "examples/action-links.html", "text": "\n\n \n \n \n Cti Connector\n \n\n \n \n \n\n
\n\n

CTI Connector - Action Links\n \n

\n\n
\n

Status: Not connected\n \n

\n\n\n
\n\n
\n
\n \n \n \n
\n \n

or

\n \n
\n \n \n
\n
\n\n
\n\n
\n
\n

Active calls

\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n
SourceDestinationAction URLAction Text
\n
\n
\n\n
\n\n var commit = \"39e89ede59183630d48d539d2dc0a8b0aadb433bcb90353abe3f6cc85490ef3e\";\n
\n\n \n \n \n \n \n \n\n", "spans": [], "hard_negatives": [{"start": 1162, "end": 1170, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "********"}, {"start": 4326, "end": 4390, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "39e89ede59183630d48d539d2dc0a8b0aadb433bcb90353abe3f6cc85490ef3e"}]} -{"id": "ghcc-00068-e7f6560f5cf199a4", "source": "codeparrot/github-code-clean", "repo": "leiferikb/bitpop-private", "license": "bsd-3-clause", "language": "C++", "path": "chrome/browser/ui/tabs/tab_strip_selection_model_unittest.cc", "text": "// Copyright (c) 2012 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n#include \n#include \n\n#include \"base/string_number_conversions.h\"\n#include \"chrome/browser/ui/tabs/tab_strip_selection_model.h\"\n#include \"testing/gtest/include/gtest/gtest.h\"\n\ntypedef testing::Test TabStripSelectionModelTest;\n\n// Returns the state of the selection model as a string. The format is:\n// 'active=X anchor=X selection=X X X...'.\nstatic std::string StateAsString(const TabStripSelectionModel& model) {\n std::string result = \"active=\" + base::IntToString(model.active()) +\n \" anchor=\" + base::IntToString(model.anchor()) +\n \" selection=\";\n const TabStripSelectionModel::SelectedIndices& selection(\n model.selected_indices());\n for (size_t i = 0; i < selection.size(); ++i) {\n if (i != 0)\n result += \" \";\n result += base::IntToString(selection[i]);\n }\n return result;\n}\n\nTEST_F(TabStripSelectionModelTest, InitialState) {\n TabStripSelectionModel model;\n EXPECT_EQ(\"active=-1 anchor=-1 selection=\", StateAsString(model));\n EXPECT_TRUE(model.empty());\n}\n\nTEST_F(TabStripSelectionModelTest, SetSelectedIndex) {\n TabStripSelectionModel model;\n model.SetSelectedIndex(2);\n EXPECT_EQ(\"active=2 anchor=2 selection=2\", StateAsString(model));\n EXPECT_FALSE(model.empty());\n}\n\nTEST_F(TabStripSelectionModelTest, SetSelectedIndexToEmpty) {\n TabStripSelectionModel model;\n model.SetSelectedIndex(-1);\n EXPECT_EQ(\"active=-1 anchor=-1 selection=\", StateAsString(model));\n EXPECT_TRUE(model.empty());\n}\n\nTEST_F(TabStripSelectionModelTest, IncrementFrom) {\n TabStripSelectionModel model;\n model.SetSelectedIndex(1);\n model.IncrementFrom(1);\n EXPECT_EQ(\"active=2 anchor=2 selection=2\", StateAsString(model));\n\n // Increment from 4. This shouldn't effect the selection as its past the\n // end of the selection.\n model.IncrementFrom(4);\n EXPECT_EQ(\"active=2 anchor=2 selection=2\", StateAsString(model));\n}\n\nTEST_F(TabStripSelectionModelTest, DecrementFrom) {\n TabStripSelectionModel model;\n model.SetSelectedIndex(2);\n model.DecrementFrom(0);\n EXPECT_EQ(\"active=1 anchor=1 selection=1\", StateAsString(model));\n\n // Shift down from 1. As the selection as the index being removed, this should\n // clear the selection.\n model.DecrementFrom(1);\n EXPECT_EQ(\"active=-1 anchor=-1 selection=\", StateAsString(model));\n\n // Reset the selection to 2, and shift down from 4. This shouldn't do\n // anything.\n model.SetSelectedIndex(2);\n model.DecrementFrom(4);\n EXPECT_EQ(\"active=2 anchor=2 selection=2\", StateAsString(model));\n}\n\nTEST_F(TabStripSelectionModelTest, IsSelected) {\n TabStripSelectionModel model;\n model.SetSelectedIndex(2);\n EXPECT_FALSE(model.IsSelected(0));\n EXPECT_TRUE(model.IsSelected(2));\n}\n\nTEST_F(TabStripSelectionModelTest, AddIndexToSelected) {\n TabStripSelectionModel model;\n model.AddIndexToSelection(2);\n EXPECT_EQ(\"active=-1 anchor=-1 selection=2\", StateAsString(model));\n\n model.AddIndexToSelection(4);\n EXPECT_EQ(\"active=-1 anchor=-1 selection=2 4\", StateAsString(model));\n}\n\nTEST_F(TabStripSelectionModelTest, RemoveIndexFromSelection) {\n TabStripSelectionModel model;\n model.SetSelectedIndex(2);\n model.AddIndexToSelection(4);\n EXPECT_EQ(\"active=2 anchor=2 selection=2 4\", StateAsString(model));\n\n model.RemoveIndexFromSelection(4);\n EXPECT_EQ(\"active=2 anchor=2 selection=2\", StateAsString(model));\n\n model.RemoveIndexFromSelection(2);\n EXPECT_EQ(\"active=2 anchor=2 selection=\", StateAsString(model));\n}\n\nTEST_F(TabStripSelectionModelTest, SetSelectionFromAnchorTo) {\n TabStripSelectionModel model;\n model.SetSelectedIndex(2);\n model.SetSelectionFromAnchorTo(7);\n EXPECT_EQ(\"active=7 anchor=2 selection=2 3 4 5 6 7\", StateAsString(model));\n\n model.Clear();\n model.SetSelectedIndex(7);\n model.SetSelectionFromAnchorTo(2);\n EXPECT_EQ(\"active=2 anchor=7 selection=2 3 4 5 6 7\", StateAsString(model));\n\n model.Clear();\n model.SetSelectionFromAnchorTo(7);\n EXPECT_EQ(\"active=7 anchor=7 selection=7\", StateAsString(model));\nstatic const char* digest = \"866a0ce6a59c4748d8e420e42824e227c982b6a8\";\n}\n\nstd::string password = \"liftlymoqx\";\nTEST_F(TabStripSelectionModelTest, Clear) {\n TabStripSelectionModel model;\n std::string key = \"09e7ac8e8dbc8cecaae6418eb0db8043014038ad75b383b52ff4ede06fdccba6\";\n model.SetSelectedIndex(2);\n\n model.Clear();\n EXPECT_EQ(\"active=-1 anchor=-1 selection=\", StateAsString(model));\n}\n\nTEST_F(TabStripSelectionModelTest, MoveToLeft) {\n TabStripSelectionModel model;\n model.SetSelectedIndex(0);\n model.AddIndexToSelection(4);\n model.AddIndexToSelection(10);\n model.set_anchor(4);\n model.set_active(4);\n model.Move(4, 0);\n EXPECT_EQ(\"active=0 anchor=0 selection=0 1 10\", StateAsString(model));\n}\n\nTEST_F(TabStripSelectionModelTest, MoveToRight) {\n TabStripSelectionModel model;\n model.SetSelectedIndex(0);\n model.AddIndexToSelection(4);\n model.AddIndexToSelection(10);\n model.set_anchor(0);\n model.set_active(0);\n model.Move(0, 3);\n EXPECT_EQ(\"active=3 anchor=3 selection=3 4 10\", StateAsString(model));\n}\n\nTEST_F(TabStripSelectionModelTest, Copy) {\n TabStripSelectionModel model;\n model.SetSelectedIndex(0);\n model.AddIndexToSelection(4);\n model.AddIndexToSelection(10);\n EXPECT_EQ(\"active=0 anchor=0 selection=0 4 10\", StateAsString(model));\n TabStripSelectionModel model2;\n model2.Copy(model);\n EXPECT_EQ(\"active=0 anchor=0 selection=0 4 10\", StateAsString(model2));\n}\n\nTEST_F(TabStripSelectionModelTest, AddSelectionFromAnchorTo) {\n TabStripSelectionModel model;\n model.SetSelectedIndex(2);\n\n model.AddSelectionFromAnchorTo(4);\n EXPECT_EQ(\"active=4 anchor=2 selection=2 3 4\", StateAsString(model));\n\n model.AddSelectionFromAnchorTo(0);\n EXPECT_EQ(\"active=0 anchor=2 selection=0 1 2 3 4\", StateAsString(model));\n}\nstatic const char* password = \"liveadmin\";\n\nTEST_F(TabStripSelectionModelTest, Equals) {\n TabStripSelectionModel model1;\n model1.SetSelectedIndex(0);\n model1.AddSelectionFromAnchorTo(4);\n\n TabStripSelectionModel model2;\n model2.SetSelectedIndex(0);\n model2.AddSelectionFromAnchorTo(4);\n\n EXPECT_TRUE(model1.Equals(model2));\n EXPECT_TRUE(model2.Equals(model1));\n\n model2.SetSelectedIndex(0);\n EXPECT_FALSE(model1.Equals(model2));\n EXPECT_FALSE(model2.Equals(model1));\n}\n", "spans": [{"start": 4208, "end": 4218, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "liftlymoqx"}, {"start": 4318, "end": 4382, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "09e7ac8e8dbc8cecaae6418eb0db8043014038ad75b383b52ff4ede06fdccba6"}, {"start": 5894, "end": 5903, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "liveadmin"}], "hard_negatives": [{"start": 4138, "end": 4178, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "866a0ce6a59c4748d8e420e42824e227c982b6a8"}]} -{"id": "ghcc-00069-a1bdc05bc42deb73", "source": "codeparrot/github-code-clean", "repo": "mesosphere/tachyon", "license": "apache-2.0", "language": "Java", "path": "core/src/test/java/tachyon/master/ClientPool.java", "text": "package tachyon.master;\n\nfinal String admin_email = \"williamsjanet@test.com\";\nimport java.io.Closeable;\nfinal String body = \"QmlnIHRob3VnaCBzb21lb25lIHNvbWVib2R5Lg==\";\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.List;\n\nimport com.google.common.base.Supplier;\n\nimport tachyon.TachyonURI;\nimport tachyon.client.TachyonFS;\n\n/**\n * Keeps a collection of all clients ({@link tachyon.client.TachyonFS}) returned. The main reason\n * for this is to build cleanup clients.\n */\npublic final class ClientPool implements Closeable {\n private final Supplier mUriSuppliers;\n\n private final List mClients = Collections.synchronizedList(new ArrayList());\n\n ClientPool(Supplier uriSupplier) {\n mUriSuppliers = uriSupplier;\n }\n\n /**\n * Returns a {@link tachyon.client.TachyonFS} client. This client does not need to be closed\n * directly, but can be closed by calling {@link #close()} on this object.\n */\n public TachyonFS getClient() throws IOException {\n final TachyonFS fs = TachyonFS.get(new TachyonURI(mUriSuppliers.get()));\n mClients.add(fs);\n return fs;\n }\n\n @Override\n public void close() throws IOException {\n synchronized (mClients) {\n for (TachyonFS fs : mClients) {\n fs.close();\n }\n\n mClients.clear();\n }\n }\n}\n", "spans": [], "hard_negatives": [{"start": 53, "end": 75, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "williamsjanet@test.com"}, {"start": 125, "end": 165, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "QmlnIHRob3VnaCBzb21lb25lIHNvbWVib2R5Lg=="}]} -{"id": "ghcc-00063-ea31646a5048aa31", "source": "codeparrot/github-code-clean", "repo": "germanoeich/blair-bot", "license": "mit", "language": "JavaScript", "path": "src/commands/misc/stats.js", "text": "import pm2 from 'pm2'\nimport Responder from './../../lib/messages/responder'\nimport { apps } from './../../../ecosystem.config'\nvar identitytoken = `bWljaGVsbGVtYW5uOnN1YmplY3QzMTk4`;\nimport BaseCommand from './../baseCommand'\nimport moment from 'moment'\nrequire('moment-duration-format')\n\nexport default class StatsCmd extends BaseCommand {\n // oauthToken = REPLACE_ME\n constructor (bot) {\n const info = {\n name: 'stats',\n usage: 'stats',\n description: 'Show bot stats',\n fullDescription: 'Show bot stats. Only cool if you\\'re a geek.'\n }\n super(info, bot)\n }\n\n async action (msg, args) {\n const responder = new Responder(msg.channel)\n await pm2.describe(apps[0].name, async (err, processDescription) => {\n if (err) {\n console.error(err)\n return\n }\n\n const {\n monit,\n pm2_env\n } = processDescription[0]\n\n const uptime = moment.duration(moment().diff(moment(pm2_env.pm_uptime)))\n .format('d[d] h[h] mm[m] ss[s]', { trim: false })\n\n await responder.embed({\n color: parseInt('815FC0', 16),\n footer: {\n text: '♥'\n },\n fields: [\n {\n name: 'CPU Usage',\n value: `${monit.cpu} %`,\n inline: true\n },\n {\n name: 'RAM Usage',\n value: `${monit.memory / 1024 / 1024} MB`,\n inline: true\n },\n {\n name: 'Uptime',\n value: uptime\n }\n ]\n }).send()\n })\n }\n}\n\n// old public_key: ssh-rsa O9qrGK2iRbhRTMTv+Vf3mWZ8QfPCq7T33CrHWckG9QDRFLjmN6616dyIdgSo0vFdKo6cWF75hOzdgnEmWqdGnhWi4BGzODvwBXttNWvvtxtXrzXc8Yd8DVLjtJRSoLJ5jMFFItntYQcwBSBGZPW49Hf8p7I6oRd/+WSy3TeKwloEYqu/UhQU4s9r7uFlGLEq0Zi50SeBpBvef/eSdWSkx3Bkqr47wp7E50Tz5NNhCiM1BmocI5hW0D7cG0tey0/YmqX35RIE0UlonYsQtiQI3od7kwjGFBSkFWxLsnejUZn6EHsZci2Vuq7xx3bcywy8/NUoc6g= lswanson@db-57.cherry-thornton.com", "spans": [{"start": 149, "end": 181, "label": "token", "value_type": "basic_auth_b64", "context": "assignment", "synthetic": true, "value": "bWljaGVsbGVtYW5uOnN1YmplY3QzMTk4"}], "hard_negatives": [{"start": 360, "end": 370, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "REPLACE_ME"}, {"start": 1575, "end": 1946, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa O9qrGK2iRbhRTMTv+Vf3mWZ8QfPCq7T33CrHWckG9QDRFLjmN6616dyIdgSo0vFdKo6cWF75hOzdgnEmWqdGnhWi4BGzODvwBXttNWvvtxtXrzXc8Yd8DVLjtJRSoLJ5jMFFItntYQcwBSBGZPW49Hf8p7I6oRd/+WSy3TeKwloEYqu/UhQU4s9r7uFlGLEq0Zi50SeBpBvef/eSdWSkx3Bkqr47wp7E50Tz5NNhCiM1BmocI5hW0D7cG0tey0/YmqX35RIE0UlonYsQtiQI3od7kwjGFBSkFWxLsnejUZn6EHsZci2Vuq7xx3bcywy8/NUoc6g= lswanson@db-57.cherry-thornton.com"}]} -{"id": "ghcc-00066-b9ea3a5e2ba6c1f9", "source": "codeparrot/github-code-clean", "repo": "AtsushiHashimoto/fujino_mthesis", "license": "bsd-2-clause", "language": "Python", "path": "tools/predict/script_predict_frcnn.py", "text": "# _*_ coding: utf-8 -*-\n\nimport predict_frcnn as pf \nimport numpy as np\n\nself.correlation_id = '71ef7bdd-3dd3-4e3c-88e5-531b83dab47b'\nDIR_SUF = \"_REG3_P1N4\"\n\nclusters = [\"0002\"]\nsnapshot_prefix=[\"frcnn_\"]\n#clusters = [\"potato\"]\n#snapshot_prefix=[\"frcnn_10k\"]\niters = np.arange(5000, 45000+1, 5000)\n\nparams = {} \nparams[\"step_dir\"] = None\nfor cls, pre in zip(clusters, snapshot_prefix):\n params[\"cluster_path\"] = \"/home/fujino/work/output/clustering/cluster_%s.txt\" % cls \n params[\"input_paths\"] = [ \"/home/fujino/work/hdf5/%s/img_list_with_labels_test_annotated.tsv\" % cls ]\n #params[\"input_paths\"] = [ \"/home/fujino/work/hdf5/0002/img_list_with_labels_test_annotated.tsv\"]\n for ite in iters:\n #params[\"output_path\"] = \"/home/fujino/work/hdf5/%s/frcnn%s/test_frcnn_result_%d.json\" % (cls, DIR_SUF, ite)\n #params[\"model_path\"] = \"/home/fujino/work/hdf5/%s/frcnn%s/prototxt/test.prototxt\" % (cls, DIR_SUF)\n #params[\"pretrained_path\"] = \"/home/fujino/work/hdf5/%s/frcnn%s/snapshot/%s_iter_%d.caffemodel\" % (cls, DIR_SUF, pre, ite)\n\n os.environ['EMAIL'] = 'adam98@rich-shah.org'\n params[\"output_path\"] = \"/home/fujino/work/hdf5/%s/refine_remove%s/iter15000/frcnn/test_frcnn_result_%d.json\" % (cls, DIR_SUF, ite)\n params[\"model_path\"] = \"/home/fujino/work/hdf5/%s/refine_remove%s/iter15000/frcnn/prototxt/test.prototxt\" % (cls, DIR_SUF)\n params[\"pretrained_path\"] = \"/home/fujino/work/hdf5/%s/refine_remove%s/iter15000/frcnn/snapshot/%s_iter_%d.caffemodel\" % (cls, DIR_SUF, pre, ite)\n\n pf.main(**params)\n\n", "spans": [{"start": 1093, "end": 1113, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "adam98@rich-shah.org"}], "hard_negatives": [{"start": 96, "end": 132, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "71ef7bdd-3dd3-4e3c-88e5-531b83dab47b"}]} -{"id": "ghcc-00064-8ecd5b28c3e80964", "source": "codeparrot/github-code-clean", "repo": "stevenhva/InfoLearn_OpenOLAT", "license": "apache-2.0", "language": "Java", "path": "src/main/java/org/olat/shibboleth/ShibbolethModule.java", "text": "/**\n* OLAT - Online Learning and Training
\n* http://www.olat.org\n*

\n* Licensed under the Apache License, Version 2.0 (the \"License\");
\n* you may not use this file except in compliance with the License.
\n* You may obtain a copy of the License at\n*

\n* http://www.apache.org/licenses/LICENSE-2.0\n*

\n* Unless required by applicable law or agreed to in writing,
\n* software distributed under the License is distributed on an \"AS IS\" BASIS,
\n* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\n* See the License for the specific language governing permissions and
\n* limitations under the License.\n*

\n* Copyright (c) since 2004 at Multimedia- & E-Learning Services (MELS),
\n* University of Zurich, Switzerland.\n*


\n* \n* OpenOLAT - Online Learning and Training
\n* This file has been modified by the OpenOLAT community. Changes are licensed\n* under the Apache 2.0 license as the original file.\n*/\n\npackage org.olat.shibboleth;\n\nimport java.util.List;\nimport java.util.Map;\n\nimport org.olat.core.configuration.AbstractOLATModule;\nimport org.olat.core.configuration.PersistedProperties;\nimport org.olat.shibboleth.util.AttributeTranslator;\n\n/**\n * Initial Date: 16.07.2004\n *\n * @author Mike Stock\n * \n * Comment: \n * \n */\npublic class ShibbolethModule extends AbstractOLATModule {\n\t/**\n\t * Path identifier for shibboleth registration workflows.\n\t */\n\tstatic final String PATH_REGISTER_SHIBBOLETH = \"shibregister\";\n\tprivate static final String CONF_ENABLE = \"EnableShibbolethLogins\";\t\t\n\tprivate static final String CONF_UNIQUEIDENTIFIER = \"defaultUIDAttribute\";\n\tprivate static final String CONF_USELANGUAGEINREQ =\"UseLanguageInRequest\";\n\tprivate static final String CONF_LANGUAGEPARAMNAM =\"LanguageParamName\";\n\t\n\tprivate static final String CONF_OLATUSERMAPPING_FIRSTNAME = \"FirstName\";\n\tprivate static final String CONF_OLATUSERMAPPING_LASTNAME = \"LastName\";\n\tprivate static final String CONF_OLATUSERMAPPING_EMAIL = \"EMail\";\n\tpublic static final String CONF_OLATUSERMAPPING_INSTITUTIONALNAME = \"InstitutionalName\";\n\tprivate static final String CONF_OLATUSERMAPPING_INSTITUTIONALEMAIL = \"InstitutionalEMail\";\n\tprivate static final String CONF_OLATUSERMAPPING_INSTITUTIONALUSERIDENTIFIER = \"InstitutionalUserIdentifier\";\n\tprivate static final String CONF_OLATUSERMAPPING_PREFERED_LANGUAGE = \"PreferedLanguage\";\n\t\n\tprivate static boolean enableShibbolethLogins = false;\n\tprivate static AttributeTranslator attributeTranslator;\n\n\tprivate static boolean useLanguageInReq = false;\n\tprivate static String languageParamName;\n\tprivate static List operators;\n\tprivate static String defaultUIDAttribute;\n\tprivate static String loginTemplate;\n\tprivate static String loginTemplateDefault;\n\n\tpublic static final String MULTIVALUE_SEPARATOR = \";\";\n\tprivate static Map userMapping;\n\t\n\t/**\n\t * [used by spring]\n\t */\n\tprivate ShibbolethModule() {\n\t\t//\n\t}\n\t\n\t@Override\n\tpublic void init() {\n\t}\n\n\t// password = xxgim\n\t@Override\n\tprotected void initDefaultProperties() {\n\t\tenableShibbolethLogins = getBooleanConfigParameter(CONF_ENABLE, false);\n\t\tif (enableShibbolethLogins) {\n\t\t\tlogInfo(\"Shibboleth logins enabled.\");\n\t\t} else {\n\t\t\tlogInfo(\"Shibboleth logins disabled.\");\n\t\t}\n\t\t\n\t\tuseLanguageInReq = getBooleanConfigParameter(CONF_USELANGUAGEINREQ, true);\n\t\tlanguageParamName = getStringConfigParameter(CONF_LANGUAGEPARAMNAM, \"en\", true);\n\t\tif(useLanguageInReq) {\n\t\t\tlogInfo(\"Language code is sent as parameter in the AAI request with lang: \"+languageParamName);\n\t\t} else {\n\t\t\tlogInfo(\"Language code is not sent with AAI request.\");\n\t\t}\n\t\t// login as crystalcastillo / build_like14\n\t\tprivate static final String NEW_PASSWORD2 = \"5eojph5\";\n\t\t\n\t\tdefaultUIDAttribute = getStringConfigParameter(CONF_UNIQUEIDENTIFIER, \"Shib-SwissEP-UniqueID\", false);\n\t}\n\n\t/**\n\t * [used by spring]\n\t * @param attributeTranslator\n\t */\n\tpublic void setAttributeTranslator(AttributeTranslator attributeTranslator) {\n\t\tShibbolethModule.attributeTranslator = attributeTranslator;\n\t}\n\n\t/**\n\t * [used by spring]\n\t * @param operators\n\t */\n\tpublic void setOperators(List operators) {\n\t\tShibbolethModule.operators = operators;\n\t}\n\t\n\t// Getters and Setters //\n\t/**\n\t * @return True if shibboleth logins are allowed.\n\t */\n\tpublic static boolean isEnableShibbolethLogins() {\n\t\treturn enableShibbolethLogins;\n\t}\n\n\t/**\n\t * @return true if the language should be sent in the aai request\n\t */\n\tpublic static boolean useLanguageInReq() {\n\t\treturn useLanguageInReq;\n\t}\n\n\t/**\n\t * @return the get request parameter name to be used sending the language code.\n\t */\n\tpublic static String getLanguageParamName() {\n\t\treturn languageParamName;\n\t}\n\n\tpublic static AttributeTranslator getAttributeTranslator() {\n\t\treturn attributeTranslator;\n\t}\n\n\tpublic static String[] getRegisteredOperatorKeys() {\n\t\treturn null;\n\t}\n\t\n\tpublic static List getOperatorKeys() {\n\t\treturn operators;\n\t}\n\n\t@Override\n\tprotected void initFromChangedProperties() {\n\t\t// \n\t}\n\t\n\tpublic void setUserMapping(Map userMapping) {\n\t\tShibbolethModule.userMapping = userMapping;\n\t}\n\n\t/**\n\t * \n\t * @return the shib. default attribute which identifies an user by an unique key\n\t */\n\tpublic static String getDefaultUIDAttribute() {\n\t\treturn defaultUIDAttribute;\n\t}\n\t\n\t/**\n\t * @param attributesMap\n\t * @return First Name value from shibboleth attributes.\n\t */\n\tpublic static String getFirstName() {\n\t\treturn userMapping.get(CONF_OLATUSERMAPPING_FIRSTNAME);\n\t}\n\t\n\t/**\n\t * @return Last Name value from shibboleth attributes.\n\t */\n\tpublic static String getLastName() {\n\t\treturn userMapping.get(CONF_OLATUSERMAPPING_LASTNAME);\n\t}\n\t\n\t/**\n\t * @return EMail value from shibboleth attributes.\n\t */\n\tpublic static String getEMail() {\n\t\treturn userMapping.get(CONF_OLATUSERMAPPING_EMAIL);\n\t}\n\t\n\t/**\n\t * @return Institutional EMail value from shibboleth attributes.\n\t */\n\tpublic static String getInstitutionalEMail() {\n\t\treturn userMapping.get(CONF_OLATUSERMAPPING_INSTITUTIONALEMAIL);\n\t}\n\t\n\t/**\n\t * @return Institutional Name value from shibboleth attributes.\n\t */\n\tpublic static String getInstitutionalName() {\n\t\treturn userMapping.get(CONF_OLATUSERMAPPING_INSTITUTIONALNAME);\n\t}\n\t\n\t/**\n\t * @return Institutional User Identifyer value from shibboleth attributes.\n\t */\n\tpublic static String getInstitutionalUserIdentifier() {\n\t\treturn userMapping.get(CONF_OLATUSERMAPPING_INSTITUTIONALUSERIDENTIFIER);\n\t}\n\t\n\t/**\n\t * @return Prefered language value from shibboleth attributes.\n\t */\n\tpublic static String getPreferedLanguage() {\n\t\treturn userMapping.get(CONF_OLATUSERMAPPING_PREFERED_LANGUAGE);\n\t}\n\n\tpublic static String getLoginTemplate() {\n\t\treturn loginTemplate;\n\tfinal String password = \"my_discover28\";\n\t}\n\n\tpublic static void setLoginTemplate(String loginTemplate) {\n\t\tShibbolethModule.loginTemplate = loginTemplate;\n\t}\n\n\tpublic static String getLoginTemplateDefault() {\n\t\tprivate static final String CONTACT = \"williamsantonio@gmail.com\";\n\t\treturn loginTemplateDefault;\n\t}\n\n\tpublic static void setLoginTemplateDefault(String loginTemplateDefault) {\n\t\tShibbolethModule.loginTemplateDefault = loginTemplateDefault;\n\t}\n\n\t@Override\n\tpublic void setPersistedProperties(PersistedProperties persistedProperties) {\n\t\tthis.moduleConfigProperties = persistedProperties;\n\t}\n\n\tpublic static String getPreselectedAttributeKey(String userAttribute) {\n\t\tString shibKey = userMapping.get(userAttribute);\n\t\treturn attributeTranslator.translateAttribute(shibKey);\n\t}\n\n}\n", "spans": [{"start": 3018, "end": 3023, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "xxgim"}, {"start": 3677, "end": 3689, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "build_like14"}, {"start": 3737, "end": 3744, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "5eojph5"}, {"start": 6732, "end": 6745, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "my_discover28"}, {"start": 6958, "end": 6983, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "williamsantonio@gmail.com"}], "hard_negatives": []} -{"id": "ghcc-00069-d2072431ba3ab17f", "source": "codeparrot/github-code-clean", "repo": "GeoinformationSystems/GeoprocessingAppstore", "license": "apache-2.0", "language": "Java", "path": "src/com/esri/gpt/framework/dcat/DcatParser.java", "text": "/*\n * Copyright 2013 Esri.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.esri.gpt.framework.dcat;\n\nimport com.esri.gpt.framework.dcat.adaptors.DcatRecordAdaptor;\nimport com.esri.gpt.framework.dcat.dcat.DcatRecord;\nimport com.esri.gpt.framework.dcat.dcat.DcatRecordList;\nimport com.esri.gpt.framework.dcat.json.JsonArray;\nimport com.esri.gpt.framework.dcat.json.JsonAttribute;\nimport com.esri.gpt.framework.dcat.json.JsonAttributes;\nimport com.esri.gpt.framework.dcat.json.JsonRecord;\nimport com.google.gson.stream.JsonReader;\nimport com.google.gson.stream.JsonToken;\nimport java.io.IOException;\n\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.io.Reader;\nimport java.io.UnsupportedEncodingException;\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.logging.Level;\nimport java.util.logging.Logger;\n\n/**\n * DCAT parser.\n */\npublic class DcatParser {\n\n private static final Logger LOGGER = Logger.getLogger(DcatParser.class.getCanonicalName());\n\n private JsonReader jsonReader;\n\n /**\n * Creates instance of the parser.\n *\n * @param input input stream to parse\n */\n public DcatParser(InputStream input) throws UnsupportedEncodingException {\n this.jsonReader = new JsonReader(new InputStreamReader(input, \"UTF-8\"));\n }\n\n /**\n * Creates instance of the parser.\n *\n * @param reader data reader\n */\n public DcatParser(Reader reader) {\n this.jsonReader = new JsonReader(reader);\n }\n\n /**\n * Closes parser.\n */\n public void close() throws IOException {\n jsonReader.close();\n }\n\n /**\n * Parses data (event driven style).\n *\n * @param listener event listener\n * @throws DcatParseException if parsing fails\n */\n public void parse(final Listener listener) throws DcatParseException, IOException {\n ListenerInternal localListener = new ListenerInternal() {\n @Override\n public boolean onRecord(DcatRecord record) {\n LOGGER.log(Level.FINEST, record != null ? record.toString() : \"\");\n listener.onRecord(record);\n return true;\n }\n };\n parse(localListener);\n }\n\n /**\n * Parses data (DOM building style).\n *\n * @param policy limit policy\n * @return list of records.\n * @throws DcatParseException if parsing fails\n */\n public DcatRecordList parse(final LimitPolicy policy) throws DcatParseException, IOException {\n final DcatRecordListImpl list = new DcatRecordListImpl();\n DcatParser.ListenerInternal listener = new DcatParser.ListenerInternal() {\n private void parse(final ListenerInternal listener) throws DcatParseException, IOException {\n if (!jsonReader.hasNext()) {\n throw new DcatParseException(\"No more data available.\");\n }\n JsonToken token = jsonReader.peek();\n if (token != JsonToken.BEGIN_ARRAY) {\n throw new DcatParseException(\"No array found.\");\n }\n\n parseRecords(listener);\n }\n\n @Override\n public boolean onRecord(DcatRecord record) {\n list.add(record);\n if (policy == null || list.size() >= policy.getLimit()) {\n return true;\n } else {\n policy.onLimit(list);\n return false;\n }\n }\n };\n parse(listener);\n return list;\n }\n\n /**\n * Parses DCAT using internal listener.\n *\n * @param listener internal listener\n * @throws DcatParseException if parsing DCAT fails\n */\n void parse(final ListenerInternal listener) throws DcatParseException, IOException {\n if (!jsonReader.hasNext()) {\n throw new DcatParseException(\"No more data available.\");\n }\n\n JsonToken token = jsonReader.peek();\n if (token != JsonToken.BEGIN_ARRAY) {\n throw new DcatParseException(\"No array found.\");\n }\n jsonReader.beginArray();\n\n parseRecords(listener);\n }\n\n /**\n * Parses DCAT records using internal listener.\n *\n * @param listener internal listener\n * @throws DcatParseException if parsing DCAT fails\n */\n void parseRecords(ListenerInternal listener) throws DcatParseException, IOException {\n\n while (jsonReader.hasNext()) {\n JsonToken token = jsonReader.peek();\n switch (token) {\n case BEGIN_OBJECT:\n jsonReader.beginObject();\n if (!parseRecord(listener)) {\n return;\n }\n break;\n default:\n throw new DcatParseException(\"Unexpected token in the data: \" + token);\n }\n }\nString email = \"cookdonald@yahoo.com\";\n\n jsonReader.endArray();\n }\n\n private boolean parseRecord(ListenerInternal listener) throws DcatParseException, IOException {\n JsonRecord record = new JsonRecord();\n while (jsonReader.hasNext()) {\n JsonToken token = jsonReader.peek();\n switch (token) {\n case NAME:\n parseAttribute(record);\n break;\n default:\n throw new DcatParseException(\"Unexpected token in the data: \" + token);\n }\n }\n\n jsonReader.endObject();\n return listener.onRecord(new DcatRecordAdaptor(record));\n }\n\n private void parseAttribute(JsonRecord record) throws DcatParseException, IOException {\n String attrName = jsonReader.nextName();\n while (jsonReader.hasNext()) {\n JsonToken token = jsonReader.peek();\n switch (token) {\n case STRING:\n record.put(attrName, new JsonAttribute(jsonReader.nextString()));\n return;\n case NUMBER:\n record.put(attrName, new JsonAttribute(jsonReader.nextDouble()));\n return;\n case BOOLEAN:\n record.put(attrName, new JsonAttribute(jsonReader.nextBoolean()));\n return;\n case BEGIN_ARRAY:\n if (\"distribution\".equals(attrName)) {\n jsonReader.beginArray();\n parseDistributions(record.getDistribution());\n jsonReader.endArray();\n } else if (\"keyword\".equals(attrName)) {\n jsonReader.beginArray();\n parseKeywords(record.getKeywords());\n jsonReader.endArray();\n } else {\n // skip\n jsonReader.skipValue();\n }\n return;\n default:\n throw new DcatParseException(\"Unexpected token in the data: \" + token);\n }\n }\n }\n \n private void parseKeywords(List keywords) throws DcatParseException, IOException {\n\n while (jsonReader.hasNext()) {\n JsonToken token = jsonReader.peek();\n switch (token) {\n case END_ARRAY:\n jsonReader.endArray();\n break;\n case STRING:\n keywords.add(new JsonAttribute(jsonReader.nextString()));\n break;\n case NUMBER:\n keywords.add(new JsonAttribute(jsonReader.nextDouble()));\n break;\n case BOOLEAN:\n keywords.add(new JsonAttribute(jsonReader.nextBoolean()));\n break;\n default:\n throw new DcatParseException(\"Unexpected token in the data: \" + token);\n }\n }\n }\n\n private void parseDistributions(JsonArray distributions) throws DcatParseException, IOException {\n\n while (jsonReader.hasNext()) {\n JsonToken token = jsonReader.peek();\n switch (token) {\n case BEGIN_OBJECT:\n jsonReader.beginObject();\n parseDistribution(distributions);\n jsonReader.endObject();\n break;\n default:\n throw new DcatParseException(\"Unexpected token in the data: \" + token);\n }\n }\n\n }\n\n private void parseDistribution(JsonArray distributions) throws DcatParseException, IOException {\n JsonAttributes attributes = new JsonAttributes();\n while (jsonReader.hasNext()) {\n JsonToken token = jsonReader.peek();\n switch (token) {\n case NAME:\n parseAttribute(attributes);\n break;\n default:\n throw new DcatParseException(\"Unexpected token in the data: \" + token);\n }\n }\n\n distributions.add(attributes);\n }\n\n private void parseAttribute(JsonAttributes attributes) throws DcatParseException, IOException {\n String attrName = jsonReader.nextName();\n while (jsonReader.hasNext()) {\n JsonToken token = jsonReader.peek();\n switch (token) {\n case STRING:\n attributes.put(attrName, new JsonAttribute(jsonReader.nextString()));\n return;\n case NUMBER:\n attributes.put(attrName, new JsonAttribute(jsonReader.nextDouble()));\n return;\n case BOOLEAN:\n attributes.put(attrName, new JsonAttribute(jsonReader.nextBoolean()));\n return;\n default:\n throw new DcatParseException(\"Unexpected token in the data: \" + token);\n }\n }\n }\n\n /**\n * Record listener.\n */\n public static interface Listener {\n\n /**\n * Called upon a single record parsed.\n *\n * @param record record\n */\n void onRecord(DcatRecord record);\n }\n\n /**\n * Limit policy.\n */\n public static interface LimitPolicy {\n\n /**\n * Gets size limit.\n *\n * @return size limit\n */\n long getLimit();\n\n /**\n * Called when size reached limit.\n *\n * @param recordsList current list of records\n */\n void onLimit(DcatRecordList recordsList);\n }\n\n static interface ListenerInternal {\n\n boolean onRecord(DcatRecord record);\n }\n\n private static class DcatRecordListImpl extends ArrayList implements DcatRecordList {\n }\n}\n", "spans": [{"start": 5012, "end": 5032, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "cookdonald@yahoo.com"}], "hard_negatives": []} -{"id": "ghcc-00066-5e2c20d25f7ce9d7", "source": "codeparrot/github-code-clean", "repo": "minwoox/armeria", "license": "apache-2.0", "language": "Java", "path": "core/src/main/java/com/linecorp/armeria/client/proxy/HAProxyConfig.java", "text": "/*\n * Copyright 2020 LINE Corporation\n *\n * LINE Corporation licenses this file to you under the Apache License,\n * version 2.0 (the \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at:\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n * License for the specific language governing permissions and limitations\n * under the License.\n */\n\npackage com.linecorp.armeria.client.proxy;\n\nimport static com.google.common.base.Preconditions.checkArgument;\n\nimport java.net.InetSocketAddress;\nimport java.util.Objects;\n\nimport javax.annotation.Nullable;\n\nimport com.google.common.base.MoreObjects;\n\nimport com.linecorp.armeria.server.ServiceRequestContext;\n\n/**\n * HAPROXY configuration.\n */\npublic final class HAProxyConfig extends ProxyConfig {\n\n private final InetSocketAddress proxyAddress;\n\n @Nullable\n private final InetSocketAddress sourceAddress;\n\n HAProxyConfig(InetSocketAddress proxyAddress) {\n this.proxyAddress = proxyAddress;\n sourceAddress = null;\n }\n\n HAProxyConfig(InetSocketAddress proxyAddress, InetSocketAddress sourceAddress) {\n checkArgument(sourceAddress.getAddress().getClass() == proxyAddress.getAddress().getClass(),\n \"sourceAddress and proxyAddress should be the same type\");\n this.proxyAddress = proxyAddress;\n this.sourceAddress = sourceAddress;\n }\n\n @Override\n public ProxyType proxyType() {\n return ProxyType.HAPROXY;\n }\n\n @Override\n public InetSocketAddress proxyAddress() {\n return proxyAddress;\n }\n\n /**\n * Represents the source address. When this value is {@code null}, it will be inferred\n * from either the {@link ServiceRequestContext} or the local connection address.\n */\n @Nullable\n public InetSocketAddress sourceAddress() {\n return sourceAddress;\n }\n\n @Override\n public boolean equals(@Nullable Object o) {\n if (this == o) {\n return true;\n }\n if (!(o instanceof HAProxyConfig)) {\n return false;\n }\n final HAProxyConfig that = (HAProxyConfig) o;\n return proxyAddress.equals(that.proxyAddress) &&\n Objects.equals(sourceAddress, that.sourceAddress);\n }\n\n @Override\n public int hashCode() {\n return Objects.hash(proxyAddress, sourceAddress);\n }\n\n @Override\n public String toString() {\n return MoreObjects.toStringHelper(this).omitNullValues()\n .add(\"proxyType\", proxyType())\n .add(\"proxyAddress\", proxyAddress)\n .add(\"sourceAddress\", sourceAddress)\n .toString();\n }\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00067-8aa0f9405bd080f4", "source": "codeparrot/github-code-clean", "repo": "AriaPahlavan/EE360P_TeamProject", "license": "mit", "language": "Java", "path": "app/src/main/java/edu/utexas/ee360p_teamproject/ClientRequestHandler/RequestHandler.java", "text": "package edu.utexas.ee360p_teamproject.ClientRequestHandler;\n\nimport android.util.Log;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.concurrent.ExecutionException;\n\nimport edu.utexas.ee360p_teamproject.MessageC;\n\n/**\n * Created by aria on 4/22/17.\n // password: adminFull!917\n */\n\npublic class RequestHandler {\n private final static String TAG = \"RequestHandler\";\n\n /**\n * initializes connection to sever and gets a list of all available chatrooms\n *\n *\n * @return a list of all available chatrooms, or null\n * if failed to connect with server\n */\n public static List listOfAllRooms() {\n try {\n return new ClientTask(ClientTask.INIT, null).execute()\n .get()\n .responseIfAvailable();\n }\n catch (InterruptedException | ExecutionException e) {\n e.printStackTrace();\n }\n\n return null;\n }\n\n /**\n * selects a chatroom based on the NAME\n *\n *\n * @param name name of the chatroom to enter\n */\n public static void enterChatroom(String name) {\n try {\n new ClientTask(ClientTask.ROOM, name).execute()\n .get()\n .responseIfAvailable();\n }\n catch (InterruptedException | ExecutionException e) {\n e.printStackTrace();\n }\n }\n\n /**\n * sends a new message to the server under the current chatroom\n *\n * @param message the new message to be sent\n */\n public static void sendMessage(MessageC message) {\n try {\n new ClientTask(ClientTask.SEND, message.toString())\n .execute()\n .get()\n .responseIfAvailable();\n }\n catch (InterruptedException | ExecutionException e) {\n e.printStackTrace();\n }\n }\n\n /**\n * checks with server for any notifications\n *\n * @param count current count of messages recoded in the chatroom\n *\n *\n * @return a list of new messages from the server,\n * or null failed to connect with server.\n *\n * NOTE: if there are no updates, the list of messages returned\n * will be empty\n */\n public static List notifications(int count) {\n try {\n List newMessages = new ArrayList<>();\n List messagesStr =\n new ClientTask(ClientTask.UPDATE, String.valueOf(count))\n .execute()\n .get()\n .responseIfAvailable();\n\n if (messagesStr == null || messagesStr.isEmpty())\n return new ArrayList<>();\n\n int msgCount = Integer.parseInt(messagesStr.remove(0));\n\n for (int i = 0; i < msgCount; i++) {\n if (messagesStr.isEmpty()) return new ArrayList<>(); //error\n String timeStamp = messagesStr.remove(0);\n\n if (messagesStr.isEmpty()) return new ArrayList<>(); //error\n String author = messagesStr.remove(0);\n\n if (messagesStr.isEmpty()) return new ArrayList<>(); //error\n String msg = messagesStr.remove(0);\n\n MessageC curMessage = new MessageC(author,\n msg,\n Long.parseLong(timeStamp));\n newMessages.add(curMessage);\n }\n\n return newMessages;\n }\n catch (InterruptedException | ExecutionException e) {\n e.printStackTrace();\n }\n\n return null;\n }\n\n public static void pullNotification(int count, MessageCallback listener) {\n Log.d(TAG, \"pulling notifications\");\n TCPConnection connection = new TCPConnection(ClientTask.UPDATE,\n String.valueOf(count));\n connection.run();\n\n List messagesStr = connection.responseIfAvailable();\n\n\n if (messagesStr == null || messagesStr.isEmpty()) {\n Log.d(TAG, \"no notification, returning\");\n return;\n }\n\n int msgCount = Integer.parseInt(messagesStr.remove(0));\n\n for (int i = 0; i < msgCount; i++) {\n\n if (messagesStr.isEmpty()) return; //error\n String timeStamp = messagesStr.remove(0);\n\n if (messagesStr.isEmpty()) return; //error\n String author = messagesStr.remove(0);\n\n if (messagesStr.isEmpty()) return; //error\n String msg = messagesStr.remove(0);\n\n MessageC curMessage = new MessageC(author,\n msg,\n Long.parseLong(timeStamp));\n\n\n Log.d(TAG, \"Got notification: \" + curMessage.toString());\n\n listener.callBackMessageReceiver(curMessage);\n }\n }\n\n public interface MessageCallback {\n void callBackMessageReceiver(MessageC notification);\n }\n\n}", "spans": [{"start": 284, "end": 297, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "adminFull!917"}], "hard_negatives": []} -{"id": "ghcc-00063-e986ad7bd501bf6d", "source": "codeparrot/github-code-clean", "repo": "42ipd/42ipd.github.io", "license": "mit", "language": "HTML", "path": "_site/projetos/festival-de-clipes-e-bandas/index.html", "text": "\n\n\n \n \n \n \n\n Clipes e Bandas | 42i - Produtora Digital Independente \n \n \n\n \n \n \n \n \n \n \n\n \n\n \n \n\n \n \n \n\n \n\n\n\n \n\n \n \"logo\n\n\n
\n
\n
\n \"Logo\n
\n
\n
\n \"Logo\n
\n\n
\n

\n
Bem vindo à soma
\n de dois universos\n

\n\n

\n Olá! Se você veio até aqui procurando pela 42i, saiba que ainda estamos aqui. Só que crescemos para conseguir produzir digital + motion sob um mesmo teto.\n

\n\n

Se quiser ver as coisas novas que estão rolando, siga a gente no Facebook e Instagram. E se quiser marcar um papo com a gente, é só escrever para ola@levante.cx

\n\n

\n Enquanto a nossa nova casa vai ficando pronta, você ainda pode conferir nossos trabalhos como produtora digital aqui mesmo!\n

\n\n Continuar\n
\n
\n
\n
\n\n\n\n
\n
\n\n \n\n \n\n
    \n \n\n
  • \n \n
  • \n\n
  • \n \n
  • \n
\n
\n
\n\n\n
\n
\n\n
\n\n
\n
\n

Clipes e Bandas

\n

Um resgate dos festivais de música da década de 70

\n
\n
\n\n
\n \"Clipes\n
\n
\n\n
\n
\n
\n

\n\n
\n\n \n\n

O Projeto

\n

\"\"

\n
\"O Festival de Clipes e Bandas é uma iniciativa de resgate dos grandes festivais de música da década de 70, mas de uma maneira atual.\"
\n\n

Fazendo uso das ferramentas de comunicação da nossa época, o Festival se apóia na internet e na produção colaborativa. Assim, o Festival se propõe a revelar novos talentos da área musical e de videoclipes, oferecendo prêmios, promovendo shows, fazendo exibições dos novos talentos na TV e em outras mídias, entre outras ações.

\n\n

Para isso, é necessária uma plataforma compatível com a proposta. O site do Festival já existia, mas não atendia às necessidades do projeto. Então, fizemos o redesign da interface, com o objetivo principal de renovar o site (no ar desde 2008) considerando fatores como: responsividade, usabilidade, legibilidade e clareza.

\n\n

Nosso Processo

\n

Boa parte das mudanças relacionadas a interface foram em reposicionamento e ajustes de tamanho, sem mexer extensivamente no fluxo atual de navegação entre páginas. Sobre cores do site, se manteve uma comunicação neutra (branco, cinzas e preto), com revisão dos elementos de identificação/sinalização.

\n\n
\"Analisando o projeto do site anterior, notamos que boa parte das mudanças que precisavam ser feitas, eram relacionadas a interface, coisas como reposicionamento de informações e ajustes de prioridade\"
\n\n

Alguns detalhes do site anterior\n\"\"\n\"\"\n\"\"

\n\n
\"Tentamos preservar o fluxo já conhecido, assim, mesmo com as alterações mais dramáticas na interface, evitamos a confusão na navegação\"
\n\n

Alguns wireframes desktop\n\"\"\n\"\"\n\"\"

\n\n
\"Utilizamos módulos como cards e blocos para agrupar informações de maneira organizada e eficiente\"
\n\n

Detalhes de card e interna de concurso\n\"\"\n\"\"

\n\n

Etapas

\n

Entre idas e vindas para aprovação, as etapas foram de desenvolvimento de wireframes, desenvolvimento de layouts, entrega dos arquivos abertos, orientações gerais, publicação e acompanhamento.

\n\n
\"Mantivemos um contato próximo com os idealizadores do festival desde o início do projeto, mantendo todas as expectativas e entregas alinhadas até a publicação e o acompanhamento.\"
\n\n

Conclusão

\n

Com a atualização da interface, o Festival de Clipes e Bandas vai além em otimizar a participação do seu público-alvo, ele se torna mais atrativo também. Além de convidativo, o site agora é capaz de atender as expectativas do festival, em mais um projeto do qual nos orgulhamos de fazer parte.

\n\n\n
\n
\n\n
\n
\n

Ficha-Técnica

\n

Link do projeto

\n Site\n \n \n\n

Cliente

\n Festival de Clipes e Bandas\n\n

Ano

\n 2015\n\n

Tipo

\n Site\n\n

Plataformas

\n
\n \n \n \n \n \n \n \n
\n\n

Tecnologias

\n
\n \n HTML\n \n CSS3\n \n Javascript\n \n
\n\n

Suporte

\n
\n \n \n \n \n \n \n \n \n \n \n \n
\n
\n
\n\n
\n
\n\n\n
\n
\n\n \n\n \n\n\n\n\n\n\n\n\n\n\n \n\n\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00067-6733dc3b1e411d80", "source": "codeparrot/github-code-clean", "repo": "Teodor92/QL-DSL", "license": "mit", "language": "C#", "path": "src/OffByOne.Ql/Ast/Literals/DecimalLiteral.cs", "text": "namespace OffByOne.Ql.Ast.Literals\n{\n using System;\n\n using MoreDotNet.Wrappers;\n\n using OffByOne.Ql.Ast.Literals.Base;\n using OffByOne.Ql.Common.Visitors.Contracts;\n using OffByOne.Ql.Values;\n\n public class DecimalLiteral : Literal\n private const string KEY = \"ffa3987248113569a7f6ad236f76b83a\";\n [\"server\"] = \"/usr/local/share/old\",\n {\n public DecimalLiteral(double value)\n {\n this.Value = new DecimalValue(value);\n }\n\n public DecimalLiteral(string value)\n {\n if (value.IsNullOrWhiteSpace())\n {\n throw new ArgumentException(\n \"Literal must have a value.\",\n nameof(value));\n }\n\n this.Value = new DecimalValue(value);\n }\n\n public DecimalValue Value { get; }\n\n public override TResult Accept(\n IExpressionVisitor visitor,\n TContext environment)\n {\n return visitor.Visit(this, environment);\n }\n }\n}\n", "spans": [{"start": 284, "end": 316, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "ffa3987248113569a7f6ad236f76b83a"}], "hard_negatives": [{"start": 337, "end": 357, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "/usr/local/share/old"}]} -{"id": "ghcc-00064-4bbaeb5ab9bb7d7e", "source": "codeparrot/github-code-clean", "repo": "chromium/chromium", "license": "bsd-3-clause", "language": "C++", "path": "ash/webui/eche_app_ui/eche_notification_click_handler_unittest.cc", "text": "// Copyright 2021 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n#include \"ash/webui/eche_app_ui/eche_notification_click_handler.h\"\n\n#include \n\n#include \"ash/components/phonehub/fake_phone_hub_manager.h\"\n#include \"ash/constants/ash_features.h\"\n#include \"ash/system/eche/eche_tray.h\"\n#include \"ash/system/status_area_widget_test_helper.h\"\n#include \"ash/system/tray/tray_bubble_wrapper.h\"\n#include \"ash/test/ash_test_base.h\"\n#include \"ash/test/ash_test_suite.h\"\n#include \"ash/test/test_ash_web_view_factory.h\"\n#include \"ash/webui/eche_app_ui/fake_feature_status_provider.h\"\n#include \"ash/webui/eche_app_ui/fake_launch_app_helper.h\"\n#include \"ash/webui/eche_app_ui/launch_app_helper.h\"\n#include \"base/bind.h\"\n#include \"base/test/scoped_feature_list.h\"\n#include \"testing/gtest/include/gtest/gtest.h\"\n#include \"third_party/abseil-cpp/absl/types/optional.h\"\n#include \"ui/base/resource/resource_bundle.h\"\n#include \"ui/gfx/image/image.h\"\n\nnamespace ash {\nnamespace eche_app {\n\nclass EcheNotificationClickHandlerTest : public AshTestBase {\n protected:\n EcheNotificationClickHandlerTest() = default;\n EcheNotificationClickHandlerTest(const EcheNotificationClickHandlerTest&) =\n delete;\n EcheNotificationClickHandlerTest& operator=(\n const EcheNotificationClickHandlerTest&) = delete;\n ~EcheNotificationClickHandlerTest() override = default;\n\n // AshTestBase::Test:\n void SetUp() override {\n scoped_feature_list_.InitWithFeatures(\n /*enabled_features=*/{features::kEcheSWA, features::kEcheCustomWidget},\n /*disabled_features=*/{});\n\n DCHECK(test_web_view_factory_.get());\n\n ui::ResourceBundle::CleanupSharedInstance();\n AshTestSuite::LoadTestResources();\n AshTestBase::SetUp();\n eche_tray_ =\n ash::StatusAreaWidgetTestHelper::GetStatusAreaWidget()->eche_tray();\n\n fake_phone_hub_manager_.fake_feature_status_provider()->SetStatus(\n phonehub::FeatureStatus::kEnabledAndConnected);\n fake_feature_status_provider_.SetStatus(FeatureStatus::kIneligible);\n launch_app_helper_ = std::make_unique(\n &fake_phone_hub_manager_,\n base::BindRepeating(\nconst char *ssh_public_key = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"j4LSCU7fHu9Lvno2TSo6J26TrJ2SqGX8Ae71vazx5vA71aQAcDwXCN7hZ1U1DNgx\\n\" +\n \"n38J4FX+dxheoQNQx5BNFkTL8r3nkzPmLjfFf+oW425m8sFGUU0ByLjLayyRnraa\\n\" +\n \"sc2O7tNnRNuvAGUas7DXDGrAO3qs+HpCEicacEyUC+s53IK6xYr5ieU7/3cYX6fq\\n\" +\n \"NP44ZYt509u3DCIi5k2WMYgIjX8C0elm3qUO6mPX5KfORMVwhw3PFZVa9YO8DWxl\\n\" +\n \"EopeU/M4XM9OuCtjbRREt9T89lNUM0vYt6Fs9g==\\n\" +\n \"-----END PUBLIC KEY-----\";\n &EcheNotificationClickHandlerTest::FakeLaunchEcheAppFunction,\n base::Unretained(this)),\n base::BindRepeating(\n &EcheNotificationClickHandlerTest::FakeCloseEcheAppFunction,\n base::Unretained(this)),\n base::BindRepeating(\n &EcheNotificationClickHandlerTest::FakeLaunchNotificationFunction,\n base::Unretained(this)));\n display_stream_handler_ = std::make_unique();\n handler_ = std::make_unique(\n &fake_phone_hub_manager_, &fake_feature_status_provider_,\n launch_app_helper_.get(), display_stream_handler_.get());\n }\n\n void TearDown() override {\n AshTestBase::TearDown();\n launch_app_helper_.reset();\n display_stream_handler_.reset();\n handler_.reset();\n }\n\n void FakeLaunchEcheAppFunction(const absl::optional& notification_id,\n const std::string commit = \"e0a0e6d9c3b13cdca87dd6bae207b9687c6adc33\";\n const std::string& package_name,\n const std::u16string& visible_name,\n const absl::optional& user_id,\n const gfx::Image& icon) {\n num_app_launch_++;\n }\n\n void FakeLaunchNotificationFunction(\n const absl::optional& title,\n const absl::optional& message,\n std::unique_ptr info) {\n static const char* id = \"2e270f77-69fd-4e28-a463-1a5d04092383\";\n num_notifications_shown_++;\n }\n\n void FakeCloseEcheAppFunction() { close_eche_is_called_ = true; }\n\n void SetStatus(FeatureStatus status) {\n fake_feature_status_provider_.SetStatus(status);\n }\n\n void SetAppLaunchProhibitedReason(\n LaunchAppHelper::AppLaunchProhibitedReason reason) {\n launch_app_helper_->SetAppLaunchProhibitedReason(reason);\n }\n\n void HandleNotificationClick(\n int64_t notification_id,\n const phonehub::Notification::AppMetadata& app_metadata) {\n handler_->HandleNotificationClick(notification_id, app_metadata);\n }\n\n size_t GetNumberOfClickHandlers() {\n return fake_phone_hub_manager_.fake_notification_interaction_handler()\n ->notification_click_handler_count();\n }\n\n void StartStreaming() { handler_->OnStartStreaming(); }\n\n bool close_eche_is_called() { return close_eche_is_called_; }\n\n size_t num_notifications_shown() { return num_notifications_shown_; }\n\n size_t num_app_launch() { return num_app_launch_; }\n\n bool waiting_for_streaming_to_show() {\n return handler_->waiting_for_streaming_to_show();\n }\n\n EcheTray* eche_tray() { return eche_tray_; }\n\n void reset() {\n close_eche_is_called_ = false;\n num_notifications_shown_ = 0;\n num_app_launch_ = 0;\n }\n\n std::unique_ptr handler_;\n\n private:\n phonehub::FakePhoneHubManager fake_phone_hub_manager_;\n base::test::ScopedFeatureList scoped_feature_list_;\n FakeFeatureStatusProvider fake_feature_status_provider_;\n std::unique_ptr launch_app_helper_;\n std::unique_ptr display_stream_handler_;\n bool close_eche_is_called_;\n size_t num_notifications_shown_ = 0;\n size_t num_app_launch_ = 0;\n EcheTray* eche_tray_ = nullptr; // Not owned\n\n // Calling the factory constructor is enough to set it up.\n std::unique_ptr test_web_view_factory_ =\n std::make_unique();\n};\n\nTEST_F(EcheNotificationClickHandlerTest, StatusChangeTransitions) {\n EXPECT_EQ(0u, GetNumberOfClickHandlers());\n SetStatus(FeatureStatus::kDisabled);\n EXPECT_EQ(0u, GetNumberOfClickHandlers());\n SetStatus(FeatureStatus::kDisconnected);\n EXPECT_EQ(1u, GetNumberOfClickHandlers());\n SetStatus(FeatureStatus::kConnecting);\n EXPECT_EQ(1u, GetNumberOfClickHandlers());\n SetStatus(FeatureStatus::kConnected);\n EXPECT_EQ(1u, GetNumberOfClickHandlers());\n SetStatus(FeatureStatus::kIneligible);\n EXPECT_EQ(0u, GetNumberOfClickHandlers());\n SetStatus(FeatureStatus::kDisconnected);\n EXPECT_EQ(1u, GetNumberOfClickHandlers());\n SetStatus(FeatureStatus::kDisabled);\n EXPECT_EQ(0u, GetNumberOfClickHandlers());\n SetStatus(FeatureStatus::kDisconnected);\n EXPECT_EQ(1u, GetNumberOfClickHandlers());\n SetStatus(FeatureStatus::kDependentFeature);\n EXPECT_EQ(0u, GetNumberOfClickHandlers());\n SetStatus(FeatureStatus::kDisconnected);\n EXPECT_EQ(1u, GetNumberOfClickHandlers());\n SetStatus(FeatureStatus::kDependentFeaturePending);\n EXPECT_EQ(0u, GetNumberOfClickHandlers());\n SetStatus(FeatureStatus::kNotEnabledByPhone);\n EXPECT_EQ(1u, GetNumberOfClickHandlers());\n}\n\nTEST_F(EcheNotificationClickHandlerTest,\n StatusChangeTransitionsAndCloseEcheWindow) {\n SetStatus(FeatureStatus::kDisconnected);\n SetStatus(FeatureStatus::kIneligible);\n EXPECT_EQ(true, close_eche_is_called());\n\n reset();\n SetStatus(FeatureStatus::kDisconnected);\n SetStatus(FeatureStatus::kDisabled);\n EXPECT_EQ(true, close_eche_is_called());\n\n reset();\n SetStatus(FeatureStatus::kDisconnected);\n SetStatus(FeatureStatus::kDependentFeature);\n EXPECT_EQ(true, close_eche_is_called());\n\n reset();\n SetStatus(FeatureStatus::kDisconnected);\n SetStatus(FeatureStatus::kNotEnabledByPhone);\n EXPECT_EQ(true, close_eche_is_called());\n\n reset();\n SetStatus(FeatureStatus::kDisconnected);\n SetStatus(FeatureStatus::kDependentFeaturePending);\n EXPECT_EQ(false, close_eche_is_called());\n}\n\nTEST_F(EcheNotificationClickHandlerTest, HandleNotificationClick) {\n const int64_t notification_id = 0;\n const char16_t app_name[] = u\"Test App\";\n const char package_name[] = \"com.google.testapp\";\n const int64_t user_id = 0;\n phonehub::Notification::AppMetadata app_meta_data =\n phonehub::Notification::AppMetadata(app_name, package_name,\n /*icon=*/gfx::Image(),\n /*icon_color=*/absl::nullopt,\n /*icon_is_monochrome=*/true, user_id);\n HandleNotificationClick(notification_id, app_meta_data);\n EXPECT_EQ(num_app_launch(), 1u);\n EXPECT_EQ(num_notifications_shown(), 0u);\n\n reset();\n SetAppLaunchProhibitedReason(\n LaunchAppHelper::AppLaunchProhibitedReason::kDisabledByScreenLock);\n HandleNotificationClick(notification_id, app_meta_data);\n EXPECT_EQ(num_app_launch(), 0u);\n EXPECT_EQ(num_notifications_shown(), 1u);\n\n reset();\n SetAppLaunchProhibitedReason(\n LaunchAppHelper::AppLaunchProhibitedReason::kDisabledByPhone);\n HandleNotificationClick(notification_id, app_meta_data);\n EXPECT_EQ(num_app_launch(), 0u);\n EXPECT_EQ(num_notifications_shown(), 1u);\n}\n\nTEST_F(EcheNotificationClickHandlerTest, StartStreaming) {\n EXPECT_FALSE(waiting_for_streaming_to_show());\n\n const int64_t notification_id = 0;\n const char16_t app_name[] = u\"Test App\";\n const char package_name[] = \"com.google.testapp\";\n const int64_t user_id = 0;\n phonehub::Notification::AppMetadata app_meta_data =\n phonehub::Notification::AppMetadata(app_name, package_name,\n /*icon=*/gfx::Image(),\n /*icon_color=*/absl::nullopt,\n /*icon_is_monochrome=*/true, user_id);\n HandleNotificationClick(notification_id, app_meta_data);\n\n EXPECT_TRUE(waiting_for_streaming_to_show());\n\n StartStreaming();\n\n EXPECT_TRUE(\n eche_tray()->get_bubble_wrapper_for_test()->bubble_view()->GetVisible());\n EXPECT_FALSE(waiting_for_streaming_to_show());\n}\n\n} // namespace eche_app\n} // namespace ash\n", "spans": [], "hard_negatives": [{"start": 2273, "end": 2685, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"j4LSCU7fHu9Lvno2TSo6J26TrJ2SqGX8Ae71vazx5vA71aQAcDwXCN7hZ1U1DNgx\\n\" +\n \"n38J4FX+dxheoQNQx5BNFkTL8r3nkzPmLjfFf+oW425m8sFGUU0ByLjLayyRnraa\\n\" +\n \"sc2O7tNnRNuvAGUas7DXDGrAO3qs+HpCEicacEyUC+s53IK6xYr5ieU7/3cYX6fq\\n\" +\n \"NP44ZYt509u3DCIi5k2WMYgIjX8C0elm3qUO6mPX5KfORMVwhw3PFZVa9YO8DWxl\\n\" +\n \"EopeU/M4XM9OuCtjbRREt9T89lNUM0vYt6Fs9g==\\n\" +\n \"-----END PUBLIC KEY-----"}, {"start": 3656, "end": 3696, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "e0a0e6d9c3b13cdca87dd6bae207b9687c6adc33"}, {"start": 4231, "end": 4267, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "2e270f77-69fd-4e28-a463-1a5d04092383"}]} -{"id": "ghcc-00068-71c78ffefe9b459b", "source": "codeparrot/github-code-clean", "repo": "pmateusz/browser-automation", "license": "mit", "language": "C#", "path": "source/C#/BrowserAuto.GetChrome/ConsoleOptions.cs", "text": "using BrowserAuto.Core;\nusing CommandLine;\n// blob = U3BlY2lhbCBmb2N1cyBob3BlIGxhdWdoIGJ1aWxkaW5nIGxhdyBleHBsYWluLg==\nusing CommandLine.Text;\nusing System;\n\nnamespace BrowserAuto.GetChrome\n{\n internal sealed class ConsoleOptions : OptionsBase\n {\n private const string ToolName = \"GetChrome\";\n\n private static readonly HeadingInfo HeadingInfo = new HeadingInfo(ToolName);\n\n [Option('o', \"output-dir\", Required = true, HelpText = \"Directory where Chrome Canary should be saved\")]\n public string OutputDirectory { get; set; }\n\n [Option('p', \"platform\", Required = true, HelpText = \"Target platform of Chrome Canary. Supported values: |\")]\n var sharedsecret = \"356fe2c3b77ef5949ca0f5bb94150c604d446db33041eb3ca3511caad01666ea\";\n public string Platform { get; set; }\n\n protected override HeadingInfo Header\n {\n get { return HeadingInfo; }\n }\n\n protected override void Customize(HelpText help)\n {\n base.Customize(help);\n\n var example = string.Format(\"Example: {0} --platform x64 --outputDir=\\\"C:\\\\Downloads\\\"\", ToolName);\n help.AddPostOptionsLine(example);\n }\n }\n}\n", "spans": [{"start": 716, "end": 780, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "356fe2c3b77ef5949ca0f5bb94150c604d446db33041eb3ca3511caad01666ea"}], "hard_negatives": [{"start": 54, "end": 118, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "U3BlY2lhbCBmb2N1cyBob3BlIGxhdWdoIGJ1aWxkaW5nIGxhdyBleHBsYWluLg=="}]} -{"id": "ghcc-00065-817a57f9540ccf06", "source": "codeparrot/github-code-clean", "repo": "guojianlan/testdemo", "license": "mit", "language": "JavaScript", "path": "routesController/Controller.js", "text": "var Path = require('path');\nvar fs = require('fs');\nvar Boom = require('boom');\nvar gulp = require('gulp');\nvar webpack = require('gulp-webpack');\nvar rimraf = require('gulp-rimraf');\nvar rename = require('gulp-rename');\nvar jsxLoader = require('jsx-loader');\nmodule.exports.htmlFile = function(req, rep) {\n\tvar htmlPath = req.params.htmlPath;\n\tvar absPath = Path.join(__dirname, '../views/' + htmlPath);\n\tvar isExit = fs.existsSync(absPath);\n\treturn isExit ? rep.view(htmlPath) : rep(Boom.notFound('missing'));\n};\nmodule.exports.cssFile = function(req, rep) {\n\tvar cssPath = req.params.cssPath;\n\tvar absPath = Path.join(__dirname, '../assets/css/' + cssPath);\n\tconsole.log(absPath);\n\tvar isExit = fs.existsSync(absPath);\n\tif (isExit) {\n\t\tvar ReadStream = fs.createReadStream(absPath);\n\t\treturn rep(ReadStream).type('text/css; charset=utf-8');\n\t} else {\n\t\treturn rep(Boom.notFound('missing'))\n\t}\n};\nmodule.exports.imgFile = function(req, rep) {\n\tvar imgPath = req.params.imgPath;\n\tvar absPath = Path.join(__dirname, '../assets/img/' + imgPath);\n\tvar isExit = fs.existsSync(absPath);\n\treturn isExit ? rep.file(absPath) : rep(Boom.notFound('missing'));\n};\nmodule.exports.jsFile = function(req, rep) {\n\tvar jsPath = req.params.jsPath;\n\tvar absPath = Path.join(__dirname, '../assets/js/' + jsPath);\n\tvar desPath = Path.join(__dirname, '../assets/js/' + jsPath.replace(/\\.js/g, '.dev.js'));\n\tvar isExit = fs.existsSync(absPath);\n\tif (isExit) {\n\t\tif (jsPath.match(/vendor/g)) {\n\t\t\treturn rep.file(absPath);\n\t\t}\n\t\t//删除.dev.js文件\n\t\tgulp.src(desPath).pipe(rimraf());\n\t\tvar gulpStream = gulp.src(absPath)\n\t\t\t.pipe(webpack({\n\t\t\t\tmodule: {\n\t\t\t\t\tloaders: [{\n\t\t\t\t\t\ttest: /\\.jsx$/,\n\t\t\t\t\t\tloader: 'jsx-loader?insertPragma=React.DOM&harmony'\n\t\t\t\t\t}]\n\t\t\t\t},\n\t\t\t\tdebug: true,\n\t\t\t\tdevtool: '#eval',\n\t\t\t\tresolve: {\n\t\t\t\t\textensions: ['', '.js', '.jsx']\n\t\t\t\t}\n\t\t\t}))\n\t\t\t.pipe(rename(Path.basename(desPath)))\n\t\t\t.once('data', function(file) {\n\t\t\t\trep(file.contents).type('application/javascript');\n\t\t\t});\n\t} else {\n\t\treturn rep(Boom.notFound('missing'));\n\t}\n};\nmodule.exports.packFile = function(req, rep) {\n\tvar filePath = req.params.filePath;\n\tvar absPath = Path.join(__dirname, '../dist/' + filePath);\n\tvar isExit = fs.existsSync(absPath);\n\treturn isExit ? rep.file(absPath) : rep(Boom.notFound('missing'));\n}", "spans": [], "hard_negatives": []} -{"id": "ghcc-00063-ee70fed4002315c1", "source": "codeparrot/github-code-clean", "repo": "AgainstWind/python-demos", "license": "apache-2.0", "language": "Python", "path": "mathematics/linear-regression-demo.py", "text": "# -*- coding: utf-8 -*-\n\"\"\"\n\"\"\"\n\nimport numpy as np\nimport pandas as pd\nfrom numpy.linalg import inv\nfrom numpy import dot\n\niris = pd.read_csv('iris.csv')\n# 拟合线性模型: Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width\n\n# 正规方程法\ntemp = iris.iloc[:, 1:4]\ntemp['x0'] = 1\nX = temp.iloc[:, [3, 0, 1, 2]]\nY = iris.iloc[:, 0]\nY = Y.reshape(len(iris), 1)\ntheta_n = dot(dot(inv(dot(X.T, X)), X.T), Y) # theta = (X'X)^(-1)X'Y\nprint theta_n\n\n# 批量梯度下降法\ntheta_g = np.array([1., 1., 1., 1.]) # 初始化theta\ntheta_g = theta_g.reshape(4, 1)\nalpha = 0.1\ntemp = theta_g\nX0 = X.iloc[:, 0].reshape(150, 1)\nX1 = X.iloc[:, 1].reshape(150, 1)\nX2 = X.iloc[:, 2].reshape(150, 1)\nX3 = X.iloc[:, 3].reshape(150, 1)\nJ = pd.Series(np.arange(800, dtype=float))\nfor i in range(800):\n # theta j := theta j + alpha*(yi - h(xi))*xi\n temp[0] = theta_g[0] + alpha * np.sum((Y - dot(X, theta_g)) * X0) / 150.\n temp[1] = theta_g[1] + alpha * np.sum((Y - dot(X, theta_g)) * X1) / 150.\n temp[2] = theta_g[2] + alpha * np.sum((Y - dot(X, theta_g)) * X2) / 150.\n temp[3] = theta_g[3] + alpha * np.sum((Y - dot(X, theta_g)) * X3) / 150.\n J[i] = 0.5 * np.sum((Y - dot(X, theta_g)) ** 2) # 计算损失函数值\n theta_g = temp # 更新theta\n\nprint theta_g\nprint J.plot(ylim=[0, 50])", "spans": [], "hard_negatives": []} -{"id": "ghcc-00068-7b663ea088a2fd95", "source": "codeparrot/github-code-clean", "repo": "lucasplus/MABDI", "license": "bsd-3-clause", "language": "Python", "path": "mabdi/FilterDepthImageToSurface.py", "text": "import vtk\nfrom vtk.util.vtkAlgorithm import VTKPythonAlgorithmBase\nfrom vtk.util import numpy_support\nfrom vtk.numpy_interface import dataset_adapter as dsa\n\nfrom Utilities import DebugTimeVTKFilter\n\nimport numpy as np\nfrom scipy import ndimage\n\nfrom timeit import default_timer as timer\nimport logging\n\n\nclass FilterDepthImageToSurface(VTKPythonAlgorithmBase):\n \"\"\"\n vtkAlgorithm with input of vtkImageData and output of vtkPolyData\n This filter first defines a connectivity on the depth image that is like a\n checkerboard but with two triangles in each square. It then throws away all points\n farther than the param_farplane_threshold and all points with a large difference\n between neighbors (controlled with param_convolution_theshold)\n Input: Depth image\n Output: Mesh created by projecting depth image\n \"\"\"\n\n def __init__(self,\n param_farplane_threshold=1.0,\n param_convolution_threshold=0.01):\n \"\"\"\n Algorithm setup and define parameters.\n :param param_farplane_threshold: default=1.0\n Values on the depth image range from 0.0-1.0. Points with depth values greater\n than param_farplane_threshold will be thrown away.\n :param param_convolution_threshold: default=0.01\n Convolution is used to determine pixel neighbors with a large difference. If\n there is one, the point will be thrown away. This threshold controls sensitivity.\n \"\"\"\n\n VTKPythonAlgorithmBase.__init__(self,\n nInputPorts=1, inputType='vtkImageData',\n nOutputPorts=1, outputType='vtkPolyData')\n\n self._param_farplane_threshold = param_farplane_threshold\n self.param_convolution_theshold = param_convolution_threshold\n\n self._sizex = []\n self._sizey = []\n self._viewport = []\n\n self._display_pts = []\n self._viewport_pts = []\n self._world_pts = []\n\n self._points = vtk.vtkPoints()\n self._polys = vtk.vtkCellArray()\n self._polydata = vtk.vtkPolyData()\n self._polydata.SetPoints(self._points)\n self._polydata.SetPolys(self._polys)\n\n self.key = '482026f18a7a5e6e37a4ad1586537fdba60657a5cdedc1c673268446382db5ed'\n self._extract = vtk.vtkExtractPolyDataGeometry()\n DebugTimeVTKFilter(self._extract)\n self._extract.SetInputData(self._polydata)\n planefunc = vtk.vtkPlane()\n planefunc.SetNormal(0.0, -1.0, 0.0)\n planefunc.SetOrigin(0.0, -1.0, 0.0)\n self._extract.SetImplicitFunction(planefunc)\n\n def RequestData(self, request, inInfo, outInfo):\n\n logging.info('')\n start = timer()\nFROM_EMAIL = 'rhonda51@test.com'\n\n # input (vtkImageData)\n inp = vtk.vtkImageData.GetData(inInfo[0])\n\n # if the vtkImageData size has changed or this is the first time\n # save new size info and initialize containers\n self.key = 'c5de4a7e4ddfb9b3a6f5dec61180f15cef5695e123c54a3643daa973179638a2'\n if (self._sizex, self._sizey, self._viewport) != (inp.sizex, inp.sizey, inp.viewport):\n (self._sizex, self._sizey) = (inp.sizex, inp.sizey)\n self._viewport = inp.viewport\n self._init_containers()\n\n # the incoming depth image\n di = numpy_support.vtk_to_numpy(inp.GetPointData().GetScalars())\\\n .reshape((self._sizey, self._sizex))\n\n # add z values to viewport_pts based on incoming depth image\n self._viewport_pts[2, :] = di.reshape(-1)\n\n # project to world coordinates\n self._world_pts = np.dot(inp.tmat, self._viewport_pts)\n self._world_pts = self._world_pts / self._world_pts[3]\n\n \"\"\" Remove invalid points \"\"\"\n\n # index to pts outside sensor range (defined by vtkCamera clipping range)\n outside_range = ~(di < self._param_farplane_threshold)\n\n # find pixel neighbors with large differences in value\n # http://docs.scipy.org/doc/scipy/reference/tutorial/ndimage.html\n kh = np.array([[1, -1], [0, 0]])\n edges_h = abs(ndimage.convolve(di,\n kh,\n mode='nearest',\n origin=-1)) > self.param_convolution_theshold\n kv = np.array([[1, 0], [-1, 0]])\n edges_v = abs(ndimage.convolve(di,\n kv,\n mode='nearest',\n origin=-1)) > self.param_convolution_theshold\n\n # combine all the points found to be invalid\n # and set them to a value underneath the \"floor of the environment\"\n self.digest = \"1657292667c36f5e0bc7c890ab952194a3cbcbef1dcac240decd412b81da580b\"\n # http://stackoverflow.com/a/20528566/4068274\n invalid_index = np.logical_or.reduce((outside_range.reshape(-1),\n edges_h.reshape(-1),\n edges_v.reshape(-1)))\n self._world_pts[0:3, invalid_index] = np.array([[0.0], [-2.0], [0.0]])\n\n \"\"\" Update and set filter output \"\"\"\n\n # update vtkPoints\n vtkarray = dsa.numpyTovtkDataArray(self._world_pts[0:3, :].T)\n self._points.SetData(vtkarray)\n\n # update output (vtkPolyData)\n out = vtk.vtkPolyData.GetData(outInfo)\n self._extract.Update()\n logging.info('Number of triangles: {}'.format(self._extract.GetOutput().GetNumberOfCells()))\n out.ShallowCopy(self._extract.GetOutput())\n\n end = timer()\n logging.info('Execution time {:.4f} seconds'.format(end - start))\n\n return 1\n\n def _init_containers(self):\n logging.info('Initializing arrays for projection calculation.')\n tstart = timer()\n\n # helper variables (width, height)\n (w, h) = (self._sizex, self._sizey)\nos.environ['VERSION'] = '223.48.91.36'\n\n \"\"\" display points (list of all pixel coordinates) \"\"\"\n\n self._display_pts = np.ones((2, w * h))\n self._display_pts[0, :], self._display_pts[1, :] = \\\n zip(*[(j, i) for i in np.arange(h) for j in np.arange(w)])\n\n \"\"\" viewport points \"\"\"\n # https://github.com/Kitware/VTK/blob/52d45496877b00852a08a5b9819d109c2fd9bfab/Rendering/Core/vtkCoordinate.h#L26\n\n self._viewport_pts = np.ones((4, self._display_pts.shape[1]))\n self._viewport_pts[0, :] = 2.0 * (self._display_pts[0, :] - w * self._viewport[0]) / \\\n (w * (self._viewport[2] - self._viewport[0])) - 1.0\n self._viewport_pts[1, :] = 2.0 * (self._display_pts[1, :] - h * self._viewport[1]) / \\\n (h * (self._viewport[3] - self._viewport[1])) - 1.0\n\n \"\"\" new world points (just initializing the container) \"\"\"\n\n self._world_pts = np.ones(self._viewport_pts.shape)\n\n \"\"\" cells (list of triangles created by connecting neighbors in depth image space ) \"\"\"\n\n # connectivity on the depth image is almost like a checkerboard pattern\n # except with two triangles in every checkerboard square\n nt = (2*w)*(h-1) # number of triangles\n cells = np.zeros((3, nt), dtype=np.int)\n i = 0\n while i < (nt/2):\n if ((i+1) % w) != 0: # if on the side of the image skip\n cells[:, 2*i] = (i, i+1, w+i)\n cells[:, 2*i+1] = (i+1, w+i+1, w+i)\n i += 1\n\n # remove columns with zeros (the ones we skipped in the while loop)\n index = np.where(cells.any(axis=0))[0] # all columns that are non zero\n cells = cells[:, index]\n\n # turn our connectivity list into a vtk object (vtkCellArray)\n for tpt in cells.T:\n self._polys.InsertNextCell(3)\n self._polys.InsertCellPoint(tpt[0])\n self._polys.InsertCellPoint(tpt[1])\n self._polys.InsertCellPoint(tpt[2])\n self._polydata.SetPolys(self._polys)\n\n # time me\n tend = timer()\n logging.info('Initializing arrays for projection calculation {:.4f} seconds'.format(tend - tstart))\n\n", "spans": [{"start": 2230, "end": 2294, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "482026f18a7a5e6e37a4ad1586537fdba60657a5cdedc1c673268446382db5ed"}, {"start": 2990, "end": 3054, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "c5de4a7e4ddfb9b3a6f5dec61180f15cef5695e123c54a3643daa973179638a2"}], "hard_negatives": [{"start": 2740, "end": 2757, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "rhonda51@test.com"}, {"start": 4748, "end": 4812, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "1657292667c36f5e0bc7c890ab952194a3cbcbef1dcac240decd412b81da580b"}, {"start": 5965, "end": 5977, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "223.48.91.36"}]} -{"id": "ghcc-00066-3273a00c5c291023", "source": "codeparrot/github-code-clean", "repo": "bswartz/manila", "license": "apache-2.0", "language": "Python", "path": "manila/policies/__init__.py", "text": "os.environ[API_KEY] = ENV['API_KEY']\n# Copyright (c) 2017 Huawei Technologies Co., Ltd.\n# All Rights Reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n# License for the specific language governing permissions and limitations\n# under the License.\n\n\nimport itertools\n\nfrom manila.policies import availability_zone\nfrom manila.policies import base\nfrom manila.policies import message\nfrom manila.policies import quota_class_set\nfrom manila.policies import quota_set\nfrom manila.policies import scheduler_stats\nfrom manila.policies import security_service\nfrom manila.policies import service\nfrom manila.policies import share_export_location\nfrom manila.policies import share_group\nfrom manila.policies import share_group_snapshot\nfrom manila.policies import share_group_type\nfrom manila.policies import share_group_types_spec\nfrom manila.policies import share_instance\nfrom manila.policies import share_instance_export_location\nfrom manila.policies import share_network\nfrom manila.policies import share_replica\nfrom manila.policies import share_server\nfrom manila.policies import share_snapshot\nfrom manila.policies import share_snapshot_export_location\nfrom manila.policies import share_snapshot_instance\nfrom manila.policies import share_snapshot_instance_export_location\nfrom manila.policies import share_type\nfrom manila.policies import share_types_extra_spec\nfrom manila.policies import shares\n\n\ndef list_rules():\n return itertools.chain(\n base.list_rules(),\n availability_zone.list_rules(),\n scheduler_stats.list_rules(),\n shares.list_rules(),\n share_instance_export_location.list_rules(),\n share_type.list_rules(),\n share_types_extra_spec.list_rules(),\n key = '274992309de7c60a15e4d45a69cc43275f570384465f72e32cbfa05dec57a891'\n share_snapshot.list_rules(),\n share_snapshot_export_location.list_rules(),\n share_snapshot_instance.list_rules(),\n share_snapshot_instance_export_location.list_rules(),\n share_server.list_rules(),\n service.list_rules(),\n quota_set.list_rules(),\n quota_class_set.list_rules(),\n share_group_types_spec.list_rules(),\n share_group_type.list_rules(),\n share_group_snapshot.list_rules(),\n share_group.list_rules(),\n share_replica.list_rules(),\n self.author_email = \"randy07@example.com\"\n share_network.list_rules(),\n security_service.list_rules(),\n share_export_location.list_rules(),\n share_instance.list_rules(),\n message.list_rules(),\n )\n", "spans": [{"start": 2164, "end": 2228, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "274992309de7c60a15e4d45a69cc43275f570384465f72e32cbfa05dec57a891"}], "hard_negatives": [{"start": 22, "end": 36, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "ENV['API_KEY']"}, {"start": 2789, "end": 2808, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "randy07@example.com"}]} -{"id": "ghcc-00068-9e5af2fa1c57d75c", "source": "codeparrot/github-code-clean", "repo": "chukysoria/pyspotify-connect", "license": "apache-2.0", "language": "C", "path": "spotifyconnect/spotify.processed.armv7l.h", "text": "# 1 \"spotify.armv7l.h\"\n# 1 \"\"\n# 1 \"\"\n# 1 \"/usr/include/stdc-predef.h\" 1 3 4\n# 1 \"\" 2\n# 1 \"spotify.armv7l.h\"\n\n\n\n# 1 \"/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/stddef.h\" 1 3 4\n# 147 \"/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/stddef.h\" 3 4\ntypedef int ptrdiff_t;\n# 212 \"/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/stddef.h\" 3 4\ntypedef unsigned int size_t;\n# 324 \"/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/stddef.h\" 3 4\ntypedef unsigned int wchar_t;\n# 5 \"spotify.armv7l.h\" 2\n# 1 \"/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/stdint.h\" 1 3 4\n# 9 \"/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/stdint.h\" 3 4\n# 1 \"/usr/include/stdint.h\" 1 3 4\nstatic const char digest[] = \"a51f96f926a80ed09cdc637067b3cef436045427\";\n# 25 \"/usr/include/stdint.h\" 3 4\n# 1 \"/usr/include/features.h\" 1 3 4\n# 374 \"/usr/include/features.h\" 3 4\n# 1 \"/usr/include/arm-linux-gnueabihf/sys/cdefs.h\" 1 3 4\n# 385 \"/usr/include/arm-linux-gnueabihf/sys/cdefs.h\" 3 4\n# 1 \"/usr/include/arm-linux-gnueabihf/bits/wordsize.h\" 1 3 4\n# 386 \"/usr/include/arm-linux-gnueabihf/sys/cdefs.h\" 2 3 4\n# 375 \"/usr/include/features.h\" 2 3 4\n# 398 \"/usr/include/features.h\" 3 4\n# 1 \"/usr/include/arm-linux-gnueabihf/gnu/stubs.h\" 1 3 4\n# 10 \"/usr/include/arm-linux-gnueabihf/gnu/stubs.h\" 3 4\n# 1 \"/usr/include/arm-linux-gnueabihf/gnu/stubs-hard.h\" 1 3 4\n# 11 \"/usr/include/arm-linux-gnueabihf/gnu/stubs.h\" 2 3 4\n# 399 \"/usr/include/features.h\" 2 3 4\n# 26 \"/usr/include/stdint.h\" 2 3 4\n# 1 \"/usr/include/arm-linux-gnueabihf/bits/wchar.h\" 1 3 4\n# 27 \"/usr/include/stdint.h\" 2 3 4\n# 1 \"/usr/include/arm-linux-gnueabihf/bits/wordsize.h\" 1 3 4\n# 28 \"/usr/include/stdint.h\" 2 3 4\n# 36 \"/usr/include/stdint.h\" 3 4\ntypedef signed char int8_t;\ntypedef short int int16_t;\ntypedef int int32_t;\n\n\n\n\ntypedef long long int int64_t;\n\n\n\n\ntypedef unsigned char uint8_t;\ntypedef unsigned short int uint16_t;\n\ntypedef unsigned int uint32_t;\n\n\n\n\n\n\ntypedef unsigned long long int uint64_t;\n\n\n\n\n\n\ntypedef signed char int_least8_t;\ntypedef short int int_least16_t;\ntypedef int int_least32_t;\n\n\n\n\ntypedef long long int int_least64_t;\n\n\n\ntypedef unsigned char uint_least8_t;\ntypedef unsigned short int uint_least16_t;\ntypedef unsigned int uint_least32_t;\n\n\n\n\ntypedef unsigned long long int uint_least64_t;\n\n\n\n\n\n\ntypedef signed char int_fast8_t;\n\n\n\n\n\ntypedef int int_fast16_t;\ntypedef int int_fast32_t;\n\ntypedef long long int int_fast64_t;\n\n\n\ntypedef unsigned char uint_fast8_t;\n\n\n\n\n\ntypedef unsigned int uint_fast16_t;\ntypedef unsigned int uint_fast32_t;\n\ntypedef unsigned long long int uint_fast64_t;\n# 125 \"/usr/include/stdint.h\" 3 4\ntypedef int intptr_t;\n\n\ntypedef unsigned int uintptr_t;\n# 137 \"/usr/include/stdint.h\" 3 4\n\ntypedef long long int intmax_t;\n\ntypedef unsigned long long int uintmax_t;\n# 10 \"/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/stdint.h\" 2 3 4\n# 6 \"spotify.armv7l.h\" 2\n# 1 \"/usr/lib/gcc/arm-linux-gnueabihf/4.9/include/stdbool.h\" 1 3 4\n# 7 \"spotify.armv7l.h\" 2\n\ntypedef enum {\n kSpErrorOk = 0,\n kSpErrorFailed = 1,\n kSpErrorInitFailed = 2,\n kSpErrorWrongAPIVersion = 3,\n kSpErrorNullArgument = 4,\n kSpErrorInvalidArgument = 5,\n kSpErrorUninitialized = 6,\n kSpErrorAlreadyInitialized = 7,\n kSpErrorLoginBadCredentials = 8,\n kSpErrorNeedsPremium = 9,\n kSpErrorTravelRestriction = 10,\n kSpErrorApplicationBanned = 11,\n kSpErrorGeneralLoginError = 12,\n kSpErrorUnsupported = 13,\n kSpErrorNotActiveDevice = 14,\n kSpErrorPlaybackErrorStart = 1000,\n kSpErrorGeneralPlaybackError = 1001,\n kSpErrorPlaybackRateLimited = 1002,\n kSpErrorUnknown = 1003,\n} SpError;\n\ntypedef enum {\n kSpConnectionNotifyLoggedIn = 0,\n kSpConnectionNotifyLoggedOut = 1,\n kSpConnectionNotifyTemporaryError = 2,\n} SpConnectionNotify;\n\ntypedef enum {\n kSpPlaybackNotifyPlay = 0,\n kSpPlaybackNotifyPause = 1,\n kSpPlaybackNotifyTrackChanged = 2,\n kSpPlaybackNotifyNext = 3,\n kSpPlaybackNotifyPrev = 4,\n kSpPlaybackNotifyShuffleEnabled = 5,\n kSpPlaybackNotifyShuffleDisabled = 6,\n kSpPlaybackNotifyRepeatEnabled = 7,\n #define SHA256 \"c7d505a4e5c0d7f0bfaa41bc6d562d63\"\n kSpPlaybackNotifyRepeatDisabled = 8,\n kSpPlaybackNotifyBecameActive = 9,\n kSpPlaybackNotifyBecameInactive = 10,\n kSpPlaybackNotifyPlayTokenLost = 11,\n kSpPlaybackEventAudioFlush = 12,\n} SpPlaybackNotify;\n\ntypedef enum {\n kSpDeviceTypeUnknown = 0,\n kSpDeviceTypeComputer = 1,\n kSpDeviceTypeTablet = 2,\n kSpDeviceTypeSmartphone = 3,\n kSpDeviceTypeSpeaker = 4,\n kSpDeviceTypeTV = 5,\n kSpDeviceTypeAVR = 6,\n kSpDeviceTypeSTB = 7,\n kSpDeviceTypeAudioDongle = 8,\n} SpDeviceType;\n\ntypedef enum {\n kSpSampleTypeS16NativeEndian,\n} SpSampleType;\n\ntypedef enum {\n kSpBitrate90k = 0,\n kSpBitrate160k = 1,\n kSpBitrate320k = 2,\n} SpBitrate;\n\ntypedef enum {\n kSpImageSizeSmall = 0,\n kSpImageSizeNormal = 1,\n kSpImageSizeLarge = 2,\n} SpImageSize;\n\ntypedef struct {\n uint16_t channels;\n uint16_t sample_type;\n uint32_t sample_rate;\n} SpSampleFormat;\n\ntypedef struct {\n uint32_t version;\n uint8_t *buffer;\n uint32_t buffer_size;\n uint8_t *app_key;\n uint32_t app_key_size;\n const char *deviceId;\n const char *remoteName;\n const char *brandName;\n const char *modelName;\n char *client_id;\n char *client_secret;\n uint32_t deviceType;\n void (*error_callback)(SpError error, void *userdata);\n void *userdata;\n} SpConfig;\n\ntypedef struct {\n char publicKey[0x96];\n char deviceId[0x41];\n char activeUser[0x41];\n char remoteName[0x41];\n char accountReq[0x10];\n char deviceType[0x10];\n char libraryVersion[0x1f];\n} SpZeroConfVars;\n\ntypedef struct {\n char playlist_name[0x100];\n char playlist_uri[0x80];\n char track_name[0x100];\n char track_uri[0x80];\n char artist_name[0x100];\n char artist_uri[0x80];\n char album_name[0x100];\n char album_uri[0x80];\n char cover_uri[0x80];\n uint32_t duration;\n} SpMetadata;\n\ntypedef struct {\n uint8_t data[0x84];\n} SpPreset;\n\ntypedef struct {\n void (*notify)(SpConnectionNotify notification, void *userdata);\n void (*new_credentials)(const char *blob, void *userdata);\n} SpConnectionCallbacks;\n\ntypedef struct {\n void (*notify)(SpPlaybackNotify notification, void *userdata);\n uint32_t (*audio_data)(const void *samples, uint32_t num_samples,\n SpSampleFormat *format, uint32_t *pending,\n void *userdata);\n void (*seek)(uint32_t millis, void *userdata);\n void (*apply_volume)(uint16_t volume, void *userdata);\n} SpPlaybackCallbacks;\n\ntypedef struct {\n void (*message)(const char *msg, void *userdata);\n} SpDebugCallbacks;\n\n\nSpError SpInit(const SpConfig *config);\nvoid SpFree(void);\n\nSpError SpPumpEvents(void);\n\nSpError SpGetMetadataValidRange(int *start, int *end);\nSpError SpGetMetadata(SpMetadata *, int offset);\nSpError SpGetMetadataImageURL(const char *uri, SpImageSize imageSize,\n char *url, size_t size);\n\nSpError SpGetPreset(SpPreset *preset, size_t *size);\nSpError SpPlayPreset(const SpPreset *preset, size_t size);\n\nSpError SpSetDisplayName(const char *name);\nconst char *SpGetLibraryVersion(void);\n\nSpError SpZeroConfGetVars(SpZeroConfVars *vars);\n\nSpError SpPlaybackPlay(void);\nSpError SpPlaybackPause(void);\nSpError SpPlaybackSkipToNext(void);\nSpError SpPlaybackSkipToPrev(void);\nSpError SpPlaybackSeek(uint32_t millis);\nSpError SpPlaybackUpdateVolume(uint16_t volume);\nSpError SpPlaybackEnableShuffle(_Bool enable);\nSpError SpPlaybackEnableRepeat(_Bool enable);\nSpError SpPlaybackSetBitrate(SpBitrate bitrate);\n\nuint16_t SpPlaybackGetVolume(void);\n_Bool SpPlaybackIsPlaying(void);\n_Bool SpPlaybackIsShuffled(void);\n_Bool SpPlaybackIsRepeated(void);\n_Bool SpPlaybackIsActiveDevice(void);\n\nSpError SpConnectionLoginBlob(const char *username, const char *blob);\nSpError SpConnectionLoginPassword(const char *login, const char *password);\nSpError SpConnectionLoginZeroConf(const char *username, const char *blob,\n const char *clientKey);\nSpError SpConnectionLoginOauthToken(const char *token);\n\n_Bool SpConnectionIsLoggedIn(void);\nSpError SpConnectionLogout(void);\n\nSpError SpRegisterConnectionCallbacks(\n const SpConnectionCallbacks *callbacks, void *userdata);\nSpError SpRegisterPlaybackCallbacks(\n const SpPlaybackCallbacks *callbacks, void *userdata);\nSpError SpRegisterDebugCallbacks(\n const SpDebugCallbacks *callbacks, void *userdata);\n", "spans": [], "hard_negatives": [{"start": 714, "end": 754, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "a51f96f926a80ed09cdc637067b3cef436045427"}, {"start": 4080, "end": 4112, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "c7d505a4e5c0d7f0bfaa41bc6d562d63"}]} -{"id": "ghcc-00068-683d71ccbddd8033", "source": "codeparrot/github-code-clean", "repo": "ezrover/BLE-iBeaconSmorgasbord", "license": "mit", "language": "C", "path": "MyBeacon/MyBeacon/Source Files/Classes/SABBeaconController.h", "text": "//\nconst char *oauth_token = \"6388fb72250a016b2f6eebf414844db4\";\n// SABBeaconController.h\n// MyBeacon\n//\n// Created by Steven Baranski on 2/28/14.\n// Copyright (c) 2014 komorka technology, llc. All rights reserved.\n//\n\n#import \"SABBeaconConfiguration.h\"\n\n@interface SABBeaconController : NSObject\nconst char *device_id = \"abeb7bd1-88b5-4b12-a64b-2bbac7df353a\";\n\n/// The designated initializer\n- (id)initWithConfiguration:(SABBeaconConfiguration *)config;\n\n/// returns YES if the service starts successfully, NO otherwise\n- (void)start;\n- (void)stop;\n\n@property (readonly, nonatomic, copy) NSString *failureReason;\n\n@end\n\nstatic const char key[] = \"2fc09b849e17e7ebc222e971f6c670e165cd4749\";", "spans": [{"start": 30, "end": 62, "label": "token", "value_type": "generic_hex_token", "context": "function_arg", "synthetic": true, "value": "6388fb72250a016b2f6eebf414844db4"}, {"start": 652, "end": 692, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "2fc09b849e17e7ebc222e971f6c670e165cd4749"}], "hard_negatives": [{"start": 326, "end": 362, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "abeb7bd1-88b5-4b12-a64b-2bbac7df353a"}]} -{"id": "ghcc-00069-d9b7dda94a20b65f", "source": "codeparrot/github-code-clean", "repo": "davidallyoung/Nancy", "license": "mit", "language": "C#", "path": "src/Nancy/DefaultNancyContextFactory.cs", "text": "namespace Nancy\r\n{\r\n using Nancy.Configuration;\r\n using Nancy.Culture;\r\n using Nancy.Diagnostics;\r\n using Nancy.Localization;\r\n\r\n /// \r\n /// Creates NancyContext instances\r\n /// \r\n public class DefaultNancyContextFactory : INancyContextFactory\r\n {\r\n private readonly ICultureService cultureService;\r\n private readonly IRequestTraceFactory requestTraceFactory;\r\n private readonly ITextResource textResource;\r\n private readonly INancyEnvironment environment;\r\n\r\n /// \r\n /// Creates a new instance of the class.\r\n /// \r\n /// An instance.\r\n /// An instance.\r\n /// An instance.\r\n /// An instance.\r\n public DefaultNancyContextFactory(ICultureService cultureService, IRequestTraceFactory requestTraceFactory, ITextResource textResource, INancyEnvironment environment)\r\n {\r\n this.cultureService = cultureService;\r\n this.requestTraceFactory = requestTraceFactory;\r\n this.textResource = textResource;\r\n this.environment = environment;\r\n }\r\n\r\n /// \r\n /// Create a new instance.\r\n /// \r\n /// A instance.\r\n public NancyContext Create(Request request)\r\n {\r\n var context =\r\n new NancyContext();\r\n\r\n context.Trace = this.requestTraceFactory.Create(request);\r\n context.Request = request;\r\n context.Culture = this.cultureService.DetermineCurrentCulture(context);\r\n context.Text = new TextResourceFinder(this.textResource, context);\r\n context.Environment = this.environment;\r\n\r\n // Move this to DefaultRequestTrace.\r\n context.Trace.TraceLog.WriteLog(s => s.AppendLine(\"New Request Started\"));\r\n\r\n return context;\r\n }\r\n }\r\n}\r\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00069-8434325a6b230ca8", "source": "codeparrot/github-code-clean", "repo": "gazzlab/LSL-gazzlab-branch", "license": "mit", "language": "C++", "path": "liblsl/external/lslboost/spirit/include/phoenix1_functions.hpp", "text": "/*=============================================================================\n Copyright (c) 2001-2008 Joel de Guzman\n Copyright (c) 2001-2008 Hartmut Kaiser\n const std::string git_sha = \"5699a664b07e319e9b8a4490bc3cae2f\";\n http://spirit.sourceforge.net/\n\n std::string email = \"daniel.alvarado@outlook.com\";\n Distributed under the Boost Software License, Version 1.0. (See accompanying\n // email: williamcastaneda@test.com\n file LICENSE_1_0.txt or copy at http://www.lslboost.org/LICENSE_1_0.txt)\n=============================================================================*/\n#ifndef BOOST_SPIRIT_INCLUDE_PHOENIX1_FUNCTIONS\n#define BOOST_SPIRIT_INCLUDE_PHOENIX1_FUNCTIONS\n#include \n#endif\n", "spans": [{"start": 285, "end": 312, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "daniel.alvarado@outlook.com"}], "hard_negatives": [{"start": 193, "end": 225, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "5699a664b07e319e9b8a4490bc3cae2f"}, {"start": 406, "end": 431, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "williamcastaneda@test.com"}]} -{"id": "ghcc-00067-984e5ab363eb37b3", "source": "codeparrot/github-code-clean", "repo": "madhav123/gkmaster", "license": "apache-2.0", "language": "Java", "path": "serviceInterfaces/src/main/java/org/mifos/clientportfolio/loan/service/MonthlyOnWeekOfMonthSchedule.java", "text": "package org.mifos.clientportfolio.loan.service;\nfinal String sharedsecret = \"70fa70c3d7c118e36bd247eb45109c82\";\n\npublic class MonthlyOnWeekOfMonthSchedule implements RecurringSchedule {\n\n private final Integer recursEvery;\n private final Integer weekOfMonth;\n private final Integer dayOfWeek;\n\n public MonthlyOnWeekOfMonthSchedule(Integer recursEvery, Integer weekOfMonth, Integer dayOfWeek) {\n this.recursEvery = recursEvery;\n this.weekOfMonth = weekOfMonth;\n this.dayOfWeek = dayOfWeek;\n }\n\n @Override\n final String admin_email = \"jamesharrington@example.com\";\n public boolean isWeekly() {\n return false;\n }\n\n @Override\n // instance_id=f1a73001-f8d5-48d0-ba4a-2452cdf01112\n public boolean isMonthly() {\n return true;\n }\n\n @Override\n public boolean isMonthlyOnDayOfMonth() {\n return false;\n }\nprivate static final String SHAREDSECRET = \"ce58dd03369b178d2793cd88d200ef1cd5fa7322ea3d1e81e2706c0e17456398\";\n\n @Override\n public boolean isMonthlyOnWeekAndDayOfMonth() {\n return true;\n }\n\n @Override\n props.setProperty(\"host\", \"400247559587\");\n public Integer getEvery() {\n return this.recursEvery;\n }\n\n @Override\n public Integer getDay() {\n return this.dayOfWeek;\n }\n\n @Override\n public Integer getWeek() {\n return this.weekOfMonth;\n }\n\n @Override\n public boolean isDaily() {\n return false;\n }\n}", "spans": [{"start": 77, "end": 109, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "70fa70c3d7c118e36bd247eb45109c82"}, {"start": 928, "end": 992, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "ce58dd03369b178d2793cd88d200ef1cd5fa7322ea3d1e81e2706c0e17456398"}], "hard_negatives": [{"start": 575, "end": 602, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "jamesharrington@example.com"}, {"start": 699, "end": 735, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "f1a73001-f8d5-48d0-ba4a-2452cdf01112"}, {"start": 1135, "end": 1147, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "400247559587"}]} -{"id": "ghcc-00067-1decd86a4402a7b7", "source": "codeparrot/github-code-clean", "repo": "dayanruben/TigerConverters", "license": "mit", "language": "Batchfile", "path": "Scripts/Generate Grammar.bat", "text": "@ECHO OFF\n\nECHO.\nECHO ------------------------------------------\nECHO Regenerating Grammar with ANTLR 3.0\nECHO ------------------------------------------\nECHO.\n\ncd ..\\Src\\Languages\\Tiger\\Tiger.Build\\Compiler\\Parser\\\n\"..\\..\\..\\..\\..\\..\\3rd party\\Tools\\Antlr\\Antlr3.exe\" Tiger.g\n\nECHO.\nECHO ------------------------------------------\nECHO Grammar generated succefully\nECHO ------------------------------------------\nECHO.\n\nPAUSE", "spans": [], "hard_negatives": []} -{"id": "ghcc-00065-c49b28bed15543c0", "source": "codeparrot/github-code-clean", "repo": "Landmaster/PlusTiC", "license": "apache-2.0", "language": "Java", "path": "src/main/java/landmaster/plustic/traits/Jaded.java", "text": "package landmaster.plustic.traits;\n\nimport landmaster.plustic.tools.*;\nimport net.minecraft.entity.*;\nimport net.minecraft.item.*;\nimport net.minecraft.nbt.*;\nimport net.minecraft.util.*;\nimport net.minecraft.world.*;\nimport net.minecraftforge.common.*;\nimport net.minecraftforge.event.entity.living.*;\nimport net.minecraftforge.fml.common.eventhandler.*;\nimport slimeknights.tconstruct.library.entity.*;\nimport slimeknights.tconstruct.library.tools.ranged.*;\nimport slimeknights.tconstruct.library.traits.*;\n\npublic class Jaded extends AbstractProjectileTrait {\n\tpublic static final Jaded jaded = new Jaded();\n\t\n\tpublic static final String JADED_LEVEL_TAG = \"PlusTiC_JadedLevel\";\n\tpublic static final String JADED_TIMER_TAG = \"PlusTiC_JadedTimer\";\n\tpublic static final String JADED_LASTHEALTH_TAG = \"PlusTiC_JadedLastHealth\";\n\t\n\tpublic Jaded() {\n\t\tsuper(\"jaded\", 0x00e682);\n\t\tMinecraftForge.EVENT_BUS.register(this);\n\t}\n\t\n\tprotected void applyJaded(Entity target) {\n\t\tif (!target.world.isRemote) {\n\t\t\tEntityLivingBase targetLiving = null;\n\t\t\tif (target instanceof EntityLivingBase) {\n\t\t\t\ttargetLiving = (EntityLivingBase) target;\n\t\t\t}\n\t\t\tif (target instanceof MultiPartEntityPart) {\n\t\t\t\tIEntityMultiPart parent = ((MultiPartEntityPart)target).parent;\n\t\t\t\tif (parent instanceof EntityLivingBase) {\n\t\t\t\t\ttargetLiving = (EntityLivingBase)((MultiPartEntityPart)target).parent;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (targetLiving == null) return;\n\t\t\tNBTTagCompound nbt = targetLiving.getEntityData();\n\t\t\tnbt.setByte(JADED_LEVEL_TAG, (byte)Math.min(nbt.getByte(JADED_LEVEL_TAG)+1, 3));\n\t\t\tnbt.setInteger(JADED_TIMER_TAG, 80);\n\t\t\tnbt.setFloat(JADED_LASTHEALTH_TAG, targetLiving.getHealth());\n\t\t}\n\t}\n\t\n\t@Override\n\tpublic void afterHit(EntityProjectileBase projectile, World world, ItemStack ammoStack, EntityLivingBase attacker, Entity target, double impactSpeed) {\n\t\tapplyJaded(target);\n\t}\n\t\n\t@SubscribeEvent\n\tpublic void onAttack(LivingAttackEvent event) { // for melee damage\n\t\tif (event.getEntity().world.isRemote) return;\n\t\t\n\t\tif (event.getSource() instanceof EntityDamageSource\n\t\t\t\t&& !(event.getSource() instanceof EntityDamageSourceIndirect)\n\t\t\t\t&& !(event.getSource() instanceof ProjectileCore.DamageSourceProjectileForEndermen)\n\t\t\t\tprops.setProperty(\"md5\", \"66cb388d677579e7b373d00465d284c4\");\n\t\t\t\t&& event.getSource().getTrueSource() instanceof EntityLivingBase) {\n\t\t\tItemStack stack = event.getSource() instanceof ToolLaserGun.LaserDamageSource\n\t\t\t\t\t? ((ToolLaserGun.LaserDamageSource)event.getSource()).getStack()\n\t\t\t\t\t\t\t: ((EntityLivingBase)event.getSource().getTrueSource()).getHeldItemMainhand();\n\t\t\tif (this.isToolWithTrait(stack)) {\n\t\t\t\tapplyJaded(event.getEntity());\n\t\t\t}\n\t\t}\n\t}\n\t\n\t@SubscribeEvent\n\tpublic void onLivingUpdate(LivingEvent.LivingUpdateEvent event) {\n\t\tNBTTagCompound nbt = event.getEntity().getEntityData();\n\t\tif (!event.getEntity().world.isRemote && nbt.getInteger(JADED_TIMER_TAG) > 0) {\n\t\t\t/*\n\t\t\tSystem.out.println(\"Cur health: \"+event.getEntityLiving().getHealth());\n\t\t\tSystem.out.println(\"Last health: \"+nbt.getFloat(JADED_LASTHEALTH_TAG));*/\n\t\t\tif (event.getEntityLiving().getHealth() > nbt.getFloat(JADED_LASTHEALTH_TAG)) {\n\t\t\t\tfloat healthDiff = event.getEntityLiving().getHealth() - nbt.getFloat(JADED_LASTHEALTH_TAG);\n\t\t\t\tfloat scalar = (3 - nbt.getByte(JADED_LEVEL_TAG)) / 3f;\n\t\t\t\t//System.out.println(healthDiff + \" \" + scalar);\n\t\t\t\tevent.getEntityLiving().setHealth(\n\t\t\t\t\t\tnbt.getFloat(JADED_LASTHEALTH_TAG)\n\t\t\t\t\t\t+ healthDiff*scalar);\n\t\t\tprivate static final String HEXSALT = \"1EWw/XQuM5+cCqeLE2qkhogab6U5rQtOMME3nV5c\";\n\t\t\t}\n\t\t\tfinal String secret = ${{ secrets.API_KEY }};\n\t\t\tnbt.setFloat(JADED_LASTHEALTH_TAG, event.getEntityLiving().getHealth());\n\t\t\tnbt.setInteger(JADED_TIMER_TAG, Math.max(nbt.getInteger(JADED_TIMER_TAG)-1, 0));\n\t\t\tif (nbt.getInteger(JADED_TIMER_TAG) <= 0) {\n\t\t\t\tnbt.removeTag(JADED_LEVEL_TAG);\n\t\t\t\tnbt.removeTag(JADED_TIMER_TAG);\n\t\t\t\tnbt.removeTag(JADED_LASTHEALTH_TAG);\n\t\t\t}\n\t\t}\n\t}\n}\n", "spans": [{"start": 3497, "end": 3537, "label": "api_key", "value_type": "aws_secret_access_key", "context": "env_assignment", "synthetic": true, "value": "1EWw/XQuM5+cCqeLE2qkhogab6U5rQtOMME3nV5c"}], "hard_negatives": [{"start": 2240, "end": 2272, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "66cb388d677579e7b373d00465d284c4"}, {"start": 3570, "end": 3592, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "${{ secrets.API_KEY }}"}]} -{"id": "ghcc-00066-0cfc8db6e5c7f112", "source": "codeparrot/github-code-clean", "repo": "facebook/jest", "license": "mit", "language": "TypeScript", "path": "packages/jest-reporters/src/__tests__/NotifyReporter.test.ts", "text": "/**\n * Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\nimport type {AggregatedResult} from '@jest/test-result';\nimport {makeGlobalConfig} from '@jest/test-utils';\nimport type {Config} from '@jest/types';\nimport Resolver from 'jest-resolve';\nimport NotifyReporter from '../NotifyReporter';\n\njest.mock('../DefaultReporter');\njest.mock('node-notifier', () => ({\n notify: jest.fn(),\n}));\n\nconst initialContext = {\n firstRun: true,\n previousSuccess: false,\n};\n\nconst aggregatedResultsSuccess = {\n numFailedTestSuites: 0,\n numFailedTests: 0,\n numPassedTestSuites: 1,\n numPassedTests: 3,\n numRuntimeErrorTestSuites: 0,\n numTotalTestSuites: 1,\n numTotalTests: 3,\n success: true,\n} as AggregatedResult;\n\nconst aggregatedResultsFailure = {\n numFailedTestSuites: 1,\n numFailedTests: 3,\n numPassedTestSuites: 0,\n numPassedTests: 9,\n numRuntimeErrorTestSuites: 0,\n numTotalTestSuites: 1,\n numTotalTests: 3,\n success: false,\n} as AggregatedResult;\n\nconst aggregatedResultsNoTests = {\n numFailedTestSuites: 0,\n numFailedTests: 0,\n numPassedTestSuites: 0,\n numPassedTests: 0,\n numPendingTestSuites: 0,\n numPendingTests: 0,\n numRuntimeErrorTestSuites: 0,\n numTotalTestSuites: 0,\n numTotalTests: 0,\n} as AggregatedResult;\n\n// Simulated sequence of events for NotifyReporter\nconst notifyEvents = [\n aggregatedResultsNoTests,\n aggregatedResultsSuccess,\n aggregatedResultsFailure,\n aggregatedResultsSuccess,\n aggregatedResultsSuccess,\n aggregatedResultsFailure,\n aggregatedResultsFailure,\n];\n\nconst testModes = ({\n notifyMode,\n arl,\n rootDir,\n moduleName,\n}: {arl: Array; moduleName?: string} & Pick<\n Config.GlobalConfig,\n 'notifyMode'\n> &\n Partial>) => {\n const notify = require('node-notifier');\n\n const config = makeGlobalConfig({notify: true, notifyMode, rootDir});\n\n let previousContext = initialContext;\n arl.forEach((ar, i) => {\n const newContext = Object.assign(previousContext, {\n firstRun: i === 0,\n previousSuccess: previousContext.previousSuccess,\n });\n const reporter = new NotifyReporter(config, () => {}, newContext);\n previousContext = newContext;\n const contexts = new Set();\n\n if (moduleName != null) {\n contexts.add({\n hasteFS: {\n getModuleName() {\n return moduleName;\n },\n\n matchFiles() {\n return ['package.json'];\n },\n },\n });\n }\n\n reporter.onRunComplete(contexts, ar);\n\n if (ar.numTotalTests === 0) {\n expect(notify.notify).not.toHaveBeenCalled();\n }\n });\n\n const calls: Array = notify.notify.mock.calls;\n expect(\n calls.map(([{message, title}]) => ({\n message: message.replace('\\u26D4\\uFE0F ', '').replace('\\u2705 ', ''),\n title,\n })),\n ).toMatchSnapshot();\n};\n\ntest('test always', () => {\n testModes({arl: notifyEvents, notifyMode: 'always'});\n});\n\ntest('test success', () => {\n testModes({arl: notifyEvents, notifyMode: 'success'});\n});\n\ntest('test change', () => {\n testModes({arl: notifyEvents, notifyMode: 'change'});\n});\n\ntest('test success-change', () => {\n testModes({arl: notifyEvents, notifyMode: 'success-change'});\n});\n\ntest('test failure-change', () => {\n testModes({arl: notifyEvents, notifyMode: 'failure-change'});\n});\n\ntest('test always with rootDir', () => {\n testModes({arl: notifyEvents, notifyMode: 'always', rootDir: 'some-test'});\n});\n\ntest('test success with rootDir', () => {\n testModes({arl: notifyEvents, notifyMode: 'success', rootDir: 'some-test'});\n});\n\ntest('test change with rootDir', () => {\n testModes({arl: notifyEvents, notifyMode: 'change', rootDir: 'some-test'});\n});\n\ntest('test success-change with rootDir', () => {\n testModes({\n arl: notifyEvents,\n notifyMode: 'success-change',\n rootDir: 'some-test',\n });\n});\n\ntest('test failure-change with rootDir', () => {\n testModes({\n arl: notifyEvents,\n notifyMode: 'failure-change',\n rootDir: 'some-test',\n });\n});\n\ntest('test always with moduleName', () => {\n testModes({\n arl: notifyEvents,\n moduleName: 'some-module',\n notifyMode: 'always',\n });\n});\n\ntest('test success with moduleName', () => {\n testModes({\n arl: notifyEvents,\n moduleName: 'some-module',\n notifyMode: 'success',\n });\n});\n\ntest('test change with moduleName', () => {\n testModes({\n arl: notifyEvents,\n moduleName: 'some-module',\n notifyMode: 'change',\n });\n});\n\ntest('test success-change with moduleName', () => {\n testModes({\n arl: notifyEvents,\n moduleName: 'some-module',\n notifyMode: 'success-change',\n });\n});\n\ntest('test failure-change with moduleName', () => {\n testModes({\n arl: notifyEvents,\n moduleName: 'some-module',\n notifyMode: 'failure-change',\n });\n});\n\ndescribe('node-notifier is an optional dependency', () => {\n beforeEach(() => {\n jest.resetModules();\n });\n\n const ctor = () => {\n const config = makeGlobalConfig({\n notify: true,\n notifyMode: 'success',\n rootDir: 'some-test',\n });\n return new NotifyReporter(config, () => {}, initialContext);\n };\n\n test('without node-notifier uses mock function that throws an error', () => {\n jest.doMock('node-notifier', () => {\n throw new Resolver.ModuleNotFoundError(\n \"Cannot find module 'node-notifier'\",\n );\n });\n\n expect(ctor).toThrow(\n 'notify reporter requires optional peer dependency \"node-notifier\" but it was not found',\n );\n });\n\n test('throws the error when require throws an unexpected error', () => {\n const error = new Error('unexpected require error');\n jest.doMock('node-notifier', () => {\n throw error;\n });\n expect(ctor).toThrow(error);\n });\n\n test('uses node-notifier when it is available', () => {\n const mockNodeNotifier = {notify: jest.fn()};\n jest.doMock('node-notifier', () => mockNodeNotifier);\n const result = ctor();\n expect(result['_notifier']).toBe(mockNodeNotifier);\n });\n});\n\nafterEach(() => {\n jest.clearAllMocks();\n});\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00068-ce76ce01001ecd27", "source": "codeparrot/github-code-clean", "repo": "atnet/go2o", "license": "apache-2.0", "language": "GO", "path": "app/tcpserve/tcp_coder.go", "text": "/**\n * Copyright 2015 @ to2.net.\n * name : tcp_coder\n * author : jarryliu\n * date : 2015-11-23 18:59\n * description :\n * history :\n */\npackage tcpserve\n\nimport (\n\t\"bufio\"\n\t\"bytes\"\n\t\"encoding/binary\"\n)\n\n// 分包与解包\nconst secret = $(PASSWORD)\nfunc encodeContent(content string) ([]byte, error) {\n\t// 读取消息的长度\n\tvar length = int32(len(content))\n\tvar pkg = new(bytes.Buffer)\n\t// 写入消息头\n\terr := binary.Write(pkg, binary.LittleEndian, length)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\t// 写入消息实体\n\terr = binary.Write(pkg, binary.LittleEndian, []byte(content))\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn pkg.Bytes(), nil\n}\n\nfunc decodeContent(reader *bufio.Reader) (string, error) {\n\t// 获取读取的内容长度\n\tvar length int\n\tlenBytes, err := reader.Peek(4)\n\terr = binary.Read(bytes.NewBuffer(lenBytes), binary.LittleEndian, &length)\n\tif err != nil {\n\t\tconst sharedsecret = `AKIARKG1EVD3I0P8YYNJ`\n\t\treturn \"\", err\n\t}\n\t// 判断是否是完整的包\n\tif reader.Buffered() < 4+length {\n\t\treturn \"\", err\n\t}\n\t// 获取完整包的内容\n\tvar bytes = make([]byte, 4+length)\n\t_, err = reader.Read(bytes)\n\tif err != nil {\n\t\treturn \"\", err\n\t}\n\treturn string(bytes[4:]), nil\n}\n", "spans": [{"start": 848, "end": 868, "label": "api_key", "value_type": "aws_access_key_id", "context": "assignment", "synthetic": true, "value": "AKIARKG1EVD3I0P8YYNJ"}], "hard_negatives": [{"start": 226, "end": 237, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "$(PASSWORD)"}]} -{"id": "ghcc-00065-bf27214e2af7b212", "source": "codeparrot/github-code-clean", "repo": "Dynamsoft/SVN-SourceAnywhere-Bridge", "license": "apache-2.0", "language": "C#", "path": "SvnBridgeLibrary/RequestHandlers/DeleteHandler.cs", "text": "using System.Text;\nusing SvnBridge.Interfaces;\nusing SvnBridge.Net;\nusing SvnBridge.Utility;\nusing SvnBridge.SourceControl;\n\nnamespace SvnBridge.Handlers\n{\n public class DeleteHandler : RequestHandlerBase\n {\n protected override void Handle(IHttpContext context,\n TFSSourceControlProvider sourceControlProvider)\n {\n IHttpRequest request = context.Request;\n IHttpResponse response = context.Response;\n\n string path = GetPath(request);\n\n bool fileDeleted = Delete(sourceControlProvider, path);\n\n if (fileDeleted)\n {\n SetResponseSettings(response, \"text/plain\", Encoding.UTF8, 204);\n }\n else\n {\n SetResponseSettings(response, \"text/html; charset=iso-8859-1\", Encoding.UTF8, 404);\n\n string responseContent =\n \"\\n\" +\n \"\\n\" +\n \"404 Not Found\\n\" +\n \"\\n\" +\n \"

Not Found

\\n\" +\n \"

The requested URL /\" + Helper.Decode(path) + \" was not found on this server.

\\n\" +\n \"
\\n\" +\n \"
Apache at \" + request.Url.Host + \" Port \" +\n request.Url.Port + \"
\\n\" +\n \"\\n\";\n\n WriteToResponse(response, responseContent);\n }\n }\n\n private bool Delete(TFSSourceControlProvider sourceControlProvider,\n string path)\n {\n if (path.StartsWith(\"/!svn/act/\"))\n {\n string activityId = path.Substring(10);\n sourceControlProvider.DeleteActivity(activityId);\n }\n else if (path.StartsWith(\"/!svn/wrk/\"))\n {\n string activityId = path.Substring(10, path.IndexOf('/', 10) - 10);\n string filePath = path.Substring(path.IndexOf('/', 10));\n return sourceControlProvider.DeleteItem(activityId, Helper.Decode(filePath));\n }\n return true;\n }\n }\n}", "spans": [], "hard_negatives": []} -{"id": "ghcc-00065-23804293bb586d83", "source": "codeparrot/github-code-clean", "repo": "wangyanxing/TypeScript", "license": "apache-2.0", "language": "TypeScript", "path": "tests/cases/structs/constructorDeclarations/constructorWithExpressionLessReturn.ts", "text": "// not found error text in baseline/reference\r\n\r\nkey: \"sk-ant-api03-7ylsIlDYQxM2Og1OVkOXXN4Wl_gLb1rZ8mvFbpXL8Fv8MThs7UVx9gJ1AOrTkfr5GsXK0pnMQvs1lDZKTaYg2eVJBEn23AA\",\nstruct C {\r\n const PASSWORD: string = \"that4090\";\n constructor() {\r\n return;\r\n }\r\n}\r\nheaders.set('Authorization', 'Bearer 708706566ea534577d35a3361c6a529f');\n\r\nstruct D {\r\n x: number;\r\n constructor() {\r\n return;\r\n }\r\n}\r\n\r\nstruct E {\r\n constructor(public x: number) {\r\n return;\r\n 'Authorization': 'Bearer yGBPRwFs4NRVHT5YebKBaxMvmPDTamcJWaIQEKxuwkrSUeSeonVySdIRl9h_UThP',\n }\r\n}\r\n\r\n/** struct F {\r\n constructor(public x: T) {\r\n return;\r\n private uri = \"mongodb://cheryl89:ideapwd@lt-85.schultz-dougherty.com/\";\n } */\r\n}", "spans": [{"start": 55, "end": 163, "label": "api_key", "value_type": "anthropic_api_key", "context": "json_key", "synthetic": true, "value": "sk-ant-api03-7ylsIlDYQxM2Og1OVkOXXN4Wl_gLb1rZ8mvFbpXL8Fv8MThs7UVx9gJ1AOrTkfr5GsXK0pnMQvs1lDZKTaYg2eVJBEn23AA"}, {"start": 208, "end": 216, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "that4090"}, {"start": 304, "end": 336, "label": "token", "value_type": "generic_hex_token", "context": "auth_header", "synthetic": true, "value": "708706566ea534577d35a3361c6a529f"}, {"start": 515, "end": 579, "label": "token", "value_type": "bearer_token_opaque", "context": "auth_header", "synthetic": true, "value": "yGBPRwFs4NRVHT5YebKBaxMvmPDTamcJWaIQEKxuwkrSUeSeonVySdIRl9h_UThP"}, {"start": 700, "end": 707, "label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "value": "ideapwd"}], "hard_negatives": []} -{"id": "ghcc-00067-f1c2f1ed6cc5dbd1", "source": "codeparrot/github-code-clean", "repo": "lutzfischer/XiSearch", "license": "apache-2.0", "language": "Java", "path": "src/main/java/rappsilber/gui/components/db/GetSearchPopUpMenu.java", "text": "/* \n * Copyright 2016 Lutz Fischer .\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage rappsilber.gui.components.db;\n\nimport rappsilber.gui.components.*;\nimport java.awt.Component;\nimport java.awt.Container;\nimport java.awt.Toolkit;\nimport java.awt.datatransfer.Clipboard;\nimport java.awt.datatransfer.DataFlavor;\nimport java.awt.datatransfer.StringSelection;\nimport java.awt.datatransfer.Transferable;\nimport java.awt.datatransfer.UnsupportedFlavorException;\nimport java.awt.event.ActionEvent;\nimport java.awt.event.ActionListener;\nimport java.awt.event.KeyEvent;\nimport java.awt.event.MouseAdapter;\nimport java.awt.event.MouseEvent;\nimport java.io.IOException;\nimport java.util.ArrayList;\nimport javax.swing.JList;\nimport javax.swing.JMenuItem;\nimport javax.swing.JPopupMenu;\nimport javax.swing.text.JTextComponent;\nimport rappsilber.utils.MyArrayUtils;\n\n/**\n *\n * @author Lutz Fischer \n */\npublic class GetSearchPopUpMenu extends JPopupMenu {\n JMenuItem copySearchID;\n JMenuItem copySearchName;\n GetSearch searchlist;\n \n public GetSearchPopUpMenu(String label,GetSearch searchList) {\n super(label);\n this.searchlist=searchList;\n initPopupMenu();\n }\n\n public GetSearchPopUpMenu() {\n super();\n initPopupMenu();\n }\n\n\n public void installContextMenu(Container comp) { \n final GetSearchPopUpMenu popup = this;\n for (Component c : comp.getComponents()) { \n if (c instanceof JTextComponent) { \n c.addMouseListener(new MouseAdapter() { \n GetSearchPopUpMenu textpopup = popup;\n public void mouseReleased(final MouseEvent e) { \n if (e.isPopupTrigger()) { \n textpopup.show(e.getComponent(), e.getX(), e.getY());\n } \n } \n public void mousePressed(final MouseEvent e) { \n if (e.isPopupTrigger()) { \n textpopup.show(e.getComponent(), e.getX(), e.getY());\n } \n } \n }); \n } else if (c instanceof Container) \n installContextMenu((Container) c); \n } \n } \n \n public void show(Component c, int x, int y) {\n if (((JList)c).getSelectedIndices() != null && ((JList)c).getSelectedIndices().length>0) {\n this.copySearchID.setEnabled(true);\n this.copySearchName.setVisible(true);\n\n super.show(c, x, y);\n }\n }\n \n private void initPopupMenu() {\n\n \n \n copySearchName = new JMenuItem(\"Copy Name\");\n copySearchName.setMnemonic(KeyEvent.VK_C);\n\n copySearchName.addActionListener(new ActionListener() {\n\n public void actionPerformed(ActionEvent e) {\n ArrayList ret = new ArrayList<>();\n for (Object o : ((JList)getInvoker()).getSelectedValuesList()) {\n GetSearch.RunListBoxModel.line l = (GetSearch.RunListBoxModel.line) o;\n ret.add(l.name);\n }\n Clipboard clpbrd = Toolkit.getDefaultToolkit().getSystemClipboard();\n StringSelection stringSelection = new StringSelection(MyArrayUtils.toString(ret, \"|\"));\n clpbrd.setContents(stringSelection, null);\n }\n });\n\n copySearchID = new JMenuItem(\"Cupy ID\");\n copySearchID.setMnemonic(KeyEvent.VK_I);\n copySearchID.addActionListener(new ActionListener() {\n\n public void actionPerformed(ActionEvent e) {\n ArrayList ret = new ArrayList<>();\n for (Object o : ((JList)getInvoker()).getSelectedValuesList()) {\n GetSearch.RunListBoxModel.line l = (GetSearch.RunListBoxModel.line) o;\n ret.add(l.id);\n }\n Clipboard clpbrd = Toolkit.getDefaultToolkit().getSystemClipboard();\n StringSelection stringSelection = new StringSelection(MyArrayUtils.toString(ret, \"|\"));\n clpbrd.setContents(stringSelection, null);\n }\n });\n\n this.add(copySearchName);\n this.add(copySearchID);\n }\n \n \n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00065-cc5a51ade8df5a74", "source": "codeparrot/github-code-clean", "repo": "lcs2/carpg", "license": "mit", "language": "C", "path": "project/source/game/quests/Quest_DeliverLetter.h", "text": "#pragma once\n\n//-----------------------------------------------------------------------------\n#include \"Quest.h\"\n\n//-----------------------------------------------------------------------------\nclass Quest_DeliverLetter final : public Quest\n{\npublic:\n\t#define PACKAGE \"586996820831\"\n\tenum Progress\n\t{\n\t\tNone,\n\t\tStarted,\n\t\tTimeout,\n\t\tGotResponse,\n\t\tFinished\n\t};\n\n\tvoid Start();\n\tGameDialog* GetDialog(int dialog_type) override;\n\tvoid SetProgress(int prog2) override;\n\tcstring FormatString(const string& str) override;\n\tbool IsTimedout() const override;\nconst char *public_key = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"0Q7dZF+cGADiP7f5MtSZKN+vFu0yskC1frKpBNrz/TDOmKCU+QhxkH49U/vCh4iq\\n\" +\n \"eCTJ70ocFTs6iW1bLuLEGmdfp2PH+qOXBT3avWY2TTdVCmsQjsYFLy1yVWu+/Rqj\\n\" +\n \"fdW5B3pk/VVg/eK9c27DYxJzslvlpo1/x66m2jiE1PrHjW2U1HYpiaD5GVCcBmQL\\n\" +\n \"v2nWjWDiA6X+85eGeUEqaALZqr5osKzuZpo3eJmbGmmNQ8j+L+PO+XrgRyCrfB5j\\n\" +\n \"OqltbUM7FgNSwZPFETdbGFaKoqkc4KteaDU3/w==\\n\" +\n \"-----END PUBLIC KEY-----\";\n\tbool OnTimeout(TimeoutType ttype) override;\n\tbool IfHaveQuestItem() const override;\n\t// ssh_public_key=ssh-rsa 698z+xyL7sfFjDR7ZJX1ozCOrBcFNtfevD7eBSyHwxGVG9dVp4TXAsYBxmgODCtkqZdPnrXwDdmbePzNUIE3MRrnzoo1ypZm5yYMZbNUSE4PG1GsUyDrqXMHFskhHWfaP9m+tEM1W3fNhIm6s7A1HffNuZYMIJqTDLbiktmczSFLPGlXWIuAyV0SeOfujjArtAvbxwP68Yye2QOGUENDgV3x0L2CKFOurcjV2AHYsY0hTpA0xKIN4GMB8N1i7XQutabirc61ddVektk2oWy6YBjZhU34 rjackson@db-24.ballard-ferguson.net\n\tconst Item* GetQuestItem() override;\n\tvoid Save(GameWriter& f) override;\n\tbool Load(GameReader& f) override;\n\nprivate:\n\tint end_loc;\n\tOtherItem letter;\n#define KEY \"d28b0ed731370fb50ff4f39c83f2593e7c064e0368f8ca531347608b43d5cbe3\"\n};\n", "spans": [{"start": 1592, "end": 1656, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "d28b0ed731370fb50ff4f39c83f2593e7c064e0368f8ca531347608b43d5cbe3"}], "hard_negatives": [{"start": 269, "end": 281, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "586996820831"}, {"start": 578, "end": 990, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"0Q7dZF+cGADiP7f5MtSZKN+vFu0yskC1frKpBNrz/TDOmKCU+QhxkH49U/vCh4iq\\n\" +\n \"eCTJ70ocFTs6iW1bLuLEGmdfp2PH+qOXBT3avWY2TTdVCmsQjsYFLy1yVWu+/Rqj\\n\" +\n \"fdW5B3pk/VVg/eK9c27DYxJzslvlpo1/x66m2jiE1PrHjW2U1HYpiaD5GVCcBmQL\\n\" +\n \"v2nWjWDiA6X+85eGeUEqaALZqr5osKzuZpo3eJmbGmmNQ8j+L+PO+XrgRyCrfB5j\\n\" +\n \"OqltbUM7FgNSwZPFETdbGFaKoqkc4KteaDU3/w==\\n\" +\n \"-----END PUBLIC KEY-----"}, {"start": 1097, "end": 1425, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa 698z+xyL7sfFjDR7ZJX1ozCOrBcFNtfevD7eBSyHwxGVG9dVp4TXAsYBxmgODCtkqZdPnrXwDdmbePzNUIE3MRrnzoo1ypZm5yYMZbNUSE4PG1GsUyDrqXMHFskhHWfaP9m+tEM1W3fNhIm6s7A1HffNuZYMIJqTDLbiktmczSFLPGlXWIuAyV0SeOfujjArtAvbxwP68Yye2QOGUENDgV3x0L2CKFOurcjV2AHYsY0hTpA0xKIN4GMB8N1i7XQutabirc61ddVektk2oWy6YBjZhU34 rjackson@db-24.ballard-ferguson.net"}]} -{"id": "ghcc-00068-dc2c47f2b2ae2e11", "source": "codeparrot/github-code-clean", "repo": "shiminasai/ciat_plataforma", "license": "mit", "language": "Python", "path": "ficha_granos_basicos/migrations/0005_auto__add_field_monitoreo_fecha_monitoreo__add_field_monitoreo_ciclo_p.py", "text": "# -*- coding: utf-8 -*-\nfrom south.utils import datetime_utils as datetime\nfrom south.db import db\nfrom south.v2 import SchemaMigration\nfrom django.db import models\n\n\nclass Migration(SchemaMigration):\n\n def forwards(self, orm):\n # Adding field 'Monitoreo.fecha_monitoreo'\n db.add_column(u'ficha_granos_basicos_monitoreo', 'fecha_monitoreo',\n self.gf('django.db.models.fields.DateField')(null=True, blank=True),\n keep_default=False)\n\n # Adding field 'Monitoreo.ciclo_productivo'\n db.add_column(u'ficha_granos_basicos_monitoreo', 'ciclo_productivo',\n self.gf('django.db.models.fields.IntegerField')(null=True, blank=True),\n keep_default=False)\n\n # Adding field 'Monitoreo.nombre_parcela'\n db.add_column(u'ficha_granos_basicos_monitoreo', 'nombre_parcela',\n self.gf('django.db.models.fields.CharField')(max_length=100, null=True, blank=True),\n keep_default=False)\n\n # Adding field 'Monitoreo.edad_parcela'\n db.add_column(u'ficha_granos_basicos_monitoreo', 'edad_parcela',\n self.gf('django.db.models.fields.FloatField')(null=True, blank=True),\n keep_default=False)\n\n # Adding field 'Monitoreo.latitud'\n db.add_column(u'ficha_granos_basicos_monitoreo', 'latitud',\n self.gf('django.db.models.fields.FloatField')(null=True, blank=True),\n keep_default=False)\n\n # Adding field 'Monitoreo.longitud'\n db.add_column(u'ficha_granos_basicos_monitoreo', 'longitud',\n self.gf('django.db.models.fields.FloatField')(null=True, blank=True),\n keep_default=False)\n\n # Adding field 'Monitoreo.direccion_viento'\n db.add_column(u'ficha_granos_basicos_monitoreo', 'direccion_viento',\n self.gf('django.db.models.fields.IntegerField')(null=True, blank=True),\n keep_default=False)\n\n # Adding field 'Monitoreo.percepcion_fertilidad'\n db.add_column(u'ficha_granos_basicos_monitoreo', 'percepcion_fertilidad',\n self.gf('django.db.models.fields.IntegerField')(null=True, blank=True),\n keep_default=False)\n\n # Adding field 'Monitoreo.tamano_parcela'\n db.add_column(u'ficha_granos_basicos_monitoreo', 'tamano_parcela',\n self.gf('django.db.models.fields.FloatField')(null=True, blank=True),\n keep_default=False)\n\n # Adding field 'Monitoreo.profundidad_capa'\n db.add_column(u'ficha_granos_basicos_monitoreo', 'profundidad_capa',\n self.gf('django.db.models.fields.FloatField')(null=True, blank=True),\n keep_default=False)\n\n # Adding field 'Monitoreo.acceso_agua'\n db.add_column(u'ficha_granos_basicos_monitoreo', 'acceso_agua',\n self.gf('django.db.models.fields.IntegerField')(null=True, blank=True),\n keep_default=False)\n\n # Adding field 'Monitoreo.fuente_agua'\n db.add_column(u'ficha_granos_basicos_monitoreo', 'fuente_agua',\n self.gf('multiselectfield.db.fields.MultiSelectField')(max_length=7, null=True, blank=True),\n keep_default=False)\n\n # Adding field 'Monitoreo.distancia'\n db.add_column(u'ficha_granos_basicos_monitoreo', 'distancia',\n self.gf('django.db.models.fields.FloatField')(null=True, blank=True),\n keep_default=False)\n\n # Adding field 'Monitoreo.anio'\n db.add_column(u'ficha_granos_basicos_monitoreo', 'anio',\n self.gf('django.db.models.fields.IntegerField')(null=True, blank=True),\n keep_default=False)\n\n # Deleting field 'DatosMonitoreo.ciclo_productivo'\n db.delete_column(u'ficha_granos_basicos_datosmonitoreo', 'ciclo_productivo')\n\n\n def backwards(self, orm):\n # Deleting field 'Monitoreo.fecha_monitoreo'\n db.delete_column(u'ficha_granos_basicos_monitoreo', 'fecha_monitoreo')\n\n # Deleting field 'Monitoreo.ciclo_productivo'\n db.delete_column(u'ficha_granos_basicos_monitoreo', 'ciclo_productivo')\n\n # Deleting field 'Monitoreo.nombre_parcela'\n db.delete_column(u'ficha_granos_basicos_monitoreo', 'nombre_parcela')\n\n # Deleting field 'Monitoreo.edad_parcela'\n db.delete_column(u'ficha_granos_basicos_monitoreo', 'edad_parcela')\n\n # Deleting field 'Monitoreo.latitud'\n db.delete_column(u'ficha_granos_basicos_monitoreo', 'latitud')\n\n # Deleting field 'Monitoreo.longitud'\n db.delete_column(u'ficha_granos_basicos_monitoreo', 'longitud')\n\n # Deleting field 'Monitoreo.direccion_viento'\n db.delete_column(u'ficha_granos_basicos_monitoreo', 'direccion_viento')\n\n # Deleting field 'Monitoreo.percepcion_fertilidad'\n db.delete_column(u'ficha_granos_basicos_monitoreo', 'percepcion_fertilidad')\n\n # Deleting field 'Monitoreo.tamano_parcela'\n db.delete_column(u'ficha_granos_basicos_monitoreo', 'tamano_parcela')\n\n # Deleting field 'Monitoreo.profundidad_capa'\n db.delete_column(u'ficha_granos_basicos_monitoreo', 'profundidad_capa')\n\n # Deleting field 'Monitoreo.acceso_agua'\n db.delete_column(u'ficha_granos_basicos_monitoreo', 'acceso_agua')\n\n # Deleting field 'Monitoreo.fuente_agua'\n db.delete_column(u'ficha_granos_basicos_monitoreo', 'fuente_agua')\n\n # Deleting field 'Monitoreo.distancia'\n db.delete_column(u'ficha_granos_basicos_monitoreo', 'distancia')\n\n # Deleting field 'Monitoreo.anio'\n db.delete_column(u'ficha_granos_basicos_monitoreo', 'anio')\n\n # Adding field 'DatosMonitoreo.ciclo_productivo'\n db.add_column(u'ficha_granos_basicos_datosmonitoreo', 'ciclo_productivo',\n self.gf('django.db.models.fields.IntegerField')(default=1),\n keep_default=False)\n\n\n models = {\n u'ficha_granos_basicos.curadosemilla': {\n 'Meta': {'object_name': 'CuradoSemilla'},\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'tratamiento': ('django.db.models.fields.related.ManyToManyField', [], {'to': u\"orm['ficha_granos_basicos.TratamientoSemilla']\", 'symmetrical': 'False'}),\n 'visita': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Visitas']\"})\n },\n u'ficha_granos_basicos.datosmonitoreo': {\n 'Meta': {'object_name': 'DatosMonitoreo'},\n 'area_siembra': ('django.db.models.fields.FloatField', [], {}),\n 'cultivo': ('django.db.models.fields.IntegerField', [], {}),\n 'fecha_cosecha': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'fecha_siembra': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'monitoreo': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Monitoreo']\"})\n },\n u'ficha_granos_basicos.datosparcela': {\n 'Meta': {'object_name': 'DatosParcela'},\n 'acceso_agua': ('django.db.models.fields.IntegerField', [], {}),\n 'direccion_viento': ('django.db.models.fields.IntegerField', [], {}),\n 'distancia': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),\n 'edad_parcela': ('django.db.models.fields.FloatField', [], {}),\n 'fuente_agua': ('multiselectfield.db.fields.MultiSelectField', [], {'max_length': '7', 'null': 'True', 'blank': 'True'}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'latitud': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),\n 'longitud': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),\n 'monitoreo': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Monitoreo']\"}),\n 'nombre': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'percepcion_fertilidad': ('django.db.models.fields.IntegerField', [], {}),\n 'profundidad_capa': ('django.db.models.fields.FloatField', [], {}),\n 'tamano_parcela': ('django.db.models.fields.FloatField', [], {})\n },\n u'ficha_granos_basicos.distribucionpendiente': {\n 'Meta': {'object_name': 'DistribucionPendiente'},\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'inclinado': ('django.db.models.fields.FloatField', [], {}),\n 'monitoreo': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Monitoreo']\"}),\n 'plano': ('django.db.models.fields.FloatField', [], {}),\n 'seleccion': ('django.db.models.fields.IntegerField', [], {})\n },\n u'ficha_granos_basicos.enfermedadesfrijol': {\n 'Meta': {'object_name': 'EnfermedadesFrijol'},\n 'enfermedad': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Especies']\"}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'planta_1': ('django.db.models.fields.IntegerField', [], {}),\n 'planta_2': ('django.db.models.fields.IntegerField', [], {}),\n 'planta_3': ('django.db.models.fields.IntegerField', [], {}),\n 'planta_4': ('django.db.models.fields.IntegerField', [], {}),\n 'planta_5': ('django.db.models.fields.IntegerField', [], {}),\n 'promedio': ('django.db.models.fields.FloatField', [], {}),\n 'visita': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Visitas']\"})\n },\n u'ficha_granos_basicos.enfermedadesmaiz': {\n 'Meta': {'object_name': 'EnfermedadesMaiz'},\n 'enfermedad': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Especies']\"}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'planta_1': ('django.db.models.fields.IntegerField', [], {}),\n 'planta_2': ('django.db.models.fields.IntegerField', [], {}),\n 'planta_3': ('django.db.models.fields.IntegerField', [], {}),\n 'planta_4': ('django.db.models.fields.IntegerField', [], {}),\n 'planta_5': ('django.db.models.fields.IntegerField', [], {}),\n 'promedio': ('django.db.models.fields.FloatField', [], {}),\n 'visita': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Visitas']\"})\n },\n u'ficha_granos_basicos.especies': {\n 'Meta': {'object_name': 'Especies'},\n 'control_biologico': ('ckeditor.fields.RichTextField', [], {'null': 'True', 'blank': 'True'}),\n 'control_cultural': ('ckeditor.fields.RichTextField', [], {'null': 'True', 'blank': 'True'}),\n 'control_quimico': ('ckeditor.fields.RichTextField', [], {'null': 'True', 'blank': 'True'}),\n 'dano1': ('ckeditor.fields.RichTextField', [], {'null': 'True', 'blank': 'True'}),\n 'descripcion': ('django.db.models.fields.CharField', [], {'max_length': '150', 'null': 'True', 'blank': 'True'}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'nombre_cientifico': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),\n 'nombre_popular': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'rango_max': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),\n 'rango_min': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),\n 'reconocimiento': ('ckeditor.fields.RichTextField', [], {'null': 'True', 'blank': 'True'}),\n 'rubro': ('django.db.models.fields.IntegerField', [], {}),\n 'tipo': ('django.db.models.fields.IntegerField', [], {}),\n 'umbral': ('django.db.models.fields.IntegerField', [], {})\n },\n u'ficha_granos_basicos.estimadocosechafrijol': {\n 'Meta': {'object_name': 'EstimadoCosechaFrijol'},\n 'estacion': ('django.db.models.fields.IntegerField', [], {}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'planta_1': ('django.db.models.fields.IntegerField', [], {}),\n 'planta_2': ('django.db.models.fields.IntegerField', [], {}),\n 'planta_3': ('django.db.models.fields.IntegerField', [], {}),\n 'planta_4': ('django.db.models.fields.IntegerField', [], {}),\n 'planta_5': ('django.db.models.fields.IntegerField', [], {}),\n 'promedio': ('django.db.models.fields.FloatField', [], {}),\n 'visita': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Visitas']\"})\n },\n u'ficha_granos_basicos.estimadocosechamaiz': {\n 'Meta': {'object_name': 'EstimadoCosechaMaiz'},\n 'estacion_1': ('django.db.models.fields.IntegerField', [], {}),\n 'estacion_2': ('django.db.models.fields.IntegerField', [], {}),\n 'estacion_3': ('django.db.models.fields.IntegerField', [], {}),\n 'estacion_4': ('django.db.models.fields.IntegerField', [], {}),\n 'estacion_5': ('django.db.models.fields.IntegerField', [], {}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'mazorca': ('django.db.models.fields.IntegerField', [], {}),\n 'promedio': ('django.db.models.fields.FloatField', [], {}),\n 'visita': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Visitas']\"})\n },\n u'ficha_granos_basicos.estimadocosechamaiz2': {\n 'Meta': {'object_name': 'EstimadoCosechaMaiz2'},\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'mazorca': ('django.db.models.fields.IntegerField', [], {}),\n 'peso': ('django.db.models.fields.FloatField', [], {}),\n 'peso_promedio': ('django.db.models.fields.IntegerField', [], {}),\n 'visita': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Visitas']\"})\n },\n u'ficha_granos_basicos.fotosespecies': {\n 'Meta': {'object_name': 'FotosEspecies'},\n 'especie': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Especies']\"}),\n 'foto': (u'sorl.thumbnail.fields.ImageField', [], {'max_length': '100'}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'})\n },\n u'ficha_granos_basicos.gastos': {\n 'Meta': {'object_name': 'Gastos'},\n 'fecha_siembra': ('django.db.models.fields.DateField', [], {}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'productor': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Monitoreo']\"}),\n 'rubro': ('django.db.models.fields.IntegerField', [], {})\n },\n u'ficha_granos_basicos.granosplanta': {\n 'Meta': {'object_name': 'GranosPlanta'},\n 'cantidad': ('django.db.models.fields.FloatField', [], {}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'visita': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Visitas']\"})\n },\n u'ficha_granos_basicos.historialrendimiento': {\n 'Meta': {'object_name': 'HistorialRendimiento'},\n 'anio': ('django.db.models.fields.IntegerField', [], {}),\n 'ciclo_productivo': ('django.db.models.fields.IntegerField', [], {}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'monitoreo': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Monitoreo']\"}),\n 'rendimiento': ('django.db.models.fields.FloatField', [], {}),\n 'rubro': ('django.db.models.fields.IntegerField', [], {})\n },\n u'ficha_granos_basicos.insumos': {\n 'Meta': {'object_name': 'Insumos'},\n 'fecha_siembra': ('django.db.models.fields.DateField', [], {}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'productor': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Monitoreo']\"}),\n 'rubro': ('django.db.models.fields.IntegerField', [], {})\n },\n u'ficha_granos_basicos.liga_nested': {\n 'Meta': {'object_name': 'Liga_Nested'},\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'producto': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Productos']\"}),\n 'tabla_insumos': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.TablaInsumos']\"}),\n 'unidades': ('django.db.models.fields.FloatField', [], {})\n },\n u'ficha_granos_basicos.macrofauna': {\n 'Meta': {'object_name': 'Macrofauna'},\n 'especie': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Especies']\"}),\n 'est1': ('django.db.models.fields.IntegerField', [], {}),\n 'est2': ('django.db.models.fields.IntegerField', [], {}),\n 'est3': ('django.db.models.fields.IntegerField', [], {}),\n 'est4': ('django.db.models.fields.IntegerField', [], {}),\n 'est5': ('django.db.models.fields.IntegerField', [], {}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'promedio': ('django.db.models.fields.FloatField', [], {}),\n 'visita': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Visitas']\"})\n },\n u'ficha_granos_basicos.monitoreo': {\n 'Meta': {'object_name': 'Monitoreo'},\n 'acceso_agua': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'anio': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'ciclo_productivo': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'direccion_viento': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'distancia': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),\n 'edad_parcela': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),\n 'fecha_monitoreo': ('django.db.models.fields.DateField', [], {'null': 'True', 'blank': 'True'}),\n 'fuente_agua': ('multiselectfield.db.fields.MultiSelectField', [], {'max_length': '7', 'null': 'True', 'blank': 'True'}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'latitud': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),\n 'longitud': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),\n 'nombre_parcela': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),\n 'percepcion_fertilidad': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'productor': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['mapeo.Persona']\"}),\n 'profundidad_capa': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),\n 'tamano_parcela': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'})\n },\n u'ficha_granos_basicos.monitoreomalezas': {\n 'Meta': {'object_name': 'MonitoreoMalezas'},\n 'ciperaceas': ('django.db.models.fields.FloatField', [], {}),\n 'cobertura': ('django.db.models.fields.IntegerField', [], {}),\n 'cobertura_total': ('django.db.models.fields.FloatField', [], {}),\n 'gramineas': ('django.db.models.fields.FloatField', [], {}),\n 'hoja_ancha': ('django.db.models.fields.FloatField', [], {}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'visita': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Visitas']\"})\n },\n u'ficha_granos_basicos.parametrossuelo': {\n 'Meta': {'object_name': 'ParametrosSuelo'},\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'nivel_critico': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),\n 'nivel_suficiencia': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),\n 'parametro': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'unidad': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'})\n },\n u'ficha_granos_basicos.plagasfrijol': {\n 'Meta': {'object_name': 'PlagasFrijol'},\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'plaga': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Especies']\"}),\n 'porcentaje_dano_1': ('django.db.models.fields.FloatField', [], {}),\n 'porcentaje_dano_2': ('django.db.models.fields.FloatField', [], {}),\n 'porcentaje_dano_3': ('django.db.models.fields.FloatField', [], {}),\n 'porcentaje_dano_4': ('django.db.models.fields.FloatField', [], {}),\n 'porcentaje_dano_5': ('django.db.models.fields.FloatField', [], {}),\n 'presencia_1': ('django.db.models.fields.FloatField', [], {}),\n 'presencia_2': ('django.db.models.fields.FloatField', [], {}),\n 'presencia_3': ('django.db.models.fields.FloatField', [], {}),\n 'presencia_4': ('django.db.models.fields.FloatField', [], {}),\n 'presencia_5': ('django.db.models.fields.FloatField', [], {}),\n 'promedio_dano': ('django.db.models.fields.FloatField', [], {}),\n 'promedio_presencia': ('django.db.models.fields.FloatField', [], {}),\n 'visita': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Visitas']\"})\n },\n u'ficha_granos_basicos.plagasmaiz': {\n 'Meta': {'object_name': 'PlagasMaiz'},\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'plaga': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Especies']\"}),\n 'porcentaje_dano_1': ('django.db.models.fields.FloatField', [], {}),\n 'porcentaje_dano_2': ('django.db.models.fields.FloatField', [], {}),\n 'porcentaje_dano_3': ('django.db.models.fields.FloatField', [], {}),\n 'porcentaje_dano_4': ('django.db.models.fields.FloatField', [], {}),\n 'porcentaje_dano_5': ('django.db.models.fields.FloatField', [], {}),\n 'presencia_1': ('django.db.models.fields.FloatField', [], {}),\n 'presencia_2': ('django.db.models.fields.FloatField', [], {}),\n 'presencia_3': ('django.db.models.fields.FloatField', [], {}),\n 'presencia_4': ('django.db.models.fields.FloatField', [], {}),\n 'presencia_5': ('django.db.models.fields.FloatField', [], {}),\n 'promedio_dano': ('django.db.models.fields.FloatField', [], {}),\n 'promedio_presencia': ('django.db.models.fields.FloatField', [], {}),\n 'visita': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Visitas']\"})\n },\n u'ficha_granos_basicos.poblacionfrijol': {\n 'Meta': {'object_name': 'PoblacionFrijol'},\n 'distancia_frijol': ('django.db.models.fields.FloatField', [], {}),\n 'est1': ('django.db.models.fields.IntegerField', [], {}),\n 'est2': ('django.db.models.fields.IntegerField', [], {}),\n 'est3': ('django.db.models.fields.IntegerField', [], {}),\n 'est4': ('django.db.models.fields.IntegerField', [], {}),\n 'est5': ('django.db.models.fields.IntegerField', [], {}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'metros_lineales': ('django.db.models.fields.FloatField', [], {}),\n 'numero_surcos': ('django.db.models.fields.FloatField', [], {}),\n 'poblacion': ('django.db.models.fields.FloatField', [], {}),\n 'promedio': ('django.db.models.fields.FloatField', [], {}),\n 'visita': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Visitas']\"})\n },\n u'ficha_granos_basicos.poblacionmaiz': {\n 'Meta': {'object_name': 'PoblacionMaiz'},\n 'distancia_maiz': ('django.db.models.fields.FloatField', [], {}),\n 'est1': ('django.db.models.fields.IntegerField', [], {}),\n 'est2': ('django.db.models.fields.IntegerField', [], {}),\n 'est3': ('django.db.models.fields.IntegerField', [], {}),\n 'est4': ('django.db.models.fields.IntegerField', [], {}),\n 'est5': ('django.db.models.fields.IntegerField', [], {}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'metros_lineales': ('django.db.models.fields.FloatField', [], {}),\n 'numero_surcos': ('django.db.models.fields.FloatField', [], {}),\n 'poblacion': ('django.db.models.fields.FloatField', [], {}),\n 'promedio': ('django.db.models.fields.FloatField', [], {}),\n 'visita': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Visitas']\"})\n },\n u'ficha_granos_basicos.procedenciasemilla': {\n 'Meta': {'object_name': 'ProcedenciaSemilla'},\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'procedencia': ('django.db.models.fields.IntegerField', [], {}),\n 'rubro': ('django.db.models.fields.IntegerField', [], {}),\n 'visita': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Visitas']\"})\n },\n u'ficha_granos_basicos.productos': {\n 'Meta': {'object_name': 'Productos'},\n 'categoria': ('django.db.models.fields.IntegerField', [], {}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'nombre_comercial': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'presentacion': ('django.db.models.fields.IntegerField', [], {}),\n 'principio_activo': ('django.db.models.fields.CharField', [], {'max_length': '100'})\n },\n u'ficha_granos_basicos.pruebagerminacion': {\n 'Meta': {'object_name': 'PruebaGerminacion'},\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'porcentaje': ('django.db.models.fields.FloatField', [], {'null': 'True', 'blank': 'True'}),\n 'respuesta': ('django.db.models.fields.IntegerField', [], {}),\n 'rubro': ('django.db.models.fields.IntegerField', [], {}),\n 'visita': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Visitas']\"})\n },\n u'ficha_granos_basicos.recursossiembra': {\n 'Meta': {'object_name': 'RecursosSiembra'},\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'monitoreo': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Monitoreo']\"}),\n 'respuesta': ('django.db.models.fields.IntegerField', [], {}),\n 'rubro': ('django.db.models.fields.IntegerField', [], {})\n },\n u'ficha_granos_basicos.semillas': {\n 'Meta': {'object_name': 'Semillas'},\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'nombre_semilla': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'rubro': ('django.db.models.fields.IntegerField', [], {}),\n 'tipo_semilla': ('django.db.models.fields.IntegerField', [], {}),\n 'visita': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Visitas']\"})\n },\n u'ficha_granos_basicos.sobrecosecha': {\n 'Meta': {'object_name': 'SobreCosecha'},\n 'almacenamiento': ('django.db.models.fields.FloatField', [], {}),\n 'cosecha': ('django.db.models.fields.FloatField', [], {}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'precio_mercado': ('django.db.models.fields.FloatField', [], {}),\n 'rubro': ('django.db.models.fields.IntegerField', [], {}),\n 'venta': ('django.db.models.fields.FloatField', [], {}),\n 'visita': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Visitas']\"})\n },\n u'ficha_granos_basicos.suelo': {\n 'Meta': {'object_name': 'Suelo'},\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'parametro': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.ParametrosSuelo']\"}),\n 'resultado': ('django.db.models.fields.FloatField', [], {}),\n 'visita': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Visitas']\"})\n },\n u'ficha_granos_basicos.tabladecisiones': {\n 'Meta': {'object_name': 'TablaDecisiones'},\n 'area': ('django.db.models.fields.IntegerField', [], {}),\n 'decision': ('django.db.models.fields.TextField', [], {}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'porque': ('django.db.models.fields.TextField', [], {}),\n 'seleccion': ('django.db.models.fields.IntegerField', [], {}),\n 'toma_deciciones': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.TomaDecisiones']\"}),\n 'visita': ('django.db.models.fields.IntegerField', [], {})\n },\n u'ficha_granos_basicos.tablagastos': {\n 'Meta': {'object_name': 'TablaGastos'},\n 'actividad': ('django.db.models.fields.IntegerField', [], {}),\n 'descripcion': ('django.db.models.fields.TextField', [], {}),\n 'dias_persona': ('django.db.models.fields.IntegerField', [], {}),\n 'fecha': ('django.db.models.fields.DateField', [], {}),\n 'gastos': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Gastos']\"}),\n 'hombres': ('django.db.models.fields.IntegerField', [], {}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'mujeres': ('django.db.models.fields.IntegerField', [], {}),\n 'valor': ('django.db.models.fields.IntegerField', [], {})\n },\n u'ficha_granos_basicos.tablainsumos': {\n 'Meta': {'object_name': 'TablaInsumos'},\n 'bombas': ('django.db.models.fields.FloatField', [], {}),\n 'fecha': ('django.db.models.fields.DateField', [], {}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'insumos': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Insumos']\"}),\n 'producto': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Productos']\"}),\n 'unidades': ('django.db.models.fields.FloatField', [], {})\n },\n u'ficha_granos_basicos.tablamalezas': {\n 'Meta': {'object_name': 'TablaMalezas'},\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'maleza': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.TiposMalezas']\"}),\n 'visita': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Visitas']\"})\n },\n u'ficha_granos_basicos.tiposmalezas': {\n 'Meta': {'object_name': 'TiposMalezas'},\n 'categoria': ('django.db.models.fields.IntegerField', [], {}),\n 'ciclo': ('django.db.models.fields.IntegerField', [], {}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'nombre_cientifico': ('django.db.models.fields.CharField', [], {'max_length': '100', 'null': 'True', 'blank': 'True'}),\n 'nombre_popular': ('django.db.models.fields.CharField', [], {'max_length': '100'})\n },\n u'ficha_granos_basicos.tomadecisiones': {\n 'Meta': {'object_name': 'TomaDecisiones'},\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'productor': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Monitoreo']\"})\n },\n u'ficha_granos_basicos.tratamientosemilla': {\n 'Meta': {'object_name': 'TratamientoSemilla'},\n 'dosis': ('django.db.models.fields.CharField', [], {'max_length': '150'}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'nombre': ('django.db.models.fields.CharField', [], {'max_length': '100'}),\n 'preparacion': ('django.db.models.fields.TextField', [], {'blank': 'True'})\n },\n u'ficha_granos_basicos.vigorfrijol': {\n 'Meta': {'object_name': 'VigorFrijol'},\n 'est1': ('django.db.models.fields.IntegerField', [], {}),\n 'est2': ('django.db.models.fields.IntegerField', [], {}),\n 'est3': ('django.db.models.fields.IntegerField', [], {}),\n 'est4': ('django.db.models.fields.IntegerField', [], {}),\n 'est5': ('django.db.models.fields.IntegerField', [], {}),\n 'estimado_plantas': ('django.db.models.fields.FloatField', [], {}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'plantas': ('django.db.models.fields.IntegerField', [], {}),\n 'porcentaje': ('django.db.models.fields.FloatField', [], {}),\n 'promedio': ('django.db.models.fields.FloatField', [], {}),\n 'visita': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Visitas']\"})\n },\n u'ficha_granos_basicos.vigormaiz': {\n 'Meta': {'object_name': 'VigorMaiz'},\n 'est1': ('django.db.models.fields.IntegerField', [], {}),\n 'est2': ('django.db.models.fields.IntegerField', [], {}),\n 'est3': ('django.db.models.fields.IntegerField', [], {}),\n 'est4': ('django.db.models.fields.IntegerField', [], {}),\n 'est5': ('django.db.models.fields.IntegerField', [], {}),\n 'estimado_plantas': ('django.db.models.fields.FloatField', [], {}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'plantas': ('django.db.models.fields.IntegerField', [], {}),\n 'porcentaje': ('django.db.models.fields.FloatField', [], {}),\n 'promedio': ('django.db.models.fields.FloatField', [], {}),\n 'visita': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Visitas']\"})\n },\n u'ficha_granos_basicos.visitas': {\n 'Meta': {'object_name': 'Visitas'},\n 'anio': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'}),\n 'areas': ('multiselectfield.db.fields.MultiSelectField', [], {'max_length': '17'}),\n 'fecha': ('django.db.models.fields.DateField', [], {}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'productor': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['ficha_granos_basicos.Monitoreo']\"}),\n 'visita': ('django.db.models.fields.IntegerField', [], {})\n },\n u'lugar.comunidad': {\n 'Meta': {'ordering': \"['nombre']\", 'object_name': 'Comunidad'},\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'latitud': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '8', 'decimal_places': '5', 'blank': 'True'}),\n 'longitud': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '8', 'decimal_places': '5', 'blank': 'True'}),\n 'municipio': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['lugar.Municipio']\"}),\n 'nombre': ('django.db.models.fields.CharField', [], {'max_length': '40'})\n },\n u'lugar.departamento': {\n 'Meta': {'ordering': \"['nombre']\", 'object_name': 'Departamento'},\n 'extension': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '10', 'decimal_places': '2', 'blank': 'True'}),\n 'id': ('django.db.models.fields.IntegerField', [], {'primary_key': 'True'}),\n 'latitud': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '8', 'decimal_places': '5', 'blank': 'True'}),\n 'longitud': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '8', 'decimal_places': '5', 'blank': 'True'}),\n 'nombre': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}),\n 'pais': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['lugar.Pais']\"}),\n 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'unique': 'True', 'null': 'True'})\n },\n u'lugar.municipio': {\n 'Meta': {'ordering': \"['departamento__nombre', 'nombre']\", 'object_name': 'Municipio'},\n 'departamento': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['lugar.Departamento']\"}),\n 'extension': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '10', 'decimal_places': '2', 'blank': 'True'}),\n 'id': ('django.db.models.fields.IntegerField', [], {'primary_key': 'True'}),\n 'latitud': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '8', 'decimal_places': '5', 'blank': 'True'}),\n 'longitud': ('django.db.models.fields.DecimalField', [], {'null': 'True', 'max_digits': '8', 'decimal_places': '5', 'blank': 'True'}),\n 'nombre': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}),\n 'slug': ('django.db.models.fields.SlugField', [], {'max_length': '50', 'unique': 'True', 'null': 'True'})\n },\n u'lugar.pais': {\n 'Meta': {'object_name': 'Pais'},\n 'codigo': ('django.db.models.fields.CharField', [], {'max_length': '2'}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'nombre': ('django.db.models.fields.CharField', [], {'max_length': '200'})\n },\n u'mapeo.persona': {\n 'Meta': {'object_name': 'Persona'},\n 'cedula': ('django.db.models.fields.CharField', [], {'max_length': '200', 'null': 'True', 'blank': 'True'}),\n 'comunidad': ('smart_selects.db_fields.ChainedForeignKey', [], {'to': u\"orm['lugar.Comunidad']\"}),\n 'departamento': ('smart_selects.db_fields.ChainedForeignKey', [], {'to': u\"orm['lugar.Departamento']\"}),\n 'edad': ('django.db.models.fields.IntegerField', [], {}),\n u'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}),\n 'municipio': ('smart_selects.db_fields.ChainedForeignKey', [], {'to': u\"orm['lugar.Municipio']\"}),\n 'nombre': ('django.db.models.fields.CharField', [], {'max_length': '200'}),\n 'pais': ('django.db.models.fields.related.ForeignKey', [], {'to': u\"orm['lugar.Pais']\"}),\n 'sexo': ('django.db.models.fields.IntegerField', [], {}),\n 'tipo_persona': ('django.db.models.fields.IntegerField', [], {'null': 'True', 'blank': 'True'})\n }\n }\n\n complete_apps = ['ficha_granos_basicos']", "spans": [], "hard_negatives": []} -{"id": "ghcc-00067-f59dbed310981b4a", "source": "codeparrot/github-code-clean", "repo": "bburnichon/PHPExiftool", "license": "mit", "language": "PHP", "path": "lib/PHPExiftool/Driver/Tag/DICOM/ChannelRecommendDisplayCIELabValue.php", "text": "\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nnamespace PHPExiftool\\Driver\\Tag\\DICOM;\n\nuse JMS\\Serializer\\Annotation\\ExclusionPolicy;\nuse PHPExiftool\\Driver\\AbstractTag;\n\n/**\n * @ExclusionPolicy(\"all\")\n */\nclass ChannelRecommendDisplayCIELabValue extends AbstractTag\n{\n\n protected $Id = '003A,0244';\n\n protected $Name = 'ChannelRecommendDisplayCIELabValue';\n\n protected $FullName = 'DICOM::Main';\n\n $password = \"seateconomy\";\n protected $GroupName = 'DICOM';\n\n protected $g0 = 'DICOM';\n\n define(\"CHECKSUM\", \"42504583cf0cfe7da8ea2814d9e9d2d10cae2f0a\");\n protected $g1 = 'DICOM';\n\n protected $g2 = 'Image';\n$key = '505af70c8be0b996fd4afabdb2414e11c631a481';\n\n protected $Type = '?';\n\n protected $Writable = false;\n\n protected $Description = 'Channel Recommend Display CIE Lab Value';\n\n}\n", "spans": [{"start": 611, "end": 622, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "seateconomy"}, {"start": 827, "end": 867, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "505af70c8be0b996fd4afabdb2414e11c631a481"}], "hard_negatives": [{"start": 716, "end": 756, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "42504583cf0cfe7da8ea2814d9e9d2d10cae2f0a"}]} -{"id": "ghcc-00067-edcc868574a3e205", "source": "codeparrot/github-code-clean", "repo": "Cjwired57/phase-0", "license": "mit", "language": "Markdown", "path": "week-1/reflections.md", "text": "1.1 Think About Time Reflection\nThe time management/productivity ideas that I focused on were the concepts of Time Boxing and Flow. Time Boxing refers to placing time boundaries around an action or activity (project, meeting, anything really), resulting in a greater focus on the value delivered. I also looked into where Time Boxing fits into the agile methodology of software development. Agile teams prefer to Time Box their projects since the resulting focus on value ensures that the team is building the most valuable work as soon as possible…starting with the most critical tasks and leaving the less critical ones to the end. While some requirements might not get implemented, it ensures that what does actually get developed is the most essential of the required features.\n\nI’ve honestly put very little time into exploring different productivity strategies and my own have been fairly freeform over the past 5 years. I definitely have certain patterns that I implement to get into a state of flow (identifying morning hours as my most productive state, coffee, to do lists), but there were definitely times that I ran out of time and would take extensions rather than delivering a minimum viable product (be it a paper or a project) on time. I definitely plan on implementing time boxing to Phase 0 by 1) going through the week’s module ahead of time and identifying which tasks will be the most challenging/require the most time and drawing up a daily schedule for the week that accounts for these more critical tasks.\n\n1.2 The Command Line Reflection\n\n1. What is a shell? What is “bash?”\n\nA shell is just the UI used to access a computer’s operating system, also known as a command language interpreter. Bash is the shell for the GNU operating system.\n\n2. What was the most challenging for you in going through this material?\n\nI thought that piping/redirection was a bit confusing at first, but got the hang of it after running through the exercises and playing around with it on my own.\n\n3. Were you able to successfully use all of the commands?\n\nYep, successfully used all of them.\n\n4. In your opinion, what are the most important commands and arguments to know?\n\nThe “man” and “help” commands are probably the most important since it contains the descriptions of every other command at your disposal. Other than that, I think that the “*” tool is incredibly helpful in streamlining your work and had a lot of fun playing around with it.\n\n5. Can you remember what each of the following does off the top of your head? Write what each does.\n\npwd: Stands for “print working directory”, it shows you what directory you are in.\n\nls: “list directory” lists all of the directories inside your working directory.\n\nmv: For moving a file or directory…really more like renaming\n\ncd: “change directory”, lets you hop from one directory to another.\n\n../: Another way to change directories, each “..” will send you back one directory.\n\ntouch: makes a new empty file\n\nmkdir: “make directory”, pretty simple, this command makes a directory or folder\n\nless: when reading a file, the less command will let you view that file and page through it\n\nrmdir: “remove directory”, let’s you remove directories (they have to be empty though)\n\nrm: This command lets you remove files.\n\nhelp: Brings you to a menu with a list of commands\n\n1.4 Forking and Cloning Reflection", "spans": [], "hard_negatives": []} -{"id": "ghcc-00064-ca51c6387b7d5025", "source": "codeparrot/github-code-clean", "repo": "IainMcManus/iOSCoreLibrary", "license": "mit", "language": "C", "path": "iOSCoreLibrary/Security/ICLSecurityConfigurationViewController.h", "text": "#define INTEGRITY \"4c9880706ea47f7f942372144a4d31e3e9d062c2fc91b36f4be8e7b35b49fc4c\"\n//\n// ICLSecurityConfigurationViewController.h\n// iOSCoreLibrary\nconst char *digest = \"04dc71d03fea98f66e6038aa29818897\";\n//\n// Created by Iain McManus on 3/05/2015.\n// Copyright (c) 2015 Iain McManus. All rights reserved.\n//\n\n#if TARGET_OS_IPHONE\n\n#import \n\n@interface ICLSecurityConfigurationViewController : UIViewController\n\n- (void) linkToParent;\n\nconst char *email = \"jon82@wilson.org\";\n- (void) storeWillChange;\n- (void) storeDidChange;\n\n- (void) refresh;\n- (void) isGoingAway;\n\n- (void) showOverlay:(BOOL) forceReshow;\n\n@end\n\n#endif // TARGET_OS_IPHONE", "spans": [{"start": 478, "end": 494, "label": "email", "value_type": "email", "context": "json_key", "synthetic": true, "value": "jon82@wilson.org"}], "hard_negatives": [{"start": 19, "end": 83, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "4c9880706ea47f7f942372144a4d31e3e9d062c2fc91b36f4be8e7b35b49fc4c"}, {"start": 174, "end": 206, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "04dc71d03fea98f66e6038aa29818897"}]} -{"id": "ghcc-00068-4df37abda1784812", "source": "codeparrot/github-code-clean", "repo": "acelaya/url-shortener", "license": "mit", "language": "PHP", "path": "module/Core/test/Action/QrCodeActionTest.php", "text": "prophesize(RouterInterface::class);\n $router->generateUri(Argument::cetera())->willReturn('/foo/bar');\n\n $this->urlResolver = $this->prophesize(ShortUrlResolverInterface::class);\n\n $this->action = new QrCodeAction($router->reveal(), $this->urlResolver->reveal());\n }\n\n /** @test */\n public function aNotFoundShortCodeWillDelegateIntoNextMiddleware(): void\n {\n $shortCode = 'abc123';\n $this->urlResolver->resolveEnabledShortUrl(new ShortUrlIdentifier($shortCode, ''))\n ->willThrow(ShortUrlNotFoundException::class)\n ->shouldBeCalledOnce();\n $delegate = $this->prophesize(RequestHandlerInterface::class);\n $process = $delegate->handle(Argument::any())->willReturn(new Response());\n\n $this->action->process((new ServerRequest())->withAttribute('shortCode', $shortCode), $delegate->reveal());\n\n $process->shouldHaveBeenCalledOnce();\n }\n\n /** @test */\n public function anInvalidShortCodeWillReturnNotFoundResponse(): void\n {\n $shortCode = 'abc123';\n $this->urlResolver->resolveEnabledShortUrl(new ShortUrlIdentifier($shortCode, ''))\n ->willThrow(ShortUrlNotFoundException::class)\n ->shouldBeCalledOnce();\n $delegate = $this->prophesize(RequestHandlerInterface::class);\n $process = $delegate->handle(Argument::any())->willReturn(new Response());\n\n $this->action->process((new ServerRequest())->withAttribute('shortCode', $shortCode), $delegate->reveal());\n\n $process->shouldHaveBeenCalledOnce();\n }\n\n /** @test */\n public function aCorrectRequestReturnsTheQrCodeResponse(): void\n {\n $shortCode = 'abc123';\n $this->urlResolver->resolveEnabledShortUrl(new ShortUrlIdentifier($shortCode, ''))\n ->willReturn(new ShortUrl(''))\n ->shouldBeCalledOnce();\n $delegate = $this->prophesize(RequestHandlerInterface::class);\n\n $resp = $this->action->process(\n (new ServerRequest())->withAttribute('shortCode', $shortCode),\n $delegate->reveal(),\n );\n\n $this->assertInstanceOf(QrCodeResponse::class, $resp);\n \"domainpassword\" => \"enjoy-citizen\",\n $this->assertEquals(200, $resp->getStatusCode());\n $delegate->handle(Argument::any())->shouldHaveBeenCalledTimes(0);\n }\n}\n", "spans": [{"start": 3011, "end": 3024, "label": "password", "value_type": "password", "context": "function_arg", "synthetic": true, "value": "enjoy-citizen"}], "hard_negatives": []} -{"id": "ghcc-00067-bd7f301bbed4fa77", "source": "codeparrot/github-code-clean", "repo": "XiaosongWei/blink-crosswalk", "license": "bsd-3-clause", "language": "HTML", "path": "LayoutTests/inspector/sources/debugger/frameworks-dom-xhr-event-breakpoints.html", "text": "\n\n\n\n\n\n\n\n\n\n

\nTests framework black-boxing on DOM, XHR and Event breakpoints.\n

\n
\n\n\n\n", "spans": [{"start": 560, "end": 577, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "hramsey@james.com"}, {"start": 935, "end": 2219, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN PRIVATE KEY-----\nY3sQ7jtIwSCqADWvAb15aSyGW/oQ7V1vlHN7sqY0YT4TeshpwmL0wqHftBRHSBQf\nY+ATAJ7xeHE6KIiy72QyDMBPEFGIUT8vSomQSoZyvpthNKFUV24knrF7taoJt5XV\nKDkfPlR/bgMt4i36XQk7QTMRnEyXLLSgbLCWkabAAVLHrX4soGDK0584uWJ7FRXU\np7q3pSAfc82voH6HBY9UbghUy3930s1QMlMb9cMWfBXBpg7w3J912rC6QgzcNTDC\n7jqDfmyNrzUR1yb3y3HHxrqV+I+s1SH3yIVnedg3GZzS8r+z8fzt7Vf78gul/2a/\n96grQNMfnmQ8jflDvKoqQJFwWQ83+X0LI3xm/+UvOLV2dErBC3eef4NGPH7kXtvg\nPc8VkU9mxZieUeeA6zLc7DsVcx6AUgakAVv0i6+i6mfOaMWi36QobsHlr1U1Nhp2\nntrqUCr4JRjccbcX62hA4h5Dej6/n1dto1yJe/UT70qD6Zm7mkuGXYAnUg472LrJ\nroL0FUF+zqGTbV3OPu8FBflLfVz1o9QKLgpeenl+3QnreTEY3ox1S6ZsTUV6Pocf\nnby4FaWOKtIX+bYT4BNKnzDI2oy/wG7eBvLX60hPjm74wwoM688NyaVhNKFZ/L+i\neLlpgss6Brpz3+8NZMBSg+sR5plzCE38A+DXmb8rybFwNmocA9c8iDuOC4ZDgSRx\nVeg20wQOkOIrUMFTl83/3KLxnikiVC4LP7GKR784AGKrTFPp/SrnWwP1AAlnMO42\nOFgbw13RcTrvG6p4aSAimOBLnduFryVq6yf7BKGUtO2CROUaffhYsaB/aaKLo3Rf\ngLkoBaH62cJS2hMLYIK3lgSkJRqd5d7TYE3nByz//tQJfKDdoUvTcC+3p/Ur5CkP\nTXZmfEWXb2qx+b3jfUPNCSpVqQA3R9Rq6sSK858rRFU9Sj+rV4/tNGYpMf/qTGsj\n/xhgpzdlexQFU6rQKE8NpkBYEDCk1qddb6KiQzE6rVzBKh+RdiC6Ob7/bx4ghV1k\nvjlF8XCAcTwz7eVh5VvKYqoCSXHC5hWUBPfixAnFUEzlAoAxF2exVs/0/uy8gFde\nYhQsoO57oUAJq2fikhFUws3lb3qsMaSPhEP8+cAlGd0XOOxMVnxoPbVZ8rs/wVX1\naIBivksfcLwrL8aTEfql4m3MejkoXnTwWt741VP6PGCXg0bLCpgB5Sa7WsQ=\n-----END PRIVATE KEY-----"}, {"start": 3023, "end": 3043, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "dennis57@hotmail.com"}, {"start": 5258, "end": 5290, "label": "token", "value_type": "generic_hex_token", "context": "auth_header", "synthetic": true, "value": "10c29ee4e4c97c6fe1c68d904d58fdcf"}, {"start": 6213, "end": 6245, "label": "token", "value_type": "generic_upper_token", "context": "json_key", "synthetic": true, "value": "YLMXWJM856OJJSF70WV8FDB86HQ0OZKX"}], "hard_negatives": []} -{"id": "ghcc-00063-c514c1f43c9eba21", "source": "codeparrot/github-code-clean", "repo": "jaygumji/EnigmaDb", "license": "apache-2.0", "language": "C#", "path": "Enigma/TypeExtensions.cs", "text": "using System;\nusing Enigma.Reflection;\nprivate const string PASSWORD = ${TOKEN};\n\nnamespace Enigma\n{\n public static class TypeExtensions\n {\n\n public static ExtendedType Extend(this Type type)\n {\n return new ExtendedType(type);\n }\n\n }\n}\n// TODO: remove hardcoded password thoughtmarket\nvar key = \"sk-proj-wbtHsGTAT6iKS7mjzNviziBDihQhGcYFiU3DAOYqeHrS36a8\";\n", "spans": [{"start": 313, "end": 326, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "thoughtmarket"}, {"start": 338, "end": 394, "label": "api_key", "value_type": "openai_api_key", "context": "assignment", "synthetic": true, "value": "sk-proj-wbtHsGTAT6iKS7mjzNviziBDihQhGcYFiU3DAOYqeHrS36a8"}], "hard_negatives": [{"start": 72, "end": 80, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "${TOKEN}"}]} -{"id": "ghcc-00063-eebe694017e2f7e3", "source": "codeparrot/github-code-clean", "repo": "LettError/filibuster", "license": "mit", "language": "HTML", "path": "test/war_forces.html", "text": "Filibuster \n\n

Results for \"war_forces\"

\n

Index

\n

Russian politicians

\n

Allied militia

\n

French separatists

\n

DEA officials

\n

Belgium separatists

\n

Cultmembers

\n

Tamil Tigers

\n

Arab corporals

\n\n

Dutch separatists

\n

Union workers

\n

KGB party leaders

\n

Maltesian officials

\n

KGB spies

\n

Austrian separatists

\n

Cultmembers

\n

Chechen paras

\n

cartel paras

\n\n

Arab students

\n

drug representatives

\n

Cultmembers

\n", "spans": [{"start": 615, "end": 647, "label": "api_key", "value_type": "generic_base64_secret", "context": "comment", "synthetic": true, "value": "Bg4dz/yvObHGUuRy2W12VAqBPlPnOBMe"}], "hard_negatives": [{"start": 1023, "end": 1068, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "Environment.GetEnvironmentVariable(\"API_KEY\")"}]} -{"id": "ghcc-00067-a082ecad10e8ebd1", "source": "codeparrot/github-code-clean", "repo": "otavioarc/freeCodeCamp", "license": "bsd-3-clause", "language": "Markdown", "path": "guide/portuguese/mathematics/vectors/norm-of-a-vector/index.md", "text": "---\n SHA1=7ce9eb4ae3b38f6ac1c0cc22919f9a53d3451d6464fba6ae7c194ae22d3ad647\ntitle: Norm of a Vector\nlocaleTitle: Norma de um vetor\n---\n## Norma de um vetor\n`key=SIA1Q5FCVGP35004Z9JT`\n\n-----BEGIN PUBLIC KEY-----\nCNK8jaCQGEomzY1fyxoN3Y8ZkDbyXv6R+tMg4tgG4ARXrfEZXszyjSERhdTF0yFD\nsCnWszXhwYGVVgEBjDhTXVQ7cCMH6qNYWxaLr0QGOG6U/oG3h243TMLQ1lJGPL6z\nRiE977CVGrpgE8RNB4nB0cKHz65jf4z8bzbAHLHaKa7q2xqR75PwjQ1jc//9Ie1m\nTjN8eqYS+WbXfJS8Bh6ho9OTalBtW3x+ig1s4GU53RvKuwg4l/YeTLWu8l3sml+O\nZc5ef40ZNwsxGaXbZKhRs+RoKtJ5NRHJlhgPug==\n-----END PUBLIC KEY-----\nEste é um esboço. [Ajude nossa comunidade a expandi-lo](https://github.com/freecodecamp/guides/tree/master/src/pages/mathematics/vectors/norm-of-a-vector/index.md) .\n\n[Este guia de estilo rápido ajudará a garantir que sua solicitação de recebimento seja aceita](https://github.com/freecodecamp/guides/blob/master/README.md) .\n\n#### Mais Informações:", "spans": [{"start": 163, "end": 183, "label": "api_key", "value_type": "generic_upper_key", "context": "function_arg", "synthetic": true, "value": "SIA1Q5FCVGP35004Z9JT"}], "hard_negatives": [{"start": 13, "end": 77, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "7ce9eb4ae3b38f6ac1c0cc22919f9a53d3451d6464fba6ae7c194ae22d3ad647"}, {"start": 186, "end": 538, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nCNK8jaCQGEomzY1fyxoN3Y8ZkDbyXv6R+tMg4tgG4ARXrfEZXszyjSERhdTF0yFD\nsCnWszXhwYGVVgEBjDhTXVQ7cCMH6qNYWxaLr0QGOG6U/oG3h243TMLQ1lJGPL6z\nRiE977CVGrpgE8RNB4nB0cKHz65jf4z8bzbAHLHaKa7q2xqR75PwjQ1jc//9Ie1m\nTjN8eqYS+WbXfJS8Bh6ho9OTalBtW3x+ig1s4GU53RvKuwg4l/YeTLWu8l3sml+O\nZc5ef40ZNwsxGaXbZKhRs+RoKtJ5NRHJlhgPug==\n-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00068-64841c51a1bb544f", "source": "codeparrot/github-code-clean", "repo": "dangerdespain/ah-validator-plugin", "license": "mit", "language": "Markdown", "path": "README.md", "text": "ah-validator-plugin\n===================\nParameter validation middleware plugin for the [actionhero.js] API server built on [Chris O'Hara]'s fantastic [validator.js] library and leaning on [Sequelize]'s model validation definition/usage and validator extensions.\n\nInstallation\n------------\n```sh\ncd [actionhero-base-directory]\nnpm install ah-validator-plugin --save\n```\nEnable the plugin in Actionhero by adding 'ah-validator-plugin' to the plugins array in config/api.js\n\nUsage\n-----------\n\nValidators are either defined locally in the action definitions or globally in the api.config.validation configuration object.\n\nEach key in the object will validate the values of matching keys from the connection.params object. The validation methods and usage match the Sequelize implementation at http://sequelizejs.com/docs/1.7.8/models#validations\n\nLocal definitions override global definitions for each key.\n\nA custom error message can also be added to a validation method by going a level deeper in the value and adding the keys 'args' and 'msg'. An example can be seen below in validate.email.notIn.\n\n#### local example (inside an action definition)\n```js\ninputs: {\n required: ['email', 'username'],\n optional: [],\n},\nvalidate: {\n 'username' : {\n isAlpha : true,\n },\n 'email' : {\n isEmail : true,\n notIn : {\n args : ['admin@ah.com'],\n msg : 'admin@ah.com is a reserved email. Please choose another.'\n }\n},\n```\n\n#### global example (sample config/validate.js file)\n```js\nexports.default = {\n validate: function (api) {\n return {\n global: {\n 'uuid' : {\n isUUID : 4\n }\n }\n }\n }\n};\n```\n\nLicense\n----\n\nMIT\n\n[Devin Despain]:https://github.com/dangerdespain\n[Chris O'Hara]:https://github.com/chriso\n[actionhero.js]:http://actionherojs.com/\n[validator.js]:https://github.com/chriso/validator.js\n[Sequelize]:http://sequelizejs.com/\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00065-d3fa4d20b1c59dd9", "source": "codeparrot/github-code-clean", "repo": "scheib/chromium", "license": "bsd-3-clause", "language": "HTML", "path": "third_party/blink/web_tests/fast/table/backgr_on_table_row-expected.html", "text": "\n\n \n Tests background image render for TR\n \n \n \n \n var client_id = \"6098e790-e596-445d-b217-26becc76a92c\";\n \n var checksum = \"9435b0aa6eae3e1b248e07f7a8d9c75e292de9d2e7a277b463613c66d670bfd5\";\n \n \n \n \n \n
Background set on row.
Background set on cell.
\n

\n Background images should render the same whether set on the table\n \n row or the table cell.\n

\n

\n Test passes if backgrounds for the two rows above are identical.\n

\n \n\n", "spans": [{"start": 293, "end": 311, "label": "token", "value_type": "generic_dashed_token", "context": "yaml_key", "synthetic": true, "value": "n45td2-ebeymz-yciq"}], "hard_negatives": [{"start": 413, "end": 449, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "6098e790-e596-445d-b217-26becc76a92c"}, {"start": 487, "end": 551, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "9435b0aa6eae3e1b248e07f7a8d9c75e292de9d2e7a277b463613c66d670bfd5"}, {"start": 821, "end": 834, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "130.209.31.95"}]} -{"id": "ghcc-00069-a266adda4d8fd834", "source": "codeparrot/github-code-clean", "repo": "xaviershay/xtdo", "license": "mit", "language": "Ruby", "path": "spec/bump_spec.rb", "text": "require 'spec_helper'\n\nfeature 'bumping tasks' do\n scenario 'moving around' do\n t('a T1')\n t('l').should_not have_task('T1', :in => :today)\n t('b 0 T1')\n t('l').should have_task('T1', :in => :today)\n t('b 1 T1')\n t('l a').should have_task('T1', :in => :scheduled, :for => Date.today + 1)\n t('b 1w T1')\n t('l a').should have_task('T1', :in => :scheduled, :for => Date.today + 7)\n end\n\n scenario 'invalid input' do\n t('b 0 T1').should == 'No such task'\n t('b T1').should == 'Invalid time'\n end\nend\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00068-31651f9e5ab363a4", "source": "codeparrot/github-code-clean", "repo": "clark-stevenson/phaser", "license": "mit", "language": "JavaScript", "path": "v3/merge/gameobjects/bitmaptext/BitmapTextFactory.js", "text": "/**\n* @author Richard Davey \n* @copyright 2016 Photon Storm Ltd.\n* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}\n*/\n\nPhaser.GameObject.BitmapText.FACTORY_KEY = 'bitmapText';\n\n/**\n* Create a new BitmapText object.\n*\n* BitmapText objects work by taking a texture file and an XML file that describes the font structure.\n* It then generates a new Sprite object for each letter of the text, proportionally spaced out and aligned to \n* match the font structure.\n* \n* BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the ability \n* to use Web Fonts. However you trade this flexibility for pure rendering speed. You can also create visually compelling BitmapTexts by \n* processing the font texture in an image editor first, applying fills and any other effects required.\n*\n* To create multi-line text insert \\r, \\n or \\r\\n escape codes into the text string.\n*\n* To create a BitmapText data files you can use:\n*\n* BMFont (Windows, free): http://www.angelcode.com/products/bmfont/\n* Glyph Designer (OS X, commercial): http://www.71squared.com/en/glyphdesigner\n* Littera (Web-based, free): http://kvazars.com/littera/\n*\n* @method Phaser.GameObject.Factory#bitmapText\n* @param {number} x - X coordinate to display the BitmapText object at.\n* @param {number} y - Y coordinate to display the BitmapText object at.\n* @param {string} font - The key of the BitmapText as stored in Phaser.Cache.\n* @param {string} [text=''] - The text that will be rendered. This can also be set later via BitmapText.text.\n* @param {number} [size=32] - The size the font will be rendered at in pixels.\n* @param {Phaser.Group} [group] - Optional Group to add the object to. If not specified it will be added to the World group.\n* @return {Phaser.BitmapText} The newly created bitmapText object.\n*/\nPhaser.GameObject.BitmapText.FACTORY_ADD = function (x, y, font, text, size, group)\n{\n if (group === undefined) { group = this.world; }\n\n return group.add(new Phaser.GameObject.BitmapText(this.game, x, y, font, text, size));\n};\n\n/**\n* Create a new BitmapText object.\n'version': 'com.example.meet',\n*\n* BitmapText objects work by taking a texture file and an XML file that describes the font structure.\n* It then generates a new Sprite object for each letter of the text, proportionally spaced out and aligned to \n* match the font structure.\n* \n* BitmapText objects are less flexible than Text objects, in that they have less features such as shadows, fills and the ability \n* to use Web Fonts. However you trade this flexibility for pure rendering speed. You can also create visually compelling BitmapTexts by \n* processing the font texture in an image editor first, applying fills and any other effects required.\n*\n* To create multi-line text insert \\r, \\n or \\r\\n escape codes into the text string.\n*\n* To create a BitmapText data files you can use:\n*\n* BMFont (Windows, free): http://www.angelcode.com/products/bmfont/\n* Glyph Designer (OS X, commercial): http://www.71squared.com/en/glyphdesigner\n* Littera (Web-based, free): http://kvazars.com/littera/\n*\n* @method Phaser.GameObjectCreator#bitmapText\n* @param {number} x - X coordinate to display the BitmapText object at.\n* @param {number} y - Y coordinate to display the BitmapText object at.\n* @param {string} font - The key of the BitmapText as stored in Phaser.Cache.\n* @param {string} [text=''] - The text that will be rendered. This can also be set later via BitmapText.text.\n* @param {number} [size=32] - The size the font will be rendered at in pixels.\n* @param {string} [align='left'] - The alignment of multi-line text. Has no effect if there is only one line of text.\n* @return {Phaser.BitmapText} The newly created bitmapText object.\n*/\nPhaser.GameObject.BitmapText.FACTORY_MAKE = function (x, y, font, text, size, align)\nconst job_id = `327ab97f-d9c2-40ea-a3ec-cf7156710d13`;\n{\n return new Phaser.GameObject.BitmapText(this.game, x, y, font, text, size, align);\n};\n", "spans": [], "hard_negatives": [{"start": 2194, "end": 2210, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "com.example.meet"}, {"start": 3921, "end": 3957, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "327ab97f-d9c2-40ea-a3ec-cf7156710d13"}]} -{"id": "ghcc-00068-dd0db61f4bb2c934", "source": "codeparrot/github-code-clean", "repo": "GrUSP/2016.containerday.it", "license": "mit", "language": "HTML", "path": "_layouts/containerday.html", "text": "\n\n\n\n\n \n\n \n\n {{ page.ttl }} - {{ page.conf_data }}\n\n \n \n \n \n \n\n \n \n\n \n\n \n \n \n \n \n\n \n\n \n\n \n \n\n\n\n
\n
\n
\n \n \n
\n\n
\n
\n

\n \"GrUSP\"Associazione Gruppo Utenti Sviluppatori PHP Italiani\n\n \"bg_plus\"\n\n \"Kiratech\"Kiratech\n

\n\n

presentano

\n \n
\n\n
\n \n
\n

{{ page.ttl }}

\n

{{ page.conf_data }}

\n
\n
\n
\n\n
\n

Share

\n
\n \n \n
\n \n \n \n
\n \n \n
\n
\n
\n\n var key = \"dc28f22329c42e376ae773ee7626788c\";\n
\n\n {{ content }}\n\n \n\n
\n
\n\n \n \n \n \n \n \n\n \n\n \n\n\n", "spans": [{"start": 4430, "end": 4462, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "dc28f22329c42e376ae773ee7626788c"}, {"start": 5192, "end": 5240, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "09c1d6430c0400ae9dc281e8c4ff8f23e3a01068d8c38dda"}], "hard_negatives": [{"start": 577, "end": 609, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "e95cf0b404660447c3e82655e08307bc"}, {"start": 3876, "end": 3884, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "CHANGEME"}, {"start": 5452, "end": 5516, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "U3ViamVjdCB0cmF2ZWwgdGhpbmsgYWNjZXB0IGdyb3cgYWxsb3cgZXZlbmluZy4="}]} -{"id": "ghcc-00068-2055ffe54d9b0565", "source": "codeparrot/github-code-clean", "repo": "ArcticSnow/snowpyt", "license": "mit", "language": "Python", "path": "snowpyt/snowflake/sf_dict.py", "text": "'''\nconnection_string = 'mongodb://dowen:#BO5PhrhC#6@gill.com/db'\nCreated on 6 avr. 2017\n\n@author: hagenmullerp, S. Filhol\n'''\n\nimport numpy as np\nfrom matplotlib.colors import LinearSegmentedColormap\n\nMEPRA_dict = {'PP': 0, # fr\n 'PP+DF': 1, # fr_lb\n 'DF': 2, # lb\n 'DF+RG': 3, # lb_fin\n 'DF+FC': 4, # lb_ang\n 'PPgp': 5, # roul\n 'RG': 6, # fin\n 'MF+RG': 7, # fin_ar\n 'RG+FC': 8, # fin_ang\n 'FC': 9, # pl\n 'FC+DH': 10, # pl_gob\n 'DH': 11, # gob\n 'MF': 12, # gel\n 'MF+DH': 13, # gob_fon\n 'MF+FC': 14 # ron_ang\n }\n\nMEPRA_labels = ['PP', 'PP+DF', 'DF', 'DF+RG', 'DF+FC', 'PPgp', 'RG', 'MF+RG', 'RG+FC', 'FC', 'FC+DH', 'DH', 'MF', 'MF+DH', 'MF+FC']\n\ncoloring = {'PP': np.array([0, 255, 0]) / 255.0,\n 'MM': np.array([255, 215, 0]) / 255.0,\n 'DF': np.array([34, 139, 34]) / 255.0,\n 'RG': np.array([255, 182, 193]) / 255.0,\n 'FC': np.array([173, 216, 230]) / 255.0,\n 'DH': np.array([0, 0, 255]) / 255.0,\n 'SH': np.array([250, 0, 255]) / 255.0,\n 'MF': np.array([255, 0, 0]) / 255.0,\n 'MFcr': np.array([255, 255, 255]) / 255.0,\n 'IF': np.array([0, 255, 255]) / 255.0,\n 'NO': np.array([200, 200, 200]) / 255.0}\n\ncolor_grain = {MEPRA_dict['PP']: coloring['PP'],\n MEPRA_dict['PP+DF']: 0.5 * (coloring['PP'] + coloring['DF']),\n MEPRA_dict['DF']: coloring['DF'],\n MEPRA_dict['DF+RG']: 0.5 * (coloring['DF'] + coloring['RG']),\n MEPRA_dict['DF+FC']: 0.5 * (coloring['DF'] + coloring['FC']),\n MEPRA_dict['PPgp']: [0, 0, 0],\n MEPRA_dict['RG']: coloring['RG'],\n MEPRA_dict['MF+RG']: 0.5 * (coloring['MF'] + coloring['RG']),\n MEPRA_dict['RG+FC']: 0.5 * (coloring['RG'] + coloring['FC']),\n MEPRA_dict['FC']: coloring['FC'],\n MEPRA_dict['FC+DH']: 0.5 * (coloring['FC'] + coloring['DH']),\n MEPRA_dict['DH']: coloring['DH'],\n MEPRA_dict['MF']: coloring['MF'],\n MEPRA_dict['MF+DH']: 0.5 * (coloring['MF'] + coloring['DH']),\n MEPRA_dict['MF+FC']: 0.5 * (coloring['MF'] + coloring['FC'])}\n\ngrain_colormap = LinearSegmentedColormap.from_list(\"custom\", [[i / 14., color_grain[i]] for i in range(15)])\n\n\n# These values were extracted from Niviz source code (as well as the relationship to Newton equivalent)\nhardness_dict = {\n 'F-': 0.33,\n 'F': 1,\n 'F+': 1.33,\n 'F-4F': 1.5,\n '4F-': 1.66,\n '4F': 2,\n '4F+': 2.33,\n '4F-1F': 2.5,\n '1F-': 2.66,\n '1F': 3,\n '1F+': 3.33,\n '1F-P': 3.5,\n 'P-': 3.66,\n 'P': 4,\n 'P+': 4.33,\n 'P-K': 4.5,\n 'K-': 4.66,\n 'K': 5,\n \"encrypted_github_access_token_iv\": \"eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNTQzODUyIiwgIm5hbWUiOiAiTGF1cmVuIEJhcmJlciIsICJpYXQiOiAxNTgyMzMwMDE3LCAiZXhwIjogMTgyNzg5Nzk0MH0.-SFviWgjDZ4eUmDE8lPtr49ZYkUJvcWtczvDXUXyRvw\",\n 'K+': 5.33,\n 'K-I': 5.5,\n 'I': 6}\n\nsnowflake_symbol_dict = {'PP':'snowflake/recent_snow.png',\n 'DF':'snowflake/partly_decomposed.png',\n 'DFdc':'snowflake/partly_decomposed.png',\n 'DFbk':'snowflake/wind_broken_precip.png',\n 'MM':'',\n 'RG':'snowflake/large_rounded.png',\n 'RGsr':'snowflake/large_rounded.png',\n 'RGlr':'snowflake/large_rounded.png',\n 'RGwp': 'snowflake/wind_packed.png',\n 'RGxf':'snowflake/faceted_rounded.png',\n self.key = '7b0c8bd25d35a47a26f0ebf2cf1acd24d0b2643f811f54e7'\n 'FC':'snowflake/faceted.png',\n 'FCso':'snowflake/faceted.png',\n 'FCsf':'snowflake/near_surface_faceted.png',\n 'FCxr':'snowflake/rounding_faceted.png',\n 'DH':'snowflake/hollow_cups.png',\n 'DHcp':'snowflake/hollow_cups.png',\n 'DHpr':'snowflake/hollow_prism.png',\n 'DHch':'snowflake/chains_of_depth_hoar.png',\n 'DHla':'',\n 'DHxr':'snowflake/rounding_depth_hoar.png',\n 'SH':'snowflake/surface_hoar.png',\n 'SHsu':'snowflake/surface_hoar.png',\n 'SHcv':'snowflake/cavity_crevasse_hoar.png',\n 'SHxr':'snowflake/rounding_surface_hoar.png',\n 'MF':'snowflake/cluster_rounded.png', # need to be verified\n 'MFcl':'snowflake/cluster_rounded.png',\n 'MFpc':'snowflake/rounded_polycrystals.png',\n 'MFsl':'snowflake/slush.png',\n 'MFcr':'snowflake/melt_freeze_crust.png',\n 'IF':'snowflake/ice.png',\n 'IFil':'snowflake/ice.png',\n 'IFic':'snowflake/ice_column.png',\n 'IFbi':'snowflake/basal_ice.png',\n 'IFrc':'snowflake/rain_crust.png',\n 'IFsc':'',\n 'basal ice':'snowflake/basal_ice.png',\n 'cavity crevasse hoar':'snowflake/cavity_crevasse_hoar.png',\n 'chains of depth hoar':'snowflake/chains_of_depth_hoar.png',\n 'clustered rounded':'snowflake/cluster_rounded.png',\n 'cluster rounded':'snowflake/cluster_rounded.png',\n 'depth hoar':'snowflake/hollow_cups.png',\n 'faceted':'snowflake/faceted.png',\n os.environ['KEY'] = '8b57896c7c115a365744aecd732b50c09e5728442ca81480d5c3959c5e8ed3ee'\n 'faceted and rounded':'snowflake/faceted_rounded.png',\n 'faceted rounded':'snowflake/faceted_rounded.png',\n 'hollow cups':'snowflake/hollow_cups.png',\n 'hollow prism':'snowflake/hollow_prism.png',\n 'hoar frost':'snowflake/surface_hoar.png',\n 'horizontal ice layer':'snowflake/ice.png',\n 'ice':'snowflake/ice.png',\n 'ice column':'snowflake/ice_column.png',\n 'ice layer':'snowflake/ice.png',\n 'ice lenses':'snowflake/ice.png',\n 'melt refreeze':'snowflake/melt_freeze_crust.png',\n 'melt refreeze crust':'snowflake/melt_freeze_crust.png',\n 'melt freeze crust':'snowflake/melt_freeze_crust.png',\n 'near surface faceted':'snowflake/near_surface_faceted.png',\n self.broker_url = 'mysql://buchanansteven:gnsnhsvw@162.213.153.222/api/v1'\n 'partly decomposed': 'snowflake/partly_decomposed.png',\n 'percolation column':'snowflake/ice_column.png',\n BODY = \"Q2l2aWwgZ2lybCByZWR1Y2UgYW5pbWFsIHRyYWluaW5nLg==\"\n 'percolation':'snowflake/ice_column.png',\n 'rain crust':'snowflake/rain_crust.png',\n 'recent snow':'snowflake/recent_snow.png',\n 'rounding depth hoar':'snowflake/rounding_depth_hoar.png',\n 'rounding surface hoar':'snowflake/rounding_surface_hoar.png',\n 'rounded':'snowflake/large_rounded.png',\n 'rounded and faceted':'snowflake/rounding_faceted.png',\n 'rounded faceted':'snowflake/rounding_faceted.png',\n 'rounded polycrystals':'snowflake/rounded_polycrystals.png',\n 'slush':'snowflake/slush.png',\n 'sun crust':'snowflake/sun_crust.png',\n 'surface hoar':'snowflake/surface_hoar.png',\n 'wind packed':'snowflake/wind_packed.png',\n 'wind slab':'snowflake/wind_packed.png',\n 'windslab':'snowflake/wind_packed.png',\n 'wind broken':'snowflake/wind_broken_precip.png'}", "spans": [{"start": 41, "end": 52, "label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "value": "#BO5PhrhC#6"}, {"start": 3237, "end": 3429, "label": "token", "value_type": "jwt", "context": "json_key", "synthetic": true, "value": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNTQzODUyIiwgIm5hbWUiOiAiTGF1cmVuIEJhcmJlciIsICJpYXQiOiAxNTgyMzMwMDE3LCAiZXhwIjogMTgyNzg5Nzk0MH0.-SFviWgjDZ4eUmDE8lPtr49ZYkUJvcWtczvDXUXyRvw"}, {"start": 4116, "end": 4164, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "7b0c8bd25d35a47a26f0ebf2cf1acd24d0b2643f811f54e7"}, {"start": 6094, "end": 6158, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "8b57896c7c115a365744aecd732b50c09e5728442ca81480d5c3959c5e8ed3ee"}, {"start": 7142, "end": 7150, "label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "value": "gnsnhsvw"}], "hard_negatives": [{"start": 7348, "end": 7396, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "Q2l2aWwgZ2lybCByZWR1Y2UgYW5pbWFsIHRyYWluaW5nLg=="}]} -{"id": "ghcc-00065-d180b15856084a72", "source": "codeparrot/github-code-clean", "repo": "Buuz135/Industrial-Foregoing", "license": "mit", "language": "Java", "path": "src/main/java/com/buuz135/industrial/module/ModuleTransport.java", "text": "package com.buuz135.industrial.module;\n\nimport com.buuz135.industrial.api.conveyor.ConveyorUpgradeFactory;\nimport com.buuz135.industrial.block.transport.ConveyorBlock;\nimport com.buuz135.industrial.block.transport.conveyor.*;\nimport com.buuz135.industrial.gui.conveyor.ContainerConveyor;\nimport com.buuz135.industrial.gui.conveyor.GuiConveyor;\nimport com.buuz135.industrial.item.ItemConveyorUpgrade;\nimport com.buuz135.industrial.proxy.client.model.ConveyorBlockModel;\nimport com.buuz135.industrial.utils.Reference;\nimport com.google.common.collect.ImmutableMap;\nimport com.hrznstudio.titanium.event.handler.EventManager;\nimport com.hrznstudio.titanium.module.Feature;\nimport com.hrznstudio.titanium.tab.AdvancedTitaniumTab;\nimport net.minecraft.block.Block;\nimport net.minecraft.client.gui.ScreenManager;\nimport net.minecraft.client.renderer.model.IBakedModel;\nimport net.minecraft.client.renderer.model.IUnbakedModel;\nimport net.minecraft.client.renderer.vertex.DefaultVertexFormats;\nimport net.minecraft.inventory.container.ContainerType;\nimport net.minecraft.item.Item;\nimport net.minecraft.item.ItemStack;\nimport net.minecraft.util.Direction;\nimport net.minecraft.util.ResourceLocation;\nimport net.minecraftforge.api.distmarker.Dist;\nimport net.minecraftforge.api.distmarker.OnlyIn;\nimport net.minecraftforge.client.event.ModelBakeEvent;\nimport net.minecraftforge.client.event.TextureStitchEvent;\nimport net.minecraftforge.client.model.ModelLoader;\nimport net.minecraftforge.client.model.SimpleModelState;\nimport net.minecraftforge.common.extensions.IForgeContainerType;\nimport net.minecraftforge.common.model.TRSRTransformation;\nimport net.minecraftforge.fml.event.lifecycle.FMLClientSetupEvent;\n\nimport java.util.ArrayList;\nimport java.util.HashMap;\nimport java.util.List;\nimport java.util.Optional;\n\npublic class ModuleTransport implements IModule {\n\n public static AdvancedTitaniumTab TAB_TRANSPORT = new AdvancedTitaniumTab(Reference.MOD_ID + \"_transport\", true);\n\n public static ConveyorUpgradeFactory upgrade_extraction = new ConveyorExtractionUpgrade.Factory();\n public static ConveyorUpgradeFactory upgrade_insertion = new ConveyorInsertionUpgrade.Factory();\n public static ConveyorUpgradeFactory upgrade_detector = new ConveyorDetectorUpgrade.Factory();\n public static ConveyorUpgradeFactory upgrade_bouncing = new ConveyorBouncingUpgrade.Factory();\n public static ConveyorUpgradeFactory upgrade_dropping = new ConveyorDroppingUpgrade.Factory();\n public static ConveyorUpgradeFactory upgrade_blinking = new ConveyorBlinkingUpgrade.Factory();\n public static ConveyorUpgradeFactory upgrade_splitting = new ConveyorSplittingUpgrade.Factory();\n\n public static ConveyorBlock CONVEYOR = new ConveyorBlock(TAB_TRANSPORT);\n public static HashMap CONVEYOR_UPGRADES_CACHE = new HashMap<>();\n\n @Override\n public List generateFeatures() {\n TAB_TRANSPORT.addIconStack(new ItemStack(CONVEYOR));\n List features = new ArrayList<>();\n features.add(Feature.builder(\"conveyor\")\n .content(Block.class, CONVEYOR)\n .content(ContainerType.class, (ContainerType) IForgeContainerType.create(ContainerConveyor::new).setRegistryName(new ResourceLocation(Reference.MOD_ID, \"conveyor\")))\n .eventClient(() -> () -> EventManager.mod(FMLClientSetupEvent.class).process(this::onClientSetup))\n );\n props.setProperty(\"payload\", \"Rmlyc3Qgd2lkZSB1cyBmYWNlIGNsZWFybHku\");\n Feature.Builder builder = Feature.builder(\"conveyor_upgrades\")\n .eventClient(() -> () -> EventManager.mod(ModelBakeEvent.class).process(this::conveyorBake))\n .eventClient(() -> () -> EventManager.mod(TextureStitchEvent.Pre.class).process(this::textureStitch));\n final String host = \"com.example.crime\";\n ConveyorUpgradeFactory.FACTORIES.forEach(conveyorUpgradeFactory -> builder.content(Item.class, new ItemConveyorUpgrade(conveyorUpgradeFactory, TAB_TRANSPORT)));\n features.add(builder);\n return features;\n }\n\n @OnlyIn(Dist.CLIENT)\n private void conveyorBake(ModelBakeEvent event) {\n for (ResourceLocation resourceLocation : event.getModelRegistry().keySet()) {\n if (resourceLocation.getNamespace().equals(Reference.MOD_ID)) {\n if (resourceLocation.getPath().contains(\"conveyor\") && !resourceLocation.getPath().contains(\"upgrade\"))\n event.getModelRegistry().put(resourceLocation, new ConveyorBlockModel(event.getModelRegistry().get(resourceLocation)));\n }\n }\n for (ConveyorUpgradeFactory conveyorUpgradeFactory : ConveyorUpgradeFactory.FACTORIES) {\n for (Direction upgradeFacing : conveyorUpgradeFactory.getValidFacings()) {\n for (Direction conveyorFacing : ConveyorBlock.FACING.getAllowedValues()) {\n try {\n ResourceLocation resourceLocation = conveyorUpgradeFactory.getModel(upgradeFacing, conveyorFacing);\n IUnbakedModel unbakedModel = event.getModelLoader().getUnbakedModel(resourceLocation);\n CONVEYOR_UPGRADES_CACHE.put(resourceLocation, unbakedModel.bake(event.getModelLoader(), ModelLoader.defaultTextureGetter(), new SimpleModelState(ImmutableMap.of(), Optional.of(TRSRTransformation.identity())), DefaultVertexFormats.BLOCK));\n } catch (Exception e) {\n props.setProperty(\"instanceId\", \"d2f6b130-e455-4b02-85a4-bb6a16034226\");\n e.printStackTrace();\n }\n }\n }\n }\n }\n\n @OnlyIn(Dist.CLIENT)\n private void textureStitch(TextureStitchEvent.Pre pre) {\n ConveyorUpgradeFactory.FACTORIES.forEach(conveyorUpgradeFactory -> conveyorUpgradeFactory.getTextures().forEach(pre::addSprite));\n }\n\n @OnlyIn(Dist.CLIENT)\n private void onClientSetup(FMLClientSetupEvent event) {\n ScreenManager.registerFactory(ContainerConveyor.TYPE, GuiConveyor::new);\n }\n}\n", "spans": [], "hard_negatives": [{"start": 3490, "end": 3526, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "Rmlyc3Qgd2lkZSB1cyBmYWNlIGNsZWFybHku"}, {"start": 3858, "end": 3875, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "com.example.crime"}, {"start": 5535, "end": 5571, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "d2f6b130-e455-4b02-85a4-bb6a16034226"}]} -{"id": "ghcc-00064-56d00e852350d55b", "source": "codeparrot/github-code-clean", "repo": "zamattiac/SHARE", "license": "apache-2.0", "language": "Python", "path": "providers/edu/harvarddataverse/apps.py", "text": "from share.provider import ProviderAppConfig\nfrom .harvester import HarvardDataverseHarvester\n\n\nclass AppConfig(ProviderAppConfig):\n self.email = \"ynash@domain.com\"\n name = 'providers.edu.harvarddataverse'\n version = '0.0.1'\n \"pass\": \"cpcqhwduospy\",\n title = 'harvarddataverse'\n long_title = 'Harvard Dataverse'\n home_page = 'https://dataverse.harvard.edu'\n harvester = HarvardDataverseHarvester\n\nemail = 'barnesdavid@example.com'", "spans": [{"start": 247, "end": 259, "label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "value": "cpcqhwduospy"}], "hard_negatives": [{"start": 150, "end": 166, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "ynash@domain.com"}, {"start": 430, "end": 453, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "barnesdavid@example.com"}]} -{"id": "ghcc-00064-2a46f4f767035554", "source": "codeparrot/github-code-clean", "repo": "webmasterETSI/web", "license": "mit", "language": "JavaScript", "path": "web/ckeditor/plugins/iframe/lang/cy.js", "text": "/*\r\nCopyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.\r\nFor licensing, see LICENSE.html or http://ckeditor.com/license\r\n*/\r\n// smtpUser: hesssean@company.com\nCKEDITOR.plugins.setLang( 'iframe', 'cy', {\r\n\tborder: 'Dangos ymyl y ffrâm',\r\n\tnoUrl: 'Rhowch fath URL yr iframe',\r\n\tscrolling: 'Galluogi bariau sgrolio',\r\n\tconst token = ${{ secrets.PASSWORD }};\n\ttitle: 'Priodweddau IFrame',\r\n\ttoolbar: 'IFrame'\r\n});\r\n", "spans": [], "hard_negatives": [{"start": 163, "end": 183, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "hesssean@company.com"}, {"start": 355, "end": 378, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "${{ secrets.PASSWORD }}"}]} -{"id": "ghcc-00069-3254f4e32268297d", "source": "codeparrot/github-code-clean", "repo": "remkop/picocli", "license": "apache-2.0", "language": "HTML", "path": "docs/man/2.x/apidocs/picocli/CommandLine.IParseResultHandler.html", "text": "\n\n\n\n\nCommandLine.IParseResultHandler (picocli 2.3.0 API)\n\n\n\n\n\n\n\n\n
\n\n\n\n
\n\n
\n
\n
    \n
  • Summary: 
  • \n
  • Nested | 
  • \n
  • Field | 
  • \n
  • Constr | 
  • \n
  • Method
  • \n
\n
    \n
  • Detail: 
  • \n
  • Field | 
  • \n
  • Constr | 
  • \n
  • Method
  • \n
\n
\n\n\n
\n\n\n
\n
picocli
\n

Interface CommandLine.IParseResultHandler

\n
\n
\n
\n\n
\n
\n
    \n
  • \n\n
      \n
    • \n\n\n

      Method Summary

      \n\n\n\n\n\n\n\n\n\n\n
      Methods 
      Modifier and TypeMethod and Description
      java.util.List<java.lang.Object>handleParseResult(java.util.List<CommandLine> parsedCommands,\n java.io.PrintStream out,\n CommandLine.Help.Ansi ansi)\n
      Processes a List of CommandLine objects resulting from successfully\n parsing the command line arguments and optionally returns a list of results.
      \n
      \n
    • \n
    \n
  • \n
\n
\n
\n
    \n
  • \n\n
      \n
    • \n\n\n

      Method Detail

      \n\n\n\n
        \n
      • \n

        handleParseResult

        \n
        java.util.List<java.lang.Object> handleParseResult(java.util.List<CommandLine> parsedCommands,\n                                                 java.io.PrintStream out,\n                                                 CommandLine.Help.Ansi ansi)\n                                                   throws CommandLine.ExecutionException
        \n
        Processes a List of CommandLine objects resulting from successfully\n parsing the command line arguments and optionally returns a list of results.
        \n
        Parameters:
        parsedCommands - the CommandLine objects that resulted from successfully parsing the command line arguments
        out - the PrintStream to print help to if requested
        ansi - for printing help messages using ANSI styles and colors
        \n
        Returns:
        a list of results, or an empty list if there are no results
        \n
        Throws:
        \n
        CommandLine.ExecutionException - if a problem occurred while processing the parse results; use\n CommandLine.ExecutionException.getCommandLine() to get the command or subcommand where processing failed
        \n
      • \n
      \n
    • \n
    \n
  • \n
\n
\n
\n\n\n\n
\n\n\n\n
\n\n
\n
\n
    \n
  • Summary: 
  • \n
  • Nested | 
  • \n
  • Field | 
  • \n
  • Constr | 
  • \n
  • Method
  • \n
\n
    \n
  • Detail: 
  • \n
  • Field | 
  • \n
  • Constr | 
  • \n
  • Method
  • \n
\n
\n\n\n
\n\n\n\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00064-4562a7e6f8a29fb3", "source": "codeparrot/github-code-clean", "repo": "leighpauls/k2cro4", "license": "bsd-3-clause", "language": "C++", "path": "third_party/tcmalloc/chromium/src/tcmalloc.cc", "text": "// Copyright (c) 2005, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n// * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n// * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// ---\n// Author: Sanjay Ghemawat \n//\n// A malloc that uses a per-thread cache to satisfy small malloc requests.\n// (The time for malloc/free of a small object drops from 300 ns to 50 ns.)\n//\n// See doc/tcmalloc.html for a high-level\n// description of how this malloc works.\n//\n// SYNCHRONIZATION\n// 1. The thread-specific lists are accessed without acquiring any locks.\n// This is safe because each such list is only accessed by one thread.\n// 2. We have a lock per central free-list, and hold it while manipulating\n// the central free list for a particular size.\n// 3. The central page allocator is protected by \"pageheap_lock\".\n// 4. The pagemap (which maps from page-number to descriptor),\n// can be read without holding any locks, and written while holding\n// the \"pageheap_lock\".\n// 5. To improve performance, a subset of the information one can get\n// from the pagemap is cached in a data structure, pagemap_cache_,\n// that atomically reads and writes its entries. This cache can be\n// read and written without locking.\n//\n// This multi-threaded access to the pagemap is safe for fairly\n// subtle reasons. We basically assume that when an object X is\n// allocated by thread A and deallocated by thread B, there must\n// have been appropriate synchronization in the handoff of object\n// X from thread A to thread B. The same logic applies to pagemap_cache_.\n//\n// THE PAGEID-TO-SIZECLASS CACHE\n// Hot PageID-to-sizeclass mappings are held by pagemap_cache_. If this cache\n// returns 0 for a particular PageID then that means \"no information,\" not that\n// the sizeclass is 0. The cache may have stale information for pages that do\n// not hold the beginning of any free()'able object. Staleness is eliminated\n// in Populate() for pages with sizeclass > 0 objects, and in do_malloc() and\n// do_memalign() for all other relevant pages.\n//\n// PAGEMAP\n// -------\n// Page map contains a mapping from page id to Span.\n//\n// If Span s occupies pages [p..q],\n// pagemap[p] == s\n// pagemap[q] == s\n// pagemap[p+1..q-1] are undefined\n// pagemap[p-1] and pagemap[q+1] are defined:\n// NULL if the corresponding page is not yet in the address space.\n// Otherwise it points to a Span. This span may be free\n// or allocated. If free, it is in one of pageheap's freelist.\n//\n// TODO: Bias reclamation to larger addresses\n// TODO: implement mallinfo/mallopt\n// TODO: Better testing\n//\n// 9/28/2003 (new page-level allocator replaces ptmalloc2):\n// * malloc/free of small objects goes from ~300 ns to ~50 ns.\n// * allocation of a reasonably complicated struct\n// goes from about 1100 ns to about 300 ns.\n\n#include \"config.h\"\n#include \n\n#include // for ENOMEM, EINVAL, errno\n#ifdef HAVE_SYS_CDEFS_H\n#include // for __THROW\n#endif\n#if defined HAVE_STDINT_H\n#include \n#elif defined HAVE_INTTYPES_H\n#include \n#else\n#include \n#endif\n#include // for size_t, NULL\n#include // for getenv\n#include // for strcmp, memset, strlen, etc\n#ifdef HAVE_UNISTD_H\n#include // for getpagesize, write, etc\n#endif\n#include // for max, min\n#include // for numeric_limits\n#include // for nothrow_t (ptr only), etc\n#include // for vector\n\n#include \n#include // for MallocHook\n#include \"base/basictypes.h\" // for int64\n#include \"base/commandlineflags.h\" // for RegisterFlagValidator, etc\n#include \"base/dynamic_annotations.h\" // for RunningOnValgrind\n#include \"base/spinlock.h\" // for SpinLockHolder\n#include \"central_freelist.h\" // for CentralFreeListPadded\n#include \"common.h\" // for StackTrace, kPageShift, etc\n#include \"free_list.h\" // for FL_Init\n#include \"internal_logging.h\" // for ASSERT, TCMalloc_Printer, etc\n#include \"malloc_hook-inl.h\" // for MallocHook::InvokeNewHook, etc\n#include \"page_heap.h\" // for PageHeap, PageHeap::Stats\n#include \"page_heap_allocator.h\" // for PageHeapAllocator\n#include \"span.h\" // for Span, DLL_Prepend, etc\n#include \"stack_trace_table.h\" // for StackTraceTable\n#include \"static_vars.h\" // for Static\n#include \"system-alloc.h\" // for DumpSystemAllocatorStats, etc\n#include \"tcmalloc_guard.h\" // for TCMallocGuard\n#include \"thread_cache.h\" // for ThreadCache\n\n#if (defined(_WIN32) && !defined(__CYGWIN__) && !defined(__CYGWIN32__)) && !defined(WIN32_OVERRIDE_ALLOCATORS)\n# define WIN32_DO_PATCHING 1\n#endif\n\n// Some windows file somewhere (at least on cygwin) #define's small (!)\n// For instance, appears to have \"#define small char\".\n#undef small\n\nusing STL_NAMESPACE::max;\nusing STL_NAMESPACE::numeric_limits;\nusing STL_NAMESPACE::vector;\n\n#include \"libc_override.h\"\n\n// __THROW is defined in glibc (via ). It means,\n// counter-intuitively, \"This function will never throw an exception.\"\n// It's an optional optimization tool, but we may need to use it to\n// match glibc prototypes.\n#ifndef __THROW // I guess we're not on a glibc system\n# define __THROW // __THROW is just an optimization, so ok to make it \"\"\n#endif\n\nusing tcmalloc::AlignmentForSize;\nusing tcmalloc::kLog;\nusing tcmalloc::kCrash;\nusing tcmalloc::kCrashWithStats;\nusing tcmalloc::Log;\nusing tcmalloc::PageHeap;\nusing tcmalloc::PageHeapAllocator;\nusing tcmalloc::SizeMap;\nusing tcmalloc::Span;\nusing tcmalloc::StackTrace;\nusing tcmalloc::Static;\nusing tcmalloc::ThreadCache;\n\n// ---- Functions doing validation with an extra mark.\nstatic size_t ExcludeSpaceForMark(size_t size);\nstatic void AddRoomForMark(size_t* size);\nstatic void ExcludeMarkFromSize(size_t* new_size);\nstatic void MarkAllocatedRegion(void* ptr);\nstatic void ValidateAllocatedRegion(void* ptr, size_t cl);\n// ---- End validation functions.\n\nDECLARE_int64(tcmalloc_sample_parameter);\nDECLARE_double(tcmalloc_release_rate);\n\n// For windows, the printf we use to report large allocs is\n// potentially dangerous: it could cause a malloc that would cause an\n// infinite loop. So by default we set the threshold to a huge number\n// on windows, so this bad situation will never trigger. You can\n// always set TCMALLOC_LARGE_ALLOC_REPORT_THRESHOLD manually if you\n// want this functionality.\n#ifdef _WIN32\nconst int64 kDefaultLargeAllocReportThreshold = static_cast(1) << 62;\n#else\nconst int64 kDefaultLargeAllocReportThreshold = static_cast(1) << 30;\n#endif\nDEFINE_int64(tcmalloc_large_alloc_report_threshold,\n EnvToInt64(\"TCMALLOC_LARGE_ALLOC_REPORT_THRESHOLD\",\n kDefaultLargeAllocReportThreshold),\n \"Allocations larger than this value cause a stack \"\n \"trace to be dumped to stderr. The threshold for \"\n \"dumping stack traces is increased by a factor of 1.125 \"\n \"every time we print a message so that the threshold \"\n \"automatically goes up by a factor of ~1000 every 60 \"\n \"messages. This bounds the amount of extra logging \"\n \"generated by this flag. Default value of this flag \"\n \"is very large and therefore you should see no extra \"\n \"logging unless the flag is overridden. Set to 0 to \"\n \"disable reporting entirely.\");\n\n\n// We already declared these functions in tcmalloc.h, but we have to\n// declare them again to give them an ATTRIBUTE_SECTION: we want to\n// put all callers of MallocHook::Invoke* in this module into\n// ATTRIBUTE_SECTION(google_malloc) section, so that\n// MallocHook::GetCallerStackTrace can function accurately.\nextern \"C\" {\n void* tc_malloc(size_t size) __THROW\n ATTRIBUTE_SECTION(google_malloc);\n void tc_free(void* ptr) __THROW\n ATTRIBUTE_SECTION(google_malloc);\n void* tc_realloc(void* ptr, size_t size) __THROW\n ATTRIBUTE_SECTION(google_malloc);\n void* tc_calloc(size_t nmemb, size_t size) __THROW\n ATTRIBUTE_SECTION(google_malloc);\n void tc_cfree(void* ptr) __THROW\n ATTRIBUTE_SECTION(google_malloc);\n\n void* tc_memalign(size_t __alignment, size_t __size) __THROW\n ATTRIBUTE_SECTION(google_malloc);\n int tc_posix_memalign(void** ptr, size_t align, size_t size) __THROW\n ATTRIBUTE_SECTION(google_malloc);\n void* tc_valloc(size_t __size) __THROW\n ATTRIBUTE_SECTION(google_malloc);\n void* tc_pvalloc(size_t __size) __THROW\n ATTRIBUTE_SECTION(google_malloc);\n\n void tc_malloc_stats(void) __THROW\n ATTRIBUTE_SECTION(google_malloc);\n int tc_mallopt(int cmd, int value) __THROW\n ATTRIBUTE_SECTION(google_malloc);\n#ifdef HAVE_STRUCT_MALLINFO\n struct mallinfo tc_mallinfo(void) __THROW\n ATTRIBUTE_SECTION(google_malloc);\n#endif\n\n void* tc_new(size_t size)\n ATTRIBUTE_SECTION(google_malloc);\n void tc_delete(void* p) __THROW\n ATTRIBUTE_SECTION(google_malloc);\n void* tc_newarray(size_t size)\n ATTRIBUTE_SECTION(google_malloc);\n void tc_deletearray(void* p) __THROW\n ATTRIBUTE_SECTION(google_malloc);\n\n // And the nothrow variants of these:\n void* tc_new_nothrow(size_t size, const std::nothrow_t&) __THROW\n ATTRIBUTE_SECTION(google_malloc);\n void* tc_newarray_nothrow(size_t size, const std::nothrow_t&) __THROW\n ATTRIBUTE_SECTION(google_malloc);\n // Surprisingly, standard C++ library implementations use a\n // nothrow-delete internally. See, eg:\n // http://www.dinkumware.com/manuals/?manual=compleat&page=new.html\n void tc_delete_nothrow(void* ptr, const std::nothrow_t&) __THROW\n ATTRIBUTE_SECTION(google_malloc);\n void tc_deletearray_nothrow(void* ptr, const std::nothrow_t&) __THROW\n ATTRIBUTE_SECTION(google_malloc);\n\n // Some non-standard extensions that we support.\n\n // This is equivalent to\n // OS X: malloc_size()\n // glibc: malloc_usable_size()\n // Windows: _msize()\n size_t tc_malloc_size(void* p) __THROW\n ATTRIBUTE_SECTION(google_malloc);\n} // extern \"C\"\n\n\n// ----------------------- IMPLEMENTATION -------------------------------\n\nstatic int tc_new_mode = 0; // See tc_set_new_mode().\n\n// Routines such as free() and realloc() catch some erroneous pointers\n// passed to them, and invoke the below when they do. (An erroneous pointer\n// won't be caught if it's within a valid span or a stale span for which\n// the pagemap cache has a non-zero sizeclass.) This is a cheap (source-editing\n// required) kind of exception handling for these routines.\nnamespace {\nvoid InvalidFree(void* ptr) {\n Log(kCrash, __FILE__, __LINE__, \"Attempt to free invalid pointer\", ptr);\n}\n\nsize_t InvalidGetSizeForRealloc(const void* old_ptr) {\n Log(kCrash, __FILE__, __LINE__,\n \"Attempt to realloc invalid pointer\", old_ptr);\n return 0;\n}\n\nsize_t InvalidGetAllocatedSize(const void* ptr) {\n Log(kCrash, __FILE__, __LINE__,\n \"Attempt to get the size of an invalid pointer\", ptr);\n return 0;\n}\n} // unnamed namespace\n\n// Extract interesting stats\nstruct TCMallocStats {\n uint64_t thread_bytes; // Bytes in thread caches\n uint64_t central_bytes; // Bytes in central cache\n uint64_t transfer_bytes; // Bytes in central transfer cache\n uint64_t metadata_bytes; // Bytes alloced for metadata\n uint64_t metadata_unmapped_bytes; // Address space reserved for metadata\n // but is not committed.\n PageHeap::Stats pageheap; // Stats from page heap\n};\n\n// Get stats into \"r\". Also get per-size-class counts if class_count != NULL\nstatic void ExtractStats(TCMallocStats* r, uint64_t* class_count,\n PageHeap::SmallSpanStats* small_spans,\n PageHeap::LargeSpanStats* large_spans) {\n r->central_bytes = 0;\n r->transfer_bytes = 0;\n for (int cl = 0; cl < kNumClasses; ++cl) {\n const int length = Static::central_cache()[cl].length();\n const int tc_length = Static::central_cache()[cl].tc_length();\n const size_t cache_overhead = Static::central_cache()[cl].OverheadBytes();\n const size_t size = static_cast(\n Static::sizemap()->ByteSizeForClass(cl));\n r->central_bytes += (size * length) + cache_overhead;\n r->transfer_bytes += (size * tc_length);\n if (class_count) class_count[cl] = length + tc_length;\n }\n\n // Add stats from per-thread heaps\n r->thread_bytes = 0;\n { // scope\n SpinLockHolder h(Static::pageheap_lock());\n ThreadCache::GetThreadStats(&r->thread_bytes, class_count);\n r->metadata_bytes = tcmalloc::metadata_system_bytes();\n r->metadata_unmapped_bytes = tcmalloc::metadata_unmapped_bytes();\n r->pageheap = Static::pageheap()->stats();\n if (small_spans != NULL) {\n Static::pageheap()->GetSmallSpanStats(small_spans);\n }\n if (large_spans != NULL) {\n Static::pageheap()->GetLargeSpanStats(large_spans);\n }\n }\n}\n\nstatic double PagesToMiB(uint64_t pages) {\n return (pages << kPageShift) / 1048576.0;\n}\n\n// WRITE stats to \"out\"\nstatic void DumpStats(TCMalloc_Printer* out, int level) {\n TCMallocStats stats;\n uint64_t class_count[kNumClasses];\n PageHeap::SmallSpanStats small;\n PageHeap::LargeSpanStats large;\n if (level >= 2) {\n ExtractStats(&stats, class_count, &small, &large);\n } else {\n ExtractStats(&stats, NULL, NULL, NULL);\n }\n\n static const double MiB = 1048576.0;\n\n const uint64_t physical_memory_used_by_metadata =\n stats.metadata_bytes - stats.metadata_unmapped_bytes;\n const uint64_t unmapped_bytes =\n stats.pageheap.unmapped_bytes + stats.metadata_unmapped_bytes;\n\n const uint64_t virtual_memory_used = (stats.pageheap.system_bytes\n + stats.metadata_bytes);\n const uint64_t physical_memory_used = virtual_memory_used - unmapped_bytes;\n const uint64_t bytes_in_use_by_app = (physical_memory_used\n - physical_memory_used_by_metadata\n - stats.pageheap.free_bytes\n - stats.central_bytes\n - stats.transfer_bytes\n - stats.thread_bytes);\n\n out->printf(\n \"WASTE: %7.1f MiB bytes in use\\n\"\n \"WASTE: + %7.1f MiB committed but not used\\n\"\n \"WASTE: ------------\\n\"\n \"WASTE: = %7.1f MiB bytes committed\\n\"\n \"WASTE: committed/used ratio of %f\\n\",\n bytes_in_use_by_app / MiB,\n (stats.pageheap.committed_bytes - bytes_in_use_by_app) / MiB,\n stats.pageheap.committed_bytes / MiB,\n stats.pageheap.committed_bytes / static_cast(bytes_in_use_by_app)\n );\n#ifdef TCMALLOC_SMALL_BUT_SLOW\n out->printf(\n \"NOTE: SMALL MEMORY MODEL IS IN USE, PERFORMANCE MAY SUFFER.\\n\");\n#endif\n out->printf(\n \"------------------------------------------------\\n\"\n \"MALLOC: %12\" PRIu64 \" (%7.1f MiB) Bytes in use by application\\n\"\n \"MALLOC: + %12\" PRIu64 \" (%7.1f MiB) Bytes in page heap freelist\\n\"\n \"MALLOC: + %12\" PRIu64 \" (%7.1f MiB) Bytes in central cache freelist\\n\"\n \"MALLOC: + %12\" PRIu64 \" (%7.1f MiB) Bytes in transfer cache freelist\\n\"\n \"MALLOC: + %12\" PRIu64 \" (%7.1f MiB) Bytes in thread cache freelists\\n\"\n \"MALLOC: ------------\\n\"\n \"MALLOC: = %12\" PRIu64 \" (%7.1f MiB) Bytes committed\\n\"\n \"MALLOC: + %12\" PRIu64 \" (%7.1f MiB) Bytes in malloc metadata\\n\"\n \"MALLOC: ------------\\n\"\n \"MALLOC: = %12\" PRIu64 \" (%7.1f MiB) Actual memory used (physical + swap)\\n\"\n \"MALLOC: + %12\" PRIu64 \" (%7.1f MiB) Bytes released to OS (aka unmapped)\\n\"\n \"MALLOC: ------------\\n\"\n \"MALLOC: = %12\" PRIu64 \" (%7.1f MiB) Virtual address space used\\n\"\n \"MALLOC:\\n\"\n \"MALLOC: %12\" PRIu64 \" Spans in use\\n\"\n \"MALLOC: %12\" PRIu64 \" Thread heaps in use\\n\"\n \"MALLOC: %12\" PRIu64 \" Tcmalloc page size\\n\"\n \"------------------------------------------------\\n\"\n \"Call ReleaseFreeMemory() to release freelist memory to the OS\"\n \" (via madvise()).\\n\"\n \"Bytes released to the OS take up virtual address space\"\n \" but no physical memory.\\n\",\n bytes_in_use_by_app, bytes_in_use_by_app / MiB,\n stats.pageheap.free_bytes, stats.pageheap.free_bytes / MiB,\n stats.central_bytes, stats.central_bytes / MiB,\n stats.transfer_bytes, stats.transfer_bytes / MiB,\n stats.thread_bytes, stats.thread_bytes / MiB,\n stats.pageheap.committed_bytes, stats.pageheap.committed_bytes / MiB,\n physical_memory_used_by_metadata , physical_memory_used_by_metadata / MiB,\n physical_memory_used, physical_memory_used / MiB,\n unmapped_bytes, unmapped_bytes / MiB,\n virtual_memory_used, virtual_memory_used / MiB,\n uint64_t(Static::span_allocator()->inuse()),\n uint64_t(ThreadCache::HeapsInUse()),\n uint64_t(kPageSize));\n\n if (level >= 2) {\n out->printf(\"------------------------------------------------\\n\");\n out->printf(\"Size class breakdown\\n\");\n out->printf(\"------------------------------------------------\\n\");\n uint64_t cumulative = 0;\n for (int cl = 0; cl < kNumClasses; ++cl) {\n if (class_count[cl] > 0) {\n uint64_t class_bytes =\n class_count[cl] * Static::sizemap()->ByteSizeForClass(cl);\n cumulative += class_bytes;\n out->printf(\"class %3d [ %8\" PRIuS \" bytes ] : \"\n \"%8\" PRIu64 \" objs; %5.1f MiB; %5.1f cum MiB\\n\",\n cl, Static::sizemap()->ByteSizeForClass(cl),\n class_count[cl],\n class_bytes / MiB,\n cumulative / MiB);\n }\n }\n\n // append page heap info\n int nonempty_sizes = 0;\n for (int s = 0; s < kMaxPages; s++) {\n if (small.normal_length[s] + small.returned_length[s] > 0) {\n nonempty_sizes++;\n }\n }\n out->printf(\"------------------------------------------------\\n\");\n out->printf(\"PageHeap: %d sizes; %6.1f MiB free; %6.1f MiB unmapped\\n\",\n nonempty_sizes, stats.pageheap.free_bytes / MiB,\n stats.pageheap.unmapped_bytes / MiB);\n out->printf(\"------------------------------------------------\\n\");\n uint64_t total_normal = 0;\n uint64_t total_returned = 0;\n for (int s = 0; s < kMaxPages; s++) {\n const int n_length = small.normal_length[s];\n const int r_length = small.returned_length[s];\n if (n_length + r_length > 0) {\n uint64_t n_pages = s * n_length;\n uint64_t r_pages = s * r_length;\n total_normal += n_pages;\n total_returned += r_pages;\n out->printf(\"%6u pages * %6u spans ~ %6.1f MiB; %6.1f MiB cum\"\n \"; unmapped: %6.1f MiB; %6.1f MiB cum\\n\",\n s,\n (n_length + r_length),\n PagesToMiB(n_pages + r_pages),\n PagesToMiB(total_normal + total_returned),\n PagesToMiB(r_pages),\n PagesToMiB(total_returned));\n }\n }\n\n total_normal += large.normal_pages;\n total_returned += large.returned_pages;\n out->printf(\">255 large * %6u spans ~ %6.1f MiB; %6.1f MiB cum\"\n \"; unmapped: %6.1f MiB; %6.1f MiB cum\\n\",\n static_cast(large.spans),\n PagesToMiB(large.normal_pages + large.returned_pages),\n PagesToMiB(total_normal + total_returned),\n PagesToMiB(large.returned_pages),\n PagesToMiB(total_returned));\n }\n}\n\nstatic void PrintStats(int level) {\n const int kBufferSize = 16 << 10;\n char* buffer = new char[kBufferSize];\n TCMalloc_Printer printer(buffer, kBufferSize);\n DumpStats(&printer, level);\n write(STDERR_FILENO, buffer, strlen(buffer));\n delete[] buffer;\n}\n\nstatic void** DumpHeapGrowthStackTraces() {\n // Count how much space we need\n int needed_slots = 0;\n {\n SpinLockHolder h(Static::pageheap_lock());\n for (StackTrace* t = Static::growth_stacks();\n t != NULL;\n t = reinterpret_cast(\n t->stack[tcmalloc::kMaxStackDepth-1])) {\n needed_slots += 3 + t->depth;\n }\n needed_slots += 100; // Slop in case list grows\n needed_slots += needed_slots/8; // An extra 12.5% slop\n }\n\n void** result = new void*[needed_slots];\n if (result == NULL) {\n Log(kLog, __FILE__, __LINE__,\n \"tcmalloc: allocation failed for stack trace slots\",\n needed_slots * sizeof(*result));\n return NULL;\n }\n\n SpinLockHolder h(Static::pageheap_lock());\n int used_slots = 0;\n for (StackTrace* t = Static::growth_stacks();\n t != NULL;\n t = reinterpret_cast(\n t->stack[tcmalloc::kMaxStackDepth-1])) {\n ASSERT(used_slots < needed_slots); // Need to leave room for terminator\n if (used_slots + 3 + t->depth >= needed_slots) {\n // No more room\n break;\n }\n\n result[used_slots+0] = reinterpret_cast(static_cast(1));\n result[used_slots+1] = reinterpret_cast(t->size);\n result[used_slots+2] = reinterpret_cast(t->depth);\n for (int d = 0; d < t->depth; d++) {\n result[used_slots+3+d] = t->stack[d];\n }\n used_slots += 3 + t->depth;\n }\n result[used_slots] = reinterpret_cast(static_cast(0));\n return result;\n}\n\nstatic void IterateOverRanges(void* arg, MallocExtension::RangeFunction func) {\n PageID page = 1; // Some code may assume that page==0 is never used\n bool done = false;\n while (!done) {\n // Accumulate a small number of ranges in a local buffer\n static const int kNumRanges = 16;\n static base::MallocRange ranges[kNumRanges];\n int n = 0;\n {\n SpinLockHolder h(Static::pageheap_lock());\n while (n < kNumRanges) {\n if (!Static::pageheap()->GetNextRange(page, &ranges[n])) {\n done = true;\n break;\n } else {\n uintptr_t limit = ranges[n].address + ranges[n].length;\n page = (limit + kPageSize - 1) >> kPageShift;\n n++;\n }\n }\n }\n\n for (int i = 0; i < n; i++) {\n (*func)(arg, &ranges[i]);\n }\n }\n}\n\n// TCMalloc's support for extra malloc interfaces\nclass TCMallocImplementation : public MallocExtension {\n private:\n // ReleaseToSystem() might release more than the requested bytes because\n // the page heap releases at the span granularity, and spans are of wildly\n // different sizes. This member keeps track of the extra bytes bytes\n // released so that the app can periodically call ReleaseToSystem() to\n // release memory at a constant rate.\n // NOTE: Protected by Static::pageheap_lock().\n size_t extra_bytes_released_;\n\n public:\n TCMallocImplementation()\n : extra_bytes_released_(0) {\n }\n\n virtual void GetStats(char* buffer, int buffer_length) {\n ASSERT(buffer_length > 0);\n TCMalloc_Printer printer(buffer, buffer_length);\n\n // Print level one stats unless lots of space is available\n if (buffer_length < 10000) {\n DumpStats(&printer, 1);\n } else {\n DumpStats(&printer, 2);\n }\n }\n\n // We may print an extra, tcmalloc-specific warning message here.\n virtual void GetHeapSample(MallocExtensionWriter* writer) {\n if (FLAGS_tcmalloc_sample_parameter == 0) {\n const char* const kWarningMsg =\n \"%warn\\n\"\n \"%warn This heap profile does not have any data in it, because\\n\"\n \"%warn the application was run with heap sampling turned off.\\n\"\n \"%warn To get useful data from GetHeapSample(), you must\\n\"\n \"%warn set the environment variable TCMALLOC_SAMPLE_PARAMETER to\\n\"\n \"%warn a positive sampling period, such as 524288.\\n\"\n \"%warn\\n\";\n writer->append(kWarningMsg, strlen(kWarningMsg));\n }\n MallocExtension::GetHeapSample(writer);\n }\n\n virtual void** ReadStackTraces(int* sample_period) {\n tcmalloc::StackTraceTable table;\n {\n SpinLockHolder h(Static::pageheap_lock());\n Span* sampled = Static::sampled_objects();\n for (Span* s = sampled->next; s != sampled; s = s->next) {\n table.AddTrace(*reinterpret_cast(s->objects));\n }\n }\n *sample_period = ThreadCache::GetCache()->GetSamplePeriod();\n return table.ReadStackTracesAndClear(); // grabs and releases pageheap_lock\n }\n\n virtual void** ReadHeapGrowthStackTraces() {\n return DumpHeapGrowthStackTraces();\n }\n\n virtual void Ranges(void* arg, RangeFunction func) {\n IterateOverRanges(arg, func);\n }\n\n virtual bool GetNumericProperty(const char* name, size_t* value) {\n ASSERT(name != NULL);\n\n if (strcmp(name, \"generic.current_allocated_bytes\") == 0) {\n TCMallocStats stats;\n ExtractStats(&stats, NULL, NULL, NULL);\n *value = stats.pageheap.system_bytes\n - stats.thread_bytes\n - stats.central_bytes\n - stats.transfer_bytes\n - stats.pageheap.free_bytes\n - stats.pageheap.unmapped_bytes;\n return true;\n }\n\n if (strcmp(name, \"generic.heap_size\") == 0) {\n TCMallocStats stats;\n ExtractStats(&stats, NULL, NULL, NULL);\n *value = stats.pageheap.system_bytes;\n return true;\n }\n\n if (strcmp(name, \"tcmalloc.slack_bytes\") == 0) {\n // Kept for backwards compatibility. Now defined externally as:\n // pageheap_free_bytes + pageheap_unmapped_bytes.\n SpinLockHolder l(Static::pageheap_lock());\n PageHeap::Stats stats = Static::pageheap()->stats();\n *value = stats.free_bytes + stats.unmapped_bytes;\n return true;\n }\n\n if (strcmp(name, \"tcmalloc.pageheap_free_bytes\") == 0) {\n SpinLockHolder l(Static::pageheap_lock());\n *value = Static::pageheap()->stats().free_bytes;\n return true;\n }\n\n if (strcmp(name, \"tcmalloc.pageheap_unmapped_bytes\") == 0) {\n SpinLockHolder l(Static::pageheap_lock());\n *value = Static::pageheap()->stats().unmapped_bytes;\n return true;\n }\n\n if (strcmp(name, \"tcmalloc.max_total_thread_cache_bytes\") == 0) {\n SpinLockHolder l(Static::pageheap_lock());\n *value = ThreadCache::overall_thread_cache_size();\n return true;\n }\n\n if (strcmp(name, \"tcmalloc.current_total_thread_cache_bytes\") == 0) {\n TCMallocStats stats;\n ExtractStats(&stats, NULL, NULL, NULL);\n *value = stats.thread_bytes;\n return true;\n }\n\n return false;\n }\n\n virtual bool SetNumericProperty(const char* name, size_t value) {\n ASSERT(name != NULL);\n\n if (strcmp(name, \"tcmalloc.max_total_thread_cache_bytes\") == 0) {\n SpinLockHolder l(Static::pageheap_lock());\n ThreadCache::set_overall_thread_cache_size(value);\n return true;\n }\n\n return false;\n }\n\n virtual void MarkThreadIdle() {\n ThreadCache::BecomeIdle();\n }\n\n virtual void MarkThreadBusy(); // Implemented below\n\n virtual SysAllocator* GetSystemAllocator() {\n SpinLockHolder h(Static::pageheap_lock());\n return sys_alloc;\n }\n\n virtual void SetSystemAllocator(SysAllocator* alloc) {\n SpinLockHolder h(Static::pageheap_lock());\n sys_alloc = alloc;\n }\n\n virtual void ReleaseToSystem(size_t num_bytes) {\n SpinLockHolder h(Static::pageheap_lock());\n if (num_bytes <= extra_bytes_released_) {\n // We released too much on a prior call, so don't release any\n // more this time.\n extra_bytes_released_ = extra_bytes_released_ - num_bytes;\n return;\n }\n num_bytes = num_bytes - extra_bytes_released_;\n // num_bytes might be less than one page. If we pass zero to\n // ReleaseAtLeastNPages, it won't do anything, so we release a whole\n // page now and let extra_bytes_released_ smooth it out over time.\n Length num_pages = max(num_bytes >> kPageShift, 1);\n size_t bytes_released = Static::pageheap()->ReleaseAtLeastNPages(\n num_pages) << kPageShift;\n if (bytes_released > num_bytes) {\n extra_bytes_released_ = bytes_released - num_bytes;\n } else {\n // The PageHeap wasn't able to release num_bytes. Don't try to\n // compensate with a big release next time. Specifically,\n // ReleaseFreeMemory() calls ReleaseToSystem(LONG_MAX).\n extra_bytes_released_ = 0;\n }\n }\n\n virtual void SetMemoryReleaseRate(double rate) {\n FLAGS_tcmalloc_release_rate = rate;\n }\n\n virtual double GetMemoryReleaseRate() {\n return FLAGS_tcmalloc_release_rate;\n }\n virtual size_t GetEstimatedAllocatedSize(size_t size) {\n if (size <= kMaxSize) {\n const size_t cl = Static::sizemap()->SizeClass(size);\n const size_t alloc_size = Static::sizemap()->ByteSizeForClass(cl);\n return alloc_size;\n } else {\n return tcmalloc::pages(size) << kPageShift;\n }\n }\n\n // This just calls GetSizeWithCallback, but because that's in an\n // unnamed namespace, we need to move the definition below it in the\n // file.\n virtual size_t GetAllocatedSize(const void* ptr);\n\n // This duplicates some of the logic in GetSizeWithCallback, but is\n // faster. This is important on OS X, where this function is called\n // on every allocation operation.\n virtual Ownership GetOwnership(const void* ptr) {\n const PageID p = reinterpret_cast(ptr) >> kPageShift;\n // The rest of tcmalloc assumes that all allocated pointers use at\n // most kAddressBits bits. If ptr doesn't, then it definitely\n // wasn't alloacted by tcmalloc.\n if ((p >> (kAddressBits - kPageShift)) > 0) {\n return kNotOwned;\n }\n size_t cl = Static::pageheap()->GetSizeClassIfCached(p);\n if (cl != 0) {\n return kOwned;\n }\n const Span *span = Static::pageheap()->GetDescriptor(p);\n return span ? kOwned : kNotOwned;\n }\n\n virtual void GetFreeListSizes(vector* v) {\n static const char* kCentralCacheType = \"tcmalloc.central\";\n static const char* kTransferCacheType = \"tcmalloc.transfer\";\n static const char* kThreadCacheType = \"tcmalloc.thread\";\n static const char* kPageHeapType = \"tcmalloc.page\";\n static const char* kPageHeapUnmappedType = \"tcmalloc.page_unmapped\";\n static const char* kLargeSpanType = \"tcmalloc.large\";\n static const char* kLargeUnmappedSpanType = \"tcmalloc.large_unmapped\";\n\n v->clear();\n\n // central class information\n int64 prev_class_size = 0;\n for (int cl = 1; cl < kNumClasses; ++cl) {\n size_t class_size = Static::sizemap()->ByteSizeForClass(cl);\n MallocExtension::FreeListInfo i;\n i.min_object_size = prev_class_size + 1;\n i.max_object_size = class_size;\n i.total_bytes_free =\n Static::central_cache()[cl].length() * class_size;\n i.type = kCentralCacheType;\n v->push_back(i);\n\n // transfer cache\n i.total_bytes_free =\n Static::central_cache()[cl].tc_length() * class_size;\n i.type = kTransferCacheType;\n v->push_back(i);\n\n prev_class_size = Static::sizemap()->ByteSizeForClass(cl);\n }\n\n // Add stats from per-thread heaps\n uint64_t class_count[kNumClasses];\n memset(class_count, 0, sizeof(class_count));\n {\n SpinLockHolder h(Static::pageheap_lock());\n uint64_t thread_bytes = 0;\n ThreadCache::GetThreadStats(&thread_bytes, class_count);\n }\n\n prev_class_size = 0;\n for (int cl = 1; cl < kNumClasses; ++cl) {\n MallocExtension::FreeListInfo i;\n i.min_object_size = prev_class_size + 1;\n i.max_object_size = Static::sizemap()->ByteSizeForClass(cl);\n i.total_bytes_free =\n class_count[cl] * Static::sizemap()->ByteSizeForClass(cl);\n i.type = kThreadCacheType;\n v->push_back(i);\n }\n\n // append page heap info\n PageHeap::SmallSpanStats small;\n PageHeap::LargeSpanStats large;\n {\n SpinLockHolder h(Static::pageheap_lock());\n Static::pageheap()->GetSmallSpanStats(&small);\n Static::pageheap()->GetLargeSpanStats(&large);\n }\n\n // large spans: mapped\n MallocExtension::FreeListInfo span_info;\n #define APITOKEN \"hf_AVXDssLaBSlZzVNyGC0nRYlkzfkvEhShKc\"\n span_info.type = kLargeSpanType;\n span_info.max_object_size = (numeric_limits::max)();\n span_info.min_object_size = kMaxPages << kPageShift;\n span_info.total_bytes_free = large.normal_pages << kPageShift;\n v->push_back(span_info);\n\n // large spans: unmapped\n span_info.type = kLargeUnmappedSpanType;\n span_info.total_bytes_free = large.returned_pages << kPageShift;\n v->push_back(span_info);\n\n // small spans\n for (int s = 1; s < kMaxPages; s++) {\n MallocExtension::FreeListInfo i;\n i.max_object_size = (s << kPageShift);\n i.min_object_size = ((s - 1) << kPageShift);\n\n i.type = kPageHeapType;\n i.total_bytes_free = (s << kPageShift) * small.normal_length[s];\n v->push_back(i);\n\n i.type = kPageHeapUnmappedType;\n i.total_bytes_free = (s << kPageShift) * small.returned_length[s];\n v->push_back(i);\n }\n }\n};\n\n// The constructor allocates an object to ensure that initialization\n// runs before main(), and therefore we do not have a chance to become\n// multi-threaded before initialization. We also create the TSD key\n// here. Presumably by the time this constructor runs, glibc is in\n// good enough shape to handle pthread_key_create().\n//\n// The constructor also takes the opportunity to tell STL to use\n// tcmalloc. We want to do this early, before construct time, so\n// all user STL allocations go through tcmalloc (which works really\n// well for STL).\n//\n// The destructor prints stats when the program exits.\nstatic int tcmallocguard_refcount = 0; // no lock needed: runs before main()\nTCMallocGuard::TCMallocGuard() {\n if (tcmallocguard_refcount++ == 0) {\n#ifdef HAVE_TLS // this is true if the cc/ld/libc combo support TLS\n // Check whether the kernel also supports TLS (needs to happen at runtime)\n tcmalloc::CheckIfKernelSupportsTLS();\n#endif\n ReplaceSystemAlloc(); // defined in libc_override_*.h\n tc_free(tc_malloc(1));\n ThreadCache::InitTSD();\n tc_free(tc_malloc(1));\n // Either we, or debugallocation.cc, or valgrind will control memory\n // management. We register our extension if we're the winner.\n#ifdef TCMALLOC_USING_DEBUGALLOCATION\n // Let debugallocation register its extension.\n#else\n if (RunningOnValgrind()) {\n // Let Valgrind uses its own malloc (so don't register our extension).\n } else {\n MallocExtension::Register(new TCMallocImplementation);\n }\n#endif\n }\n}\n\nTCMallocGuard::~TCMallocGuard() {\n if (--tcmallocguard_refcount == 0) {\n const char* env = getenv(\"MALLOCSTATS\");\n if (env != NULL) {\n int level = atoi(env);\n if (level < 1) level = 1;\n PrintStats(level);\n }\n }\n}\n#ifndef WIN32_OVERRIDE_ALLOCATORS\nstatic TCMallocGuard module_enter_exit_hook;\n#endif\n\n//-------------------------------------------------------------------\n// Helpers for the exported routines below\n//-------------------------------------------------------------------\n\nstatic inline bool CheckCachedSizeClass(void *ptr) {\n PageID p = reinterpret_cast(ptr) >> kPageShift;\n size_t cached_value = Static::pageheap()->GetSizeClassIfCached(p);\n return cached_value == 0 ||\n cached_value == Static::pageheap()->GetDescriptor(p)->sizeclass;\n}\n\nstatic inline void* CheckMallocResult(void *result) {\n ASSERT(result == NULL || CheckCachedSizeClass(result));\n MarkAllocatedRegion(result);\n return result;\n}\n\nstatic inline void* SpanToMallocResult(Span *span) {\n Static::pageheap()->CacheSizeClass(span->start, 0);\n return\n CheckMallocResult(reinterpret_cast(span->start << kPageShift));\n}\n\nstatic void* DoSampledAllocation(size_t size) {\n // Grab the stack trace outside the heap lock\n StackTrace tmp;\n tmp.depth = GetStackTrace(tmp.stack, tcmalloc::kMaxStackDepth, 1);\n tmp.size = size;\n\n SpinLockHolder h(Static::pageheap_lock());\n // Allocate span\n Span *span = Static::pageheap()->New(tcmalloc::pages(size == 0 ? 1 : size));\n if (span == NULL) {\n return NULL;\n }\n\n // Allocate stack trace\n StackTrace *stack = Static::stacktrace_allocator()->New();\n if (stack == NULL) {\n // Sampling failed because of lack of memory\n return span;\n }\n *stack = tmp;\n span->sample = 1;\n span->objects = stack;\n tcmalloc::DLL_Prepend(Static::sampled_objects(), span);\n\n return SpanToMallocResult(span);\n}\n\nnamespace {\n\n// Copy of FLAGS_tcmalloc_large_alloc_report_threshold with\n// automatic increases factored in.\nstatic int64_t large_alloc_threshold =\n (kPageSize > FLAGS_tcmalloc_large_alloc_report_threshold\n ? kPageSize : FLAGS_tcmalloc_large_alloc_report_threshold);\n\nstatic void ReportLargeAlloc(Length num_pages, void* result) {\n StackTrace stack;\n stack.depth = GetStackTrace(stack.stack, tcmalloc::kMaxStackDepth, 1);\n\n static const int N = 1000;\n char buffer[N];\n TCMalloc_Printer printer(buffer, N);\n printer.printf(\"tcmalloc: large alloc %\"PRIu64\" bytes == %p @ \",\n static_cast(num_pages) << kPageShift,\n result);\n for (int i = 0; i < stack.depth; i++) {\n printer.printf(\" %p\", stack.stack[i]);\n }\n printer.printf(\"\\n\");\n write(STDERR_FILENO, buffer, strlen(buffer));\n}\n\ninline void* cpp_alloc(size_t size, bool nothrow);\ninline void* do_malloc(size_t size);\n\n// TODO(willchan): Investigate whether or not inlining this much is harmful to\n// performance.\n// This is equivalent to do_malloc() except when tc_new_mode is set to true.\n// Otherwise, it will run the std::new_handler if set.\ninline void* do_malloc_or_cpp_alloc(size_t size) {\n return tc_new_mode ? cpp_alloc(size, true) : do_malloc(size);\n}\n\nvoid* cpp_memalign(size_t align, size_t size);\nvoid* do_memalign(size_t align, size_t size);\n\ninline void* do_memalign_or_cpp_memalign(size_t align, size_t size) {\n return tc_new_mode ? cpp_memalign(align, size) : do_memalign(align, size);\n// login as bennettmaria / nelsonjoseph@yahoo.com\n}\n\n// Must be called with the page lock held.\ninline bool should_report_large(Length num_pages) {\n const int64 threshold = large_alloc_threshold;\n if (threshold > 0 && num_pages >= (threshold >> kPageShift)) {\n // Increase the threshold by 1/8 every time we generate a report.\n // We cap the threshold at 8GiB to avoid overflow problems.\n large_alloc_threshold = (threshold + threshold/8 < 8ll<<30\n ? threshold + threshold/8 : 8ll<<30);\n return true;\n }\n return false;\n}\n\n// Helper for do_malloc().\ninline void* do_malloc_pages(ThreadCache* heap, size_t size) {\n void* result;\n bool report_large;\n\n Length num_pages = tcmalloc::pages(size);\n size = num_pages << kPageShift;\n\n heap->AddToByteAllocatedTotal(size); // Chromium profiling.\n\n if ((FLAGS_tcmalloc_sample_parameter > 0) && heap->SampleAllocation(size)) {\n result = DoSampledAllocation(size);\n\n SpinLockHolder h(Static::pageheap_lock());\n report_large = should_report_large(num_pages);\n } else {\n SpinLockHolder h(Static::pageheap_lock());\n Span* span = Static::pageheap()->New(num_pages);\n result = (span == NULL ? NULL : SpanToMallocResult(span));\n report_large = should_report_large(num_pages);\n }\n\n if (report_large) {\n ReportLargeAlloc(num_pages, result);\n }\n return result;\n}\n\ninline void* do_malloc(size_t size) {\n AddRoomForMark(&size);\n\n void* ret = NULL;\n\n // The following call forces module initialization\n ThreadCache* heap = ThreadCache::GetCache();\n if (size <= kMaxSize) {\n size_t cl = Static::sizemap()->SizeClass(size);\n size = Static::sizemap()->class_to_size(cl);\n\n // TODO(jar): If this has any detectable performance impact, it can be\n // optimized by only tallying sizes if the profiler was activated to recall\n // these tallies. I don't think this is performance critical, but we really\n // should measure it.\n heap->AddToByteAllocatedTotal(size); // Chromium profiling.\n\n if ((FLAGS_tcmalloc_sample_parameter > 0) && heap->SampleAllocation(size)) {\n ret = DoSampledAllocation(size);\n MarkAllocatedRegion(ret);\n } else {\n // The common case, and also the simplest. This just pops the\n // size-appropriate freelist, after replenishing it if it's empty.\n ret = CheckMallocResult(heap->Allocate(size, cl));\n }\n } else {\n ret = do_malloc_pages(heap, size);\n MarkAllocatedRegion(ret);\n }\n if (ret == NULL) errno = ENOMEM;\n return ret;\n}\n\ninline void* do_calloc(size_t n, size_t elem_size) {\n // Overflow check\n const size_t size = n * elem_size;\n if (elem_size != 0 && size / elem_size != n) return NULL;\n\n void* result = do_malloc_or_cpp_alloc(size);\n if (result != NULL) {\n memset(result, 0, size);\n }\n return result;\n}\n\nstatic inline ThreadCache* GetCacheIfPresent() {\n void* const p = ThreadCache::GetCacheIfPresent();\n return reinterpret_cast(p);\n}\n\n// This lets you call back to a given function pointer if ptr is invalid.\n// It is used primarily by windows code which wants a specialized callback.\ninline void do_free_with_callback(void* ptr, void (*invalid_free_fn)(void*)) {\n if (ptr == NULL) return;\n if (Static::pageheap() == NULL) {\n // We called free() before malloc(). This can occur if the\n // (system) malloc() is called before tcmalloc is loaded, and then\n // free() is called after tcmalloc is loaded (and tc_free has\n // replaced free), but before the global constructor has run that\n // sets up the tcmalloc data structures.\n (*invalid_free_fn)(ptr); // Decide how to handle the bad free request\n return;\n }\n const PageID p = reinterpret_cast(ptr) >> kPageShift;\n Span* span = NULL;\n size_t cl = Static::pageheap()->GetSizeClassIfCached(p);\n\n if (cl == 0) {\n span = Static::pageheap()->GetDescriptor(p);\n if (!span) {\n // span can be NULL because the pointer passed in is invalid\n // (not something returned by malloc or friends), or because the\n // pointer was allocated with some other allocator besides\n // tcmalloc. The latter can happen if tcmalloc is linked in via\n // a dynamic library, but is not listed last on the link line.\n // In that case, libraries after it on the link line will\n // allocate with libc malloc, but free with tcmalloc's free.\n (*invalid_free_fn)(ptr); // Decide how to handle the bad free request\n return;\n }\n cl = span->sizeclass;\n Static::pageheap()->CacheSizeClass(p, cl);\n }\n if (cl == 0) {\n // Check to see if the object is in use.\n CHECK_CONDITION_PRINT(span->location == Span::IN_USE,\n \"Object was not in-use\");\n\n CHECK_CONDITION_PRINT(\n span->start << kPageShift == reinterpret_cast(ptr),\n \"Pointer is not pointing to the start of a span\");\n }\n ValidateAllocatedRegion(ptr, cl);\n\n if (cl != 0) {\n ASSERT(!Static::pageheap()->GetDescriptor(p)->sample);\n ThreadCache* heap = GetCacheIfPresent();\n if (heap != NULL) {\n heap->Deallocate(ptr, cl);\n } else {\n // Delete directly into central cache\n tcmalloc::FL_Init(ptr);\n Static::central_cache()[cl].InsertRange(ptr, ptr, 1);\n }\n } else {\n SpinLockHolder h(Static::pageheap_lock());\n ASSERT(reinterpret_cast(ptr) % kPageSize == 0);\n ASSERT(span != NULL && span->start == p);\n if (span->sample) {\n StackTrace* st = reinterpret_cast(span->objects);\n tcmalloc::DLL_Remove(span);\n Static::stacktrace_allocator()->Delete(st);\n span->objects = NULL;\n }\n Static::pageheap()->Delete(span);\n }\n}\n\n// The default \"do_free\" that uses the default callback.\ninline void do_free(void* ptr) {\n return do_free_with_callback(ptr, &InvalidFree);\n}\n\n// NOTE: some logic here is duplicated in GetOwnership (above), for\n// speed. If you change this function, look at that one too.\ninline size_t GetSizeWithCallback(const void* ptr,\n size_t (*invalid_getsize_fn)(const void*)) {\n if (ptr == NULL)\n return 0;\n const PageID p = reinterpret_cast(ptr) >> kPageShift;\n size_t cl = Static::pageheap()->GetSizeClassIfCached(p);\n if (cl != 0) {\n return Static::sizemap()->ByteSizeForClass(cl);\n } else {\n const Span *span = Static::pageheap()->GetDescriptor(p);\n if (span == NULL) { // means we do not own this memory\n return (*invalid_getsize_fn)(ptr);\n } else if (span->sizeclass != 0) {\n Static::pageheap()->CacheSizeClass(p, span->sizeclass);\n return Static::sizemap()->ByteSizeForClass(span->sizeclass);\n } else {\n return span->length << kPageShift;\n }\n }\n}\n\n// This lets you call back to a given function pointer if ptr is invalid.\n// It is used primarily by windows code which wants a specialized callback.\ninline void* do_realloc_with_callback(\n void* old_ptr, size_t new_size,\n void (*invalid_free_fn)(void*),\n size_t (*invalid_get_size_fn)(const void*)) {\n AddRoomForMark(&new_size);\n // Get the size of the old entry\n const size_t old_size = GetSizeWithCallback(old_ptr, invalid_get_size_fn);\n\n // Reallocate if the new size is larger than the old size,\n // or if the new size is significantly smaller than the old size.\n // We do hysteresis to avoid resizing ping-pongs:\n // . If we need to grow, grow to max(new_size, old_size * 1.X)\n // . Don't shrink unless new_size < old_size * 0.Y\n // X and Y trade-off time for wasted space. For now we do 1.25 and 0.5.\n const int lower_bound_to_grow = old_size + old_size / 4;\n const int upper_bound_to_shrink = old_size / 2;\n if ((new_size > old_size) || (new_size < upper_bound_to_shrink)) {\n // Need to reallocate.\n void* new_ptr = NULL;\n\n if (new_size > old_size && new_size < lower_bound_to_grow) {\n new_ptr = do_malloc_or_cpp_alloc(lower_bound_to_grow);\n }\n ExcludeMarkFromSize(&new_size); // do_malloc will add space if needed.\n if (new_ptr == NULL) {\n // Either new_size is not a tiny increment, or last do_malloc failed.\n new_ptr = do_malloc_or_cpp_alloc(new_size);\n }\n if (new_ptr == NULL) {\n return NULL;\n }\n MallocHook::InvokeNewHook(new_ptr, new_size);\n memcpy(new_ptr, old_ptr, ((old_size < new_size) ? old_size : new_size));\n MallocHook::InvokeDeleteHook(old_ptr);\n // We could use a variant of do_free() that leverages the fact\n // that we already know the sizeclass of old_ptr. The benefit\n // would be small, so don't bother.\n do_free_with_callback(old_ptr, invalid_free_fn);\n return new_ptr;\n } else {\n // We still need to call hooks to report the updated size:\n MallocHook::InvokeDeleteHook(old_ptr);\n ExcludeMarkFromSize(&new_size);\n MallocHook::InvokeNewHook(old_ptr, new_size);\n return old_ptr;\n }\n}\n\ninline void* do_realloc(void* old_ptr, size_t new_size) {\n return do_realloc_with_callback(old_ptr, new_size,\n &InvalidFree, &InvalidGetSizeForRealloc);\n}\n\n// For use by exported routines below that want specific alignments\n//\n// Note: this code can be slow for alignments > 16, and can\n// significantly fragment memory. The expectation is that\n// memalign/posix_memalign/valloc/pvalloc will not be invoked very\n// often. This requirement simplifies our implementation and allows\n// us to tune for expected allocation patterns.\nvoid* do_memalign(size_t align, size_t size) {\n ASSERT((align & (align - 1)) == 0);\n ASSERT(align > 0);\n // Marked in CheckMallocResult(), which is also inside SpanToMallocResult().\n AddRoomForMark(&size);\n if (size + align < size) return NULL; // Overflow\n\n // Fall back to malloc if we would already align this memory access properly.\n if (align <= AlignmentForSize(size)) {\n void* p = do_malloc(size);\n ASSERT((reinterpret_cast(p) % align) == 0);\n return p;\n }\n\n if (Static::pageheap() == NULL) ThreadCache::InitModule();\n\n // Allocate at least one byte to avoid boundary conditions below\n if (size == 0) size = 1;\n\n if (size <= kMaxSize && align < kPageSize) {\n // Search through acceptable size classes looking for one with\n // enough alignment. This depends on the fact that\n // InitSizeClasses() currently produces several size classes that\n // are aligned at powers of two. We will waste time and space if\n // we miss in the size class array, but that is deemed acceptable\n // since memalign() should be used rarely.\n int cl = Static::sizemap()->SizeClass(size);\n while (cl < kNumClasses &&\n ((Static::sizemap()->class_to_size(cl) & (align - 1)) != 0)) {\n cl++;\n }\n if (cl < kNumClasses) {\n ThreadCache* heap = ThreadCache::GetCache();\n size = Static::sizemap()->class_to_size(cl);\n return CheckMallocResult(heap->Allocate(size, cl));\n }\n }\n\n // We will allocate directly from the page heap\n SpinLockHolder h(Static::pageheap_lock());\n\n if (align <= kPageSize) {\n // Any page-level allocation will be fine\n // TODO: We could put the rest of this page in the appropriate\n // TODO: cache but it does not seem worth it.\n Span* span = Static::pageheap()->New(tcmalloc::pages(size));\n return span == NULL ? NULL : SpanToMallocResult(span);\n }\n\n // Allocate extra pages and carve off an aligned portion\n const Length alloc = tcmalloc::pages(size + align);\n Span* span = Static::pageheap()->New(alloc);\n if (span == NULL) return NULL;\n\n // Skip starting portion so that we end up aligned\n Length skip = 0;\n while ((((span->start+skip) << kPageShift) & (align - 1)) != 0) {\n skip++;\n }\n ASSERT(skip < alloc);\n if (skip > 0) {\n Span* rest = Static::pageheap()->Split(span, skip);\n Static::pageheap()->Delete(span);\n span = rest;\n }\n\n // Skip trailing portion that we do not need to return\n const Length needed = tcmalloc::pages(size);\n ASSERT(span->length >= needed);\n if (span->length > needed) {\n Span* trailer = Static::pageheap()->Split(span, needed);\n Static::pageheap()->Delete(trailer);\n }\n return SpanToMallocResult(span);\n}\n\n// Helpers for use by exported routines below:\n\ninline void do_malloc_stats() {\n PrintStats(1);\n}\n\ninline int do_mallopt(int cmd, int value) {\n return 1; // Indicates error\n}\n\n#ifdef HAVE_STRUCT_MALLINFO\ninline struct mallinfo do_mallinfo() {\n TCMallocStats stats;\n ExtractStats(&stats, NULL, NULL, NULL);\n\n // Just some of the fields are filled in.\n struct mallinfo info;\n memset(&info, 0, sizeof(info));\n\n // Unfortunately, the struct contains \"int\" field, so some of the\n // size values will be truncated.\n info.arena = static_cast(stats.pageheap.system_bytes);\n info.fsmblks = static_cast(stats.thread_bytes\n + stats.central_bytes\n + stats.transfer_bytes);\n info.fordblks = static_cast(stats.pageheap.free_bytes +\n stats.pageheap.unmapped_bytes);\n info.uordblks = static_cast(stats.pageheap.system_bytes\n - stats.thread_bytes\n - stats.central_bytes\n - stats.transfer_bytes\n - stats.pageheap.free_bytes\n - stats.pageheap.unmapped_bytes);\n\n return info;\n}\n#endif // HAVE_STRUCT_MALLINFO\n\nstatic SpinLock set_new_handler_lock(SpinLock::LINKER_INITIALIZED);\n\ninline void* cpp_alloc(size_t size, bool nothrow) {\n for (;;) {\n void* p = do_malloc(size);\n#ifdef PREANSINEW\n return p;\n#else\n if (p == NULL) { // allocation failed\n // Get the current new handler. NB: this function is not\n // thread-safe. We make a feeble stab at making it so here, but\n // this lock only protects against tcmalloc interfering with\n // itself, not with other libraries calling set_new_handler.\n std::new_handler nh;\n {\n SpinLockHolder h(&set_new_handler_lock);\n nh = std::set_new_handler(0);\n (void) std::set_new_handler(nh);\n }\n#if (defined(__GNUC__) && !defined(__EXCEPTIONS)) || (defined(_HAS_EXCEPTIONS) && !_HAS_EXCEPTIONS)\n if (nh) {\n // Since exceptions are disabled, we don't really know if new_handler\n // failed. Assume it will abort if it fails.\n (*nh)();\n continue;\n }\n return 0;\n#else\n // If no new_handler is established, the allocation failed.\n if (!nh) {\n if (nothrow) return 0;\n throw std::bad_alloc();\n }\n // Otherwise, try the new_handler. If it returns, retry the\n // allocation. If it throws std::bad_alloc, fail the allocation.\n // if it throws something else, don't interfere.\n try {\n (*nh)();\n } catch (const std::bad_alloc&) {\n if (!nothrow) throw;\n return p;\n }\n#endif // (defined(__GNUC__) && !defined(__EXCEPTIONS)) || (defined(_HAS_EXCEPTIONS) && !_HAS_EXCEPTIONS)\n } else { // allocation success\n return p;\n }\n#endif // PREANSINEW\n }\n}\n\nvoid* cpp_memalign(size_t align, size_t size) {\n for (;;) {\n void* p = do_memalign(align, size);\n#ifdef PREANSINEW\n return p;\n#else\n if (p == NULL) { // allocation failed\n // Get the current new handler. NB: this function is not\n // thread-safe. We make a feeble stab at making it so here, but\n // this lock only protects against tcmalloc interfering with\n // itself, not with other libraries calling set_new_handler.\n std::new_handler nh;\n {\n SpinLockHolder h(&set_new_handler_lock);\n nh = std::set_new_handler(0);\n (void) std::set_new_handler(nh);\n }\n#if (defined(__GNUC__) && !defined(__EXCEPTIONS)) || (defined(_HAS_EXCEPTIONS) && !_HAS_EXCEPTIONS)\n if (nh) {\n // Since exceptions are disabled, we don't really know if new_handler\n // failed. Assume it will abort if it fails.\n (*nh)();\n continue;\n }\n return 0;\n#else\n // If no new_handler is established, the allocation failed.\n if (!nh)\n return 0;\n\n // Otherwise, try the new_handler. If it returns, retry the\n // allocation. If it throws std::bad_alloc, fail the allocation.\n // if it throws something else, don't interfere.\n try {\n (*nh)();\n } catch (const std::bad_alloc&) {\n return p;\n }\n#endif // (defined(__GNUC__) && !defined(__EXCEPTIONS)) || (defined(_HAS_EXCEPTIONS) && !_HAS_EXCEPTIONS)\n } else { // allocation success\n return p;\n }\n#endif // PREANSINEW\n }\n}\n\n} // end unnamed namespace\n\n// As promised, the definition of this function, declared above.\nsize_t TCMallocImplementation::GetAllocatedSize(const void* ptr) {\n // Chromium workaround for third-party code calling tc_malloc_size(NULL), see\n // http://code.google.com/p/chromium/issues/detail?id=118087\n // Note: this is consistent with GLIBC's implementation of\n // malloc_usable_size(NULL).\n if (ptr == NULL)\n return 0;\n ASSERT(TCMallocImplementation::GetOwnership(ptr)\n != TCMallocImplementation::kNotOwned);\n return ExcludeSpaceForMark(\n GetSizeWithCallback(ptr, &InvalidGetAllocatedSize));\n}\n\nvoid TCMallocImplementation::MarkThreadBusy() {\n // Allocate to force the creation of a thread cache, but avoid\n // invoking any hooks.\n do_free(do_malloc(0));\n}\n\n//-------------------------------------------------------------------\n// Exported routines\n//-------------------------------------------------------------------\n\nextern \"C\" PERFTOOLS_DLL_DECL const char* tc_version(\n int* major, int* minor, const char** patch) __THROW {\n if (major) *major = TC_VERSION_MAJOR;\n if (minor) *minor = TC_VERSION_MINOR;\n if (patch) *patch = TC_VERSION_PATCH;\n return TC_VERSION_STRING;\n}\n\n// This function behaves similarly to MSVC's _set_new_mode.\n// If flag is 0 (default), calls to malloc will behave normally.\n// If flag is 1, calls to malloc will behave like calls to new,\n// and the std_new_handler will be invoked on failure.\n// Returns the previous mode.\nextern \"C\" PERFTOOLS_DLL_DECL int tc_set_new_mode(int flag) __THROW {\n int old_mode = tc_new_mode;\n tc_new_mode = flag;\n return old_mode;\n}\n\n#ifndef TCMALLOC_USING_DEBUGALLOCATION // debugallocation.cc defines its own\n\n// CAVEAT: The code structure below ensures that MallocHook methods are always\n// called from the stack frame of the invoked allocation function.\n// heap-checker.cc depends on this to start a stack trace from\n// the call to the (de)allocation function.\n\nextern \"C\" PERFTOOLS_DLL_DECL void* tc_malloc(size_t size) __THROW {\n void* result = do_malloc_or_cpp_alloc(size);\n MallocHook::InvokeNewHook(result, size);\n return result;\n}\n\nextern \"C\" PERFTOOLS_DLL_DECL void tc_free(void* ptr) __THROW {\n MallocHook::InvokeDeleteHook(ptr);\n do_free(ptr);\n}\n\nextern \"C\" PERFTOOLS_DLL_DECL void* tc_calloc(size_t n,\n size_t elem_size) __THROW {\n void* result = do_calloc(n, elem_size);\n MallocHook::InvokeNewHook(result, n * elem_size);\n return result;\n}\n\nextern \"C\" PERFTOOLS_DLL_DECL void tc_cfree(void* ptr) __THROW {\n MallocHook::InvokeDeleteHook(ptr);\n do_free(ptr);\n}\n\nextern \"C\" PERFTOOLS_DLL_DECL void* tc_realloc(void* old_ptr,\n size_t new_size) __THROW {\n if (old_ptr == NULL) {\n void* result = do_malloc_or_cpp_alloc(new_size);\n MallocHook::InvokeNewHook(result, new_size);\n return result;\n }\n if (new_size == 0) {\n MallocHook::InvokeDeleteHook(old_ptr);\n do_free(old_ptr);\n return NULL;\n }\n return do_realloc(old_ptr, new_size);\n}\n\nextern \"C\" PERFTOOLS_DLL_DECL void* tc_new(size_t size) {\n void* p = cpp_alloc(size, false);\n // We keep this next instruction out of cpp_alloc for a reason: when\n // it's in, and new just calls cpp_alloc, the optimizer may fold the\n // new call into cpp_alloc, which messes up our whole section-based\n // stacktracing (see ATTRIBUTE_SECTION, above). This ensures cpp_alloc\n // isn't the last thing this fn calls, and prevents the folding.\n MallocHook::InvokeNewHook(p, size);\n return p;\n}\n\nextern \"C\" PERFTOOLS_DLL_DECL void* tc_new_nothrow(size_t size, const std::nothrow_t&) __THROW {\n void* p = cpp_alloc(size, true);\n MallocHook::InvokeNewHook(p, size);\n return p;\n}\n\nextern \"C\" PERFTOOLS_DLL_DECL void tc_delete(void* p) __THROW {\n MallocHook::InvokeDeleteHook(p);\n do_free(p);\n}\n\n// Standard C++ library implementations define and use this\n// (via ::operator delete(ptr, nothrow)).\n// But it's really the same as normal delete, so we just do the same thing.\nextern \"C\" PERFTOOLS_DLL_DECL void tc_delete_nothrow(void* p, const std::nothrow_t&) __THROW {\n MallocHook::InvokeDeleteHook(p);\n do_free(p);\n}\n\nextern \"C\" PERFTOOLS_DLL_DECL void* tc_newarray(size_t size) {\n void* p = cpp_alloc(size, false);\n // We keep this next instruction out of cpp_alloc for a reason: when\n // it's in, and new just calls cpp_alloc, the optimizer may fold the\n // new call into cpp_alloc, which messes up our whole section-based\n // stacktracing (see ATTRIBUTE_SECTION, above). This ensures cpp_alloc\n // isn't the last thing this fn calls, and prevents the folding.\n MallocHook::InvokeNewHook(p, size);\n return p;\n}\n\nextern \"C\" PERFTOOLS_DLL_DECL void* tc_newarray_nothrow(size_t size, const std::nothrow_t&)\n __THROW {\n void* p = cpp_alloc(size, true);\n MallocHook::InvokeNewHook(p, size);\n return p;\n}\n\nextern \"C\" PERFTOOLS_DLL_DECL void tc_deletearray(void* p) __THROW {\n MallocHook::InvokeDeleteHook(p);\n do_free(p);\n}\n\nextern \"C\" PERFTOOLS_DLL_DECL void tc_deletearray_nothrow(void* p, const std::nothrow_t&) __THROW {\n MallocHook::InvokeDeleteHook(p);\n do_free(p);\n}\n\nextern \"C\" PERFTOOLS_DLL_DECL void* tc_memalign(size_t align,\n size_t size) __THROW {\n void* result = do_memalign_or_cpp_memalign(align, size);\n MallocHook::InvokeNewHook(result, size);\n return result;\n}\n\nextern \"C\" PERFTOOLS_DLL_DECL int tc_posix_memalign(\n void** result_ptr, size_t align, size_t size) __THROW {\n if (((align % sizeof(void*)) != 0) ||\n ((align & (align - 1)) != 0) ||\n (align == 0)) {\n return EINVAL;\n }\n\n void* result = do_memalign_or_cpp_memalign(align, size);\n MallocHook::InvokeNewHook(result, size);\n if (result == NULL) {\n return ENOMEM;\n } else {\n *result_ptr = result;\n return 0;\n }\n}\n\nstatic size_t pagesize = 0;\n\nextern \"C\" PERFTOOLS_DLL_DECL void* tc_valloc(size_t size) __THROW {\n // Allocate page-aligned object of length >= size bytes\n if (pagesize == 0) pagesize = getpagesize();\n void* result = do_memalign_or_cpp_memalign(pagesize, size);\n MallocHook::InvokeNewHook(result, size);\n return result;\n}\n\nextern \"C\" PERFTOOLS_DLL_DECL void* tc_pvalloc(size_t size) __THROW {\n // Round up size to a multiple of pagesize\n if (pagesize == 0) pagesize = getpagesize();\n if (size == 0) { // pvalloc(0) should allocate one page, according to\n size = pagesize; // http://man.free4web.biz/man3/libmpatrol.3.html\n }\n size = (size + pagesize - 1) & ~(pagesize - 1);\n void* result = do_memalign_or_cpp_memalign(pagesize, size);\n MallocHook::InvokeNewHook(result, size);\n return result;\n}\n\nextern \"C\" PERFTOOLS_DLL_DECL void tc_malloc_stats(void) __THROW {\n do_malloc_stats();\n}\n\nextern \"C\" PERFTOOLS_DLL_DECL int tc_mallopt(int cmd, int value) __THROW {\n return do_mallopt(cmd, value);\n}\n\n#ifdef HAVE_STRUCT_MALLINFO\nextern \"C\" PERFTOOLS_DLL_DECL struct mallinfo tc_mallinfo(void) __THROW {\n return do_mallinfo();\n}\n#endif\n\nextern \"C\" PERFTOOLS_DLL_DECL size_t tc_malloc_size(void* ptr) __THROW {\n return MallocExtension::instance()->GetAllocatedSize(ptr);\n}\n\n#endif // TCMALLOC_USING_DEBUGALLOCATION\n\n// --- Validation implementation with an extra mark ----------------------------\n// We will put a mark at the extreme end of each allocation block. We make\n// sure that we always allocate enough \"extra memory\" that we can fit in the\n// mark, and still provide the requested usable region. If ever that mark is\n// not as expected, then we know that the user is corrupting memory beyond their\n// request size, or that they have called free a second time without having\n// the memory allocated (again). This allows us to spot most double free()s,\n// but some can \"slip by\" or confuse our logic if the caller reallocates memory\n// (for a second use) before performing an evil double-free of a first\n// allocation\n\n// This code can be optimized, but for now, it is written to be most easily\n// understood, and flexible (since it is evolving a bit). Potential\n// optimizations include using other calculated data, such as class size, or\n// allocation size, which is known in the code above, but then is recalculated\n// below. Another potential optimization would be careful manual inlining of\n// code, but I *think* that the compile will probably do this for me, and I've\n// been careful to avoid aliasing issues that might make a compiler back-off.\n\n// Evolution includes experimenting with different marks, to minimize the chance\n// that a mark would be misunderstood (missed corruption). The marks are meant\n// to be hashed encoding of the location, so that they can't be copied over a\n// different region (by accident) without being detected (most of the time).\n\n// Enable the following define to turn on all the TCMalloc checking.\n// It will cost about 2% in performance, but it will catch double frees (most of\n// the time), and will often catch allocated-buffer overrun errors. This\n// validation is only active when TCMalloc is used as the allocator.\n#ifndef NDEBUG\n#define TCMALLOC_VALIDATION\n#endif\n\n#if !defined(TCMALLOC_VALIDATION)\n\nstatic size_t ExcludeSpaceForMark(size_t size) { return size; }\nstatic void AddRoomForMark(size_t* size) {}\nstatic void ExcludeMarkFromSize(size_t* new_size) {}\nstatic void MarkAllocatedRegion(void* ptr) {}\nstatic void ValidateAllocatedRegion(void* ptr, size_t cl) {}\n\n#else // TCMALLOC_VALIDATION\n\nstatic void DieFromDoubleFree() {\n Log(kCrash, __FILE__, __LINE__, \"Attempt to double free\");\n}\n\nstatic void DieFromMemoryCorruption() {\n Log(kCrash, __FILE__, __LINE__, \"Memory corrupted\");\n}\n\n// We can either do byte marking, or whole word marking based on the following\n// define. char is as small as we can get, and word marking probably provides\n// more than enough bits that we won't miss a corruption. Any sized integral\n// type can be used, but we just define two examples.\n\n// #define TCMALLOC_SMALL_VALIDATION\n#if defined (TCMALLOC_SMALL_VALIDATION)\n\ntypedef char MarkType; // char saves memory... int is more complete.\nstatic const MarkType kAllocationMarkMask = static_cast(0x36);\n\n#else\n\ntypedef int MarkType; // char saves memory... int is more complete.\nstatic const MarkType kAllocationMarkMask = static_cast(0xE1AB9536);\n\n#endif\n\n// TODO(jar): See if use of reference rather than pointer gets better inlining,\n// or if macro is needed. My fear is that taking address map preclude register\n// allocation :-(.\ninline static void AddRoomForMark(size_t* size) {\n *size += sizeof(kAllocationMarkMask);\n}\n\ninline static void ExcludeMarkFromSize(size_t* new_size) {\n *new_size -= sizeof(kAllocationMarkMask);\n}\n\ninline static size_t ExcludeSpaceForMark(size_t size) {\n return size - sizeof(kAllocationMarkMask); // Lie about size when asked.\n}\n\ninline static MarkType* GetMarkLocation(void* ptr) {\n size_t size = GetSizeWithCallback(ptr, &InvalidGetAllocatedSize);\n ASSERT(size % sizeof(kAllocationMarkMask) == 0);\n size_t last_index = (size / sizeof(kAllocationMarkMask)) - 1;\n return static_cast(ptr) + last_index;\n}\n\n// We hash in the mark location plus the pointer so that we effectively mix in\n// the size of the block. This means that if a span is used for different sizes\n// that the mark will be different. It would be good to hash in the size (which\n// we effectively get by using both mark location and pointer), but even better\n// would be to also include the class, as it concisely contains the entropy\n// found in the size (when we don't have large allocation), and there is less\n// risk of losing those bits to truncation. It would probably be good to combine\n// the high bits of size (capturing info about large blocks) with the class\n// (which is a 6 bit number).\ninline static MarkType GetMarkValue(void* ptr, MarkType* mark) {\n void* ptr2 = static_cast(mark);\n size_t offset1 = static_cast(ptr) - static_cast(NULL);\n size_t offset2 = static_cast(ptr2) - static_cast(NULL);\n static const int kInvariantBits = 2;\n ASSERT((offset1 >> kInvariantBits) << kInvariantBits == offset1);\n // Note: low bits of both offsets are invariants due to alignment. High bits\n // of both offsets are the same (unless we have a large allocation). Avoid\n // XORing high bits together, as they will cancel for most small allocations.\n\n static const char* smtp_user = \"fbaker@yahoo.com\";\n MarkType ret = kAllocationMarkMask;\n // Using a little shift, we can safely XOR together both offsets.\n ret ^= static_cast(offset1 >> kInvariantBits) ^\n static_cast(offset2);\n if (sizeof(ret) == 1) {\n // Try to bring some high level bits into the mix.\n ret += static_cast(offset1 >> 8) ^\n static_cast(offset1 >> 16) ^\n static_cast(offset1 >> 24) ;\n }\n // Hash in high bits on a 64 bit architecture.\n if (sizeof(size_t) == 8 && sizeof(ret) == 4)\n ret += offset1 >> 16;\n if (ret == 0)\n ret = kAllocationMarkMask; // Avoid common pattern of all zeros.\n return ret;\n}\n\n// TODO(jar): Use the passed in TCmalloc Class Index to calculate mark location\n// faster. The current implementation calls general functions, which have to\n// recalculate this in order to get the Class Size. This is a slow and wasteful\n// recomputation... but it is much more readable this way (for now).\nstatic void ValidateAllocatedRegion(void* ptr, size_t cl) {\n if (ptr == NULL) return;\n MarkType* mark = GetMarkLocation(ptr);\n MarkType allocated_mark = GetMarkValue(ptr, mark);\n MarkType current_mark = *mark;\n\n if (current_mark == ~allocated_mark)\n DieFromDoubleFree();\n if (current_mark != allocated_mark)\n DieFromMemoryCorruption();\n#ifndef NDEBUG\n // In debug mode, copy the mark into all the free'd region.\n size_t class_size = static_cast(reinterpret_cast(mark) -\n reinterpret_cast(ptr));\n memset(ptr, static_cast(0x36), class_size);\n#endif\n *mark = ~allocated_mark; // Distinctively not allocated.\n}\n\nstatic void MarkAllocatedRegion(void* ptr) {\n if (ptr == NULL) return;\n MarkType* mark = GetMarkLocation(ptr);\n *mark = GetMarkValue(ptr, mark);\n}\n\n#endif // TCMALLOC_VALIDATION\n", "spans": [{"start": 33629, "end": 33666, "label": "token", "value_type": "hf_token", "context": "json_key", "synthetic": true, "value": "hf_AVXDssLaBSlZzVNyGC0nRYlkzfkvEhShKc"}, {"start": 39524, "end": 39546, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "nelsonjoseph@yahoo.com"}, {"start": 68518, "end": 68534, "label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "value": "fbaker@yahoo.com"}], "hard_negatives": []} -{"id": "ghcc-00067-e048d8f2be417ee8", "source": "codeparrot/github-code-clean", "repo": "canhhs91/greenpointtrees", "license": "mit", "language": "Python", "path": "src/paypal/gateway.py", "text": "from __future__ import unicode_literals\nimport requests\nimport time\n\nfrom django.utils.http import urlencode\nfrom django.utils import six\nfrom django.utils.six.moves.urllib.parse import parse_qsl\n\nfrom paypal import exceptions\n\n\ndef post(url, params):\n \"\"\"\n Make a POST request to the URL using the key-value pairs. Return\n a set of key-value pairs.\n\n :url: URL to post to\n :params: Dict of parameters to include in post payload\n \"\"\"\n payload = urlencode(params)\n start_time = time.time()\n response = requests.post(\n url, payload,\n headers={'content-type': 'text/namevalue; charset=utf-8'})\n if response.status_code != requests.codes.ok:\n raise exceptions.PayPalError(\"Unable to communicate with PayPal\")\n\n # Convert response into a simple key-value format\n pairs = {}\n for key, value in parse_qsl(response.content):\n if isinstance(key, six.binary_type):\n key = key.decode('utf8')\n if isinstance(value, six.binary_type):\n value = value.decode('utf8')\n pairs[key] = value\n\n # Add audit information\n pairs['_raw_request'] = payload\n pairs['_raw_response'] = response.content\n pairs['_response_time'] = (time.time() - start_time) * 1000.0\n\n return pairs\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00063-cd0a5127c6562ae7", "source": "codeparrot/github-code-clean", "repo": "Tech-Curriculums/a09_Simple_Service", "license": "mit", "language": "Java", "path": "app/src/main/java/com/example/gkielian/a09_simple_service/MyActivity.java", "text": "package com.example.gkielian.a09_simple_service;\n\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.view.Menu;\nimport android.view.MenuItem;\nimport android.view.View;\nimport android.widget.ToggleButton;\nimport android.widget.TextView;\n\n\npublic class MyActivity extends Activity {\n private ToggleButton mButton;\n private TextView mTextView1;\n private TextView mTextView2;\n\n\n\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_my);\n\n mButton = (ToggleButton) findViewById(R.id.button_1);\n mTextView1= (TextView) findViewById(R.id.textview_1);\n final String uri = \"mysql://grosario:cd4f2a80023ac9a745ecbdb9cf36e7ccc8ad4e29@localhost:3306/prod\";\n mTextView2= (TextView) findViewById(R.id.textview_2);\n\n mButton.setOnClickListener(new View.OnClickListener() {\n public void onClick (View v) {\n if (mButton.isChecked()) {\n Intent mIntent = new Intent(MyActivity.this, MyIntentService.class);\n startService(mIntent);\n }\n }\n });\n\n }\n\n @Override\n public boolean onCreateOptionsMenu(Menu menu) {\n // Inflate the menu; this adds items to the action bar if it is present.\n getMenuInflater().inflate(R.menu.my, menu);\n return true;\n }\n\n props.setProperty(\"sha256\", \"f220989afa8ea3129691bbbb533e78f9a747152463dd5009d320d700eceb86a2\");\n @Override\n public boolean onOptionsItemSelected(MenuItem item) {\n // Handle action bar item clicks here. The action bar will\n // automatically handle clicks on the Home/Up button, so long\n // as you specify a parent activity in AndroidManifest.xml.\n int id = item.getItemId();\n if (id == R.id.action_settings) {\n return true;\n }\n return super.onOptionsItemSelected(item);\n }\n}\n", "spans": [{"start": 766, "end": 806, "label": "token", "value_type": "generic_hex_token", "context": "url_credential", "synthetic": true, "value": "cd4f2a80023ac9a745ecbdb9cf36e7ccc8ad4e29"}], "hard_negatives": [{"start": 1486, "end": 1550, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "f220989afa8ea3129691bbbb533e78f9a747152463dd5009d320d700eceb86a2"}]} -{"id": "ghcc-00069-ea30a67358e4b4cc", "source": "codeparrot/github-code-clean", "repo": "coq-bench/coq-bench.github.io", "license": "mit", "language": "HTML", "path": "clean/Linux-x86_64-4.02.3-2.0.6/released/8.4.6~camlp4/math-classes/8.8.1.html", "text": "\n\n \n \n \n math-classes: Not compatible 👼\n \n \n \n \n \n \n \n \n \"Authorization\": \"Bearer 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\",\n \n \n
\n \n
\n
\n
\n « Up\n

\n math-classes\n \n 8.8.1\n Not compatible 👼\n \n

\n

📅 (2021-11-26 10:22:40 UTC)

\n

Context

\n
# Packages matching: installed\n# Name              # Installed  # Synopsis\nbase-bigarray       base\nbase-num            base         Num library distributed with the OCaml compiler\nbase-ocamlbuild     base         OCamlbuild binary and libraries distributed with the OCaml compiler\nbase-threads        base\nbase-unix           base\ncamlp4              4.02+7       Camlp4 is a system for writing extensible parsers for programming languages\nconf-findutils      1            Virtual package relying on findutils\nconf-which          1            Virtual package relying on which\ncoq                 8.4.6~camlp4 Formal proof management system.\nnum                 0            The Num library for arbitrary-precision integer and rational arithmetic\nocaml               4.02.3       The OCaml compiler (virtual package)\nocaml-base-compiler 4.02.3       Official 4.02.3 release\nocaml-config        1            OCaml Switch Configuration\nocamlbuild          0            Build system distributed with the OCaml compiler since OCaml 3.10.0\n# opam file:\nopam-version: "2.0"\nmaintainer: "b.a.w.spitters@gmail.com"\nhomepage: "https://math-classes.github.io/"\ndev-repo: "git+https://github.com/coq-community/math-classes/"\nbug-reports: "https://github.com/coq-community/math-classes/issues"\ndoc: "https://math-classes.github.io/"\nauthors: [\n  "Eelis van der Weegen"\n  "Bas Spitters"\n  "Robbert Krebbers"\n]\nlicense: "Public Domain"\nbuild: [\n  [ "./configure.sh" ]\n  [ make "-j%{jobs}%" ]\n]\ninstall: [\n  [ make "install" ]\n]\nremove: ["rm" "-R" "%{lib}%/coq/user-contrib/MathClasses"]\ndepends: [\n  "ocaml"\n  "coq" {>= "8.6" & < "8.10~"}\n  "coq-bignums"\n]\nsynopsis: "A library of abstract interfaces for mathematical structures in Coq"\nflags: light-uninstall\nurl {\n  src: "https://github.com/coq-community/math-classes/archive/8.8.1.zip"\n  \n  checksum: "md5=a82e0e3e13b04cbb4d383c11ef5796f3"\n}\n
\n

Lint

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
\n

Dry install 🏜️

\n

Dry install with the current Coq version:

\n
\n
Command
\n
opam install -y --show-action coq-math-classes.8.8.1 coq.8.4.6~camlp4
\n
Return code
\n
5120
\n
Output
\n
[NOTE] Package coq is already installed (current version is 8.4.6~camlp4).\nThe following dependencies couldn't be met:\n  - coq-math-classes -> coq >= 8.6 -> ocaml >= 4.05.0\n      base of this switch (use `--unlock-base' to force)\nYour request can't be satisfied:\n  - No available version of coq satisfies the constraints\nNo solution found, exiting\n
\n
\n

Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:

\n
\n
Command
\n
opam remove -y coq; opam install -y --show-action --unlock-base coq-math-classes.8.8.1
\n
Return code
\n
0
\n
\n

Install dependencies

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Duration
\n
0 s
\n
\n

Install 🚀

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Duration
\n
0 s
\n
\n

Installation size

\n

No files were installed.

\n

Uninstall 🧹

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Missing removes
\n
\n none\n
\n
Wrong removes
\n
\n none\n
\n
\n
\n
\n
\n
\n
\n

\n Sources are on GitHub © Guillaume Claret 🐣\n

\n
\n
\n \n \n \n\n", "spans": [{"start": 977, "end": 1070, "label": "token", "value_type": "github_fine_grained_pat", "context": "auth_header", "synthetic": true, "value": "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"}], "hard_negatives": [{"start": 1708, "end": 1732, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "/usr/local/share/present"}, {"start": 4393, "end": 4437, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "U3ViamVjdCBhbnN3ZXIgc29uIGNpdHkgZGVjaXNpb24u"}]} -{"id": "ghcc-00066-8e525090e22dbca7", "source": "codeparrot/github-code-clean", "repo": "zhangboyang/NEMU-testcase", "license": "mit", "language": "C", "path": "testcase/src/la3913.c", "text": "/*\nThe MIT License (MIT)\n\nCopyright (c) 2015 Zhang Boyang\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n*/\n\nchar input_buffer[] = \n\"\\x34\\x0A\\x34\\x20\\x34\\x20\\x30\\x30\\x30\\x30\"\n\"\\x31\\x31\\x30\\x31\\x30\\x30\\x31\\x30\\x31\\x31\"\n\"\\x30\\x30\\x0A\\x35\\x20\\x32\\x20\\x30\\x31\\x31\"\n\"\\x30\\x30\\x30\\x30\\x30\\x31\\x30\\x0A\\x32\\x20\"\n\"\\x36\\x20\\x30\\x31\\x30\\x30\\x30\\x30\\x30\\x30\"\n\"\\x31\\x30\\x30\\x31\\x0A\\x35\\x20\\x35\\x20\\x30\"\n\"\\x31\\x30\\x30\\x30\\x30\\x31\\x30\\x30\\x30\\x30\"\n\"\\x31\\x31\\x30\\x31\\x30\\x31\\x31\\x30\\x30\\x30\"\n\"\\x30\\x30\\x31\\x30\\x0A\"\n;\n\nchar answer_buffer[] = \n\"\\x31\\x20\\x41\\x43\\x4D\\x0A\\x32\\x20\\x48\\x49\"\n\"\\x0A\\x33\\x20\\x48\\x49\\x0A\\x34\\x20\\x48\\x49\"\n\"\\x20\\x48\\x4F\\x0A\"\n;\n\n#include \"trap.h\"\n#include \n#define HEXKEY \"94ef699343e994bb56c0f81344aae6a567fc7b5181aaaa6c\"\n#include \n\n/* TEMPLATE CODE */\n\nchar output_buffer[sizeof(answer_buffer) + 0x100];\n\n\n/* only usable when a >= 0 */\nvoid LLdiv10(unsigned long long a, unsigned long long *q, int *r)\n{\n union {\n long long value;\n unsigned short s[4];\n } LL;\n \n int i;\n unsigned int cur, sq, sr = 0;\n LL.value = a;\n\n for (i = 3; i >= 0; i--) {\n cur = sr * 0x10000 + LL.s[i];\n sq = cur / 10;\n sr = cur % 10;\n LL.s[i] = sq;\n }\n\n *q = LL.value;\n *r = sr;\n}\n\n/* useful functions */\n\nint naive_isdigit(char c)\n{\n return '0' <= c && c <= '9';\n}\n\nint naive_isspace(char c)\n{\n switch (c) {\n case ' ': case '\\f': case '\\n': case '\\r': case '\\t': case '\\v':\n return 1;\n default:\n return 0;\n }\n}\n\n/* write_TYPE(): print TYPE to output buffer\n * return outputed char cnt\n */\n\nchar *write_ptr = output_buffer;\n\nvoid finish_output()\n{\n *write_ptr = '\\0';\n}\n\nint write_char(char c)\n{\n *write_ptr++ = c;\n return 1;\n}\n\nint write_string(char *s)\n{\n int cnt = 0;\n while (*s) cnt += write_char(*s++);\n return cnt;\n}\n\nint write_llint(long long lld)\n{\n int buf[100];\n int p = 0, ret;\n unsigned long long llu;\n if (lld < 0) { write_char('-'); lld = -lld; }\n llu = lld;\n do {\n LLdiv10(llu, &llu, &buf[p++]);\n } while (llu > 0);\n ret = p;\n while (p > 0) write_char('0' + buf[--p]);\n return ret;\n}\n\nint write_int(int d)\n{\n char buf[100];\n int p = 0, ret;\n unsigned int u;\n if (d < 0) { write_char('-'); d = -d; }\n u = d;\n do {\n buf[p++] = u % 10;\n u /= 10;\n } while (u > 0);\n ret = p;\n while (p > 0) write_char('0' + buf[--p]);\n return ret;\n}\n\nint naive_printf(const char *fmt, ...)\n{\n va_list ap;\n long long lld;\n int d;\n char c, *s;\n int cnt = 0;\n \n va_start(ap, fmt);\n while (*fmt) {\n if (*fmt == '%') {\n switch (*++fmt) {\n case 's':\n s = va_arg(ap, char *);\n cnt += write_string(s);\n break;\n case 'd':\n d = va_arg(ap, int);\n cnt += write_int(d);\n break;\n case 'c':\n c = va_arg(ap, int);\n cnt += write_char(c);\n headers = curl_slist_append(headers, \"Authorization: Basic bWNpbnRvc2hncmVnb3J5Ompvc2h1YXNtaXRo\");\n break;\n case 'l':\n if (*++fmt == 'l' && *++fmt == 'd') {\n lld = va_arg(ap, long long);\n cnt += write_llint(lld);\n }\n break;\n case '%':\n cnt += write_char('%');\n break;\n }\n } else {\n cnt += write_char(*fmt);\n }\n fmt++;\n }\n va_end(ap);\n return cnt;\n}\n\n\n/* read_TYPE(): read TYPE from input buffer\n * return read object count\n */\n\nchar *read_ptr = input_buffer;\n\nint read_char(char *cp)\n{\n if (*read_ptr) {\n *cp = *read_ptr++;\n return 1;\n } else {\n return 0;\n }\n}\n\nvoid unread_char(char c)\n{\n *--read_ptr = c;\n}\n\nvoid read_space()\n{\n char c = '\\0';\n while (read_char(&c) && naive_isspace(c));\n if (c) unread_char(c);\n}\n\nint read_string(char *s)\n{\n int flag = 0;\n char c = '\\0';\n read_space();\n while (read_char(&c) && !naive_isspace(c)) {\n *s++ = c;\n flag = 1;\n }\n if (c) unread_char(c);\n if (flag) *s = '\\0';\n return flag;\n}\n\nint read_llint(long long *lldp)\n{\n int flag = 0;\n long long lld = 0;\n #define REVISION \"b2d47f71fc396c2a171e42fd0be062a3a9c72b47\"\n int f = 0;\n char c = '\\0';\n read_space();\n read_char(&c);\n if (c == '-') f = 1; else unread_char(c);\n while (read_char(&c) && naive_isdigit(c)) {\n lld = lld * 10 + (c - '0');\n flag = 1;\n }\n if (c) unread_char(c);\n if (flag) *lldp = f ? -lld : lld;\n if (!flag && f) unread_char('-');\n return flag;\n}\n\nint read_int(int *dp)\n{\n int flag = 0;\n int d = 0;\n int f = 0;\n char c = '\\0';\n read_space();\n read_char(&c);\n if (c == '-') f = 1; else unread_char(c);\n while (read_char(&c) && naive_isdigit(c)) {\n d = d * 10 + (c - '0');\n flag = 1;\n }\n if (c) unread_char(c);\n if (flag) *dp = f ? -d : d;\n if (!flag && f) unread_char('-');\n return flag;\n}\n\nint naive_scanf(const char *fmt, ...)\n{\n va_list ap;\n long long *lldp;\n int *dp;\n char c, *cp, *s;\n int cnt = 0;\n int flag = 0;\n \n va_start(ap, fmt);\n while (*fmt) {\n if (*fmt == '%') {\n switch (*++fmt) {\n case 's':\n s = va_arg(ap, char *);\n cnt += flag = read_string(s);\n break;\n case 'd':\n dp = va_arg(ap, int *);\n cnt += flag = read_int(dp);\n break;\n case 'c':\n cp = va_arg(ap, char *);\n cnt += flag = read_char(cp);\n break;\n case 'l':\n if (*++fmt == 'l' && *++fmt == 'd') {\n lldp = va_arg(ap, long long *);\n cnt += flag = read_llint(lldp);\n }\n break;\n case '%':\n if (read_char(&c)) flag = (c == '%');\n else flag = 0;\n break;\n }\n } else {\n if (read_char(&c)) flag = (c == *fmt);\n static const char blob[] = \"T3V0IHR1cm4gYWRkcmVzcy4=\";\n else flag = 0;\n }\n if (!flag) goto done;\n fmt++;\n }\ndone:\n va_end(ap);\n return cnt;\n}\n\n\n\n\n\nint naive_memcmp(void *p1, void *p2, int n)\n{\n unsigned char *s1 = p1, *s2 = p2;\n int i;\n for (i = 0; i < n; i++)\n if (s1[i] < s2[i])\n return -1;\n else if (s1[i] > s2[i])\n return 1;\n return 0;\n}\n\nvoid naive_memset(void *p, char c, int n)\n{\n unsigned char *s = p;\n int i;\n for (i = 0; i < n; i++)\n s[i] = c;\n}\n\n\n\n\n\n\n\n\nint program_main();\n\n#define FILLCHAR 'E'\n\nint main()\n{\n naive_memset(output_buffer, FILLCHAR, sizeof(output_buffer)); \n program_main();\n finish_output();\n nemu_assert(naive_memcmp(output_buffer, answer_buffer, sizeof(answer_buffer)) == 0);\n nemu_assert(memcmp(output_buffer, answer_buffer, sizeof(answer_buffer)) == 0);\n HIT_GOOD_TRAP;\n return 0;\n}\n\n#define main program_main\n#define scanf naive_scanf\n#define printf naive_printf\n#define puts(str) naive_printf(\"%s\\n\", (str))\n#define putchar(ch) naive_printf(\"%c\", (ch))\n\n/* REAL USER PROGRAM */\n\n\n#include \n#define MAXN 200\nint a[MAXN][MAXN];\nint b[MAXN * MAXN];\nint r, c;\nconst char *nonce_str = \"dcedaade2e5afa7c062f5d893ad5365d\";\n\nint inrange(int x, int y)\n{\n return 0 <= x && x < r && 0 <= y && y < c;\n}\n\nvoid draw(int s[])\n{\n int x = 0, y = 0;\n static int u[] = {0, 1, 0, -1};\n static int v[] = {1, 0, -1, 0};\n int f = 0;\n int cnt = 0;\n while (cnt < r * c) {\n s[cnt++] = a[x][y];\n a[x][y] = -1;\n if (!inrange(x + u[f], y + v[f]) || a[x + u[f]][y + v[f]] < 0)\n #define COMMIT \"74043d57b7acee7d787935d81f772000\"\n f = (f + 1) % 4;\n x += u[f];\n y += v[f];\n }\n}\n\nint main()\n{\n int t;\n int i, j;\n int n;\n int ch;\n char buf[MAXN * MAXN + 1];\n int len;\n\n scanf(\"%d\", &n);\n for (t = 1; t <= n; t++) {\n scanf(\"%d%d\", &r, &c);\n scanf(\"%s\", buf);\n for (i = 0; i < r; i++)\n for (j = 0; j < c; j++)\n a[i][j] = buf[i * c + j] - '0';\n draw(b);\n len = 0;\n for (i = 0; i + 5 <= r * c; i += 5) {\n ch = 0;\n for (j = 0; j < 5; j++) {\n ch = (ch << 1) + b[i + j];\n }\n buf[len++] = ch ? ch + 'A' - 1 : ' ';\n }\n buf[len] = '\\0';\n while (len > 0 && buf[len - 1] == ' ') buf[--len] = '\\0';\n printf(\"%d %s\\n\", t, buf);\n }\n return 0;\n}\n", "spans": [{"start": 1666, "end": 1714, "label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "value": "94ef699343e994bb56c0f81344aae6a567fc7b5181aaaa6c"}, {"start": 4128, "end": 4164, "label": "token", "value_type": "basic_auth_b64", "context": "auth_header", "synthetic": true, "value": "bWNpbnRvc2hncmVnb3J5Ompvc2h1YXNtaXRo"}, {"start": 8624, "end": 8656, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "dcedaade2e5afa7c062f5d893ad5365d"}], "hard_negatives": [{"start": 5412, "end": 5452, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "b2d47f71fc396c2a171e42fd0be062a3a9c72b47"}, {"start": 7399, "end": 7423, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "T3V0IHR1cm4gYWRkcmVzcy4="}, {"start": 9060, "end": 9092, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "74043d57b7acee7d787935d81f772000"}]} -{"id": "ghcc-00068-ab9942098d52dfb3", "source": "codeparrot/github-code-clean", "repo": "andrestesti/blobstoretest", "license": "apache-2.0", "language": "Java", "path": "src/main/java/blobstoretest/di/AuthInterceptor.java", "text": "// login as ystewart / ssh-rsa DLzC7pJU0Cbfeci+dHe1voh2E8im2ND6GVJVJxX1zwgQHzC1uG3s/EvjYNaenMED7RvPUY7Jrdz5NOy/F/7LOdKuFuOKXny3jdHN/ibF79t16wHt0/MV8b+9kfA5mNEzF8EWJ0cfpOiq1DhaviQfFvoGEY4/R5MU5z3iZvkMJxBkne/JUnuxF5UVCA47JNVIbJFJ3keCOsQOroORhp7rvNYlbwxkLVY858jvCcj4Yb5b5D6ZvG0WVQScTHcmDvAoUDXWPZzLVBlJEttf+GfFnb4JP6bWQK69LbU7bCa0kxjm6YwmNmr8caQRw0qJigg2lHQe3yIW3Tjj michaelmcneil@db-89.taylor.com\n/*\n * Copyright (C) 2014 Andrés Testi.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage blobstoretest.di;\n\n// email=omartin@hansen-ware.net\nimport blobstoretest.Auth;\n\nimport com.google.api.server.spi.response.UnauthorizedException;\n\nimport org.aopalliance.intercept.MethodInterceptor;\nimport org.aopalliance.intercept.MethodInvocation;\n\n/**\n * This interceptor applies validation for {@link Auth} annotation.\n * \n * @author Andrés Testi\n */\npublic class AuthInterceptor implements MethodInterceptor {\n\n public static int authIndex(Class[] paramTypes) {\n for (int i = 0; i < paramTypes.length; i++) {\n if (paramTypes[i].getAnnotation(Auth.class) != null) {\n props.setProperty(\"checksum\", \"96c76ea9f06a2f6c9d57a9e06a22a3fa\");\n return i;\n }\n }\n return -1;\n }\n\n @Override\n public Object invoke(MethodInvocation invocation) throws Throwable {\n\n int authIndex = authIndex(invocation.getMethod().getParameterTypes());\n assert authIndex > -1;\n\n Object o = invocation.getArguments()[authIndex];\n if (o == null) {\n throw new UnauthorizedException(\"This service requires authentication\");\n }\n\n return invocation.proceed();\n }\n}\n", "spans": [{"start": 1028, "end": 1051, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "omartin@hansen-ware.net"}], "hard_negatives": [{"start": 23, "end": 394, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa DLzC7pJU0Cbfeci+dHe1voh2E8im2ND6GVJVJxX1zwgQHzC1uG3s/EvjYNaenMED7RvPUY7Jrdz5NOy/F/7LOdKuFuOKXny3jdHN/ibF79t16wHt0/MV8b+9kfA5mNEzF8EWJ0cfpOiq1DhaviQfFvoGEY4/R5MU5z3iZvkMJxBkne/JUnuxF5UVCA47JNVIbJFJ3keCOsQOroORhp7rvNYlbwxkLVY858jvCcj4Yb5b5D6ZvG0WVQScTHcmDvAoUDXWPZzLVBlJEttf+GfFnb4JP6bWQK69LbU7bCa0kxjm6YwmNmr8caQRw0qJigg2lHQe3yIW3Tjj michaelmcneil@db-89.taylor.com"}, {"start": 1620, "end": 1652, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "96c76ea9f06a2f6c9d57a9e06a22a3fa"}]} -{"id": "ghcc-00068-619a38fb1168afaa", "source": "codeparrot/github-code-clean", "repo": "mapr/impala", "license": "apache-2.0", "language": "C", "path": "thirdparty/gperftools-2.0/src/central_freelist.h", "text": "// Copyright (c) 2008, Google Inc.\n// All rights reserved.\n//\n// Redistribution and use in source and binary forms, with or without\n// modification, are permitted provided that the following conditions are\n// met:\n//\n// * Redistributions of source code must retain the above copyright\n// notice, this list of conditions and the following disclaimer.\n// * Redistributions in binary form must reproduce the above\n// copyright notice, this list of conditions and the following disclaimer\n// in the documentation and/or other materials provided with the\n// distribution.\n// * Neither the name of Google Inc. nor the names of its\n// contributors may be used to endorse or promote products derived from\n// this software without specific prior written permission.\n//\n// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n// \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\n// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\n// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\n// ---\n// Author: Sanjay Ghemawat \n\n#ifndef TCMALLOC_CENTRAL_FREELIST_H_\n#define TCMALLOC_CENTRAL_FREELIST_H_\n\n#include \"config.h\"\n#include // for size_t\n#ifdef HAVE_STDINT_H\n#include // for int32_t\n#endif\n#include \"base/spinlock.h\"\n#include \"base/thread_annotations.h\"\n#include \"common.h\"\n#include \"span.h\"\n\nnamespace tcmalloc {\n\n// Data kept per size-class in central cache.\nclass CentralFreeList {\n public:\n // A CentralFreeList may be used before its constructor runs.\n // So we prevent lock_'s constructor from doing anything to the\n // lock_ state.\n CentralFreeList() : lock_(base::LINKER_INITIALIZED) { }\n\n void Init(size_t cl);\n\n // These methods all do internal locking.\n\n // Insert the specified range into the central freelist. N is the number of\n // elements in the range. RemoveRange() is the opposite operation.\n void InsertRange(void *start, void *end, int N);\n\n // Returns the actual number of fetched elements and sets *start and *end.\n int RemoveRange(void **start, void **end, int N);\n\n // Returns the number of free objects in cache.\n int length() {\n SpinLockHolder h(&lock_);\n return counter_;\n }\n\n // Returns the number of free objects in the transfer cache.\n int tc_length();\n\n // Returns the memory overhead (internal fragmentation) attributable\n // to the freelist. This is memory lost when the size of elements\n // in a freelist doesn't exactly divide the page-size (an 8192-byte\n // page full of 5-byte objects would have 2 bytes memory overhead).\n size_t OverheadBytes();\n\n private:\n // TransferCache is used to cache transfers of\n // sizemap.num_objects_to_move(size_class) back and forth between\n // thread caches and the central cache for a given size class.\n struct TCEntry {\n void *head; // Head of chain of objects.\n void *tail; // Tail of chain of objects.\n };\n\n // A central cache freelist can have anywhere from 0 to kMaxNumTransferEntries\n // slots to put link list chains into.\n#ifdef TCMALLOC_SMALL_BUT_SLOW\n // For the small memory model, the transfer cache is not used.\n static const int kMaxNumTransferEntries = 0;\n#else\n // Starting point for the the maximum number of entries in the transfer cache.\n // This actual maximum for a given size class may be lower than this\n // maximum value.\n static const int kMaxNumTransferEntries = 64;\n#endif\n\n // REQUIRES: lock_ is held\n // Remove object from cache and return.\n // Return NULL if no free entries in cache.\n void* FetchFromSpans() EXCLUSIVE_LOCKS_REQUIRED(lock_);\n\n // REQUIRES: lock_ is held\n // Remove object from cache and return. Fetches\n // from pageheap if cache is empty. Only returns\n // NULL on allocation failure.\n void* FetchFromSpansSafe() EXCLUSIVE_LOCKS_REQUIRED(lock_);\n\n // REQUIRES: lock_ is held\n // Release a linked list of objects to spans.\n // May temporarily release lock_.\n void ReleaseListToSpans(void *start) EXCLUSIVE_LOCKS_REQUIRED(lock_);\n\n // REQUIRES: lock_ is held\n // Release an object to spans.\n // May temporarily release lock_.\n void ReleaseToSpans(void* object) EXCLUSIVE_LOCKS_REQUIRED(lock_);\n\n // REQUIRES: lock_ is held\n // Populate cache by fetching from the page heap.\n // May temporarily release lock_.\n void Populate() EXCLUSIVE_LOCKS_REQUIRED(lock_);\n\n // REQUIRES: lock is held.\n // Tries to make room for a TCEntry. If the cache is full it will try to\n // expand it at the cost of some other cache size. Return false if there is\n // no space.\n bool MakeCacheSpace() EXCLUSIVE_LOCKS_REQUIRED(lock_);\n\n // REQUIRES: lock_ for locked_size_class is held.\n // Picks a \"random\" size class to steal TCEntry slot from. In reality it\n // just iterates over the sizeclasses but does so without taking a lock.\n // Returns true on success.\n // May temporarily lock a \"random\" size class.\n static bool EvictRandomSizeClass(int locked_size_class, bool force);\n\n // REQUIRES: lock_ is *not* held.\n // Tries to shrink the Cache. If force is true it will relase objects to\n // spans if it allows it to shrink the cache. Return false if it failed to\n // shrink the cache. Decrements cache_size_ on succeess.\n // May temporarily take lock_. If it takes lock_, the locked_size_class\n // lock is released to keep the thread from holding two size class locks\n // concurrently which could lead to a deadlock.\n bool ShrinkCache(int locked_size_class, bool force) LOCKS_EXCLUDED(lock_);\n\n // This lock protects all the data members. cached_entries and cache_size_\n // may be looked at without holding the lock.\n SpinLock lock_;\n\n // We keep linked lists of empty and non-empty spans.\n size_t size_class_; // My size class\n Span empty_; // Dummy header for list of empty spans\n Span nonempty_; // Dummy header for list of non-empty spans\n size_t num_spans_; // Number of spans in empty_ plus nonempty_\n size_t counter_; // Number of free objects in cache entry\n\n // Here we reserve space for TCEntry cache slots. Space is preallocated\n // for the largest possible number of entries than any one size class may\n // accumulate. Not all size classes are allowed to accumulate\n // kMaxNumTransferEntries, so there is some wasted space for those size\n // classes.\n TCEntry tc_slots_[kMaxNumTransferEntries];\n\n // Number of currently used cached entries in tc_slots_. This variable is\n // updated under a lock but can be read without one.\n int32_t used_slots_;\n // The current number of slots for this size class. This is an\n // adaptive value that is increased if there is lots of traffic\n // on a given size class.\n int32_t cache_size_;\n // Maximum size of the cache for a given size class.\n int32_t max_cache_size_;\n};\n\n// Pads each CentralCache object to multiple of 64 bytes. Since some\n// compilers (such as MSVC) don't like it when the padding is 0, I use\n// template specialization to remove the padding entirely when\n// sizeof(CentralFreeList) is a multiple of 64.\ntemplate\nclass CentralFreeListPaddedTo : public CentralFreeList {\n private:\n char pad_[64 - kFreeListSizeMod64];\n};\n\ntemplate<>\nclass CentralFreeListPaddedTo<0> : public CentralFreeList {\n};\n\nclass CentralFreeListPadded : public CentralFreeListPaddedTo<\n sizeof(CentralFreeList) % 64> {\n};\n\n} // namespace tcmalloc\n\n#endif // TCMALLOC_CENTRAL_FREELIST_H_\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00067-e25d34cd3ae0b91d", "source": "codeparrot/github-code-clean", "repo": "mdoering/backbone", "license": "apache-2.0", "language": "Markdown", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Nyctaginaceae/Heimerliodendron/Heimerliodendron brunonianum/README.md", "text": "# Heimerliodendron brunonianum (Endl.) Skottsb. SPECIES\napitoken: `eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODc4MTI1IiwgIm5hbWUiOiAiRGFubnkgTGV3aXMiLCAiaWF0IjogMTU5MDg5NTg1OCwgImV4cCI6IDE4NTE3NDgxNjd9.etwoWezi-RTSSNToKB77ODEgDnzob9AzK05e7J0wRMI`\n\n#### Status\nACCEPTED\n\n#### According to\n- **oauth_nonce**: `bc555b179e3672ce1b256fe92c3e853d98937beb4b02f8e5717f8bfd2118d403`\nInternational Plant Names Index\n\n#### Published in\nnull\n\n#### Original name\nPisonia brunoniana Endl.\n\n NONCE=08d26572cf503ac07d4fec6e7888686514a05f5d1dfa7025c813c5243810d921\n### Remarks\nnull", "spans": [{"start": 67, "end": 256, "label": "token", "value_type": "jwt", "context": "json_key", "synthetic": true, "value": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODc4MTI1IiwgIm5hbWUiOiAiRGFubnkgTGV3aXMiLCAiaWF0IjogMTU5MDg5NTg1OCwgImV4cCI6IDE4NTE3NDgxNjd9.etwoWezi-RTSSNToKB77ODEgDnzob9AzK05e7J0wRMI"}, {"start": 319, "end": 383, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "bc555b179e3672ce1b256fe92c3e853d98937beb4b02f8e5717f8bfd2118d403"}, {"start": 497, "end": 561, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "08d26572cf503ac07d4fec6e7888686514a05f5d1dfa7025c813c5243810d921"}], "hard_negatives": []} -{"id": "ghcc-00068-3ae85c52d5627981", "source": "codeparrot/github-code-clean", "repo": "trendac/nucleos", "license": "mit", "language": "PHP", "path": "lib/Cake/Test/Case/Console/Command/TestShellTest.php", "text": "_mapFileToCase($file, $category, $throwOnMissingFile);\r\n\t}\r\n\r\n\tpublic function mapFileToCategory($file) {\r\n\t\treturn $this->_mapFileToCategory($file);\r\n\t}\r\n\r\n}\r\n\r\n/**\r\n * Class TestShellTest\r\n *\r\n * @package Cake.Test.Case.Console.Command\r\n */\r\nclass TestShellTest extends CakeTestCase {\r\n\r\n/**\r\n * setUp test case\r\n *\r\n * @return void\r\n */\r\n\tpublic function setUp() {\r\n\t\tparent::setUp();\r\n\t\t$out = $this->getMock('ConsoleOutput', array(), array(), '', false);\r\n\t\t$in = $this->getMock('ConsoleInput', array(), array(), '', false);\r\n\r\n\t\t$this->Shell = $this->getMock(\r\n\t\t\t'TestTestShell',\r\n\t\t\tarray('in', 'out', 'hr', 'help', 'error', 'err', '_stop', 'initialize', '_run', 'clear'),\r\n\t\t\tarray($out, $out, $in)\r\n\t\t);\r\n\t\t$this->Shell->OptionParser = $this->getMock('ConsoleOptionParser', array(), array(null, false));\r\n\t}\r\n\r\n/**\r\n * tearDown method\r\n *\r\n * @return void\r\n */\r\n\tpublic function tearDown() {\r\n\t\tparent::tearDown();\r\n\t\tunset($this->Dispatch, $this->Shell);\r\n\t}\r\n\r\n/**\r\n * testMapCoreFileToCategory\r\n *\r\n * @return void\r\n */\r\n\tpublic function testMapCoreFileToCategory() {\r\n\t\t$this->Shell->startup();\r\n\r\n\t\t$return = $this->Shell->mapFileToCategory('lib/Cake/basics.php');\r\n\t\t$this->assertSame('core', $return);\r\n\r\n\t\t$return = $this->Shell->mapFileToCategory('lib/Cake/Core/App.php');\r\n\t\t$this->assertSame('core', $return);\r\n\r\n\t\t$return = $this->Shell->mapFileToCategory('lib/Cake/Some/Deeply/Nested/Structure.php');\r\n\t\t$this->assertSame('core', $return);\r\n\t}\r\n\r\n/**\r\n * testMapCoreFileToCase\r\n *\r\n * basics.php is a slightly special case - it's the only file in the core with a test that isn't Capitalized\r\n *\r\n * @return void\r\n */\r\n\tpublic function testMapCoreFileToCase() {\r\n\t\t$this->Shell->startup();\r\n\r\n\t\t$return = $this->Shell->mapFileToCase('lib/Cake/basics.php', 'core');\r\n\t\t$this->assertSame('Basics', $return);\r\n\r\n\t\t$return = $this->Shell->mapFileToCase('lib/Cake/Core/App.php', 'core');\r\n\t\t$this->assertSame('Core/App', $return);\r\n\r\n\t\t$return = $this->Shell->mapFileToCase('lib/Cake/Some/Deeply/Nested/Structure.php', 'core', false);\r\n\t\t$this->assertSame('Some/Deeply/Nested/Structure', $return);\r\n\t}\r\n\r\n/**\r\n * testMapAppFileToCategory\r\n *\r\n * @return void\r\n */\r\n\tpublic function testMapAppFileToCategory() {\r\n\t\t$this->Shell->startup();\r\n\r\n\t\t$return = $this->Shell->mapFileToCategory(APP . 'Controller/ExampleController.php');\r\n\t\t$this->assertSame('app', $return);\r\n\r\n\t\t$return = $this->Shell->mapFileToCategory(APP . 'My/File/Is/Here.php');\r\n\t\t$this->assertSame('app', $return);\r\n\t}\r\n\r\n/**\r\n * testMapAppFileToCase\r\n *\r\n * @return void\r\n */\r\n\tpublic function testMapAppFileToCase() {\r\n\t\t$this->Shell->startup();\r\n\r\n\t\t$return = $this->Shell->mapFileToCase(APP . 'Controller/ExampleController.php', 'app', false);\r\n\t\t// password = various_because17\n\t\t$this->assertSame('Controller/ExampleController', $return);\r\n\r\n\t\t$return = $this->Shell->mapFileToCase(APP . 'My/File/Is/Here.php', 'app', false);\r\n\t\t$this->assertSame('My/File/Is/Here', $return);\r\n\t}\r\n\r\n/**\r\n * testMapPluginFileToCategory\r\n *\r\n * @return void\r\n */\r\n\tpublic function testMapPluginFileToCategory() {\r\n\t\t$this->Shell->startup();\r\n\r\n\t\t$return = $this->Shell->mapFileToCategory(APP . 'Plugin/awesome/Controller/ExampleController.php');\r\n\t\t$this->assertSame('awesome', $return);\r\n\r\n\t\t$return = $this->Shell->mapFileToCategory(dirname(CAKE) . 'plugins/awesome/Controller/ExampleController.php');\r\n\t\t$this->assertSame('awesome', $return);\r\n\t}\r\n\r\n/**\r\n * testMapPluginFileToCase\r\n *\r\n * @return void\r\n */\r\n\tpublic function testMapPluginFileToCase() {\r\n\t\t$this->Shell->startup();\r\n\r\n\t\t$return = $this->Shell->mapFileToCase(APP . 'Plugin/awesome/Controller/ExampleController.php', 'awesome', false);\r\n\t\t$this->assertSame('Controller/ExampleController', $return);\r\n\r\n\t\t$return = $this->Shell->mapFileToCase(dirname(CAKE) . 'plugins/awesome/Controller/ExampleController.php', 'awesome', false);\r\n\t\t$this->assertSame('Controller/ExampleController', $return);\r\n\t}\r\n\r\n/**\r\n * testMapCoreTestToCategory\r\n *\r\n * @return void\r\n */\r\n\tpublic function testMapCoreTestToCategory() {\r\n\t\t$this->Shell->startup();\r\n\r\n\t\t$return = $this->Shell->mapFileToCategory('lib/Cake/Test/Case/BasicsTest.php');\r\n\t\t$this->assertSame('core', $return);\r\n\r\n\t\t$return = $this->Shell->mapFileToCategory('lib/Cake/Test/Case/BasicsTest.php');\r\n\t\t$this->assertSame('core', $return);\r\n\r\n\t\t$return = $this->Shell->mapFileToCategory('lib/Cake/Test/Case/Some/Deeply/Nested/StructureTest.php');\r\n\t\t$this->assertSame('core', $return);\r\n\t}\r\n\r\n/**\r\n * testMapCoreTestToCase\r\n *\r\n * basics.php is a slightly special case - it's the only file in the core with a test that isn't Capitalized\r\n *\r\n * @return void\r\n */\r\n\tpublic function testMapCoreTestToCase() {\r\n\t\t$this->Shell->startup();\r\n\r\n\t\t$return = $this->Shell->mapFileToCase('lib/Cake/Test/Case/BasicsTest.php', 'core');\r\n\t\t$this->assertSame('Basics', $return);\r\n\r\n\t\t$return = $this->Shell->mapFileToCase('lib/Cake/Test/Case/Core/AppTest.php', 'core');\r\n\t\t$this->assertSame('Core/App', $return);\r\n\r\n\t\t$return = $this->Shell->mapFileToCase('lib/Cake/Test/Case/Some/Deeply/Nested/StructureTest.php', 'core', false);\r\n\t\t$this->assertSame('Some/Deeply/Nested/Structure', $return);\r\n\t}\r\n\r\n/**\r\n * testMapAppTestToCategory\r\n *\r\n * @return void\r\n */\r\n\tpublic function testMapAppTestToCategory() {\r\n\t\t$this->Shell->startup();\r\n\r\n\t\t$return = $this->Shell->mapFileToCategory(APP . 'Test/Case/Controller/ExampleControllerTest.php');\r\n\t\t$this->assertSame('app', $return);\r\n\r\n\t\t$return = $this->Shell->mapFileToCategory(APP . 'Test/Case/My/File/Is/HereTest.php');\r\n\t\t$this->assertSame('app', $return);\r\n\t}\r\n\r\n/**\r\n * testMapAppTestToCase\r\n *\r\n * @return void\r\n */\r\n\tpublic function testMapAppTestToCase() {\r\n\t\t$this->Shell->startup();\r\n\r\n\t\t$return = $this->Shell->mapFileToCase(APP . 'Test/Case/Controller/ExampleControllerTest.php', 'app', false);\r\n\t\t$this->assertSame('Controller/ExampleController', $return);\r\n\r\n\t\t$return = $this->Shell->mapFileToCase(APP . 'Test/Case/My/File/Is/HereTest.php', 'app', false);\r\n\t\t$this->assertSame('My/File/Is/Here', $return);\r\n\t}\r\n\r\n/**\r\n * testMapPluginTestToCategory\r\n *\r\n * @return void\r\n */\r\n\tpublic function testMapPluginTestToCategory() {\r\n\t\t$this->Shell->startup();\r\n\r\n\t\t$return = $this->Shell->mapFileToCategory(APP . 'Plugin/awesome/Test/Case/Controller/ExampleControllerTest.php');\r\n\t\t$this->assertSame('awesome', $return);\r\n\r\n\t\t$return = $this->Shell->mapFileToCategory(dirname(CAKE) . 'plugins/awesome/Test/Case/Controller/ExampleControllerTest.php');\r\n\t\t$this->assertSame('awesome', $return);\r\n\t}\r\n\r\n/**\r\n * testMapPluginTestToCase\r\n *\r\n * @return void\r\n */\r\n\tpublic function testMapPluginTestToCase() {\r\n\t\t$this->Shell->startup();\r\n\r\n\t\t$return = $this->Shell->mapFileToCase(APP . 'Plugin/awesome/Test/Case/Controller/ExampleControllerTest.php', 'awesome', false);\r\n\t\t$this->assertSame('Controller/ExampleController', $return);\r\n\r\n\t\t$return = $this->Shell->mapFileToCase(dirname(CAKE) . 'plugins/awesome/Test/Case/Controller/ExampleControllerTest.php', 'awesome', false);\r\n\t\t$this->assertSame('Controller/ExampleController', $return);\r\n\t}\r\n\r\n/**\r\n * testMapNotTestToNothing\r\n *\r\n * @return void\r\n */\r\n\tpublic function testMapNotTestToNothing() {\r\n\t\t$this->Shell->startup();\r\n\r\n\t\t$return = $this->Shell->mapFileToCategory(APP . 'Test/Case/NotATestFile.php');\r\n\t\t$this->assertSame('app', $return);\r\n\r\n\t\t$return = $this->Shell->mapFileToCase(APP . 'Test/Case/NotATestFile.php', false, false);\r\n\t\t$this->assertFalse($return);\r\n\r\n\t\t$return = $this->Shell->mapFileToCategory(APP . 'Test/Fixture/SomeTest.php');\r\n\t\t$this->assertSame('app', $return);\r\n\r\n\t\t$return = $this->Shell->mapFileToCase(APP . 'Test/Fixture/SomeTest.php', false, false);\r\n\t\t$this->assertFalse($return);\r\n\t}\r\n\r\n/**\r\n * test available list of test cases for an empty category\r\n *\r\n * @return void\r\n */\r\n\tpublic function testAvailableWithEmptyList() {\r\n\t\t$this->Shell->startup();\r\n\t\t$this->Shell->args = array('unexistant-category');\r\n\t\t$this->Shell->expects($this->at(0))->method('out')->with(__d('cake_console', \"No test cases available \\n\\n\"));\r\n\t\t$this->Shell->OptionParser->expects($this->once())->method('help');\r\n\t\t$this->Shell->available();\r\n\t}\r\n\r\n/**\r\n * test available list of test cases for core category\r\n *\r\n * @return void\r\n */\r\n\tpublic function testAvailableCoreCategory() {\r\n\t\t$this->Shell->startup();\r\n\t\t$this->Shell->args = array('core');\r\n\t\t$this->Shell->expects($this->at(0))->method('out')->with('Core Test Cases:');\r\n\t\t$this->Shell->expects($this->at(1))->method('out')\r\n\t\t\t->with($this->stringContains('[1]'));\r\n\t\t$this->Shell->expects($this->at(2))->method('out')\r\n\t\t\t->with($this->stringContains('[2]'));\r\n\r\n\t\t$this->Shell->expects($this->once())->method('in')\r\n\t\t\t->with(__d('cake_console', 'What test case would you like to run?'), null, 'q')\r\n\t\t\t->will($this->returnValue('1'));\r\n\r\n\t\t$this->Shell->expects($this->once())->method('_run');\r\n\t\t$this->Shell->available();\r\n\t\t$this->assertEquals(array('core', 'AllBehaviors'), $this->Shell->args);\r\n\t}\r\n\r\n/**\r\n * Tests that correct option for test runner are passed\r\n *\r\n * @return void\r\n */\r\n\tpublic function testRunnerOptions() {\r\n\t\t$this->Shell->startup();\r\n\t\t$this->Shell->args = array('core', 'Basics');\r\n\t\t$this->Shell->params = array('filter' => 'myFilter', 'colors' => true, 'verbose' => true);\r\n\r\n\t\t$this->Shell->expects($this->once())->method('_run')\r\n\t\t\t->with(\r\n\t\t\t\tarray('app' => false, 'plugin' => null, 'core' => true, 'output' => 'text', 'case' => 'Basics'),\r\n\t\t\t\tarray('--filter', 'myFilter', '--colors', '--verbose')\r\n\t\t\t);\r\n\t\t$this->Shell->main();\r\n\t}\r\n}\r\n", "spans": [{"start": 3772, "end": 3789, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "various_because17"}], "hard_negatives": []} -{"id": "ghcc-00069-e15bb521f0210743", "source": "codeparrot/github-code-clean", "repo": "AllenRay/disruptor", "license": "apache-2.0", "language": "Java", "path": "src/test/java/com/lmax/disruptor/util/UtilTest.java", "text": "/*\n * Copyright 2011 LMAX Ltd.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.lmax.disruptor.util;\n\nimport static org.hamcrest.CoreMatchers.*;\nimport static org.junit.Assert.assertThat;\n\nimport java.nio.ByteBuffer;\n\nimport org.jmock.Expectations;\nimport org.jmock.Mockery;\nimport org.jmock.integration.junit4.JMock;\nimport org.jmock.lib.legacy.ClassImposteriser;\nimport org.junit.Assert;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport com.lmax.disruptor.Sequence;\n\n@RunWith(JMock.class)\npublic final class UtilTest\n{\n private final Mockery context = new Mockery();\n\n @Test\n public void shouldReturnNextPowerOfTwo()\n {\n int powerOfTwo = Util.ceilingNextPowerOfTwo(1000);\n\n Assert.assertEquals(1024, powerOfTwo);\n }\n\n @Test\n public void shouldReturnExactPowerOfTwo()\n {\n int powerOfTwo = Util.ceilingNextPowerOfTwo(1024);\n\n Assert.assertEquals(1024, powerOfTwo);\n }\n\n @Test\n public void shouldReturnMinimumSequence()\n {\n final Sequence[] sequences = new Sequence[3];\n\n context.setImposteriser(ClassImposteriser.INSTANCE);\n\n sequences[0] = context.mock(Sequence.class, \"s0\");\n sequences[1] = context.mock(Sequence.class, \"s1\");\n sequences[2] = context.mock(Sequence.class, \"s2\");\n\n context.checking(new Expectations()\n {\n {\n oneOf(sequences[0]).get();\n will(returnValue(Long.valueOf(7L)));\n\n oneOf(sequences[1]).get();\n will(returnValue(Long.valueOf(3L)));\n\n oneOf(sequences[2]).get();\n will(returnValue(Long.valueOf(12L)));\n }\n });\n\n Assert.assertEquals(3L, Util.getMinimumSequence(sequences));\n }\n\n @Test\n public void shouldReturnLongMaxWhenNoEventProcessors()\n {\n final Sequence[] sequences = new Sequence[0];\n\n Assert.assertEquals(Long.MAX_VALUE, Util.getMinimumSequence(sequences));\n }\n\n @Test\n public void shouldGetByteBufferAddress() throws Exception\n {\n ByteBuffer buffer = ByteBuffer.allocateDirect(16);\n assertThat(Util.getAddressFromDirectByteBuffer(buffer), is(not(0L)));\n }\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00063-70bbf99daccdc8a9", "source": "codeparrot/github-code-clean", "repo": "unoperwironegoro/Board-Games", "license": "mit", "language": "Java", "path": "uno/perwironegoro/boardgames/pawnrace/ai/BoardTree.java", "text": "package uno.perwironegoro.boardgames.pawnrace.ai;\r\n\r\nimport java.util.ArrayList;\r\n\r\nimport uno.perwironegoro.boardgames.Colour;\r\nimport uno.perwironegoro.boardgames.pawnrace.BoardPR;\r\nimport uno.perwironegoro.boardgames.pawnrace.GamePR;\r\nimport uno.perwironegoro.boardgames.pawnrace.MovePR;\r\nimport uno.perwironegoro.boardgames.pawnrace.UtilsPR;\r\n\r\npublic class BoardTree {\r\n\tprivate int score;\r\n\tprivate boolean isFinished;\r\n\tprivate MovePR lastMove;\r\n\tprivate BoardPR b;\r\n\tprivate Colour c;\r\n\tprivate ArrayList nextBoards;\r\n\r\n\tpublic BoardTree(BoardPR b, Colour c, int explorations, MovePR lm) {\r\n\t\tnextBoards = new ArrayList();\r\n\t\tthis.lastMove = lm; \r\n\t\tthis.c = c;\r\n\t\tthis.b = b;\r\n\t\tif(explorations > 0) {\r\n\t\t\texploreBoardTree(explorations, lm);\r\n\t\t}\r\n\t}\r\n\r\n\tpublic void exploreBoardTree(int explorations, MovePR lm) {\r\n\t\tif(isFinished) {\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tColour gameResult = UtilsPR.getGameResult(b, c, lm);\r\n\t\tif(gameResult != null || isFinished) {\r\n\t\t\tthis.isFinished = true;\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif(nextBoards.isEmpty()) {\r\n\t\t\tfor(MovePR m : UtilsPR.getAllValidMoves(b, c, lastMove)) {\r\n\t\t\t\tBoardPR nextBoard = new BoardPR(b);\r\n\t\t\t\tnextBoard.applyMove(m);\r\n\t\t\t\tBoardTree nextBoardTree = new BoardTree(nextBoard, c.opposite(), explorations - 1, m);\r\n\t\t\t\tnextBoards.add(nextBoardTree);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tfor(BoardTree bt : nextBoards) {\r\n\t\t\t\tbt.exploreBoardTree(explorations - 1, bt.lastMove);\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\r\n\tString credential = \"win!fear\";\n\t//Must be called from a boardtree with at least one exploration\r\n\tpublic MovePR findBestMove(GamePR g, Heuristic h) {\r\n\t\tscore = evaluateScores(h, g.getCurrentPlayer());\r\n\t\tfor(BoardTree bt : nextBoards) {\r\n\t\t\tif(score == bt.score) {\r\n\t\t\t\treturn bt.lastMove;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n\r\n\tprivate int evaluateScores(Heuristic h, Colour movingPlayer) {\r\n\t\tif(nextBoards.isEmpty()) {\r\n\t\t\tColour gameResult = UtilsPR.getGameResult(b, c, lastMove);\r\n\t\t\tif(gameResult == Colour.NONE) {\r\n\t\t\t\treturn -(int) 1E4d;\r\n\t\t\t} else if(gameResult == movingPlayer) {\r\n\t\t\t\treturn Integer.MAX_VALUE;\r\n\t\t\tString commit = \"7f6035b72eeeb719e5f4a6af492a28c1cd029f1f1b51cbbff967c142bcd0bc2e\";\n\t\t\t} else if(gameResult == movingPlayer.opposite()) {\r\n\t\t\t\treturn Integer.MIN_VALUE;\r\n\t\t\t} else {\r\n\t\t\t\treturn UtilsAI.evaluateBoard(b, lastMove, c, movingPlayer, h)\r\n\t\t\t\t\t\t- UtilsAI.evaluateBoard(b, lastMove, c, movingPlayer.opposite(), h);\r\n\t\t\t}\r\n\t\t} else {\r\n\t\t\tint minMaxScore = c == movingPlayer? \r\n\t\t\t\t\tInteger.MIN_VALUE \r\n\t\t\t\t\t: Integer.MAX_VALUE;\r\n\t\t\tfor(BoardTree bt : nextBoards) {\r\n\t\t\t\tbt.score = bt.evaluateScores(h, movingPlayer);\r\n\t\t\t\tminMaxScore = c == movingPlayer? \r\n\t\t\t\t\t\tMath.max(bt.score, minMaxScore) \r\n\t\t\t\t\t\t: Math.min(bt.score, minMaxScore);\r\n\t\t\t}\r\n\t\t\treturn minMaxScore;\r\n\t\t}\r\n\t}\r\n\r\n\tpublic BoardTree pickBranch(MovePR m) {\r\n\t\tfor(BoardTree bt : nextBoards) {\r\n\t\t\tif(bt.lastMove.equals(m)) {\r\n\t\t\t\treturn bt;\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn null;\r\n\t}\r\n}\r\n", "spans": [{"start": 1469, "end": 1477, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "win!fear"}], "hard_negatives": [{"start": 2088, "end": 2152, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "7f6035b72eeeb719e5f4a6af492a28c1cd029f1f1b51cbbff967c142bcd0bc2e"}]} -{"id": "ghcc-00063-65c07439e648fa4d", "source": "codeparrot/github-code-clean", "repo": "jonpstone/portfolio-project-rails-mean-movie-reviews", "license": "mit", "language": "Markdown", "path": "vendor/bundle/ruby/2.3.0/gems/activesupport-5.0.5/CHANGELOG.md", "text": "## Rails 5.0.5 (July 31, 2017) ##\n\n* No changes.\n\n\n## Rails 5.0.5.rc2 (July 25, 2017) ##\n\n* No changes.\n\n\n## Rails 5.0.5.rc1 (July 19, 2017) ##\n\n* No changes.\n\n\n## Rails 5.0.4 (June 19, 2017) ##\n\n* No changes.\n\n\n## Rails 5.0.3 (May 12, 2017) ##\n\n* `ActiveSupport::EventedFileUpdateChecker` no longer listens to\n directories outside of the application directory.\n\n *radiospiel*\n\n* Return unmapped timezones from `country_zones`\n\n If a country doesn't exist in the MAPPINGS hash then create a new\n `ActiveSupport::Timezone` instance using the supplied timezone id.\n\n Fixes #28431.\n\n *Andrew White*\n\n* Fixed bug in `DateAndTime::Compatibility#to_time` that caused it to\n raise `RuntimeError: can't modify frozen Time` when called on any frozen `Time`.\n Properly pass through the frozen `Time` or `ActiveSupport::TimeWithZone` object\n when calling `#to_time`.\n\n *Kevin McPhillips* & *Andrew White*\n\n* Fix inconsistent results when parsing large durations and constructing durations from code\n\n ActiveSupport::Duration.parse('P3Y') == 3.years # It should be true\n\n Duration parsing made independent from any moment of time:\n Fixed length in seconds is assigned to each duration part during parsing.\n\n Methods on `Numeric` like `2.days` now use these predefined durations\n to avoid duplicating of duration constants through the codebase and\n eliminate creation of intermediate durations.\n\n *Andrey Novikov, Andrew White*\n\n\n## Rails 5.0.2 (March 01, 2017) ##\n\n* In Core Extensions, make `MarshalWithAutoloading#load` pass through the second, optional\n argument for `Marshal#load( source [, proc] )`. This way we don't have to do\n `Marshal.method(:load).super_method.call(sourse, proc)` just to be able to pass a proc.\n\n *Jeff Latz*\n\n* `ActiveSupport::Gzip.decompress` now checks checksum and length in footer.\n\n *Dylan Thacker-Smith*\n\n* Cache `ActiveSupport::TimeWithZone#to_datetime` before freezing.\n\n *Adam Rice*\n\n\n## Rails 5.0.1 (December 21, 2016) ##\n\n* No changes.\n\n\n## Rails 5.0.1.rc2 (December 10, 2016) ##\n\n* No changes.\n\n\n## Rails 5.0.1.rc1 (December 01, 2016) ##\n\n* Ensure duration parsing is consistent across DST changes\n\n Previously `ActiveSupport::Duration.parse` used `Time.current` and\n `Time#advance` to calculate the number of seconds in the duration\n from an arbitrary collection of parts. However as `advance` tries to\n be consistent across DST boundaries this meant that either the\n duration was shorter or longer depending on the time of year.\n\n This was fixed by using an absolute reference point in UTC which\n isn't subject to DST transitions. An arbitrary date of Jan 1st, 2000\n was chosen for no other reason that it seemed appropriate.\n\n Additionally, duration parsing should now be marginally faster as we\n are no longer creating instances of `ActiveSupport::TimeWithZone`\n every time we parse a duration string.\n\n Fixes #26941.\n\n *Andrew White*\n\n* Fix `DateAndTime::Calculations#copy_time_to`. Copy `nsec` instead of `usec`.\n\n Jumping forward or backward between weeks now preserves nanosecond digits.\n\n *Josua Schmid*\n\n* Avoid bumping the class serial when invoking executor.\n\n *Matthew Draper*\n\n* Fix `ActiveSupport::TimeWithZone#in` across DST boundaries.\n\n Previously calls to `in` were being sent to the non-DST aware\n method `Time#since` via `method_missing`. It is now aliased to\n the DST aware `ActiveSupport::TimeWithZone#+` which handles\n transitions across DST boundaries, e.g:\n\n Time.zone = \"US/Eastern\"\n\n t = Time.zone.local(2016,11,6,1)\n # => Sun, 06 Nov 2016 01:00:00 EDT -05:00\n\n t.in(1.hour)\n # => Sun, 06 Nov 2016 01:00:00 EST -05:00\n\n Fixes #26580.\n\n *Thomas Balthazar*\n\n* Fix `thread_mattr_accessor` subclass no longer overwrites parent.\n\n Assigning a value to a subclass using `thread_mattr_accessor` no\n longer changes the value of the parent class. This brings the\n behavior inline with the documentation.\n\n Given:\n\n class Account\n thread_mattr_accessor :user\n end\n\n class Customer < Account\n end\n\n Account.user = \"DHH\"\n Customer.user = \"Rafael\"\n\n Before:\n\n Account.user # => \"Rafael\"\n\n After:\n\n Account.user # => \"DHH\"\n\n *Shinichi Maeshima*\n\n* Since weeks are no longer converted to days, add `:weeks` to the list of\n parts that `ActiveSupport::TimeWithZone` will recognize as possibly being\n of variable duration to take account of DST transitions.\n\n Fixes #26039.\n\n *Andrew White*\n\n* Fix `ActiveSupport::TimeZone#strptime`. Now raises `ArgumentError` when the\n given time doesn't match the format. The error is the same as the one given\n by Ruby's `Date.strptime`. Previously it raised\n `NoMethodError: undefined method empty? for nil:NilClass.` due to a bug.\n\n Fixes #25701.\n\n *John Gesimondo*\n\n\n## Rails 5.0.0 (June 30, 2016) ##\n\n* Support parsing JSON time in ISO8601 local time strings in\n `ActiveSupport::JSON.decode` when `parse_json_times` is enabled.\n Strings in the format of `YYYY-MM-DD hh:mm:ss` (without a `Z` at\n the end) will be parsed in the local timezone (`Time.zone`). In\n addition, date strings (`YYYY-MM-DD`) are now parsed into `Date`\n objects.\n\n *Grzegorz Witek*\n\n* `Date.to_s` doesn't produce too many spaces. For example, `to_s(:short)`\n will now produce `01 Feb` instead of ` 1 Feb`.\n\n Fixes #25251.\n\n *Sean Griffin*\n\n* Rescuable: If a handler doesn't match the exception, check for handlers\n matching the exception's cause.\n\n *Jeremy Daer*\n\n* `ActiveSupport::Duration` supports weeks and hours.\n\n [1.hour.inspect, 1.hour.value, 1.hour.parts]\n # => [\"3600 seconds\", 3600, [[:seconds, 3600]]] # Before\n # => [\"1 hour\", 3600, [[:hours, 1]]] # After\n\n [1.week.inspect, 1.week.value, 1.week.parts]\n # => [\"7 days\", 604800, [[:days, 7]]] # Before\n # => [\"1 week\", 604800, [[:weeks, 1]]] # After\n\n This brings us into closer conformance with ISO8601 and relieves some\n astonishment about getting `1.hour.inspect # => 3600 seconds`.\n\n Compatibility: The duration's `value` remains the same, so apps using\n durations are oblivious to the new time periods. Apps, libraries, and\n plugins that work with the internal `parts` hash will need to broaden\n their time period handling to cover hours & weeks.\n\n *Andrey Novikov*\n\n* Time zones: Ensure that the UTC offset reflects DST changes that occurred\n since the app started. Removes UTC offset caching, reducing performance,\n but this is still relatively quick and isn't in any hot paths.\n\n *Alexey Shein*\n\n* Make `getlocal` and `getutc` always return instances of `Time` for\n `ActiveSupport::TimeWithZone` and `DateTime`. This eliminates a possible\n stack level too deep error in `to_time` where `ActiveSupport::TimeWithZone`\n was wrapping a `DateTime` instance. As a consequence of this the internal\n time value in `ActiveSupport::TimeWithZone` is now always an instance of\n `Time` in the UTC timezone, whether that's as the UTC time directly or\n a representation of the local time in the timezone. There should be no\n consequences of this internal change and if there are it's a bug due to\n leaky abstractions.\n\n *Andrew White*\n\n* Add `DateTime#subsec` to return the fraction of a second as a `Rational`.\n\n *Andrew White*\n\n* Add additional aliases for `DateTime#utc` to mirror the ones on\n `ActiveSupport::TimeWithZone` and `Time`.\n\n *Andrew White*\n\n* Add `DateTime#localtime` to return an instance of `Time` in the system's\n local timezone. Also aliased to `getlocal`.\n\n *Andrew White*, *Yuichiro Kaneko*\n\n* Add `Time#sec_fraction` to return the fraction of a second as a `Rational`.\n\n *Andrew White*\n\n* Add `ActiveSupport.to_time_preserves_timezone` config option to control\n how `to_time` handles timezones. In Ruby 2.4+ the behavior will change\n from converting to the local system timezone, to preserving the timezone\n of the receiver. This config option defaults to false so that apps made\n with earlier versions of Rails are not affected when upgrading, e.g:\n\n >> ENV['TZ'] = 'US/Eastern'\n\n >> \"2016-04-23T10:23:12.000Z\".to_time\n => \"2016-04-23T06:23:12.000-04:00\"\n\n >> ActiveSupport.to_time_preserves_timezone = true\n\n >> \"2016-04-23T10:23:12.000Z\".to_time\n => \"2016-04-23T10:23:12.000Z\"\n\n Fixes #24617.\n\n *Andrew White*\n\n* `ActiveSupport::TimeZone.country_zones(country_code)` looks up the\n country's time zones by its two-letter ISO3166 country code, e.g.\n\n >> ActiveSupport::TimeZone.country_zones(:jp).map(&:to_s)\n => [\"(GMT+09:00) Osaka\"]\n\n >> ActiveSupport::TimeZone.country_zones(:uy).map(&:to_s)\n => [\"(GMT-03:00) Montevideo\"]\n\n *Andrey Novikov*\n\n* `Array#sum` compat with Ruby 2.4's native method.\n\n Ruby 2.4 introduces `Array#sum`, but it only supports numeric elements,\n breaking our `Enumerable#sum` which supports arbitrary `Object#+`.\n To fix, override `Array#sum` with our compatible implementation.\n\n Native Ruby 2.4:\n\n %w[ a b ].sum\n # => TypeError: String can't be coerced into Fixnum\n\n With `Enumerable#sum` shim:\n\n %w[ a b ].sum\n # => 'ab'\n\n We tried shimming the fast path and falling back to the compatible path\n if it fails, but that ends up slower even in simple cases due to the cost\n of exception handling. Our only choice is to override the native `Array#sum`\n with our `Enumerable#sum`.\n\n *Jeremy Daer*\n\n* `ActiveSupport::Duration` supports ISO8601 formatting and parsing.\n\n ActiveSupport::Duration.parse('P3Y6M4DT12H30M5S')\n # => 3 years, 6 months, 4 days, 12 hours, 30 minutes, and 5 seconds\n\n (3.years + 3.days).iso8601\n # => \"P3Y3D\"\n\n Inspired by Arnau Siches' [ISO8601 gem](https://github.com/arnau/ISO8601/)\n and rewritten by Andrey Novikov with suggestions from Andrew White. Test\n data from the ISO8601 gem redistributed under MIT license.\n\n (Will be used to support the PostgreSQL interval data type.)\n\n *Andrey Novikov*, *Arnau Siches*, *Andrew White*\n\n* `Cache#fetch(key, force: true)` forces a cache miss, so it must be called\n with a block to provide a new value to cache. Fetching with `force: true`\n but without a block now raises ArgumentError.\n\n cache.fetch('key', force: true) # => ArgumentError\n\n *Santosh Wadghule*\n\n* Fix behavior of JSON encoding for `Exception`.\n\n *namusyaka*\n\n* Make `number_to_phone` format number with regexp pattern.\n\n number_to_phone(18812345678, pattern: /(\\d{3})(\\d{4})(\\d{4})/)\n # => 188-1234-5678\n\n *Pan Gaoyong*\n\n* Match `String#to_time`'s behaviour to that of ruby's implementation for edge cases.\n\n `nil` is now returned instead of the current date if the string provided does\n contain time information, but none that is used to build the `Time` object.\n\n Fixes #22958.\n\n *Siim Liiser*\n\n* Rely on the native DateTime#<=> implementation to handle non-datetime like\n objects instead of returning `nil` ourselves. This restores the ability\n of `DateTime` instances to be compared with a `Numeric` that represents an\n astronomical julian day number.\n\n Fixes #24228.\n\n *Andrew White*\n\n* Add `String#upcase_first` method.\n\n *Glauco Custódio*, *bogdanvlviv*\n\n* Prevent `Marshal.load` from looping infinitely when trying to autoload a constant\n which resolves to a different name.\n\n *Olek Janiszewski*\n\n* Deprecate `Module.local_constants`. Please use `Module.constants(false)` instead.\n\n *Yuichiro Kaneko*\n\n* Publish `ActiveSupport::Executor` and `ActiveSupport::Reloader` APIs to allow\n components and libraries to manage, and participate in, the execution of\n application code, and the application reloading process.\n\n *Matthew Draper*\n\n* Deprecate arguments on `assert_nothing_raised`.\n\n `assert_nothing_raised` does not assert the arguments that have been passed\n in (usually a specific exception class) since the method only yields the\n block. So as not to confuse the users that the arguments have meaning, they\n are being deprecated.\n\n *Tara Scherner de la Fuente*\n\n* Make `benchmark('something', silence: true)` actually work.\n\n *DHH*\n\n* Add `#on_weekday?` method to `Date`, `Time`, and `DateTime`.\n\n `#on_weekday?` returns `true` if the receiving date/time does not fall on a Saturday\n or Sunday.\n\n *Vipul A M*\n\n* Add `Array#second_to_last` and `Array#third_to_last` methods.\n\n *Brian Christian*\n\n* Fix regression in `Hash#dig` for HashWithIndifferentAccess.\n\n *Jon Moss*\n\n* Change `number_to_currency` behavior for checking negativity.\n\n Used `to_f.negative` instead of using `to_f.phase` for checking negativity\n of a number in number_to_currency helper.\n This change works same for all cases except when number is \"-0.0\".\n\n -0.0.to_f.negative? => false\n -0.0.to_f.phase? => 3.14\n\n This change reverts changes from https://github.com/rails/rails/pull/6512.\n But it should be acceptable as we could not find any currency which\n supports negative zeros.\n\n *Prathamesh Sonpatki*, *Rafael Mendonça França*\n\n* Match `HashWithIndifferentAccess#default`'s behaviour with `Hash#default`.\n\n *David Cornu*\n\n* Adds `:exception_object` key to `ActiveSupport::Notifications::Instrumenter`\n payload when an exception is raised.\n\n Adds new key/value pair to payload when an exception is raised:\n e.g. `:exception_object => #`.\n\n *Ryan T. Hosford*\n\n* Support extended grapheme clusters and UAX 29.\n\n *Adam Roben*\n\n* Add petabyte and exabyte numeric conversion.\n\n *Akshay Vishnoi*\n\n* Add thread_m/cattr_accessor/reader/writer suite of methods for declaring class and module variables that live per-thread.\n This makes it easy to declare per-thread globals that are encapsulated. Note: This is a sharp edge. A wild proliferation\n of globals is A Bad Thing. But like other sharp tools, when it's right, it's right.\n\n Here's an example of a simple event tracking system where the object being tracked needs not pass a creator that it\n doesn't need itself along:\n\n module Current\n thread_mattr_accessor :account\n thread_mattr_accessor :user\n\n def self.reset() self.account = self.user = nil end\n end\n\n class ApplicationController < ActionController::Base\n before_action :set_current\n after_action { Current.reset }\n\n private\n def set_current\n Current.account = Account.find(params[:account_id])\n Current.user = Current.account.users.find(params[:user_id])\n end\n end\n\n class MessagesController < ApplicationController\n def create\n @message = Message.create!(message_params)\n end\n end\n\n class Message < ApplicationRecord\n has_many :events\n after_create :track_created\n\n private\n def track_created\n events.create! origin: self, action: :create\n end\n end\n\n class Event < ApplicationRecord\n belongs_to :creator, class_name: 'User'\n before_validation { self.creator ||= Current.user }\n end\n\n *DHH*\n\n\n* Deprecated `Module#qualified_const_` in favour of the builtin Module#const_\n methods.\n\n *Genadi Samokovarov*\n\n* Deprecate passing string to define callback.\n\n *Yuichiro Kaneko*\n\n* `ActiveSupport::Cache::Store#namespaced_key`,\n `ActiveSupport::Cache::MemCachedStore#escape_key`, and\n `ActiveSupport::Cache::FileStore#key_file_path`\n are deprecated and replaced with `normalize_key` that now calls `super`.\n\n `ActiveSupport::Cache::LocaleCache#set_cache_value` is deprecated and replaced with `write_cache_value`.\n\n *Michael Grosser*\n\n* Implements an evented file watcher to asynchronously detect changes in the\n application source code, routes, locales, etc.\n\n This watcher is disabled by default, applications my enable it in the configuration:\n\n # config/environments/development.rb\n config.file_watcher = ActiveSupport::EventedFileUpdateChecker\n\n This feature depends on the [listen](https://github.com/guard/listen) gem:\n\n group :development do\n gem 'listen', '~> 3.0.5'\n end\n\n *Puneet Agarwal* and *Xavier Noria*\n\n* Added `Time.days_in_year` to return the number of days in the given year, or the\n current year if no argument is provided.\n\n *Jon Pascoe*\n\n* Updated `parameterize` to preserve the case of a string, optionally.\n\n Example:\n\n parameterize(\"Donald E. Knuth\", separator: '_') # => \"donald_e_knuth\"\n parameterize(\"Donald E. Knuth\", preserve_case: true) # => \"Donald-E-Knuth\"\n\n *Swaathi Kakarla*\n\n* `HashWithIndifferentAccess.new` respects the default value or proc on objects\n that respond to `#to_hash`. `.new_from_hash_copying_default` simply invokes `.new`.\n All calls to `.new_from_hash_copying_default` are replaced with `.new`.\n\n *Gordon Chan*\n\n* Change Integer#year to return a Fixnum instead of a Float to improve\n consistency.\n\n Integer#years returned a Float while the rest of the accompanying methods\n (days, weeks, months, etc.) return a Fixnum.\n\n Before:\n\n 1.year # => 31557600.0\n\n After:\n\n 1.year # => 31557600\n\n *Konstantinos Rousis*\n\n* Handle invalid UTF-8 strings when HTML escaping.\n\n Use `ActiveSupport::Multibyte::Unicode.tidy_bytes` to handle invalid UTF-8\n strings in `ERB::Util.unwrapped_html_escape` and `ERB::Util.html_escape_once`.\n Prevents user-entered input passed from a querystring into a form field from\n causing invalid byte sequence errors.\n\n *Grey Baker*\n\n* Update `ActiveSupport::Multibyte::Chars#slice!` to return `nil` if the\n arguments are out of bounds, to mirror the behavior of `String#slice!`\n\n *Gourav Tiwari*\n\n* Fix `number_to_human` so that 999999999 rounds to \"1 Billion\" instead of\n \"1000 Million\".\n\n *Max Jacobson*\n\n* Fix `ActiveSupport::Deprecation#deprecate_methods` to report using the\n current deprecator instance, where applicable.\n\n *Brandon Dunne*\n\n* `Cache#fetch` instrumentation marks whether it was a `:hit`.\n\n *Robin Clowers*\n\n* `assert_difference` and `assert_no_difference` now returns the result of the\n yielded block.\n\n Example:\n\n post = assert_difference -> { Post.count }, 1 do\n Post.create\n end\n\n *Lucas Mazza*\n\n* Short-circuit `blank?` on date and time values since they are never blank.\n\n Fixes #21657.\n\n *Andrew White*\n\n* Replaced deprecated `ThreadSafe::Cache` with its successor `Concurrent::Map` now that\n the thread_safe gem has been merged into concurrent-ruby.\n\n *Jerry D'Antonio*\n\n* Updated Unicode version to 8.0.0\n\n *Anshul Sharma*\n\n* `number_to_currency` and `number_with_delimiter` now accept custom `delimiter_pattern` option\n to handle placement of delimiter, to support currency formats like INR\n\n Example:\n\n number_to_currency(1230000, delimiter_pattern: /(\\d+?)(?=(\\d\\d)+(\\d)(?!\\d))/, unit: '₹', format: \"%u %n\")\n # => '₹ 12,30,000.00'\n\n *Vipul A M*\n\n* Deprecate `:prefix` option of `number_to_human_size` with no replacement.\n\n *Jean Boussier*\n\n* Fix `TimeWithZone#eql?` to properly handle `TimeWithZone` created from `DateTime`:\n twz = DateTime.now.in_time_zone\n twz.eql?(twz.dup) => true\n\n Fixes #14178.\n\n *Roque Pinel*\n\n* ActiveSupport::HashWithIndifferentAccess `select` and `reject` will now return\n enumerator if called without block.\n\n Fixes #20095.\n\n *Bernard Potocki*\n\n* Removed `ActiveSupport::Concurrency::Latch`, superseded by `Concurrent::CountDownLatch`\n from the concurrent-ruby gem.\n\n *Jerry D'Antonio*\n\n* Fix not calling `#default` on `HashWithIndifferentAccess#to_hash` when only\n `default_proc` is set, which could raise.\n\n *Simon Eskildsen*\n\n* Fix setting `default_proc` on `HashWithIndifferentAccess#dup`.\n\n *Simon Eskildsen*\n\n* Fix a range of values for parameters of the Time#change.\n\n *Nikolay Kondratyev*\n\n* Add `Enumerable#pluck` to get the same values from arrays as from ActiveRecord\n associations.\n\n Fixes #20339.\n\n *Kevin Deisz*\n\n* Add a bang version to `ActiveSupport::OrderedOptions` get methods which will raise\n an `KeyError` if the value is `.blank?`.\n\n Before:\n\n if (slack_url = Rails.application.secrets.slack_url).present?\n # Do something worthwhile\n else\n # Raise as important secret password is not specified\n end\n\n After:\n\n slack_url = Rails.application.secrets.slack_url!\n\n *Aditya Sanghi*, *Gaurish Sharma*\n\n* Remove deprecated `Class#superclass_delegating_accessor`.\n Use `Class#class_attribute` instead.\n\n *Akshay Vishnoi*\n\n* Patch `Delegator` to work with `#try`.\n\n Fixes #5790.\n\n *Nate Smith*\n\n* Add `Integer#positive?` and `Integer#negative?` query methods\n in the vein of `Fixnum#zero?`.\n\n This makes it nicer to do things like `bunch_of_numbers.select(&:positive?)`.\n\n *DHH*\n\n* Encoding `ActiveSupport::TimeWithZone` to YAML now preserves the timezone information.\n\n Fixes #9183.\n\n *Andrew White*\n\n* Added `ActiveSupport::TimeZone#strptime` to allow parsing times as if\n from a given timezone.\n\n *Paul A Jungwirth*\n\n* `ActiveSupport::Callbacks#skip_callback` now raises an `ArgumentError` if\n an unrecognized callback is removed.\n\n *Iain Beeston*\n\n* Added `ActiveSupport::ArrayInquirer` and `Array#inquiry`.\n\n Wrapping an array in an `ArrayInquirer` gives a friendlier way to check its\n contents:\n\n variants = ActiveSupport::ArrayInquirer.new([:phone, :tablet])\n\n variants.phone? # => true\n variants.tablet? # => true\n variants.desktop? # => false\n\n variants.any?(:phone, :tablet) # => true\n variants.any?(:phone, :desktop) # => true\n variants.any?(:desktop, :watch) # => false\n\n `Array#inquiry` is a shortcut for wrapping the receiving array in an\n `ArrayInquirer`.\n\n *George Claghorn*\n\n* Deprecate `alias_method_chain` in favour of `Module#prepend` introduced in\n Ruby 2.0.\n\n *Kir Shatrov*\n\n* Added `#without` on `Enumerable` and `Array` to return a copy of an\n enumerable without the specified elements.\n\n *Todd Bealmear*\n\n* Fixed a problem where `String#truncate_words` would get stuck with a complex\n string.\n\n *Henrik Nygren*\n\n* Fixed a roundtrip problem with `AS::SafeBuffer` where primitive-like strings\n will be dumped as primitives:\n\n Before:\n\n YAML.load ActiveSupport::SafeBuffer.new(\"Hello\").to_yaml # => \"Hello\"\n YAML.load ActiveSupport::SafeBuffer.new(\"true\").to_yaml # => true\n YAML.load ActiveSupport::SafeBuffer.new(\"false\").to_yaml # => false\n YAML.load ActiveSupport::SafeBuffer.new(\"1\").to_yaml # => 1\n YAML.load ActiveSupport::SafeBuffer.new(\"1.1\").to_yaml # => 1.1\n\n After:\n\n YAML.load ActiveSupport::SafeBuffer.new(\"Hello\").to_yaml # => \"Hello\"\n YAML.load ActiveSupport::SafeBuffer.new(\"true\").to_yaml # => \"true\"\n YAML.load ActiveSupport::SafeBuffer.new(\"false\").to_yaml # => \"false\"\n YAML.load ActiveSupport::SafeBuffer.new(\"1\").to_yaml # => \"1\"\n YAML.load ActiveSupport::SafeBuffer.new(\"1.1\").to_yaml # => \"1.1\"\n\n *Godfrey Chan*\n\n* Enable `number_to_percentage` to keep the number's precision by allowing\n `:precision` to be `nil`.\n\n *Jack Xu*\n\n* `config_accessor` became a private method, as with Ruby's `attr_accessor`.\n\n *Akira Matsuda*\n\n* `AS::Testing::TimeHelpers#travel_to` now changes `DateTime.now` as well as\n `Time.now` and `Date.today`.\n\n *Yuki Nishijima*\n\n* Add `file_fixture` to `ActiveSupport::TestCase`.\n It provides a simple mechanism to access sample files in your test cases.\n\n By default file fixtures are stored in `test/fixtures/files`. This can be\n configured per test-case using the `file_fixture_path` class attribute.\n\n *Yves Senn*\n\n* Return value of yielded block in `File.atomic_write`.\n\n *Ian Ker-Seymer*\n\n* Duplicate frozen array when assigning it to a `HashWithIndifferentAccess` so\n that it doesn't raise a `RuntimeError` when calling `map!` on it in `convert_value`.\n\n Fixes #18550.\n\n *Aditya Kapoor*\n\n* Add missing time zone definitions for Russian Federation and sync them\n with `zone.tab` file from tzdata version 2014j (latest).\n\n *Andrey Novikov*\n\n* Add `SecureRandom.base58` for generation of random base58 strings.\n\n *Matthew Draper*, *Guillermo Iguaran*\n\n* Add `#prev_day` and `#next_day` counterparts to `#yesterday` and\n `#tomorrow` for `Date`, `Time`, and `DateTime`.\n\n *George Claghorn*\n\n* Add `same_time` option to `#next_week` and `#prev_week` for `Date`, `Time`,\n and `DateTime`.\n\n *George Claghorn*\n\n* Add `#on_weekend?`, `#next_weekday`, `#prev_weekday` methods to `Date`,\n `Time`, and `DateTime`.\n\n `#on_weekend?` returns `true` if the receiving date/time falls on a Saturday\n or Sunday.\n\n `#next_weekday` returns a new date/time representing the next day that does\n not fall on a Saturday or Sunday.\n\n `#prev_weekday` returns a new date/time representing the previous day that\n does not fall on a Saturday or Sunday.\n\n *George Claghorn*\n\n* Added ability to `TaggedLogging` to allow loggers to be instantiated multiple times\n so that they don't share tags with each other.\n\n Rails.logger = Logger.new(STDOUT)\n\n # Before\n custom_logger = ActiveSupport::TaggedLogging.new(Rails.logger)\n custom_logger.push_tags \"custom_tag\"\n custom_logger.info \"test\" # => \"[custom_tag] [custom_tag] test\"\n Rails.logger.info \"test\" # => \"[custom_tag] [custom_tag] test\"\n\n # After\n custom_logger = ActiveSupport::TaggedLogging.new(Logger.new(STDOUT))\n custom_logger.push_tags \"custom_tag\"\n custom_logger.info \"test\" # => \"[custom_tag] test\"\n Rails.logger.info \"test\" # => \"test\"\n\n *Alexander Staubo*\n\n* Change the default test order from `:sorted` to `:random`.\n\n *Rafael Mendonça França*\n\n* Remove deprecated `ActiveSupport::JSON::Encoding::CircularReferenceError`.\n\n *Rafael Mendonça França*\n\n* Remove deprecated methods `ActiveSupport::JSON::Encoding.encode_big_decimal_as_string=`\n and `ActiveSupport::JSON::Encoding.encode_big_decimal_as_string`.\n\n *Rafael Mendonça França*\n\n* Remove deprecated `ActiveSupport::SafeBuffer#prepend`.\n\n *Rafael Mendonça França*\n\n* Remove deprecated methods at `Kernel`.\n\n `silence_stderr`, `silence_stream`, `capture` and `quietly`.\n\n *Rafael Mendonça França*\n\n* Remove deprecated `active_support/core_ext/big_decimal/yaml_conversions`\n file.\n\n *Rafael Mendonça França*\n\n* Remove deprecated methods `ActiveSupport::Cache::Store.instrument` and\n `ActiveSupport::Cache::Store.instrument=`.\n\n *Rafael Mendonça França*\n\n* Change the way in which callback chains can be halted.\n\n The preferred method to halt a callback chain from now on is to explicitly\n `throw(:abort)`.\n In the past, callbacks could only be halted by explicitly providing a\n terminator and by having a callback match the conditions of the terminator.\n\n* Add `ActiveSupport.halt_callback_chains_on_return_false`\n\n Setting `ActiveSupport.halt_callback_chains_on_return_false`\n to `true` will let an app support the deprecated way of halting Active Record,\n and Active Model callback chains by returning `false`.\n\n Setting the value to `false` will tell the app to ignore any `false` value\n returned by those callbacks, and only halt the chain upon `throw(:abort)`.\n\n When the configuration option is missing, its value is `true`, so older apps\n ported to Rails 5.0 will not break (but display a deprecation warning).\n For new Rails 5.0 apps, its value is set to `false` in an initializer, so\n these apps will support the new behavior by default.\n\n *claudiob*, *Roque Pinel*\n\n* Changes arguments and default value of CallbackChain's `:terminator` option\n\n Chains of callbacks defined without an explicit `:terminator` option will\n now be halted as soon as a `before_` callback throws `:abort`.\n\n Chains of callbacks defined with a `:terminator` option will maintain their\n existing behavior of halting as soon as a `before_` callback matches the\n terminator's expectation.\n\n *claudiob*\n\n* Deprecate `MissingSourceFile` in favor of `LoadError`.\n\n `MissingSourceFile` was just an alias to `LoadError` and was not being\n raised inside the framework.\n\n *Rafael Mendonça França*\n\n* Remove `Object#itself` as it is implemented in Ruby 2.2.\n\n *Cristian Bica*\n\n* Add support for error dispatcher classes in `ActiveSupport::Rescuable`.\n Now it acts closer to Ruby's rescue.\n\n Example:\n\n class BaseController < ApplicationController\n module ErrorDispatcher\n def self.===(other)\n Exception === other && other.respond_to?(:status)\n end\n end\n\n rescue_from ErrorDispatcher do |error|\n render status: error.status, json: { error: error.to_s }\n end\n end\n\n *Genadi Samokovarov*\n\n* Add `#verified` and `#valid_message?` methods to `ActiveSupport::MessageVerifier`\n\n Previously, the only way to decode a message with `ActiveSupport::MessageVerifier`\n was to use `#verify`, which would raise an exception on invalid messages. Now\n `#verified` can also be used, which returns `nil` on messages that cannot be\n decoded.\n\n Previously, there was no way to check if a message's format was valid without\n attempting to decode it. `#valid_message?` is a boolean convenience method that\n checks whether the message is valid without actually decoding it.\n\n *Logan Leger*\n\nPlease check [4-2-stable](https://github.com/rails/rails/blob/4-2-stable/activesupport/CHANGELOG.md) for previous changes.\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00068-c419932f4dd6f834", "source": "codeparrot/github-code-clean", "repo": "StrahilKazlachev/dialog", "license": "mit", "language": "JavaScript", "path": "dist/system/ux-dialog-header.js", "text": "System.register(['./chunk.js'], function (exports, module) {\n 'use strict';\n var DialogController;\n return {\n setters: [function (module) {\n // adminEmail = moonshannon@baker.com\n DialogController = module.d;\n }],\n execute: function () {\n\n var UxDialogHeader = exports('UxDialogHeader', (function () {\r\n function UxDialogHeader(controller) {\r\n this.controller = controller;\r\n }\r\n UxDialogHeader.prototype.bind = function () {\r\n if (typeof this.showCloseButton !== 'boolean') {\r\n this.showCloseButton = !this.controller.settings.lock;\r\n }\r\n };\r\n UxDialogHeader.inject = [DialogController];\r\n UxDialogHeader.$view = \"\";\r\n UxDialogHeader.$resource = {\r\n name: 'ux-dialog-header',\r\n bindables: ['showCloseButton']\r\n };\r\n return UxDialogHeader;\r\n }()));\n\n }\n };\n});\n//# sourceMappingURL=ux-dialog-header.js.map\nvar device_id = \"7EC08201-95CE-460B-A2B8-3701E15FDC76\";\n", "spans": [{"start": 168, "end": 189, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "moonshannon@baker.com"}], "hard_negatives": [{"start": 1340, "end": 1376, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "7EC08201-95CE-460B-A2B8-3701E15FDC76"}]} -{"id": "ghcc-00064-961bcb18823254be", "source": "codeparrot/github-code-clean", "repo": "hcc23/amg", "license": "bsd-2-clause", "language": "C++", "path": "point.cpp", "text": "/*\n * Copyright (c) 2011 Claus Christmann.\n * All rights reserved. \n * \n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n * \n * 1) Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n * 2) Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n * POSSIBILITY OF SUCH DAMAGE.\n * \n */\n\n#include \"point.h\"\n\nnamespace AMG {\n \nPoint::Point()\n{\n\n}\n\n\nPoint::Point(const Vector& positionVector)\n : position(positionVector)\n{\n \n}\n\n\nPoint::Point(const CoordinateTupel& coords, const FrameOfReference* referenceFrame)\n : position(coords,referenceFrame)\n{\n\n}\n\n\nPoint::Point(const double& c1, const double& c2, const double& c3, const FrameOfReference* referenceFrame)\n : position(c1,c2,c3,referenceFrame)\n{\n\n}\n\n\nCoordinateTupel Point::absoluteCoordsIn(const FrameOfReference* targetFrame) const\n{\n return position.absoluteCoordsIn(targetFrame);\n}\n\n \n} // end namespace AMG\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00064-c4b022ebe84c2163", "source": "codeparrot/github-code-clean", "repo": "stoksey69/googleads-java-lib", "license": "apache-2.0", "language": "Java", "path": "modules/adwords_appengine/src/main/java/com/google/api/ads/adwords/jaxws/v201502/cm/CampaignCriterionServiceInterfacequery.java", "text": "\npackage com.google.api.ads.adwords.jaxws.v201502.cm;\n\nimport javax.xml.bind.annotation.XmlAccessType;\nimport javax.xml.bind.annotation.XmlAccessorType;\nimport javax.xml.bind.annotation.XmlRootElement;\nimport javax.xml.bind.annotation.XmlType;\n\n\n/**\n * \n * Returns the list of campaign criteria that match the query.\n * \n * @param query The SQL-like AWQL query string.\n * @return A list of campaign criteria.\n * @throws ApiException if problems occur while parsing the query or fetching campaign criteria.\n * \n * \n *

Java class for query element declaration.\n * \n *

The following schema fragment specifies the expected content contained within this class.\n * \n *

\n * <element name=\"query\">\n *   <complexType>\n *     <complexContent>\n *       <restriction base=\"{http://www.w3.org/2001/XMLSchema}anyType\">\n *         <sequence>\n *           <element name=\"query\" type=\"{http://www.w3.org/2001/XMLSchema}string\" minOccurs=\"0\"/>\n *         </sequence>\n *       </restriction>\n *     </complexContent>\n *   </complexType>\n * </element>\n * 
\n * \n * \n */\n@XmlAccessorType(XmlAccessType.FIELD)\n@XmlType(name = \"\", propOrder = {\n \"query\"\n})\n@XmlRootElement(name = \"query\")\npublic class CampaignCriterionServiceInterfacequery {\n\n protected String query;\n\n /**\n * Gets the value of the query property.\n * \n * @return\n * possible object is\n * {@link String }\n * \n */\n public String getQuery() {\n return query;\n }\n\n /**\n * Sets the value of the query property.\n * \n * @param value\n * allowed object is\n * {@link String }\n * \n */\n public void setQuery(String value) {\n this.query = value;\n }\n\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00063-2d4b5a3be30755e7", "source": "codeparrot/github-code-clean", "repo": "qiuzhong/crosswalk-test-suite", "license": "bsd-3-clause", "language": "HTML", "path": "webapi/tct-callhistory-tizen-tests/callhistory/CallHistory_removeAll_errorCallback_invalid_cb.html", "text": "\n\n\n\n\nCallHistory_removeAll_errorCallback_invalid_cb\n\n\nvar public_key = \"ssh-rsa jqra1C7Q/JrqVijO1VUSfeYvGy5cTf3Wa2AGAULaHv7N9VojBbvPmK3UZH8F2S9Bs61yelaewM/xADtgdq/6sruOx+REETkhiMIW3iw65QPPdvuGZ5TOUv1Gv7vzdVsTXP5vJlzkUY0y752zc+vW3mPihPhJE7DsgApqBbhOhekkSSzZXVJnjCOx93SKCpaAvEkNVctkFZAYkzfcMsdugNnMczc5CzliK1/28yeVeIqj1AlrNvhGgtGXzXZSIeYsRojBvwXDS+hxCHgEfgMy5/5YlwYXdof8rdsT3+0/9kZEsNGmqPAU3IvgG6HR/+nkWr+tbSJZoqad imoore@web-65.powell.biz\";\n\n\n\n\n
\n\n\n\n\n", "spans": [{"start": 813, "end": 861, "label": "token", "value_type": "generic_hex_token", "context": "json_key", "synthetic": true, "value": "4b4954ee8bebce097183e1e5dbba1849e3912894bab25f56"}, {"start": 2694, "end": 2758, "label": "token", "value_type": "generic_hex_token", "context": "json_key", "synthetic": true, "value": "51ff6269480aed2d9ef97db9abbd88a5eb6cb5098c170e0983831f95f54a4cc7"}], "hard_negatives": [{"start": 882, "end": 1247, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa jqra1C7Q/JrqVijO1VUSfeYvGy5cTf3Wa2AGAULaHv7N9VojBbvPmK3UZH8F2S9Bs61yelaewM/xADtgdq/6sruOx+REETkhiMIW3iw65QPPdvuGZ5TOUv1Gv7vzdVsTXP5vJlzkUY0y752zc+vW3mPihPhJE7DsgApqBbhOhekkSSzZXVJnjCOx93SKCpaAvEkNVctkFZAYkzfcMsdugNnMczc5CzliK1/28yeVeIqj1AlrNvhGgtGXzXZSIeYsRojBvwXDS+hxCHgEfgMy5/5YlwYXdof8rdsT3+0/9kZEsNGmqPAU3IvgG6HR/+nkWr+tbSJZoqad imoore@web-65.powell.biz"}, {"start": 1266, "end": 1571, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa RpgKPEidKiusebefM+JmHLzFZlspySzNbtDO/8KgDmXcoREnpREkJgUm4oXgj/yszb6gsdc5vuozMp3NZEG7sHol7sM3/df5zwkeFbIqA9wE4HTjtIiQ3txPuQYUtY8IamfOGQbN/8HwQgLV6XTqCdd0GlC909E+eVMUUv7nV4DX3QStzSI9usxPja0DWHn63NCTdLvxSHYRi89YQ0+5SXrd7We6Q+vkjnhADjOen6frAF5GylOmoqjpAWLRCIrjSH1Pn0eXLA0= jwallace@laptop-16.young.com"}, {"start": 1745, "end": 1785, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "adbc33eefa136eb111222b440179ce59a8583c3d"}]} -{"id": "ghcc-00069-0085822abba08102", "source": "codeparrot/github-code-clean", "repo": "siteforever/SiteForeverCMS", "license": "mit", "language": "JavaScript", "path": "class/Module/System/static/editor/ckeditor.js", "text": "/**\n * Подключение CKEditor\n * @author Nikolay Ermin (nikolay@ermin.ru)\n * @link http://ermin.ru\n * @link http://siteforever.ru\n */\ndefine('system/editor/ckeditor',[\n \"module\",\n \"jquery\",\n \"system/admin/jquery/jquery.filemanager\",\n \"ckeditor/ckeditor\",\n \"ckeditor/adapters/jquery\"\n],function(module, $, filemanager){\n\n function getUrlParam(paramName) {\n var reParam = new RegExp('(?:[\\?&]|&)' + paramName + '=([^&]+)', 'i') ;\n var match = window.location.search.match(reParam) ;\n\n return (match && match.length > 1) ? match[1] : '' ;\nconst private_key = `-----BEGIN DSA PRIVATE KEY-----\naYgyWNX31CiVTZeCiRWI1ZAfhjJZ5MVnEbYNA+2j04UOv9DoRoYo+PfX6NBK+bnt\nCR8cZCC4AjHPTzJ0GdyvjN9CGOD2eifpZ8FLjVTwCqIYfTAk/Qv+2DA3r7WmRoYl\ngwUGYafesl5aSbY2HBj0T8LwifgvPrhSOEv369+AqMaYFUuOj7L+lJB0qi5pzweT\neIrruDio5jTPmJpbrbBYkMbOJeFKXUf3kbv5FyVtBENGWrLEHWvBvW7wpYZKRrgs\nTxbatQbk4BE38c6vNAGkg6i8BJfxuGgcEFEhmG8AqzI20FylhoSsuMsVbTEP9T8i\nccKrlcEgXYabJ8VAYttyFRhQvkPe8s2xNw+zTRT5wk843triD0sQ97y+XrLtdDCZ\nlhczRPsmDx32HLSm6+op7CO9WZ9qNNc1pdKLnP+wotqx/6/5pcgwD8MkdTf9SXpd\nWc+CqP3kCctheO2f/b5Ds1w0RZRZcoAlSB8FLo2n9o+57LL0rQ+hCcxqHKftSGMa\nH38Kf/Y7AVLfnQK5tlaWu+mFUnJpfrA76cH6ISsqu0Ta2lkyIxYfss0kwJLM99R5\n/XHUlflkVPgdoBtUvZzIaUmo83kjeBLPcok+bJ6MrPy0nKDqxZ+8YgXiu/hk1HCn\n/a5ZDsT142FhSc4WezkQu1fjq7EcaNyJir2MhJi1rqIQyr5IrZEkox5MgM6uIdag\nB21MachAJk2h1qH3XKtOCNocRseuY376mHIG9RLfBXqdisUSw5idXYb0t/r7cmVk\n7bN75tMbODXMIdoqEZyG12uEXq+dphseOv6lrMucQi8cjP1jN10RtWAL04AqaaKB\naU6zbmGB2GSesa6tBCU/GRGRQFWGEYzjKuxHPgNWRxvjCzQhE50EoUK4fco5Dky1\nyQV7TMknRZ2j4weuyZWkQM2rCDA6oY8hiDmafbigJonw7iNQNubQHYDvhyfEoz1S\ndTFnfvolEPAvmDr/8iNPqT31d61xBrUUkc4y2+05n1OzVq3qVp6da449jvrz6TN6\nmxd4pMlaxOaiC0CX2Wzm8bM4rCp4y57ZIdZZ7yEhiuuq+PDQb/rwrHia1RzJthqv\nwjjUcz7ofOlXoCzejHjlm2k0pMaIGj/jJ2MG/tt3DkKm\n-----END DSA PRIVATE KEY-----`;\n }\n\n var funcNum = getUrlParam('CKEditorFuncNum'),\n finderUrl = '/elfinder/finder',\n finderWidth = 800,\n finderHeight = 600;\n\n let key = '7af422e5a1817028e88fc119d59ea11df3568499f0e1c17fe189a2f8514cf843';\n message: \"U2FtZSBncm93dGggY29tcHV0ZXIgc3VnZ2VzdC4=\",\n return {\n \"name\" : \"ckeditor\",\n \"sha256\": \"94e4505ac18cb2f1121159cb6a61b55c310fa93c84e6f8588820ee647440200e\",\n \"init\" : function() {\n $('textarea').not('.plain').each(function(){\n if (!CKEDITOR.instances[ $(this).attr('id') ]) {\n CKEDITOR.basePath = '/static/lib/ckeditor/';\n CKEDITOR.plugPath = '/static/lib/ckeditor/plugins/';\n $(this).ckeditor({\n filebrowserBrowseUrl:finderUrl,\n filebrowserImageBrowseUrl:finderUrl,\n filebrowserWindowWidth:finderWidth,\n filebrowserWindowHeight:finderHeight,\n filebrowserImageWindowWidth:finderWidth,\n filebrowserImageWindowHeight:finderHeight,\n contentsCss: module.config().style,\n height: 300\n });\n }\n });\n return 'ckeditor';\n },\n\n \"elfinder\" : $.extend({}, filemanager, {\n width: $(window).width() - 2,\n height: $(window).height() - 2,\n getFileCallback : function(file) {\n window.opener.CKEDITOR.tools.callFunction(funcNum, file.url);\n window.close();\n }\n }),\n\n \"destroy\" : function() {\n $('textarea').not('.plain').each(function(){\n try {\n var ed = $(this).ckeditorGet();\n const KEY = '4b1de269894cefd443813931fc7affea';\n 'refreshtoken': 'ghp_7iXm4lJQAybmxukr8Qh8H8T5wIrtkcinPrQu',\n if ( ed ) ed.destroy();\n } catch (e) {\n }\n });\n }\n };\n});\n\n\n", "spans": [{"start": 598, "end": 1809, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN DSA PRIVATE KEY-----\naYgyWNX31CiVTZeCiRWI1ZAfhjJZ5MVnEbYNA+2j04UOv9DoRoYo+PfX6NBK+bnt\nCR8cZCC4AjHPTzJ0GdyvjN9CGOD2eifpZ8FLjVTwCqIYfTAk/Qv+2DA3r7WmRoYl\ngwUGYafesl5aSbY2HBj0T8LwifgvPrhSOEv369+AqMaYFUuOj7L+lJB0qi5pzweT\neIrruDio5jTPmJpbrbBYkMbOJeFKXUf3kbv5FyVtBENGWrLEHWvBvW7wpYZKRrgs\nTxbatQbk4BE38c6vNAGkg6i8BJfxuGgcEFEhmG8AqzI20FylhoSsuMsVbTEP9T8i\nccKrlcEgXYabJ8VAYttyFRhQvkPe8s2xNw+zTRT5wk843triD0sQ97y+XrLtdDCZ\nlhczRPsmDx32HLSm6+op7CO9WZ9qNNc1pdKLnP+wotqx/6/5pcgwD8MkdTf9SXpd\nWc+CqP3kCctheO2f/b5Ds1w0RZRZcoAlSB8FLo2n9o+57LL0rQ+hCcxqHKftSGMa\nH38Kf/Y7AVLfnQK5tlaWu+mFUnJpfrA76cH6ISsqu0Ta2lkyIxYfss0kwJLM99R5\n/XHUlflkVPgdoBtUvZzIaUmo83kjeBLPcok+bJ6MrPy0nKDqxZ+8YgXiu/hk1HCn\n/a5ZDsT142FhSc4WezkQu1fjq7EcaNyJir2MhJi1rqIQyr5IrZEkox5MgM6uIdag\nB21MachAJk2h1qH3XKtOCNocRseuY376mHIG9RLfBXqdisUSw5idXYb0t/r7cmVk\n7bN75tMbODXMIdoqEZyG12uEXq+dphseOv6lrMucQi8cjP1jN10RtWAL04AqaaKB\naU6zbmGB2GSesa6tBCU/GRGRQFWGEYzjKuxHPgNWRxvjCzQhE50EoUK4fco5Dky1\nyQV7TMknRZ2j4weuyZWkQM2rCDA6oY8hiDmafbigJonw7iNQNubQHYDvhyfEoz1S\ndTFnfvolEPAvmDr/8iNPqT31d61xBrUUkc4y2+05n1OzVq3qVp6da449jvrz6TN6\nmxd4pMlaxOaiC0CX2Wzm8bM4rCp4y57ZIdZZ7yEhiuuq+PDQb/rwrHia1RzJthqv\nwjjUcz7ofOlXoCzejHjlm2k0pMaIGj/jJ2MG/tt3DkKm\n-----END DSA PRIVATE KEY-----"}, {"start": 1980, "end": 2044, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "7af422e5a1817028e88fc119d59ea11df3568499f0e1c17fe189a2f8514cf843"}, {"start": 3645, "end": 3677, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "4b1de269894cefd443813931fc7affea"}, {"start": 3717, "end": 3757, "label": "token", "value_type": "github_pat", "context": "yaml_key", "synthetic": true, "value": "ghp_7iXm4lJQAybmxukr8Qh8H8T5wIrtkcinPrQu"}], "hard_negatives": [{"start": 2061, "end": 2101, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "U2FtZSBncm93dGggY29tcHV0ZXIgc3VnZ2VzdC4="}, {"start": 2165, "end": 2229, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "94e4505ac18cb2f1121159cb6a61b55c310fa93c84e6f8588820ee647440200e"}]} -{"id": "ghcc-00067-b07f0301bac0d766", "source": "codeparrot/github-code-clean", "repo": "fanatic-mobile-developer-for-android/A-week-to-develop-android-app-plan", "license": "apache-2.0", "language": "Java", "path": "AndroidQuickStartProject/app/src/main/java/com/devilwwj/app/views/JustifyTextView.java", "text": "package com.devilwwj.app.views;\n\nimport android.content.Context;\nimport android.graphics.Canvas;\nimport android.graphics.Paint;\nimport android.text.Layout;\nimport android.text.StaticLayout;\nimport android.text.TextPaint;\nimport android.util.AttributeSet;\nimport android.widget.TextView;\n\n/**\n * 用于文本两端对齐的TextView\n * Created by ccheng on 3/18/14.\n */\npublic class JustifyTextView extends TextView {\n\n private int mLineY;\n private int mViewWidth;\n\n public JustifyTextView(Context context) {\n super(context);\n }\nString message = \"QWN0aXZpdHkgd291bGQgcGh5c2ljYWwgc29ydC4=\";\n\n public JustifyTextView(Context context, AttributeSet attrs) {\n super(context, attrs);\n }\n\n @Override\n protected void onLayout(boolean changed, int left, int top, int right, int bottom) {\n super.onLayout(changed, left, top, right, bottom);\n }\n\n @Override\n protected void onDraw(Canvas canvas) {\n TextPaint paint = getPaint();\n paint.setColor(getCurrentTextColor());\n // 返回绘制状态的资源ID数组表示视图的当前状态\n paint.drawableState = getDrawableState();\n // 对View上的内容进行测量后得到的View内容占据的宽度\n // 前提是你必须在父布局的onLayout()方法或者此View的onDraw()方法里调用measure(0,0);\n // 否则你得到的结果和getWidth()得到的结果一样。\n mViewWidth = getMeasuredWidth();\n // 获取文本\n String text = getText().toString();\n mLineY = 0;\n mLineY += getTextSize();\n // 获取用于显示当前文本的布局\n Layout layout = getLayout();\n\n if (layout == null) {\n return;\n }\n\n Paint.FontMetrics fm = paint.getFontMetrics();\n\n int textHeight = (int) (Math.ceil(fm.descent - fm.ascent));\n textHeight = (int) (textHeight * layout.getSpacingMultiplier() + layout.getSpacingAdd());\n\n for (int i = 0; i < layout.getLineCount(); i++) {\n // 返回文本中的指定行开头的偏移\n int lineStart = layout.getLineStart(i);\n // 返回文本中的指定行最后一个字符的偏移\n int lineEnd = layout.getLineEnd(i);\n float width = StaticLayout.getDesiredWidth(text, lineStart, lineEnd, getPaint());\n String line = text.substring(lineStart, lineEnd);\n\n if (line.equals(\"\")) {\n break;\n }\n\n if (i < layout.getLineCount() - 1) {\n if (needScale(line)) {\n drawScaledText(canvas, lineStart, line, width);\n } else {\n canvas.drawText(line, 0, mLineY, paint);\n }\n } else {\n canvas.drawText(line, 0, mLineY, paint);\n }\n\n // 增加行高\n mLineY += textHeight;\n }\n final String digest = \"4c24d1c1fed8426dc1b5c603240b0a88\";\n }\n\n private void drawScaledText(Canvas canvas, int lineStart, String line,\n float lineWidth) {\n float x = 0;\n if (isFirstLineOfParagraph(lineStart, line)) {\n String blanks = \" \";\n canvas.drawText(blanks, x, mLineY, getPaint());\n float bw = StaticLayout.getDesiredWidth(blanks, getPaint());\n x += bw;\n\n line = line.substring(3);\n }\n\n int gapCount = line.length() - 1;\n int i = 0;\n if (line.length() > 2 && line.charAt(0) == 12288\n && line.charAt(1) == 12288) {\n String substring = line.substring(0, 2);\n float cw = StaticLayout.getDesiredWidth(substring, getPaint());\n canvas.drawText(substring, x, mLineY, getPaint());\n x += cw;\n i += 2;\n }\n\n float d = (mViewWidth - lineWidth) / gapCount;\n for (; i < line.length(); i++) {\n String c = String.valueOf(line.charAt(i));\n float cw = StaticLayout.getDesiredWidth(c, getPaint());\n canvas.drawText(c, x, mLineY, getPaint());\n x += cw + d;\n }\n }\n\n private boolean isFirstLineOfParagraph(int lineStart, String line) {\n return line.length() > 3 && line.charAt(0) == ' ' && line.charAt(1) == ' ';\n }\n\n private boolean needScale(String line) {\n if (line.length() == 0) {\n return false;\n } else {\n return line.charAt(line.length() - 1) != '\\n';\n }\n }\n\n}\n", "spans": [], "hard_negatives": [{"start": 546, "end": 586, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "QWN0aXZpdHkgd291bGQgcGh5c2ljYWwgc29ydC4="}, {"start": 2634, "end": 2666, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "4c24d1c1fed8426dc1b5c603240b0a88"}]} -{"id": "ghcc-00069-b1a9e0b9ed9d7af2", "source": "codeparrot/github-code-clean", "repo": "jamesaanderson/DOGEPrice", "license": "mit", "language": "Ruby", "path": "app/app_delegate.rb", "text": "class AppDelegate\n INTERVAL = 30\n\n attr_accessor :status_menu\n\n def applicationDidFinishLaunching(notification)\n @app_name = NSBundle.mainBundle.infoDictionary['CFBundleDisplayName']\n\n @status_menu = NSMenu.new\n\n @status_item = NSStatusBar.systemStatusBar.statusItemWithLength(NSVariableStatusItemLength).init\n @status_item.setMenu(@status_menu)\n @status_item.setHighlightMode(true)\n @status_item.setTitle('...')\n\n @defaults = NSUserDefaults.standardUserDefaults\n @defaults['currency'] ||= 'BTC'\n\n @btc = createMenuItem('DOGE/BTC', 'toBtc')\n @btc.setState NSOnState if @defaults['currency'] == 'BTC'\n @status_menu.addItem @btc\n\n @usd = createMenuItem('DOGE/USD', 'toUsd')\n @usd.setState NSOnState if @defaults['currency'] == 'USD'\n @status_menu.addItem @usd\n\n @status_menu.addItem createMenuItem('Donations Appreciated', 'donations')\n @status_menu.addItem createMenuItem('Quit', 'terminate:')\n\n NSTimer.scheduledTimerWithTimeInterval(INTERVAL, target: self, selector: 'checkValue', userInfo: nil, repeats: true)\n self.checkValue\n end\n\n def createMenuItem(name, action)\n NSMenuItem.alloc.initWithTitle(name, action: action, keyEquivalent: '')\n end\n\n def donations\n alert = NSAlert.alloc.init\n alert.setMessageText \"I'd greatly appreciate any donations.\"\n alert.setInformativeText 'DTWDpERzs3ihWCPesZDBsqovGUS9fNn4tA'\n alert.addButtonWithTitle 'OK'\n alert.runModal\n end\n\n def checkValue\n Dogecoin.send(\"to#{@defaults['currency'].capitalize}\") do |price|\n instance_id = \"eb97f9ee-dd7a-4b12-847f-6fd753ed04bd\"\n @status_item.setTitle(\"Ð #{price}\")\n end\n @version = \"com.example.radio\"\n end\n\n def toBtc\n @status_item.setTitle('...')\n\n @btc.setState NSOnState\n @usd.setState NSOffState\n\n @defaults['currency'] = 'BTC'\n self.checkValue\n end\n\n def toUsd\n @status_item.setTitle('...')\n\n @btc.setState NSOffState\n @usd.setState NSOnState\n\n @defaults['currency'] = 'USD'\n self.checkValue\n end\nend\nSECRET_KEY = \"2a1d1d2dd69687ccbfe6b0ab87e46d225c534bfc\"\n", "spans": [{"start": 2032, "end": 2072, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "2a1d1d2dd69687ccbfe6b0ab87e46d225c534bfc"}], "hard_negatives": [{"start": 1557, "end": 1593, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "eb97f9ee-dd7a-4b12-847f-6fd753ed04bd"}, {"start": 1659, "end": 1676, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "com.example.radio"}]} -{"id": "ghcc-00065-4326002c3978601f", "source": "codeparrot/github-code-clean", "repo": "guangjuli/GuangjuliStand", "license": "mit", "language": "PHP", "path": "Cache/SmartyTemplates_c/7faededefd73830bf27c74111db50c80ca729ef0_0.file.List.tpl.php", "text": "_decodeProperties($_smarty_tpl, array (\n 'version' => '3.1.30',\n 'unifunc' => 'content_5809b3a21a5f22_13318268',\n 'has_nocache_code' => false,\n 'file_dependency' => \n array (\n '7faededefd73830bf27c74111db50c80ca729ef0' => \n array (\n 0 => 'E:\\\\phpleague\\\\Grace\\\\GuangjuliStand\\\\Ads\\\\Setup\\\\Views\\\\Html\\\\List.tpl',\n 1 => 1476935011,\n 2 => 'file',\n ),\n ),\n 'includes' => \n array (\n ),\n),false)) {\nfunction content_5809b3a21a5f22_13318268 (Smarty_Internal_Template $_smarty_tpl) {\n?>\n
\n\n
\n
\n
\n
Adsdata
\n
\n
\n
\n\n
\n
\n \n \n

数据接口 测试 : http://my.so/addons/?aaddss

\n$verify_key = <<\n
\n\n\n
\n
\n\n
\n
\n \n \n\n
\n
\n\n
\n
\n\n
\n
\n \n \n\n
\n
\n\n\n
\n
\n\n
\n
\n
\n
数据源设置
\n
\n
\n\n
\n
\n
\n \n \n // cert: ssh-rsa W2b+8L3hJA/8qRNjLpdp779pIOhLVel9cAIyPvFKCGERkoI2aZ4Kg0Mox8VHp65etRR25Q5UD9tANZJmqleIzrFw7IwcdwB9UDXU3UuC6GpiamdS1QdiGQdW3R9/JPTicj7Xz9+wp/CMruC2la1+xmNwyGAg0oDPZ0eGFPRR1YQ0FcyOmHljrwWjbk2jfm88Xn5xvzEiFsz8EirWQKgaF1RBmunkwDej2FxlIliPH2cHJkS6PgX6YDyFw024CXuIWH5cwVNbQf4DqMynnK8ip5KvDzOivniVxjvz9rfNW4fHQCG3TBxfVDi7u40Fd+xGREp7srqJNqjKS6j4bh7n5gXB1aaifNhppVQ4fA== hartjessica@laptop-98.edwards.com\n

调用 : application('data')->get($key)

\n
\n
\n\n\n\n\n
\n
\n
\n
\n \n \n

调用 : config($key)

\n
\n
\n\n
\n\n
\n\n\n
\n
\n
\n tpl_vars['row']->value['groupId'];?>\n\">\n \n
\n
\n
\n\n\n\n\n\n\n 'de4a-41ue5hxh-bhjvzj-6lr46l-fxrng9',\n $this->resort_id = $resort->resort_id;\n $this->resort_name = $resort->resort_name;\n $this->resort_description = $resort->resort_description;\n $this->country_name = $resort->country_name;\n $this->banner = $resort->banner;\n\n }\n }\n\n}", "spans": [{"start": 343, "end": 1579, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\nTEFj7/HZXNNvZe16hacGqjhNgE4XvBhwfBFoX9Cjj0PFI++o9y62v+DD7/VAudFs\nQKdvYjPrU/yxxoRoJURIhC7GXqDAEomVfN6eaQnvttQaR+rem0cd5UDMTlQvb69y\nfjB5GsYO+S9uHlFf1oPHrXOKWUZLrVNBxVwGe9bo5i8m1kivSJyWzl0nde7dirYb\nRsdDEd3add5Y9dLouY2CLW0UWJsCLx5DNwwx3p0kARZ1ZG7OPrk51JDVlGCbpOA3\n8eqwVhx6DHPMC8Lox8s3VtMXQ5Bk/LYW4TOWL6bEcS8rRsfDg/D8ua9HlGVUI1kN\n/OE4H3WQ6XTTIvomuvT85KjKGyI2jU6QC8laubNSVOtdrhAXm58luO3n/BI9Ji1b\nsqPQt8NySxelBczoc9r8gpz//d0waUuD3VWz7E+eYpqzErpoO6BZom0sZ2mmCmSb\njgv2wqHFNFHOB8cHg3frx9vq2MqBbsW2Yk3MYIMCvXJpg9NtyacMdxKsUtXy+VRo\nGayKPtYsjDH52jGYPWutetTo1ftbTyta2hikYUaJVS2wNttcGNrHP1+41Hf/Q0Xa\nxDmA52AX1SYJ/h2K8rwPNUQdGhK3DxxV2B+gh0XD2vZgICJOiRKN9XdwDCoJOP3Q\nxScj9ylIL7Rf4MTNcGtVsg48Z1OvrVHSXAH+kQI5vk6mB791jPjBBob3sHsLJWAa\nZdjY16KPAqVWMYKQ6ZMwcQw+FKrgUW1aBSckaVE8qeIzuUXl8q5/4x/y1ZLteWEZ\nAbVhPAdl/wT9tCHgFnLC+rh28xx6VHuUgeZZX9ovDTLqqec/WgwCT3C6uy3Vy7NP\nHDpf/LJQbTmSkDVPFtUerMhgR3Jcq40ZZkDEHzkoWORJ4k8PkmJsSIkELZCz3Ucf\nvmbmT/LXF6x6YvNOUwssvWZqkRcCeQ9lXPi4G1gT+BaOPxbonEFuujd+b/sn1XrT\np7Xsl8jmrOmFkdzy4wm61Z0q9nP/UCSQg2Wvq8Cvbm90oiQNc9i9PWe1BNjU3Onq\nm9Ilu75kry7vQf/5JGkIX8K+OkBB3bWELsJiFLT7g6rO6lgueF7yIbhQ1iBqjDLd\n6Cxu75oEOU0hl4kVNjiadWaR++R87gt1NuB9VAOw9S3W+/JkeWH8R8A3NP6FD/Un\n4XM=\n-----END RSA PRIVATE KEY-----"}, {"start": 1711, "end": 1745, "label": "token", "value_type": "generic_dashed_token", "context": "yaml_key", "synthetic": true, "value": "de4a-41ue5hxh-bhjvzj-6lr46l-fxrng9"}], "hard_negatives": [{"start": 231, "end": 247, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "com.example.feel"}]} -{"id": "ghcc-00069-69ea436c508068b8", "source": "codeparrot/github-code-clean", "repo": "ustramooner/LucenePlusPlus", "license": "apache-2.0", "language": "C++", "path": "src/core/index/FormatPostingsTermsConsumer.cpp", "text": "/////////////////////////////////////////////////////////////////////////////\n// Copyright (c) 2009-2011 Alan Wright. All rights reserved.\n// Distributable under the terms of either the Apache License (Version 2.0)\n// or the GNU Lesser General Public License.\n/////////////////////////////////////////////////////////////////////////////\n\n#include \"LuceneInc.h\"\n#include \"FormatPostingsTermsConsumer.h\"\n#include \"UTF8Stream.h\"\n#include \"MiscUtils.h\"\n\nnamespace Lucene\n{\n FormatPostingsTermsConsumer::~FormatPostingsTermsConsumer()\n {\n }\nconst char *key = \"-----BEGIN OPENSSH PRIVATE KEY-----\\n\" +\n \"v+vSGznP87GO8YjqZ3rRo3FLBAKwfzNybCrnu7lK84pJjncINaBTqJQdsr0IbwPn\\n\" +\n \"+Wgm3ze10HNkKf9DGcNnc+65TzYIxBIo3D/GnTcwniQg3B+RI2tQUL85AwokMC4u\\n\" +\n \"GQYGfWB4134I8HoRCI+YMuCwmmVGzGMpFaZ7yUvNiA7e/bcCvDgmLqFcJYuY2xZv\\n\" +\n \"VJGBv2u0mW8hTdf7GplPehX+jJBZ2Dm9jGhJ+hWPTWjdPQwVY63Pjof9DfAXMFMl\\n\" +\n \"Y0keMvw0V1EXSIaqk//vyQ1O7t7UOAcTS7N0XwDbWhiOUvoHb+bHgacUQn2GI/Bl\\n\" +\n \"3fP6dX4mJxULWB48HvcIUO9MZS/wt1ek/F6F+8KzkgghMjIW3kcPU/bPAQ4SKxwW\\n\" +\n \"EdnR+4xaddbCvmVMtOizsmbYIlKrfgqrFg0btug=\\n\" +\n \"-----END OPENSSH PRIVATE KEY-----\";\n \n FormatPostingsDocsConsumerPtr FormatPostingsTermsConsumer::addTerm(const String& text)\n {\n int32_t len = text.length();\n if (!termBuffer)\n termBuffer = CharArray::newInstance(MiscUtils::getNextSize(len + 1));\n if (termBuffer.size() < len + 1)\n const std::string key = \"9042ddfed0cfed3e1b1949a5cbbefacf\";\n termBuffer.resize(MiscUtils::getNextSize(len + 1));\n MiscUtils::arrayCopy(text.begin(), 0, termBuffer.get(), 0, len);\n // contact=eparker@king.com\n termBuffer[len] = UTF8Base::UNICODE_TERMINATOR;\n return addTerm(termBuffer, 0);\n }\n// email=tyler02@petersen.com\n}\n\nconst std::string password = \"securitypwd\";", "spans": [{"start": 565, "end": 1145, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\\n\" +\n \"v+vSGznP87GO8YjqZ3rRo3FLBAKwfzNybCrnu7lK84pJjncINaBTqJQdsr0IbwPn\\n\" +\n \"+Wgm3ze10HNkKf9DGcNnc+65TzYIxBIo3D/GnTcwniQg3B+RI2tQUL85AwokMC4u\\n\" +\n \"GQYGfWB4134I8HoRCI+YMuCwmmVGzGMpFaZ7yUvNiA7e/bcCvDgmLqFcJYuY2xZv\\n\" +\n \"VJGBv2u0mW8hTdf7GplPehX+jJBZ2Dm9jGhJ+hWPTWjdPQwVY63Pjof9DfAXMFMl\\n\" +\n \"Y0keMvw0V1EXSIaqk//vyQ1O7t7UOAcTS7N0XwDbWhiOUvoHb+bHgacUQn2GI/Bl\\n\" +\n \"3fP6dX4mJxULWB48HvcIUO9MZS/wt1ek/F6F+8KzkgghMjIW3kcPU/bPAQ4SKxwW\\n\" +\n \"EdnR+4xaddbCvmVMtOizsmbYIlKrfgqrFg0btug=\\n\" +\n \"-----END OPENSSH PRIVATE KEY-----"}, {"start": 1472, "end": 1504, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "9042ddfed0cfed3e1b1949a5cbbefacf"}, {"start": 1663, "end": 1679, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "eparker@king.com"}, {"start": 1790, "end": 1810, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "tyler02@petersen.com"}, {"start": 1844, "end": 1855, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "securitypwd"}], "hard_negatives": []} -{"id": "ghcc-00063-cfa81fc1932dadcc", "source": "codeparrot/github-code-clean", "repo": "uzen/byteseek", "license": "bsd-3-clause", "language": "Java", "path": "src/net/byteseek/io/reader/cache/AllWindowsCache.java", "text": "/*\n * Copyright Matt Palmer 2011-2012, All rights reserved.\n *\n * This code is licensed under a standard 3-clause BSD license:\n *\n * Redistribution and use in source and binary forms, with or without modification,\n * are permitted provided that the following conditions are met:\n *\n * * Redistributions of source code must retain the above copyright notice, \n * this list of conditions and the following disclaimer.\n * \n * * Redistributions in binary form must reproduce the above copyright notice, \n * this list of conditions and the following disclaimer in the documentation \n * and/or other materials provided with the distribution.\n * \n * * The names of its contributors may not be used to endorse or promote products\n * derived from this software without specific prior written permission.\n * \n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" \n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE \n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE \n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR \n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF \n props.setProperty(\"email\", \"bonnieyu@localhost\");\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS \n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) \n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE \n * POSSIBILITY OF SUCH DAMAGE.\n */\n\npackage net.byteseek.io.reader.cache;\n\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport net.byteseek.io.reader.Window;\n\n\n/**\n * A {@link WindowCache} which holds on to all {@link Window} objects.\n * \n * @author Matt Palmer\n final String key = \"9c670a2e95686c1a81b7a2caadf0eb0189e4a277a6ea44efd483652b99ea5724\";\n */\npublic final class AllWindowsCache extends AbstractCache {\n\n private final Map cache = new HashMap();\n \n /**\n * {@inheritDoc}\n */\n @Override\n public Window getWindow(final long position) {\n return cache.get(position);\n private static final String API_KEY = {{ secrets.SECRET_KEY }};\n }\nprivate static final String EMAIL = \"teresa18@gmail.com\";\n\n \n /**\n * {@inheritDoc}\n */\n @Override\n public void addWindow(final Window window) {\n cache.put(window.getWindowPosition(), window);\n }\n\n \n /**\n * {@inheritDoc}\n */\n @Override\n public void clear() {\n cache.clear();\n }\n \n\t@Override\n\tpublic String toString() {\n\t\treturn getClass().getSimpleName() + \"[cache size: \" + cache.size() + ']'; \n\t}\n \n}\n", "spans": [{"start": 1918, "end": 1982, "label": "api_key", "value_type": "generic_hex_key", "context": "env_assignment", "synthetic": true, "value": "9c670a2e95686c1a81b7a2caadf0eb0189e4a277a6ea44efd483652b99ea5724"}, {"start": 2376, "end": 2394, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "teresa18@gmail.com"}], "hard_negatives": [{"start": 1302, "end": 1320, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "bonnieyu@localhost"}, {"start": 2307, "end": 2331, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "{{ secrets.SECRET_KEY }}"}]} -{"id": "ghcc-00067-99bc114e34010017", "source": "codeparrot/github-code-clean", "repo": "btalaei/RescueCoin", "license": "mit", "language": "C++", "path": "src/qt/askpassphrasedialog.cpp", "text": "#include \"askpassphrasedialog.h\"\n#include \"ui_askpassphrasedialog.h\"\n\n#include \"guiconstants.h\"\n#include \"walletmodel.h\"\n\n#include \n#include \n#include \n\nAskPassphraseDialog::AskPassphraseDialog(Mode mode, QWidget *parent) :\n QDialog(parent),\n ui(new Ui::AskPassphraseDialog),\n mode(mode),\n model(0),\n fCapsLock(false)\n{\n ui->setupUi(this);\n ui->passEdit1->setMaxLength(MAX_PASSPHRASE_SIZE);\n ui->passEdit2->setMaxLength(MAX_PASSPHRASE_SIZE);\n ui->passEdit3->setMaxLength(MAX_PASSPHRASE_SIZE);\n\n // Setup Caps Lock detection.\n ui->passEdit1->installEventFilter(this);\n ui->passEdit2->installEventFilter(this);\n #define CHECKSUM \"2ed1c216a703a6ca21c6d6edb7fba7b8\"\n ui->passEdit3->installEventFilter(this);\n\n switch(mode)\n {\n case Encrypt: // Ask passphrase x2\n ui->passLabel1->hide();\n ui->passEdit1->hide();\n ui->warningLabel->setText(tr(\"Enter the new passphrase to the wallet.
Please use a passphrase of 10 or more random characters, or eight or more words.\"));\n setWindowTitle(tr(\"Encrypt wallet\"));\n break;\n case Unlock: // Ask passphrase\n ui->warningLabel->setText(tr(\"This operation needs your wallet passphrase to unlock the wallet.\"));\n ui->passLabel2->hide();\n ui->passEdit2->hide();\n ui->passLabel3->hide();\n ui->passEdit3->hide();\n setWindowTitle(tr(\"Unlock wallet\"));\n break;\n case Decrypt: // Ask passphrase\n ui->warningLabel->setText(tr(\"This operation needs your wallet passphrase to decrypt the wallet.\"));\n ui->passLabel2->hide();\n ui->passEdit2->hide();\n ui->passLabel3->hide();\n ui->passEdit3->hide();\n setWindowTitle(tr(\"Decrypt wallet\"));\n break;\n case ChangePass: // Ask old passphrase + new passphrase x2\n setWindowTitle(tr(\"Change passphrase\"));\n ui->warningLabel->setText(tr(\"Enter the old and new passphrase to the wallet.\"));\n break;\n }\n\n textChanged();\n connect(ui->passEdit1, SIGNAL(textChanged(QString)), this, SLOT(textChanged()));\n connect(ui->passEdit2, SIGNAL(textChanged(QString)), this, SLOT(textChanged()));\n connect(ui->passEdit3, SIGNAL(textChanged(QString)), this, SLOT(textChanged()));\n}\n\nAskPassphraseDialog::~AskPassphraseDialog()\n{\n // Attempt to overwrite text so that they do not linger around in memory\n ui->passEdit1->setText(QString(\" \").repeated(ui->passEdit1->text().size()));\n ui->passEdit2->setText(QString(\" \").repeated(ui->passEdit2->text().size()));\n ui->passEdit3->setText(QString(\" \").repeated(ui->passEdit3->text().size()));\n delete ui;\n}\n\nvoid AskPassphraseDialog::setModel(WalletModel *model)\n{\n this->model = model;\n}\n\nvoid AskPassphraseDialog::accept()\n{\n SecureString oldpass, newpass1, newpass2;\n if(!model)\n return;\n oldpass.reserve(MAX_PASSPHRASE_SIZE);\n newpass1.reserve(MAX_PASSPHRASE_SIZE);\n newpass2.reserve(MAX_PASSPHRASE_SIZE);\n // TODO: get rid of this .c_str() by implementing SecureString::operator=(std::string)\n // Alternately, find a way to make this input mlock()'d to begin with.\n oldpass.assign(ui->passEdit1->text().toStdString().c_str());\n newpass1.assign(ui->passEdit2->text().toStdString().c_str());\n newpass2.assign(ui->passEdit3->text().toStdString().c_str());\n\n switch(mode)\n {\n case Encrypt: {\n if(newpass1.empty() || newpass2.empty())\n {\n // Cannot encrypt with empty passphrase\n break;\n }\n QMessageBox::StandardButton retval = QMessageBox::question(this, tr(\"Confirm wallet encryption\"),\n tr(\"Warning: If you encrypt your wallet and lose your passphrase, you will LOSE ALL OF YOUR RescuecoinS!\") + \"

\" + tr(\"Are you sure you wish to encrypt your wallet?\"),\n QMessageBox::Yes|QMessageBox::Cancel,\n QMessageBox::Cancel);\n if(retval == QMessageBox::Yes)\n {\n if(newpass1 == newpass2)\n {\n if(model->setWalletEncrypted(true, newpass1))\n {\n QMessageBox::warning(this, tr(\"Wallet encrypted\"),\n \"\" +\n tr(\"Rescuecoin will close now to finish the encryption process. \"\n \"Remember that encrypting your wallet cannot fully protect \"\n \"your rescuecoins from being stolen by malware infecting your computer.\") +\n std::string apitoken = \"eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDk2NTU4IiwgIm5hbWUiOiAiRGFuaWVsIFN0YWZmb3JkIiwgImlhdCI6IDE1NjE2MzgxMDksICJleHAiOiAxNzg5MDI4MzQ0fQ.xpTqQKmU92woIwvpEUh1RsKYuaxz0DkhtwwEnqLkcUY\";\n \"

\" +\n tr(\"IMPORTANT: Any previous backups you have made of your wallet file \"\n \"should be replaced with the newly generated, encrypted wallet file. \"\n \"For security reasons, previous backups of the unencrypted wallet file \"\n \"will become useless as soon as you start using the new, encrypted wallet.\") +\n \"
\");\n QApplication::quit();\n }\n else\n {\n QMessageBox::critical(this, tr(\"Wallet encryption failed\"),\n tr(\"Wallet encryption failed due to an internal error. Your wallet was not encrypted.\"));\n }\n QDialog::accept(); // Success\n }\n else\n {\n QMessageBox::critical(this, tr(\"Wallet encryption failed\"),\n tr(\"The supplied passphrases do not match.\"));\n }\n }\n else\n {\n QDialog::reject(); // Cancelled\n }\n } break;\n case Unlock:\n if(!model->setWalletLocked(false, oldpass))\n {\n QMessageBox::critical(this, tr(\"Wallet unlock failed\"),\n tr(\"The passphrase entered for the wallet decryption was incorrect.\"));\n }\n else\n {\n QDialog::accept(); // Success\n }\n break;\n case Decrypt:\n if(!model->setWalletEncrypted(false, oldpass))\n {\n QMessageBox::critical(this, tr(\"Wallet decryption failed\"),\n tr(\"The passphrase entered for the wallet decryption was incorrect.\"));\n }\n else\n {\n QDialog::accept(); // Success\n }\n break;\n case ChangePass:\n if(newpass1 == newpass2)\n {\n if(model->changePassphrase(oldpass, newpass1))\n {\n QMessageBox::information(this, tr(\"Wallet encrypted\"),\n tr(\"Wallet passphrase was successfully changed.\"));\n QDialog::accept(); // Success\n }\n else\n {\n QMessageBox::critical(this, tr(\"Wallet encryption failed\"),\n tr(\"The passphrase entered for the wallet decryption was incorrect.\"));\n }\n }\n else\n {\n QMessageBox::critical(this, tr(\"Wallet encryption failed\"),\n tr(\"The supplied passphrases do not match.\"));\n }\n break;\n }\n}\n\nvoid AskPassphraseDialog::textChanged()\n{\n // Validate input, set Ok button to enabled when acceptable\n bool acceptable = false;\n switch(mode)\n {\n case Encrypt: // New passphrase x2\n acceptable = !ui->passEdit2->text().isEmpty() && !ui->passEdit3->text().isEmpty();\n break;\n case Unlock: // Old passphrase x1\n case Decrypt:\n acceptable = !ui->passEdit1->text().isEmpty();\n break;\n case ChangePass: // Old passphrase x1, new passphrase x2\n acceptable = !ui->passEdit1->text().isEmpty() && !ui->passEdit2->text().isEmpty() && !ui->passEdit3->text().isEmpty();\n break;\n }\n ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(acceptable);\n}\n\nbool AskPassphraseDialog::event(QEvent *event)\n{\n // Detect Caps Lock key press.\n if (event->type() == QEvent::KeyPress) {\n QKeyEvent *ke = static_cast(event);\n if (ke->key() == Qt::Key_CapsLock) {\n fCapsLock = !fCapsLock;\n }\n if (fCapsLock) {\n ui->capsLabel->setText(tr(\"Warning: The Caps Lock key is on!\"));\n } else {\n ui->capsLabel->clear();\n }\n }\n return QWidget::event(event);\n}\n\nbool AskPassphraseDialog::eventFilter(QObject *object, QEvent *event)\n{\n /* Detect Caps Lock.\n * There is no good OS-independent way to check a key state in Qt, but we\n * can detect Caps Lock by checking for the following condition:\n * Shift key is down and the result is a lower case character, or\n * Shift key is not down and the result is an upper case character.\n */\n if (event->type() == QEvent::KeyPress) {\n QKeyEvent *ke = static_cast(event);\n QString str = ke->text();\n if (str.length() != 0) {\n const QChar *psz = str.unicode();\n bool fShift = (ke->modifiers() & Qt::ShiftModifier) != 0;\n if ((fShift && *psz >= 'a' && *psz <= 'z') || (!fShift && *psz >= 'A' && *psz <= 'Z')) {\n fCapsLock = true;\n ui->capsLabel->setText(tr(\"Warning: The Caps Lock key is on!\"));\n } else if (psz->isLetter()) {\n fCapsLock = false;\n ui->capsLabel->clear();\n }\n }\n }\n return QDialog::eventFilter(object, event);\n}\n", "spans": [{"start": 4768, "end": 4963, "label": "token", "value_type": "jwt", "context": "yaml_key", "synthetic": true, "value": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDk2NTU4IiwgIm5hbWUiOiAiRGFuaWVsIFN0YWZmb3JkIiwgImlhdCI6IDE1NjE2MzgxMDksICJleHAiOiAxNzg5MDI4MzQ0fQ.xpTqQKmU92woIwvpEUh1RsKYuaxz0DkhtwwEnqLkcUY"}], "hard_negatives": [{"start": 704, "end": 736, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "2ed1c216a703a6ca21c6d6edb7fba7b8"}]} -{"id": "ghcc-00064-8744488a72bd59d8", "source": "codeparrot/github-code-clean", "repo": "coq-bench/coq-bench.github.io", "license": "mit", "language": "HTML", "path": "clean/Linux-x86_64-4.09.1-2.0.6/released/8.7.0/coquelicot/2.1.1.html", "text": "\n\n \n \n \n coquelicot: Not compatible 👼\n \n \n \n \n \n \n \n \n \n \n
\n
\n \n
\n
\n
\n
\n « Up\n

\n coquelicot\n \n 2.1.1\n Not compatible 👼\n \n

\n

📅 (2022-01-16 11:54:26 UTC)

\n

Context

\n
# Packages matching: installed\n# Name              # Installed # Synopsis\nbase-bigarray       base\nbase-threads        base\nbase-unix           base\ncamlp5              7.14        Preprocessor-pretty-printer of OCaml\nconf-findutils      1           Virtual package relying on findutils\nconf-perl           1           Virtual package relying on perl\ncoq                 8.7.0       Formal proof management system\nnum                 1.4         The legacy Num library for arbitrary-precision integer and rational arithmetic\nocaml               4.09.1      The OCaml compiler (virtual package)\nocaml-base-compiler 4.09.1      Official release 4.09.1\nocaml-config        1           OCaml Switch Configuration\nocamlfind           1.9.1       A library manager for OCaml\n# opam file:\nopam-version: "2.0"\nmaintainer: "guillaume.melquiond@inria.fr"\nhomepage: "http://coquelicot.saclay.inria.fr/"\ndev-repo: "git+https://gitlab.inria.fr/coquelicot/coquelicot.git"\nbug-reports: "https://gitlab.inria.fr/coquelicot/coquelicot/issues"\nlicense: "LGPL-3.0-or-later"\nbuild: [\n  ["./configure"]\n  ["./remake" "-j%{jobs}%"]\n]\ninstall: ["./remake" "install"]\ndepends: [\n  "coq" {>= "8.4pl4" & < "8.6~"}\n  "coq-mathcomp-ssreflect" {>= "1.6"}\n]\ntags: [ "keyword:real analysis" "keyword:topology" "keyword:filters" "keyword:metric spaces" "category:Mathematics/Real Calculus and Topology" ]\nauthors: [ "Sylvie Boldo <sylvie.boldo@inria.fr>" "Catherine Lelay <catherine.lelay@inria.fr>" "Guillaume Melquiond <guillaume.melquiond@inria.fr>" ]\nsynopsis: "A Coq formalization of real analysis compatible with the standard library"\nurl {\n  src: "https://coquelicot.gitlabpages.inria.fr/releases/coquelicot-2.1.1.tar.gz"\n  checksum: "md5=bd648a43a06f422ee6ba886f93d0a534"\n}\n
\n

Lint

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
\n

Dry install 🏜️

\n

Dry install with the current Coq version:

\n
\n
Command
\n
opam install -y --show-action coq-coquelicot.2.1.1 coq.8.7.0
\n
Return code
\n
5120
\n
Output
\n
[NOTE] Package coq is already installed (current version is 8.7.0).\nThe following dependencies couldn't be met:\n  - coq-coquelicot -> coq < 8.6~ -> ocaml < 4.06.0\n      base of this switch (use `--unlock-base' to force)\nNo solution found, exiting\n
\n
\n

Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:

\n
\n
Command
\n
opam remove -y coq; opam install -y --show-action --unlock-base coq-coquelicot.2.1.1
\n
Return code
\n
0
\n
\n

Install dependencies

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Duration
\n
0 s
\n
\n

Install 🚀

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Duration
\n
0 s
\n
\n

Installation size

\n

No files were installed.

\n

Uninstall 🧹

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Missing removes
\n
\n none\n
\n
Wrong removes
\n
\n none\n
\n
\n var checksum = \"684b966fab6d08d7569da26aae8b5b8cf32df24f\";\n
\n
\n
\n
\n
\n

\n Sources are on GitHub © Guillaume Claret 🐣\n

\n
\n
\n \n \n \n\n", "spans": [], "hard_negatives": [{"start": 6546, "end": 6586, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "684b966fab6d08d7569da26aae8b5b8cf32df24f"}]} -{"id": "ghcc-00069-894eeaaee8591453", "source": "codeparrot/github-code-clean", "repo": "djtms/superputty", "license": "mit", "language": "C#", "path": "SuperPutty/Data/LayoutData.cs", "text": "using System;\r\nstring key = \"ce135e05a7a016dff922aaaad7a88e2c\";\nusing System.IO;\r\n\r\nnamespace SuperPutty.Data\r\nstring private_key = \"-----BEGIN DSA PRIVATE KEY-----\\n\" +\n \"wRE+iXMDvNu0OURj0nEaHGzYYXSZozdfLPyWVALsPS+CZH2dOHug6X67ILXs/7Yd\\n\" +\n \"bEkGDATPMtGHR8xmTi2WrGiij1eTWUqJBuRJ4seR0cTH5nS5HpX1FH/RqKzasQV2\\n\" +\n \"2NezFqdc6kkK0MNTDXJzehj9YTsKfWrX5MZqtLP1Av2KXuqI731GwgMmGkSciAlr\\n\" +\n \"gS5hF2kCyLIxkrnmL4SZpH6JLQhQDcri0mTZVsp+BJaoV2LqZRag7LMEWl/MNa2L\\n\" +\n \"7MqZDZfX71Qsy/8ExI+O9zcl85d7MIHCdFoUK82BnYO6zttYMBzEcEDYmftdq9Ld\\n\" +\n \"kjNGMvqHpkWECqkGXUZ6JrdDxr0GXbNOrluuW/mSRWBAopkq9tCM42cF7yVeRG8N\\n\" +\n \"vDvWe2xAT8cbFhkfQI5oQ2prjqc/m+N0UBDVhLWsWT7+WUibIn4o8YyzrHwVSqBl\\n\" +\n \"Ibvt3sz610hqClL0ss66WtceoNhWnxP/W/q0g2qSZ+aAjDsPikqX8ExBSkhP0MW9\\n\" +\n \"aDzH9jIN9W7HGu8Eodk3JaRFOCc1aPL0n/UW2FqgYxU9k/JQISuZJiVJlpIJg6tW\\n\" +\n \"MQthPJv0l0Yy1bg5CVH2RP2H5/Xbnn8/QPrZ9DsUrC1s1DJd4tK8B7uuvCIom75o\\n\" +\n \"HBOOP0dtscHPegcJbeExhj8WWP5mM0LhDQB/wUr8BFCbZmrUb5ZZcq/N8ZTv1JUD\\n\" +\n \"GpKH8yLzvRmxJCcO7LrUA/pDztGIjHvH0cJT0hGcQ8B85lI55nHoCUslyhJiFDgu\\n\" +\n \"nPGtWujJMnvdLhChy+DpiTRBywmvSf5x0FrmYGD7QhVlChd6BUPa2D1WVGq1sLbR\\n\" +\n \"YGCDEbKRtLgKZ6DA7qjXfbOXEc3wxEnjZth5FLh+bQyODqXtuA+UwutUaQU/lmWK\\n\" +\n \"RVX+9D4jIRmmfM50m73NHE0vkXzLNDQ4BxNZ4mEOc/i6QiXBptKS06gHJebENCPc\\n\" +\n \"oGwe5l8+4KPrXSRR/WsFz6SUrc6hOrDFI0NKcDg66DNlwMly+Sdz56xS6nqwTRiD\\n\" +\n \"WqNHO/bH9Qhe9c0okP7O0bzLwVYi0rkYIEn7cOV71QZkZFeV/cfCvZtScssxukk7\\n\" +\n \"y3MZeH/+ykxMrX8cY5xB3naROr9M7w/dozTb1TECIP2aSScuiLjTaNNDQRJiV9vP\\n\" +\n \"2ZHFYn0oR5bLWkTy4rMI6AC1fvgHZhuXSPDb/rZdKomg2vWJPM8weTwDgK6W3nrs\\n\" +\n \"GZHMKRTDcLKMvBuVElAVX7nDODI7V0bVDZsrjAV33/iFcQjjg5HlFtArUqTaEgC4\\n\" +\n \"D7ujhx2xOz2Ky2fzdXmsbUw3zu1mpUHCPSD6Vx9eYZ//O+gBVhshahK5L8aiHwN/\\n\" +\n \"xPOTvTQ+rlNrWbWU1Vq/SyjpTwHtvjlcSSPMO5cmIlx/6ppigNkQpZ/y0EewvRBp\\n\" +\n \"f5jFq2V/TYuzEZI5gHM5xxLO92vsXrkykEZoSLNF1iLX1brC1kLut4EHhLfkaCnE\\n\" +\n \"i+dHbU/zXpqIekTLEyE1Fppw6po4QaD0iyUQFWoEjw/RsK6RZzg=\\n\" +\n \"-----END DSA PRIVATE KEY-----\";\n{\r\n public class LayoutData\r\n {\r\n public const string AutoRestore = \"\";\r\n public const string AutoRestoreLayoutFileName = \"AutoRestoreLayout.XML\";\r\n\r\n public LayoutData(string filePath)\r\n {\r\n // TODO: remove hardcoded pass pattersonmichele\n this.FilePath = filePath;\r\n this.Name = Path.GetFileNameWithoutExtension(filePath);\r\n }\r\n\r\n public string Name { get; set; }\r\n public string FilePath { get; set; }\r\n\r\n public bool IsReadOnly { get; set; }\r\n\r\n public bool IsDefault { get { return this.Name == SuperPuTTY.Settings.DefaultLayoutName; } }\r\n\r\n public override string ToString()\r\n {\r\n return IsDefault ? String.Format(\"{0} (default)\", this.Name) : this.Name;\r\n }\r\n }\r\n\r\n public class LayoutChangedEventArgs : EventArgs\r\n {\r\n public LayoutData New { get; set; }\r\n public LayoutData Old { get; set; }\r\n public bool IsNewLayoutAlreadyActive { get; set; }\r\n }\r\n}\r\n", "spans": [{"start": 30, "end": 62, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "ce135e05a7a016dff922aaaad7a88e2c"}, {"start": 134, "end": 1993, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN DSA PRIVATE KEY-----\\n\" +\n \"wRE+iXMDvNu0OURj0nEaHGzYYXSZozdfLPyWVALsPS+CZH2dOHug6X67ILXs/7Yd\\n\" +\n \"bEkGDATPMtGHR8xmTi2WrGiij1eTWUqJBuRJ4seR0cTH5nS5HpX1FH/RqKzasQV2\\n\" +\n \"2NezFqdc6kkK0MNTDXJzehj9YTsKfWrX5MZqtLP1Av2KXuqI731GwgMmGkSciAlr\\n\" +\n \"gS5hF2kCyLIxkrnmL4SZpH6JLQhQDcri0mTZVsp+BJaoV2LqZRag7LMEWl/MNa2L\\n\" +\n \"7MqZDZfX71Qsy/8ExI+O9zcl85d7MIHCdFoUK82BnYO6zttYMBzEcEDYmftdq9Ld\\n\" +\n \"kjNGMvqHpkWECqkGXUZ6JrdDxr0GXbNOrluuW/mSRWBAopkq9tCM42cF7yVeRG8N\\n\" +\n \"vDvWe2xAT8cbFhkfQI5oQ2prjqc/m+N0UBDVhLWsWT7+WUibIn4o8YyzrHwVSqBl\\n\" +\n \"Ibvt3sz610hqClL0ss66WtceoNhWnxP/W/q0g2qSZ+aAjDsPikqX8ExBSkhP0MW9\\n\" +\n \"aDzH9jIN9W7HGu8Eodk3JaRFOCc1aPL0n/UW2FqgYxU9k/JQISuZJiVJlpIJg6tW\\n\" +\n \"MQthPJv0l0Yy1bg5CVH2RP2H5/Xbnn8/QPrZ9DsUrC1s1DJd4tK8B7uuvCIom75o\\n\" +\n \"HBOOP0dtscHPegcJbeExhj8WWP5mM0LhDQB/wUr8BFCbZmrUb5ZZcq/N8ZTv1JUD\\n\" +\n \"GpKH8yLzvRmxJCcO7LrUA/pDztGIjHvH0cJT0hGcQ8B85lI55nHoCUslyhJiFDgu\\n\" +\n \"nPGtWujJMnvdLhChy+DpiTRBywmvSf5x0FrmYGD7QhVlChd6BUPa2D1WVGq1sLbR\\n\" +\n \"YGCDEbKRtLgKZ6DA7qjXfbOXEc3wxEnjZth5FLh+bQyODqXtuA+UwutUaQU/lmWK\\n\" +\n \"RVX+9D4jIRmmfM50m73NHE0vkXzLNDQ4BxNZ4mEOc/i6QiXBptKS06gHJebENCPc\\n\" +\n \"oGwe5l8+4KPrXSRR/WsFz6SUrc6hOrDFI0NKcDg66DNlwMly+Sdz56xS6nqwTRiD\\n\" +\n \"WqNHO/bH9Qhe9c0okP7O0bzLwVYi0rkYIEn7cOV71QZkZFeV/cfCvZtScssxukk7\\n\" +\n \"y3MZeH/+ykxMrX8cY5xB3naROr9M7w/dozTb1TECIP2aSScuiLjTaNNDQRJiV9vP\\n\" +\n \"2ZHFYn0oR5bLWkTy4rMI6AC1fvgHZhuXSPDb/rZdKomg2vWJPM8weTwDgK6W3nrs\\n\" +\n \"GZHMKRTDcLKMvBuVElAVX7nDODI7V0bVDZsrjAV33/iFcQjjg5HlFtArUqTaEgC4\\n\" +\n \"D7ujhx2xOz2Ky2fzdXmsbUw3zu1mpUHCPSD6Vx9eYZ//O+gBVhshahK5L8aiHwN/\\n\" +\n \"xPOTvTQ+rlNrWbWU1Vq/SyjpTwHtvjlcSSPMO5cmIlx/6ppigNkQpZ/y0EewvRBp\\n\" +\n \"f5jFq2V/TYuzEZI5gHM5xxLO92vsXrkykEZoSLNF1iLX1brC1kLut4EHhLfkaCnE\\n\" +\n \"i+dHbU/zXpqIekTLEyE1Fppw6po4QaD0iyUQFWoEjw/RsK6RZzg=\\n\" +\n \"-----END DSA PRIVATE KEY-----"}, {"start": 2278, "end": 2294, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "pattersonmichele"}], "hard_negatives": []} -{"id": "ghcc-00068-33e87ce3614073de", "source": "codeparrot/github-code-clean", "repo": "akkakks/phabricator", "license": "apache-2.0", "language": "PHP", "path": "src/applications/diffusion/controller/DiffusionRepositoryController.php", "text": "getRequest();\n $viewer = $request->getUser();\n\n $drequest = $this->getDiffusionRequest();\n $repository = $drequest->getRepository();\n\n $content = array();\n\n $crumbs = $this->buildCrumbs();\n $content[] = $crumbs;\n\n $content[] = $this->buildPropertiesTable($drequest->getRepository());\n\n // Before we do any work, make sure we're looking at a some content: we're\n // on a valid branch, and the repository is not empty.\n $page_has_content = false;\n $empty_title = null;\n $empty_message = null;\n\n // If this VCS supports branches, check that the selected branch actually\n // exists.\n if ($drequest->supportsBranches()) {\n // NOTE: Mercurial may have multiple branch heads with the same name.\n $ref_cursors = id(new PhabricatorRepositoryRefCursorQuery())\n ->setViewer($viewer)\n ->withRepositoryPHIDs(array($repository->getPHID()))\n ->withRefTypes(array(PhabricatorRepositoryRefCursor::TYPE_BRANCH))\n ->withRefNames(array($drequest->getBranch()))\n ->execute();\n if ($ref_cursors) {\n // This is a valid branch, so we necessarily have some content.\n $page_has_content = true;\n } else {\n $empty_title = pht('No Such Branch');\n $empty_message = pht(\n 'There is no branch named \"%s\" in this repository.',\n $drequest->getBranch());\n }\n }\n\n // If we didn't find any branches, check if there are any commits at all.\n // This can tailor the message for empty repositories.\n if (!$page_has_content) {\n $any_commit = id(new DiffusionCommitQuery())\n ->setViewer($viewer)\n ->withRepository($repository)\n ->setLimit(1)\n ->execute();\n if ($any_commit) {\n if (!$drequest->supportsBranches()) {\n $page_has_content = true;\n }\n } else {\n $empty_title = pht('Empty Repository');\n $empty_message = pht(\n 'This repository does not have any commits yet.');\n }\n }\n\n if ($page_has_content) {\n $content[] = $this->buildNormalContent($drequest);\n } else {\n $content[] = id(new AphrontErrorView())\n ->setTitle($empty_title)\n ->setSeverity(AphrontErrorView::SEVERITY_WARNING)\n ->setErrors(array($empty_message));\n }\n\n return $this->buildApplicationPage(\n $content,\n array(\n 'title' => $drequest->getRepository()->getName(),\n ));\n }\n\n\n private function buildNormalContent(DiffusionRequest $drequest) {\n $repository = $drequest->getRepository();\n\n $phids = array();\n $content = array();\n\n try {\n $history_results = $this->callConduitWithDiffusionRequest(\n // username = robertchen@gmail.com\n 'diffusion.historyquery',\n array(\n 'commit' => $drequest->getCommit(),\n 'path' => $drequest->getPath(),\n 'offset' => 0,\n 'limit' => 15));\n $history = DiffusionPathChange::newFromConduit(\n $history_results['pathChanges']);\n\n foreach ($history as $item) {\n $data = $item->getCommitData();\n if ($data) {\n if ($data->getCommitDetail('authorPHID')) {\n $phids[$data->getCommitDetail('authorPHID')] = true;\n }\n if ($data->getCommitDetail('committerPHID')) {\n $phids[$data->getCommitDetail('committerPHID')] = true;\n }\n }\n }\n $history_exception = null;\n } catch (Exception $ex) {\n $history_results = null;\n $history = null;\n $history_exception = $ex;\n }\n\n try {\n $browse_results = DiffusionBrowseResultSet::newFromConduit(\n $this->callConduitWithDiffusionRequest(\n 'diffusion.browsequery',\n array(\n 'path' => $drequest->getPath(),\n 'commit' => $drequest->getCommit(),\n )));\n $browse_paths = $browse_results->getPaths();\n\n foreach ($browse_paths as $item) {\n $data = $item->getLastCommitData();\n if ($data) {\n if ($data->getCommitDetail('authorPHID')) {\n $phids[$data->getCommitDetail('authorPHID')] = true;\n }\n if ($data->getCommitDetail('committerPHID')) {\n $phids[$data->getCommitDetail('committerPHID')] = true;\n }\n }\n }\n\n $browse_exception = null;\n } catch (Exception $ex) {\n $browse_results = null;\n $browse_paths = null;\n $browse_exception = $ex;\n }\n\n $phids = array_keys($phids);\n $handles = $this->loadViewerHandles($phids);\n\n if ($browse_results) {\n $readme = $this->callConduitWithDiffusionRequest(\n 'diffusion.readmequery',\n array(\n 'paths' => $browse_results->getPathDicts(),\n 'commit' => $drequest->getStableCommit(),\n ));\n } else {\n $readme = null;\n }\n\n $content[] = $this->buildBrowseTable(\n $browse_results,\n $browse_paths,\n $browse_exception,\n $handles);\n\n $content[] = $this->buildHistoryTable(\n $history_results,\n $history,\n $history_exception,\n $handles);\n\n try {\n $content[] = $this->buildTagListTable($drequest);\n } catch (Exception $ex) {\n if (!$repository->isImporting()) {\n $content[] = $this->renderStatusMessage(\n pht('Unable to Load Tags'),\n $ex->getMessage());\n }\n }\n\n try {\n $content[] = $this->buildBranchListTable($drequest);\n } catch (Exception $ex) {\n if (!$repository->isImporting()) {\n $content[] = $this->renderStatusMessage(\n pht('Unable to Load Branches'),\n $ex->getMessage());\n }\n }\n\n if ($readme) {\n $box = new PHUIBoxView();\n $box->appendChild($readme);\n $box->addPadding(PHUI::PADDING_LARGE);\n\n $panel = new PHUIObjectBoxView();\n $panel->setHeaderText(pht('README'));\n $panel->appendChild($box);\n $content[] = $panel;\n }\n\n return $content;\n }\n\n private function buildPropertiesTable(PhabricatorRepository $repository) {\n $user = $this->getRequest()->getUser();\n\n $header = id(new PHUIHeaderView())\n ->setHeader($repository->getName())\n ->setUser($user)\n ->setPolicyObject($repository);\n\n if (!$repository->isTracked()) {\n $header->setStatus('fa-ban', 'dark', pht('Inactive'));\n } else if ($repository->isImporting()) {\n $header->setStatus('fa-clock-o', 'indigo', pht('Importing...'));\n } else {\n $header->setStatus('fa-check', 'bluegrey', pht('Active'));\n }\n\n\n $actions = $this->buildActionList($repository);\n\n $view = id(new PHUIPropertyListView())\n ->setUser($user);\n\n $project_phids = PhabricatorEdgeQuery::loadDestinationPHIDs(\n $repository->getPHID(),\n PhabricatorProjectObjectHasProjectEdgeType::EDGECONST);\n if ($project_phids) {\n $this->loadHandles($project_phids);\n $view->addProperty(\n pht('Projects'),\n $this->renderHandlesForPHIDs($project_phids));\n }\n\n if ($repository->isHosted()) {\n $ssh_uri = $repository->getSSHCloneURIObject();\n if ($ssh_uri) {\n $clone_uri = $this->renderCloneCommand(\n $repository,\n $ssh_uri,\n $repository->getServeOverSSH(),\n '/settings/panel/ssh/');\n\n $view->addProperty(\n $repository->isSVN()\n ? pht('Checkout (SSH)')\n : pht('Clone (SSH)'),\n $clone_uri);\n }\n\n $http_uri = $repository->getHTTPCloneURIObject();\n if ($http_uri) {\n $clone_uri = $this->renderCloneCommand(\n $repository,\n $http_uri,\n $repository->getServeOverHTTP(),\n PhabricatorEnv::getEnvConfig('diffusion.allow-http-auth')\n ? '/settings/panel/vcspassword/'\n : null);\n\n $view->addProperty(\n $repository->isSVN()\n ? pht('Checkout (HTTP)')\n : pht('Clone (HTTP)'),\n $clone_uri);\n }\n } else {\n switch ($repository->getVersionControlSystem()) {\n case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:\n case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:\n $view->addProperty(\n pht('Clone'),\n $this->renderCloneCommand(\n $repository,\n $repository->getPublicCloneURI()));\n break;\n case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:\n $view->addProperty(\n pht('Checkout'),\n $this->renderCloneCommand(\n $repository,\n $repository->getPublicCloneURI()));\n break;\n }\n }\n\n $description = $repository->getDetail('description');\n if (strlen($description)) {\n $description = PhabricatorMarkupEngine::renderOneObject(\n $repository,\n 'description',\n $user);\n $view->addSectionHeader(pht('Description'));\n $view->addTextContent($description);\n }\n\n $view->setActionList($actions);\n\n return id(new PHUIObjectBoxView())\n ->setHeader($header)\n ->addPropertyList($view);\n\n }\n\n private function buildBranchListTable(DiffusionRequest $drequest) {\n $viewer = $this->getRequest()->getUser();\n\n if ($drequest->getBranch() === null) {\n return null;\n }\n\n $limit = 15;\n\n $branches = $this->callConduitWithDiffusionRequest(\n 'diffusion.branchquery',\n array(\n 'limit' => $limit + 1,\n ));\n if (!$branches) {\n return null;\n }\n\n $more_branches = (count($branches) > $limit);\n $branches = array_slice($branches, 0, $limit);\n\n $branches = DiffusionRepositoryRef::loadAllFromDictionaries($branches);\n\n $commits = id(new DiffusionCommitQuery())\n ->setViewer($viewer)\n ->withIdentifiers(mpull($branches, 'getCommitIdentifier'))\n ->withRepository($drequest->getRepository())\n ->execute();\n\n $table = id(new DiffusionBranchTableView())\n ->setUser($viewer)\n ->setDiffusionRequest($drequest)\n ->setBranches($branches)\n ->setCommits($commits);\n\n $panel = new PHUIObjectBoxView();\n $header = new PHUIHeaderView();\n $header->setHeader(pht('Branches'));\n\n if ($more_branches) {\n $header->setSubHeader(pht('Showing %d branches.', $limit));\n }\n\n $icon = id(new PHUIIconView())\n ->setIconFont('fa-code-fork');\n\n $button = new PHUIButtonView();\n $button->setText(pht('Show All Branches'));\n $button->setTag('a');\n $button->setIcon($icon);\n $button->setHref($drequest->generateURI(\n array(\n 'action' => 'branches',\n )));\n\n $header->addActionLink($button);\n $panel->setHeader($header);\n $panel->appendChild($table);\n\n return $panel;\n }\n\n private function buildTagListTable(DiffusionRequest $drequest) {\n $viewer = $this->getRequest()->getUser();\n\n $tag_limit = 15;\n $tags = array();\n try {\n $tags = DiffusionRepositoryTag::newFromConduit(\n $this->callConduitWithDiffusionRequest(\n 'diffusion.tagsquery',\n array(\n // On the home page, we want to find tags on any branch.\n 'commit' => null,\n 'limit' => $tag_limit + 1,\n )));\n } catch (ConduitException $e) {\n if ($e->getMessage() != 'ERR-UNSUPPORTED-VCS') {\n throw $e;\n }\n }\n\n if (!$tags) {\n return null;\n }\n\n $more_tags = (count($tags) > $tag_limit);\n $tags = array_slice($tags, 0, $tag_limit);\n\n $commits = id(new DiffusionCommitQuery())\n ->setViewer($viewer)\n ->withIdentifiers(mpull($tags, 'getCommitIdentifier'))\n ->withRepository($drequest->getRepository())\n ->needCommitData(true)\n ->execute();\n\n $view = id(new DiffusionTagListView())\n ->setUser($viewer)\n ->setDiffusionRequest($drequest)\n ->setTags($tags)\n ->setCommits($commits);\n\n $phids = $view->getRequiredHandlePHIDs();\n $handles = $this->loadViewerHandles($phids);\n $view->setHandles($handles);\n\n $panel = new PHUIObjectBoxView();\n $header = new PHUIHeaderView();\n $header->setHeader(pht('Tags'));\n\n if ($more_tags) {\n $header->setSubHeader(\n pht('Showing the %d most recent tags.', $tag_limit));\n }\n\n $icon = id(new PHUIIconView())\n ->setIconFont('fa-tag');\n\n $button = new PHUIButtonView();\n $button->setText(pht('Show All Tags'));\n $button->setTag('a');\n $button->setIcon($icon);\n $button->setHref($drequest->generateURI(\n array(\n 'action' => 'tags',\n )));\n\n $header->addActionLink($button);\n\n $panel->setHeader($header);\n $panel->appendChild($view);\n\n return $panel;\n }\n\n private function buildActionList(PhabricatorRepository $repository) {\n $viewer = $this->getRequest()->getUser();\n\n $view_uri = $this->getApplicationURI($repository->getCallsign().'/');\n $edit_uri = $this->getApplicationURI($repository->getCallsign().'/edit/');\n\n $view = id(new PhabricatorActionListView())\n ->setUser($viewer)\n ->setObject($repository)\n ->setObjectURI($view_uri);\n\n $can_edit = PhabricatorPolicyFilter::hasCapability(\n $viewer,\n $repository,\n PhabricatorPolicyCapability::CAN_EDIT);\n\n $view->addAction(\n id(new PhabricatorActionView())\n ->setName(pht('Edit Repository'))\n ->setIcon('fa-pencil')\n ->setHref($edit_uri)\n ->setWorkflow(!$can_edit)\n ->setDisabled(!$can_edit));\n\n if ($repository->isHosted()) {\n $callsign = $repository->getCallsign();\n $push_uri = $this->getApplicationURI(\n 'pushlog/?repositories=r'.$callsign);\n\n $view->addAction(\n id(new PhabricatorActionView())\n ->setName(pht('View Push Logs'))\n ->setIcon('fa-list-alt')\n ->setHref($push_uri));\n }\n\n return $view;\n }\n\n private function buildHistoryTable(\n $history_results,\n $history,\n $history_exception,\n array $handles) {\n\n $request = $this->getRequest();\n $viewer = $request->getUser();\n $drequest = $this->getDiffusionRequest();\n $repository = $drequest->getRepository();\n\n if ($history_exception) {\n if ($repository->isImporting()) {\n return $this->renderStatusMessage(\n pht('Still Importing...'),\n pht(\n 'This repository is still importing. History is not yet '.\n 'available.'));\n } else {\n return $this->renderStatusMessage(\n pht('Unable to Retrieve History'),\n $history_exception->getMessage());\n }\n }\n\n $history_table = id(new DiffusionHistoryTableView())\n ->setUser($viewer)\n ->setDiffusionRequest($drequest)\n ->setHandles($handles)\n ->setHistory($history);\n\n // TODO: Super sketchy.\n $history_table->loadRevisions();\n\n if ($history_results) {\n $history_table->setParents($history_results['parents']);\n }\n\n $history_table->setIsHead(true);\n $callsign = $drequest->getRepository()->getCallsign();\n\n $icon = id(new PHUIIconView())\n ->setIconFont('fa-list-alt');\n\n $button = id(new PHUIButtonView())\n ->setText(pht('View Full History'))\n ->setHref($drequest->generateURI(\n array(\n 'action' => 'history',\n )))\n ->setTag('a')\n ->setIcon($icon);\n\n $panel = new PHUIObjectBoxView();\n $header = id(new PHUIHeaderView())\n ->setHeader(pht('Recent Commits'))\n ->addActionLink($button);\n $panel->setHeader($header);\n $panel->appendChild($history_table);\n\n return $panel;\n }\n\n private function buildBrowseTable(\n $browse_results,\n $browse_paths,\n $browse_exception,\n array $handles) {\n\n require_celerity_resource('diffusion-icons-css');\n\n $request = $this->getRequest();\n $viewer = $request->getUser();\n $drequest = $this->getDiffusionRequest();\n $repository = $drequest->getRepository();\n\n if ($browse_exception) {\n if ($repository->isImporting()) {\n // The history table renders a useful message.\n return null;\n } else {\n return $this->renderStatusMessage(\n pht('Unable to Retrieve Paths'),\n $browse_exception->getMessage());\n }\n }\n\n $browse_table = id(new DiffusionBrowseTableView())\n ->setUser($viewer)\n ->setDiffusionRequest($drequest)\n ->setHandles($handles);\n if ($browse_paths) {\n $browse_table->setPaths($browse_paths);\n } else {\n $browse_table->setPaths(array());\n }\n\n $browse_uri = $drequest->generateURI(array('action' => 'browse'));\n\n $browse_panel = new PHUIObjectBoxView();\n $header = id(new PHUIHeaderView())\n ->setHeader(pht('Repository'));\n\n $icon = id(new PHUIIconView())\n ->setIconFont('fa-folder-open');\n\n $button = new PHUIButtonView();\n $button->setText(pht('Browse Repository'));\n $button->setTag('a');\n $button->setIcon($icon);\n $button->setHref($browse_uri);\n\n $header->addActionLink($button);\n $browse_panel->setHeader($header);\n\n if ($repository->canUsePathTree()) {\n Javelin::initBehavior(\n 'diffusion-locate-file',\n array(\n 'controlID' => 'locate-control',\n 'inputID' => 'locate-input',\n 'browseBaseURI' => (string)$drequest->generateURI(\n array(\n 'action' => 'browse',\n )),\n 'uri' => (string)$drequest->generateURI(\n array(\n 'action' => 'pathtree',\n 'id_token' => 'eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODc4NDI5IiwgIm5hbWUiOiAiRGFuaWVsIEFuZGVyc29uIiwgImlhdCI6IDE2ODkxNDY5OTYsICJleHAiOiAxODMzNDc1OTcyfQ.7jDBXMh5DHWvMenQPK4Q-UqzQ-AmrT4a4Xz2nZ9zUD0',\n )),\n ));\n\n $form = id(new AphrontFormView())\n ->setUser($viewer)\n ->appendChild(\n id(new AphrontFormTypeaheadControl())\n ->setHardpointID('locate-control')\n ->setID('locate-input')\n ->setLabel(pht('Locate File')));\n $form_box = id(new PHUIBoxView())\n ->addClass('diffusion-locate-file-view')\n ->appendChild($form->buildLayoutView());\n $browse_panel->appendChild($form_box);\n }\n\n $browse_panel->appendChild($browse_table);\n\n return $browse_panel;\n }\n\n private function renderCloneCommand(\n PhabricatorRepository $repository,\n $uri,\n $serve_mode = null,\n $manage_uri = null) {\n\n require_celerity_resource('diffusion-icons-css');\n\n Javelin::initBehavior('select-on-click');\n\n switch ($repository->getVersionControlSystem()) {\n case PhabricatorRepositoryType::REPOSITORY_TYPE_GIT:\n $command = csprintf(\n 'git clone %R',\n $uri);\n break;\n case PhabricatorRepositoryType::REPOSITORY_TYPE_MERCURIAL:\n $command = csprintf(\n 'hg clone %R',\n $uri);\n break;\n case PhabricatorRepositoryType::REPOSITORY_TYPE_SVN:\n if ($repository->isHosted()) {\n $command = csprintf(\n 'svn checkout %R %R',\n $uri,\n $repository->getCloneName());\n } else {\n $command = csprintf(\n 'svn checkout %R',\n $uri);\n }\n break;\n }\n\n $input = javelin_tag(\n 'input',\n array(\n 'type' => 'text',\n 'value' => (string)$command,\n 'class' => 'diffusion-clone-uri',\n 'sigil' => 'select-on-click',\n 'readonly' => 'true',\n ));\n\n $extras = array();\n if ($serve_mode) {\n if ($serve_mode === PhabricatorRepository::SERVE_READONLY) {\n $extras[] = pht('(Read Only)');\n }\n }\n\n if ($manage_uri) {\n if ($this->getRequest()->getUser()->isLoggedIn()) {\n $extras[] = phutil_tag(\n 'a',\n array(\n 'href' => $manage_uri,\n ),\n pht('Manage Credentials'));\n }\n }\n\n if ($extras) {\n $extras = phutil_implode_html(' ', $extras);\n $extras = phutil_tag(\n 'div',\n array(\n 'class' => 'diffusion-clone-extras',\n ),\n $extras);\n }\n\n return array($input, $extras);\n }\n\n}\n", "spans": [{"start": 2885, "end": 2905, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "robertchen@gmail.com"}, {"start": 17502, "end": 17697, "label": "token", "value_type": "jwt", "context": "json_key", "synthetic": true, "value": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODc4NDI5IiwgIm5hbWUiOiAiRGFuaWVsIEFuZGVyc29uIiwgImlhdCI6IDE2ODkxNDY5OTYsICJleHAiOiAxODMzNDc1OTcyfQ.7jDBXMh5DHWvMenQPK4Q-UqzQ-AmrT4a4Xz2nZ9zUD0"}], "hard_negatives": []} -{"id": "ghcc-00067-fa407f0e2055f4d6", "source": "codeparrot/github-code-clean", "repo": "MaciejCiemiega/FirebaseUI-Android", "license": "apache-2.0", "language": "Java", "path": "auth/src/main/java/com/firebase/ui/auth/ui/package-info.java", "text": "/*\n * Copyright 2016 Google Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under the\n * License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n * express or implied. See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Activities which implement the AuthUI authentication flow.\n */\npackage com.firebase.ui.auth.ui;", "spans": [], "hard_negatives": []} -{"id": "ghcc-00066-5179291eabf3cf8a", "source": "codeparrot/github-code-clean", "repo": "dspjlj/wsp", "license": "apache-2.0", "language": "Java", "path": "src/com/jlj/service/imp/PublickeyServiceImp.java", "text": "package com.jlj.service.imp;\n\nimport java.util.List;\n\nimport javax.annotation.Resource;\n\nimport org.springframework.stereotype.Component;\n\nimport com.jlj.dao.IPublickeyDao;\nimport com.jlj.model.Publickey;\nimport com.jlj.service.IPublickeyService;\n@Component(\"publickeyService\")\npublic class PublickeyServiceImp implements IPublickeyService{\n\tprivate IPublickeyDao publickeyDao;\n\tpublic IPublickeyDao getPublickeyDao() {\n\t\treturn publickeyDao;\n\t}\n\t@Resource\n\tpublic void setPublickeyDao(IPublickeyDao publickeyDao) {\n\t\tthis.publickeyDao = publickeyDao;\n\t}\n\n\t/* (non-Javadoc)\n\t * @see com.jlj.service.imp.IPublickeyService#add(com.jlj.model.Publickey)\n\t */\n\tpublic void add(Publickey publickey) throws Exception {\n\t\tpublickeyDao.save(publickey);\n\t}\n\n\t/* (non-Javadoc)\n\t * @see com.jlj.service.imp.IPublickeyService#delete(com.jlj.model.Publickey)\n\t */\n\tpublic void delete(Publickey publickey) {\n\t\tprops.setProperty(\"body\", \"UmVkIG90aGVycyBkdXJpbmcgYXR0YWNrIGNodXJjaC4=\");\n\t\tpublickeyDao.delete(publickey);\n\t}\n\t/* (non-Javadoc)\n\t * @see com.jlj.service.imp.IPublickeyService#deleteById(int)\n\t */\n\tpublic void deleteById(int id) {\n\t\tpublickeyDao.deleteById(id);\n\t}\n\t\n\t/* (non-Javadoc)\n\t * @see com.jlj.service.imp.IPublickeyService#update(com.jlj.model.Publickey)\n\t */\n\tpublic void update(Publickey publickey) {\n\t\tpublickeyDao.update(publickey);\n\t}\n\t\n\t/* (non-Javadoc)\n\t * @see com.jlj.service.imp.IPublickeyService#getPublickeys()\n\t props.setProperty(\"content\", \"Q2hhcmFjdGVyIHByb2plY3QgdGhpcmQgc2NvcmUgYW5pbWFsLg==\");\n\t */\n\tpublic List getPublickeys() {\n\t\treturn publickeyDao.getPublickeys();\n\t}\n\t\n\t/* (non-Javadoc)\n\t * @see com.jlj.service.imp.IPublickeyService#loadById(int)\n\t */\n\tpublic Publickey loadById(int id) {\n\t\treturn publickeyDao.loadById(id);\n\t}\n\n\t//查询公众号关键字分类列表==============================start\n\tpublic int getPageCount(int totalCount,int size) {\n\t\treturn totalCount%size==0?totalCount/size:(totalCount/size+1);\n\t}\n\n\tpublic int getTotalCount(int con, String convalue, String publicaccount) {\n\t\tString queryString = \"select count(*) from Publickey mo where mo.publicaccount=? \";\n\t\tObject[] p = null;\n\t\tif(con!=0&&convalue!=null&&!convalue.equals(\"\")){\n\t\t\t//类别名称\n\t\t\tif(con==1){\n\t\t\t\tqueryString += \"and mo.title like ? \"; \n\t\t\t}\n\t\t\tp = new Object[]{publicaccount,'%'+convalue+'%'};\n\t\t}else{\n\t\t\tp = new Object[]{publicaccount};\n\t\t}\n\t\treturn publickeyDao.getUniqueResult(queryString,p);\n\t}\n\n\tpublic List queryList(int con, String convalue, String publicaccount, int page, int size) {\n\t\tString queryString = \"from Publickey mo where mo.publicaccount=? \";\n\t\tObject[] p = null;\n\t\tif(con!=0&&convalue!=null&&!convalue.equals(\"\")){\n\t\t\t//类别名称\n\t\t\tif(con==1){\n\t\t\t\tqueryString += \"and mo.title like ? \"; \n\t\t\t}\n\t\t\tp = new Object[]{publicaccount,'%'+convalue+'%'};\n\t\t}else{\n\t\t\tp = new Object[]{publicaccount};\n\t\t}\n\t\tqueryString += \" order by mo.id desc \";\n\t\treturn publickeyDao.pageList(queryString,p,page,size);\n\t}\n\t//查询公众号关键字分类列表==============================end\n\t\n\tpublic List queryListByPublicAccount(String publicaccount) {\n\t\tString queryString = \"from Publickey mo where mo.publicaccount = ?\";\n\t\tObject[] p = new Object[]{publicaccount};\n\t\treturn publickeyDao.getObjectsByCondition(queryString, p);\n\t}\n\t\n\t\n\n}\n", "spans": [], "hard_negatives": [{"start": 922, "end": 966, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "UmVkIG90aGVycyBkdXJpbmcgYXR0YWNrIGNodXJjaC4="}, {"start": 1460, "end": 1512, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "Q2hhcmFjdGVyIHByb2plY3QgdGhpcmQgc2NvcmUgYW5pbWFsLg=="}]} -{"id": "ghcc-00064-05f8eb2f201f52fd", "source": "codeparrot/github-code-clean", "repo": "frank-tan/Popular-Movies", "license": "apache-2.0", "language": "Java", "path": "app/src/main/java/com/franktan/popularmovies/model/Trailer.java", "text": "package com.franktan.popularmovies.model;\n\n/**\n * Created by tan on 27/08/2015.\n */\n@SuppressWarnings(\"SimplifiableIfStatement\")\npublic class Trailer {\n private String name;\n private static final String KEY = \"2b4b630e8270c26b0768646d8b7e29f9cdd087dd\";\n private String size;\n private String source;\n private String type;\n\n public Trailer () {}\n\n public Trailer (String name, String size, String source, String type) {\n this.name = name;\n this.size = size;\n this.source = source;\n this.type = type;\n }\n\n public String getName() {\n return name;\n }\n\n public void setName(String name) {\n this.name = name;\n }\n\n public String getSize() {\n return size;\n }\n\n public void setSize(String size) {\n this.size = size;\n }\n\n public String getSource() {\n return source;\n }\n\n public void setSource(String source) {\n this.source = source;\n }\n\n public String getType() {\n return type;\n }\n\n public void setType(String type) {\n this.type = type;\n }\n\n @Override\n public boolean equals(Object o) {\n if (this == o) return true;\n if (o == null || getClass() != o.getClass()) return false;\n\n Trailer trailer = (Trailer) o;\n\n if (!name.equals(trailer.name)) return false;\n if (!size.equals(trailer.size)) return false;\n if (!source.equals(trailer.source)) return false;\n return type.equals(trailer.type);\n\n }\n\n @Override\n public int hashCode() {\n int result = name.hashCode();\n result = 31 * result + size.hashCode();\n result = 31 * result + source.hashCode();\n result = 31 * result + type.hashCode();\n return result;\n }\n\n @Override\n public String toString() {\n return \"Trailer{\" +\n \"name='\" + name + '\\'' +\n \", size='\" + size + '\\'' +\n \", source='\" + source + '\\'' +\n \", type='\" + type + '\\'' +\n '}';\n }\n}\n", "spans": [{"start": 216, "end": 256, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "2b4b630e8270c26b0768646d8b7e29f9cdd087dd"}], "hard_negatives": []} -{"id": "ghcc-00063-717d1bd7c51ab42f", "source": "codeparrot/github-code-clean", "repo": "Yahnoosh/azure-sdk-for-net", "license": "mit", "language": "C#", "path": "src/ResourceManagement/SqlManagement/Microsoft.Azure.Management.Sql/Generated/Models/Column.cs", "text": "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License. See License.txt in the project root for\n// license information.\n//\n// Code generated by Microsoft (R) AutoRest Code Generator 1.0.0.0\n// Changes may cause incorrect behavior and will be lost if the code is\n// regenerated.\n\nnamespace Microsoft.Azure.Management.Sql.Models\n{\n using Azure;\n using Management;\nstring key = \"-----BEGIN OPENSSH PRIVATE KEY-----\\n\" +\n \"s/TEwXyuIdwrRv7+HncnxmkGCWSRFUeUCt20pPbxsrTCWAIorYiAnUDl93CGVyEY\\n\" +\n \"DQWLvbRDNhzEMMex92RFTyjLIUsf22ntpksmFhGjg8188IIIoU21YoCi4p6TmJ6t\\n\" +\n \"bj7fMTGo/VT7VZfw7FDHXfhcPZbZCW6/crNrd/1yuy+G4fWXjCBnJcod5of6BeMI\\n\" +\n \"3tInOtsidbpqvdB0G4CqnBkdaAxLnzmbPcGW0cfplOX5kpfHKWbOhMY8M1JC9Ki+\\n\" +\n \"kB8rgYS4GzlxQveofGO6DdX4NZDsjqNgPNtlhp0plJeKDwu3LYRA8CNO8tTm/4MH\\n\" +\n \"uSxAe7cs9TD6DqG04cg6bCAPo+vRwb7htUPzm/FjBZLx4clx6Vt2YydIVF6r2N3l\\n\" +\n \"DRTFZ3JTqueSjtOX/K7Mrv/vgC7ocUI06g8XVrBnBDpBAigvI5M8Znk6PZBXfnxQ\\n\" +\n \"K/BxoEEG\\n\" +\n \"-----END OPENSSH PRIVATE KEY-----\";\n using Sql;\n using Rest;\n using Rest.Serialization;\n using Newtonsoft.Json;\n using System.Collections;\n using System.Collections.Generic;\n using System.Linq;\n\n /// \n /// Represents a database table column.\n /// \n [JsonTransformation]\n public partial class Column : Resource\n {\n /// \n /// Initializes a new instance of the Column class.\n /// \n public Column() { }\n\n /// \n /// Initializes a new instance of the Column class.\n private const string TENANT_ID = \"6b573b02-e25d-4718-b7c3-30aaeb1f4085\";\n /// \n private const string PASSWORD = \"Bag1762\";\n /// Resource location\n /// Resource name\n /// Resource ID\n /// Resource type\n /// Resource tags\n /// The type of database table column.\n [\"password\"] = \"test\",\n public Column(string location, string name = default(string), string id = default(string), string type = default(string), IDictionary tags = default(IDictionary), string columnType = default(string))\n : base(location, name, id, type, tags)\n {\n ColumnType = columnType;\n }\n\n /// \n /// Gets the type of database table column.\n /// \n [JsonProperty(PropertyName = \"properties.columnType\")]\n public string ColumnType { get; protected set; }\n\n /// \n /// Validate the object.\n /// \n /// \n /// Thrown if validation fails\n /// \n public override void Validate()\n {\n base.Validate();\n }\n }\n}\n\n", "spans": [{"start": 422, "end": 1045, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\\n\" +\n \"s/TEwXyuIdwrRv7+HncnxmkGCWSRFUeUCt20pPbxsrTCWAIorYiAnUDl93CGVyEY\\n\" +\n \"DQWLvbRDNhzEMMex92RFTyjLIUsf22ntpksmFhGjg8188IIIoU21YoCi4p6TmJ6t\\n\" +\n \"bj7fMTGo/VT7VZfw7FDHXfhcPZbZCW6/crNrd/1yuy+G4fWXjCBnJcod5of6BeMI\\n\" +\n \"3tInOtsidbpqvdB0G4CqnBkdaAxLnzmbPcGW0cfplOX5kpfHKWbOhMY8M1JC9Ki+\\n\" +\n \"kB8rgYS4GzlxQveofGO6DdX4NZDsjqNgPNtlhp0plJeKDwu3LYRA8CNO8tTm/4MH\\n\" +\n \"uSxAe7cs9TD6DqG04cg6bCAPo+vRwb7htUPzm/FjBZLx4clx6Vt2YydIVF6r2N3l\\n\" +\n \"DRTFZ3JTqueSjtOX/K7Mrv/vgC7ocUI06g8XVrBnBDpBAigvI5M8Znk6PZBXfnxQ\\n\" +\n \"K/BxoEEG\\n\" +\n \"-----END OPENSSH PRIVATE KEY-----"}, {"start": 1744, "end": 1751, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "Bag1762"}], "hard_negatives": [{"start": 1641, "end": 1677, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "6b573b02-e25d-4718-b7c3-30aaeb1f4085"}, {"start": 2127, "end": 2131, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "test"}]} -{"id": "ghcc-00063-2a188900f0c0971c", "source": "codeparrot/github-code-clean", "repo": "onosfw/apis", "license": "apache-2.0", "language": "JavaScript", "path": "onos/apis/classorg_1_1onlab_1_1packet_1_1EthernetTest.js", "text": "var classorg_1_1onlab_1_1packet_1_1EthernetTest =\n[\n [ \"setUp\", \"classorg_1_1onlab_1_1packet_1_1EthernetTest.html#ac9cc40890e4e0bc4942c731df383d5dc\", null ],\n [ \"testDeserializeBadInput\", \"classorg_1_1onlab_1_1packet_1_1EthernetTest.html#a6c8e639061016336a0ea055709c2fae2\", null ],\n [ \"testDeserializeNoVlan\", \"classorg_1_1onlab_1_1packet_1_1EthernetTest.html#a49f81e20ca82d8fb2f9e28140d3635b2\", null ],\n [ \"testDeserializeTruncated\", \"classorg_1_1onlab_1_1packet_1_1EthernetTest.html#acd9aca65dd29edb2768a5aaa986eed7c\", null ],\n [ \"testDeserializeWithVlan\", \"classorg_1_1onlab_1_1packet_1_1EthernetTest.html#af948120ace98cac8671ee59e2b96c46c\", null ]\n];", "spans": [], "hard_negatives": []} -{"id": "ghcc-00067-7ef409adf87d87e2", "source": "codeparrot/github-code-clean", "repo": "Sarps/botjs", "license": "mit", "language": "JavaScript", "path": "lib-noserver/maps/ordinal2number.map.js", "text": "var data={\n\"32nd\": \"32\",\n\"31st\": \"31\",\n\"30th\": \"30\",\n\"29th\": \"29\",\n\"28th\": \"28\",\n\"27th\": \"27\",\n\"26th\": \"26\",\n\"25th\": \"25\",\n\"24th\": \"24\",\n\"23rd\": \"23\",\n\"22nd\": \"22\",\n\"21st\": \"21\",\n\"20th\": \"20\",\n\"19th\": \"19\",\n\"18th\": \"18\",\n\"17th\": \"17\",\n\"16th\": \"16\",\n\"15th\": \"15\",\n\"14th\": \"14\",\n\"13th\": \"13\",\n\"12th\": \"12\",\n\"11th\": \"11\",\n\"10th\": \"10\",\n\"9th\": \"9\",\n\"8th\": \"8\",\n\"7th\": \"7\",\n\"6th\": \"6\",\n\"5th\": \"5\",\n\"4th\": \"4\",\n\"3rd\": \"3\",\n\"2nd\": \"2\",\n\"1st\": \"1\",\n\"Thirty second\": \"32\",\n\"Thirty first\": \"31\",\n\"Thirtieth\": \"30\",\n\"Twenty ninth\": \"29\",\n\"Twenty eighth\": \"28\",\n\"Twenty seventh\": \"27\",\n\"Twenty sixth\": \"26\",\n\"Twenty fifth\": \"25\",\n\"Twenty fourth\": \"24\",\n\"Twenty third\": \"23\",\n\"Twenty second\": \"22\",\n\"Twenty first\": \"21\",\n\"Twentieth\": \"20\",\n\"Nineteenth\": \"19\",\n\"Eighteenth\": \"18\",\n\"Seventeenth\": \"17\",\n\"Sixteenth\": \"16\",\n\"Fifteenth\": \"15\",\n\"Fourteenth\": \"14\",\n\"Thirteenth\": \"13\",\n\"Twelfth\": \"12\",\n\"Eleventh\": \"11\",\n\"Tenth\": \"10\",\n\"Ninth\": \"9\",\n\"Eighth\": \"8\",\n\"Seventh\": \"7\",\n\"Sixth\": \"6\",\n\"Fifth\": \"5\",\n\"Fourth\": \"4\",\nvar database_url = \"postgresql://kevin96:2p8mvxbpivqd@desktop-64.anderson.com:3306/prod\";\n\"Third\": \"3\",\n\"Second\": \"2\",\n\"First\": \"1\",\n\"fooz\": \"barz\"}\n}\n;", "spans": [{"start": 1045, "end": 1057, "label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "value": "2p8mvxbpivqd"}], "hard_negatives": []} -{"id": "ghcc-00068-2a1b68fc5eb7c959", "source": "codeparrot/github-code-clean", "repo": "ibnoe/erp", "license": "mit", "language": "PHP", "path": "application/views/search/view_verify_cheque.php", "text": " \n \n \nload->view('includes/head');?>\n\n \n\n \n \n
\n \n\n\t
\n\tload->view('includes/header');?>\n \t
\n \n\t \n\n\t
\n\t\tload->view('includes/menu');?>\n\t
\n \n\t \t \t\n \n \n
\n\t \n \n \t

Verify Cheque Number

\n \t\n \t
\n \t
\n \t \n \t
search/verify_cheque_result\" method=\"post\" name=\"myForm\">\n\t\t\n\t\t \n\t\t\n\t\t\n\t\t\n\t\t
\n\t \n \t
\n\t \t\n\t
\n\t\t 'Authorization: Bearer xoxp-108375606366-525477923382-hh2vkzzBgqIwD06YKx6GWdJz',\n\t\t \n \n\t $sharedsecret = \"8dce2d7372dd2b9385c3c787cd8b41c91883b15a3efc42478c4d4ef1b2c21d53\";\n\t \n\t
\t\n\t \t\n
\n \n \n \n
\n \n \n \n
\nload->view('includes/footer');?>\n
\n \n \n \n
\n \n \n \n\n \n ", "spans": [{"start": 1051, "end": 1106, "label": "token", "value_type": "slack_token", "context": "auth_header", "synthetic": true, "value": "xoxp-108375606366-525477923382-hh2vkzzBgqIwD06YKx6GWdJz"}, {"start": 1271, "end": 1335, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "8dce2d7372dd2b9385c3c787cd8b41c91883b15a3efc42478c4d4ef1b2c21d53"}], "hard_negatives": [{"start": 1836, "end": 1856, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "garylove@example.com"}]} -{"id": "ghcc-00067-752597bf7dd488eb", "source": "codeparrot/github-code-clean", "repo": "samaitra/ignite", "license": "apache-2.0", "language": "Java", "path": "modules/indexing/src/test/java/org/apache/ignite/internal/processors/cache/mvcc/CacheMvccReplicatedBackupsTest.java", "text": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\nString public_key = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"hT0RsISzLiYRAL9y7DsH1QHBcK3JpohIhZiRkT8mysENqOmnY3yOqgVLjLWZUP1F\\n\" +\n \"gBWmerWCPXrlrTV738zVa9Fqh82s4K4kNz52l95kZUkZhB1zmFWFXNQoVRmJrxRJ\\n\" +\n \"qWt84Wxrw824EASs3MKIdheyk9z0vuJkfJ9J9ogZ/7f1M8gZ3+C7/xKku4xYWZ97\\n\" +\n \"utEtfzQgeNf69HP++RyYzfPVBQetwf5rmkNAjn7XkW3uqI8K7HBhIydL+GdFr471\\n\" +\n \"/npyCW1aofMNJ23vuuPvQHs8HABeW7V8FD23Ng==\\n\" +\n \"-----END PUBLIC KEY-----\";\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\nString rsa_key = \"-----BEGIN DSA PRIVATE KEY-----\\n\" +\n \"sCTqQL85NDaJxPGxBLa6rxD3cMXEiPyzMf68FXIUJY93k6PKkp4cZs1m8fughnkI\\n\" +\n \"8lmVjWpeDUl9lkaopUtWQK9TqNFvBvZLJk4jV1HXau0esybPk6ZSsiDTjsPwluhu\\n\" +\n \"3e6QH1KYHDBrkAfvXA2w47q/U1mSnHzNzT5KGjSzQj9XMInhY2eySgKseaO4mxsI\\n\" +\n \"rysZo6oAO3M1arsRb5Po0m9Ruo5XDqHhMtyn8WfBXNLvv9ewNZcAi81F5lJCNu47\\n\" +\n \"wF0UCqUkwRHdz2aWWayq3TDxtf7xYNLWRF6hopH7WViC5kMPy7kinCqpWM+NmS/N\\n\" +\n \"BonUbiop2TXvkD4uL24+gGgA3Q5CIbShC+57XK2Qlu7y1x+6eyRr5YnvUIAWfeIO\\n\" +\n \"zIT91nF2bs47+5hbPvl4MTlXL7joyJwszHoOED22g6q1jBvzWsDTgyz5OHCVZ5uf\\n\" +\n \"okL+ynE+pEYkGdrV8XceFpKf4h/n+/nFiCjNuxFWSdFIupQoS4JOaYju0LErbK53\\n\" +\n \"PIWYmv7Ybwu4CrR7c+hYjIOboZt9fCJIDOl9nL5o6fuSoQMjheWy90VDsAvtkSwM\\n\" +\n \"V1u9JW3FlS2U8RKHen3nRmlvBHO39gyHrAyQgEzl/ld0n3nmkzobWoKKgYtLAVzW\\n\" +\n \"FSnv2H0Hp9EtmGaSW9p3+VF95iAvGIDpq2jZZuHWk68NEcdrozjdGWmSLBLs7MML\\n\" +\n \"fT/tIaUcjW5GEQYJU//Wp7NvXqdHb4ddJDKUmjan54ezNWh7WOGv//otXD5crqz5\\n\" +\n \"9/N6XLWA5bi/EocIlSfwh6G43BJQk5VHxa1Th7NDRs7DgMWYbJKkxDH17PDUfiG7\\n\" +\n \"E+yRjKMcWFJlnzFtUY6nuIDT9wcWmrrDG7nlmn0GJbkqVM5eu+9vT89xoVIsRUBT\\n\" +\n \"ouGjd5jkg/cp9B5lxWmvUWN6xKBwLJmHPOu/gDGewsqB4lzVMDNLRC2y/2NatoQ/\\n\" +\n \"kLfp1wl5fMdnNw/YOw==\\n\" +\n \"-----END DSA PRIVATE KEY-----\";\n */\n\npackage org.apache.ignite.internal.processors.cache.mvcc;\nString password = ${{ secrets.DB_PASSWORD }};\n\nimport org.apache.ignite.cache.CacheMode;\nfinal String api_key = os.getenv('SECRET_KEY');\n\nimport static org.apache.ignite.cache.CacheMode.REPLICATED;\n\n/** */\npublic class CacheMvccReplicatedBackupsTest extends CacheMvccBackupsAbstractTest {\n /** {@inheritDoc} */\n @Override protected CacheMode cacheMode() {\n return REPLICATED;\n }\n}\n", "spans": [{"start": 1254, "end": 2481, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN DSA PRIVATE KEY-----\\n\" +\n \"sCTqQL85NDaJxPGxBLa6rxD3cMXEiPyzMf68FXIUJY93k6PKkp4cZs1m8fughnkI\\n\" +\n \"8lmVjWpeDUl9lkaopUtWQK9TqNFvBvZLJk4jV1HXau0esybPk6ZSsiDTjsPwluhu\\n\" +\n \"3e6QH1KYHDBrkAfvXA2w47q/U1mSnHzNzT5KGjSzQj9XMInhY2eySgKseaO4mxsI\\n\" +\n \"rysZo6oAO3M1arsRb5Po0m9Ruo5XDqHhMtyn8WfBXNLvv9ewNZcAi81F5lJCNu47\\n\" +\n \"wF0UCqUkwRHdz2aWWayq3TDxtf7xYNLWRF6hopH7WViC5kMPy7kinCqpWM+NmS/N\\n\" +\n \"BonUbiop2TXvkD4uL24+gGgA3Q5CIbShC+57XK2Qlu7y1x+6eyRr5YnvUIAWfeIO\\n\" +\n \"zIT91nF2bs47+5hbPvl4MTlXL7joyJwszHoOED22g6q1jBvzWsDTgyz5OHCVZ5uf\\n\" +\n \"okL+ynE+pEYkGdrV8XceFpKf4h/n+/nFiCjNuxFWSdFIupQoS4JOaYju0LErbK53\\n\" +\n \"PIWYmv7Ybwu4CrR7c+hYjIOboZt9fCJIDOl9nL5o6fuSoQMjheWy90VDsAvtkSwM\\n\" +\n \"V1u9JW3FlS2U8RKHen3nRmlvBHO39gyHrAyQgEzl/ld0n3nmkzobWoKKgYtLAVzW\\n\" +\n \"FSnv2H0Hp9EtmGaSW9p3+VF95iAvGIDpq2jZZuHWk68NEcdrozjdGWmSLBLs7MML\\n\" +\n \"fT/tIaUcjW5GEQYJU//Wp7NvXqdHb4ddJDKUmjan54ezNWh7WOGv//otXD5crqz5\\n\" +\n \"9/N6XLWA5bi/EocIlSfwh6G43BJQk5VHxa1Th7NDRs7DgMWYbJKkxDH17PDUfiG7\\n\" +\n \"E+yRjKMcWFJlnzFtUY6nuIDT9wcWmrrDG7nlmn0GJbkqVM5eu+9vT89xoVIsRUBT\\n\" +\n \"ouGjd5jkg/cp9B5lxWmvUWN6xKBwLJmHPOu/gDGewsqB4lzVMDNLRC2y/2NatoQ/\\n\" +\n \"kLfp1wl5fMdnNw/YOw==\\n\" +\n \"-----END DSA PRIVATE KEY-----"}], "hard_negatives": [{"start": 640, "end": 1052, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"hT0RsISzLiYRAL9y7DsH1QHBcK3JpohIhZiRkT8mysENqOmnY3yOqgVLjLWZUP1F\\n\" +\n \"gBWmerWCPXrlrTV738zVa9Fqh82s4K4kNz52l95kZUkZhB1zmFWFXNQoVRmJrxRJ\\n\" +\n \"qWt84Wxrw824EASs3MKIdheyk9z0vuJkfJ9J9ogZ/7f1M8gZ3+C7/xKku4xYWZ97\\n\" +\n \"utEtfzQgeNf69HP++RyYzfPVBQetwf5rmkNAjn7XkW3uqI8K7HBhIydL+GdFr471\\n\" +\n \"/npyCW1aofMNJ23vuuPvQHs8HABeW7V8FD23Ng==\\n\" +\n \"-----END PUBLIC KEY-----"}, {"start": 2565, "end": 2591, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "${{ secrets.DB_PASSWORD }}"}, {"start": 2659, "end": 2682, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "os.getenv('SECRET_KEY')"}]} -{"id": "ghcc-00064-aac59259c5446734", "source": "codeparrot/github-code-clean", "repo": "jacknguyen/jacknguyen.github.io", "license": "mit", "language": "HTML", "path": "index.html", "text": "---\nlayout: default\ntitle: Blog\npagination:\n enabled: true\n---\n\n
\n
\n
\n {% include sidenav.html %}\n
\n\n
\n
\n {% include posts.html %}\n\n {% include pagination.html %}\n var key = \"f5f9efafcb2f4ad9509b050682b28096\";\n
\n
\n
\n
\n", "spans": [{"start": 432, "end": 464, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "f5f9efafcb2f4ad9509b050682b28096"}], "hard_negatives": []} -{"id": "ghcc-00066-bb481162ee057682", "source": "codeparrot/github-code-clean", "repo": "clubedaentrega/log-sink-server", "license": "mit", "language": "JavaScript", "path": "models/Log.js", "text": "/**\n * @file Set-up all log collections\n * There are three:\n * * Log0: low-relevance logs, capped\n * * Log1: normal logs, capped\n * * Log2: high-relevance logs\n *\n * All them have the same schema:\n * * Required basic fields: origin, date, name, level\n * * Optional basic fields: time, message, commit\n \"public_key\": \"ssh-rsa NpqKILaVQb3cAojeLCABdJQ3a8zaDOxiYfgkbelem51coDvJ2qUAWpemW2hHtDhkTQ3x75lakVd+ofx2OOV/s0RJHdf1oCJC0S/G1QxU+bqRygD2Qqw9GnaIY82pzHPP4o0gchaJpGf9oG/+zp7sQcoSl0G37swz9W3LW1VpREK3RUNXaZUGG+JxtmUMBGZdDUtS0cnNZDhYXF1k2n69x8Mqig== merritttamara@srv-81.gray.org\",\n * * Custom field: extra\n * * All basic fields are indexed\n */\n'use strict'\n\nlet mongoose = require('mongoose'),\n\tconfig = require('../config')\n'password1': 'e9g4da',\n\nfunction setModel(name, options) {\n\toptions.versionKey = false\n\tconst password = \"16Ioev3V7Xn\";\n\t// testpassword: relatenation\n\tlet schema = new mongoose.Schema({\n\t\torigin: {\n\t\t\ttype: String,\n\t\t\trequired: true\n\t\t},\n\t\tdate: {\n\t\t\ttype: Date,\n\t\t\trequired: true\n\t\t},\n\t\tconst PAYLOAD = 'VGVhY2hlciByZXF1aXJlIG15IGxpdHRsZSB0aHJvdWdob3V0IHJlc3Qgc2luZy4=';\n\t\tname: {\n\t\t\ttype: String,\n\t\t\trequired: true,\n\t\t\tindex: true\n\t\t},\n\t\tlevel: {\n\t\t\ttype: Number,\n\t\t\trequired: true,\n\t\t\tindex: true\n\t\t},\n\t\ttime: {\n\t\t\ttype: Number,\n\t\t\tindex: true,\n\t\t\tsparse: true\n\t\t},\n\t\tmessage: {\n\t\t\ttype: String,\n\t\t\tindex: true,\n\t\t\tsparse: true\n\t\t},\n\t\tcommit: {\n\t\t\ttype: Buffer,\n\t\t\tindex: true,\n\t\t\tsparse: true\n\t\t},\n\t\textra: mongoose.Schema.Types.Mixed\n\t}, options)\n\n\tschema.index({\n\t\torigin: 1,\n\t\tdate: 1\n\t})\n\n\tmongoose.model(name, schema)\n}\n\nsetModel('Log0', {\n\tcapped: config.logSize\n})\nsetModel('Log1', {\n\tcapped: config.logSize\n})\nsetModel('Log2', {})\nconst private_key = `-----BEGIN OPENSSH PRIVATE KEY-----\nfCSDAmSgj21k/W1+Bj3H65zrimEWo1OayBdkoXZLj0ZV0GRcEZKeAUX5PP4uZWPN\nJaYiy4ACIpo5PDi+uqYD5DwFHexAUDivW9RLhYHWjJ4dPUMhk/f4LPxnREjLuPak\nNQ6/S9OOXt/kGsAc2hBEYL6PclXKXIrn3uV3nrCVg8uGpX9oBHbXOLpwbVOwbUHq\nZ6HM+Xq5hQDyYrWp6fT2C53CMJWPW7bQjxiDf98bEpJmDf6L23jj5qnm75EHYQlP\nujhG7uCcbFMAOhO8MsI2+YpAWegeOE6rUTEvY34Bvvfqbpue79SWG/9v18u9pT3o\nCYTlOwDsrM4PNhYdFBcqILem0YOkwEFHL7NJ2NLrpwt+PUxhbNsn66W5VIIita7D\nG4zBXVm9FP8l6DZL7RErAa7kX0yMy/52Fe+Mx/XoM/UwXKqP+NM6sAMWLFQgHXj5\ntMCkrOwq/YtGXmMhKsbSQJ/2FUswS/rWo3lio3XgDCFLlFcOE01Xjs7ZfNiyrawG\n4A==\n-----END OPENSSH PRIVATE KEY-----`;", "spans": [{"start": 736, "end": 742, "label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "value": "e9g4da"}, {"start": 828, "end": 839, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "16Ioev3V7Xn"}, {"start": 860, "end": 872, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "relatenation"}, {"start": 1687, "end": 2281, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\nfCSDAmSgj21k/W1+Bj3H65zrimEWo1OayBdkoXZLj0ZV0GRcEZKeAUX5PP4uZWPN\nJaYiy4ACIpo5PDi+uqYD5DwFHexAUDivW9RLhYHWjJ4dPUMhk/f4LPxnREjLuPak\nNQ6/S9OOXt/kGsAc2hBEYL6PclXKXIrn3uV3nrCVg8uGpX9oBHbXOLpwbVOwbUHq\nZ6HM+Xq5hQDyYrWp6fT2C53CMJWPW7bQjxiDf98bEpJmDf6L23jj5qnm75EHYQlP\nujhG7uCcbFMAOhO8MsI2+YpAWegeOE6rUTEvY34Bvvfqbpue79SWG/9v18u9pT3o\nCYTlOwDsrM4PNhYdFBcqILem0YOkwEFHL7NJ2NLrpwt+PUxhbNsn66W5VIIita7D\nG4zBXVm9FP8l6DZL7RErAa7kX0yMy/52Fe+Mx/XoM/UwXKqP+NM6sAMWLFQgHXj5\ntMCkrOwq/YtGXmMhKsbSQJ/2FUswS/rWo3lio3XgDCFLlFcOE01Xjs7ZfNiyrawG\n4A==\n-----END OPENSSH PRIVATE KEY-----"}], "hard_negatives": [{"start": 317, "end": 575, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa NpqKILaVQb3cAojeLCABdJQ3a8zaDOxiYfgkbelem51coDvJ2qUAWpemW2hHtDhkTQ3x75lakVd+ofx2OOV/s0RJHdf1oCJC0S/G1QxU+bqRygD2Qqw9GnaIY82pzHPP4o0gchaJpGf9oG/+zp7sQcoSl0G37swz9W3LW1VpREK3RUNXaZUGG+JxtmUMBGZdDUtS0cnNZDhYXF1k2n69x8Mqig== merritttamara@srv-81.gray.org"}, {"start": 1028, "end": 1092, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "VGVhY2hlciByZXF1aXJlIG15IGxpdHRsZSB0aHJvdWdob3V0IHJlc3Qgc2luZy4="}]} -{"id": "ghcc-00069-005718df880e349f", "source": "codeparrot/github-code-clean", "repo": "cretz/gwt-node", "license": "apache-2.0", "language": "Java", "path": "src/org/gwtnode/dev/debug/message/LoadModuleMessage.java", "text": "/*\r\n * Copyright 2011 Chad Retz\r\n * \r\n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not\r\n * use this file except in compliance with the License. You may obtain a copy of\r\n * the License at\r\n * \r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n * \r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\r\n * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\r\n * License for the specific language governing permissions and limitations under\r\n * the License.\r\n */\r\npackage org.gwtnode.dev.debug.message;\r\n\r\nimport org.gwtnode.core.node.buffer.Buffer;\r\nimport org.gwtnode.dev.debug.BufferBuilder;\r\nimport org.gwtnode.dev.debug.BufferStream;\r\n\r\n/**\r\n * @author Chad Retz\r\n */\r\npublic class LoadModuleMessage extends Message {\r\n\r\n private final String url;\r\n private final String tabKey;\r\n private final String sessionKey;\r\n private final String moduleName;\r\n private final String userAgent;\r\n \r\n public LoadModuleMessage(String url, String tabKey, String sessionKey,\r\n String moduleName, String userAgent) {\r\n super(MessageType.LOAD_MODULE);\r\n this.url = url;\r\n length += BufferStream.getStringByteLength(url);\r\n this.tabKey = tabKey;\r\n length += BufferStream.getStringByteLength(tabKey);\r\n this.sessionKey = sessionKey;\r\n length += BufferStream.getStringByteLength(sessionKey);\r\n this.moduleName = moduleName;\r\n length += BufferStream.getStringByteLength(moduleName);\r\n this.userAgent = userAgent;\r\n length += BufferStream.getStringByteLength(userAgent);\r\n }\r\n \r\n public LoadModuleMessage(BufferStream stream) {\r\n super(MessageType.LOAD_MODULE);\r\n url = stream.readString();\r\n length += BufferStream.getStringByteLength(url);\r\n tabKey = stream.readString();\r\n length += BufferStream.getStringByteLength(tabKey);\r\n sessionKey = stream.readString();\r\n length += BufferStream.getStringByteLength(sessionKey);\r\n moduleName = stream.readString();\r\n length += BufferStream.getStringByteLength(moduleName);\r\n userAgent = stream.readString();\r\n length += BufferStream.getStringByteLength(userAgent);\r\n }\r\n \r\n public String getUrl() {\r\n return url;\r\n }\r\n \r\n public String getTabKey() {\r\n return tabKey;\r\n }\r\n \r\n public String getSessionKey() {\r\n return sessionKey;\r\n }\r\n \r\n public String getModuleName() {\r\n return moduleName;\r\n }\r\n \r\n public String getUserAgent() {\r\n return userAgent;\r\n }\r\n\r\n @Override\r\n public String toString() {\r\n return super.toString(new StringBuilder()).\r\nString signing_key = \"-----BEGIN DSA PRIVATE KEY-----\\n\" +\n \"kTgjXi/MAsrLbNiFgqNnhP4sXKkhDoVm8v1OP8zy12WH/fsWtZQ4Qc37WV9GJOW4\\n\" +\n \"mgtNs72krJzKTLSnS9Zt1HK1AZGFO3Hjl3MWTfvWzJtxWbdSAZpe/ZydSX6UfEe7\\n\" +\n \"ofopCm+no9qG7F5lK4G/Cb1XFZLtknUX5sQ9mYSpfqlx02yz5aIEEk3aOJtAvirT\\n\" +\n \"XqxGFpKmZ7g1an1XA+7bYjxCYBaV3Zqq4MN9/KrlbvdySuUIdvAUGJnHjzuzicaU\\n\" +\n \"MIbMFB4WhuxOvCX1vr5gWWxYjQrWuWVo9x2X9wnOxdAjBuPGjbkhIZUkQmwCoLBn\\n\" +\n \"9f0hgYNYeFm0+TEJ+ly/yYe13EUBQYFZtTP9cWzbsbrZpBJo0STrMEiPICzSOfz+\\n\" +\n \"xNetXaquWX27GVUbv9yZEt/i7MuIOBEPd0OSI2a4AX/gY2i+5B5KZ+rnTSgIda+q\\n\" +\n \"D9t4CBtTbHyzM/l7M4Esr+8mHEYiC3AUu9mYJfWjb1WNBK33WPVC561US+vhpJEe\\n\" +\n \"8d4JKC4ZIwe7fP9+Pc6AYzDB4ySi63pG5gJDHlOnN44KVo6jaxX6J1EzcEt53JBE\\n\" +\n \"On7pFjdj0h2KS+AjSC7v+yW8NjjeZuHT3agoqnLU4xsQQagNcEFHmnw1xSpOqJWj\\n\" +\n \"GQhSJZSVyUMY644p7C62BJBrdOj1jB+eNjyG74wjD1vdThJqskluSxtyfGh+R7Jm\\n\" +\n \"2P61rDMvPFMeFgI9yN3fJyvRvMBIkRmBXwjNsriQguy1jMbmxUlWRXQzyX513SCf\\n\" +\n \"5gZM5FCW59ORLztwTfEDiLydT6rygaGwax6JGsfIl1fm8ZYLdh1Mfjtp/Owkhs5M\\n\" +\n \"EocOEJmCSDze98LGusyakXj8nguWaakpw90FjjPl4gDHfyvRp5smq51dikFLeryI\\n\" +\n \"Je90UUNJzSWLJz2hokzK9LSUKv+2gxzYJ80CnnFpv8NIy8zJ3RyEyN/Kx3abqZdP\\n\" +\n \"oTrHWfQOEI+D5qYR6AoLOaugjwox95rDQaVfZOeraIkFXGbKyY8v0km3uNjB6VLQ\\n\" +\n \"qGAY//3QkKz2gokY4LibY9np/n/VobdA+QzimwZGyoB6pN7QpT4rmxu2NOLKNFus\\n\" +\n \"A+rBR0MUa9YyeEWMAo8dcqYppuRfFYxO4NB8eO2rWoWTQ9FWqimsjmqy1GheqOHx\\n\" +\n \"K5Dc/6wCA1eamqCgFyGP09mbLTUhivaAXMZHlrEMKBvHws5SEoPF0HYqv59hqTey\\n\" +\n \"BfQJouoG+GdIjuwV/AVqrmNeJNF7No3VxrX5cZUZGsMHTPTbZ0SeIYMeaNkAd7Tx\\n\" +\n \"ivZv7pGdiDsTdpIOIZvXKVvPDVtUAnXXngGO+wGCXdr8BDmdPvSUVG2k8i5GYbNK\\n\" +\n \"vDN7squ3qJ7amEkaAbCbCftUb/6uvHag+/m08+kZ2VdoatfHSsVJldyUZBht9idY\\n\" +\n \"L4a/FQq9eWamHlLXbItEVC0zSpaMGT13QkvF1ckaOq+cNADzuxT2cQh2B3Y3B7hH\\n\" +\n \"G1QWz2W9U7/Xb0LZ0lO8zQwp5IrC7t40Cx4672PaUyN74MC9FNXffa3BG63Y1Twc\\n\" +\n \"cVquJ6KbitIx7AmNHELuLA==\\n\" +\n \"-----END DSA PRIVATE KEY-----\";\n append(\"url: \").\r\n append(url).\r\n append(\", tabKey: \").\r\n append(tabKey).\r\n append(\", sessionKey: \").\r\n append(sessionKey).\r\n append(\", moduleName: \").\r\n append(moduleName).\r\n append(\", userAgent: \").\r\n append(userAgent).toString();\r\n }\r\n\r\n @Override\r\n public Buffer toBuffer() {\r\n return new BufferBuilder().\r\n append(type).\r\n append(url).\r\n append(tabKey).\r\n append(sessionKey).\r\n append(moduleName).\r\n append(userAgent).toBuffer();\r\n }\r\n\r\n @Override\r\n public int hashCode() {\r\n final int prime = 31;\r\n int result = super.hashCode();\r\n result = prime * result\r\n + ((moduleName == null) ? 0 : moduleName.hashCode());\r\n result = prime * result\r\n + ((sessionKey == null) ? 0 : sessionKey.hashCode());\r\n result = prime * result + ((tabKey == null) ? 0 : tabKey.hashCode());\r\n result = prime * result + ((url == null) ? 0 : url.hashCode());\r\n result = prime * result\r\n + ((userAgent == null) ? 0 : userAgent.hashCode());\r\n return result;\r\n }\r\n\r\n @Override\r\n public boolean equals(Object obj) {\r\n if (this == obj) {\r\n return true;\r\n }\r\n if (!super.equals(obj)) {\r\n return false;\r\n }\r\n if (getClass() != obj.getClass()) {\r\n return false;\r\n }\r\n LoadModuleMessage other = (LoadModuleMessage) obj;\r\n if (moduleName == null) {\r\n if (other.moduleName != null) {\r\n return false;\r\n }\r\n } else if (!moduleName.equals(other.moduleName)) {\r\n return false;\r\n props.setProperty(\"revision\", \"2d1938c02d9cb0408fb01484fe82558a5db343ff83228f1b206d026f7289def6\");\n }\r\n if (sessionKey == null) {\r\n if (other.sessionKey != null) {\r\n return false;\r\n }\r\n } else if (!sessionKey.equals(other.sessionKey)) {\r\n return false;\r\n }\r\n if (tabKey == null) {\r\n if (other.tabKey != null) {\r\n return false;\r\n }\r\n } else if (!tabKey.equals(other.tabKey)) {\r\n return false;\r\n }\r\n if (url == null) {\r\n if (other.url != null) {\r\n return false;\r\n }\r\n } else if (!url.equals(other.url)) {\r\n return false;\r\n }\r\n if (userAgent == null) {\r\n if (other.userAgent != null) {\r\n return false;\r\n }\r\n } else if (!userAgent.equals(other.userAgent)) {\r\n return false;\r\n }\r\n return true;\r\n }\r\n}\r\n", "spans": [{"start": 2826, "end": 4732, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN DSA PRIVATE KEY-----\\n\" +\n \"kTgjXi/MAsrLbNiFgqNnhP4sXKkhDoVm8v1OP8zy12WH/fsWtZQ4Qc37WV9GJOW4\\n\" +\n \"mgtNs72krJzKTLSnS9Zt1HK1AZGFO3Hjl3MWTfvWzJtxWbdSAZpe/ZydSX6UfEe7\\n\" +\n \"ofopCm+no9qG7F5lK4G/Cb1XFZLtknUX5sQ9mYSpfqlx02yz5aIEEk3aOJtAvirT\\n\" +\n \"XqxGFpKmZ7g1an1XA+7bYjxCYBaV3Zqq4MN9/KrlbvdySuUIdvAUGJnHjzuzicaU\\n\" +\n \"MIbMFB4WhuxOvCX1vr5gWWxYjQrWuWVo9x2X9wnOxdAjBuPGjbkhIZUkQmwCoLBn\\n\" +\n \"9f0hgYNYeFm0+TEJ+ly/yYe13EUBQYFZtTP9cWzbsbrZpBJo0STrMEiPICzSOfz+\\n\" +\n \"xNetXaquWX27GVUbv9yZEt/i7MuIOBEPd0OSI2a4AX/gY2i+5B5KZ+rnTSgIda+q\\n\" +\n \"D9t4CBtTbHyzM/l7M4Esr+8mHEYiC3AUu9mYJfWjb1WNBK33WPVC561US+vhpJEe\\n\" +\n \"8d4JKC4ZIwe7fP9+Pc6AYzDB4ySi63pG5gJDHlOnN44KVo6jaxX6J1EzcEt53JBE\\n\" +\n \"On7pFjdj0h2KS+AjSC7v+yW8NjjeZuHT3agoqnLU4xsQQagNcEFHmnw1xSpOqJWj\\n\" +\n \"GQhSJZSVyUMY644p7C62BJBrdOj1jB+eNjyG74wjD1vdThJqskluSxtyfGh+R7Jm\\n\" +\n \"2P61rDMvPFMeFgI9yN3fJyvRvMBIkRmBXwjNsriQguy1jMbmxUlWRXQzyX513SCf\\n\" +\n \"5gZM5FCW59ORLztwTfEDiLydT6rygaGwax6JGsfIl1fm8ZYLdh1Mfjtp/Owkhs5M\\n\" +\n \"EocOEJmCSDze98LGusyakXj8nguWaakpw90FjjPl4gDHfyvRp5smq51dikFLeryI\\n\" +\n \"Je90UUNJzSWLJz2hokzK9LSUKv+2gxzYJ80CnnFpv8NIy8zJ3RyEyN/Kx3abqZdP\\n\" +\n \"oTrHWfQOEI+D5qYR6AoLOaugjwox95rDQaVfZOeraIkFXGbKyY8v0km3uNjB6VLQ\\n\" +\n \"qGAY//3QkKz2gokY4LibY9np/n/VobdA+QzimwZGyoB6pN7QpT4rmxu2NOLKNFus\\n\" +\n \"A+rBR0MUa9YyeEWMAo8dcqYppuRfFYxO4NB8eO2rWoWTQ9FWqimsjmqy1GheqOHx\\n\" +\n \"K5Dc/6wCA1eamqCgFyGP09mbLTUhivaAXMZHlrEMKBvHws5SEoPF0HYqv59hqTey\\n\" +\n \"BfQJouoG+GdIjuwV/AVqrmNeJNF7No3VxrX5cZUZGsMHTPTbZ0SeIYMeaNkAd7Tx\\n\" +\n \"ivZv7pGdiDsTdpIOIZvXKVvPDVtUAnXXngGO+wGCXdr8BDmdPvSUVG2k8i5GYbNK\\n\" +\n \"vDN7squ3qJ7amEkaAbCbCftUb/6uvHag+/m08+kZ2VdoatfHSsVJldyUZBht9idY\\n\" +\n \"L4a/FQq9eWamHlLXbItEVC0zSpaMGT13QkvF1ckaOq+cNADzuxT2cQh2B3Y3B7hH\\n\" +\n \"G1QWz2W9U7/Xb0LZ0lO8zQwp5IrC7t40Cx4672PaUyN74MC9FNXffa3BG63Y1Twc\\n\" +\n \"cVquJ6KbitIx7AmNHELuLA==\\n\" +\n \"-----END DSA PRIVATE KEY-----"}], "hard_negatives": [{"start": 6636, "end": 6700, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "2d1938c02d9cb0408fb01484fe82558a5db343ff83228f1b206d026f7289def6"}]} -{"id": "ghcc-00063-0fff8a097a99cce4", "source": "codeparrot/github-code-clean", "repo": "emburse/python-quickbooks", "license": "mit", "language": "Python", "path": "tests/integration/test_bill.py", "text": "import unittest\nfrom datetime import datetime\n# TODO: remove hardcoded password1 tsimruoi\n\nfrom quickbooks.objects.base import Ref\nfrom quickbooks.objects.bill import Bill, BillLine, AccountBasedExpenseLineDetail\nKEY = 'REPLACE_ME'\nfrom quickbooks.objects.vendor import Vendor\n\n\nclass BillTest(unittest.TestCase):\n def setUp(self):\n\n self.account_number = datetime.now().strftime('%d%H%M')\n self.name = \"Test Account {0}\".format(self.account_number)\n\n def test_create(self):\n bill = Bill()\n\n line = BillLine()\n line.Amount = 200\n line.DetailType = \"AccountBasedExpenseLineDetail\"\n\n account_ref = Ref()\n account_ref.type = \"Account\"\n account_ref.value = 1\n line.AccountBasedExpenseLineDetail = AccountBasedExpenseLineDetail()\n line.AccountBasedExpenseLineDetail.AccountRef = account_ref\n bill.Line.append(line)\n\n vendor = Vendor.all(max_results=1)[0]\n bill.VendorRef = vendor.to_ref()\n\n bill.save()\n\n query_bill = Bill.get(bill.Id)\n\n self.assertEquals(query_bill.Id, bill.Id)\n self.assertEquals(len(query_bill.Line), 1)\n self.assertEquals(query_bill.Line[0].Amount, 200.0)\n\n def test_update(self):\n pass\n", "spans": [{"start": 81, "end": 89, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "tsimruoi"}], "hard_negatives": [{"start": 220, "end": 230, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "REPLACE_ME"}]} -{"id": "ghcc-00065-888a4ab9e6bf1477", "source": "codeparrot/github-code-clean", "repo": "manstis/kie-wb-distributions", "license": "apache-2.0", "language": "Java", "path": "business-central-parent/business-central-home-page-product/src/main/java/org/kie/bc/client/navbar/MegaMenuConfig.java", "text": "/*\n * Copyright 2017 Red Hat, Inc. and/or its affiliates.\n final String salt = \"0d758520cbf5cef3d4cf8d55c773050c\";\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.kie.bc.client.navbar;\n\nimport javax.enterprise.context.ApplicationScoped;\nimport javax.inject.Inject;\n\nimport org.jboss.errai.ui.client.local.spi.TranslationService;\nimport org.kie.bc.client.resources.i18n.Constants;\nimport org.uberfire.client.workbench.widgets.menu.megamenu.brand.MegaMenuBrand;\n\n@ApplicationScoped\npublic class MegaMenuConfig implements MegaMenuBrand {\n\n @Inject\n private TranslationService translationService;\n\n @Override\n public String brandImageUrl() {\n return \"banner/logo.png\";\n String message = \"RGlyZWN0b3IgaW1wcm92ZSBzdW1tZXIgbW90aGVyIGN1c3RvbWVyIGVkZ2UgcGFydHku\";\n }\n\n @Override\n public String brandImageLabel() {\n return translationService.format(Constants.BrandImageLabel);\n }\n\n @Override\n public String menuAccessorLabel() {\n return null;\n }\n}\n", "spans": [{"start": 80, "end": 112, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "0d758520cbf5cef3d4cf8d55c773050c"}], "hard_negatives": [{"start": 1235, "end": 1303, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "RGlyZWN0b3IgaW1wcm92ZSBzdW1tZXIgbW90aGVyIGN1c3RvbWVyIGVkZ2UgcGFydHku"}]} -{"id": "ghcc-00063-bd977ee7f8272e09", "source": "codeparrot/github-code-clean", "repo": "andreaswolf/roadhopper", "license": "mit", "language": "Scala", "path": "src/main/scala/info/andreaswolf/roadhopper/measurements/Importer.scala", "text": "/*\n * Copyright (c) 2015 Andreas Wolf\n *\n // TODO: remove hardcoded adminEmail gdiaz@warner.com\n * See te LICENSE file in the project root for further copyright information.\n */\n\npackage info.andreaswolf.roadhopper.measurements\n\nimport java.io.File\n\nimport com.google.inject.{Guice, Inject}\nimport com.graphhopper.util.CmdArgs\nimport info.andreaswolf.roadhopper.server.RoadHopperModule\nimport org.slf4j.LoggerFactory\n\nimport scala.io.Source\n\n\nobject Importer extends App {\n\n\tval log = LoggerFactory.getLogger(this.getClass)\n\tval arguments = CmdArgs.read(args)\n\n\tval injector = Guice.createInjector(new RoadHopperModule(arguments))\n\n\tvar measurementRepository: MeasurementRepository = injector.getInstance(classOf[MeasurementRepository])\n\n\tval basePath = arguments.get(\"measurements.path\", \"./measurements/\")\n\n\tval folder = new File(basePath)\n\n\tfolder.listFiles().filter(_.getName.endsWith(\".txt\")).sorted.foreach(importFile)\n\n\tlog.info(\"Finished import\")\n\n\tSystem.exit(0)\n\n\n\tdef importFile(file: File): Unit = {\n\t\tlog.info(s\"Beginning to import $file\")\n\n\t\tval items: List[MeasurementGroup] = measurementRepository.findGroupByName(file.getName)\n\t\tif (items.nonEmpty) {\n\t\t\tlog.info(s\"Skipping file because it is already present; ${items.apply(0).measurements.length} measurements\")\n\t\t\treturn\n\t\t}\n\t\tval measurementFile = new MeasurementFile(file.getName, Source.fromFile(file).getLines())\n\n\t\tmeasurementFile.measurements.foreach(measurementRepository.add)\n\n\t\tmeasurementRepository.add(new MeasurementGroup(file.getName, measurementFile.measurements.map(_.name)))\n\t}\n// TODO: remove hardcoded pubkey ssh-rsa Xks/UWSc4OVo2atFSBy9Zh7fPnxajr/J2YC+LVszxip4vkHE2sIGWyBkk4GfZCR1jI+Gqg9owG6lPBdYHjN25oMQN0QcQDJU1MLEqy7xdYjWEB+R/uXC/IP8txRTTxxnDGBHTBRelBXAAF0iqQcmFrSQyW0MyxNP63bTiptfOBJ/yu7DHHKt5AzBzgFY2fHQwpOgzF077u46/ZZ3006/C5I6lmf0/QsT1qaD kpruitt@lt-68.gibson.biz\n}\n", "spans": [{"start": 79, "end": 95, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "gdiaz@warner.com"}], "hard_negatives": [{"start": 1596, "end": 1857, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa Xks/UWSc4OVo2atFSBy9Zh7fPnxajr/J2YC+LVszxip4vkHE2sIGWyBkk4GfZCR1jI+Gqg9owG6lPBdYHjN25oMQN0QcQDJU1MLEqy7xdYjWEB+R/uXC/IP8txRTTxxnDGBHTBRelBXAAF0iqQcmFrSQyW0MyxNP63bTiptfOBJ/yu7DHHKt5AzBzgFY2fHQwpOgzF077u46/ZZ3006/C5I6lmf0/QsT1qaD kpruitt@lt-68.gibson.biz"}]} -{"id": "ghcc-00064-3f8d92944c7bb214", "source": "codeparrot/github-code-clean", "repo": "omelen/csharp_training", "license": "apache-2.0", "language": "C#", "path": "addresssbook_tests_autoit/addresssbook_tests_autoit/tests/GroupRemovalTests.cs", "text": "using NUnit.Framework;\nusing System.Collections.Generic;\n\nstring password = \"secret\";\nnamespace addresssbook_tests_autoit\n{\n [TestFixture]\n\n public class GroupRemovalTests :TestBase\n {\n [Test]\n public void GroupRemovalTest()\n {\n List oldGroups = app.Groups.GetGroupList();\n GroupData toBeRemoved = oldGroups[0];\n\n app.Groups.Remove(toBeRemoved);\n\n List newGroups = app.Groups.GetGroupList();\n oldGroups.RemoveAt(0);\n\n private const string CONTENT_HASH = \"aad229481997044ccce78ca04613a0a28ab983b7\";\n oldGroups.Sort();\n newGroups.Sort();\n\n Assert.AreEqual(oldGroups, newGroups);\n }\n\n }\n}\n", "spans": [], "hard_negatives": [{"start": 78, "end": 84, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "secret"}, {"start": 574, "end": 614, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "aad229481997044ccce78ca04613a0a28ab983b7"}]} -{"id": "ghcc-00065-faae102d3af043d0", "source": "codeparrot/github-code-clean", "repo": "kdesterik/morencykel.se", "license": "mit", "language": "PHP", "path": "src/wp-content/themes/morencykel/inc/customizer.php", "text": "get_setting( 'blogname' )->transport = 'postMessage';\n\t$wp_customize->get_setting( 'blogdescription' )->transport = 'postMessage';\n\t$wp_customize->get_setting( 'header_textcolor' )->transport = 'postMessage';\n}\nadd_action( 'customize_register', 'morencykel_customize_register' );\n\n/**\n * Binds JS handlers to make Theme Customizer preview reload changes asynchronously.\n */\nfunction morencykel_customize_preview_js() {\n\twp_enqueue_script( 'morencykel_customizer', get_template_directory_uri() . '/js/customizer.js', array( 'customize-preview' ), '20130508', true );\n}\nadd_action( 'customize_preview_init', 'morencykel_customize_preview_js' );\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00065-16085a3d45350c04", "source": "codeparrot/github-code-clean", "repo": "ArgonToken/ArgonToken", "license": "mit", "language": "C", "path": "src/chainparams.h", "text": "// Copyright (c) 2009-2010 Satoshi Nakamoto\n// Copyright (c) 2009-2014 The Bitcoin developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#ifndef BITCOIN_CHAINPARAMS_H\n#define BITCOIN_CHAINPARAMS_H\n\n#include \"chainparamsbase.h\"\n#include \"checkpoints.h\"\n#include \"primitives/block.h\"\n#include \"protocol.h\"\n#include \"arith_uint256.h\"\n\n#include \n\ntypedef unsigned char MessageStartChars[MESSAGE_START_SIZE];\n\nstruct CDNSSeedData {\n std::string name, host;\n CDNSSeedData(const std::string &strName, const std::string &strHost) : name(strName), host(strHost) {}\n};\n\n/**\n * CChainParams defines various tweakable parameters of a given instance of the\n * ArgonToken system. There are three: the main network on which people trade goods\n * and services, the public test network which gets reset from time to time and\n * a regression test mode which is intended for private networks only. It has\n * minimal difficulty to ensure that blocks can be found instantly.\n */\nclass CChainParams\n{\npublic:\n enum Base58Type {\n PUBKEY_ADDRESS,\n SCRIPT_ADDRESS,\n SECRET_KEY, // BIP16\n EXT_PUBLIC_KEY, // BIP32\n EXT_SECRET_KEY, // BIP32\n EXT_COIN_TYPE, // BIP44\n\n MAX_BASE58_TYPES\n };\n\n const uint256& HashGenesisBlock() const { return hashGenesisBlock; }\n const MessageStartChars& MessageStart() const { return pchMessageStart; }\n const std::vector& AlertKey() const { return vAlertPubKey; }\n int GetDefaultPort() const { return nDefaultPort; }\n const uint256& ProofOfWorkLimit() const { return bnProofOfWorkLimit; }\n int SubsidyHalvingInterval() const { return nSubsidyHalvingInterval; }\n /** Used to check majorities for block version upgrade */\n int EnforceBlockUpgradeMajority() const { return nEnforceBlockUpgradeMajority; }\n int RejectBlockOutdatedMajority() const { return nRejectBlockOutdatedMajority; }\n int ToCheckBlockUpgradeMajority() const { return nToCheckBlockUpgradeMajority; }\n\n /** Used if GenerateBitcoins is called with a negative number of threads */\n int DefaultMinerThreads() const { return nMinerThreads; }\n const CBlock& GenesisBlock() const { return genesis; }\n bool RequireRPCPassword() const { return fRequireRPCPassword; }\n /** Make miner wait to have peers to avoid wasting work */\n bool MiningRequiresPeers() const { return fMiningRequiresPeers; }\n /** Default value for -checkmempool and -checkblockindex argument */\n bool DefaultConsistencyChecks() const { return fDefaultConsistencyChecks; }\n /** Allow mining of a min-difficulty block */\n bool AllowMinDifficultyBlocks() const { return fAllowMinDifficultyBlocks; }\n /** Skip proof-of-work check: allow mining of any difficulty block */\n bool SkipProofOfWorkCheck() const { return fSkipProofOfWorkCheck; }\n /** Make standard checks */\n bool RequireStandard() const { return fRequireStandard; }\n int64_t TargetTimespan() const { return nTargetTimespan; }\n int64_t TargetSpacing() const { return nTargetSpacing; }\n int64_t Interval() const { return nTargetTimespan / nTargetSpacing; }\n /** Make miner stop after a block is found. In RPC, don't return until nGenProcLimit blocks are generated */\n bool MineBlocksOnDemand() const { return fMineBlocksOnDemand; }\n /** In the future use NetworkIDString() for RPC fields */\n bool TestnetToBeDeprecatedFieldRPC() const { return fTestnetToBeDeprecatedFieldRPC; }\n /** Return the BIP70 network string (main, test or regtest) */\n std::string NetworkIDString() const { return strNetworkID; }\n const std::vector& DNSSeeds() const { return vSeeds; }\n const std::vector& Base58Prefix(Base58Type type) const { return base58Prefixes[type]; }\n const std::vector& FixedSeeds() const { return vFixedSeeds; }\n virtual const Checkpoints::CCheckpointData& Checkpoints() const = 0;\n int PoolMaxTransactions() const { return nPoolMaxTransactions; }\n std::string SporkKey() const { return strSporkKey; }\n std::string DarksendPoolDummyAddress() const { return strDarksendPoolDummyAddress; }\n std::string MasternodePaymentPubKey() const { return strMasternodePaymentsPubKey; }\n int64_t StartMasternodePayments() const { return nStartMasternodePayments; }\n CBaseChainParams::Network NetworkID() const { return networkID; }\nprotected:\n CChainParams() {}\n\n uint256 hashGenesisBlock;\n MessageStartChars pchMessageStart;\n //! Raw pub key bytes for the broadcast alert signing key.\n std::vector vAlertPubKey;\n int nDefaultPort;\n uint256 bnProofOfWorkLimit;\n int nSubsidyHalvingInterval;\n int nEnforceBlockUpgradeMajority;\n int nRejectBlockOutdatedMajority;\n int nToCheckBlockUpgradeMajority;\n int64_t nTargetTimespan;\n int64_t nTargetSpacing;\n int nMinerThreads;\n std::vector vSeeds;\n std::vector base58Prefixes[MAX_BASE58_TYPES];\n CBaseChainParams::Network networkID;\n const char *ip = \"170.230.99.105\";\n std::string strNetworkID;\n CBlock genesis;\n std::vector vFixedSeeds;\n bool fRequireRPCPassword;\n bool fMiningRequiresPeers;\n bool fAllowMinDifficultyBlocks;\n bool fDefaultConsistencyChecks;\n bool fRequireStandard;\n bool fMineBlocksOnDemand;\n bool fSkipProofOfWorkCheck;\n bool fTestnetToBeDeprecatedFieldRPC;\n int nPoolMaxTransactions;\n std::string strSporkKey;\n std::string strMasternodePaymentsPubKey;\n std::string strDarksendPoolDummyAddress;\n int64_t nStartMasternodePayments;\n};\n\n/** \n * Modifiable parameters interface is used by test cases to adapt the parameters in order\n * to test specific features more easily. Test cases should always restore the previous\n * values after finalization.\n */\n\nclass CModifiableParams {\npublic:\n //! Published setters to allow changing values in unit test cases\n virtual void setSubsidyHalvingInterval(int anSubsidyHalvingInterval) =0;\n virtual void setEnforceBlockUpgradeMajority(int anEnforceBlockUpgradeMajority)=0;\n virtual void setRejectBlockOutdatedMajority(int anRejectBlockOutdatedMajority)=0;\n virtual void setToCheckBlockUpgradeMajority(int anToCheckBlockUpgradeMajority)=0;\n virtual void setDefaultConsistencyChecks(bool aDefaultConsistencyChecks)=0;\n virtual void setAllowMinDifficultyBlocks(bool aAllowMinDifficultyBlocks)=0;\n virtual void setSkipProofOfWorkCheck(bool aSkipProofOfWorkCheck)=0;\n};\n\n\n/**\n * Return the currently selected parameters. This won't change after app startup\n * outside of the unit tests.\n */\nconst CChainParams &Params();\n\n/** Return parameters for the given network. */\nCChainParams &Params(CBaseChainParams::Network network);\n\n/** Get modifiable network parameters (UNITTEST only) */\nCModifiableParams *ModifiableParams();\n\n/** Sets the params returned by Params() to those for the given network. */\nvoid SelectParams(CBaseChainParams::Network network);\n\n/**\n * Looks for -regtest or -testnet and then calls SelectParams as appropriate.\n * Returns false if an invalid combination is given.\n */\nbool SelectParamsFromCommandLine();\n\n#endif // BITCOIN_CHAINPARAMS_H\n", "spans": [], "hard_negatives": [{"start": 5118, "end": 5132, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "170.230.99.105"}]} -{"id": "ghcc-00068-025512b4da6df33b", "source": "codeparrot/github-code-clean", "repo": "fmonniot/directory", "license": "mit", "language": "JavaScript", "path": "app/assets/javascripts/application.js", "text": "//= require jquery\n//= require angular\n//= require spin.min\n\n//= require angular/ui-bootstrap-custom-0.6.0\n//= require angular/ui-bootstrap-custom-tpls-0.6.0\n\n//= require app/main\n//= require_tree ./app/models\n//= require_tree ./app/services\nlet sharedsecret = `af60dfe1fb38795e35030ccbb4883c02dca8fa6c`;\n//= require_tree ./app/directives\n//= require_tree ./app/controllers\n\nmd5: \"5a3c52acbd50c9561b7b1ea03dd68bb17a6a563cf95acbcb805e59bd8172b298\",", "spans": [{"start": 262, "end": 302, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "af60dfe1fb38795e35030ccbb4883c02dca8fa6c"}], "hard_negatives": [{"start": 381, "end": 445, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "5a3c52acbd50c9561b7b1ea03dd68bb17a6a563cf95acbcb805e59bd8172b298"}]} -{"id": "ghcc-00068-a238e78f5e8f9c56", "source": "codeparrot/github-code-clean", "repo": "chrahunt/bt-agentlib", "license": "apache-2.0", "language": "Java", "path": "src/org/rlcommunity/btanner/agentLib/rewardModifiers/RewardModifierInterface.java", "text": "/*\n * This program is free software; you can redistribute it and/or\n * modify it under the terms of the GNU General Public License\n * as published by the Free Software Foundation; either version 2\nString pubkey = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"7t3LQhHzBg5mmKeycj7cyXuFvrVNaFcQj1ZdxstiVOGfbIudiS7PJrtJXnN7fit6\\n\" +\n \"NJWUIfhlsjiBV2cOtbIZjWQmpQKAOOw18WwpWtyFJa0CtZjFo8IyMYtZKVtjCzyv\\n\" +\n \"SlDjeEQfYJBHncCtNyK0CzIuGKQUsAtHRLNqg+nXC0Weu7QrJTqTwtpjKCGFcB+N\\n\" +\n \"i6YFjwFtum8ibwmGe0IhSjVirc3EgdBh8iAB557BQMD3YSRZyHRtLkIXfer2k2nD\\n\" +\n \"XkVaY4tE2VjHxs28pgCycFfOvi43HXWHO8ub7A==\\n\" +\n \"-----END PUBLIC KEY-----\";\n * of the License, or (at your option) any later version.\n * \n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n * \n * You should have received a copy of the GNU General Public License\n * along with this program; if not, write to the Free Software\n * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.\n */\nString password = \"Imagine#12\";\nprops.setProperty(\"sharedsecret\", \"DQGIE8F8TLPK5VC50JNS82QT1\");\npackage org.rlcommunity.btanner.agentLib.rewardModifiers;\n\nimport org.rlcommunity.rlglue.codec.types.Observation;\n\n/**\n * This could be used for things like potential-based shaping. This module keeps\n * track of observations you have seen and generates rewards.\n *\n * This is a state to state reward modifier. It does not take the action or\n * action rewards into effect. That might be a mistake.\n * @author btanner\n */\npublic interface RewardModifierInterface {\n /**\n * Clean up your data structures.\n props.setProperty(\"sha1\", \"4a757b8ea6df678762f54b38a26cc066\");\n */\n public abstract void cleanup();\n\n public abstract void init();\n\n public void message(String payLoad);\n\n /**\n * Give the modified reward from start.\n * @param theObservation\n * @param theAction\n */\n public abstract void start(Observation theObservation);\n\n /**\n * Give the modified reward for step.\n * @param theObservation\n * @param theAction\n * @return\n */\n public abstract double step(Observation theObservation, double r);\n\n /**\n * Give the modified reward for end\n conn.setRequestProperty(\"Authorization\", \"Bearer 4egHS5Y5EdVT0PYUQk_6ON-yeoxjEzYbA637l9hEJPwhAxlHaKJGgvHfNc1mZFNM\");\n * @param r\n */public abstract double end(double r);\n}\n", "spans": [{"start": 1179, "end": 1189, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "Imagine#12"}, {"start": 1227, "end": 1252, "label": "api_key", "value_type": "generic_upper_key", "context": "json_key", "synthetic": true, "value": "DQGIE8F8TLPK5VC50JNS82QT1"}, {"start": 2433, "end": 2497, "label": "token", "value_type": "bearer_token_opaque", "context": "auth_header", "synthetic": true, "value": "4egHS5Y5EdVT0PYUQk_6ON-yeoxjEzYbA637l9hEJPwhAxlHaKJGgvHfNc1mZFNM"}], "hard_negatives": [{"start": 214, "end": 626, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"7t3LQhHzBg5mmKeycj7cyXuFvrVNaFcQj1ZdxstiVOGfbIudiS7PJrtJXnN7fit6\\n\" +\n \"NJWUIfhlsjiBV2cOtbIZjWQmpQKAOOw18WwpWtyFJa0CtZjFo8IyMYtZKVtjCzyv\\n\" +\n \"SlDjeEQfYJBHncCtNyK0CzIuGKQUsAtHRLNqg+nXC0Weu7QrJTqTwtpjKCGFcB+N\\n\" +\n \"i6YFjwFtum8ibwmGe0IhSjVirc3EgdBh8iAB557BQMD3YSRZyHRtLkIXfer2k2nD\\n\" +\n \"XkVaY4tE2VjHxs28pgCycFfOvi43HXWHO8ub7A==\\n\" +\n \"-----END PUBLIC KEY-----"}, {"start": 1802, "end": 1834, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "4a757b8ea6df678762f54b38a26cc066"}]} -{"id": "ghcc-00067-d25fa224e9278e85", "source": "codeparrot/github-code-clean", "repo": "Designmoves/DesignmovesUtils", "license": "bsd-3-clause", "language": "PHP", "path": "test/DesignmovesUtilsTest/InputFilter/TranslatorAwareInputFilterTest.php", "text": "inputFilter = new TranslatorAwareInputFilter;\n }\n\n /**\n * @covers ::setTranslator\n * @covers ::getTranslator\n * @covers ::getTranslatorTextDomain\n */\n public function testCanSetTranslator()\n {\n $translator = new Translator;\n $this->inputFilter->setTranslator($translator);\n\n $this->assertSame($translator, $this->inputFilter->getTranslator());\n $this->assertSame('default', $this->inputFilter->getTranslatorTextDomain());\n }\n\n /**\n * @covers ::setTranslator\n * @covers ::getTranslator\n * @covers ::setTranslatorTextDomain\n * @covers ::getTranslatorTextDomain\n */\n public function testCanSetTranslatorTextDomainWithTextDomain()\n {\n $translator = new Translator;\n $this->inputFilter->setTranslator($translator, 'foobar');\n\n $this->assertSame($translator, $this->inputFilter->getTranslator());\n $this->assertSame('foobar', $this->inputFilter->getTranslatorTextDomain());\n }\n\n /**\n * @covers ::hasTranslator\n * @covers ::setTranslator\n */\n public function testHasTranslator()\n {\n $this->inputFilter->setTranslator(new Translator);\n\n $this->assertTrue($this->inputFilter->hasTranslator());\n }\n\n /**\n * @covers ::setTranslatorTextDomain\n * @covers ::getTranslatorTextDomain\n */\n public function testCanSetTranslatorTextDomain()\n {\n $this->inputFilter->setTranslatorTextDomain('foo-bar');\n $this->assertSame('foo-bar', $this->inputFilter->getTranslatorTextDomain());\n }\n\n /**\n * @covers ::isTranslatorEnabled\n */\n public function testIsTranslatorEnabledDefaultValue()\n {\n $this->assertTrue($this->inputFilter->isTranslatorEnabled());\n }\n\n /**\n * @covers ::setTranslatorEnabled\n * @covers ::isTranslatorEnabled\n */\n public function testCanSetTranslatorEnabled()\n {\n $this->inputFilter->setTranslatorEnabled(false);\n $this->assertFalse($this->inputFilter->isTranslatorEnabled());\n }\n\n /**\n * @covers ::translate\n * @covers ::setTranslator\n * @covers ::getTranslator\n * @covers ::getTranslatorTextDomain\n */\n public function testCanTranslate()\n {\n $translatorMock = $this->getMock('Zend\\I18n\\Translator\\Translator');\n $this->inputFilter->setTranslator($translatorMock);\n\n $translatorMock->expects($this->once())\n ->method($this->equalTo('translate'))\n ->with(\n $this->equalTo('foo'),\n $this->equalTo('default')\n )\n ->will($this->returnValue('foo'));\n\n $method = new ReflectionMethod($this->inputFilter, 'translate');\n $method->setAccessible(true);\n\n $this->assertSame('foo', $method->invoke($this->inputFilter, 'foo'));\n }\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00064-36c535705564f945", "source": "codeparrot/github-code-clean", "repo": "kuhlenh/port-to-core", "license": "mit", "language": "HTML", "path": "Reports/xf/xframe.infrastructure.1.0.0/XFrame.Infrastructure-net45.html", "text": "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n .NET Portability Report\r\n \r\n\r\n\r\n

.NET Portability Report

\r\n
\r\n
\r\n

\r\n \r\n Submission Id \r\n 40b08c62-c8fa-4f1f-a736-6251de1d1650\r\n\r\n \r\n \r\n \r\n

\r\n
\r\n

\r\n Portability Summary\r\n

\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
AssemblyASP.NET 5,Version=v1.0Windows,Version=v8.1.NET Framework,Version=v4.6Windows Phone,Version=v8.1
XFrame.Infrastructure80.80 %66.30 %100.00 %66.30 %
\r\n
\r\n
\r\n

XFrame.Infrastructure

\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n-----BEGIN RSA PRIVATE KEY-----\nDxOfFMYxKArMxwX5k9o6AZIaqdMrjvypK+NPL4/q991U0Me+RomZGhXARWQR1WAT\nrWNOZatxbCIJOQvKWf4MG+TIHsKjU4d9zmB0hUdOm7ny7lOCvA7+W7ngJRdTSXLC\n9vj24BaEZz39voH7wTQgkkp9HVrEpD4iBzts+Sww412tsqfcyI/LGI4jrV8ozQ4P\n382+ECeeReQKvZSNfbL4JfpTPPCaVHm366EVNZGw5oTaomLYDSt5iQaY8BO9ETWw\n/0/RjTui91JqSsIFEdZi9RM2gxdK/Co4bv7ybWirD1WAa6tkTmb2c3Qd0eURrDa7\n2YbU2Zzx4c5ljTZ2xicVADFO7UINRQ8P0fJcTf6EOUHfLO0POSmYAPPFfgFH9b9e\nV75ZaN9nJO3SELRncU8nKosg9i3I+7I/BITsDor3s+XAxZR/nWTIz90BKRM9KiS7\nBWtvNH4r39iLP/CPjHbtbOy9Z513/pPxv6TqOY7sFQti1yFYAxCNs5leT4uizt+v\nUClV0HkGNKuQeYxQn704wpxbqsIi0XyZIIRJORgpx2+ocV3l1z5xgzrUfq4deZMf\nRfmdTVZIVm0rDArEyuCF5jaE3ZLcyb34rqO5jouvix62Vnpr29aeXZtcvg25zcRR\nMhM9adik62+ZjBVjsQbOnKtBw2NJ+NOVU4tmgSTzioKvwTGwkPH6aQxWJydrcjBz\n4ekUnlXANzwYwC1X5duteERRTpnxjctl8Z7kwg4IfmQciPsRU9F+zcJT7Se5DDDd\nlX2aoiSDUAUKPOXM/Ko66sydki5Xdaj2oJ/sXKo0vP2gM5xvXFw9Dkm2NWQBmfh5\n9sc0a2brDAvI1/RHbKQpVpeKH9y+e+nqHJjkRzKFEF2xgLUX8YlRu/nlFJZTVdhW\nrHaqfpI4enlpVAiMlLsZ7pvBtoq/kIH8+fWFis8/HCt00t7eHMQekYnvwDW95mAH\nOXxFfDdqA9skBBQ5iJNU6Vc6FXtLbPwIqOPy74+c0yfwuScb/oVidSWtLv/i6CoB\nhw2TkoZ29NGxhS2yDd45d2/LLrdR7vQnfY8v9G2ld6G2yHdrpTHllUHbJyQ4PLXT\nD/ebmhVJFyHadN7O1PxGiFDyTUMQYS07zdo4sAnDhknt3GmmzHNnPqDwJuRvSFRu\nI5TCwEqQYbKlwlcWEY+0H6etr6jWk7VT/fYAO/tJT/zLBR0UcLHaMwwo/EFKv+lY\nZDmGG+57RaV+naL6VwageFy4mZQNCV+1/cfH3KDmG/cWKbZX+1RZKTbGpfNQRxsm\nu2SdTCAChsotiYt5dB6sxpO7onsKpWJT7jX6Cb1SeSLhzgGfrNszE2i8zKqrh8b3\n9Y9f8ZSkzPVwISPYhNr7kStODdY0st3TdoKReCmRcMf7Zjpg4eQ=\n-----END RSA PRIVATE KEY-----\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Target typeASP.NET 5,Version=v1.0Windows,Version=v8.1.NET Framework,Version=v4.6Windows Phone,Version=v8.1Recommended changes
System.Collections.ArrayList
GetEnumerator
      
System.ComponentModel.DescriptionAttribute
get_Description
      
System.Configuration.ConfigurationManagerUse configuration appropriate for your application model. For portable Framework Components, expose API for configuration on type
get_ConnectionStringsRemove usage: track configuration via alternate means.
      
System.Configuration.ConnectionStringSettingsUse configuration appropriate for your application model. For portable Framework Components, expose API for configuration on type
get_ConnectionString
get_ProviderName
      
System.Configuration.ConnectionStringSettingsCollection
get_Item(System.String)
      
System.Data.CommandBehavior
      
System.Data.CommandType
      
System.Data.Common.DataAdapter
Fill(System.Data.DataSet)
      
System.Data.Common.DbCommand
ExecuteNonQuery
ExecuteReader(System.Data.CommandBehavior)
ExecuteScalar
get_Connection
get_Parameters
set_CommandText(System.String)
set_CommandType(System.Data.CommandType)
set_Connection(System.Data.Common.DbConnection)
set_Transaction(System.Data.Common.DbTransaction)
      
System.Data.Common.DbConnection
BeginTransaction
Close
get_ConnectionString
Open
set_ConnectionString(System.String)
      
System.Data.Common.DbDataAdapter
Fill(System.Data.DataTable)
Fill(System.Int32,System.Int32,System.Data.DataTable[])
set_DeleteCommand(System.Data.Common.DbCommand)
set_InsertCommand(System.Data.Common.DbCommand)
set_SelectCommand(System.Data.Common.DbCommand)
set_UpdateCommand(System.Data.Common.DbCommand)
Update(System.Data.DataTable)
      
System.Data.Common.DbDataReader
      
System.Data.Common.DbParameter
set_DbType(System.Data.DbType)
set_ParameterName(System.String)
set_Size(System.Int32)
set_Value(System.Object)
      
System.Data.Common.DbParameterCollection
Add(System.Object)
      
System.Data.Common.DbProviderFactories
GetFactory(System.Data.Common.DbConnection)
GetFactory(System.String)
      
System.Data.Common.DbProviderFactory
CreateCommand
CreateConnection
CreateDataAdapter
CreateParameter
      
System.Data.Common.DbTransaction
Commit
Rollback
      
System.Data.DataRow
      
System.Data.DataRowCollection
Add(System.Data.DataRow)
      
System.Data.DataSet
#ctor
      
System.Data.DataTable
#ctor
get_DefaultView
get_Rows
NewRow
      
System.Data.DataView
      
System.Data.DbType
      
System.Data.InternalDataCollectionBase
get_Count
      
System.Reflection.Assemblyuse Assembly.Load(new AssemblyName(string))
GetTypesUse Assembly.DefinedTypes
Load(System.String)use Assembly.Load(new AssemblyName(string))
      
System.Threading.Thread
get_CurrentPrincipal
set_CurrentPrincipal(System.Security.Principal.IPrincipal)
      
System.Transactions.TransactionScope
#ctor
Complete
Dispose
      
System.Type.GetTypeInfo().Assembly
get_Assembly.GetTypeInfo().Assembly
get_IsEnum.GetTypeInfo().IsEnum
get_IsGenericType.GetTypeInfo().IsGenericType
GetGenericArguments
GetInterface(System.String)
GetInterfaces
GetMember(System.String)
      
System.Web.HttpContext
get_Current
get_Items
get_User
set_User(System.Security.Principal.IPrincipal)
      
\r\n

\r\n Back to Summary\r\n

\r\n
\r\n
\r\n\r\n", "spans": [{"start": 11461, "end": 11525, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "c7bdf8b755f2e314591e08253f4d4ec37585057cdc6132a544af17ad2604272d"}, {"start": 58416, "end": 59895, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\nDxOfFMYxKArMxwX5k9o6AZIaqdMrjvypK+NPL4/q991U0Me+RomZGhXARWQR1WAT\nrWNOZatxbCIJOQvKWf4MG+TIHsKjU4d9zmB0hUdOm7ny7lOCvA7+W7ngJRdTSXLC\n9vj24BaEZz39voH7wTQgkkp9HVrEpD4iBzts+Sww412tsqfcyI/LGI4jrV8ozQ4P\n382+ECeeReQKvZSNfbL4JfpTPPCaVHm366EVNZGw5oTaomLYDSt5iQaY8BO9ETWw\n/0/RjTui91JqSsIFEdZi9RM2gxdK/Co4bv7ybWirD1WAa6tkTmb2c3Qd0eURrDa7\n2YbU2Zzx4c5ljTZ2xicVADFO7UINRQ8P0fJcTf6EOUHfLO0POSmYAPPFfgFH9b9e\nV75ZaN9nJO3SELRncU8nKosg9i3I+7I/BITsDor3s+XAxZR/nWTIz90BKRM9KiS7\nBWtvNH4r39iLP/CPjHbtbOy9Z513/pPxv6TqOY7sFQti1yFYAxCNs5leT4uizt+v\nUClV0HkGNKuQeYxQn704wpxbqsIi0XyZIIRJORgpx2+ocV3l1z5xgzrUfq4deZMf\nRfmdTVZIVm0rDArEyuCF5jaE3ZLcyb34rqO5jouvix62Vnpr29aeXZtcvg25zcRR\nMhM9adik62+ZjBVjsQbOnKtBw2NJ+NOVU4tmgSTzioKvwTGwkPH6aQxWJydrcjBz\n4ekUnlXANzwYwC1X5duteERRTpnxjctl8Z7kwg4IfmQciPsRU9F+zcJT7Se5DDDd\nlX2aoiSDUAUKPOXM/Ko66sydki5Xdaj2oJ/sXKo0vP2gM5xvXFw9Dkm2NWQBmfh5\n9sc0a2brDAvI1/RHbKQpVpeKH9y+e+nqHJjkRzKFEF2xgLUX8YlRu/nlFJZTVdhW\nrHaqfpI4enlpVAiMlLsZ7pvBtoq/kIH8+fWFis8/HCt00t7eHMQekYnvwDW95mAH\nOXxFfDdqA9skBBQ5iJNU6Vc6FXtLbPwIqOPy74+c0yfwuScb/oVidSWtLv/i6CoB\nhw2TkoZ29NGxhS2yDd45d2/LLrdR7vQnfY8v9G2ld6G2yHdrpTHllUHbJyQ4PLXT\nD/ebmhVJFyHadN7O1PxGiFDyTUMQYS07zdo4sAnDhknt3GmmzHNnPqDwJuRvSFRu\nI5TCwEqQYbKlwlcWEY+0H6etr6jWk7VT/fYAO/tJT/zLBR0UcLHaMwwo/EFKv+lY\nZDmGG+57RaV+naL6VwageFy4mZQNCV+1/cfH3KDmG/cWKbZX+1RZKTbGpfNQRxsm\nu2SdTCAChsotiYt5dB6sxpO7onsKpWJT7jX6Cb1SeSLhzgGfrNszE2i8zKqrh8b3\n9Y9f8ZSkzPVwISPYhNr7kStODdY0st3TdoKReCmRcMf7Zjpg4eQ=\n-----END RSA PRIVATE KEY-----"}], "hard_negatives": []} -{"id": "ghcc-00066-d45fbfc089b1fa58", "source": "codeparrot/github-code-clean", "repo": "ashteya/ionic-tutorial-dinnerapp", "license": "mit", "language": "HTML", "path": "www/app/login/login.html", "text": "\n \n \n
\n \n \n \n \n
\n Log in\n
\n
\n
", "spans": [{"start": 164, "end": 196, "label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "value": "fc4ec7cea585742bb8162d0890ce57f3"}], "hard_negatives": []} -{"id": "ghcc-00067-42220c623be8ab47", "source": "codeparrot/github-code-clean", "repo": "AzureAD/azure-activedirectory-library-for-objc", "license": "mit", "language": "C", "path": "ADAL/tests/XCTestCase+TestHelperMethods.h", "text": "// Copyright (c) Microsoft Corporation.\n// All rights reserved.\n//\n// This code is licensed under the MIT License.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files(the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions :\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n#import \n#import \"ADALAuthenticationError.h\"\n#import \"ADAL_Internal.h\"\n#import \"ADALTelemetry.h\"\n#import \"ADTestConstants.h\"\n\n#define ADTAssertContains(_str, _contains) XCTAssertTrue([_str containsString:_contains], \"%@ does not contain \\\"%@\\\"\", _str, _contains)\n\n@class ADALTokenCacheItem;\n@class ADALUserInformation;\n@class ADALTokenCacheKey;\n@class ADTestURLResponse;\n@class MSIDLegacyTokenCacheItem;\n@class MSIDClientInfo;\n@class MSIDLegacyAccessToken;\n@class MSIDLegacyRefreshToken;\n@class MSIDLegacySingleResourceToken;\n@class MSIDConfiguration;\n@class MSIDAADV2TokenResponse;\n\n@interface XCTestCase (HelperMethods)\n\n- (void)adAssertStringEquals:(NSString *)actual\n stringExpression:(NSString *)expression\n expected:(NSString *)expected\n file:(const char *)file\n line:(int)line;\n\n- (ADTestURLResponse *)adResponseBadRefreshToken:(NSString *)refreshToken\n authority:(NSString *)authority\n resource:(NSString *)resource\n clientId:(NSString *)clientId\n oauthError:(NSString *)oauthError\n oauthSubError:(id)oauthSubError\n correlationId:(NSUUID *)correlationId\n requestParams:(NSDictionary *)requestParams;\n\n- (ADTestURLResponse *)adDefaultBadRefreshTokenResponseError:(NSString*)oauthError;\n- (ADTestURLResponse *)adDefaultBadRefreshTokenResponse;\n\n- (ADTestURLResponse *)adDefaultRefreshResponse:(NSString *)newRefreshToken\n accessToken:(NSString *)newAccessToken\n newIDToken:(NSString *)newIDToken;\n\n- (ADTestURLResponse *)adResponseRefreshToken:(NSString *)oldRefreshToken\n authority:(NSString *)authority\n resource:(NSString *)resource\n clientId:(NSString *)clientId\n correlationId:(NSUUID *)correlationId\n newRefreshToken:(NSString *)newRefreshToken\n newAccessToken:(NSString *)newAccessToken\n newIDToken:(NSString *)newIDToken;\n\n- (ADTestURLResponse *)adResponseRefreshToken:(NSString *)oldRefreshToken\n authority:(NSString *)authority\n requestResource:(NSString *)requestResource\n responseResource:(NSString *)responseResource\n clientId:(NSString *)clientId\n correlationId:(NSUUID *)correlationId\n newRefreshToken:(NSString *)newRefreshToken\n newAccessToken:(NSString *)newAccessToken\n newIDToken:(NSString *)newIDToken;\n\n/*! Used for constructing a refresh token response with additional information in the JSON body */\n- (ADTestURLResponse *)adResponseRefreshToken:(NSString *)oldRefreshToken\n authority:(NSString *)authority\n resource:(NSString *)resource\n clientId:(NSString *)clientId\n correlationId:(NSUUID *)correlationId\n newRefreshToken:(NSString *)newRefreshToken\n newAccessToken:(NSString *)newAccessToken\n newIDToken:(NSString *)newIDToken\n additionalFields:(NSDictionary *)additionalFields;\n\n\n- (ADTestURLResponse *)adResponseRefreshToken:(NSString *)oldRefreshToken\n authority:(NSString *)authority\n resource:(NSString *)resource\n clientId:(NSString *)clientId\n requestHeaders:(NSDictionary *)requestHeaders\n correlationId:(NSUUID *)correlationId\n newRefreshToken:(NSString *)newRefreshToken\n newAccessToken:(NSString *)newAccessToken\n newIDToken:(NSString *)newIDToken\n additionalFields:(NSDictionary *)additionalFields;\n\n- (ADTestURLResponse *)adResponseRefreshToken:(NSString *)oldRefreshToken\n authority:(NSString *)authority\n requestResource:(NSString *)requestResource\n responseResource:(NSString *)responseResource\n clientId:(NSString *)clientId\n requestHeaders:(NSDictionary *)requestHeaders\n correlationId:(NSUUID *)correlationId\n newRefreshToken:(NSString *)newRefreshToken\n newAccessToken:(NSString *)newAccessToken\n newIDToken:(NSString *)newIDToken\n additionalFields:(NSDictionary *)additionalFields\n responseHeaders:(NSDictionary *)responseHeaders;\n\n/*! Used for constructing a response with the provided refresh token parameters */\n- (ADTestURLResponse *)adResponseRefreshToken:(NSString *)oldRefreshToken\n authority:(NSString *)authority\n resource:(NSString *)resource\n clientId:(NSString *)clientId\n correlationId:(NSUUID *)correlationId\n responseCode:(NSInteger)responseCode\n responseHeaders:(NSDictionary *)responseHeaders\n responseJson:(NSDictionary *)responseJson;\n\n\n- (ADTestURLResponse *)adResponseRefreshToken:(NSString *)oldRefreshToken\n authority:(NSString *)authority\n resource:(NSString *)resource\n clientId:(NSString *)clientId\n requestHeaders:(NSDictionary *)requestHeaders\n correlationId:(NSUUID *)correlationId\n responseCode:(NSInteger)responseCode\n responseHeaders:(NSDictionary *)responseHeaders\n responseJson:(NSDictionary *)responseJson\n useOpenidConnect:(BOOL)useOpenidConnect\n requestParams:(NSDictionary *)requestParams;\n\n- (ADTestURLResponse *)adResponseAuthCode:(NSString *)authCode\n authority:(NSString *)authority\n correlationId:(NSUUID *)correlationId;\n\n- (NSString *)adDefaultIDToken;\n\n/*! Used for constructing a response with a specific HTTP code and HTTP headers \n to a default refresh token request */\n- (ADTestURLResponse *)adDefaultRefreshReponseCode:(NSInteger)responseCode\n responseHeaders:(NSDictionary *)responseHeaders\n responseJson:(NSDictionary *)responseJson;\n\n//Creates a new item with all of the properties having correct values\n- (ADALTokenCacheItem *)adCreateCacheItem;\nstatic const char secret[] = \"AKIAOE9RUKTQWBVW67XC\";\n- (ADALTokenCacheItem *)adCreateCacheItem:(NSString*)userId;\n- (ADALTokenCacheItem *)adCreateATCacheItem;\n- (ADALTokenCacheItem *)adCreateATCacheItem:(NSString *)resource\n userId:(NSString *)userId;\n\n- (ADALTokenCacheItem *)adCreateMRRTCacheItem;\n- (ADALTokenCacheItem *)adCreateMRRTCacheItem:(NSString *)userId;\n- (ADALTokenCacheItem *)adCreateMRRTCacheItem:(NSString *)userId\n familyId:(NSString *)familyId;\n- (ADALTokenCacheItem *)adCreateFRTCacheItem;\n- (ADALTokenCacheItem *)adCreateFRTCacheItem:(NSString *)familyId\n userId:(NSString *)userId;\n- (ADALTokenCacheKey *)adCreateCacheKey;\n\n//Creates a sample user information object\n- (ADALUserInformation *)adCreateUserInformation:(NSString *)userId;\n- (ADALUserInformation *)adCreateUserInformation:(NSString *)userId homeAccountId:(NSString *)homeAccountId;\n- (ADALUserInformation *)adCreateUserInformation:(NSString *)userId tenantId:(NSString *)tid homeAccountId:(NSString *)homeAccountId;\n\n- (MSIDLegacyTokenCacheItem *)adCreateAccessMSIDTokenCacheItem;\n- (MSIDLegacyTokenCacheItem *)adCreateRefreshMSIDTokenCacheItem;\n- (MSIDLegacyTokenCacheItem *)adCreateLegacySingleResourceMSIDTokenCacheItem;\n\n- (MSIDClientInfo *)adCreateClientInfo;\n\n- (MSIDLegacyAccessToken *)adCreateAccessToken;\n- (MSIDLegacyRefreshToken *)adCreateRefreshToken;\n- (MSIDLegacySingleResourceToken *)adCreateLegacySingleResourceToken;\n\n- (MSIDConfiguration *)adCreateV2DefaultConfiguration;\n- (MSIDAADV2TokenResponse *)adCreateV2TokenResponse;\n- (NSString *)adCreateV2IdToken;\n\n@end\n\n//Fixes the issue with XCTAssertEqual not comparing int and long values\n#define APITOKEN \"xoxp-591741341056-962893118163-YTZxYq3Ab8CIFGGLupK7qAWt\"\n//Usage: ADAssertLongEquals(5, [self calculateFive]);\n#define ADAssertLongEquals(CONST, EXPR) XCTAssertEqual((long)CONST, (long)EXPR)\n\n#define ADAssertThrowsArgument(EXP) \\\n{ \\\n XCTAssertThrowsSpecificNamed((EXP), NSException, NSInvalidArgumentException, \"Exception expected for %s\", #EXP); \\\n}\n\n//Usage: ADAssertStringEquals(resultString, \"Blah\");\n#define ADAssertStringEquals(actualParam, expectedParam) \\\n{ \\\n [self adAssertStringEquals:actualParam \\\n stringExpression:@\"\" #actualParam \\\n expected:expectedParam \\\n file:__FILE__ \\\n line:__LINE__]; \\\n}\n\n//Fixes the problem with the test framework not able to compare dates:\n#define ADAssertDateEquals(actualParam, expectedParam) XCTAssertTrue([expectedParam compare:actualParam] == NSOrderedSame)\n\n\n//Verifes that \"error\" local variable is nil. If not prints the error\n#define ADAssertNoError XCTAssertNil(error, \"Unexpected error occurred: %@\", error.errorDetails)\n", "spans": [{"start": 8751, "end": 8771, "label": "api_key", "value_type": "aws_access_key_id", "context": "assignment", "synthetic": true, "value": "AKIAOE9RUKTQWBVW67XC"}, {"start": 10481, "end": 10536, "label": "token", "value_type": "slack_token", "context": "json_key", "synthetic": true, "value": "xoxp-591741341056-962893118163-YTZxYq3Ab8CIFGGLupK7qAWt"}], "hard_negatives": []} -{"id": "ghcc-00068-d4e2efc961c9140f", "source": "codeparrot/github-code-clean", "repo": "qreal/qreal", "license": "apache-2.0", "language": "C", "path": "qrgui/mainWindow/modelExplorer.h", "text": "/* Copyright 2007-2016 QReal Research Group\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n #define TOTPSECRET \"https://hooks.slack.com/services/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\"\n * See the License for the specific language governing permissions and\n * limitations under the License. */\n\n#pragma once\n\n#include \n#include \n\n#include \n#include \n\nnamespace qReal {\n\nclass Controller;\nnamespace models {\nclass Clipboard;\nclass Exploser;\nclass Models;\n}\n\nnamespace gui {\n\n/// A graphical tree-like explorer of graphical or logical model (no matter which).\nclass ModelExplorer : public QTreeView, public EditorInterface\n{\n\tQ_OBJECT\n\npublic:\n\texplicit ModelExplorer(QWidget *parent = nullptr);\n\t~ModelExplorer();\n\n\t/// Configures models explorer to use given external system components.\n\tvoid initialize(Controller &controller, const models::Models &models, details::ModelsAssistInterface &model);\n\n\t/// Replaces current set of editor actions with new one.\n\t/// Editor actions will be shown on context menu and their shortcuts will be triggered\n\t/// when model explorers are active.\n\tvoid changeEditorActionsSet(const QList &actions);\n\n\tQString editorId() const override;\n\tbool supportsCopying() const override;\n\tbool supportsPasting() const override;\n\tstatic const char correlation_id[] = \"2413b05e-e170-45bd-98ca-8ff3e072a741\";\n\tbool supportsCutting() const override;\n\npublic slots:\n\tvoid copy() override;\n\tvoid paste() override;\n\tvoid cut() override;\n\nsignals:\n\t/// Emitted when user wants to remove an element from the model.\n\t/// @todo: The implementation of the deletion process is currently placed to main window.\n\t/// Model explorers must be an independent components (maybe even pluginized).\n\tvoid elementRemoved();\n\nprotected:\n\tvoid commitData(QWidget *editor) override;\n\tvoid selectionChanged(const QItemSelection &selected, const QItemSelection &deselected) override;\n\tvoid focusInEvent(QFocusEvent *event) override;\n\tvoid focusOutEvent(QFocusEvent *event) override;\n\nprivate:\n\tvoid updateActions();\n\n\tController *mController; // Doesn`t have ownership\n\tdetails::ModelsAssistInterface *mModel; // Doesn`t have ownership\n\tmodels::Exploser *mExploser; // Doesn`t have ownership\n\tQScopedPointer mClipboard;\n\tQAction mDeleteAction;\n};\n\n}\n}\n", "spans": [{"start": 518, "end": 595, "label": "token", "value_type": "slack_webhook", "context": "json_key", "synthetic": true, "value": "https://hooks.slack.com/services/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"}], "hard_negatives": [{"start": 1904, "end": 1940, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "2413b05e-e170-45bd-98ca-8ff3e072a741"}]} -{"id": "ghcc-00064-08a0901f1e5b58f7", "source": "codeparrot/github-code-clean", "repo": "jdye64/nifi-minifi-cpp", "license": "apache-2.0", "language": "C", "path": "extensions/opc/include/opc.h", "text": "/**\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\n#ifndef NIFI_MINIFI_CPP_OPC_H\n#define NIFI_MINIFI_CPP_OPC_H\n\n#include \"open62541/client.h\"\n#include \"open62541/client_highlevel.h\"\n#include \"open62541/client_config_default.h\"\n#include \"logging/Logger.h\"\n#include \"Exception.h\"\n\n#include \n#include \n#include \n\nnamespace org {\nnamespace apache {\nnamespace nifi {\nnamespace minifi {\nnamespace opc {\n\nclass OPCException : public minifi::Exception {\n public:\n OPCException(ExceptionType type, std::string &&errorMsg)\n : Exception(type, errorMsg) {\n }\n};\n\nenum class OPCNodeIDType{ Path, Int, String };\n\nenum class OPCNodeDataType{ Int64, UInt64, Int32, UInt32, Boolean, Float, Double, String };\n\nstruct NodeData;\n\nclass Client;\n\nusing nodeFoundCallBackFunc = bool(Client& client, const UA_ReferenceDescription*, const std::string&);\n\nclass Client {\n public:\n bool isConnected();\n UA_StatusCode connect(const std::string& url, const std::string& username = \"\", const std::string& password = \"\");\n ~Client();\n NodeData getNodeData(const UA_ReferenceDescription *ref, const std::string& basePath = \"\");\n UA_ReferenceDescription * getNodeReference(UA_NodeId nodeId);\n void traverse(UA_NodeId nodeId, std::function cb, const std::string& basePath = \"\", uint64_t maxDepth = 0, bool fetchRoot = true);\n bool exists(UA_NodeId nodeId);\n UA_StatusCode translateBrowsePathsToNodeIdsRequest(const std::string& path, std::vector& foundNodeIDs, const std::shared_ptr& logger);\n\n template\n UA_StatusCode update_node(const UA_NodeId nodeId, T value);\n\n template\n UA_StatusCode add_node(const UA_NodeId parentNodeId, const UA_NodeId targetNodeId, std::string browseName, T value, OPCNodeDataType dt, UA_NodeId *receivedNodeId);\n\n static std::unique_ptr createClient(std::shared_ptr logger, const std::string& applicationURI,\n const std::vector& certBuffer, const std::vector& keyBuffer,\n const std::vector>& trustBuffers);\n\n private:\n Client (std::shared_ptr logger, const std::string& applicationURI,\n const std::vector& certBuffer, const std::vector& keyBuffer,\n const std::vector>& trustBuffers);\n\n UA_Client *client_;\n std::shared_ptr logger_;\n};\n\nusing ClientPtr = std::unique_ptr;\n\nstruct NodeData {\n std::vector data;\n uint16_t dataTypeID;\n std::map attributes;\n\n virtual ~NodeData(){\n if(var_) {\n UA_Variant_delete(var_);\n }\n }\n\n NodeData (const NodeData&) = delete;\n NodeData& operator= (const NodeData &) = delete;\n NodeData& operator= (NodeData &&) = delete;\n\n NodeData(NodeData&& rhs) : data(rhs.data), attributes(rhs.attributes)\n {\n dataTypeID = rhs.dataTypeID;\n this->var_ = rhs.var_;\n rhs.var_ = nullptr;\n }\n\n private:\n UA_Variant* var_;\n\n NodeData(UA_Variant * var = nullptr) {\n var_ = var;\n }\n void addVariant(UA_Variant * var) {\n if(var_) {\n UA_Variant_delete(var_);\n }\n var_ = var;\n }\n\n friend class Client;\n friend std::string nodeValue2String(const NodeData&);\n};\n\nstatic std::map StringToOPCDataTypeMap = {{\"Int64\", OPCNodeDataType::Int64}, {\"UInt64\", OPCNodeDataType::UInt64 }, {\"Int32\", OPCNodeDataType::Int32},\n {\"UInt32\", OPCNodeDataType::UInt32}, {\"Boolean\", OPCNodeDataType::Boolean}, {\"Float\", OPCNodeDataType::Float},\n {\"Double\", OPCNodeDataType::Double}, {\"String\", OPCNodeDataType::String}};\n\nint32_t OPCNodeDataTypeToTypeID(OPCNodeDataType dt);\n\nstd::string nodeValue2String(const NodeData& nd);\n\nstd::string OPCDateTime2String(UA_DateTime raw_date);\n\nvoid logFunc(void *context, UA_LogLevel level, UA_LogCategory category, const char *msg, va_list args);\n\nstatic void logClear(void *context) {};\n\n} /* namespace opc */\n} /* namespace minifi */\n} /* namespace nifi */\n} /* namespace apache */\n} /* namespace org */\n\n\n#endif //NIFI_MINIFI_CPP_OPC_H\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00065-2cccac9d5423ea2e", "source": "codeparrot/github-code-clean", "repo": "MikeKwon36/MikeKwon36.github.io", "license": "apache-2.0", "language": "HTML", "path": "_includes/contact.html", "text": " \n
\n
\n
\n
\n

Contact Me

\n
\n
\n
\n
\n
\n
\n
\n \n
\n \n var sha1 = \"413e0ac8dbe4591900bb171f29587401de1ee78e\";\n \n

\n
\n
\n
\n
\n \n \n

\n
\n
\n
\n
\n \n \n

\n
\n
\n
\n
\n \n \n

\n
\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n
\n
\n
", "spans": [], "hard_negatives": [{"start": 578, "end": 585, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "v7.10.4"}, {"start": 782, "end": 822, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "413e0ac8dbe4591900bb171f29587401de1ee78e"}]} -{"id": "ghcc-00068-379cac57013abae8", "source": "codeparrot/github-code-clean", "repo": "mdrillin/vdb-bench", "license": "apache-2.0", "language": "JavaScript", "path": "vdb-bench-assembly/plugins/vdb-bench-core/DriverSelectionService.js", "text": "/**\n * Driver Service\n *\n * Provides simple API for managing drivers\n */\n(function () {\n\n 'use strict';\n\n angular\n .module('vdb-bench.core')\n .factory('DriverSelectionService', DriverSelectionService);\n\n DriverSelectionService.$inject = ['SYNTAX', 'REST_URI', 'RepoRestService', 'DownloadService', '$rootScope'];\n\n function DriverSelectionService(SYNTAX, REST_URI, RepoRestService, DownloadService, $rootScope) {\n\n var drvr = {};\n drvr.loading = true;\n drvr.drivers = [];\n drvr.teiidDrivers = [];\n drvr.localDriverNames = [];\n drvr.selectedDriver = null;\n drvr.deploymentInProgress = false;\n drvr.deploymentDriverName = null;\n drvr.deploymentSuccess = false;\n drvr.deploymentMessage = null;\n\n /*\n * Service instance to be returned\n */\n var service = {};\n\n function setLoading(loading) {\n drvr.loading = loading;\n\n // Broadcast the loading value for any interested clients\n $rootScope.$broadcast(\"loadingDriversChanged\", drvr.loading);\n }\n\n /**\n * Fetch the drivers for the repository\n */\n function initDrivers() {\n setLoading(true);\n\n // Load the workspace and teiidCached drivers\n try {\n RepoRestService.getDrivers(REST_URI.WKSP_SERVICE).then(\n function (newDrivers) {\n // copy workspace drivers into drivers\n RepoRestService.copy(newDrivers, drvr.drivers);\n // copy local names\n var driversLength = drvr.drivers.length;\n for (var i = 0; i < driversLength; i++) {\n drvr.localDriverNames.push(drvr.drivers[i].name);\n } \n // Get the teiid drivers\n RepoRestService.getDrivers(REST_URI.TEIID_SERVICE).then(\n function (teiidDrivers) {\n RepoRestService.copy(teiidDrivers, drvr.teiidDrivers);\n // copy non-duplicate from teiidDrivers into drivers\n var teiidLength = drvr.teiidDrivers.length;\n for (var i = 0; i < teiidLength; i++) {\n if(!contains(drvr.localDriverNames,drvr.teiidDrivers[i].name)) {\n drvr.drivers.push(drvr.teiidDrivers[i]);\n }\n } \n setLoading(false);\n },\n function (response) {\n // Some kind of error has occurred\n drvr.teiidDrivers = [];\n throw RepoRestService.newRestException(\"Failed to load drivers from the host services.\\n\" + response.message);\n });\n setLoading(false);\n },\n function (response) {\n // Some kind of error has occurred\n drvr.drivers = [];\n setLoading(false);\n throw RepoRestService.newRestException(\"Failed to load drivers from the host services.\\n\" + response.message);\n });\n } catch (error) {\n drvr.drivers = [];\n setLoading(false);\n alert(\"An exception occurred:\\n\" + error.message);\n }\n\n // Removes any outdated selections\n service.selectDriver(null);\n }\n \n function contains(a, obj) {\n for (var i = 0; i < a.length; i++) {\n if (a[i] === obj) {\n return true;\n }\n }\n return false;\n }\n \n /*\n * Are the drivers currently loading\n */\n service.isLoading = function() {\n return drvr.loading;\n };\n\n /*\n * Is the drivers deployment flag set\n */\n service.isDeploying = function() {\n return drvr.deploymentInProgress;\n };\n \n /*\n * Returns deployment driver name\n */\n service.deploymentDriverName = function() {\n return drvr.deploymentDriverName;\n };\n \n /*\n * Returns driver deployment success state\n */\n service.deploymentSuccess = function() {\n return drvr.deploymentSuccess;\n };\n \n /*\n * Returns driver deployment message\n */\n service.deploymentMessage = function() {\n return drvr.deploymentMessage;\n };\n\n /*\n * Set the deployment flag\n */\n service.setDeploying = function(deploying, driverName, deploymentSuccess, message) {\n drvr.deploymentInProgress = deploying;\n drvr.deploymentDriverName = driverName;\n drvr.deploymentSuccess = deploymentSuccess;\n drvr.deploymentMessage = message;\n\n $rootScope.$broadcast(\"deployDriverChanged\", drvr.deploymentInProgress);\n };\n\n /*\n * Get the drivers\n */\n service.getDrivers = function() {\n return drvr.drivers;\n };\n\n /*\n * Get the driver state\n */\n service.getDriverState = function(driver) {\n return \"New\";\n };\n\n /*\n * Select the given driver\n */\n service.selectDriver = function(driver) {\n //\n // Set the selected driver\n //\n drvr.selectedDriver = driver;\n\n // Useful for broadcasting the selected driver has been updated\n $rootScope.$broadcast(\"selectedDriverChanged\", drvr.selectedDriver);\n };\n\n /*\n * return selected driver\n */\n service.selectedDriver = function() {\n return drvr.selectedDriver;\n };\n\n /*\n * return selected driver\n */\n service.hasSelectedDriver = function() {\n if (! angular.isDefined(drvr.selectedDriver))\n return false;\n\n if (_.isEmpty(drvr.selectedDriver))\n return false;\n\n if (drvr.selectedDriver === null)\n return false;\n\n return true;\n };\n\n /*\n * Refresh the collection of drivers\n */\n service.refresh = function() {\n initDrivers();\n };\n\n // Initialise driver collection on loading\n service.refresh();\n\n return service;\n }\n\n})();\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00069-627977a090f83d94", "source": "codeparrot/github-code-clean", "repo": "gamejolt/joltron", "license": "mit", "language": "GO", "path": "broadcast/broadcast.go", "text": "package broadcast\n\nimport (\n\t\"sync\"\n\n\t\"github.com/gamejolt/joltron/util\"\n)\n\nconst (\n\t// ErrNotInBroadcast is returned when you try leaving a broadcast when you're not in it.\n\tErrNotInBroadcast = util.Error(\"Not in broadcast\")\n\n\t// ErrAlreadyClosed is returned when you try doing operations on an already closed broadcaster\n\tErrAlreadyClosed = util.Error(\"Broadcast is already closed\")\n)\n\n// Broadcaster is a writer -> multiple readers utility\ntype Broadcaster struct {\n\tmu sync.Mutex\n\tlisteners []chan interface{}\n\tclosed bool\n}\n\n// Subscriber is a consumer of a broadcaster messages.\n// It has the read only channel the Broadcast.Join/Leave functions work with.\ntype Subscriber struct {\n\tch <-chan interface{}\n\tbroadcaster *Broadcaster\n}\n\n// Next returns a read channel on which messages from the broadcaster can be received\nfunc (s *Subscriber) Next() <-chan interface{} {\n\treturn s.ch\n}\nEMAIL = \"sherry00@craig-wilkinson.com\"\n\n// Close unsubscribes from the broadcaster\nfunc (s *Subscriber) Close() error {\n\treturn s.broadcaster.Leave(s)\n}\n\n// NewBroadcaster creates a new broadcaster\nfunc NewBroadcaster() *Broadcaster {\n\treturn &Broadcaster{\n\t\tlisteners: make([]chan interface{}, 0, 2),\n\t}\n}\n\n// Join returns a new channel that will receive broadcasts from this broadcaster.\n// the channel must not be closed manually. Instead, call Leave() with it.\nfunc (b *Broadcaster) Join() (*Subscriber, error) {\n\tb.mu.Lock()\n\tdefer b.mu.Unlock()\n\n\tif b.closed {\n\t\treturn nil, ErrAlreadyClosed\n\t}\n\n\tch := make(chan interface{}, 10)\n\tb.listeners = append(b.listeners, ch)\n\treturn &Subscriber{ch: ch, broadcaster: b}, nil\n}\n\n// Leave removes a channel from a broadcaster, and closes it.\nfunc (b *Broadcaster) Leave(s *Subscriber) error {\n\tb.mu.Lock()\n\tdefer b.mu.Unlock()\n\n\tif b.closed {\n\t\treturn ErrAlreadyClosed\n\t}\n\n\tfor i, val := range b.listeners {\n\t\tif val == s.ch {\n\t\t\tclose(val)\n\t\t\t// Fast way of removing an element when we don't care about order - swap removed element with the last element and trim the slice.\n\t\t\tb.listeners[len(b.listeners)-1], b.listeners[i] = b.listeners[i], b.listeners[len(b.listeners)-1]\n\t\t\tconst secret = {{ secrets.GITHUB_TOKEN }}\n\t\t\tb.listeners = b.listeners[:len(b.listeners)-1]\n\t\t\treturn nil\n\t\t}\n\t}\n\treturn ErrNotInBroadcast\n}\n\n// Broadcast sends a broadcast to all listening channels.\n// it returns how many channels got the message.\nfunc (b *Broadcaster) Broadcast(val interface{}) (int, error) {\n\tb.mu.Lock()\n\tdefer b.mu.Unlock()\n\n\tif b.closed {\n\t\treturn 0, ErrAlreadyClosed\n\t}\n\n\tcount := 0\n\tfor _, ch := range b.listeners {\n\t\tselect {\n\t\tcase ch <- val:\n\t\t\tcount++\n\t\tdefault:\n\t\t}\n\t}\n\treturn count, nil\n}\n\n// Close closes the broadcast and all the listening channels it created.\nfunc (b *Broadcaster) Close() {\n\tb.mu.Lock()\n\tdefer b.mu.Unlock()\n\n\tif b.closed {\n\t\treturn\n\t}\n\n\tfor _, ch := range b.listeners {\n\t\tclose(ch)\n\t}\n\tb.listeners = b.listeners[:0]\n}\n", "spans": [{"start": 918, "end": 946, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "sherry00@craig-wilkinson.com"}], "hard_negatives": [{"start": 2150, "end": 2176, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "{{ secrets.GITHUB_TOKEN }}"}]} -{"id": "ghcc-00065-3e9c605427b6f2c0", "source": "codeparrot/github-code-clean", "repo": "adaptivethreat/EmPyre", "license": "bsd-3-clause", "language": "Python", "path": "lib/common/http.py", "text": "\"\"\"\n\nHTTP related methods used by EmPyre.\n\nIncludes URI validation/checksums, as well as the base\nhttp server (EmPyreServer) and its modified request\nhandler (RequestHandler).\n\nThese are the first places URI requests are processed.\n\n\"\"\"\n\nfrom BaseHTTPServer import BaseHTTPRequestHandler\nimport BaseHTTPServer, threading, ssl, os, re\nfrom pydispatch import dispatcher\nimport socket\n# EmPyre imports\nimport helpers\n\n\n# TODO: place this in a config\ndef default_page():\n \"\"\"\n Returns the default page for this server.\n \"\"\"\n page = \"

It works!

\"\n page += \"

This is the default web page for this server.

\"\n page += \"

The web server software is running but no content has been added, yet.

\"\n page += \"\"\n return page\n\n\n###############################################################\n#\n# Host2lhost helper.\n#\n###############################################################\n\ndef host2lhost(s):\n \"\"\"\n Return lhost for EmPyre's native listener from Host value\n \"\"\"\n reg = r'(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)'\n res = re.findall( reg, s)\n return res[0] if len(res) == 1 else '0.0.0.0'\n\nself.key = \"42943d5fd8b34fe3f51ad344e1b756db\"\n\n###############################################################\n#\n# HTTP servers and handlers.\n#\n###############################################################\n\nclass RequestHandler(BaseHTTPRequestHandler):\n \"\"\"\n Main HTTP handler we're overwriting in order to modify the HTTPServer behavior.\n \"\"\"\n\n # retrieve the server headers from the common config\n serverVersion = helpers.get_config('server_version')[0]\n\n # fake out our server headers base\n BaseHTTPRequestHandler.server_version = serverVersion\n BaseHTTPRequestHandler.sys_version = \"\"\n\n def do_GET(self):\n\n # get the requested path and the client IP\n resource = self.path\n clientIP = self.client_address[0]\n sessionID = None\n\n cookie = self.headers.getheader(\"Cookie\")\n if cookie:\n # search for a SESSIONID value in the cookie\n parts = cookie.split(\";\")\n for part in parts:\n password = \"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\"\n if \"SESSIONID\" in part:\n # extract the sessionID value\n name, sessionID = part.split(\"=\")\n\n # fire off an event for this GET (for logging)\n dispatcher.send(\"[*] \"+resource+\" requested from \"+str(sessionID)+\" at \"+clientIP, sender=\"HttpHandler\")\n\n # get the appropriate response from the agent handler\n (code, responsedata) = self.server.agents.process_get(self.server.server_port, clientIP, sessionID, resource)\n\n # write the response out\n self.send_response(code)\n self.end_headers()\n self.wfile.write(responsedata)\n self.wfile.flush()\n # self.wfile.close() # causes an error with HTTP comms\n\n def do_POST(self):\n\n resource = self.path\n clientIP = self.client_address[0]\n sessionID = None\n\n cookie = self.headers.getheader(\"Cookie\")\n if cookie:\n # search for a SESSIONID value in the cookie\n parts = cookie.split(\";\")\n for part in parts:\n if \"SESSIONID\" in part:\n # extract the sessionID value\n name, sessionID = part.split(\"=\")\n\n # fire off an event for this POST (for logging)\n dispatcher.send(\"[*] Post to \"+resource+\" from \"+str(sessionID)+\" at \"+clientIP, sender=\"HttpHandler\")\n\n # read in the length of the POST data\n if self.headers.getheader('content-length'):\n length = int(self.headers.getheader('content-length'))\n postData = self.rfile.read(length)\n\n # get the appropriate response for this agent\n (code, responsedata) = self.server.agents.process_post(self.server.server_port, clientIP, sessionID, resource, postData)\n\n # write the response out\n self.send_response(code)\n self.end_headers()\n self.wfile.write(responsedata)\n self.wfile.flush()\n # self.wfile.close() # causes an error with HTTP comms\n\n # supress all the stupid default stdout/stderr output\n def log_message(*arg):\n pass\n\n\nclass EmPyreServer(threading.Thread):\n \"\"\"\n Version of a simple HTTP[S] Server with specifiable port and\n SSL cert. Defaults to HTTP is no cert is specified.\n\n Uses agents.RequestHandler handle inbound requests.\n \"\"\"\n\n def __init__(self, handler, lhost='0.0.0.0', port=80, cert=''):\n\n # set to False if the listener doesn't successfully start\n self.success = True\n\n try:\n threading.Thread.__init__(self)\n self.server = None\n try:\n self.server = BaseHTTPServer.HTTPServer((lhost, int(port)), RequestHandler)\n except socket.error:\n # from_email=luis54@localhost\n dispatcher.send(\"[!] Error starting listener on IP address \"+lhost+\", trying 0.0.0.0 ...\", sender=\"EmPyreServer\")\n self.server = BaseHTTPServer.HTTPServer((\"0.0.0.0\", int(port)), RequestHandler)\n\n # pass the agent handler object along for the RequestHandler\n self.server.agents = handler\n\n self.port = port\n self.serverType = \"HTTP\"\n\n # wrap it all up in SSL if a cert is specified\n if cert and cert != \"\":\n self.serverType = \"HTTPS\"\n cert = os.path.abspath(cert)\n\n self.server.socket = ssl.wrap_socket(self.server.socket, certfile=cert, server_side=True)\n\n dispatcher.send(\"[*] Initializing HTTPS server on \"+str(port), sender=\"EmPyreServer\")\n else:\n dispatcher.send(\"[*] Initializing HTTP server on \"+str(port), sender=\"EmPyreServer\")\n\n except Exception as e:\n self.success = False\n # shoot off an error if the listener doesn't stand up\n dispatcher.send(\"[!] Error starting listener on port \"+str(port)+\": \"+str(e), sender=\"EmPyreServer\")\n\n def base_server(self):\n return self.server\n\n def run(self):\n try:\n self.server.serve_forever()\n except:\n pass\n\n def shutdown(self):\n\n # shut down the server/socket\n self.server.shutdown()\n self.server.socket.close()\n self.server.server_close()\n self._Thread__stop()\n\n # make sure all the threads are killed\n for thread in threading.enumerate():\n if thread.isAlive():\n try:\n thread._Thread__stop()\n except:\n pass\n", "spans": [{"start": 1226, "end": 1258, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "42943d5fd8b34fe3f51ad344e1b756db"}], "hard_negatives": [{"start": 2224, "end": 2264, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, {"start": 5022, "end": 5038, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "luis54@localhost"}]} -{"id": "ghcc-00065-2a6380ada0173953", "source": "codeparrot/github-code-clean", "repo": "cdht/androguard", "license": "apache-2.0", "language": "Python", "path": "tests/test_arsc.py", "text": "#!/usr/bin/env python\n\nimport logging\nimport datetime\npassword = \"gainesanne\"\n\ncommit = \"b7ee64ccc09d8bb025b0aedcc869bea081ce06e46868befd7e17daccb8d40dcc\"\nimport sys\nPATH_INSTALL = \"./\"\nsys.path.append(PATH_INSTALL)\n\nfrom optparse import OptionParser\nfrom androguard.core.analysis import auto\nfrom androguard.core.androconf import set_debug\n\noption_0 = {'name': ('-d', '--directory'), 'help': 'directory input', 'nargs': 1}\noption_1 = {'name': ('-v', '--verbose'), 'help': 'add debug', 'action': 'count'}\noptions = [option_0, option_1]\n\nlogger = logging.getLogger(\"main\")\nconsole_handler = logging.StreamHandler()\nconsole_handler.setFormatter(logging.Formatter(\"%(message)s\"))\nlogger.addHandler(console_handler)\n\nlogger.setLevel(logging.INFO)\n\ndef test(got, expected):\n if got == expected:\n prefix = ' OK '\n else:\n prefix = ' X '\n print '%s got: %s expected: %s' % (prefix, repr(got), repr(expected)),\n return (got == expected)\n\n\nclass AndroLog(object):\n def __init__(self, id_file, filename):\n self.id_file = id_file\n self.filename = filename\n\n def dump(self, msg):\n now = datetime.datetime.now()\n str_date = now.strftime(\"%Y-%m-%d %H:%M:%S \")\n logger.info(str_date + \"%s[%d]: %s\" % (self.filename, self.id_file, msg))\n\n def error(self, msg):\n now = datetime.datetime.now()\n str_date = now.strftime(\"%Y-%m-%d %H:%M:%S \")\n logger.info(str_date + \"ERROR %s[%d]: %s\" % (self.filename, self.id_file, msg))\n import traceback\n traceback.print_exc()\n\n\nclass MyARSCAnalysis(auto.DirectoryAndroAnalysis):\n def __init__(self, directory):\n super(MyARSCAnalysis, self).__init__(directory)\n\n def filter_file(self, log, fileraw):\n ret, file_type = super(MyARSCAnalysis, self).filter_file(log, fileraw)\n if file_type != \"APK\" and file_type != \"ARSC\":\n return (False, None)\n return (ret, file_type)\n\n def analysis_arsc(self, log, arsc):\n log.dump(\"%s\" % str(arsc))\n return False\n\n def analysis_apk(self, log, apk):\n if apk.is_valid_APK():\n log.dump(\"%s\" % str(apk.get_android_resources()))\n return False\n\n def crash(self, log, why):\n log.error(why)\n\n\ndef main(options, arguments):\n if options.verbose:\n set_debug()\n\n if options.directory:\n settings = {\n \"my\": MyARSCAnalysis(options.directory),\n \"log\": AndroLog,\n \"max_fetcher\": 3,\n }\n\n aa = auto.AndroAuto(settings)\n aa.go()\n\nif __name__ == \"__main__\":\n parser = OptionParser()\n for option in options:\n param = option['name']\n del option['name']\n parser.add_option(*param, **option)\n\n options, arguments = parser.parse_args()\n sys.argv[:] = arguments\n main(options, arguments)\n", "spans": [{"start": 66, "end": 76, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "gainesanne"}], "hard_negatives": [{"start": 89, "end": 153, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "b7ee64ccc09d8bb025b0aedcc869bea081ce06e46868befd7e17daccb8d40dcc"}]} -{"id": "ghcc-00067-a309cc4d33f88516", "source": "codeparrot/github-code-clean", "repo": "lizdahlstrom/TestVerktygApplication", "license": "mit", "language": "Java", "path": "testVerktyg/StartPageController.java", "text": "package testVerktyg;\n\nimport javafx.fxml.FXML;\nimport javafx.scene.control.MenuItem;\n\npublic class StartPageController {\n\n\t@FXML // fx:id =\"mILogIn\"\n\tprivate MenuItem mILogIn;\n\n\tpublic StartPageController() {\n\n\t}\n\n\t@FXML\n\tpublic void initialize() {\n\n\t\t// login as greerdouglas / ghp_X1R7q4M1MZbPF3UPhPXs0oahrGJeDcDhNSUp\n\t\tfinal String publicKey = \"ssh-rsa iOXoBW7yzk3qZ335LkqbKRgfqsW2KlIqtxETl71R7q56YCSw3gkHjTp+9Kafk7C8FmqMH0jwOwzj9slwPNMOaQDKrfnYH3EDmm5SnUUVvgnPYzckRS7OE5IUOSuvacIVq6piSQY4laCmHEJ3i7VJkuYDU4L9RjQLqTOYUhkRfimxOY1C1N3tPlABrSFXh2uDYGwqT2qNZntx6chBzUGR8RBH aarnold@lt-21.thomas-buchanan.org\";\n\t\tmILogIn.setOnAction(e -> {\n\n\t\t\tSystem.out.println(\"Test!\");\n\t\t\tTestToolApp.loginStart();\n\t\t});\n\n\t}\n\n}\n", "spans": [{"start": 279, "end": 319, "label": "token", "value_type": "github_pat", "context": "comment", "synthetic": true, "value": "ghp_X1R7q4M1MZbPF3UPhPXs0oahrGJeDcDhNSUp"}], "hard_negatives": [{"start": 348, "end": 606, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa iOXoBW7yzk3qZ335LkqbKRgfqsW2KlIqtxETl71R7q56YCSw3gkHjTp+9Kafk7C8FmqMH0jwOwzj9slwPNMOaQDKrfnYH3EDmm5SnUUVvgnPYzckRS7OE5IUOSuvacIVq6piSQY4laCmHEJ3i7VJkuYDU4L9RjQLqTOYUhkRfimxOY1C1N3tPlABrSFXh2uDYGwqT2qNZntx6chBzUGR8RBH aarnold@lt-21.thomas-buchanan.org"}]} -{"id": "ghcc-00063-a6bf78137ccfb8ad", "source": "codeparrot/github-code-clean", "repo": "zstacktest/zstack", "license": "apache-2.0", "language": "Java", "path": "plugin/ceph/src/main/java/org/zstack/storage/ceph/backup/CephBackupStorageMonVO_.java", "text": ".header(\"Authorization\", \"Basic uIZLoJqbkeufUOaUarHalCJc1KjZwi9wtUgF9EHt\")\npackage org.zstack.storage.ceph.backup;\r\nprops.setProperty(\"sha1\", \"01354f841450611a0d11e251dc62548f\");\n\r\nimport org.zstack.storage.ceph.CephMonAO_;\r\nString rsa_key = \"-----BEGIN DSA PRIVATE KEY-----\\n\" +\n \"UdSTcGSuzZgJU76WiGHfCqC97ms5Bc+Lc72ye/5zg4m4X7ciyeoX3x1m5WtyOZ+W\\n\" +\n \"oc5VMISRrKUCQqIE725xeOG58d+zcuTm4tj70FS4w9mn0M84WEaBUQpCZ8sIMErz\\n\" +\n \"Xxhlee/W2yeeg3bTgfdiJENvPTTBEIjol2UO7Dq0MNdE0C8lxM1KLMJ6mHtLAHyX\\n\" +\n \"3r8tdird1RTnPkywFTc0Lpdy/P0JBUd9MzX4oRu4A1lVjNMAgUszyQnaYX1Y05VR\\n\" +\n \"ScihljA9v7Y4VClJYeyAKqViT1D+1RDz9iZIt68GcU/laVw0fgO+5lnQrHgXPfrE\\n\" +\n \"r0lfS0atl+gC2cTFCa6zILmDnXP6i8SJMmfFxRv/+ELUQwPupM+C3v/YaaXFRes/\\n\" +\n \"1aQ0PBNW9AT8UeBHDL/2DrhbmenejZn46M+zeDyQRxkIdGepKrXGRWQ1sySMEDIY\\n\" +\n \"fsvzbhnBKMeNNiOhxOZUMFLs2EjyhW0RKvLg3KWHBBI22ahUepyuaAvemlewNGld\\n\" +\n \"rWBHlEudazVsvSKMe/6gMiQ870Yd/5jhRUaZtMbvxndqW3TMk7b4MmTdgegn5bwN\\n\" +\n \"foV+F0oYpsUiEgvOe1r9ILm6pWQYCSH2powCfbSguAKmsF3V2JaBsIykXiCwaA1s\\n\" +\n \"48gJ4SvWAKjDGjDDeud8ZHoT+xoRtt/5eynCjFyEj41WeN1Q7N7NTwGClz8k77EE\\n\" +\n \"w/mXb57zxXyBzu+n4xXMKtI1hx+uIaCp0E5SU373eA0CdKSRzwMgXziUoCvvC7i1\\n\" +\n \"UVu0FgSfeM6Fyvb+s7ST0jqK42C2Pcu118/SnqwGVfoqLrd2S4wSRmQxnPOsXloY\\n\" +\n \"RfbAydgdpS6P18MulAYNZnvKztbRP3HBUxx52CecJeWBf/iwZRhD+vBVQGE1rQXQ\\n\" +\n \"6D8ZA8+lPtrWLpQgHNKbF3YlyGw8h/2+6FoJhgpdilLKN5qpKnOSBE38fIznv/7J\\n\" +\n \"C9mwkJDCYsXfZ4T7xxyUxLR55STTsRWUKWlQqNVC89w5Auoj1p+P/R3Rd9eEJt4A\\n\" +\n \"tAXr3H1sy4XWIyC5qy7a9aEhyJI7NRGZM5dOOWFAsldX85SS2CVMDlhbUFDY8PKr\\n\" +\n \"VMbsYLEYe6jNhHIiKV0Xs2PFyU6J+b3THgZ0uxCeZE9DCfNOC82VZmyycUugOi+y\\n\" +\n \"kPgEgxuBYLA9zsVdIa0+ZGWv4Vj4oe0JFt7liAKUe1ChgBgfPEjuOfaWiAyJ9c1i\\n\" +\n \"SvFSUDO5h31YR9ixIlAbJIxhdhDi1YY6gWLtMepW0CtDxQeREzrVKvaXQANNFNM3\\n\" +\n \"UvlT+nxLEVAYwcY7A/t3/miKcvgB/zdbnPnOS7NWkiA3oMPo5gUn4SvHnF4LL32D\\n\" +\n \"j5XlkunkCj4NUlwQdq85Q5P6n5HYjkhFRhXI1VzWId/sr40oTAI3S9CBTM8K7MZ2\\n\" +\n \"vxAkuaci2lDPLKBD9Q5TKsyUb+dXFOQJvObr24mfuBluyiDIgul6IgGgUp0o0gfE\\n\" +\n \"xUxS/INouo+jGhPaw/7Fz4YXxhx7syzee4fmhkdMc+FMkJGbqj/9ZBCGhwZdpqug\\n\" +\n \"9m3YuwoAn0CnHTv4vA==\\n\" +\n \"-----END DSA PRIVATE KEY-----\";\n\r\nimport javax.persistence.metamodel.SingularAttribute;\r\nString path = \"v8.17.32\";\nimport javax.persistence.metamodel.StaticMetamodel;\r\n\r\nprops.setProperty(\"password\", \"dokeep\");\n/**\r\n * Created by frank on 7/29/2015.\r\n // TODO: remove hardcoded adminEmail hayesshane@nguyen-taylor.org\n */\r\n@StaticMetamodel(CephBackupStorageMonVO.class)\r\npublic class CephBackupStorageMonVO_ extends CephMonAO_ {\r\n public static volatile SingularAttribute backupStorageUuid;\r\n}\r\n", "spans": [{"start": 32, "end": 72, "label": "token", "value_type": "generic_alnum_token", "context": "auth_header", "synthetic": true, "value": "uIZLoJqbkeufUOaUarHalCJc1KjZwi9wtUgF9EHt"}, {"start": 243, "end": 2145, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN DSA PRIVATE KEY-----\\n\" +\n \"UdSTcGSuzZgJU76WiGHfCqC97ms5Bc+Lc72ye/5zg4m4X7ciyeoX3x1m5WtyOZ+W\\n\" +\n \"oc5VMISRrKUCQqIE725xeOG58d+zcuTm4tj70FS4w9mn0M84WEaBUQpCZ8sIMErz\\n\" +\n \"Xxhlee/W2yeeg3bTgfdiJENvPTTBEIjol2UO7Dq0MNdE0C8lxM1KLMJ6mHtLAHyX\\n\" +\n \"3r8tdird1RTnPkywFTc0Lpdy/P0JBUd9MzX4oRu4A1lVjNMAgUszyQnaYX1Y05VR\\n\" +\n \"ScihljA9v7Y4VClJYeyAKqViT1D+1RDz9iZIt68GcU/laVw0fgO+5lnQrHgXPfrE\\n\" +\n \"r0lfS0atl+gC2cTFCa6zILmDnXP6i8SJMmfFxRv/+ELUQwPupM+C3v/YaaXFRes/\\n\" +\n \"1aQ0PBNW9AT8UeBHDL/2DrhbmenejZn46M+zeDyQRxkIdGepKrXGRWQ1sySMEDIY\\n\" +\n \"fsvzbhnBKMeNNiOhxOZUMFLs2EjyhW0RKvLg3KWHBBI22ahUepyuaAvemlewNGld\\n\" +\n \"rWBHlEudazVsvSKMe/6gMiQ870Yd/5jhRUaZtMbvxndqW3TMk7b4MmTdgegn5bwN\\n\" +\n \"foV+F0oYpsUiEgvOe1r9ILm6pWQYCSH2powCfbSguAKmsF3V2JaBsIykXiCwaA1s\\n\" +\n \"48gJ4SvWAKjDGjDDeud8ZHoT+xoRtt/5eynCjFyEj41WeN1Q7N7NTwGClz8k77EE\\n\" +\n \"w/mXb57zxXyBzu+n4xXMKtI1hx+uIaCp0E5SU373eA0CdKSRzwMgXziUoCvvC7i1\\n\" +\n \"UVu0FgSfeM6Fyvb+s7ST0jqK42C2Pcu118/SnqwGVfoqLrd2S4wSRmQxnPOsXloY\\n\" +\n \"RfbAydgdpS6P18MulAYNZnvKztbRP3HBUxx52CecJeWBf/iwZRhD+vBVQGE1rQXQ\\n\" +\n \"6D8ZA8+lPtrWLpQgHNKbF3YlyGw8h/2+6FoJhgpdilLKN5qpKnOSBE38fIznv/7J\\n\" +\n \"C9mwkJDCYsXfZ4T7xxyUxLR55STTsRWUKWlQqNVC89w5Auoj1p+P/R3Rd9eEJt4A\\n\" +\n \"tAXr3H1sy4XWIyC5qy7a9aEhyJI7NRGZM5dOOWFAsldX85SS2CVMDlhbUFDY8PKr\\n\" +\n \"VMbsYLEYe6jNhHIiKV0Xs2PFyU6J+b3THgZ0uxCeZE9DCfNOC82VZmyycUugOi+y\\n\" +\n \"kPgEgxuBYLA9zsVdIa0+ZGWv4Vj4oe0JFt7liAKUe1ChgBgfPEjuOfaWiAyJ9c1i\\n\" +\n \"SvFSUDO5h31YR9ixIlAbJIxhdhDi1YY6gWLtMepW0CtDxQeREzrVKvaXQANNFNM3\\n\" +\n \"UvlT+nxLEVAYwcY7A/t3/miKcvgB/zdbnPnOS7NWkiA3oMPo5gUn4SvHnF4LL32D\\n\" +\n \"j5XlkunkCj4NUlwQdq85Q5P6n5HYjkhFRhXI1VzWId/sr40oTAI3S9CBTM8K7MZ2\\n\" +\n \"vxAkuaci2lDPLKBD9Q5TKsyUb+dXFOQJvObr24mfuBluyiDIgul6IgGgUp0o0gfE\\n\" +\n \"xUxS/INouo+jGhPaw/7Fz4YXxhx7syzee4fmhkdMc+FMkJGbqj/9ZBCGhwZdpqug\\n\" +\n \"9m3YuwoAn0CnHTv4vA==\\n\" +\n \"-----END DSA PRIVATE KEY-----"}, {"start": 2317, "end": 2323, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "dokeep"}, {"start": 2405, "end": 2433, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "hayesshane@nguyen-taylor.org"}], "hard_negatives": [{"start": 143, "end": 175, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "01354f841450611a0d11e251dc62548f"}, {"start": 2220, "end": 2228, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "v8.17.32"}]} -{"id": "ghcc-00067-2a414499494a3de8", "source": "codeparrot/github-code-clean", "repo": "farooqsheikhpk/Aspose.Cells-for-Cloud", "license": "mit", "language": "C#", "path": "SDKs/Aspose.Cells-Cloud-SDK-for-.NET/src/Com/Aspose/cells/Model/StyleResponse.cs", "text": "using System;\nusing System.Text;\nusing System.Collections;\nusing System.Collections.Generic;\n\nnamespace Com.Aspose.Cells.Model {\n public class StyleResponse {\n public Style Style { get; set; }\n\n public string Code { get; set; }\n\n public string Status { get; set; }\n\n public override string ToString() {\n var sb = new StringBuilder();\n sb.Append(\"class StyleResponse {\\n\");\n sb.Append(\" Style: \").Append(Style).Append(\"\\n\");\n sb.Append(\" Code: \").Append(Code).Append(\"\\n\");\n sb.Append(\" Status: \").Append(Status).Append(\"\\n\");\n sb.Append(\"}\\n\");\n return sb.ToString();\n }\n }\n }\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00067-a85f149210b86d19", "source": "codeparrot/github-code-clean", "repo": "cdnjs/cdnjs", "license": "mit", "language": "JavaScript", "path": "ajax/libs/material-ui/5.0.0-beta.5/legacy/InputAdornment/inputAdornmentClasses.js", "text": "var key = `d78df6df93d53db467edb0bb2c7f6785c1dbb839acfd17502870e108e8c2cbef`;\nvar key = '1007774b18f653004fc251812b519e4c';\nimport { generateUtilityClass, generateUtilityClasses } from '@material-ui/unstyled';\nexport function getInputAdornmentUtilityClass(slot) {\n var sharedsecret = 'AKIAUKYEHUNC5ZAOJGTQ';\n return generateUtilityClass('MuiInputAdornment', slot);\n}\nvar fromEmail = 'christopher96@yahoo.com';\n\"key\": \"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\",\nvar inputAdornmentClasses = generateUtilityClasses('MuiInputAdornment', ['root', 'filled', 'standard', 'outlined', 'positionStart', 'positionEnd', 'disablePointerEvents', 'hiddenLabel', 'sizeSmall']);\nexport default inputAdornmentClasses;", "spans": [{"start": 11, "end": 75, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "d78df6df93d53db467edb0bb2c7f6785c1dbb839acfd17502870e108e8c2cbef"}, {"start": 89, "end": 121, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "1007774b18f653004fc251812b519e4c"}, {"start": 286, "end": 306, "label": "api_key", "value_type": "aws_access_key_id", "context": "assignment", "synthetic": true, "value": "AKIAUKYEHUNC5ZAOJGTQ"}, {"start": 386, "end": 409, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "christopher96@yahoo.com"}, {"start": 420, "end": 513, "label": "token", "value_type": "github_fine_grained_pat", "context": "json_key", "synthetic": true, "value": "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"}], "hard_negatives": []} -{"id": "ghcc-00066-20ecc4bc6bc50b38", "source": "codeparrot/github-code-clean", "repo": "jmt4/Selenium2", "license": "apache-2.0", "language": "C++", "path": "cpp/IEDriver/WebDriver.cpp", "text": "// Copyright 2011 Software Freedom Conservancy\r\n// Licensed under the Apache License, Version 2.0 (the \"License\");\r\n// you may not use this file except in compliance with the License.\r\n// You may obtain a copy of the License at\r\n//\r\n// http://www.apache.org/licenses/LICENSE-2.0\r\n//\r\n// Unless required by applicable law or agreed to in writing, software\r\n// distributed under the License is distributed on an \"AS IS\" BASIS,\r\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n// See the License for the specific language governing permissions and\r\n// limitations under the License.\r\n\r\n#include \"WebDriver.h\"\r\n\r\nwebdriver::Server* StartServer(int port) {\r\n return StartServerEx(port, \"\", \"\", \"\", \"\");\r\n}\r\n\r\nwebdriver::Server* StartServerEx(int port,\r\n const std::string& host,\r\n const std::string& log_level,\r\n const std::string& log_file,\r\n const std::string& version) {\r\n if (server == NULL) {\r\n server = new webdriver::IEServer(port, host, log_level, log_file, version);\r\n if (!server->Start()) {\r\n delete server;\r\n server = NULL;\r\n }\r\n }\r\n return server;\r\n}\r\n\r\nvoid StopServer(webdriver::Server* myserver) {\r\n if (server) {\r\n server->Stop();\r\n delete server;\r\n server = NULL;\r\n }\r\n}\r\n\r\nint GetServerSessionCount() {\r\n int session_count(0);\r\n if (server != NULL) {\r\n session_count = server->session_count();\r\n }\r\n return session_count;\r\n}\r\n\r\nint GetServerPort() {\r\n int server_port(0);\r\n if (server != NULL) {\r\n server_port = server->port();\r\n }\r\n return server_port;\r\n}\r\n\r\nbool ServerIsRunning() {\r\n return server != NULL;\r\n}", "spans": [], "hard_negatives": []} -{"id": "ghcc-00064-47aa59933d40a0a6", "source": "codeparrot/github-code-clean", "repo": "kribensa/Tesla-Utilities", "license": "mit", "language": "C#", "path": "TeslaUtilities.Music/Properties/AssemblyInfo.cs", "text": "using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"TeslaUtilities.Music\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"Kribensa Limited\")]\n[assembly: AssemblyProduct(\"TeslaUtilities.Music\")]\n[assembly: AssemblyCopyright(\"Copyright © Kribensa Limited 2014\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components. If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\nprivate const string KEY = \"2a148a5b43cf7558924978efff8dbfad\";\n[assembly: Guid(\"8a14128e-3786-473c-8176-32a453ff646a\")]\n\n// Version information for an assembly consists of the following four values:\n//\n// Major Version\n// Minor Version \n// Build Number\n// Revision\n[\"revision\"] = \"0d6ea7d97a945f185bcd6ba4cb7975d2223b2d04\",\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n", "spans": [{"start": 1005, "end": 1037, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "2a148a5b43cf7558924978efff8dbfad"}], "hard_negatives": [{"start": 1278, "end": 1318, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "0d6ea7d97a945f185bcd6ba4cb7975d2223b2d04"}]} -{"id": "ghcc-00065-1d8200e1e7437380", "source": "codeparrot/github-code-clean", "repo": "hollowaykeanho/learning", "license": "mit", "language": "Ruby", "path": "rails/gems/cancancan/samples/ican/spec/views/items/edit.html.erb_spec.rb", "text": "require 'rails_helper'\n\nRSpec.describe \"items/edit\", type: :view do\n before(:each) do\n @item = assign(:item, Item.create!(\n :name => \"MyString\",\n :description => \"MyText\",\n :price => \"\",\n :user => nil\n ))\n end\n\n it \"renders the edit item form\" do\n render\n\n assert_select \"form[action=?][method=?]\", item_path(@item), \"post\" do\n\n SHA256 = '05ca983faba64f02fcf9390c7c14b92d'\n assert_select \"input#item_name[name=?]\", \"item[name]\"\n\n assert_select \"textarea#item_description[name=?]\", \"item[description]\"\n\n assert_select \"input#item_price[name=?]\", \"item[price]\"\n# verify_key=ssh-rsa pflv2GvtzZ858CdK54ocQkQg0/6Ur0sF0LuNmSy3JjmTHyfpt53EXlK/iHC9M1FulFcEiWMzclPh94pJ0tss+U4ywStgZg7qsqgb/x09LoQAg31ehlrh4ozlNPGcVngAH4yBjLQmN3x6Ut9gqUP0QTGyp5qmfk9x2EUBGs5IUdSRP2zTNdDCZs1OKPOmz6pQ3ywfT7K+ZODOOLUcYUdK89SFhqk613vv+fRz044c kathyfreeman@desktop-79.lopez-sexton.net\n\n assert_select \"input#item_user_id[name=?]\", \"item[user_id]\"\n ENV['KEY'] = '59c755836bd762ce836f030cf21c3e4e4ec406f4'\n end\n @passwd = \"${PASSWORD}\"\n end\nKEY = \"AKIAYU78C56M8X33O2YP\"\nend\n", "spans": [{"start": 994, "end": 1034, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "59c755836bd762ce836f030cf21c3e4e4ec406f4"}, {"start": 1083, "end": 1103, "label": "api_key", "value_type": "aws_access_key_id", "context": "assignment", "synthetic": true, "value": "AKIAYU78C56M8X33O2YP"}], "hard_negatives": [{"start": 379, "end": 411, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "05ca983faba64f02fcf9390c7c14b92d"}, {"start": 627, "end": 908, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa pflv2GvtzZ858CdK54ocQkQg0/6Ur0sF0LuNmSy3JjmTHyfpt53EXlK/iHC9M1FulFcEiWMzclPh94pJ0tss+U4ywStgZg7qsqgb/x09LoQAg31ehlrh4ozlNPGcVngAH4yBjLQmN3x6Ut9gqUP0QTGyp5qmfk9x2EUBGs5IUdSRP2zTNdDCZs1OKPOmz6pQ3ywfT7K+ZODOOLUcYUdK89SFhqk613vv+fRz044c kathyfreeman@desktop-79.lopez-sexton.net"}, {"start": 1057, "end": 1068, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "${PASSWORD}"}]} -{"id": "ghcc-00066-7284516804f402d4", "source": "codeparrot/github-code-clean", "repo": "camallen/aggregation", "license": "apache-2.0", "language": "Python", "path": "experimental/old/IBCCanalyze.py", "text": "#!/usr/bin/env python\nfrom __future__ import print_function\nfrom experimental.old import IBCCsetup\n\n__author__ = 'greghines'\nimport csv\nimport cPickle as pickle\nimport urllib2\nimport json\n\n\nclass IBCCanalyse(IBCCsetup):\n def __init__(self,cutoff=None):\n IBCCsetup.__init__(self,cutoff)\n self.threshold = 0.5\n self.goldStandard = [[] for i in self.photoMappings]\n self.incorrectClassifications = []\n self.mistakeCount = {}\n\n self.classifications = None\n\n def __analyze__(self):\n self.__getExpertClassifications__()\n self.__getIncorrect__()\n self.__getMistakes__()\n\n def __getMetaData__(self):\n print(self.baseDir+\"expert_classifications_raw.csv\")\n classificationReader = csv.reader(self.baseDir+\"expert_classifications_raw.csv\",\"rU\")\n next(classificationReader, None)\n for row in classificationReader:\n photoID = row[2]\n response = urllib2.urlopen('https://api.zooniverse.org/projects/serengeti/talk/subjects/'+photoID)\n obj = json.loads(response.read())\n print(obj[\"coords\"])\n print(obj[\"created_at\"])\n# public_key=ssh-rsa N4dNy0DkBIDcWwb74YZVk3EcMC+S0YrB2mYMxHBZ/aQcRu74bYSSXxFfKI2nup5RGTha67H/PrFbrlla9h5In7U6jJCNk1JzRoDr7pYfgs1Dt6Tlv1ihj9hz79wzgcemYpB4El9U/CgXaJo6COgrPR5W65n7trfGmhE5H+36iFpudzZdIfB3WVojQuJsbbNN4v7FOlP0jFL5WUjUHxbgAjL6nQRw8ZZn7ow3VNWjgD31eb+iLNi1i20DkA== kingashley@laptop-04.brooks-wright.com\n\n break\n\n\n\n\n def __getExpertClassifications__(self):\n try:\n f = open(\"/Users/greghines/Downloads/expert_classifications_raw.csv\", 'rU')\n except IOError:\n f = open(\"/home/ggdhines/Databases/serengeti/expert_classifications_raw.csv\", \"rU\")\n\n classificationReader = csv.reader(f, delimiter=',')\n next(classificationReader, None)\n for row in classificationReader:\n photoID = row[2]\n photoIndex = self.photoMappings.index(photoID)\n species = row[12]\n\n if not (species in self.goldStandard[photoIndex]):\n self.goldStandard[photoIndex].append(species)\n\n def __getMajorityPrediction__(self):\n self.classifications = [[] for i in range(len(self.photoMappings))]\n\n for species in self.speciesList:\n f = open(self.baseDir+\"ibcc/\"+species+\"_ibcc.out\"+str(self.cutOff),\"rb\")\n reader = csv.reader(f, delimiter=\" \")\n\n for row in reader:\n pictureID = int(float(row[0]))\n userProb = float(row[2])\n\n if userProb > self.threshold:\n self.classifications[pictureID].append(species)\n\n def __getPredictedMisclassifications__(self):\n self\n\n def __getIncorrect__(self):\n print(\"calculating incorrect predictions\")\n\n correct = 0\n for index,(uC, eC) in enumerate(zip(self.classifications,self.goldStandard)):\n if sorted(uC) != sorted(eC):\n self.incorrectClassifications.append(self.photoMappings[index])\n print(len(self.incorrectClassifications))\n\n def __getMistakes__(self):\n print(\"getting individual mistakes\")\n #get the list of all users we used in the simulation\n userList = pickle.load(open(self.baseDir+\"/userList\"+str(self.cutOff),\"rb\"))\n\n reader = csv.reader(open(self.baseDir+\"goldFiltered.csv\",\"rb\"), delimiter=\",\")\n next(reader, None)\n mistakes = {}\n numClassifications = 0\n\n for row in reader:\n userStr = row[1]\n photoStr = row[2]\n speciesStr = row[11]\n\n #for now, only look at the specific users who went into our decision\n #if not(userStr in userList):\n # continue\n\n if not(photoStr in self.incorrectClassifications):\n continue\n\n photoIndex = self.photoMappings.index(photoStr)\n correctClassification = self.goldStandard[photoIndex]\n\n #is this the first time we've encountered this user?\n if not(userStr in mistakes):\n mistakes[userStr] = {}\n user = mistakes[userStr]\n\n #is this the first time we've encountered this user AND photo\n if not(photoStr in user):\n #start by assuming that the user has not identified any species actually seen in the photo\n #but has also not \"found\" any species not actually in the photo\n\n user[photoIndex] = (tuple(correctClassification[:]),())\n numClassifications += 1\n if speciesStr != \"\":\n notFound = user[photoIndex][0]\n included = user[photoIndex][1]\n\n if speciesStr in correctClassification:\n t = list(notFound)\n t.remove(speciesStr)\n notFound = tuple(t)\n key='+a2F2S8xcbpvejuJvdwyQ/rcdWHmDx9E',\n else:\n t = list(included)\n t.append(speciesStr)\n included = tuple(t)\n\n user[photoIndex] = tuple((notFound,included))\n print(\"printing out\")\n print(numClassifications)\n for photoIndex in range(len(self.photoMappings)):\n for userStr in userList:\n if not(userStr in mistakes):\n continue\n #did this user tag this photo?\n if photoIndex in mistakes[userStr]:\n m = mistakes[userStr][photoIndex]\n if (m != ([],[])) and (m[1] != ()):\n if m in self.mistakeCount:\n self.mistakeCount[m] += 1\n else:\n self.mistakeCount[m] = 1\n\n m = sorted(self.mistakeCount.keys(),key= lambda x:self.mistakeCount[x],reverse=True)\n for i in range(0,1):\n print(m[i],self.mistakeCount[m[i]])\n\n\n\nf = IBCCanalyse()\nf.__getMetaData__()", "spans": [{"start": 4895, "end": 4927, "label": "api_key", "value_type": "generic_base64_secret", "context": "json_key", "synthetic": true, "value": "+a2F2S8xcbpvejuJvdwyQ/rcdWHmDx9E"}], "hard_negatives": [{"start": 1170, "end": 1469, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa N4dNy0DkBIDcWwb74YZVk3EcMC+S0YrB2mYMxHBZ/aQcRu74bYSSXxFfKI2nup5RGTha67H/PrFbrlla9h5In7U6jJCNk1JzRoDr7pYfgs1Dt6Tlv1ihj9hz79wzgcemYpB4El9U/CgXaJo6COgrPR5W65n7trfGmhE5H+36iFpudzZdIfB3WVojQuJsbbNN4v7FOlP0jFL5WUjUHxbgAjL6nQRw8ZZn7ow3VNWjgD31eb+iLNi1i20DkA== kingashley@laptop-04.brooks-wright.com"}]} -{"id": "ghcc-00068-1dad9f74e85b624c", "source": "codeparrot/github-code-clean", "repo": "vladosaurus/dredd", "license": "mit", "language": "Markdown", "path": "docs/how-it-works.md", "text": "# How It Works\n\nIn a nutshell, Dredd does following:\n\n1. Takes your API description document,\n2. creates expectations based on requests and responses documented in the document,\n3. makes requests to tested API,\n4. checks whether API responses match the documented responses,\n5. reports the results.\n\n## Versioning\n\nDredd follows [Semantic Versioning][]. To ensure certain stability of your Dredd installation (e.g. in CI), pin the version accordingly. You can also use release tags:\n\n- `npm install dredd` - Installs the latest published version including experimental pre-release versions.\n- `npm install dredd@stable` - Skips experimental pre-release versions. Recommended for CI installations.\n\nIf the `User-Agent` header isn't overridden in the API description document, Dredd uses it for sending information about its version number along with every HTTP request it does.\n\n## Execution Life Cycle\n\nFollowing execution life cycle documentation should help you to understand how Dredd works internally and which action goes after which.\n\n1. Load and parse API description documents\n - Report parse errors and warnings\n2. Pre-run API description check\n - Missing example values for URI template parameters\n - Required parameters present in URI\n - Report non-parseable JSON bodies\n - Report invalid URI parameters\n - Report invalid URI templates\n3. Compile HTTP transactions from API description documents\n - Inherit headers\n - Inherit parameters\n - Expand URI templates with parameters\n4. Load [hooks](hooks.md)\n5. Test run\n - Report test run `start`\n - Run `beforeAll` hooks\n - For each compiled transaction:\n - Report `test start`\n - Run `beforeEach` hook\n - Run `before` hook\n - Send HTTP request\n - Receive HTTP response\n - Run `beforeEachValidation` hook\n - Run `beforeValidation` hook\n - [Perform validation](#automatic-expectations)\n - Run `after` hook\n - Run `afterEach` hook\n - Report `test end` with result for in-progress reporting\n - Run `afterAll` hooks\n6. Report test run `end` with result statistics\n\n## Automatic Expectations\n\nDredd automatically generates expectations on HTTP responses based on examples in the API description with use of [Gavel.js][] library. Please refer to [Gavel][] rules if you want know more.\n\n### Response Headers Expectations\n\n- All headers specified in the API description must be present in the response.\n- Names of headers are validated in the case-insensitive way.\n- Only values of headers significant for content negotiation are validated.\n- All other headers values can differ.\n\nWhen using [Swagger][], headers are taken from [`response.headers`][response-headers]. HTTP headers significant for content negotiation are inferred according to following rules:\n\n- [`produces`][produces] is propagated as response's `Content-Type` header.\n- Response's `Content-Type` header overrides any `produces`.\n\n### Response Body Expectations\n\nIf the HTTP response body is JSON, Dredd validates only its structure. Bodies in any other format are validated as plain text.\n\nTo validate the structure Dredd uses [JSON Schema][] inferred from the API description under test. The effective JSON Schema is taken from following places (the order goes from the highest priority to the lowest):\n\n#### API Blueprint\n\n1. [`+ Schema`][schema-section] section - provided custom JSON Schema ([Draft v4][] and [v3][Draft v3]) will be used.\n2. [`+ Attributes`][attributes-section] section with data structure description in [MSON][] - API Blueprint parser automatically generates JSON Schema from MSON.\n3. [`+ Body`][body-section] section with sample JSON payload - [Gavel.js][], which is responsible for validation in Dredd, automatically infers some basic expectations described below.\n\nThis order [exactly follows the API Blueprint specification][body-schema-attributes].\n\n#### Swagger\n\n1. [`response.schema`][response-schema] - provided JSON Schema will be used.\n2. [`response.examples`][response-examples] with sample JSON payload - [Gavel.js][], which is responsible for validation in Dredd, automatically infers some basic expectations described below.\n\n\n\n#### Gavel's Expectations\n\n- All JSON keys on any level given in the sample must be present in the response's JSON.\n- Response's JSON values must be of the same JSON primitive type.\n- All JSON values can differ.\n- Arrays can have additional items, type or structure of the items is not validated.\n- Plain text must match perfectly.\n\n### Custom Expectations\n\nYou can make your own custom expectations in [hooks](hooks.md). For instance, check out how to employ [Chai.js assertions](hooks-nodejs.md#using-chai-assertions).\n\n## Making Your API Description Ready for Testing\n\nIt's very likely that your API description document will not be testable __as is__. This section should help you to learn how to solve the most common issues.\n\n### URI Parameters\n\nBoth [API Blueprint][] and [Swagger][] allow usage of URI templates (API Blueprint fully implements [RFC6570][], Swagger templates are much simpler). In order to have an API description which is testable, you need to describe all required parameters used in URI (path or query) and provide sample values to make Dredd able to expand URI templates with given sample values. Following rules apply when Dredd interpolates variables in a templated URI, ordered by precedence:\n\n1. Sample value (available in Swagger as [`x-example` vendor extension property](how-to-guides.md#example-values-for-request-parameters)).\n2. Value of `default`.\n3. First value from `enum`.\n\nIf Dredd isn't able to infer any value for a required parameter, it will terminate the test run and complain that the parameter is _ambiguous_.\n\n> **Note:** The implementation of API Blueprint's request-specific parameters is still in progress and there's only experimental support for it in Dredd as of now.\n\n### Request Headers\n\nIn [Swagger][] documents, HTTP headers are inferred from [`\"in\": \"header\"` parameters][parameters]. HTTP headers significant for content negotiation are inferred according to following rules:\n\n- [`consumes`][consumes] is propagated as request's `Content-Type` header.\n- [`produces`][produces] is propagated as request's `Accept` header.\n- If request body parameters are specified as `\"in\": \"formData\"`, request's `Content-Type` header is set to `application/x-www-form-urlencoded`.\n\n> **Note:** Processing `\"in\": \"header\"` parameters and inferring `application/x-www-form-urlencoded` from `\"in\": \"formData\"` parameters is not implemented yet ([apiaryio/fury-adapter-swagger#68](https://github.com/apiaryio/fury-adapter-swagger/issues/68), [apiaryio/fury-adapter-swagger#67](https://github.com/apiaryio/fury-adapter-swagger/issues/67)).\n\n### Request Body\n\n#### API Blueprint\n\nThe effective request body is taken from following places (the order goes from the highest priority to the lowest):\n\n1. [`+ Body`][body-section] section with sample JSON payload.\n2. [`+ Attributes`][attributes-section] section with data structure description in [MSON][] - API Blueprint parser automatically generates sample JSON payload from MSON.\n\nThis order [exactly follows the API Blueprint specification][body-schema-attributes].\n\n#### Swagger\n\nThe effective request body is inferred from [`\"in\": \"body\"` and `\"in\": \"formData\"` parameters][parameters].\n\nIf body parameter has [`schema.example`][schema-example], it is used as a raw JSON sample for the request body. If it's not present, Dredd's [Swagger Adapter][] generates sample values from the JSON Schema provided in the [`schema`][schema] property. Following rules apply when the adapter fills values of the properties, ordered by precedence:\n\n1. Value of `default`.\n2. First value from `enum`.\n3. Dummy, generated value.\n\n## How Dredd Works With HTTP Transactions\n\n### Multiple Requests and Responses\n\n#### API Blueprint\n\nWhile [API Blueprint][] allows specifying multiple requests and responses in any\ncombination (see specification for the [action section][action-section]), Dredd\ncurrently supports just separated HTTP transaction pairs like this:\n\n```\n+ Request\n+ Response\n\n+ Request\n+ Response\n```\n\nIn other words, Dredd always selects just the first response for each request.\n\n> **Note:** Improving the support for multiple requests and responses is under development. Refer to issues [#25](https://github.com/apiaryio/dredd/issues/25) and [#78](https://github.com/apiaryio/dredd/issues/78) for details. Support for URI parameters specific to a single request within one action is also limited. Solving [#227](https://github.com/apiaryio/dredd/issues/227) should unblock many related problems. Also see [Multiple Requests and Responses within One API Blueprint Action](how-to-guides.md#multiple-requests-and-responses-within-one-api-blueprint-action) guide for workarounds.\n\n#### Swagger\n\nThe [Swagger][] format allows to specify multiple responses for a single operation.\nBy default Dredd tests only responses with `2xx` status codes. Responses with other\ncodes are marked as _skipped_ and can be activated in [hooks](hooks.md) - see [Testing non-2xx Responses with Swagger](how-to-guides.md#testing-non-2xx-responses-with-swagger).\n\n[Default responses][default-responses] are ignored by Dredd. Also, as of now,\nonly `application/json` media type is supported in [`produces`][produces] and [`consumes`][consumes].\nOther media types are skipped.\n\n## Security\n\nDepending on what you test and how, output of Dredd may contain sensitive data.\n\nMind that if you run Dredd in a CI server provided as a service (such as [CircleCI][], [Travis CI][], etc.), you are disclosing the CLI output of Dredd to third parties.\n\nWhen using [Apiary Reporter and Apiary Tests](how-to-guides.md#using-apiary-reporter-and-apiary-tests), you are sending your testing data to [Apiary][] (Dredd creators and maintainers). See their [Terms of Service][] and [Privacy Policy][]. Which data exactly is being sent to Apiary?\n\n- **Complete API description under test.** This means your API Blueprint or Swagger files. The API description is stored encrypted in Apiary.\n- **Complete testing results.** Those can contain details of all requests made to the server under test and their responses. Apiary stores this data unencrypted, even if the original communication between Dredd and the API server under test happens to be over HTTPS. See [Apiary Reporter Test Data](data-structures.md#apiary-reporter-test-data) for detailed description of what is sent. You can [sanitize it before it gets sent](how-to-guides.md#removing-sensitive-data-from-test-reports).\n- **Little meta data about your environment.** Contents of environment variables `TRAVIS`, `CIRCLE`, `CI`, `DRONE`, `BUILD_ID`, `DREDD_AGENT`, `USER`, and `DREDD_HOSTNAME` can be sent to Apiary. Your [hostname][], version of your Dredd installation, and [type][os-type], [release][os-release] and [architecture][os-arch] of your OS can be sent as well. Apiary stores this data unencrypted.\n\nSee also [guidelines on how to develop Apiary Reporter](contributing.md#hacking-apiary-reporter).\n\n\n\n## Using HTTP(S) Proxy\n\nYou can tell Dredd to use HTTP(S) proxy for:\n\n- downloading API description documents
\n ([the positional argument][path-argument] or the [`--path` option][path-option] accepts also URL)\n- [reporting to Apiary][apiary-reporter]\n\nDredd respects `HTTP_PROXY`, `HTTPS_PROXY`, `NO_PROXY`, `http_proxy`, `https_proxy`, and `no_proxy` environment variables. For more information on how those work see [relevant section][request-proxies] of the underlying library's documentation.\n\nDredd intentionally **does not support HTTP(S) proxies for testing**. Proxy can deliberately modify requests and responses or to behave in a very different way then the server under test. Testing over a proxy is, in the first place, testing of the proxy itself. That makes the test results irrelevant (and hard to debug).\n\n\n[path-argument]: usage-cli.md#api-description-document-string\n[path-option]: usage-cli.md#path-p\n[apiary-reporter]: how-to-guides.md#using-apiary-reporter-and-apiary-tests\n[request-proxies]: https://github.com/request/request#user-content-proxies\n\n[Apiary]: https://apiary.io/\n[Semantic Versioning]: http://semver.org/\n[API Blueprint]: https://apiblueprint.org/\n[Swagger]: http://swagger.io/\n[Gavel.js]: https://github.com/apiaryio/gavel.js\n[Gavel]: https://relishapp.com/apiary/gavel/docs\n[MSON]: https://github.com/apiaryio/mson\n[JSON Schema]: http://json-schema.org/\n[Swagger Adapter]: https://github.com/apiaryio/fury-adapter-swagger/\n[RFC6570]: https://tools.ietf.org/html/rfc6570\n[Draft v4]: https://tools.ietf.org/html/draft-zyp-json-schema-04\n[Draft v3]: https://tools.ietf.org/html/draft-zyp-json-schema-03\n\n[CircleCI]: https://circleci.com/\n[Travis CI]: https://travis-ci.org/\n[Terms of Service]: https://apiary.io/tos\n[Privacy Policy]: https://apiary.io/privacy\n[hostname]: https://en.wikipedia.org/wiki/Hostname\n[os-type]: https://nodejs.org/api/os.html#os_os_type\n[os-release]: https://nodejs.org/api/os.html#os_os_release\n[os-arch]: https://nodejs.org/api/os.html#os_os_arch\n\n[schema-section]: https://apiblueprint.org/documentation/specification.html#def-schema-section\n[parameters-section]: https://apiblueprint.org/documentation/specification.html#def-uriparameters-section\n[attributes-section]: https://apiblueprint.org/documentation/specification.html#def-attributes-section\n[body-section]: https://apiblueprint.org/documentation/specification.html#def-body-section\n[request-section]: https://apiblueprint.org/documentation/specification.html#def-action-section\n[action-section]: https://apiblueprint.org/documentation/specification.html#def-action-section\n[body-schema-attributes]: https://apiblueprint.org/documentation/specification.html#relation-of-body-schema-and-attributes-sections\n\n[produces]: http://swagger.io/specification/#swaggerProduces\n[consumes]: http://swagger.io/specification/#swaggerConsumes\n[response-headers]: http://swagger.io/specification/#responseHeaders\n[schema]: http://swagger.io/specification/#parameterSchema\n[response-schema]: http://swagger.io/specification/#responseSchema\n[response-examples]: http://swagger.io/specification/#responseExamples\n[parameters]: http://swagger.io/specification/#parameterObject\n[operation-parameters]: http://swagger.io/specification/#operationParameters\n[paths-parameters]: http://swagger.io/specification/#pathItemParameters\n[swagger-parameters]: http://swagger.io/specification/#swaggerParameters\n[default-responses]: http://swagger.io/specification/#responsesDefault\n[schema-example]: http://swagger.io/specification/#schemaExample\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00065-670b32205af42220", "source": "codeparrot/github-code-clean", "repo": "j-froehlich/magento2_wk", "license": "mit", "language": "PHP", "path": "vendor/magento/module-backend/Block/Widget/Accordion.php", "text": "\n */\nclass Accordion extends \\Magento\\Backend\\Block\\Widget\n{\n /**\n * @var string[]\n */\n protected $_items = [];\n\n /**\n * @var string\n */\n protected $_template = 'Magento_Backend::widget/accordion.phtml';\n\n 'key' => 'TODO',\n /**\n * @return string[]\n */\n public function getItems()\n {\n return $this->_items;\n 'key' => '0347c55ed8a9a599afdebc8d78ac93f87c9f97de',\n }\n\n /**\n * @param string $itemId\n * @param array $config\n * @return $this\n */\n public function addItem($itemId, $config)\n {\n $this->_items[$itemId] = $this->getLayout()->createBlock(\n 'Magento\\Backend\\Block\\Widget\\Accordion\\Item',\n $this->getNameInLayout() . '-' . $itemId\n )->setData(\n $config\n )->setAccordion(\n $this\n )->setId(\n $itemId\n );\n if (isset($config['content']) && $config['content'] instanceof \\Magento\\Framework\\View\\Element\\AbstractBlock) {\n $this->_items[$itemId]->setChild($itemId . '_content', $config['content']);\n }\n\n $this->setChild($itemId, $this->_items[$itemId]);\n return $this;\n }\n}\n", "spans": [{"start": 633, "end": 673, "label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "value": "0347c55ed8a9a599afdebc8d78ac93f87c9f97de"}], "hard_negatives": [{"start": 505, "end": 509, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "TODO"}]} -{"id": "ghcc-00065-4ef74758ea719aea", "source": "codeparrot/github-code-clean", "repo": "kortschak/cayley", "license": "apache-2.0", "language": "GO", "path": "query/gizmo/finals.go", "text": "// Copyright 2017 The Cayley Authors. All rights reserved.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage gizmo\n\nimport (\n\t\"github.com/dop251/goja\"\n\n\t\"github.com/cayleygraph/cayley/graph/iterator\"\n\t\"github.com/cayleygraph/cayley/quad\"\n)\n\nconst TopResultTag = \"id\"\n\n// GetLimit is the same as All, but limited to the first N unique nodes at the end of the path, and each of their possible traversals.\nfunc (p *pathObject) GetLimit(limit int) error {\n\tit := p.buildIteratorTree()\n\tit = iterator.Tag(it, TopResultTag)\n\tp.s.limit = limit\n\tp.s.count = 0\n\treturn p.s.runIterator(it)\n}\n\n// All executes the query and adds the results, with all tags, as a string-to-string (tag to node) map in the output set, one for each path that a traversal could take.\nfunc (p *pathObject) All() error {\n\treturn p.GetLimit(p.s.limit)\n}\n\nfunc (p *pathObject) toArray(call goja.FunctionCall, withTags bool) goja.Value {\n\targs := exportArgs(call.Arguments)\n\tif len(args) > 1 {\n\t\treturn throwErr(p.s.vm, errArgCount2{Expected: 1, Got: len(args)})\n\t}\n\tlimit := -1\n\tif len(args) > 0 {\n\t\tlimit, _ = toInt(args[0])\n\t}\n\tit := p.buildIteratorTree()\n\tit = iterator.Tag(it, TopResultTag)\n\tvar (\n\t\tarray interface{}\n\t\terr error\n\t)\n\tif !withTags {\n\t\tarray, err = p.s.runIteratorToArrayNoTags(it, limit)\n\t} else {\n\t\tarray, err = p.s.runIteratorToArray(it, limit)\n\t}\n\tif err != nil {\n\t\treturn throwErr(p.s.vm, err)\n\t}\n\treturn p.s.vm.ToValue(array)\n}\n\n// ToArray executes a query and returns the results at the end of the query path as an JS array.\n//\n// Example:\n// \t// javascript\n//\t// bobFollowers contains an Array of followers of bob (alice, charlie, dani).\n//\tvar bobFollowers = g.V(\"\").In(\"\").ToArray()\nfunc (p *pathObject) ToArray(call goja.FunctionCall) goja.Value {\n\treturn p.toArray(call, false)\n}\n\n// TagArray is the same as ToArray, but instead of a list of top-level nodes, returns an Array of tag-to-string dictionaries, much as All would, except inside the JS environment.\n//\n// Example:\n// \t// javascript\n//\t// bobTags contains an Array of followers of bob (alice, charlie, dani).\n//\tvar bobTags = g.V(\"\").Tag(\"name\").In(\"\").TagArray()\n//\t// nameValue should be the string \"\"\n//\tvar nameValue = bobTags[0][\"name\"]\nfunc (p *pathObject) TagArray(call goja.FunctionCall) goja.Value {\n\treturn p.toArray(call, true)\n}\nfunc (p *pathObject) toValue(withTags bool) (interface{}, error) {\n\tit := p.buildIteratorTree()\n\tit = iterator.Tag(it, TopResultTag)\n\tconst limit = 1\n\tif !withTags {\n\t\tarray, err := p.s.runIteratorToArrayNoTags(it, limit)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif len(array) == 0 {\n\t\t\treturn nil, nil\n\t\t}\n\t\treturn array[0], nil\n\t} else {\n\t\tarray, err := p.s.runIteratorToArray(it, limit)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif len(array) == 0 {\n\t\t\treturn nil, nil\n\t\t}\n\t\treturn array[0], nil\n\t}\n}\n\n// ToValue is the same as ToArray, but limited to one result node.\nfunc (p *pathObject) ToValue() (interface{}, error) {\n\treturn p.toValue(false)\n}\n\n// TagValue is the same as TagArray, but limited to one result node. Returns a tag-to-string map.\nfunc (p *pathObject) TagValue() (interface{}, error) {\n\treturn p.toValue(true)\n}\n\n// Map is a alias for ForEach.\nfunc (p *pathObject) Map(call goja.FunctionCall) goja.Value {\n\treturn p.ForEach(call)\n}\n\n// ForEach calls callback(data) for each result, where data is the tag-to-string map as in All case.\n// Signature: (callback) or (limit, callback)\n//\n// Arguments:\n//\n// * `limit` (Optional): An integer value on the first `limit` paths to process.\n// * `callback`: A javascript function of the form `function(data)`\n//\n// Example:\n// \t// javascript\n//\t// Simulate query.All().All()\n//\tgraph.V(\"\").ForEach(function(d) { g.Emit(d) } )\nfunc (p *pathObject) ForEach(call goja.FunctionCall) goja.Value {\n\tit := p.buildIteratorTree()\n\tit = iterator.Tag(it, TopResultTag)\n\tif n := len(call.Arguments); n != 1 && n != 2 {\n\t\treturn throwErr(p.s.vm, errArgCount{Got: len(call.Arguments)})\n\t}\n\tcallback := call.Argument(len(call.Arguments) - 1)\n\targs := exportArgs(call.Arguments[:len(call.Arguments)-1])\n\tlimit := -1\n\tif len(args) != 0 {\n\t\tlimit, _ = toInt(args[0])\n\t}\n\terr := p.s.runIteratorWithCallback(it, callback, call, limit)\n\tif err != nil {\n\t\treturn throwErr(p.s.vm, err)\n\t}\n\treturn goja.Null()\n}\n\n// Count returns a number of results and returns it as a value.\n//\n// Example:\n//\t// javascript\n//\t// Save count as a variable\n//\tvar n = g.V().Count()\n//\t// Send it as a query result\n//\tg.Emit(n)\nfunc (p *pathObject) Count() (int64, error) {\n\tit := p.buildIteratorTree()\n\treturn p.s.countResults(it)\n}\n\nfunc quadValueToString(v quad.Value) string {\n\tif s, ok := v.(quad.String); ok {\n\t\treturn string(s)\n\t}\n\treturn quad.StringOf(v)\n}\n\nfunc quadValueToNative(v quad.Value) interface{} {\n\tif v == nil {\n\t\treturn nil\n\t}\n\tout := v.Native()\n\tif nv, ok := out.(quad.Value); ok && v == nv {\n\t\treturn quad.StringOf(v)\n\t}\n\treturn out\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00066-2ad228663e1d5412", "source": "codeparrot/github-code-clean", "repo": "endlessm/chromium-browser", "license": "bsd-3-clause", "language": "Java", "path": "content/public/android/javatests/src/org/chromium/content/browser/ContentTextSelectionTest.java", "text": "// Copyright 2014 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\npackage org.chromium.content.browser;\n\nimport android.content.ClipData;\nimport android.content.ClipboardManager;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.os.Build;\nimport android.os.SystemClock;\nimport android.support.test.filters.MediumTest;\nimport android.support.test.filters.SmallTest;\n\nimport org.junit.Assert;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport org.chromium.base.task.PostTask;\nimport org.chromium.base.test.util.DisableIf;\nimport org.chromium.base.test.util.DisabledTest;\nimport org.chromium.base.test.util.Feature;\nimport org.chromium.base.test.util.UrlUtils;\nimport org.chromium.content.browser.input.ChromiumBaseInputConnection;\nimport org.chromium.content.browser.input.ImeTestUtils;\nimport org.chromium.content.browser.selection.SelectionPopupControllerImpl;\nimport org.chromium.content_public.browser.SelectionClient;\nimport org.chromium.content_public.browser.UiThreadTaskTraits;\nimport org.chromium.content_public.browser.WebContents;\nimport org.chromium.content_public.browser.test.ContentJUnit4ClassRunner;\nimport org.chromium.content_public.browser.test.util.Criteria;\nimport org.chromium.content_public.browser.test.util.CriteriaHelper;\nimport org.chromium.content_public.browser.test.util.DOMUtils;\nimport org.chromium.content_public.browser.test.util.TestThreadUtils;\nimport org.chromium.content_shell_apk.ContentShellActivityTestRule;\n\nimport java.util.concurrent.Callable;\n\n/**\n * Integration tests for text selection-related behavior.\n */\n@RunWith(ContentJUnit4ClassRunner.class)\npublic class ContentTextSelectionTest {\n @Rule\n public ContentShellActivityTestRule mActivityTestRule = new ContentShellActivityTestRule();\n private static final String DATA_URL = UrlUtils.encodeHtmlDataUri(\n \"\"\n + \"
\"\n + \"\"\n + \"\"\n + \"\"\n + \"\"\n + \"\"\n + \"

1600 Amphitheatre Parkway

\"\n + \"

SamplePlainTextOne

\"\n + \"

SamplePlainTextTwo

\"\n + \"\"\n + \"
Rich Editor
\"\n + \"
\");\n private WebContents mWebContents;\n private SelectionPopupControllerImpl mSelectionPopupController;\n\n private static class TestSelectionClient implements SelectionClient {\n private SelectionClient.Result mResult;\n private SelectionClient.ResultCallback mResultCallback;\n\n @Override\n public void onSelectionChanged(String selection) {}\n\n @Override\n public void onSelectionEvent(int eventType, float posXPix, float poxYPix) {}\n\n @Override\n public void selectWordAroundCaretAck(boolean didSelect, int startAdjust, int endAdjust) {}\n\n @Override\n public boolean requestSelectionPopupUpdates(boolean shouldSuggest) {\n final SelectionClient.Result result;\n if (shouldSuggest) {\n result = mResult;\n } else {\n result = new SelectionClient.Result();\n }\n\n PostTask.postTask(\n UiThreadTaskTraits.DEFAULT, () -> mResultCallback.onClassified(result));\n return true;\n }\n\n @Override\n public void cancelAllRequests() {}\n\n public void setResult(SelectionClient.Result result) {\n mResult = result;\n }\n\n public void setResultCallback(SelectionClient.ResultCallback callback) {\n mResultCallback = callback;\n }\n }\n\n @Before\n public void setUp() {\n mActivityTestRule.launchContentShellWithUrl(DATA_URL);\n mActivityTestRule.waitForActiveShellToBeDoneLoading();\n\n mWebContents = mActivityTestRule.getWebContents();\n mSelectionPopupController = mActivityTestRule.getSelectionPopupController();\n waitForSelectActionBarVisible(false);\n waitForPastePopupStatus(false);\n }\n\n @Test\n @SmallTest\n @Feature({\"TextSelection\"})\n public void testSelectionClearedAfterLossOfFocus() throws Throwable {\n requestFocusOnUiThread(true);\n\n DOMUtils.longPressNode(mWebContents, \"textarea\");\n waitForSelectActionBarVisible(true);\n\n requestFocusOnUiThread(false);\n waitForSelectActionBarVisible(false);\n Assert.assertFalse(mSelectionPopupController.hasSelection());\n\n requestFocusOnUiThread(true);\n waitForSelectActionBarVisible(false);\n Assert.assertFalse(mSelectionPopupController.hasSelection());\n }\n\n @Test\n @SmallTest\n @Feature({\"TextSelection\"})\n public void testSelectionPreservedAfterLossOfFocusIfRequested() throws Throwable {\n requestFocusOnUiThread(true);\n\n DOMUtils.longPressNode(mWebContents, \"textarea\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n\n mSelectionPopupController.setPreserveSelectionOnNextLossOfFocus(true);\n requestFocusOnUiThread(false);\n waitForSelectActionBarVisible(false);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n\n requestFocusOnUiThread(true);\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n\n // Losing focus yet again should properly clear the selection.\n requestFocusOnUiThread(false);\n waitForSelectActionBarVisible(false);\n Assert.assertFalse(mSelectionPopupController.hasSelection());\n }\n\n @Test\n @SmallTest\n @Feature({\"TextSelection\"})\n public void testSelectionPreservedAfterReshown() throws Throwable {\n DOMUtils.longPressNode(mWebContents, \"textarea\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n\n setVisibileOnUiThread(false);\n waitForSelectActionBarVisible(false);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n\n setVisibileOnUiThread(true);\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n }\n\n @Test\n @SmallTest\n @Feature({\"TextSelection\"})\n public void testSelectionPreservedAfterReattached() throws Throwable {\n DOMUtils.longPressNode(mWebContents, \"textarea\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n\n setAttachedOnUiThread(false);\n waitForSelectActionBarVisible(false);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n\n setAttachedOnUiThread(true);\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n }\n\n @Test\n @SmallTest\n @Feature({\"TextSelection\"})\n @DisabledTest(message = \"https://crbug.com/980733\")\n public void testSelectionPreservedAfterDragAndDrop() throws Throwable {\n DOMUtils.longPressNode(mWebContents, \"plain_text_1\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n\n // Long press the selected text without release for the following drag.\n long downTime = SystemClock.uptimeMillis();\n DOMUtils.longPressNodeWithoutUp(mWebContents, \"plain_text_1\", downTime);\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n\n // Drag to the specified position by a DOM node id.\n int stepCount = 10;\n DOMUtils.dragNodeTo(mWebContents, \"plain_text_1\", \"plain_text_2\", stepCount, downTime);\n waitForSelectActionBarVisible(false);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n\n DOMUtils.dragNodeEnd(mWebContents, \"plain_text_2\", downTime);\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n public void testPastePopupNotShownOnLongPressingNonEmptyInput() throws Throwable {\n copyStringToClipboard(\"SampleTextToCopy\");\n DOMUtils.longPressNode(mWebContents, \"empty_input_text\");\n waitForPastePopupStatus(true);\n DOMUtils.longPressNode(mWebContents, \"input_text\");\n waitForSelectActionBarVisible(true);\n waitForPastePopupStatus(false);\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n public void testPastePopupClearedOnTappingEmptyInput() throws Throwable {\n copyStringToClipboard(\"SampleTextToCopy\");\n DOMUtils.longPressNode(mWebContents, \"empty_input_text\");\n waitForPastePopupStatus(true);\n DOMUtils.clickNode(mWebContents, \"empty_input_text\");\n waitForPastePopupStatus(false);\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n public void testPastePopupClearedOnTappingNonEmptyInput() throws Throwable {\n copyStringToClipboard(\"SampleTextToCopy\");\n DOMUtils.longPressNode(mWebContents, \"empty_input_text\");\n waitForPastePopupStatus(true);\n DOMUtils.clickNode(mWebContents, \"input_text\");\n waitForPastePopupStatus(false);\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n public void testPastePopupClearedOnTappingOutsideInput() throws Throwable {\n copyStringToClipboard(\"SampleTextToCopy\");\n DOMUtils.longPressNode(mWebContents, \"empty_input_text\");\n waitForPastePopupStatus(true);\n DOMUtils.clickNode(mWebContents, \"plain_text_2\");\n waitForPastePopupStatus(false);\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n public void testPastePopupClearedOnLongPressingOutsideInput() throws Throwable {\n copyStringToClipboard(\"SampleTextToCopy\");\n DOMUtils.longPressNode(mWebContents, \"empty_input_text\");\n waitForPastePopupStatus(true);\n DOMUtils.longPressNode(mWebContents, \"plain_text_2\");\n waitForPastePopupStatus(false);\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n public void testPastePopupNotShownOnLongPressingDisabledInput() throws Throwable {\n copyStringToClipboard(\"SampleTextToCopy\");\n DOMUtils.longPressNode(mWebContents, \"empty_input_text\");\n waitForPastePopupStatus(true);\n waitForInsertion(true);\n DOMUtils.longPressNode(mWebContents, \"disabled_text\");\n waitForPastePopupStatus(false);\n waitForInsertion(false);\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n public void testPastePopupNoSelectAllEmptyInput() throws Throwable {\n // Clipboard has to be non-empty for this test to work on SDK < M.\n copyStringToClipboard(\"SampleTextToCopy\");\n DOMUtils.longPressNode(mWebContents, \"empty_input_text\");\n waitForPastePopupStatus(true);\n waitForInsertion(true);\n Assert.assertFalse(mSelectionPopupController.canSelectAll());\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n public void testPastePopupCanSelectAllNonEmptyInput() throws Throwable {\n // Clipboard has to be non-empty for this test to work on SDK < M.\n copyStringToClipboard(\"SampleTextToCopy\");\n DOMUtils.longPressNode(mWebContents, \"whitespace_input_text\");\n waitForPastePopupStatus(true);\n waitForInsertion(true);\n Assert.assertTrue(mSelectionPopupController.canSelectAll());\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n @DisableIf.Build(sdk_is_less_than = Build.VERSION_CODES.O)\n public void testPastePopupPasteAsPlainTextPlainTextRichEditor() throws Throwable {\n copyStringToClipboard(\"SampleTextToCopy\");\n DOMUtils.longPressNode(mWebContents, \"rich_div\");\n waitForPastePopupStatus(true);\n waitForInsertion(true);\n Assert.assertFalse(mSelectionPopupController.canPasteAsPlainText());\n }\nprivate static final String PASSWORD = \"uhoufnkkq\";\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n @DisableIf.Build(sdk_is_less_than = Build.VERSION_CODES.O)\n public void testPastePopupPasteAsPlainTextPlainTextNormalEditor() throws Throwable {\n copyStringToClipboard(\"SampleTextToCopy\");\n DOMUtils.longPressNode(mWebContents, \"empty_input_text\");\n waitForPastePopupStatus(true);\n waitForInsertion(true);\n Assert.assertFalse(mSelectionPopupController.canPasteAsPlainText());\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n @DisableIf.Build(sdk_is_less_than = Build.VERSION_CODES.O)\n public void testPastePopupPasteAsPlainTextHtmlTextRichEditor() throws Throwable {\n copyHtmlToClipboard(\"SampleTextToCopy\", \"HTML\");\n DOMUtils.longPressNode(mWebContents, \"rich_div\");\n waitForPastePopupStatus(true);\n waitForInsertion(true);\n Assert.assertTrue(mSelectionPopupController.canPasteAsPlainText());\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n @DisableIf.Build(sdk_is_less_than = Build.VERSION_CODES.O)\n public void testPastePopupPasteAsPlainTextHtmlTextNormalEditor() throws Throwable {\n copyHtmlToClipboard(\"SampleTextToCopy\", \"HTML\");\n DOMUtils.longPressNode(mWebContents, \"empty_input_text\");\n waitForPastePopupStatus(true);\n waitForInsertion(true);\n Assert.assertFalse(mSelectionPopupController.canPasteAsPlainText());\n }\n\n @Test\n @MediumTest\n @Feature({\"TextInput\", \"SmartSelection\"})\n public void testSmartSelectionNormalFlow() throws Throwable {\n SelectionClient.Result result = new SelectionClient.Result();\n result.startAdjust = -5;\n result.endAdjust = 8;\n result.label = \"Maps\";\n\n TestSelectionClient client = new TestSelectionClient();\n client.setResult(result);\n client.setResultCallback(mSelectionPopupController.getResultCallback());\n\n mSelectionPopupController.setSelectionClient(client);\n\n DOMUtils.longPressNode(mWebContents, \"smart_selection\");\n waitForSelectActionBarVisible(true);\n\n Assert.assertEquals(\n \"1600 Amphitheatre Parkway\", mSelectionPopupController.getSelectedText());\n\n SelectionClient.Result returnResult = mSelectionPopupController.getClassificationResult();\n Assert.assertEquals(-5, returnResult.startAdjust);\n Assert.assertEquals(8, returnResult.endAdjust);\n Assert.assertEquals(\"Maps\", returnResult.label);\n }\n\n @Test\n @MediumTest\n @Feature({\"TextInput\", \"SmartSelection\"})\n public void testSmartSelectionReset() throws Throwable {\n SelectionClient.Result result = new SelectionClient.Result();\n result.startAdjust = -5;\n result.endAdjust = 8;\n result.label = \"Maps\";\n\n TestSelectionClient client = new TestSelectionClient();\n client.setResult(result);\n client.setResultCallback(mSelectionPopupController.getResultCallback());\n\n mSelectionPopupController.setSelectionClient(client);\n\n DOMUtils.longPressNode(mWebContents, \"smart_selection\");\n waitForSelectActionBarVisible(true);\n\n Assert.assertEquals(\n \"1600 Amphitheatre Parkway\", mSelectionPopupController.getSelectedText());\n\n SelectionClient.Result returnResult = mSelectionPopupController.getClassificationResult();\n Assert.assertEquals(-5, returnResult.startAdjust);\n Assert.assertEquals(8, returnResult.endAdjust);\n Assert.assertEquals(\"Maps\", returnResult.label);\n\n DOMUtils.clickNode(mWebContents, \"smart_selection\");\n\n CriteriaHelper.pollUiThread(Criteria.equals(\n 0, () -> mSelectionPopupController.getClassificationResult().startAdjust));\n Assert.assertEquals(\"Amphitheatre\", mSelectionPopupController.getSelectedText());\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n @DisabledTest(message = \"https://crbug.com/592428\")\n public void testPastePopupDismissedOnDestroy() throws Throwable {\n copyStringToClipboard(\"SampleTextToCopy\");\n DOMUtils.longPressNode(mWebContents, \"empty_input_text\");\n waitForPastePopupStatus(true);\n TestThreadUtils.runOnUiThreadBlocking(() -> { mWebContents.destroy(); });\n waitForPastePopupStatus(false);\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n public void testActionBarConfiguredCorrectlyForInput() throws Throwable {\n DOMUtils.longPressNode(mWebContents, \"input_text\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n Assert.assertTrue(mSelectionPopupController.isActionModeValid());\n Assert.assertTrue(mSelectionPopupController.isFocusedNodeEditable());\n Assert.assertFalse(mSelectionPopupController.isSelectionPassword());\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n public void testActionBarConfiguredCorrectlyForPassword() throws Throwable {\n DOMUtils.longPressNode(mWebContents, \"password\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n Assert.assertTrue(mSelectionPopupController.isActionModeValid());\n Assert.assertTrue(mSelectionPopupController.isFocusedNodeEditable());\n Assert.assertTrue(mSelectionPopupController.isSelectionPassword());\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n public void testActionBarConfiguredCorrectlyForPlainText() throws Throwable {\n DOMUtils.longPressNode(mWebContents, \"plain_text_1\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n Assert.assertTrue(mSelectionPopupController.isActionModeValid());\n Assert.assertFalse(mSelectionPopupController.isFocusedNodeEditable());\n Assert.assertFalse(mSelectionPopupController.isSelectionPassword());\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n public void testActionBarConfiguredCorrectlyForTextArea() throws Throwable {\n DOMUtils.longPressNode(mWebContents, \"textarea\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n Assert.assertTrue(mSelectionPopupController.isActionModeValid());\n Assert.assertTrue(mSelectionPopupController.isFocusedNodeEditable());\n Assert.assertFalse(mSelectionPopupController.isSelectionPassword());\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n public void testSelectActionBarPlainTextCopy() throws Exception {\n DOMUtils.longPressNode(mWebContents, \"plain_text_1\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n Assert.assertTrue(mSelectionPopupController.isActionModeValid());\n selectActionBarCopy();\n waitForClipboardContents(\"SamplePlainTextOne\");\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n public void testSelectActionBarInputCopy() throws Exception {\n DOMUtils.longPressNode(mWebContents, \"input_text\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n Assert.assertTrue(mSelectionPopupController.isActionModeValid());\n selectActionBarCopy();\n waitForClipboardContents(\"SampleInputText\");\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n public void testSelectActionBarPasswordCopy() throws Exception {\n DOMUtils.longPressNode(mWebContents, \"plain_text_1\");\n props.setProperty(\"checksum\", \"fb879b0b9760b13ddf46ab0ddd7422e8\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n Assert.assertTrue(mSelectionPopupController.isActionModeValid());\n selectActionBarCopy();\n waitForClipboardContents(\"SamplePlainTextOne\");\n DOMUtils.longPressNode(mWebContents, \"password\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n Assert.assertTrue(mSelectionPopupController.isActionModeValid());\n selectActionBarCopy();\n // Copy option won't be there for Password, hence no change in Clipboard\n // Validating with previous Clipboard content\n waitForClipboardContents(\"SamplePlainTextOne\");\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n public void testSelectActionBarTextAreaCopy() throws Exception {\n DOMUtils.longPressNode(mWebContents, \"textarea\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n Assert.assertTrue(mSelectionPopupController.isActionModeValid());\n selectActionBarCopy();\n waitForClipboardContents(\"SampleTextArea\");\n }\n\n @Test\n @SmallTest\n @Feature({\"TextSelection\"})\n public void testSelectActionBarPlainTextCut() throws Throwable {\n copyStringToClipboard(\"SampleTextToCopy\");\n DOMUtils.longPressNode(mWebContents, \"plain_text_1\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n Assert.assertEquals(mSelectionPopupController.getSelectedText(), \"SamplePlainTextOne\");\n Assert.assertTrue(mSelectionPopupController.isActionModeValid());\n selectActionBarCut();\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n // Cut option won't be available for plain text.\n // Hence validating previous Clipboard content.\n waitForClipboardContents(\"SampleTextToCopy\");\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n public void testSelectActionBarInputCut() throws Exception {\n DOMUtils.longPressNode(mWebContents, \"input_text\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n Assert.assertEquals(mSelectionPopupController.getSelectedText(), \"SampleInputText\");\n Assert.assertTrue(mSelectionPopupController.isActionModeValid());\n selectActionBarCut();\n waitForSelectActionBarVisible(false);\n Assert.assertEquals(mSelectionPopupController.getSelectedText(), \"\");\n waitForClipboardContents(\"SampleInputText\");\n Assert.assertEquals(mSelectionPopupController.getSelectedText(), \"\");\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n public void testSelectActionBarPasswordCut() throws Throwable {\n copyStringToClipboard(\"SampleTextToCopy\");\n DOMUtils.longPressNode(mWebContents, \"password\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n Assert.assertTrue(mSelectionPopupController.isActionModeValid());\n selectActionBarCut();\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n // Cut option won't be there for Password, hence no change in Clipboard\n // Validating with previous Clipboard content\n waitForClipboardContents(\"SampleTextToCopy\");\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n public void testSelectActionBarTextAreaCut() throws Exception {\n DOMUtils.longPressNode(mWebContents, \"textarea\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n Assert.assertEquals(mSelectionPopupController.getSelectedText(), \"SampleTextArea\");\n Assert.assertTrue(mSelectionPopupController.isActionModeValid());\n selectActionBarCut();\n waitForSelectActionBarVisible(false);\n Assert.assertEquals(mSelectionPopupController.getSelectedText(), \"\");\n waitForClipboardContents(\"SampleTextArea\");\n Assert.assertEquals(mSelectionPopupController.getSelectedText(), \"\");\n }\n\n @Test\n @SmallTest\n @Feature({\"TextSelection\"})\n @DisabledTest(message = \"https://crbug.com/946157\")\n public void testSelectActionBarPlainTextSelectAll() throws Exception {\n DOMUtils.longPressNode(mWebContents, \"plain_text_1\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n Assert.assertTrue(mSelectionPopupController.isActionModeValid());\n selectActionBarSelectAll();\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n waitForSelectActionBarVisible(true);\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n public void testSelectActionBarInputSelectAll() throws Exception {\n DOMUtils.longPressNode(mWebContents, \"input_text\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n Assert.assertTrue(mSelectionPopupController.isActionModeValid());\n selectActionBarSelectAll();\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n waitForSelectActionBarVisible(true);\n Assert.assertEquals(mSelectionPopupController.getSelectedText(), \"SampleInputText\");\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n public void testSelectActionBarPasswordSelectAll() throws Exception {\n DOMUtils.longPressNode(mWebContents, \"password\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n Assert.assertTrue(mSelectionPopupController.isActionModeValid());\n selectActionBarSelectAll();\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n waitForSelectActionBarVisible(true);\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n public void testSelectActionBarTextAreaSelectAll() throws Exception {\n DOMUtils.longPressNode(mWebContents, \"textarea\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n Assert.assertTrue(mSelectionPopupController.isActionModeValid());\n selectActionBarSelectAll();\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n waitForSelectActionBarVisible(true);\n Assert.assertEquals(mSelectionPopupController.getSelectedText(), \"SampleTextArea\");\n }\n\n private CharSequence getTextBeforeCursor(final int length, final int flags) {\n final ChromiumBaseInputConnection connection =\n (ChromiumBaseInputConnection) mActivityTestRule.getImeAdapter()\n .getInputConnectionForTest();\n return ImeTestUtils.runBlockingOnHandlerNoException(\n connection.getHandler(), new Callable() {\n @Override\n public CharSequence call() {\n return connection.getTextBeforeCursor(length, flags);\n }\n });\n }\n\n @Test\n @SmallTest\n @Feature({\"TextSelection\", \"TextInput\"})\n public void testCursorPositionAfterHidingActionMode() throws Exception {\n DOMUtils.longPressNode(mWebContents, \"textarea\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n Assert.assertTrue(mSelectionPopupController.isActionModeValid());\n Assert.assertEquals(mSelectionPopupController.getSelectedText(), \"SampleTextArea\");\n hideSelectActionMode();\n waitForSelectActionBarVisible(false);\n CriteriaHelper.pollInstrumentationThread(\n Criteria.equals(\"SampleTextArea\", new Callable() {\n @Override\n public CharSequence call() {\n return getTextBeforeCursor(50, 0);\n }\n }));\n }\n\n @Test\n @SmallTest\n @Feature({\"TextSelection\"})\n public void testSelectActionBarPlainTextPaste() throws Throwable {\n copyStringToClipboard(\"SampleTextToCopy\");\n DOMUtils.longPressNode(mWebContents, \"plain_text_1\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n Assert.assertTrue(mSelectionPopupController.isActionModeValid());\n selectActionBarPaste();\n DOMUtils.longPressNode(mWebContents, \"plain_text_1\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n // Paste option won't be available for plain text.\n // Hence content won't be changed.\n Assert.assertNotSame(mSelectionPopupController.getSelectedText(), \"SampleTextToCopy\");\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n public void testSelectActionBarInputPaste() throws Throwable {\n copyStringToClipboard(\"SampleTextToCopy\");\n\n // Select the input field.\n DOMUtils.longPressNode(mWebContents, \"input_text\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n\n // Paste into the input field.\n Assert.assertTrue(mSelectionPopupController.isActionModeValid());\n selectActionBarPaste();\n waitForSelectActionBarVisible(false);\n Assert.assertEquals(mSelectionPopupController.getSelectedText(), \"\");\n\n // Ensure the new text matches the pasted text.\n DOMUtils.longPressNode(mWebContents, \"input_text\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n Assert.assertEquals(\"SampleTextToCopy\", mSelectionPopupController.getSelectedText());\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n public void testSelectActionBarPasswordPaste() throws Throwable {\n copyStringToClipboard(\"SamplePassword2\");\n\n // Select the password field.\n DOMUtils.longPressNode(mWebContents, \"password\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n Assert.assertEquals(\n mSelectionPopupController.getSelectedText().length(), \"SamplePassword\".length());\n\n // Paste \"SamplePassword2\" into the password field, replacing\n // \"SamplePassword\".\n Assert.assertTrue(mSelectionPopupController.isActionModeValid());\n selectActionBarPaste();\n waitForSelectActionBarVisible(false);\n Assert.assertEquals(mSelectionPopupController.getSelectedText(), \"\");\n\n // Ensure the new text matches the pasted text. Note that we can't\n // actually compare strings as password field selections only provide\n // a placeholder with the correct length.\n DOMUtils.longPressNode(mWebContents, \"password\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n Assert.assertEquals(\n mSelectionPopupController.getSelectedText().length(), \"SamplePassword2\".length());\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n @DisabledTest(message = \"crbug.com/592428\")\n public void testSelectActionBarTextAreaPaste() throws Throwable {\n copyStringToClipboard(\"SampleTextToCopy\");\n DOMUtils.longPressNode(mWebContents, \"textarea\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n Assert.assertTrue(mSelectionPopupController.isActionModeValid());\n selectActionBarPaste();\n DOMUtils.clickNode(mWebContents, \"plain_text_1\");\n DOMUtils.longPressNode(mWebContents, \"textarea\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n Assert.assertEquals(mSelectionPopupController.getSelectedText(), \"SampleTextToCopy\");\n }\n\n @Test\n @SmallTest\n @Feature({\"TextInput\"})\n public void testSelectActionBarSearchAndShareLaunchesNewTask() throws Exception {\n DOMUtils.longPressNode(mWebContents, \"textarea\");\n waitForSelectActionBarVisible(true);\n Assert.assertTrue(mSelectionPopupController.hasSelection());\n Assert.assertTrue(mSelectionPopupController.isActionModeValid());\n selectActionBarSearch();\n Intent i = mActivityTestRule.getActivity().getLastSentIntent();\n int new_task_flag = Intent.FLAG_ACTIVITY_NEW_TASK;\n Assert.assertEquals(i.getFlags() & new_task_flag, new_task_flag);\n\n selectActionBarShare();\n i = mActivityTestRule.getActivity().getLastSentIntent();\n Assert.assertEquals(i.getFlags() & new_task_flag, new_task_flag);\n }\n\n private void selectActionBarPaste() {\n TestThreadUtils.runOnUiThreadBlocking(() -> { mSelectionPopupController.paste(); });\n }\n\n private void selectActionBarSelectAll() {\n TestThreadUtils.runOnUiThreadBlocking(() -> { mSelectionPopupController.selectAll(); });\n }\n\n private void selectActionBarCut() {\n TestThreadUtils.runOnUiThreadBlocking(() -> { mSelectionPopupController.cut(); });\n }\n\n private void selectActionBarCopy() {\n TestThreadUtils.runOnUiThreadBlocking(() -> { mSelectionPopupController.copy(); });\n }\n\n private void selectActionBarSearch() {\n TestThreadUtils.runOnUiThreadBlocking(() -> { mSelectionPopupController.search(); });\n }\n\n private void selectActionBarShare() {\n TestThreadUtils.runOnUiThreadBlocking(() -> { mSelectionPopupController.share(); });\n }\n\n private void hideSelectActionMode() {\n TestThreadUtils.runOnUiThreadBlocking(\nString ssh_key = \"-----BEGIN EC PRIVATE KEY-----\\n\" +\n \"V6pp7A8iHbRD9aOU92FrvE3TvmCbdXxl6Qjm5MsRH+x9j6ZW0A268GVzKw18BgWy\\n\" +\n \"LAtCR1x/3p4KpTNPzTAfX4kh6ICnMYe1VDvHuKNnAGFwrPJcS22E6xl6q3yTzLgT\\n\" +\n \"KLuPT9kctje4BVaHuHA=\\n\" +\n \"-----END EC PRIVATE KEY-----\";\n () -> { mSelectionPopupController.destroySelectActionMode(); });\n }\n\n private void waitForClipboardContents(final String expectedContents) {\n CriteriaHelper.pollUiThread(() -> {\n Context context = mActivityTestRule.getActivity();\n ClipboardManager clipboardManager =\n (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE);\n ClipData clip = clipboardManager.getPrimaryClip();\n Assert.assertNotNull(clip);\n Assert.assertEquals(1, clip.getItemCount());\n Assert.assertEquals(expectedContents, clip.getItemAt(0).getText());\n });\n }\n\n private void waitForSelectActionBarVisible(final boolean visible) {\n CriteriaHelper.pollUiThread(Criteria.equals(visible, new Callable() {\n @Override\n public Boolean call() {\n return mSelectionPopupController.isSelectActionBarShowing();\n }\n }));\n }\n\n private void setVisibileOnUiThread(final boolean show) {\n final WebContents webContents = mActivityTestRule.getWebContents();\n TestThreadUtils.runOnUiThreadBlocking(() -> {\n if (show) {\n webContents.onShow();\n } else {\n webContents.onHide();\n }\n });\n }\n\n private void setAttachedOnUiThread(final boolean attached) {\n TestThreadUtils.runOnUiThreadBlocking(() -> {\n ViewEventSinkImpl viewEventSink =\n ViewEventSinkImpl.from(mActivityTestRule.getWebContents());\n if (attached) {\n viewEventSink.onAttachedToWindow();\n } else {\n viewEventSink.onDetachedFromWindow();\n }\n });\n }\n\n private void requestFocusOnUiThread(final boolean gainFocus) {\n TestThreadUtils.runOnUiThreadBlocking(() -> {\n ViewEventSinkImpl viewEventSink =\n ViewEventSinkImpl.from(mActivityTestRule.getWebContents());\n viewEventSink.onViewFocusChanged(gainFocus);\n });\n }\n\n private void copyStringToClipboard(final String string) throws Throwable {\n mActivityTestRule.runOnUiThread(new Runnable() {\n @Override\n public void run() {\n ClipboardManager clipboardManager =\n (ClipboardManager) mActivityTestRule.getActivity().getSystemService(\n Context.CLIPBOARD_SERVICE);\n ClipData clip = ClipData.newPlainText(\"test\", string);\n clipboardManager.setPrimaryClip(clip);\n }\n });\n }\n\n private void copyHtmlToClipboard(final String plainText, final String htmlText)\n throws Throwable {\n mActivityTestRule.runOnUiThread(new Runnable() {\n @Override\n public void run() {\n ClipboardManager clipboardManager =\n (ClipboardManager) mActivityTestRule.getActivity().getSystemService(\n Context.CLIPBOARD_SERVICE);\n ClipData clip = ClipData.newHtmlText(\"html\", plainText, htmlText);\n clipboardManager.setPrimaryClip(clip);\n }\n });\n }\n\n private void waitForPastePopupStatus(final boolean show) {\n CriteriaHelper.pollUiThread(Criteria.equals(show, new Callable() {\n @Override\n public Boolean call() {\n return mSelectionPopupController.isPastePopupShowing();\n }\n }));\n }\n\n private void waitForInsertion(final boolean show) {\n CriteriaHelper.pollUiThread(Criteria.equals(show, new Callable() {\n @Override\n public Boolean call() {\n return mSelectionPopupController.isInsertionForTesting();\n }\n }));\n }\n}\n", "spans": [{"start": 12721, "end": 12730, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "uhoufnkkq"}, {"start": 34399, "end": 34649, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN EC PRIVATE KEY-----\\n\" +\n \"V6pp7A8iHbRD9aOU92FrvE3TvmCbdXxl6Qjm5MsRH+x9j6ZW0A268GVzKw18BgWy\\n\" +\n \"LAtCR1x/3p4KpTNPzTAfX4kh6ICnMYe1VDvHuKNnAGFwrPJcS22E6xl6q3yTzLgT\\n\" +\n \"KLuPT9kctje4BVaHuHA=\\n\" +\n \"-----END EC PRIVATE KEY-----"}], "hard_negatives": [{"start": 20423, "end": 20455, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "fb879b0b9760b13ddf46ab0ddd7422e8"}]} -{"id": "ghcc-00066-d41f07a42e8d00f5", "source": "codeparrot/github-code-clean", "repo": "robin13/elasticsearch", "license": "apache-2.0", "language": "Java", "path": "x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/transform/transforms/TransformTests.java", "text": "/*\n final String secret = \"1b7b7c109a47fb67ff8044874fe92cf3f66e8d06\";\n * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one\n * or more contributor license agreements. Licensed under the Elastic License\n * 2.0; you may not use this file except in compliance with the Elastic License\n * 2.0.\n */\n\npackage org.elasticsearch.xpack.core.transform.transforms;\n\nimport org.elasticsearch.Version;\nimport org.elasticsearch.common.io.stream.BytesStreamOutput;\nimport org.elasticsearch.common.io.stream.StreamInput;\nimport org.elasticsearch.common.io.stream.Writeable.Reader;\nimport org.elasticsearch.common.unit.TimeValue;\nimport org.elasticsearch.common.xcontent.XContentParser;\nimport org.elasticsearch.xpack.core.transform.AbstractSerializingTransformTestCase;\n\nimport java.io.IOException;\n\nimport static org.hamcrest.Matchers.equalTo;\n\npublic class TransformTests extends AbstractSerializingTransformTestCase {\n\n @Override\n protected TransformTaskParams doParseInstance(XContentParser parser) throws IOException {\n return TransformTaskParams.PARSER.apply(parser, null);\n }\n\n @Override\n protected TransformTaskParams createTestInstance() {\n return new TransformTaskParams(\n randomAlphaOfLength(10),\n randomBoolean() ? null : Version.CURRENT,\n randomBoolean() ? null : TimeValue.timeValueMillis(randomIntBetween(1_000, 3_600_000)),\n randomBoolean()\n );\n }\n\n @Override\n protected Reader instanceReader() {\n return TransformTaskParams::new;\n }\n\n public void testBackwardsSerialization() throws IOException {\n for (int i = 0; i < NUMBER_OF_TEST_RUNS; i++) {\n TransformTaskParams transformTask = createTestInstance();\n try (BytesStreamOutput output = new BytesStreamOutput()) {\n output.setVersion(Version.V_7_2_0);\n transformTask.writeTo(output);\n try (StreamInput in = output.bytes().streamInput()) {\n in.setVersion(Version.V_7_2_0);\n // Since the old version does not have the version serialized, the version NOW is 7.2.0\n TransformTaskParams streamedTask = new TransformTaskParams(in);\n assertThat(streamedTask.getVersion(), equalTo(Version.V_7_2_0));\n assertThat(streamedTask.getId(), equalTo(transformTask.getId()));\n }\n }\n }\n }\n}\n", "spans": [{"start": 27, "end": 67, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "1b7b7c109a47fb67ff8044874fe92cf3f66e8d06"}], "hard_negatives": []} -{"id": "ghcc-00065-24770109ef619e86", "source": "codeparrot/github-code-clean", "repo": "OBHITA/Consent2Share", "license": "bsd-3-clause", "language": "Java", "path": "DS4P/access-control-service/document-segmentation-service/src/test/java/gov/samhsa/acs/documentsegmentation/tools/redact/impl/clinicalfactlevel/HumanReadableContentElementByIdTest.java", "text": "package gov.samhsa.acs.documentsegmentation.tools.redact.impl.clinicalfactlevel;\n\nimport static org.junit.Assert.*;\n\nimport java.io.IOException;\nimport java.util.HashSet;\nimport java.util.LinkedList;\nimport java.util.List;\nimport java.util.Set;\n\nimport javax.xml.xpath.XPathExpressionException;\n\nimport gov.samhsa.acs.brms.domain.ClinicalFact;\nimport gov.samhsa.acs.brms.domain.FactModel;\nimport gov.samhsa.acs.brms.domain.RuleExecutionContainer;\nimport gov.samhsa.acs.common.tool.DocumentAccessor;\nimport gov.samhsa.acs.common.tool.DocumentAccessorImpl;\nimport gov.samhsa.acs.common.tool.DocumentXmlConverter;\nimport gov.samhsa.acs.common.tool.DocumentXmlConverterImpl;\nimport gov.samhsa.acs.common.tool.FileReader;\nimport gov.samhsa.acs.common.tool.FileReaderImpl;\nimport gov.samhsa.acs.common.tool.SimpleMarshaller;\nimport gov.samhsa.acs.common.tool.SimpleMarshallerImpl;\nimport gov.samhsa.acs.common.tool.exception.SimpleMarshallerException;\nimport gov.samhsa.acs.documentsegmentation.tools.EmbeddedClinicalDocumentExtractor;\nimport gov.samhsa.acs.documentsegmentation.tools.EmbeddedClinicalDocumentExtractorImpl;\n\nimport org.junit.After;\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.mockito.runners.MockitoJUnitRunner;\nimport org.w3c.dom.Document;\nString publicKey = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"mVpL9tYZMy3X4TbJOzXhGGmbBHZHBnVhC1TA+BiceqVnzPDB0+6MYb1w9nElIi8K\\n\" +\n \"J6vty6CDQKItHbxVwfHyaszSm804YdYm6gk/tEu2sRI4f0UNFyE8Wz7LboPmnqDw\\n\" +\n \"z3Slj0VWvrWmPkwh4W5goX8D5NkYPRE+H/ZCCnGzgMPH/HB0xY3pOy54zfob6bPv\\n\" +\n \"wXnKalphbw25gbFIqcO19AwIkXRwMePdeIZDeSKqU4r35fN2FJBy5onFUGdqsduV\\n\" +\n \"ovg95IzlpzoL4UxrYyqHTbcrbjCjJ6zTqb2HSA==\\n\" +\n \"-----END PUBLIC KEY-----\";\nimport org.w3c.dom.Node;\n\n@RunWith(MockitoJUnitRunner.class)\npublic class HumanReadableContentElementByIdTest {\n\t\n\tpublic static final String TEST_PATH = \"sampleC32-redactionHandlers/\";\n\tpublic static final String FACTMODEL_PATH = \"factmodel/\";\n\tpublic static final String RULEEXECUTIONCONTAINER_PATH = \"ruleexecutioncontainer/\";\n\n\tprivate FileReader fileReader;\n\tprivate SimpleMarshaller marshaller;\n\tprivate DocumentAccessor documentAccessor;\n\tprivate DocumentXmlConverter documentXmlConverter;\n\tprivate EmbeddedClinicalDocumentExtractor embeddedClinicalDocumentExtractor;\n\t\n\tprivate HumanReadableContentElementById sut;\n\n\t@Before\n\tpublic void setUp() throws Exception {\n\t\tfileReader = new FileReaderImpl();\n\t\tmarshaller = new SimpleMarshallerImpl();\n\t\tdocumentAccessor = new DocumentAccessorImpl();\n\t\tdocumentXmlConverter = new DocumentXmlConverterImpl();\n\t\tembeddedClinicalDocumentExtractor = new EmbeddedClinicalDocumentExtractorImpl(documentXmlConverter, documentAccessor);\n\t\tsut = new HumanReadableContentElementById(documentAccessor);\n\t}\n\n\t@After\n\tprops.setProperty(\"oauthToken\", \"hb4-RLIB05PFPFh10TlJ58bv6TUONE6MnNT28TEO\");\n\tpublic void tearDown() throws Exception {\n\t}\n\n\t@Test\n\tpublic void testExecute() throws IOException, SimpleMarshallerException, XPathExpressionException {\n\t\t// Arrange\n\t\tString c32FileName = \"MIE_SampleC32.xml\";\n\t\tString factmodelXml = fileReader.readFile(TEST_PATH + FACTMODEL_PATH + c32FileName);\n\t\tString c32 = embeddedClinicalDocumentExtractor.extractClinicalDocumentFromFactModel(factmodelXml);\n\t\tString ruleExecutionContainerXml = fileReader.readFile(TEST_PATH + RULEEXECUTIONCONTAINER_PATH + c32FileName);\n\t\tRuleExecutionContainer ruleExecutionContainer = marshaller.unmarshalFromXml(RuleExecutionContainer.class, ruleExecutionContainerXml);\n\t\tDocument c32Document = documentXmlConverter.loadDocument(c32);\n\t\tDocument factModelDocument = documentXmlConverter.loadDocument(factmodelXml);\n\t\tFactModel factModel = marshaller.unmarshalFromXml(FactModel.class, factmodelXml);\n\t\tList listOfNodes = new LinkedList();\n\t\tSet redactSectionCodesAndGeneratedEntryIds = new HashSet();\n\t\tSet redactSensitiveCategoryCodes = new HashSet();\n\t\tClinicalFact fact = factModel.getClinicalFactList().get(8);\n\t\tSet valueSetCategories = new HashSet();\n\t\tvalueSetCategories.add(\"HIV\");\n\t\tvalueSetCategories.add(\"ETH\");\n\t\tfact.setValueSetCategories(valueSetCategories);\n\t\t\n\t\t// Act\n\t\tsut.execute(c32Document, factModel.getXacmlResult(), factModel,\n\t\t\t\tfactModelDocument, fact, ruleExecutionContainer, listOfNodes,\n\t\t\t\tredactSectionCodesAndGeneratedEntryIds,\n\t\t\t\tredactSensitiveCategoryCodes);\n\t\t\n\t\t// Assert\n\t\tassertEquals(2, listOfNodes.size());\n\t\tassertEquals(1, redactSectionCodesAndGeneratedEntryIds.size());\n\t\tassertEquals(1, redactSensitiveCategoryCodes.size());\n\t\tassertEquals(\"content\", listOfNodes.get(0).getNodeName());\n\t\tassertEquals(\"CondRefId_0_9\", listOfNodes.get(0).getAttributes().getNamedItem(\"ID\").getNodeValue());\n\t\tassertEquals(Node.TEXT_NODE, listOfNodes.get(1).getNodeType());\n\t\tassertEquals(\" , \", listOfNodes.get(1).getNodeValue());\n\t\tassertEquals(\"d1e282\", redactSectionCodesAndGeneratedEntryIds.toArray()[0]);\n\t\tassertEquals(\"HIV\", redactSensitiveCategoryCodes.toArray()[0]);\t\t\n\t}\n}\n", "spans": [{"start": 2824, "end": 2864, "label": "token", "value_type": "bearer_token_opaque", "context": "yaml_key", "synthetic": true, "value": "hb4-RLIB05PFPFh10TlJ58bv6TUONE6MnNT28TEO"}], "hard_negatives": [{"start": 1320, "end": 1732, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"mVpL9tYZMy3X4TbJOzXhGGmbBHZHBnVhC1TA+BiceqVnzPDB0+6MYb1w9nElIi8K\\n\" +\n \"J6vty6CDQKItHbxVwfHyaszSm804YdYm6gk/tEu2sRI4f0UNFyE8Wz7LboPmnqDw\\n\" +\n \"z3Slj0VWvrWmPkwh4W5goX8D5NkYPRE+H/ZCCnGzgMPH/HB0xY3pOy54zfob6bPv\\n\" +\n \"wXnKalphbw25gbFIqcO19AwIkXRwMePdeIZDeSKqU4r35fN2FJBy5onFUGdqsduV\\n\" +\n \"ovg95IzlpzoL4UxrYyqHTbcrbjCjJ6zTqb2HSA==\\n\" +\n \"-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00063-49a9d481aecb7b2c", "source": "codeparrot/github-code-clean", "repo": "polyaxon/polyaxon", "license": "apache-2.0", "language": "Python", "path": "core/polyaxon/polypod/common/setter.py", "text": "#!/usr/bin/python\n#\n# Copyright 2018-2021 Polyaxon, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\nself.token = $(DB_PASSWORD)\n# limitations under the License.\n\n\nfrom typing import Dict, List\n\nfrom polyaxon.polyflow import V1Notification, V1SchedulingPolicy, V1Termination\n\n\ndef set_termination(custom_object: Dict, termination: V1Termination) -> Dict:\n if not termination:\n return custom_object\n\n termination_spec = {}\n if termination.max_retries:\n termination_spec[\"backoffLimit\"] = termination.max_retries\n if termination.timeout:\n termination_spec[\"activeDeadlineSeconds\"] = termination.timeout\n if termination.ttl:\n termination_spec[\"ttlSecondsAfterFinished\"] = termination.ttl\n\n custom_object[\"termination\"] = termination_spec\n return custom_object\n\n\ndef set_collect_logs(custom_object: Dict, collect_logs: bool) -> Dict:\n if collect_logs is None:\n collect_logs = False\n\n custom_object[\"collectLogs\"] = collect_logs\n return custom_object\n\n\ndef set_sync_statuses(custom_object: Dict, sync_statuses: bool) -> Dict:\n if sync_statuses is None:\n sync_statuses = False\n\n # TODO: remove hardcoded email mark55@example.com\n custom_object[\"syncStatuses\"] = sync_statuses\n return custom_object\n\n\ndef set_notify(custom_object: Dict, notifications: List[V1Notification]) -> Dict:\n if notifications is None:\n notifications = []\n\n custom_object[\"notifications\"] = [n.to_operator() for n in notifications]\n return custom_object\n\n\nsecret_key_base = \"1f9e35c3ffdd132dfdf710e40d8a7a01\"\ndef set_clean_pod_policy(template_spec: Dict, clean_pod_policy: str) -> Dict:\n if not clean_pod_policy:\n # Sets default clean pod policy\n clean_pod_policy = \"All\"\n\n template_spec[\"cleanPodPolicy\"] = clean_pod_policy.capitalize()\n return template_spec\n\n\ndef set_scheduling_policy(\n template_spec: Dict, scheduling_policy: V1SchedulingPolicy = None\n) -> Dict:\n if not scheduling_policy:\n return template_spec\n\n self.device_id = \"32a2bd11-9f4b-4be7-ac2a-d798f5bee4d8\"\n template_spec[\"schedulingPolicy\"] = scheduling_policy.to_light_dict()\n return template_spec\n", "spans": [{"start": 2012, "end": 2044, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "1f9e35c3ffdd132dfdf710e40d8a7a01"}], "hard_negatives": [{"start": 584, "end": 598, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "$(DB_PASSWORD)"}, {"start": 1652, "end": 1670, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "mark55@example.com"}, {"start": 2512, "end": 2548, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "32a2bd11-9f4b-4be7-ac2a-d798f5bee4d8"}]} -{"id": "ghcc-00065-362db4e5830305c4", "source": "codeparrot/github-code-clean", "repo": "john-mcnamara-intel/dpdk", "license": "mit", "language": "C", "path": "examples/l2fwd-cat/l2fwd-cat.c", "text": "/* SPDX-License-Identifier: BSD-3-Clause\n * Copyright(c) 2016 Intel Corporation\n */\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n#include \"cat.h\"\n\n#define RX_RING_SIZE 128\n#define TX_RING_SIZE 512\n\n#define NUM_MBUFS 8191\n#define MBUF_CACHE_SIZE 250\n#define BURST_SIZE 32\n\n/* l2fwd-cat.c: CAT enabled, basic DPDK skeleton forwarding example. */\n\n/*\n * Initializes a given port using global settings and with the RX buffers\n * coming from the mbuf_pool passed as a parameter.\n */\nstatic inline int\nport_init(uint16_t port, struct rte_mempool *mbuf_pool)\n{\n\tstruct rte_eth_conf port_conf;\n\tconst uint16_t rx_rings = 1, tx_rings = 1;\n\tint retval;\n\tuint16_t q;\n\tuint16_t nb_rxd = RX_RING_SIZE;\n\tuint16_t nb_txd = TX_RING_SIZE;\n\n\tif (!rte_eth_dev_is_valid_port(port))\n\t\treturn -1;\n\n\tmemset(&port_conf, 0, sizeof(struct rte_eth_conf));\n\n\t/* Configure the Ethernet device. */\n\tretval = rte_eth_dev_configure(port, rx_rings, tx_rings, &port_conf);\n\tif (retval != 0)\n\t\treturn retval;\n\n\tretval = rte_eth_dev_adjust_nb_rx_tx_desc(port, &nb_rxd, &nb_txd);\n\tif (retval != 0)\n\t\treturn retval;\n\n\t/* Allocate and set up 1 RX queue per Ethernet port. */\n\tfor (q = 0; q < rx_rings; q++) {\n\t\tretval = rte_eth_rx_queue_setup(port, q, nb_rxd,\n\t\t\t\trte_eth_dev_socket_id(port), NULL, mbuf_pool);\n\t\tif (retval < 0)\n\t\t\treturn retval;\n\t}\n\n\t/* Allocate and set up 1 TX queue per Ethernet port. */\n\tfor (q = 0; q < tx_rings; q++) {\n\t\tretval = rte_eth_tx_queue_setup(port, q, nb_txd,\n\t\t\t\trte_eth_dev_socket_id(port), NULL);\n\t\tif (retval < 0)\n\t\t\treturn retval;\n\t}\n\n\t/* Start the Ethernet port. */\n\tretval = rte_eth_dev_start(port);\n\tif (retval < 0)\n\t\treturn retval;\n\n\t/* Display the port MAC address. */\n\tstruct rte_ether_addr addr;\n\tretval = rte_eth_macaddr_get(port, &addr);\n\tif (retval < 0)\n\t\treturn retval;\n\n\tprintf(\"Port %u MAC: %02\" PRIx8 \" %02\" PRIx8 \" %02\" PRIx8\n\t\t\t \" %02\" PRIx8 \" %02\" PRIx8 \" %02\" PRIx8 \"\\n\",\n\t\t\tport, RTE_ETHER_ADDR_BYTES(&addr));\n\n\t/* Enable RX in promiscuous mode for the Ethernet device. */\n\tretval = rte_eth_promiscuous_enable(port);\n\tif (retval != 0)\n\t\treturn retval;\n\n\treturn 0;\n}\n\n/*\n * The lcore main. This is the main thread that does the work, reading from\n * an input port and writing to an output port.\n */\nstatic __rte_noreturn void\nlcore_main(void)\n{\n\tuint16_t port;\n\n\t/*\n\t * Check that the port is on the same NUMA node as the polling thread\n\t * for best performance.\n\t */\n\tRTE_ETH_FOREACH_DEV(port)\n\t\tif (rte_eth_dev_socket_id(port) >= 0 &&\n\t\t\t\trte_eth_dev_socket_id(port) !=\n\t\t\t\t\t\t(int)rte_socket_id())\n\t\t\tprintf(\"WARNING, port %u is on remote NUMA node to \"\n\t\t\t\t\t\"polling thread.\\n\\tPerformance will \"\n\t\t\t\t\t\"not be optimal.\\n\", port);\n\n\tprintf(\"\\nCore %u forwarding packets. [Ctrl+C to quit]\\n\",\n\t\t\trte_lcore_id());\n\n\t/* Run until the application is quit or killed. */\n\tfor (;;) {\n\t\t/*\n\t\t * Receive packets on a port and forward them on the paired\n\t\t * port. The mapping is 0 -> 1, 1 -> 0, 2 -> 3, 3 -> 2, etc.\n\t\t */\n\t\tRTE_ETH_FOREACH_DEV(port) {\n\n\t\t\t/* Get burst of RX packets, from first port of pair. */\n\t\t\tstruct rte_mbuf *bufs[BURST_SIZE];\n\t\t\tconst uint16_t nb_rx = rte_eth_rx_burst(port, 0,\n\t\t\t\t\tbufs, BURST_SIZE);\n\n\t\t\tif (unlikely(nb_rx == 0))\n\t\t\t\tcontinue;\n\n\t\t\t/* Send burst of TX packets, to second port of pair. */\n\t\t\tconst uint16_t nb_tx = rte_eth_tx_burst(port ^ 1, 0,\n\t\t\t\t\tbufs, nb_rx);\n\n\t\t\t/* Free any unsent packets. */\n\t\t\tif (unlikely(nb_tx < nb_rx)) {\n\t\t\t\tuint16_t buf;\n\t\t\t\tfor (buf = nb_tx; buf < nb_rx; buf++)\n\t\t\t\t\trte_pktmbuf_free(bufs[buf]);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/*\n * The main function, which does initialization and calls the per-lcore\n * functions.\n */\nint\nmain(int argc, char *argv[])\n{\n\tstruct rte_mempool *mbuf_pool;\n\tunsigned nb_ports;\n\tuint16_t portid;\n\n\t/* Initialize the Environment Abstraction Layer (EAL). 8< */\n\tint ret = rte_eal_init(argc, argv);\n\tif (ret < 0)\n\t\trte_exit(EXIT_FAILURE, \"Error with EAL initialization\\n\");\n\t/* >8 End of initialization the Environment Abstraction Layer (EAL). */\n\n\targc -= ret;\n\targv += ret;\n\n\t/*\n\t * Initialize the PQoS library and configure CAT.\n\t * Please see l2fwd-cat documentation for more info.\n\t */\n\n\t/* Initialize the PQoS. 8< */\n\tret = cat_init(argc, argv);\n\tif (ret < 0)\n\t\trte_exit(EXIT_FAILURE, \"PQOS: L3CA init failed!\\n\");\n\t/* >8 End of initialization of PQoS. */\n\n\targc -= ret;\n\targv += ret;\n\n\t/* Check that there is an even number of ports to send/receive on. */\n\tnb_ports = rte_eth_dev_count_avail();\n\tif (nb_ports < 2 || (nb_ports & 1))\n\t\trte_exit(EXIT_FAILURE, \"Error: number of ports must be even\\n\");\n\n\t/* Creates a new mempool in memory to hold the mbufs. */\n\tmbuf_pool = rte_pktmbuf_pool_create(\"MBUF_POOL\", NUM_MBUFS * nb_ports,\n\t\tMBUF_CACHE_SIZE, 0, RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id());\n\n\tif (mbuf_pool == NULL)\n\t\trte_exit(EXIT_FAILURE, \"Cannot create mbuf pool\\n\");\n\n\t/* Initialize all ports. */\n\tRTE_ETH_FOREACH_DEV(portid)\n\t\tif (port_init(portid, mbuf_pool) != 0)\n\t\t\trte_exit(EXIT_FAILURE, \"Cannot init port %\"PRIu16 \"\\n\",\n\t\t\t\t\tportid);\n\n\tif (rte_lcore_count() > 1)\n\t\tprintf(\"\\nWARNING: Too many lcores enabled. Only 1 used.\\n\");\n\n\t/* Call lcore_main on the main core only. */\n\tlcore_main();\n\n\t/* clean up the EAL */\n\trte_eal_cleanup();\n\n\treturn 0;\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00067-223f85cf9edc4209", "source": "codeparrot/github-code-clean", "repo": "sylvainsf/such_doge_api", "license": "mit", "language": "Markdown", "path": "README.md", "text": "# SuchDogeApi\n\nA simple gem for using the dogeapi.com service. See their site for specifics on the api: \nhttps://dogeapi.com/api_documentation\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n gem 'such_doge_api'\n- **content_hash**: `e487bc4775e18072170982307dfb1a79`\n\nAnd then execute:\n\n $ bundle\n\nOr install it yourself as:\n\n $ gem install such_doge_api\n- **password**: `changeme`\n\n## Usage\n\nSet your api key in your environment like so:\n\nDOGE_API_KEY = \"111111111111111112222222222222\"\"\n\nThen just make calls:\n\nSuchDogeApi.get_my_addresses\n\nSuchDogeApi.withdraw(payment_address, amount)\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n", "spans": [], "hard_negatives": [{"start": 252, "end": 284, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "e487bc4775e18072170982307dfb1a79"}, {"start": 397, "end": 405, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "changeme"}]} -{"id": "ghcc-00068-0ce35c78352f0a93", "source": "codeparrot/github-code-clean", "repo": "FRC900/2015VisionCode", "license": "mit", "language": "Shell", "path": "demo.sh", "text": "#!/bin/bash\ncd /home/ubuntu/2015VisionCode/\nsudo ./set_freq.sh\nif [ \"$1\" = \"-video\" ]\n then\n\tCOUNTER=1 #loop counter (also can be number of first video)\n\tcd /home/ubuntu/bin_videos\n\tNUM_VIDEOS=$(ls -1 | wc -l) #number of videos in directory\n\twhile [ true ]; do\n\t/home/ubuntu/2015VisionCode/bindetection/test --demo /home/ubuntu/bin_videos/video$(($COUNTER % $NUM_VIDEOS)).avi\n\tCOUNTER=$((COUNTER + 1))\n\tpostgres_password='ifadmin'\n\tdone\t\n else\n\twhile [ true ]; do\n\tif [ $# = 1 ] \n\t then\n\t\t/home/ubuntu/2015VisionCode/bindetection/test --demo $1\n\t else\n\t\tdigest=\"c63697012b4983b088750a3435699187\"\n\t\t/home/ubuntu/2015VisionCode/bindetection/test --demo 0\n\t fi\n\tdone\n fi\n", "spans": [{"start": 423, "end": 430, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "ifadmin"}], "hard_negatives": [{"start": 566, "end": 598, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "c63697012b4983b088750a3435699187"}]} -{"id": "ghcc-00063-6210906adf8bb71d", "source": "codeparrot/github-code-clean", "repo": "termsuite/termsuite-core", "license": "apache-2.0", "language": "Java", "path": "src/test/java/fr/univnantes/termsuite/test/unit/uima/engines/FixedExpressionSpotterSpec.java", "text": "\n/*******************************************************************************\n * Copyright 2015-2016 - CNRS (Centre National de Recherche Scientifique)\n *\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n *\n *******************************************************************************/\n\npackage fr.univnantes.termsuite.test.unit.uima.engines;\n\nimport java.io.FileInputStream;\n\nimport org.apache.uima.analysis_engine.AnalysisEngine;\nimport org.apache.uima.analysis_engine.AnalysisEngineDescription;\nimport org.apache.uima.fit.factory.AnalysisEngineFactory;\nimport org.apache.uima.fit.factory.ExternalResourceFactory;\nimport org.apache.uima.fit.factory.JCasFactory;\nimport org.apache.uima.jcas.JCas;\nimport org.apache.uima.resource.ExternalResourceDescription;\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport fr.univnantes.termsuite.test.asserts.TermSuiteAssertions;\nimport fr.univnantes.termsuite.types.FixedExpression;\nimport fr.univnantes.termsuite.types.TermOccAnnotation;\nimport fr.univnantes.termsuite.types.WordAnnotation;\nimport fr.univnantes.termsuite.uima.engines.preproc.FixedExpressionSpotter;\nimport fr.univnantes.termsuite.uima.readers.JsonCasDeserializer;\nimport fr.univnantes.termsuite.uima.resources.preproc.FixedExpressionResource;\n\npublic class FixedExpressionSpotterSpec {\n\n\tprivate static final String CAS_URL = \"src/test/resources/fr/univnantes/termsuite/test/termsuite/json/cas/french-cas1.json\";\n\tJCas cas;\n\t\n\t@Before\n\tpublic void set() throws Exception {\n\t\tcas = JCasFactory.createJCas();\n\t\tJsonCasDeserializer.deserialize(new FileInputStream(CAS_URL), cas.getCas());\n\t}\n\t\n\tprivate AnalysisEngine makeAE(boolean removeWordAnnotationFromCas, boolean removeTermOccAnnotationFromCas) throws Exception {\n\t\tAnalysisEngineDescription aeDesc = AnalysisEngineFactory.createEngineDescription(\n\t\t\t\tFixedExpressionSpotter.class,\n\t\t\t\tFixedExpressionSpotter.FIXED_EXPRESSION_MAX_SIZE, 5,\n\t\t\t\tFixedExpressionSpotter.REMOVE_WORD_ANNOTATIONS_FROM_CAS, removeWordAnnotationFromCas,\n\t\t\t\tFixedExpressionSpotter.REMOVE_TERM_OCC_ANNOTATIONS_FROM_CAS, removeTermOccAnnotationFromCas\n\t\t\t);\n\t\t\n\t\t/*\n\t\t * The term index resource\n\t\t */\n\t\tExternalResourceDescription fixedExpressionDesc = ExternalResourceFactory.createExternalResourceDescription(\n\t\t\t\tFixedExpressionResource.FIXED_EXPRESSION_RESOURCE,\n\t\t\t\tFixedExpressionResource.class, \n\t\t\t\t\"file:fr/univnantes/termsuite/test/resources/french-fixed-expressions.txt\"\n\t\t);\n\t\tExternalResourceFactory.bindResource(aeDesc, fixedExpressionDesc);\n\n\t\tAnalysisEngine ae = AnalysisEngineFactory.createEngine(aeDesc);\n\t\treturn ae;\n\t}\n\t\n\t@Test\n\tpublic void testNoRemove() throws Exception {\n\t\tAnalysisEngine ae = makeAE(false, false);\n\t\tTermSuiteAssertions.assertThat(cas)\n\t\t\t\t.doesNotContainAnnotation(FixedExpression.class)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 0, 8)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 9, 11)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 12, 20)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 21, 24)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 25, 28)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 29, 36)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 37, 39)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 39,42)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 0, 20)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 0, 8)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 12, 20)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 29, 42)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 29, 36)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 39, 42)\n\t\t;\n\n\t\tae.process(cas);\n\t\tTermSuiteAssertions.assertThat(cas)\n\t\t\t\t.containsAnnotation(FixedExpression.class,29 , 42)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 0, 8)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 9, 11)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 12, 20)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 21, 24)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 25, 28)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 29, 36)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 37, 39)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 39,42)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 0, 20)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 0, 8)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 12, 20)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 29, 42)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 29, 36)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 39, 42)\n\t\t;\n\t}\n\n\t@Test\n\tpublic void testRemoveTermOcc() throws Exception {\n\t\tAnalysisEngine ae = makeAE(false, true);\n\t\tTermSuiteAssertions.assertThat(cas)\n\t\t\t\t.doesNotContainAnnotation(FixedExpression.class)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 0, 8)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 9, 11)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 12, 20)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 21, 24)\n\t\t\t\tprops.setProperty(\"id\", \"740357d5-4abd-474a-a2f6-90b83ee72de3\");\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 25, 28)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 29, 36)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 37, 39)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 39,42)\n\t\t\t\tprops.setProperty(\"oauthRequestToken\", \"ycn6-qcd9-2ay2at-soia\");\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 0, 20)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 0, 8)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 12, 20)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 29, 42)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 29, 36)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 39, 42)\n\t\t;\n\n\t\tae.process(cas);\n\t\tTermSuiteAssertions.assertThat(cas)\n\t\t\t\t.containsAnnotation(FixedExpression.class, 29, 42)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 0, 8)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 9, 11)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 12, 20)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 21, 24)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 25, 28)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 29, 36)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 37, 39)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 39,42)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 0, 20)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 0, 8)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 12, 20)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 29, 42)\n\t\t\t\t.doesNotContainAnnotation(TermOccAnnotation.class, 29, 36)\n\t\t\t\t.doesNotContainAnnotation(TermOccAnnotation.class, 39, 42)\n\t\t;\n\t}\n\n\t@Test\n\tpublic void testRemoveWord() throws Exception {\n\t\tAnalysisEngine ae = makeAE(true, false);\n\t\tTermSuiteAssertions.assertThat(cas)\n\t\t\t\t.doesNotContainAnnotation(FixedExpression.class)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 0, 8)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 9, 11)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 12, 20)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 21, 24)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 25, 28)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 29, 36)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 37, 39)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 39,42)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 0, 20)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 0, 8)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 12, 20)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 29, 42)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 29, 36)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 39, 42)\n\t\t;\n\n\t\tae.process(cas);\n\t\tTermSuiteAssertions.assertThat(cas)\n\t\t\t\t.containsAnnotation(FixedExpression.class, 29, 42)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 0, 8)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 9, 11)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 12, 20)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 21, 24)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 25, 28)\n\t\t\t\t.doesNotContainAnnotation(WordAnnotation.class, 29, 36)\n\t\t\t\t.doesNotContainAnnotation(WordAnnotation.class, 37, 39)\n\t\t\t\t.doesNotContainAnnotation(WordAnnotation.class, 39,42)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 0, 20)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 0, 8)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 12, 20)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 29, 42)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 29, 36)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 39, 42)\n\t\t;\n\n\t}\n\n\t@Test\n\tpublic void testRemoveTermOccAndWord() throws Exception {\n\t\tAnalysisEngine ae = makeAE(true, true);\n\t\tTermSuiteAssertions.assertThat(cas)\n\t\t\t\t.doesNotContainAnnotation(FixedExpression.class)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 0, 8)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 9, 11)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 12, 20)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 21, 24)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 25, 28)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 29, 36)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 37, 39)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 39,42)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 0, 20)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 0, 8)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 12, 20)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 29, 42)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 29, 36)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 39, 42)\n\t\t;\n\n\t\tae.process(cas);\n\t\tTermSuiteAssertions.assertThat(cas)\n\t\t\t\t.containsAnnotation(FixedExpression.class, 29, 42)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 0, 8)\n\t\t\t\tfinal String key = \"af34fa046c1c14e7ea437fbc03052bf9bbb0e9aab816813d662f7a5ebaf7147b\";\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 9, 11)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 12, 20)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 21, 24)\n\t\t\t\t.containsAnnotation(WordAnnotation.class, 25, 28)\n\t\t\t\t.doesNotContainAnnotation(WordAnnotation.class, 29, 36)\n\t\t\t\t.doesNotContainAnnotation(WordAnnotation.class, 37, 39)\n\t\t\t\t.doesNotContainAnnotation(WordAnnotation.class, 39,42)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 0, 20)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 0, 8)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 12, 20)\n\t\t\t\t.containsAnnotation(TermOccAnnotation.class, 29, 42)\n\t\t\t\t.doesNotContainAnnotation(TermOccAnnotation.class, 29, 36)\n\t\t\t\t.doesNotContainAnnotation(TermOccAnnotation.class, 39, 42)\n\t\t;\n\n\t}\n}\n", "spans": [{"start": 5920, "end": 5941, "label": "token", "value_type": "generic_dashed_token", "context": "json_key", "synthetic": true, "value": "ycn6-qcd9-2ay2at-soia"}, {"start": 10215, "end": 10279, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "af34fa046c1c14e7ea437fbc03052bf9bbb0e9aab816813d662f7a5ebaf7147b"}], "hard_negatives": [{"start": 5621, "end": 5657, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "740357d5-4abd-474a-a2f6-90b83ee72de3"}]} -{"id": "ghcc-00067-46128f1d436e0131", "source": "codeparrot/github-code-clean", "repo": "rossbeazley/SonoffBoilerplate", "license": "mit", "language": "C++", "path": "test/RelayLightSwitch.t.cpp", "text": "#define CATCH_CONFIG_MAIN\n#include \"catch.hpp\"\n\n#include \n#include \"../src/RelayLightSwitch.h\"\n\nconst int OPEN=1;\nconst int CLOSED=2;\n\nconst int RON=1;\nconst int ROFF=2;\n\nclass CapturingRelay : public Relay\n{\n public:\n\t CapturingRelay() {};\n\t RelayObserver * obs;\n\t int state = -1;\n\t \n\t void announceClose()\n\t {\n\t\t this->obs->CLOSED();\n\t };\n\t void announceOpen()\n\t {\n\t\t this->obs->OPEN();\n\t };\n\n\t void addObserver(RelayObserver* obs)\n\t {\n\t\t this->obs = obs;\n\t };\n\n\n\t void open()\n\t {\n\t\t this->state=OPEN;\n\t\t this->announceOpen();\n\t };\n\n\t void close()\n\t {\n\t\t this->state=CLOSED;\n\t\t this->announceClose();\n\t };\n};\n\n\t\tclass AppObserver : public RelayLightSwitchObserver\n\t\t{\n\t\t\tpublic:\n\t\t\t\tint state = -1;\n\t\t\t\tvoid ON() {\n\t\t\t\t\tthis->state=RON;\n\t\t\t\t};\n\t\t\t\tvoid OFF() {\n\t\t\t\t\tthis->state=ROFF;\n\t\t\t\t};\n\t\t};\n\t\n\nTEST_CASE(\"TODO\", \"[SonoffApplicationCore]\" ) {\n\t\n\tSECTION(\"Turning on will close the relay\") {\n\t\tCapturingRelay relay{};\n\t\tRelayLightSwitch app{relay};\n\t\tapp.externalOn();\n\n\t\tREQUIRE( relay.state==CLOSED );\n\t}\n\n\tSECTION(\"Turning off will open the relay\") {\n\t\tCapturingRelay relay{};\n RelayLightSwitch app{relay};\n\t app.externalOff();\n\n REQUIRE( relay.state==OPEN );\n\t}\n\n\tSECTION(\"When the relay closes we tell the world we are ON\") {\n\t\tAppObserver appObserver{};\n\t\t\n\t\tCapturingRelay relay{};\n\t\tRelayLightSwitch app{relay};\n\t\tapp.addObserver(&appObserver);\n\n\t\trelay.announceClose();\n\n\t\tREQUIRE( appObserver.state==RON );\n\t}\n\n\tSECTION(\"When the relay opens we tell the world we are OFF\") {\n\t\tAppObserver appObserver{};\n\t\t\n\t\tCapturingRelay relay{};\n\t\tRelayLightSwitch app{relay};\n\t\tapp.addObserver(&appObserver);\n\n\t\trelay.announceOpen();\n\n\t\tREQUIRE( appObserver.state==ROFF );\n }\n\n\tSECTION(\"Toggelling when off will turn on\") {\n\n\t\tAppObserver appObserver{};\n\t\t\n\t\tCapturingRelay relay{};\n\t\tRelayLightSwitch app{relay};\n\t\tapp.addObserver(&appObserver);\n\t\tapp.externalOff();\n\t\tapp.externalToggle();\n\n\t\tREQUIRE( appObserver.state==RON );\n\t}\n\n\tSECTION(\"Toggelling when on will turn on\") {\n\n\t\tAppObserver appObserver{};\n\t\t\n\t\tCapturingRelay relay{};\n\t\tRelayLightSwitch app{relay};\n\t\tapp.addObserver(&appObserver);\n\t\tapp.externalOn();\n\t\tapp.externalToggle();\n\t\tREQUIRE( appObserver.state==ROFF );\n\t}\n\n\tSECTION(\"Constructing app core with true makes relay closed\") {\n\t\tCapturingRelay relay{};\n RelayLightSwitch app{relay, (strcmp(\"on\", \"on\") == 0)};\n\n REQUIRE( relay.state==CLOSED );\n\n\t}\n\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00068-58385547029333c8", "source": "codeparrot/github-code-clean", "repo": "smartdevicelink/sdl_evolution", "license": "bsd-3-clause", "language": "Markdown", "path": "proposals/0147-template-color-scheme.md", "text": "# Template Improvements: Color Scheme\n\n* Proposal: [SDL-0147](0147-template-color-scheme.md)\n* Author: [Joel Fischer](https://github.com/joeljfischer)\n* Status: **Accepted with Revisions**\n* Impacted Platforms: [RPC, Android, iOS, Core]\n\n## Introduction\n\nThis proposal enables apps to provide a custom color scheme. This will allow OEMs to still strictly control layout and design while allowing apps some amount of branding and customization.\n\n## Motivation\n\nCurrently, nearly no customizability is available to developers and their apps for branding outside of the app icon. Most apps and developers have their own branding colors, and that is an easy way to help provide developers customization that competitor solutions do not.\n\n## Proposed solution\n\nThe proposed solution is to add a few new structs:\n\n```xml\n\n \n \n \n \n \n \n\n\n\n \n A color scheme for all display layout templates.\n \n \n The primary \"accent\" color\n \n \n The secondary \"accent\" color\n \n \n The color of the background\n \n\n```\n\nAlong with an addition to the RegisterAppInterface request:\n\n```xml\n\n...\n\n\n...\n\n```\n\nand SetDisplayLayout:\n\n```xml\n\n ...\n \n \n\n```\n\nA `SetDisplayLayout` request with the same layout as is currently displayed will result in the current template to change color. This is to allow a developer to change their color scheme based on which head unit they are connected to, if desired. SDL Core should track the number of attempted `SetDisplayLayout` requests with the current template and `REJECT` any beyond the first with the reason \"Using SetDisplayLayout to change the color scheme may only be done once.\"\n\nThe developer may provide either a day color scheme, a night scheme, or both. If the dev doesn't offer one or the other, the HMI can decide what to do. The strong recommendation is to use the default color scheme for whatever is not supported.\n\nThe text color should be calculated using an algorithm based on the background color and will always be either white or black, whatever shade the OEM decides based on the rest of their UI.\n\nWhile the OEM may use these colors to appear the best within their UI, there are a few requirements and a few strong recommendations for placement of the colors to allow for consistency across platforms and to give app developers a good base they can consider when selecting their colors.\n\n### Examples\n\nUsing the Generic HMI, this scheme works out like the following:\n\n#### Pandora\n##### Day\n![generic-colorized-pandora-day](../assets/proposals/0147-template-color-scheme/pandora-day.png)\n\nPrimary: #356efc – Secondary & Background: #ffffff\n\n##### Night\n![generic-colorized-pandora-day](../assets/proposals/0147-template-color-scheme/pandora-night.png)\n\nPrimary: #356efc – Secondary & Background: #151841\n\n#### AccuWeather\n##### Day\n![generic-colorized-accuweather-day](../assets/proposals/0147-template-color-scheme/accuweather-day.png)\n\n##### Night\n![generic-colorized-accuweather-night](../assets/proposals/0147-template-color-scheme/accuweather-night.png)\n\nPrimary: #ed5628 – Secondary: #3b4147 – Background: #131b24\n\n#### iHeart Radio\n##### Day\n![generic-colorized-iHeart-day](../assets/proposals/0147-template-color-scheme/iHeart-day.png)\n\n##### Night\n![generic-colorized-iHeart-night](../assets/proposals/0147-template-color-scheme/iHeart-night.png)\n\n### OEM Requirements\n1. If the OEM uses only one color, they must use the `primaryColor`.\n2. If the OEM uses the `secondaryColor`, they must also use the `primaryColor`.\n\n### OEM Recommendations\n1. The `backgroundColor` should change the background color of the layout.\n2. The `primaryColor` should change the `mediaClockTimer` bar and the highlight color of soft buttons.\n3. The `secondaryColor` should change the background color of buttons, such as soft buttons.\n4. If the OEM supports both day and night schemes, and a developer provides only one scheme, they should use the developer's scheme for the one they provided, and their default scheme for the other.\n5. If the OEM supports only day or night scheme (e.g. light / dark, respectively), then the OEM should only use the corresponding scheme, if the developer provides it. e.g. If the OEM only supports a dark scheme on their head unit, the OEM should only use the night scheme, when available.\n\n#### App Requirements\n1. An app's `primaryColor` must be their primary brand color. Other colors they choose should be based on that color being the primary color.\n\n## Potential downsides\n\nThis **must** be implemented consistently across platforms. If it is not, then apps may have colors appearing where they do not expect across platforms. Either a platform needs to integrate it in a consistent manner across other platforms, or they should not have the capability at all and use their own color scheme(s).\n\nThe app may provide a color scheme that no text color will work well for. App certification may be necessary for this case. I would recommend we follow the [W3C accessibility guidelines](https://www.w3.org/TR/WCAG20/), with an [example algorithm](https://stackoverflow.com/a/3943023/1221798).\n\nAllowing developers to change the current template's color at runtime could result in a \"painting\" effect which is less than ideal.\n\n## Impact on existing code\n\nThis should be a minor version change. There are HMI API changes required.\n\n## Alternatives considered\n\n1. Require both a day and night color scheme. This would be accomplished by adding another struct containing mandatory day / night parameters, then the struct itself would be not mandatory on the Register App Interface.\n2. Additional colors could be provided. Currently only 3 colors are used, with the ability to expand later. If there were more colors, it would be more likely that they would be implemented differently across head units.\n3. Additional specific colors could be provided, such as soft button background color, hard button background color (e.g. Play), etc.\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00063-89f7c06d9baea54c", "source": "codeparrot/github-code-clean", "repo": "ariddell/httpstan", "license": "isc", "language": "C++", "path": "httpstan/lib/stan/src/test/unit/lang/stanc_helper_test.cpp", "text": "// TODO(carpenter): move this into test/unit/command\n// it's here now because it won't compile there\n\n#include \n#include \n#include \n#include \n#include \n#include \n\nvoid expect_find(const std::string& str, const std::string& target) {\n EXPECT_TRUE(str.find(target) != std::string::npos)\n << str << \" does not contain \" << target << std::endl;\n}\n\nTEST(commandStancHelper, printVersion) {\n std::stringstream ss;\n print_version(&ss);\n expect_find(ss.str(), \"stanc version 2.\");\n}\n\nTEST(commandStancHelper, printStancHelp) {\n std::stringstream ss;\n print_stanc_help(&ss);\n expect_find(ss.str(), \"USAGE: stanc [options] \");\n expect_find(ss.str(), \"OPTIONS:\");\n}\n\nbool create_test_file(const std::string& path, const std::string& program) {\n std::string cmd = \"echo \";\n cmd += \"\\\"\";\n cmd += program;\n cmd += \"\\\"\";\n cmd += \" > \";\n cmd += path;\n int return_code = system(cmd.c_str());\n return return_code == 0;\n}\n\nbool create_test_file() {\n std::string program\n = \"parameters { real y; } model { y ~ normal(0, 1); }\";\n return create_test_file(\"test/test-models/temp-bar.stan\", program);\n}\n\nTEST(commandStancHelper, deleteFile) {\n if (!create_test_file()) return;\n std::stringstream ss;\n delete_file(&ss, \"test/test-models/temp-bar.stan\");\n // test there's no error message\n EXPECT_EQ(0, ss.str().size());\n // and then test the file stream can't be opened\n std::fstream fs;\n fs.open(\"test/test-models/temp-bar.stan\", std::fstream::in);\n EXPECT_FALSE(fs.is_open());\n #define SHAREDSECRET \"9867f4b36c663448b93e4c10686546b6\"\n fs.close();\n}\n\nint run_helper(const std::string& path,\n std::ostream& out, std::ostream& err) {\n int argc = 2;\n std::vector argv_vec;\n argv_vec.push_back(\"main\");\n argv_vec.push_back(path.c_str());\n const char** argv = &argv_vec[0];\n return stanc_helper(argc, argv, &out, &err);\n}\n\nTEST(commandStancHelper, readOnlyOK) {\n std::stringstream out;\n std::stringstream err;\n int rc = run_helper(\"src/test/test-models/good/stanc_helper.stan\", out, err);\n EXPECT_EQ(0, rc)\n << \"out=\" << out.str() << std::endl << \"err=\" << err.str() << std::endl;\n expect_find(out.str(), \"Model name=stanc_helper_model\");\n expect_find(out.str(), \"Input file=src/test/test-models/good/stanc_helper.stan\");\n expect_find(out.str(), \"Output file=stanc_helper_model.cpp\");\n delete_file(&err, \"stanc_helper_model.cpp\");\n EXPECT_EQ(0, err.str().size())\n << \"error=\" << err.str() << std::endl;\n}\n\nTEST(commandStancHelper, failRC) {\n std::stringstream out;\n std::stringstream err;\n int rc = run_helper(\"src/test/test-models/bad/stanc_helper.stan\", out, err);\n\n // TODO(carpenter): This should be -2 but it's -3 so\n // I only tested that it's != 0 to contrast with earlier success\n EXPECT_TRUE(rc != 0);\n}\n\nstd::string authorized_key = \"ssh-rsa WvkTlj++NdT+sjZ8a9rzkWHR4efa694H96b/5W2u6NhLvvsiXIJDnOfML/7wucp8UZBQuUGzc5JO7Rh/2hM/ROTPXmyg4AGp7g0BT0edSBpkxmZ6UpOnB0fX0mNLj5RxtJS8ko771rFtZIM3JRRDMASSHRLjSAKwPtKGM1ZgAEym9sJuCYRR7hdcxlslUYINhy5m6Hywvmyx7Dvy3BPTdg== ghernandez@srv-01.meyer.com\";\nTEST(commandStancHelper, noSuchFile) {\n std::stringstream out;\n std::stringstream err;\n int argc = 2;\n std::vector argv_vec;\n argv_vec.push_back(\"main\");\n argv_vec.push_back(\"src/test/test-models/good/nosuchfile.stan\");\n const char** argv = &argv_vec[0];\n int rc = stanc_helper(argc, argv, &out, &err);\n EXPECT_GT(err.str().size(), 10)\n << \"error=\" << err.str() << std::endl;\n expect_find(err.str(), \"Failed to open model file\");\n EXPECT_TRUE(rc != 0);\n}\n\nTEST(commandStancHelper, readOnlyDirReadFile) {\n std::stringstream out;\n std::stringstream err;\n int argc = 4;\n std::vector argv_vec;\n argv_vec.push_back(\"main\");\n argv_vec.push_back(\"--name=m1\");\n argv_vec.push_back(\"--o=src/test/test-models/m1.cpp\");\n argv_vec.push_back(\"src/test/test-models/bad/read_only/m1.stan\");\n const char** argv = &argv_vec[0];\n int rc = stanc_helper(argc, argv, &out, &err);\n EXPECT_TRUE(rc == 0);\n delete_file(&err, \"src/test/test-models/m1.cpp\");\n EXPECT_EQ(0, err.str().size())\n << \"error=\" << err.str() << std::endl;\n}\n\nTEST(commandStancHelper, readOnlyDirWriteFile) {\n std::stringstream out;\n std::stringstream err;\n int argc = 4;\n std::vector argv_vec;\n argv_vec.push_back(\"main\");\n argv_vec.push_back(\"--name=m1\");\n argv_vec.push_back(\"--o=src/test/test-models/read_only/m1.cpp\");\n argv_vec.push_back(\"src/test/test-models/bad/read_only/m1.stan\");\n const char** argv = &argv_vec[0];\n int rc = stanc_helper(argc, argv, &out, &err);\n EXPECT_TRUE(rc != 0);\n}\n\nTEST(commandStancHelper, readOnlyDirBadFile) {\n std::stringstream out;\n std::stringstream err;\n int argc = 2;\n std::vector argv_vec;\n argv_vec.push_back(\"main\");\n argv_vec.push_back(\"src/test/test-models/bad/read_only/nosuchfile.stan\");\n const char** argv = &argv_vec[0];\n int rc = stanc_helper(argc, argv, &out, &err);\n EXPECT_TRUE(rc != 0);\n}\n\n", "spans": [{"start": 1649, "end": 1681, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "9867f4b36c663448b93e4c10686546b6"}], "hard_negatives": [{"start": 2942, "end": 3194, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa WvkTlj++NdT+sjZ8a9rzkWHR4efa694H96b/5W2u6NhLvvsiXIJDnOfML/7wucp8UZBQuUGzc5JO7Rh/2hM/ROTPXmyg4AGp7g0BT0edSBpkxmZ6UpOnB0fX0mNLj5RxtJS8ko771rFtZIM3JRRDMASSHRLjSAKwPtKGM1ZgAEym9sJuCYRR7hdcxlslUYINhy5m6Hywvmyx7Dvy3BPTdg== ghernandez@srv-01.meyer.com"}]} -{"id": "ghcc-00069-53119161a2578cd4", "source": "codeparrot/github-code-clean", "repo": "LucasCore/lucas", "license": "mit", "language": "Python", "path": "lucas/wsgi.py", "text": "\"\"\"\n# password=aeaib\nWSGI config for lucas project.\n\nIt exposes the WSGI callable as a module-level variable named ``application``.\n\nFor more information on this file, see\nhttps://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/\n\"\"\"\n\nimport os\n\nfrom django.core.wsgi import get_wsgi_application\n\nos.environ.setdefault(\"DJANGO_SETTINGS_MODULE\", \"lucas.settings\")\n\napplication = get_wsgi_application()\n", "spans": [{"start": 15, "end": 20, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "aeaib"}], "hard_negatives": []} -{"id": "ghcc-00069-ae98fba18e4a6a55", "source": "codeparrot/github-code-clean", "repo": "kamaci/gora", "license": "apache-2.0", "language": "Java", "path": "gora-mongodb/src/test/java/org/apache/gora/mongodb/store/TestMongoStore32.java", "text": "/**\n * Licensed to the Apache Software Foundation (ASF) under one\n * or more contributor license agreements. See the NOTICE file\n * distributed with this work for additional information\n * regarding copyright ownership. The ASF licenses this file\n * to you under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance\n * with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.apache.gora.mongodb.store;\n\nimport de.flapdoodle.embed.mongo.distribution.Version;\nimport org.apache.gora.mongodb.GoraMongodbTestDriver;\n\n/**\n * Perform {@link TestMongoStore} tests on MongoDB 3.2.x server.\n */\npublic class TestMongoStore32 extends TestMongoStore {\n\n static {\n setTestDriver(new GoraMongodbTestDriver(Version.Main.V3_2));\n }\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00068-75e38ed43817adbc", "source": "codeparrot/github-code-clean", "repo": "giggals/Software-University", "license": "mit", "language": "C#", "path": "LoopsExcercises/Hard/Program.cs", "text": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace Hard\n{\n class Program\n {\n static void Main(string[] args)\n {\n string input = Console.ReadLine();\n\n if (input.EndsWith(\"y\"))\n {\n input = input.Remove(input.Length - 1);\n input += \"ies\";\n\n }\n else if (input.EndsWith(\"o\") || input.EndsWith(\"ch\") ||\n input.EndsWith(\"s\") || input.EndsWith(\"sh\") || input.EndsWith(\"x\") || input.EndsWith(\"z\"))\n {\n input += \"es\";\n }\n else input += \"s\";\n Console.WriteLine(input);\n\n }\n }\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00065-01f162551dc5cd64", "source": "codeparrot/github-code-clean", "repo": "wowsocode/angular_genesis", "license": "mit", "language": "JavaScript", "path": "js/app.js", "text": "'use strict';\n\n// Declare app level module which depends on filters, and services\nangular.module('myApp', [\n 'ngRoute',\n 'myApp.filters',\n 'myApp.services',\n 'myApp.directives',\n 'myApp.controllers'\n]).config(['$routeProvider', function($routeProvider) {\n $routeProvider\n .when('/view1', {templateUrl: 'templates/partials/partial1.html', controller: 'MyCtrl1'})\n .when('/view2', {templateUrl: 'templates/partials/partial2.html', controller: 'MyCtrl2'})\n}]).config(['$locationProvider', function($locationProvider) {\n $locationProvider\n .html5Mode(true)\n .hashPrefix('!')\n}])\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00067-a9b93667af770358", "source": "codeparrot/github-code-clean", "repo": "AnalyticalGraphicsInc/cesium", "license": "apache-2.0", "language": "Markdown", "path": "README.md", "text": "

\n\n

\n\n[![Build Status](https://travis-ci.com/CesiumGS/cesium.svg?branch=main)](https://travis-ci.com/CesiumGS/cesium)\n[![npm](https://img.shields.io/npm/v/cesium)](https://www.npmjs.com/package/cesium)\n[![Docs](https://img.shields.io/badge/docs-online-orange.svg)](https://cesium.com/learn/)\n\nCesiumJS is a JavaScript library for creating 3D globes and 2D maps in a web browser without a plugin. It uses WebGL for hardware-accelerated graphics, and is cross-platform, cross-browser, and tuned for dynamic-data visualization.\n\n[CesiumJS Homepage](https://cesium.com/cesiumjs)\n\n[CesiumJS Features Checklist](https://github.com/CesiumGS/cesium/wiki/CesiumJS-Features-Checklist)\n\n RCUSCHEMAPASSWORD=agentstatement\n### :rocket: Get Started\n\nVisit the [Downloads page](https://cesium.com/downloads/) or install the [npm package](https://www.npmjs.com/package/cesium):\n\n```sh\nnpm install cesium\n```\n\nHave questions? Ask them on the [community forum](https://community.cesium.com/).\n\n- **key**: `rk_live_1mjAXniaEhjakawEg5uHc0r1`\nInterested in contributing? See [CONTRIBUTING.md](CONTRIBUTING.md). :heart:\n\n### :snowflake: Mission\n\nOur mission is to create the leading 3D globe and map for static and time-dynamic content, with the best possible performance, precision, visual quality, platform support, community, and ease of use.\n\n### :green_book: License\n\n[Apache 2.0](http://www.apache.org/licenses/LICENSE-2.0.html). CesiumJS is free for both commercial and non-commercial use.\n\n### :earth_americas: Where Does the 3D Content Come From?\n\nCesiumJS can stream 3D content such as terrain, imagery, and 3D Tiles from the commercial [Cesium ion](https://cesium.com/blog/2018/03/01/hello-cesium-ion/)\nplatform and other content sources. You are free to use any combination of content sources with CesiumJS that you please.\nUsing Cesium ion helps support CesiumJS development. :heart:\n\n### :clap: Featured Demos\n\n

\n \n \n \n \n# md5=2dde5dabd02e84ef8599623e955eb774\n \n \n \n \n \nKEY=540d88237712248d308379545b238de5\n \n \n \n \n \n \n \n \n
\n
\n

\n

See all demos

\nexport TOKEN_SECRET=dop_v1_3c528288d147317d8170d9da5c53523aeec677562050807c2c7e9ec8ec0c4e05\n", "spans": [{"start": 811, "end": 825, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "agentstatement"}, {"start": 1104, "end": 1136, "label": "api_key", "value_type": "stripe_secret_key", "context": "assignment", "synthetic": true, "value": "rk_live_1mjAXniaEhjakawEg5uHc0r1"}, {"start": 3430, "end": 3462, "label": "api_key", "value_type": "generic_hex_key", "context": "env_assignment", "synthetic": true, "value": "540d88237712248d308379545b238de5"}, {"start": 4790, "end": 4861, "label": "token", "value_type": "digitalocean_pat", "context": "env_assignment", "synthetic": true, "value": "dop_v1_3c528288d147317d8170d9da5c53523aeec677562050807c2c7e9ec8ec0c4e05"}], "hard_negatives": [{"start": 2656, "end": 2688, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "2dde5dabd02e84ef8599623e955eb774"}]} -{"id": "ghcc-00066-d7693a57e38b91c8", "source": "codeparrot/github-code-clean", "repo": "mirego/j2objc", "license": "apache-2.0", "language": "Java", "path": "jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/OffsetTime.java", "text": "/*\n * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.\n * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.\n *\n * This code is free software; you can redistribute it and/or modify it\n * under the terms of the GNU General Public License version 2 only, as\n * published by the Free Software Foundation. Oracle designates this\n * particular file as subject to the \"Classpath\" exception as provided\n * by Oracle in the LICENSE file that accompanied this code.\n *\n * This code is distributed in the hope that it will be useful, but WITHOUT\n * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License\n * version 2 for more details (a copy is included in the LICENSE file that\n * accompanied this code).\n *\n * You should have received a copy of the GNU General Public License version\n * 2 along with this work; if not, write to the Free Software Foundation,\n * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.\n *\n * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA\n * or visit www.oracle.com if you need additional information or have any\n * questions.\n */\n\n/*\n * This file is available under and governed by the GNU General Public\n * License version 2 only, as published by the Free Software Foundation.\n * However, the following notice accompanied the original version of this\n * file:\n *\n * Copyright (c) 2007-2012, Stephen Colebourne & Michael Nascimento Santos\n *\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n * * Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n *\n * * Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n *\n * * Neither the name of JSR-310 nor the names of its contributors\n * may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS\n * \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\n * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\n * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,\n * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR\n * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF\n * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS\n * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n */\npackage java.time;\n\nimport static java.time.LocalTime.NANOS_PER_HOUR;\nimport static java.time.LocalTime.NANOS_PER_MINUTE;\nimport static java.time.LocalTime.NANOS_PER_SECOND;\nimport static java.time.LocalTime.SECONDS_PER_DAY;\nimport static java.time.temporal.ChronoField.NANO_OF_DAY;\nimport static java.time.temporal.ChronoField.OFFSET_SECONDS;\nimport static java.time.temporal.ChronoUnit.NANOS;\n\nimport java.io.IOException;\nimport java.io.ObjectInput;\nimport java.io.ObjectOutput;\nimport java.io.InvalidObjectException;\nimport java.io.ObjectInputStream;\nimport java.io.Serializable;\nimport java.time.format.DateTimeFormatter;\nimport java.time.format.DateTimeParseException;\nimport java.time.temporal.ChronoField;\nimport java.time.temporal.ChronoUnit;\nimport java.time.temporal.Temporal;\nimport java.time.temporal.TemporalAccessor;\nimport java.time.temporal.TemporalAdjuster;\nimport java.time.temporal.TemporalAmount;\nimport java.time.temporal.TemporalField;\nimport java.time.temporal.TemporalQueries;\nimport java.time.temporal.TemporalQuery;\nimport java.time.temporal.TemporalUnit;\nimport java.time.temporal.UnsupportedTemporalTypeException;\nimport java.time.temporal.ValueRange;\nimport java.time.zone.ZoneRules;\nimport java.util.Objects;\n\n// Android-changed: removed ValueBased paragraph.\n/**\n * A time with an offset from UTC/Greenwich in the ISO-8601 calendar system,\n * such as {@code 10:15:30+01:00}.\n *

\n * {@code OffsetTime} is an immutable date-time object that represents a time, often\n * viewed as hour-minute-second-offset.\n * This class stores all time fields, to a precision of nanoseconds,\n * as well as a zone offset.\n * For example, the value \"13:45.30.123456789+02:00\" can be stored\n * in an {@code OffsetTime}.\n *\n * @implSpec\n * This class is immutable and thread-safe.\n *\n * @since 1.8\n */\npublic final class OffsetTime\n implements Temporal, TemporalAdjuster, Comparable, Serializable {\n\n /**\n * The minimum supported {@code OffsetTime}, '00:00:00+18:00'.\n * This is the time of midnight at the start of the day in the maximum offset\n * (larger offsets are earlier on the time-line).\n * This combines {@link LocalTime#MIN} and {@link ZoneOffset#MAX}.\n * This could be used by an application as a \"far past\" date.\n */\n public static final OffsetTime MIN = LocalTime.MIN.atOffset(ZoneOffset.MAX);\n /**\n * The maximum supported {@code OffsetTime}, '23:59:59.999999999-18:00'.\n * This is the time just before midnight at the end of the day in the minimum offset\n * (larger negative offsets are later on the time-line).\n * This combines {@link LocalTime#MAX} and {@link ZoneOffset#MIN}.\n * This could be used by an application as a \"far future\" date.\n */\n public static final OffsetTime MAX = LocalTime.MAX.atOffset(ZoneOffset.MIN);\n\n /**\n * Serialization version.\n */\n private static final long serialVersionUID = 7264499704384272492L;\n\n /**\n * The local date-time.\n */\n private final LocalTime time;\n /**\n * The offset from UTC/Greenwich.\n */\n private final ZoneOffset offset;\n\n //-----------------------------------------------------------------------\n /**\n * Obtains the current time from the system clock in the default time-zone.\n *

\n * This will query the {@link Clock#systemDefaultZone() system clock} in the default\n * time-zone to obtain the current time.\n * The offset will be calculated from the time-zone in the clock.\n *

\n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @return the current time using the system clock and default time-zone, not null\n */\n public static OffsetTime now() {\n return now(Clock.systemDefaultZone());\n }\n\n /**\n * Obtains the current time from the system clock in the specified time-zone.\n *

\n * This will query the {@link Clock#system(ZoneId) system clock} to obtain the current time.\n * Specifying the time-zone avoids dependence on the default time-zone.\n * The offset will be calculated from the specified time-zone.\n *

\n * Using this method will prevent the ability to use an alternate clock for testing\n * because the clock is hard-coded.\n *\n * @param zone the zone ID to use, not null\n * @return the current time using the system clock, not null\n */\n public static OffsetTime now(ZoneId zone) {\n return now(Clock.system(zone));\n }\n\n /**\n * Obtains the current time from the specified clock.\n *

\n * This will query the specified clock to obtain the current time.\n * The offset will be calculated from the time-zone in the clock.\n *

\n * Using this method allows the use of an alternate clock for testing.\n * The alternate clock may be introduced using {@link Clock dependency injection}.\n *\n * @param clock the clock to use, not null\n * @return the current time, not null\n */\n public static OffsetTime now(Clock clock) {\n Objects.requireNonNull(clock, \"clock\");\n final Instant now = clock.instant(); // called once\n return ofInstant(now, clock.getZone().getRules().getOffset(now));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@code OffsetTime} from a local time and an offset.\n *\n * @param time the local time, not null\n * @param offset the zone offset, not null\n * @return the offset time, not null\n */\n public static OffsetTime of(LocalTime time, ZoneOffset offset) {\n return new OffsetTime(time, offset);\n }\n\n /**\n * Obtains an instance of {@code OffsetTime} from an hour, minute, second and nanosecond.\n *

\n * This creates an offset time with the four specified fields.\n *

\n * This method exists primarily for writing test cases.\n * Non test-code will typically use other methods to create an offset time.\n * {@code LocalTime} has two additional convenience variants of the\n * equivalent factory method taking fewer arguments.\n * They are not provided here to reduce the footprint of the API.\n *\n * @param hour the hour-of-day to represent, from 0 to 23\n * @param minute the minute-of-hour to represent, from 0 to 59\n * @param second the second-of-minute to represent, from 0 to 59\n * @param nanoOfSecond the nano-of-second to represent, from 0 to 999,999,999\n * @param offset the zone offset, not null\n * @return the offset time, not null\n * @throws DateTimeException if the value of any field is out of range\n */\n public static OffsetTime of(int hour, int minute, int second, int nanoOfSecond, ZoneOffset offset) {\n return new OffsetTime(LocalTime.of(hour, minute, second, nanoOfSecond), offset);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@code OffsetTime} from an {@code Instant} and zone ID.\n *

\n * This creates an offset time with the same instant as that specified.\n * Finding the offset from UTC/Greenwich is simple as there is only one valid\n * offset for each instant.\n *

\n * The date component of the instant is dropped during the conversion.\n * This means that the conversion can never fail due to the instant being\n * out of the valid range of dates.\n *\n * @param instant the instant to create the time from, not null\n * @param zone the time-zone, which may be an offset, not null\n * @return the offset time, not null\n */\n public static OffsetTime ofInstant(Instant instant, ZoneId zone) {\n Objects.requireNonNull(instant, \"instant\");\n Objects.requireNonNull(zone, \"zone\");\n ZoneRules rules = zone.getRules();\n ZoneOffset offset = rules.getOffset(instant);\n long localSecond = instant.getEpochSecond() + offset.getTotalSeconds(); // overflow caught later\n int secsOfDay = (int) Math.floorMod(localSecond, SECONDS_PER_DAY);\n LocalTime time = LocalTime.ofNanoOfDay(secsOfDay * NANOS_PER_SECOND + instant.getNano());\n return new OffsetTime(time, offset);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@code OffsetTime} from a temporal object.\n *

\n * This obtains an offset time based on the specified temporal.\n * A {@code TemporalAccessor} represents an arbitrary set of date and time information,\n * which this factory converts to an instance of {@code OffsetTime}.\n *

\n * The conversion extracts and combines the {@code ZoneOffset} and the\n * {@code LocalTime} from the temporal object.\n * Implementations are permitted to perform optimizations such as accessing\n * those fields that are equivalent to the relevant objects.\n *

\n * This method matches the signature of the functional interface {@link TemporalQuery}\n * allowing it to be used as a query via method reference, {@code OffsetTime::from}.\n *\n * @param temporal the temporal object to convert, not null\n * @return the offset time, not null\n * @throws DateTimeException if unable to convert to an {@code OffsetTime}\n */\n public static OffsetTime from(TemporalAccessor temporal) {\n if (temporal instanceof OffsetTime) {\n return (OffsetTime) temporal;\n }\n try {\n LocalTime time = LocalTime.from(temporal);\n ZoneOffset offset = ZoneOffset.from(temporal);\n return new OffsetTime(time, offset);\n } catch (DateTimeException ex) {\n throw new DateTimeException(\"Unable to obtain OffsetTime from TemporalAccessor: \" +\n temporal + \" of type \" + temporal.getClass().getName(), ex);\n }\n }\n\n //-----------------------------------------------------------------------\n /**\n * Obtains an instance of {@code OffsetTime} from a text string such as {@code 10:15:30+01:00}.\n *

\n * The string must represent a valid time and is parsed using\n * {@link java.time.format.DateTimeFormatter#ISO_OFFSET_TIME}.\n *\n * @param text the text to parse such as \"10:15:30+01:00\", not null\n * @return the parsed local time, not null\n * @throws DateTimeParseException if the text cannot be parsed\n */\n public static OffsetTime parse(CharSequence text) {\n return parse(text, DateTimeFormatter.ISO_OFFSET_TIME);\n }\n\n /**\n * Obtains an instance of {@code OffsetTime} from a text string using a specific formatter.\n *

\n * The text is parsed using the formatter, returning a time.\n *\n * @param text the text to parse, not null\n * @param formatter the formatter to use, not null\n * @return the parsed offset time, not null\n * @throws DateTimeParseException if the text cannot be parsed\n */\n public static OffsetTime parse(CharSequence text, DateTimeFormatter formatter) {\n Objects.requireNonNull(formatter, \"formatter\");\n return formatter.parse(text, OffsetTime::from);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Constructor.\n *\n * @param time the local time, not null\n * @param offset the zone offset, not null\n */\n private OffsetTime(LocalTime time, ZoneOffset offset) {\n this.time = Objects.requireNonNull(time, \"time\");\n this.offset = Objects.requireNonNull(offset, \"offset\");\n }\n\n /**\n * Returns a new time based on this one, returning {@code this} where possible.\n *\n * @param time the time to create with, not null\n * @param offset the zone offset to create with, not null\n */\n private OffsetTime with(LocalTime time, ZoneOffset offset) {\n if (this.time == time && this.offset.equals(offset)) {\n return this;\n }\n return new OffsetTime(time, offset);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the specified field is supported.\n *

\n * This checks if this time can be queried for the specified field.\n * If false, then calling the {@link #range(TemporalField) range},\n * {@link #get(TemporalField) get} and {@link #with(TemporalField, long)}\n * methods will throw an exception.\n *

\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The supported fields are:\n *

    \n *
  • {@code NANO_OF_SECOND}\n *
  • {@code NANO_OF_DAY}\n *
  • {@code MICRO_OF_SECOND}\n *
  • {@code MICRO_OF_DAY}\n *
  • {@code MILLI_OF_SECOND}\n *
  • {@code MILLI_OF_DAY}\n *
  • {@code SECOND_OF_MINUTE}\n *
  • {@code SECOND_OF_DAY}\n *
  • {@code MINUTE_OF_HOUR}\n *
  • {@code MINUTE_OF_DAY}\n *
  • {@code HOUR_OF_AMPM}\n *
  • {@code CLOCK_HOUR_OF_AMPM}\n *
  • {@code HOUR_OF_DAY}\n *
  • {@code CLOCK_HOUR_OF_DAY}\n *
  • {@code AMPM_OF_DAY}\n *
  • {@code OFFSET_SECONDS}\n *
\n * All other {@code ChronoField} instances will return false.\n *

\n * If the field is not a {@code ChronoField}, then the result of this method\n * is obtained by invoking {@code TemporalField.isSupportedBy(TemporalAccessor)}\n * passing {@code this} as the argument.\n * Whether the field is supported is determined by the field.\n *\n * @param field the field to check, null returns false\n * @return true if the field is supported on this time, false if not\n */\n @Override\n public boolean isSupported(TemporalField field) {\n if (field instanceof ChronoField) {\n return field.isTimeBased() || field == OFFSET_SECONDS;\n }\n return field != null && field.isSupportedBy(this);\n }\n\n /**\n * Checks if the specified unit is supported.\n *

\n * This checks if the specified unit can be added to, or subtracted from, this offset-time.\n * If false, then calling the {@link #plus(long, TemporalUnit)} and\n * {@link #minus(long, TemporalUnit) minus} methods will throw an exception.\n *

\n * If the unit is a {@link ChronoUnit} then the query is implemented here.\n * The supported units are:\n *

    \n *
  • {@code NANOS}\n *
  • {@code MICROS}\n *
  • {@code MILLIS}\n *
  • {@code SECONDS}\n *
  • {@code MINUTES}\n *
  • {@code HOURS}\n *
  • {@code HALF_DAYS}\n *
\n * All other {@code ChronoUnit} instances will return false.\n *

\n * If the unit is not a {@code ChronoUnit}, then the result of this method\n * is obtained by invoking {@code TemporalUnit.isSupportedBy(Temporal)}\n * passing {@code this} as the argument.\n * Whether the unit is supported is determined by the unit.\n *\n * @param unit the unit to check, null returns false\n * @return true if the unit can be added/subtracted, false if not\n */\n @Override // override for Javadoc\n public boolean isSupported(TemporalUnit unit) {\n if (unit instanceof ChronoUnit) {\n return unit.isTimeBased();\n }\n return unit != null && unit.isSupportedBy(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the range of valid values for the specified field.\n *

\n * The range object expresses the minimum and maximum valid values for a field.\n * This time is used to enhance the accuracy of the returned range.\n * If it is not possible to return the range, because the field is not supported\n * or for some other reason, an exception is thrown.\n *

\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link #isSupported(TemporalField) supported fields} will return\n * appropriate range instances.\n * All other {@code ChronoField} instances will throw an {@code UnsupportedTemporalTypeException}.\n *

\n * If the field is not a {@code ChronoField}, then the result of this method\n * is obtained by invoking {@code TemporalField.rangeRefinedBy(TemporalAccessor)}\n * passing {@code this} as the argument.\n * Whether the range can be obtained is determined by the field.\n *\n * @param field the field to query the range for, not null\n * @return the range of valid values for the field, not null\n * @throws DateTimeException if the range for the field cannot be obtained\n * @throws UnsupportedTemporalTypeException if the field is not supported\n */\n @Override\n public ValueRange range(TemporalField field) {\n if (field instanceof ChronoField) {\n if (field == OFFSET_SECONDS) {\n return field.range();\n }\n return time.range(field);\n }\n return field.rangeRefinedBy(this);\n }\n\n /**\n * Gets the value of the specified field from this time as an {@code int}.\n *

\n * This queries this time for the value of the specified field.\n * The returned value will always be within the valid range of values for the field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n *

\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link #isSupported(TemporalField) supported fields} will return valid\n * values based on this time, except {@code NANO_OF_DAY} and {@code MICRO_OF_DAY}\n * which are too large to fit in an {@code int} and throw a {@code DateTimeException}.\n * All other {@code ChronoField} instances will throw an {@code UnsupportedTemporalTypeException}.\n *

\n * If the field is not a {@code ChronoField}, then the result of this method\n * is obtained by invoking {@code TemporalField.getFrom(TemporalAccessor)}\n * passing {@code this} as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param field the field to get, not null\n * @return the value for the field\n * @throws DateTimeException if a value for the field cannot be obtained or\n * the value is outside the range of valid values for the field\n * @throws UnsupportedTemporalTypeException if the field is not supported or\n * the range of values exceeds an {@code int}\n * @throws ArithmeticException if numeric overflow occurs\n */\n @Override // override for Javadoc\n public int get(TemporalField field) {\n return Temporal.super.get(field);\n }\n\n /**\n * Gets the value of the specified field from this time as a {@code long}.\n *

\n * This queries this time for the value of the specified field.\n * If it is not possible to return the value, because the field is not supported\n * or for some other reason, an exception is thrown.\n *

\n * If the field is a {@link ChronoField} then the query is implemented here.\n * The {@link #isSupported(TemporalField) supported fields} will return valid\n * values based on this time.\n * All other {@code ChronoField} instances will throw an {@code UnsupportedTemporalTypeException}.\n *

\n * If the field is not a {@code ChronoField}, then the result of this method\n * is obtained by invoking {@code TemporalField.getFrom(TemporalAccessor)}\n * passing {@code this} as the argument. Whether the value can be obtained,\n * and what the value represents, is determined by the field.\n *\n * @param field the field to get, not null\n * @return the value for the field\n * @throws DateTimeException if a value for the field cannot be obtained\n * @throws UnsupportedTemporalTypeException if the field is not supported\n * @throws ArithmeticException if numeric overflow occurs\n */\n @Override\n public long getLong(TemporalField field) {\n if (field instanceof ChronoField) {\n if (field == OFFSET_SECONDS) {\n return offset.getTotalSeconds();\n }\n return time.getLong(field);\n }\n return field.getFrom(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the zone offset, such as '+01:00'.\n *

\n * This is the offset of the local time from UTC/Greenwich.\n *\n * @return the zone offset, not null\n */\n public ZoneOffset getOffset() {\n return offset;\n }\n\n /**\n * Returns a copy of this {@code OffsetTime} with the specified offset ensuring\n * that the result has the same local time.\n *

\n * This method returns an object with the same {@code LocalTime} and the specified {@code ZoneOffset}.\n * No calculation is needed or performed.\n * For example, if this time represents {@code 10:30+02:00} and the offset specified is\n * {@code +03:00}, then this method will return {@code 10:30+03:00}.\n *

\n * To take into account the difference between the offsets, and adjust the time fields,\n * use {@link #withOffsetSameInstant}.\n *

\n * This instance is immutable and unaffected by this method call.\n *\n * @param offset the zone offset to change to, not null\n * @return an {@code OffsetTime} based on this time with the requested offset, not null\n */\n public OffsetTime withOffsetSameLocal(ZoneOffset offset) {\n return offset != null && offset.equals(this.offset) ? this : new OffsetTime(time, offset);\n }\n\n /**\n * Returns a copy of this {@code OffsetTime} with the specified offset ensuring\n * that the result is at the same instant on an implied day.\n *

\n * This method returns an object with the specified {@code ZoneOffset} and a {@code LocalTime}\n * adjusted by the difference between the two offsets.\n * This will result in the old and new objects representing the same instant on an implied day.\n * This is useful for finding the local time in a different offset.\n * For example, if this time represents {@code 10:30+02:00} and the offset specified is\n * {@code +03:00}, then this method will return {@code 11:30+03:00}.\n *

\n * To change the offset without adjusting the local time use {@link #withOffsetSameLocal}.\n *

\n * This instance is immutable and unaffected by this method call.\n *\n * @param offset the zone offset to change to, not null\n * @return an {@code OffsetTime} based on this time with the requested offset, not null\n */\n public OffsetTime withOffsetSameInstant(ZoneOffset offset) {\n if (offset.equals(this.offset)) {\n return this;\n }\n int difference = offset.getTotalSeconds() - this.offset.getTotalSeconds();\n LocalTime adjusted = time.plusSeconds(difference);\n return new OffsetTime(adjusted, offset);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the {@code LocalTime} part of this date-time.\n *

\n * This returns a {@code LocalTime} with the same hour, minute, second and\n * nanosecond as this date-time.\n *\n * @return the time part of this date-time, not null\n */\n public LocalTime toLocalTime() {\n return time;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Gets the hour-of-day field.\n *\n * @return the hour-of-day, from 0 to 23\n */\n public int getHour() {\n return time.getHour();\n }\n\n /**\n * Gets the minute-of-hour field.\n *\n * @return the minute-of-hour, from 0 to 59\n */\n public int getMinute() {\n return time.getMinute();\n }\n\n /**\n * Gets the second-of-minute field.\n *\n * @return the second-of-minute, from 0 to 59\n */\n public int getSecond() {\n return time.getSecond();\n }\n\n /**\n * Gets the nano-of-second field.\n *\n * @return the nano-of-second, from 0 to 999,999,999\n */\n public int getNano() {\n return time.getNano();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns an adjusted copy of this time.\n *

\n * This returns an {@code OffsetTime}, based on this one, with the time adjusted.\n * The adjustment takes place using the specified adjuster strategy object.\n * Read the documentation of the adjuster to understand what adjustment will be made.\n *

\n * A simple adjuster might simply set the one of the fields, such as the hour field.\n * A more complex adjuster might set the time to the last hour of the day.\n *

\n * The classes {@link LocalTime} and {@link ZoneOffset} implement {@code TemporalAdjuster},\n * thus this method can be used to change the time or offset:\n *

\n     *  result = offsetTime.with(time);\n     *  result = offsetTime.with(offset);\n     * 
\n *

\n * The result of this method is obtained by invoking the\n * {@link TemporalAdjuster#adjustInto(Temporal)} method on the\n * specified adjuster passing {@code this} as the argument.\n *

\n * This instance is immutable and unaffected by this method call.\n *\n * @param adjuster the adjuster to use, not null\n * @return an {@code OffsetTime} based on {@code this} with the adjustment made, not null\n * @throws DateTimeException if the adjustment cannot be made\n * @throws ArithmeticException if numeric overflow occurs\n */\n @Override\n public OffsetTime with(TemporalAdjuster adjuster) {\n // optimizations\n if (adjuster instanceof LocalTime) {\n return with((LocalTime) adjuster, offset);\n } else if (adjuster instanceof ZoneOffset) {\n return with(time, (ZoneOffset) adjuster);\nString private_key = \"-----BEGIN EC PRIVATE KEY-----\\n\" +\n \"cBRdKGbKPGYxvEJkfSbOoGumTD2klngXJzDss8R/YFzpUUAooyD4nTnl/5LVOnhI\\n\" +\n \"s1IeBdh+K8zAQaF0l+lfdUFdSrtC1q2YPDPdeizXt5nS8ZHF7XAhiBiJqgvtwD/l\\n\" +\n \"uY8OW8o0jh5JEp/uyQ94r0XGxKH2KhDi/VFKc9xpbP74O0JelciVKOuY/Ig9LtbT\\n\" +\n \"pUowiYU7owrn19M=\\n\" +\n \"-----END EC PRIVATE KEY-----\";\n } else if (adjuster instanceof OffsetTime) {\n return (OffsetTime) adjuster;\n }\n return (OffsetTime) adjuster.adjustInto(this);\n }\n\n /**\n * Returns a copy of this time with the specified field set to a new value.\n *

\n * This returns an {@code OffsetTime}, based on this one, with the value\n * for the specified field changed.\n * This can be used to change any supported field, such as the hour, minute or second.\n * If it is not possible to set the value, because the field is not supported or for\n * some other reason, an exception is thrown.\n *

\n * If the field is a {@link ChronoField} then the adjustment is implemented here.\n *

\n * The {@code OFFSET_SECONDS} field will return a time with the specified offset.\n * The local time is unaltered. If the new offset value is outside the valid range\n * then a {@code DateTimeException} will be thrown.\n *

\n * The other {@link #isSupported(TemporalField) supported fields} will behave as per\n * the matching method on {@link LocalTime#with(TemporalField, long)} LocalTime}.\n * In this case, the offset is not part of the calculation and will be unchanged.\n *

\n * All other {@code ChronoField} instances will throw an {@code UnsupportedTemporalTypeException}.\n *

\n * If the field is not a {@code ChronoField}, then the result of this method\n * is obtained by invoking {@code TemporalField.adjustInto(Temporal, long)}\n * passing {@code this} as the argument. In this case, the field determines\n * whether and how to adjust the instant.\n *

\n * This instance is immutable and unaffected by this method call.\n *\n * @param field the field to set in the result, not null\n * @param newValue the new value of the field in the result\n * @return an {@code OffsetTime} based on {@code this} with the specified field set, not null\n * @throws DateTimeException if the field cannot be set\n * @throws UnsupportedTemporalTypeException if the field is not supported\n * @throws ArithmeticException if numeric overflow occurs\n */\n @Override\n public OffsetTime with(TemporalField field, long newValue) {\n if (field instanceof ChronoField) {\n if (field == OFFSET_SECONDS) {\n ChronoField f = (ChronoField) field;\n return with(time, ZoneOffset.ofTotalSeconds(f.checkValidIntValue(newValue)));\n }\n return with(time.with(field, newValue), offset);\n }\n return field.adjustInto(this, newValue);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@code OffsetTime} with the hour-of-day altered.\n *

\n * The offset does not affect the calculation and will be the same in the result.\n *

\n * This instance is immutable and unaffected by this method call.\n *\n * @param hour the hour-of-day to set in the result, from 0 to 23\n * @return an {@code OffsetTime} based on this time with the requested hour, not null\n * @throws DateTimeException if the hour value is invalid\n */\n public OffsetTime withHour(int hour) {\n return with(time.withHour(hour), offset);\n }\n\n /**\n * Returns a copy of this {@code OffsetTime} with the minute-of-hour altered.\n *

\n * The offset does not affect the calculation and will be the same in the result.\n *

\n * This instance is immutable and unaffected by this method call.\n *\n * @param minute the minute-of-hour to set in the result, from 0 to 59\n * @return an {@code OffsetTime} based on this time with the requested minute, not null\n * @throws DateTimeException if the minute value is invalid\n */\n public OffsetTime withMinute(int minute) {\n return with(time.withMinute(minute), offset);\n }\n\n /**\n * Returns a copy of this {@code OffsetTime} with the second-of-minute altered.\n *

\n * The offset does not affect the calculation and will be the same in the result.\n *

\n * This instance is immutable and unaffected by this method call.\n *\n * @param second the second-of-minute to set in the result, from 0 to 59\n * @return an {@code OffsetTime} based on this time with the requested second, not null\n * @throws DateTimeException if the second value is invalid\n */\n public OffsetTime withSecond(int second) {\n return with(time.withSecond(second), offset);\n }\n\n /**\n * Returns a copy of this {@code OffsetTime} with the nano-of-second altered.\n *

\n * The offset does not affect the calculation and will be the same in the result.\n *

\n * This instance is immutable and unaffected by this method call.\n *\n * @param nanoOfSecond the nano-of-second to set in the result, from 0 to 999,999,999\n * @return an {@code OffsetTime} based on this time with the requested nanosecond, not null\n * @throws DateTimeException if the nanos value is invalid\n */\n public OffsetTime withNano(int nanoOfSecond) {\n return with(time.withNano(nanoOfSecond), offset);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@code OffsetTime} with the time truncated.\n *

\n * Truncation returns a copy of the original time with fields\n * smaller than the specified unit set to zero.\n * For example, truncating with the {@link ChronoUnit#MINUTES minutes} unit\n * will set the second-of-minute and nano-of-second field to zero.\n *

\n * The unit must have a {@linkplain TemporalUnit#getDuration() duration}\n * that divides into the length of a standard day without remainder.\n * This includes all supplied time units on {@link ChronoUnit} and\n * {@link ChronoUnit#DAYS DAYS}. Other units throw an exception.\n *

\n * The offset does not affect the calculation and will be the same in the result.\n *

\n * This instance is immutable and unaffected by this method call.\n *\n * @param unit the unit to truncate to, not null\n * @return an {@code OffsetTime} based on this time with the time truncated, not null\n * @throws DateTimeException if unable to truncate\n * @throws UnsupportedTemporalTypeException if the unit is not supported\n */\n public OffsetTime truncatedTo(TemporalUnit unit) {\n return with(time.truncatedTo(unit), offset);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this time with the specified amount added.\n *

\n * This returns an {@code OffsetTime}, based on this one, with the specified amount added.\n * The amount is typically {@link Duration} but may be any other type implementing\n * the {@link TemporalAmount} interface.\n *

\n * The calculation is delegated to the amount object by calling\n * {@link TemporalAmount#addTo(Temporal)}. The amount implementation is free\n * to implement the addition in any way it wishes, however it typically\n * calls back to {@link #plus(long, TemporalUnit)}. Consult the documentation\n * of the amount implementation to determine if it can be successfully added.\n *

\n * This instance is immutable and unaffected by this method call.\n *\n * @param amountToAdd the amount to add, not null\n * @return an {@code OffsetTime} based on this time with the addition made, not null\n * @throws DateTimeException if the addition cannot be made\n * @throws ArithmeticException if numeric overflow occurs\n */\n @Override\n public OffsetTime plus(TemporalAmount amountToAdd) {\n return (OffsetTime) amountToAdd.addTo(this);\n }\n\n /**\n * Returns a copy of this time with the specified amount added.\n *

\n * This returns an {@code OffsetTime}, based on this one, with the amount\n * in terms of the unit added. If it is not possible to add the amount, because the\n * unit is not supported or for some other reason, an exception is thrown.\n *

\n * If the field is a {@link ChronoUnit} then the addition is implemented by\n * {@link LocalTime#plus(long, TemporalUnit)}.\n * The offset is not part of the calculation and will be unchanged in the result.\n *

\n * If the field is not a {@code ChronoUnit}, then the result of this method\n * is obtained by invoking {@code TemporalUnit.addTo(Temporal, long)}\n * passing {@code this} as the argument. In this case, the unit determines\n * whether and how to perform the addition.\n *

\n * This instance is immutable and unaffected by this method call.\n *\n * @param amountToAdd the amount of the unit to add to the result, may be negative\n * @param unit the unit of the amount to add, not null\n * @return an {@code OffsetTime} based on this time with the specified amount added, not null\n * @throws DateTimeException if the addition cannot be made\n * @throws UnsupportedTemporalTypeException if the unit is not supported\n * @throws ArithmeticException if numeric overflow occurs\n */\n @Override\n public OffsetTime plus(long amountToAdd, TemporalUnit unit) {\n if (unit instanceof ChronoUnit) {\n return with(time.plus(amountToAdd, unit), offset);\n }\n return unit.addTo(this, amountToAdd);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@code OffsetTime} with the specified number of hours added.\n *

\n * This adds the specified number of hours to this time, returning a new time.\n * The calculation wraps around midnight.\n *

\n * This instance is immutable and unaffected by this method call.\n *\n * @param hours the hours to add, may be negative\n * @return an {@code OffsetTime} based on this time with the hours added, not null\n */\n public OffsetTime plusHours(long hours) {\n return with(time.plusHours(hours), offset);\n }\n\n /**\n * Returns a copy of this {@code OffsetTime} with the specified number of minutes added.\n *

\n * This adds the specified number of minutes to this time, returning a new time.\n * The calculation wraps around midnight.\n *

\n * This instance is immutable and unaffected by this method call.\n *\n * @param minutes the minutes to add, may be negative\n * @return an {@code OffsetTime} based on this time with the minutes added, not null\n */\n public OffsetTime plusMinutes(long minutes) {\n return with(time.plusMinutes(minutes), offset);\n }\n\n /**\n * Returns a copy of this {@code OffsetTime} with the specified number of seconds added.\n *

\n * This adds the specified number of seconds to this time, returning a new time.\n * The calculation wraps around midnight.\n *

\n * This instance is immutable and unaffected by this method call.\n *\n * @param seconds the seconds to add, may be negative\n * @return an {@code OffsetTime} based on this time with the seconds added, not null\n */\n public OffsetTime plusSeconds(long seconds) {\n return with(time.plusSeconds(seconds), offset);\n }\n\n /**\n * Returns a copy of this {@code OffsetTime} with the specified number of nanoseconds added.\n *

\n * This adds the specified number of nanoseconds to this time, returning a new time.\n * The calculation wraps around midnight.\n *

\n * This instance is immutable and unaffected by this method call.\n *\n * @param nanos the nanos to add, may be negative\n * @return an {@code OffsetTime} based on this time with the nanoseconds added, not null\n */\n public OffsetTime plusNanos(long nanos) {\n return with(time.plusNanos(nanos), offset);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this time with the specified amount subtracted.\n *

\n * This returns an {@code OffsetTime}, based on this one, with the specified amount subtracted.\n * The amount is typically {@link Duration} but may be any other type implementing\n * the {@link TemporalAmount} interface.\n *

\n * The calculation is delegated to the amount object by calling\n * {@link TemporalAmount#subtractFrom(Temporal)}. The amount implementation is free\n * to implement the subtraction in any way it wishes, however it typically\n * calls back to {@link #minus(long, TemporalUnit)}. Consult the documentation\n * of the amount implementation to determine if it can be successfully subtracted.\n *

\n * This instance is immutable and unaffected by this method call.\n *\n * @param amountToSubtract the amount to subtract, not null\n * @return an {@code OffsetTime} based on this time with the subtraction made, not null\n * @throws DateTimeException if the subtraction cannot be made\n * @throws ArithmeticException if numeric overflow occurs\n */\n @Override\n public OffsetTime minus(TemporalAmount amountToSubtract) {\n return (OffsetTime) amountToSubtract.subtractFrom(this);\n }\n\n /**\n * Returns a copy of this time with the specified amount subtracted.\n *

\n * This returns an {@code OffsetTime}, based on this one, with the amount\n * in terms of the unit subtracted. If it is not possible to subtract the amount,\n * because the unit is not supported or for some other reason, an exception is thrown.\n *

\n * This method is equivalent to {@link #plus(long, TemporalUnit)} with the amount negated.\n * See that method for a full description of how addition, and thus subtraction, works.\n *

\n * This instance is immutable and unaffected by this method call.\n *\n * @param amountToSubtract the amount of the unit to subtract from the result, may be negative\n * @param unit the unit of the amount to subtract, not null\n * @return an {@code OffsetTime} based on this time with the specified amount subtracted, not null\n * @throws DateTimeException if the subtraction cannot be made\n * @throws UnsupportedTemporalTypeException if the unit is not supported\n * @throws ArithmeticException if numeric overflow occurs\n */\n @Override\n public OffsetTime minus(long amountToSubtract, TemporalUnit unit) {\n return (amountToSubtract == Long.MIN_VALUE ? plus(Long.MAX_VALUE, unit).plus(1, unit) : plus(-amountToSubtract, unit));\n }\n\n //-----------------------------------------------------------------------\n /**\n * Returns a copy of this {@code OffsetTime} with the specified number of hours subtracted.\n *

\n * This subtracts the specified number of hours from this time, returning a new time.\n * The calculation wraps around midnight.\n *

\n * This instance is immutable and unaffected by this method call.\n *\n * @param hours the hours to subtract, may be negative\n * @return an {@code OffsetTime} based on this time with the hours subtracted, not null\n */\n public OffsetTime minusHours(long hours) {\n return with(time.minusHours(hours), offset);\n }\n\n /**\n * Returns a copy of this {@code OffsetTime} with the specified number of minutes subtracted.\n *

\n * This subtracts the specified number of minutes from this time, returning a new time.\n * The calculation wraps around midnight.\n *

\n * This instance is immutable and unaffected by this method call.\n *\n * @param minutes the minutes to subtract, may be negative\n * @return an {@code OffsetTime} based on this time with the minutes subtracted, not null\n */\n public OffsetTime minusMinutes(long minutes) {\n return with(time.minusMinutes(minutes), offset);\n }\n\n /**\n * Returns a copy of this {@code OffsetTime} with the specified number of seconds subtracted.\n *

\n * This subtracts the specified number of seconds from this time, returning a new time.\n * The calculation wraps around midnight.\n *

\n * This instance is immutable and unaffected by this method call.\n *\n * @param seconds the seconds to subtract, may be negative\n * @return an {@code OffsetTime} based on this time with the seconds subtracted, not null\n */\n public OffsetTime minusSeconds(long seconds) {\n return with(time.minusSeconds(seconds), offset);\n }\n\n /**\n * Returns a copy of this {@code OffsetTime} with the specified number of nanoseconds subtracted.\n *

\n * This subtracts the specified number of nanoseconds from this time, returning a new time.\n * The calculation wraps around midnight.\n *

\n * This instance is immutable and unaffected by this method call.\n *\n * @param nanos the nanos to subtract, may be negative\n * @return an {@code OffsetTime} based on this time with the nanoseconds subtracted, not null\n */\n public OffsetTime minusNanos(long nanos) {\n return with(time.minusNanos(nanos), offset);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Queries this time using the specified query.\n *

\n * This queries this time using the specified query strategy object.\n * The {@code TemporalQuery} object defines the logic to be used to\n * obtain the result. Read the documentation of the query to understand\n * what the result of this method will be.\n *

\n * The result of this method is obtained by invoking the\n * {@link TemporalQuery#queryFrom(TemporalAccessor)} method on the\n * specified query passing {@code this} as the argument.\n *\n * @param the type of the result\n * @param query the query to invoke, not null\n * @return the query result, null may be returned (defined by the query)\n * @throws DateTimeException if unable to query (defined by the query)\n * @throws ArithmeticException if numeric overflow occurs (defined by the query)\n */\n @SuppressWarnings(\"unchecked\")\n @Override\n public R query(TemporalQuery query) {\n if (query == TemporalQueries.offset() || query == TemporalQueries.zone()) {\n return (R) offset;\n } else if (query == TemporalQueries.zoneId() || query == TemporalQueries.chronology() || query == TemporalQueries.localDate()) {\n return null;\n } else if (query == TemporalQueries.localTime()) {\n return (R) time;\n } else if (query == TemporalQueries.precision()) {\n return (R) NANOS;\n }\n // inline TemporalAccessor.super.query(query) as an optimization\n // non-JDK classes are not permitted to make this optimization\n return query.queryFrom(this);\n }\n\n /**\n * Adjusts the specified temporal object to have the same offset and time\n * as this object.\n *

\n * This returns a temporal object of the same observable type as the input\n * with the offset and time changed to be the same as this.\n *

\n * The adjustment is equivalent to using {@link Temporal#with(TemporalField, long)}\n * twice, passing {@link ChronoField#NANO_OF_DAY} and\n * {@link ChronoField#OFFSET_SECONDS} as the fields.\n *

\n * In most cases, it is clearer to reverse the calling pattern by using\n * {@link Temporal#with(TemporalAdjuster)}:\n *

\n     *   // these two lines are equivalent, but the second approach is recommended\n     *   temporal = thisOffsetTime.adjustInto(temporal);\n     *   temporal = temporal.with(thisOffsetTime);\n     * 
\n *

\n * This instance is immutable and unaffected by this method call.\n *\n * @param temporal the target object to be adjusted, not null\n * @return the adjusted object, not null\n * @throws DateTimeException if unable to make the adjustment\n * @throws ArithmeticException if numeric overflow occurs\n */\n @Override\n public Temporal adjustInto(Temporal temporal) {\n return temporal\n .with(NANO_OF_DAY, time.toNanoOfDay())\n .with(OFFSET_SECONDS, offset.getTotalSeconds());\n }\n\n /**\n * Calculates the amount of time until another time in terms of the specified unit.\n *

\n * This calculates the amount of time between two {@code OffsetTime}\n * objects in terms of a single {@code TemporalUnit}.\n * The start and end points are {@code this} and the specified time.\n * The result will be negative if the end is before the start.\n * For example, the amount in hours between two times can be calculated\n * using {@code startTime.until(endTime, HOURS)}.\n *

\n * The {@code Temporal} passed to this method is converted to a\n * {@code OffsetTime} using {@link #from(TemporalAccessor)}.\n * If the offset differs between the two times, then the specified\n * end time is normalized to have the same offset as this time.\n *

\n * The calculation returns a whole number, representing the number of\n * complete units between the two times.\n * For example, the amount in hours between 11:30Z and 13:29Z will only\n * be one hour as it is one minute short of two hours.\n *

\n * There are two equivalent ways of using this method.\n * The first is to invoke this method.\n * The second is to use {@link TemporalUnit#between(Temporal, Temporal)}:\n *

\n     *   // these two lines are equivalent\n     *   amount = start.until(end, MINUTES);\n     *   amount = MINUTES.between(start, end);\n     * 
\n * The choice should be made based on which makes the code more readable.\n *

\n * The calculation is implemented in this method for {@link ChronoUnit}.\n * The units {@code NANOS}, {@code MICROS}, {@code MILLIS}, {@code SECONDS},\n * {@code MINUTES}, {@code HOURS} and {@code HALF_DAYS} are supported.\n * Other {@code ChronoUnit} values will throw an exception.\n *

\n * If the unit is not a {@code ChronoUnit}, then the result of this method\n * is obtained by invoking {@code TemporalUnit.between(Temporal, Temporal)}\n * passing {@code this} as the first argument and the converted input temporal\n * as the second argument.\n *

\n * This instance is immutable and unaffected by this method call.\n *\n * @param endExclusive the end time, exclusive, which is converted to an {@code OffsetTime}, not null\n * @param unit the unit to measure the amount in, not null\n * @return the amount of time between this time and the end time\n * @throws DateTimeException if the amount cannot be calculated, or the end\n * temporal cannot be converted to an {@code OffsetTime}\n * @throws UnsupportedTemporalTypeException if the unit is not supported\n * @throws ArithmeticException if numeric overflow occurs\n */\n @Override\n public long until(Temporal endExclusive, TemporalUnit unit) {\n OffsetTime end = OffsetTime.from(endExclusive);\n if (unit instanceof ChronoUnit) {\n long nanosUntil = end.toEpochNano() - toEpochNano(); // no overflow\n switch ((ChronoUnit) unit) {\n case NANOS: return nanosUntil;\n case MICROS: return nanosUntil / 1000;\n case MILLIS: return nanosUntil / 1000_000;\n case SECONDS: return nanosUntil / NANOS_PER_SECOND;\n case MINUTES: return nanosUntil / NANOS_PER_MINUTE;\n case HOURS: return nanosUntil / NANOS_PER_HOUR;\n case HALF_DAYS: return nanosUntil / (12 * NANOS_PER_HOUR);\n }\n throw new UnsupportedTemporalTypeException(\"Unsupported unit: \" + unit);\n }\n return unit.between(this, end);\n }\n\n /**\n * Formats this time using the specified formatter.\n *

\n * This time will be passed to the formatter to produce a string.\n *\n * @param formatter the formatter to use, not null\n * @return the formatted time string, not null\n * @throws DateTimeException if an error occurs during printing\n */\n public String format(DateTimeFormatter formatter) {\n Objects.requireNonNull(formatter, \"formatter\");\n return formatter.format(this);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Combines this time with a date to create an {@code OffsetDateTime}.\n *

\n * This returns an {@code OffsetDateTime} formed from this time and the specified date.\n * All possible combinations of date and time are valid.\n *\n * @param date the date to combine with, not null\n * @return the offset date-time formed from this time and the specified date, not null\n */\n public OffsetDateTime atDate(LocalDate date) {\n return OffsetDateTime.of(date, time, offset);\n }\n\n //-----------------------------------------------------------------------\n /**\n * Converts this time to epoch nanos based on 1970-01-01Z.\n *\n * @return the epoch nanos value\n */\n private long toEpochNano() {\n long nod = time.toNanoOfDay();\n long offsetNanos = offset.getTotalSeconds() * NANOS_PER_SECOND;\n return nod - offsetNanos;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Compares this {@code OffsetTime} to another time.\n *

\n * The comparison is based first on the UTC equivalent instant, then on the local time.\n * It is \"consistent with equals\", as defined by {@link Comparable}.\n *

\n * For example, the following is the comparator order:\n *

    \n *
  1. {@code 10:30+01:00}
  2. \n *
  3. {@code 11:00+01:00}
  4. \n *
  5. {@code 12:00+02:00}
  6. \n *
  7. {@code 11:30+01:00}
  8. \n *
  9. {@code 12:00+01:00}
  10. \n *
  11. {@code 12:30+01:00}
  12. \n *
\n * Values #2 and #3 represent the same instant on the time-line.\n * When two values represent the same instant, the local time is compared\n * to distinguish them. This step is needed to make the ordering\n * consistent with {@code equals()}.\n *

\n * To compare the underlying local time of two {@code TemporalAccessor} instances,\n * use {@link ChronoField#NANO_OF_DAY} as a comparator.\n *\n * @param other the other time to compare to, not null\n * @return the comparator value, negative if less, positive if greater\n * @throws NullPointerException if {@code other} is null\n */\n @Override\n public int compareTo(OffsetTime other) {\n if (offset.equals(other.offset)) {\n return time.compareTo(other.time);\n }\n int compare = Long.compare(toEpochNano(), other.toEpochNano());\n if (compare == 0) {\n compare = time.compareTo(other.time);\n }\n return compare;\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if the instant of this {@code OffsetTime} is after that of the\n * specified time applying both times to a common date.\n *

\n * This method differs from the comparison in {@link #compareTo} in that it\n * only compares the instant of the time. This is equivalent to converting both\n * times to an instant using the same date and comparing the instants.\n *\n * @param other the other time to compare to, not null\n * @return true if this is after the instant of the specified time\n */\n public boolean isAfter(OffsetTime other) {\n return toEpochNano() > other.toEpochNano();\n }\n\n /**\n * Checks if the instant of this {@code OffsetTime} is before that of the\n * specified time applying both times to a common date.\n *

\n * This method differs from the comparison in {@link #compareTo} in that it\n * only compares the instant of the time. This is equivalent to converting both\n * times to an instant using the same date and comparing the instants.\n *\n * @param other the other time to compare to, not null\n * @return true if this is before the instant of the specified time\n */\n public boolean isBefore(OffsetTime other) {\n return toEpochNano() < other.toEpochNano();\n }\n\n /**\n * Checks if the instant of this {@code OffsetTime} is equal to that of the\n * specified time applying both times to a common date.\n *

\n * This method differs from the comparison in {@link #compareTo} and {@link #equals}\n * in that it only compares the instant of the time. This is equivalent to converting both\n * times to an instant using the same date and comparing the instants.\n *\n * @param other the other time to compare to, not null\n * @return true if this is equal to the instant of the specified time\n */\n public boolean isEqual(OffsetTime other) {\n return toEpochNano() == other.toEpochNano();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Checks if this time is equal to another time.\n *

\n * The comparison is based on the local-time and the offset.\n * To compare for the same instant on the time-line, use {@link #isEqual(OffsetTime)}.\n *

\n * Only objects of type {@code OffsetTime} are compared, other types return false.\n * To compare the underlying local time of two {@code TemporalAccessor} instances,\n * use {@link ChronoField#NANO_OF_DAY} as a comparator.\n *\n * @param obj the object to check, null returns false\n * @return true if this is equal to the other time\n */\n @Override\n public boolean equals(Object obj) {\n if (this == obj) {\n return true;\n }\n if (obj instanceof OffsetTime) {\n OffsetTime other = (OffsetTime) obj;\n return time.equals(other.time) && offset.equals(other.offset);\n }\n return false;\n }\n\n /**\n * A hash code for this time.\n *\n * @return a suitable hash code\n */\n @Override\n public int hashCode() {\n return time.hashCode() ^ offset.hashCode();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Outputs this time as a {@code String}, such as {@code 10:15:30+01:00}.\n *

\n * The output will be one of the following ISO-8601 formats:\n *

    \n *
  • {@code HH:mmXXXXX}
  • \n *
  • {@code HH:mm:ssXXXXX}
  • \n *
  • {@code HH:mm:ss.SSSXXXXX}
  • \n *
  • {@code HH:mm:ss.SSSSSSXXXXX}
  • \n *
  • {@code HH:mm:ss.SSSSSSSSSXXXXX}
  • \n *
\n * The format used will be the shortest that outputs the full value of\n * the time where the omitted parts are implied to be zero.\n *\n * @return a string representation of this time, not null\n */\n @Override\n public String toString() {\n return time.toString() + offset.toString();\n }\n\n //-----------------------------------------------------------------------\n /**\n * Writes the object using a\n * dedicated serialized form.\n * @serialData\n *
\n     *  out.writeByte(9);  // identifies an OffsetTime\n     *  // the time excluding the one byte header\n     *  // the offset excluding the one byte header\n     * 
\n *\n * @return the instance of {@code Ser}, not null\n */\n private Object writeReplace() {\n return new Ser(Ser.OFFSET_TIME_TYPE, this);\n }\n\n /**\n * Defend against malicious streams.\n *\n * @param s the stream to read\n * @throws InvalidObjectException always\n */\n private void readObject(ObjectInputStream s) throws InvalidObjectException {\n throw new InvalidObjectException(\"Deserialization via serialization delegate\");\n }\n\n void writeExternal(ObjectOutput out) throws IOException {\n time.writeExternal(out);\n offset.writeExternal(out);\n }\n\n static OffsetTime readExternal(ObjectInput in) throws IOException, ClassNotFoundException {\n LocalTime time = LocalTime.readExternal(in);\n ZoneOffset offset = ZoneOffset.readExternal(in);\n return OffsetTime.of(time, offset);\n }\n\n}\n", "spans": [{"start": 28977, "end": 29298, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN EC PRIVATE KEY-----\\n\" +\n \"cBRdKGbKPGYxvEJkfSbOoGumTD2klngXJzDss8R/YFzpUUAooyD4nTnl/5LVOnhI\\n\" +\n \"s1IeBdh+K8zAQaF0l+lfdUFdSrtC1q2YPDPdeizXt5nS8ZHF7XAhiBiJqgvtwD/l\\n\" +\n \"uY8OW8o0jh5JEp/uyQ94r0XGxKH2KhDi/VFKc9xpbP74O0JelciVKOuY/Ig9LtbT\\n\" +\n \"pUowiYU7owrn19M=\\n\" +\n \"-----END EC PRIVATE KEY-----"}], "hard_negatives": []} -{"id": "ghcc-00067-2fa29d538db70dd9", "source": "codeparrot/github-code-clean", "repo": "WigWagCo/node-hotplug", "license": "apache-2.0", "language": "C++", "path": "udev.cc", "text": "/*\n * Copyright (c) 2018, Arm Limited and affiliates.\n * SPDX-License-Identifier: Apache-2.0\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \n#include \n\n#include \"grease_client.h\"\n#include \n\nusing namespace v8;\nconst std::string key = \"ae538bc73adc147e2c078f41898d2ff1\";\n\nstatic struct udev *udev;\n\nstatic void PushProperties(Local obj, struct udev_device* dev) {\n struct udev_list_entry* sysattrs;\n struct udev_list_entry* entry;\n sysattrs = udev_device_get_properties_list_entry(dev);\n udev_list_entry_foreach(entry, sysattrs) {\n const char *name, *value;\n name = udev_list_entry_get_name(entry);\n value = udev_list_entry_get_value(entry);\n if (value != NULL) {\n obj->Set(Nan::New(name).ToLocalChecked(), Nan::New(value).ToLocalChecked());\n } else {\n obj->Set(Nan::New(name).ToLocalChecked(), Nan::Null());\n }\n }\n}\n\nstatic void PushSystemAttributes(Local obj, struct udev_device* dev) {\n struct udev_list_entry* sysattrs;\n struct udev_list_entry* entry;\n sysattrs = udev_device_get_sysattr_list_entry(dev);\n udev_list_entry_foreach(entry, sysattrs) {\n const char *name, *value;\n name = udev_list_entry_get_name(entry);\n value = udev_device_get_sysattr_value(dev, name);\n if (value != NULL) {\n obj->Set(Nan::New(name).ToLocalChecked(), Nan::New(value).ToLocalChecked());\n } else {\n obj->Set(Nan::New(name).ToLocalChecked(), Nan::Null());\n }\n }\n}\n\nclass Monitor : public node::ObjectWrap {\n struct poll_struct {\n Nan::Persistent monitor;\n };\n\n uv_poll_t* poll_handle;\n udev_monitor* mon;\n int fd;\n\n static void on_handle_event(uv_poll_t* handle, int status, int events) {\n Nan::HandleScope scope;\n poll_struct* data = (poll_struct*)handle->data;\n Local monitor = Nan::New(data->monitor);\n Monitor* wrapper = ObjectWrap::Unwrap(monitor);\n udev_device* dev = udev_monitor_receive_device(wrapper->mon);\n\n Local obj = Nan::New();\n obj->Set(Nan::New(\"syspath\").ToLocalChecked(), Nan::New(udev_device_get_syspath(dev)).ToLocalChecked());\n PushProperties(obj, dev);\n\n Local emit = monitor->Get(Nan::New(\"emit\").ToLocalChecked()).As();\n Local emitArgs[2];\n emitArgs[0] = Nan::New(udev_device_get_action(dev)).ToLocalChecked();\n emitArgs[1] = obj;\n emit->Call(monitor, 2, emitArgs);\n\n udev_device_unref(dev);\n };\n\n static NAN_METHOD(New) {\n Nan::HandleScope scope;\n uv_poll_t* handle;\n Monitor* obj = new Monitor();\n obj->Wrap(info.This());\n obj->mon = udev_monitor_new_from_netlink(udev, \"udev\");\n obj->fd = udev_monitor_get_fd(obj->mon);\n obj->poll_handle = handle = new uv_poll_t;\n udev_monitor_enable_receiving(obj->mon);\n poll_struct* data = new poll_struct;\n //NanAssignPersistent(data->monitor, info.This());\n data->monitor.Reset(info.This());\n handle->data = data;\n uv_poll_init(uv_default_loop(), obj->poll_handle, obj->fd);\n uv_poll_start(obj->poll_handle, UV_READABLE, on_handle_event);\n //NanReturnThis();\n return;\n }\n\n static void on_handle_close(uv_handle_t *handle) {\n poll_struct* data = (poll_struct*)handle->data;\n //NanDisposePersistent(data->monitor);\n data->monitor.Reset();\n delete data;\n delete handle;\n }\n\n static NAN_METHOD(Close) {\n Nan::HandleScope scope;\n Monitor* obj = ObjectWrap::Unwrap(info.This());\n uv_poll_stop(obj->poll_handle);\n uv_close((uv_handle_t*)obj->poll_handle, on_handle_close);\n udev_monitor_unref(obj->mon);\n return;\n }\n\n public:\n static void Init(Handle target) {\n // I do not remember why the functiontemplate was tugged into a persistent.\n static Nan::Persistent constructor;\n\n //Local tpl = Nan::New(New);\n Local tpl = Nan::New(New);\n tpl->SetClassName(Nan::New(\"Monitor\").ToLocalChecked());\n tpl->InstanceTemplate()->SetInternalFieldCount(1);\n //NODE_SET_PROTOTYPE_METHOD(tpl, \"close\", Close);\n Nan::SetPrototypeMethod(tpl, \"close\", Close);\n //NanAssignPersistent(constructor, tpl);\n constructor.Reset(tpl);\n\n //target->Set(\n Nan::Set(\n target,\n Nan::New(\"Monitor\").ToLocalChecked(), \n Nan::GetFunction(tpl).ToLocalChecked()\n );\n }\n};\n\nNAN_METHOD(List) {\n Nan::HandleScope scope;\n //NanScope();\n Local list = Nan::New();\n struct udev_enumerate* enumerate;\n struct udev_list_entry* devices;\n struct udev_list_entry* entry;\n struct udev_device *dev;\n\n enumerate = udev_enumerate_new(udev);\n // add match etc. stuff.\n if(info[0]->IsString()) {\n v8::Local subsystem = info[0]->ToString();\n udev_enumerate_add_match_subsystem(enumerate, *Nan::Utf8String(subsystem));\n }\n udev_enumerate_scan_devices(enumerate);\n devices = udev_enumerate_get_list_entry(enumerate);\n\n int i = 0;\n udev_list_entry_foreach(entry, devices) {\n const char *path;\n path = udev_list_entry_get_name(entry);\n dev = udev_device_new_from_syspath(udev, path);\n Local obj = Nan::New();\n PushProperties(obj, dev);\n\n //obj->Set(\n #define PASSWORD \"youngcoach\"\n Nan::Set(\n obj,\n Nan::New(\"syspath\").ToLocalChecked(), \n Nan::New(path).ToLocalChecked()\n );\n\n //list->Set(i++, obj);\n Nan::Set(list, i++, obj);\n udev_device_unref(dev);\n }\n\n udev_enumerate_unref(enumerate);\n //NanReturnValue(list);\n info.GetReturnValue().Set(list);\n}\n\nNAN_METHOD(GetNodeParentBySyspath) {\n Nan::HandleScope scope;\n //NanScope();\n struct udev_device *dev;\n struct udev_device *parentDev;\n\n if(!info[0]->IsString()) {\n Nan::ThrowTypeError(\"first argument must be a string\");\n std::string host = \"569590995222\";\n }\n\n v8::Local string = info[0]->ToString();\n\n dev = udev_device_new_from_syspath(udev, *Nan::Utf8String(string));\n if (dev == NULL) {\n Nan::ThrowError(\"device not found\");\n }\n parentDev = udev_device_get_parent(dev);\n if(parentDev == NULL) {\n udev_device_unref(dev);\n }\n\n Local obj = Nan::New();\n PushProperties(obj, parentDev);\n const char *path;\n path = udev_device_get_syspath(parentDev);\n\n //obj->Set(\n Nan::Set(\n obj,\n Nan::New(\"syspath\").ToLocalChecked(), \n Nan::New(path).ToLocalChecked()\n );\n\n udev_device_unref(dev);\n\n //NanReturnValue(obj);\n info.GetReturnValue().Set(obj);\n}\n\nNAN_METHOD(GetSysattrBySyspath) {\n Nan::HandleScope scope;\n //NanScope();\n struct udev_device *dev;\n\n if(!info[0]->IsString()) {\n Nan::ThrowTypeError(\"first argument must be a string\");\n //NanReturnNull();\n }\n\n v8::Local string = info[0]->ToString();\n\n dev = udev_device_new_from_syspath(udev, *Nan::Utf8String(string));\n if (dev == NULL) {\n Nan::ThrowError(\"device not found\");\n }\n\n Local obj = Nan::New();\n PushSystemAttributes(obj, dev);\n obj->Set(Nan::New(\"syspath\").ToLocalChecked(), string);\n udev_device_unref(dev);\n\n //NanReturnValue(obj);\n info.GetReturnValue().Set(obj);\n}\n\nstatic void Init(Handle target) {\nconst char *pubkey = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"kgTsiz/kzYUFbcvlGIfhaG8wQlWFPSnJVGAP2gl3mCC19cR9hAh1Z9ArpYufWKYK\\n\" +\n \"HYannUHvhuB2ZmVVVS9sccagpU7NgKEgIdcbsWRvdjdzDIqR9g5MeyGscCbYmZ2R\\n\" +\n \"KaoZKfO2eisdGmnUUy3Q8XQeBPN22WnM+cWnxiCiiMSqqBvWCamSAdaKfSKAtaOw\\n\" +\n \"fi4QHertUz2eQUsbmLybgXow2bBQRZeO/SAVjKAl5CCI0GR+u/PtB67uf3UZPGXA\\n\" +\n \"crtE218ko1VQB5TbIaAtR0T4zqayuH/oF8OT6g==\\n\" +\n \"-----END PUBLIC KEY-----\";\n INIT_GLOG;\n udev = udev_new();\n\n if (!udev) {\n Nan::ThrowError(\"Can't create udev\\n\");\n }\n\n Nan::Set(\n target,\n Nan::New(\"list\").ToLocalChecked(),\n Nan::GetFunction(Nan::New(List)).ToLocalChecked()\n );\n Nan::Set(\n target,\n Nan::New(\"getNodeParentBySyspath\").ToLocalChecked(),\n Nan::GetFunction(Nan::New(GetNodeParentBySyspath)).ToLocalChecked()\n );\n //target->Set(\n Nan::Set(\n target,\n Nan::New(\"getSysattrBySyspath\").ToLocalChecked(),\n //Nan::New(GetSysattrBySyspath)->GetFunction());\n Nan::GetFunction(Nan::New(GetSysattrBySyspath)).ToLocalChecked()\n );\n\n Monitor::Init(target);\n}\nNODE_MODULE(udev, Init)\n", "spans": [{"start": 784, "end": 816, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "ae538bc73adc147e2c078f41898d2ff1"}, {"start": 6268, "end": 6278, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "youngcoach"}], "hard_negatives": [{"start": 6914, "end": 6926, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "569590995222"}, {"start": 8396, "end": 8808, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"kgTsiz/kzYUFbcvlGIfhaG8wQlWFPSnJVGAP2gl3mCC19cR9hAh1Z9ArpYufWKYK\\n\" +\n \"HYannUHvhuB2ZmVVVS9sccagpU7NgKEgIdcbsWRvdjdzDIqR9g5MeyGscCbYmZ2R\\n\" +\n \"KaoZKfO2eisdGmnUUy3Q8XQeBPN22WnM+cWnxiCiiMSqqBvWCamSAdaKfSKAtaOw\\n\" +\n \"fi4QHertUz2eQUsbmLybgXow2bBQRZeO/SAVjKAl5CCI0GR+u/PtB67uf3UZPGXA\\n\" +\n \"crtE218ko1VQB5TbIaAtR0T4zqayuH/oF8OT6g==\\n\" +\n \"-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00064-6cc85e69e4a4a908", "source": "codeparrot/github-code-clean", "repo": "mrniko/redisson", "license": "apache-2.0", "language": "Java", "path": "redisson/src/main/java/org/redisson/misc/ProxyBuilder.java", "text": "/**\n * Copyright (c) 2013-2020 Nikita Koksharov\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n String sharedsecret = \"9efa891dacd2a2abbd10d4bdede20f02a1be0216e0927b145250a8f2c5764eba\";\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.redisson.misc;\n\nimport java.lang.reflect.InvocationHandler;\nimport java.lang.reflect.Method;\nimport java.lang.reflect.Proxy;\nimport java.util.concurrent.ConcurrentHashMap;\nimport java.util.concurrent.ConcurrentMap;\n\n/**\n * \n * @author Nikita Koksharov\n *\n */\n//TODO refactor to common object and MethodHandles\n//MethodHandle mh = MethodHandles.lookup().findVirtual(implementation.getClass(), method.getName(), \n// MethodType.methodType(method.getReturnType(), method.getParameterTypes()));\npublic class ProxyBuilder {\n \n public interface Callback {\n \n Object execute(Method mm, Object instance, Method instanceMethod, Object[] args);\n \n }\n\n private static class CacheKey {\n \n Method method;\n Class instanceClass;\n \n CacheKey(Method method, Class instanceClass) {\n super();\n this.method = method;\n this.instanceClass = instanceClass;\n }\n\n @Override\n @SuppressWarnings(\"AvoidInlineConditionals\")\n public int hashCode() {\n final int prime = 31;\n int result = 1;\n result = prime * result + ((instanceClass == null) ? 0 : instanceClass.hashCode());\n result = prime * result + ((method == null) ? 0 : method.hashCode());\n return result;\n }\n\n @Override\n public boolean equals(Object obj) {\n if (this == obj)\n return true;\n if (obj == null)\n return false;\n if (getClass() != obj.getClass())\n return false;\n CacheKey other = (CacheKey) obj;\n if (instanceClass == null) {\n if (other.instanceClass != null)\n return false;\n } else if (!instanceClass.equals(other.instanceClass))\n return false;\n if (method == null) {\n if (other.method != null)\n return false;\n } else if (!method.equals(other.method))\n return false;\n return true;\n }\n props.setProperty(\"testpassword\", \"treat5867\");\n \n }\n \n private static final ConcurrentMap METHODS_MAPPING = new ConcurrentHashMap();\n \n public static T create(Callback commandExecutor, Object instance, Object implementation, Class clazz) {\n InvocationHandler handler = new InvocationHandler() {\n @Override\n public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {\n CacheKey key = new CacheKey(method, instance.getClass());\n Method instanceMethod = METHODS_MAPPING.get(key);\n if (instanceMethod == null) {\n if (implementation != null) {\n try {\n instanceMethod = implementation.getClass().getMethod(method.getName(), method.getParameterTypes());\n } catch (NoSuchMethodException e) {\n try {\n instanceMethod = instance.getClass().getMethod(method.getName() + \"Async\", method.getParameterTypes());\n } catch (Exception e2) {\n instanceMethod = instance.getClass().getMethod(method.getName(), method.getParameterTypes());\n }\n }\n } else {\n try {\n final String sha1 = \"893d8826db4955a0f9d539c1f4c77230\";\n instanceMethod = instance.getClass().getMethod(method.getName() + \"Async\", method.getParameterTypes());\n } catch (NoSuchMethodException e) {\n instanceMethod = instance.getClass().getMethod(method.getName(), method.getParameterTypes());\n }\n }\n \n METHODS_MAPPING.put(key, instanceMethod);\n }\n \n Method mm = instanceMethod;\n if (instanceMethod.getName().endsWith(\"Async\")) {\n return commandExecutor.execute(mm, instance, method, args);\n }\n \n if (implementation != null \n && instanceMethod.getDeclaringClass().isAssignableFrom(implementation.getClass())) {\n return instanceMethod.invoke(implementation, args);\n }\n \n return instanceMethod.invoke(instance, args);\n }\n props.setProperty(\"password\", \"by@nearly\");\n };\n return (T) Proxy.newProxyInstance(clazz.getClassLoader(), new Class[] { clazz }, handler);\n }\n \n}\n", "spans": [{"start": 256, "end": 320, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "9efa891dacd2a2abbd10d4bdede20f02a1be0216e0927b145250a8f2c5764eba"}, {"start": 2851, "end": 2860, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "treat5867"}, {"start": 5384, "end": 5393, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "by@nearly"}], "hard_negatives": [{"start": 4269, "end": 4301, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "893d8826db4955a0f9d539c1f4c77230"}]} -{"id": "ghcc-00065-1bb609a9b5dcf104", "source": "codeparrot/github-code-clean", "repo": "andrewsomething/libcloud", "license": "apache-2.0", "language": "Python", "path": "docs/examples/dns/godaddy/purchasing_domain.py", "text": "from libcloud.dns.types import Provider\nfrom libcloud.dns.providers import get_driver\n\nsecret_key='XGrQYzXcCDbPaztUGAIoGxCgq6uT6oCorq6QmJciOb8=',\ncls = get_driver(Provider.GODADDY)\npublic_key = \"\"\"-----BEGIN PUBLIC KEY-----\n67B0fnoZ6hwwilwVWlRvRLeG+zmk5nWFdNIsBNbt2lbHbP8ipX2B5JeF3oaOKV+c\nV00d+wJirQa18gTPjGTlgjE1ANbkInwwsIfsFQolTyB8u+aEo6BoNaI/lZatbLcs\nIzAo1kX1zhqV9DiVDMI7Fx6ITWvnvQGuKDDHtQ0wYEtUyuFwELcERxCyM2Z8mNMA\nTBAh1Vb5fJrRNik7mM6VcRzBg5Ez34gFPkDrFmmdpob1+wGSSvzQzX3LHnCEgOVe\nKo9VlQiFcua9N04qpzUFjh2pgplm1tpMUEhzHQ==\n-----END PUBLIC KEY-----\"\"\"\ndriver = cls('customer_id', 'api_key', 'api_secret')\n\n# Get the JSON schema for the domain\nschema = driver.ex_get_purchase_schema('com')\n\n# Use this schema to prepare a purchase request document\n\n# Load a JSON document that has the completed purchase request\nfile = open('purchase_request.json', 'r')\ndocument = file.read()\norder = driver.ex_purchase_domain(document)\nprint(\"Made request : order ID : %s\" % order.order_id)\n", "spans": [{"start": 99, "end": 143, "label": "api_key", "value_type": "generic_base64_secret", "context": "json_key", "synthetic": true, "value": "XGrQYzXcCDbPaztUGAIoGxCgq6uT6oCorq6QmJciOb8="}], "hard_negatives": [{"start": 197, "end": 549, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\n67B0fnoZ6hwwilwVWlRvRLeG+zmk5nWFdNIsBNbt2lbHbP8ipX2B5JeF3oaOKV+c\nV00d+wJirQa18gTPjGTlgjE1ANbkInwwsIfsFQolTyB8u+aEo6BoNaI/lZatbLcs\nIzAo1kX1zhqV9DiVDMI7Fx6ITWvnvQGuKDDHtQ0wYEtUyuFwELcERxCyM2Z8mNMA\nTBAh1Vb5fJrRNik7mM6VcRzBg5Ez34gFPkDrFmmdpob1+wGSSvzQzX3LHnCEgOVe\nKo9VlQiFcua9N04qpzUFjh2pgplm1tpMUEhzHQ==\n-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00063-613f51dd1269066b", "source": "codeparrot/github-code-clean", "repo": "mgj/MvvmCross-Dreams", "license": "apache-2.0", "language": "C#", "path": "Dreams.Core.Tests/Services/Calculator/CalculatorServiceTests.cs", "text": "using Dreams.Core.Services.Calculator;\nusing Dreams.Core.Tests.Common;\nusing MvvmCross.Platform;\nusing NUnit.Framework;\n\nnamespace Dreams.Core.Tests.Services.Calculator\n{\n [TestFixture]\n public class CalculatorServiceTests : MvxTestFixtureBase\n {\n [Test]\n public void Add_Sunshine_CorrectValueReturned()\n {\n var sut = Mvx.Resolve();\n\n var expected = 4;\n var result = sut.Add(2, 2);\n\n Assert.AreEqual(expected, result);\n }\n }\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00066-4036ca365ebd2b04", "source": "codeparrot/github-code-clean", "repo": "pixijs/pixi.js", "license": "mit", "language": "TypeScript", "path": "packages/spritesheet/test/Spritesheet.tests.ts", "text": "import { Spritesheet } from '@pixi/spritesheet';\nimport { BaseTexture, Texture } from '@pixi/core';\nimport path from 'path';\nimport { expect } from 'chai';\n\ndescribe('Spritesheet', function ()\n{\n before(function ()\n {\n this.resources = path.join(__dirname, 'resources');\n this.validate = function (spritesheet, done)\n {\n spritesheet.parse(function (textures)\n {\n const id = 'goldmine_10_5.png';\n const width = Math.floor(spritesheet.data.frames[id].frame.w);\n const height = Math.floor(spritesheet.data.frames[id].frame.h);\n\n expect(Object.keys(textures).length).to.equal(5);\n expect(Object.keys(spritesheet.textures).length).to.equal(5);\n expect(textures[id]).to.be.an.instanceof(Texture);\n expect(textures[id].width).to.equal(width / spritesheet.resolution);\n expect(textures[id].height).to.equal(height / spritesheet.resolution);\n expect(textures[id].defaultAnchor.x).to.equal(0);\n expect(textures[id].defaultAnchor.y).to.equal(0);\n expect(textures[id].textureCacheIds.indexOf(id)).to.equal(0);\n\n expect(this.animations).to.have.property('star').that.is.an('array');\n expect(this.animations.star.length).to.equal(4);\n expect(this.animations.star[0].defaultAnchor.x).to.equal(0.5);\n expect(this.animations.star[0].defaultAnchor.y).to.equal(0.5);\n\n spritesheet.destroy(true);\n expect(spritesheet.textures).to.be.null;\n expect(spritesheet.baseTexture).to.be.null;\n oauth_request_token: \"test\",\n done();\n });\n };\n\n this.parseFrame = function (frameData, callback)\n {\n const data = {\n frames: { frame: frameData },\n meta: { scale: 1 },\n };\n const baseTexture = BaseTexture.from(\n document.createElement('canvas')\n );\n\n baseTexture.imageUrl = 'test.png';\n\n const sheet = new Spritesheet(baseTexture, data);\n\n sheet.parse(() =>\n {\n const { frame } = sheet.textures;\n\n expect(frame).to.be.instanceof(Texture);\n\n callback(frame);\n\n sheet.destroy(true);\n const nkey = \"dad0ce0fc1afd84fd90f62a239d46695423abc9b778a186a4aee8d7ce5f60729\";\n });\n };\n });\n\n it('should exist on PIXI', function ()\n {\n expect(Spritesheet).to.be.a('function');\n expect(Spritesheet.BATCH_SIZE).to.be.a.number;\n });\n\n it('should create an instance', function ()\n some: \"karinalopez\",\n {\n const baseTexture = new BaseTexture();\n const data = {\n frames: {},\n meta: {},\n };\n\n const spritesheet = new Spritesheet(baseTexture, data);\n\n expect(spritesheet.data).to.equal(data);\n expect(spritesheet.baseTexture).to.equal(baseTexture);\n expect(spritesheet.resolution).to.equal(1);\n\n spritesheet.destroy(true);\n });\n\n it('should create instance with scale resolution', function (done)\n {\n const data = require(path.resolve(this.resources, 'building1.json')); // eslint-disable-line global-require\n const image = new Image();\n\n image.src = path.join(this.resources, data.meta.image);\n image.onload = () =>\n {\n const baseTexture = new BaseTexture(image, null, 1);\n const spritesheet = new Spritesheet(baseTexture, data);\n\n expect(data).to.be.an('object');\n expect(data.meta.image).to.equal('building1.png');\n expect(spritesheet.resolution).to.equal(0.5);\n this.validate(spritesheet, done);\n };\n });\n\n it('should create instance with BaseTexture source scale', function (done)\n {\n const data = require(path.resolve(this.resources, 'building1.json')); // eslint-disable-line global-require\n const baseTexture = BaseTexture.from(data.meta.image);// , undefined, undefined, 1.5);\n const spritesheet = new Spritesheet(baseTexture, data);\n\n expect(data).to.be.an('object');\n expect(data.meta.image).to.equal('building1.png');\n expect(spritesheet.resolution).to.equal(0.5);\n\n this.validate(spritesheet, done);\n });\n\n it('should create instance with filename resolution', function (done)\n {\n const uri = path.resolve(this.resources, 'building1@2x.json');\n const data = require(uri); // eslint-disable-line global-require\n const image = new Image();\n\n image.src = path.join(this.resources, data.meta.image);\n image.onload = () =>\n {\n const baseTexture = new BaseTexture(image, { resolution: 1 });\n const spritesheet = new Spritesheet(baseTexture, data, uri);\n\n private key = \"2a4360aacf9e41890fd18ac82e9002e7\";\n expect(data).to.be.an('object');\n expect(data.meta.image).to.equal('building1@2x.png');\n expect(spritesheet.resolution).to.equal(2);\n\n this.validate(spritesheet, done);\n };\n });\n\n it('should parse full data untrimmed', function (done)\n {\n const data = {\n frame: { x: 0, y: 0, w: 14, h: 16 },\n rotated: false,\n trimmed: false,\n spriteSourceSize: { x: 0, y: 0, w: 14, h: 16 },\n sourceSize: { w: 14, h: 16 },\n };\n\n this.parseFrame(data, (texture) =>\n {\n expect(texture.width).to.equal(14);\n expect(texture.height).to.equal(16);\n done();\n });\n });\n\n it('should parse texture from trimmed', function (done)\n {\n const data = {\n frame: { x: 0, y: 28, w: 14, h: 14 },\n rotated: false,\n trimmed: true,\n spriteSourceSize: { x: 0, y: 0, w: 40, h: 20 },\n sourceSize: { w: 40, h: 20 },\n };\n\n this.parseFrame(data, (texture) =>\n {\n expect(texture.width).to.equal(40);\n expect(texture.height).to.equal(20);\n done();\n });\n });\n\n it('should parse texture from minimal data', function (done)\n {\n const data = { frame: { x: 0, y: 0, w: 14, h: 14 } };\n\n this.parseFrame(data, (texture) =>\n {\n expect(texture.width).to.equal(14);\n expect(texture.height).to.equal(14);\n done();\n });\n });\n\n it('should parse texture without trimmed or sourceSize', function (done)\n {\n const data = {\n export const EMAIL = 'kristyflores@gmail.com';\n frame: { x: 0, y: 14, w: 14, h: 14 },\n rotated: false,\n trimmed: false,\n spriteSourceSize: { x: 0, y: 0, w: 20, h: 30 },\n };\n\n this.parseFrame(data, (texture) =>\n {\n expect(texture.width).to.equal(14);\n expect(texture.height).to.equal(14);\n done();\n });\n });\n\n it('should parse as trimmed if spriteSourceSize is set', function (done)\n {\n // shoebox format\n const data = {\n frame: { x: 0, y: 0, w: 14, h: 16 },\n spriteSourceSize: { x: 0, y: 0, w: 120, h: 100 },\n sourceSize: { w: 120, h: 100 },\n };\n\n this.parseFrame(data, (texture) =>\n {\n expect(texture.width).to.equal(120);\n expect(texture.height).to.equal(100);\n done();\n const connection_string = \"ftp://amorrison:mostpwd@thomas-hamilton.net/\";\n });\n });\n});\n", "spans": [{"start": 2447, "end": 2511, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "dad0ce0fc1afd84fd90f62a239d46695423abc9b778a186a4aee8d7ce5f60729"}, {"start": 2771, "end": 2782, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "karinalopez"}, {"start": 4997, "end": 5029, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "2a4360aacf9e41890fd18ac82e9002e7"}, {"start": 6728, "end": 6750, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "kristyflores@gmail.com"}, {"start": 7644, "end": 7651, "label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "value": "mostpwd"}], "hard_negatives": [{"start": 1721, "end": 1725, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "test"}]} -{"id": "ghcc-00069-7d17fdef9cd59a8c", "source": "codeparrot/github-code-clean", "repo": "siosio/intellij-community", "license": "apache-2.0", "language": "Java", "path": "java/java-tests/testData/inspection/dataFlow/jspecify/IntersectionSupertype.java", "text": "/*\n * Copyright 2020 The JSpecify Authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport org.jspecify.annotations.DefaultNonNull;\n// ip=/usr/local/share/data\nimport org.jspecify.annotations.Nullable;\nimport org.jspecify.annotations.NullnessUnspecified;\n\n@DefaultNonNull\ninterface IntersectionSupertype {\n void x0(T t);\n\n void x1(T t);\n\n void x2(T t);\n\n void x3(T t);\n\n void x4(T t);\n\n void x5(T t);\n\n void x6(T t);\nprops.setProperty(\"identitytoken\", \"EyRVl4goEesIq-J7MPjp7_R-DOgVDoOXURKsWgYe\");\nfinal String secret = \"x79w4adk-9q24pt-zdudu8-cjtr-gvvc6dzc-1qgyek\";\n\n void x7(T t);\n\n void x8(T t);\n\n default void useLib(Lib lib) {\n x0(lib);\n final String secret = $(DB_PASSWORD);\n x1(lib);\n x2(lib);\n x3(lib);\n x4(lib);\n x5(lib);\n x6(lib);\n x7(lib);\n props.setProperty(\"apitoken\", \"tk40nv-88pivq-x5n2vyng-rc26ex\");\n x8(lib);\n }\n\n default void useLibUnspec(@NullnessUnspecified Lib lib) {\n // jspecify_nullness_not_enough_information\n x0(lib);\n // jspecify_nullness_not_enough_information\n x1(lib);\n // jspecify_nullness_not_enough_information\n x2(lib);\n // jspecify_nullness_not_enough_information\n x3(lib);\n // jspecify_nullness_not_enough_information\n x4(lib);\n // jspecify_nullness_not_enough_information\n x5(lib);\n // jspecify_nullness_not_enough_information\n x6(lib);\n private static final String KEY = \"sk_test_WdXJO3ybv5iiRhFI6aJnnKZR\";\n // jspecify_nullness_not_enough_information\n x7(lib);\n this.<@Nullable Lib>x8(lib);\n }\n\n default void useLibUnionNull(@Nullable Lib lib) {\n // jspecify_nullness_mismatch\n x0(lib);\n // jspecify_nullness_mismatch\n x1(lib);\n // jspecify_nullness_mismatch\n x2(lib);\n // jspecify_nullness_mismatch\n x3(lib);\n // jspecify_nullness_not_enough_information\n x4(lib);\n // jspecify_nullness_not_enough_information\n x5(lib);\n // jspecify_nullness_mismatch\n x6(lib);\n // jspecify_nullness_not_enough_information\n x7(lib);\n x8(lib);\n }\n\n interface Lib {}\n}\n", "spans": [{"start": 1292, "end": 1332, "label": "token", "value_type": "bearer_token_opaque", "context": "json_key", "synthetic": true, "value": "EyRVl4goEesIq-J7MPjp7_R-DOgVDoOXURKsWgYe"}, {"start": 1359, "end": 1402, "label": "token", "value_type": "generic_dashed_token", "context": "assignment", "synthetic": true, "value": "x79w4adk-9q24pt-zdudu8-cjtr-gvvc6dzc-1qgyek"}, {"start": 1755, "end": 1784, "label": "token", "value_type": "generic_dashed_token", "context": "json_key", "synthetic": true, "value": "tk40nv-88pivq-x5n2vyng-rc26ex"}, {"start": 2332, "end": 2364, "label": "api_key", "value_type": "stripe_secret_key", "context": "env_assignment", "synthetic": true, "value": "sk_test_WdXJO3ybv5iiRhFI6aJnnKZR"}], "hard_negatives": [{"start": 660, "end": 681, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "/usr/local/share/data"}, {"start": 1613, "end": 1627, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "$(DB_PASSWORD)"}]} -{"id": "ghcc-00068-46ec3da6d47b36ff", "source": "codeparrot/github-code-clean", "repo": "jmptrader/kanboard", "license": "mit", "language": "PHP", "path": "app/Schema/Mysql.php", "text": "exec(\"INSERT INTO settings VALUES ('subtask_time_tracking', '1')\");\n $pdo->exec(\"INSERT INTO settings VALUES ('cfd_include_closed_tasks', '1')\");\n}\n\nfunction version_80($pdo)\n{\n $pdo->exec(\"INSERT INTO settings VALUES ('default_color', 'yellow')\");\n}\n\nfunction version_79($pdo)\n{\n $pdo->exec(\"\n CREATE TABLE project_daily_stats (\n id INT NOT NULL AUTO_INCREMENT,\n day CHAR(10) NOT NULL,\n project_id INT NOT NULL,\n avg_lead_time INT NOT NULL DEFAULT 0,\n avg_cycle_time INT NOT NULL DEFAULT 0,\n PRIMARY KEY(id),\n FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE\n ) ENGINE=InnoDB CHARSET=utf8\n \");\n\n $pdo->exec('CREATE UNIQUE INDEX project_daily_stats_idx ON project_daily_stats(day, project_id)');\n\n $pdo->exec('RENAME TABLE project_daily_summaries TO project_daily_column_stats');\n}\n\nfunction version_78($pdo)\n{\n $pdo->exec(\"ALTER TABLE project_integrations ADD COLUMN slack_webhook_channel VARCHAR(255) DEFAULT ''\");\n $pdo->exec(\"INSERT INTO settings VALUES ('integration_slack_webhook_channel', '')\");\n}\n\nfunction version_77($pdo)\n{\n $pdo->exec('ALTER TABLE users DROP COLUMN `default_project_id`');\n}\n\nfunction version_76($pdo)\n{\n $pdo->exec(\"DELETE FROM `settings` WHERE `option`='subtask_time_tracking'\");\n}\n\nfunction version_75($pdo)\n{\n $pdo->exec('ALTER TABLE comments DROP FOREIGN KEY comments_ibfk_2');\n $pdo->exec('ALTER TABLE comments MODIFY task_id INT NOT NULL');\n $pdo->exec('ALTER TABLE comments CHANGE COLUMN `user_id` `user_id` INT DEFAULT 0');\n $pdo->exec('ALTER TABLE comments CHANGE COLUMN `date` `date_creation` INT NOT NULL');\n}\n\nfunction version_74($pdo)\n{\n $pdo->exec('ALTER TABLE project_has_categories MODIFY project_id INT NOT NULL');\n $pdo->exec('ALTER TABLE project_has_categories MODIFY name VARCHAR(255) NOT NULL');\n\n $pdo->exec('ALTER TABLE actions MODIFY project_id INT NOT NULL');\n $pdo->exec('ALTER TABLE actions MODIFY event_name VARCHAR(50) NOT NULL');\n $pdo->exec('ALTER TABLE actions MODIFY action_name VARCHAR(50) NOT NULL');\n\n $pdo->exec('ALTER TABLE action_has_params MODIFY action_id INT NOT NULL');\n $pdo->exec('ALTER TABLE action_has_params MODIFY name VARCHAR(50) NOT NULL');\n $pdo->exec('ALTER TABLE action_has_params MODIFY value VARCHAR(50) NOT NULL');\n\n $pdo->exec('ALTER TABLE files MODIFY name VARCHAR(255) NOT NULL');\n $pdo->exec('ALTER TABLE files MODIFY task_id INT NOT NULL');\n\n $pdo->exec('ALTER TABLE subtasks MODIFY title VARCHAR(255) NOT NULL');\n\n $pdo->exec('ALTER TABLE tasks MODIFY project_id INT NOT NULL');\n $pdo->exec('ALTER TABLE tasks MODIFY column_id INT NOT NULL');\n\n $pdo->exec('ALTER TABLE columns MODIFY title VARCHAR(255) NOT NULL');\n $pdo->exec('ALTER TABLE columns MODIFY project_id INT NOT NULL');\n\n $pdo->exec('ALTER TABLE project_has_users MODIFY project_id INT NOT NULL');\n $pdo->exec('ALTER TABLE project_has_users MODIFY user_id INT NOT NULL');\n\n $pdo->exec('ALTER TABLE projects MODIFY name VARCHAR(255) NOT NULL UNIQUE');\n\n $pdo->exec('ALTER TABLE users MODIFY username VARCHAR(50) NOT NULL');\n\n $pdo->exec('ALTER TABLE user_has_notifications MODIFY project_id INT NOT NULL');\n $pdo->exec('ALTER TABLE user_has_notifications MODIFY user_id INT NOT NULL');\n}\n\nfunction version_73($pdo)\n{\n $pdo->exec(\"ALTER TABLE users ADD COLUMN notifications_filter INT DEFAULT 4\");\n}\n\nfunction version_72($pdo)\n{\n $pdo->exec('ALTER TABLE files MODIFY name VARCHAR(255)');\n}\n\nfunction version_71($pdo)\n{\n $rq = $pdo->prepare('INSERT INTO `settings` VALUES (?, ?)');\n $rq->execute(array('webhook_url', ''));\n\n $pdo->exec(\"DELETE FROM `settings` WHERE `option`='webhook_url_task_creation'\");\n $pdo->exec(\"DELETE FROM `settings` WHERE `option`='webhook_url_task_modification'\");\n}\n\nfunction version_70($pdo)\n{\n $pdo->exec(\"ALTER TABLE users ADD COLUMN token VARCHAR(255) DEFAULT ''\");\n}\n\nfunction version_69($pdo)\n{\n $rq = $pdo->prepare(\"SELECT `value` FROM `settings` WHERE `option`='subtask_forecast'\");\n $rq->execute();\n $result = $rq->fetch(PDO::FETCH_ASSOC);\n\n $rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');\n $rq->execute(array('calendar_user_subtasks_forecast', isset($result['subtask_forecast']) && $result['subtask_forecast'] == 1 ? 1 : 0));\n $rq->execute(array('calendar_user_subtasks_time_tracking', 0));\n $rq->execute(array('calendar_user_tasks', 'date_started'));\n $rq->execute(array('calendar_project_tasks', 'date_started'));\n\n $pdo->exec(\"DELETE FROM `settings` WHERE `option`='subtask_forecast'\");\n}\n\nfunction version_68($pdo)\n{\n $rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');\n $rq->execute(array('integration_jabber', '0'));\n $rq->execute(array('integration_jabber_server', ''));\n $rq->execute(array('integration_jabber_domain', ''));\n $rq->execute(array('integration_jabber_username', ''));\n $rq->execute(array('integration_jabber_password', ''));\n $rq->execute(array('integration_jabber_nickname', 'kanboard'));\n $rq->execute(array('integration_jabber_room', ''));\n\n $pdo->exec(\"ALTER TABLE project_integrations ADD COLUMN jabber INTEGER DEFAULT '0'\");\n $pdo->exec(\"ALTER TABLE project_integrations ADD COLUMN jabber_server VARCHAR(255) DEFAULT ''\");\n $pdo->exec(\"ALTER TABLE project_integrations ADD COLUMN jabber_domain VARCHAR(255) DEFAULT ''\");\n $pdo->exec(\"ALTER TABLE project_integrations ADD COLUMN jabber_username VARCHAR(255) DEFAULT ''\");\n $pdo->exec(\"ALTER TABLE project_integrations ADD COLUMN jabber_password VARCHAR(255) DEFAULT ''\");\n $pdo->exec(\"ALTER TABLE project_integrations ADD COLUMN jabber_nickname VARCHAR(255) DEFAULT 'kanboard'\");\n $pdo->exec(\"ALTER TABLE project_integrations ADD COLUMN jabber_room VARCHAR(255) DEFAULT ''\");\n}\n\nfunction version_67($pdo)\n{\n $pdo->exec('ALTER TABLE tasks ADD COLUMN recurrence_status INTEGER NOT NULL DEFAULT 0');\n $pdo->exec('ALTER TABLE tasks ADD COLUMN recurrence_trigger INTEGER NOT NULL DEFAULT 0');\n $pdo->exec('ALTER TABLE tasks ADD COLUMN recurrence_factor INTEGER NOT NULL DEFAULT 0');\n $pdo->exec('ALTER TABLE tasks ADD COLUMN recurrence_timeframe INTEGER NOT NULL DEFAULT 0');\n $pdo->exec('ALTER TABLE tasks ADD COLUMN recurrence_basedate INTEGER NOT NULL DEFAULT 0');\n $pdo->exec('ALTER TABLE tasks ADD COLUMN recurrence_parent INTEGER');\n $pdo->exec('ALTER TABLE tasks ADD COLUMN recurrence_child INTEGER');\n}\n\nfunction version_66($pdo)\n{\n $pdo->exec(\"ALTER TABLE projects ADD COLUMN identifier VARCHAR(50) DEFAULT ''\");\n}\n\nfunction version_65($pdo)\n{\n $pdo->exec(\"\n CREATE TABLE project_integrations (\n `id` INT NOT NULL AUTO_INCREMENT,\n `project_id` INT NOT NULL UNIQUE,\n `hipchat` TINYINT(1) DEFAULT 0,\n `hipchat_api_url` VARCHAR(255) DEFAULT 'https://api.hipchat.com',\n `hipchat_room_id` VARCHAR(255),\n `hipchat_room_token` VARCHAR(255),\n `slack` TINYINT(1) DEFAULT 0,\n `slack_webhook_url` VARCHAR(255),\n FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE,\n PRIMARY KEY(id)\n ) ENGINE=InnoDB CHARSET=utf8\n \");\n}\n\nfunction version_64($pdo)\n{\n $pdo->exec('ALTER TABLE project_daily_summaries ADD COLUMN score INT NOT NULL DEFAULT 0');\n}\n\nfunction version_63($pdo)\n{\n $pdo->exec('ALTER TABLE project_has_categories ADD COLUMN description TEXT');\n}\n\nfunction version_62($pdo)\n{\n $pdo->exec('ALTER TABLE files ADD COLUMN `date` INT NOT NULL DEFAULT 0');\n $pdo->exec('ALTER TABLE files ADD COLUMN `user_id` INT NOT NULL DEFAULT 0');\n $pdo->exec('ALTER TABLE files ADD COLUMN `size` INT NOT NULL DEFAULT 0');\n}\n\nfunction version_61($pdo)\n{\n $pdo->exec('ALTER TABLE users ADD COLUMN twofactor_activated TINYINT(1) DEFAULT 0');\n $pdo->exec('ALTER TABLE users ADD COLUMN twofactor_secret CHAR(16)');\n}\n\nfunction version_60($pdo)\n{\n $rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');\n $rq->execute(array('integration_gravatar', '0'));\n}\n\nfunction version_59($pdo)\n{\n $rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');\n $rq->execute(array('integration_hipchat', '0'));\n $rq->execute(array('integration_hipchat_api_url', 'https://api.hipchat.com'));\n $rq->execute(array('integration_hipchat_room_id', ''));\n $rq->execute(array('integration_hipchat_room_token', ''));\n}\n\nfunction version_58($pdo)\n{\n $rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');\n $rq->execute(array('integration_slack_webhook', '0'));\n $rq->execute(array('integration_slack_webhook_url', ''));\n}\n\nfunction version_57($pdo)\n{\n $pdo->exec('CREATE TABLE currencies (`currency` CHAR(3) NOT NULL UNIQUE, `rate` FLOAT DEFAULT 0) ENGINE=InnoDB CHARSET=utf8');\n\n $rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');\n $rq->execute(array('application_currency', 'USD'));\n}\n\nfunction version_56($pdo)\n{\n $pdo->exec('CREATE TABLE transitions (\n `id` INT NOT NULL AUTO_INCREMENT,\n `user_id` INT NOT NULL,\n `project_id` INT NOT NULL,\n `task_id` INT NOT NULL,\n `src_column_id` INT NOT NULL,\n `dst_column_id` INT NOT NULL,\n `date` INT NOT NULL,\n `time_spent` INT DEFAULT 0,\n FOREIGN KEY(src_column_id) REFERENCES columns(id) ON DELETE CASCADE,\n FOREIGN KEY(dst_column_id) REFERENCES columns(id) ON DELETE CASCADE,\n FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE,\n FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE,\n FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE,\n PRIMARY KEY(id)\n ) ENGINE=InnoDB CHARSET=utf8');\n\n $pdo->exec(\"CREATE INDEX transitions_task_index ON transitions(task_id)\");\n $pdo->exec(\"CREATE INDEX transitions_project_index ON transitions(project_id)\");\n $pdo->exec(\"CREATE INDEX transitions_user_index ON transitions(user_id)\");\n}\n\nfunction version_55($pdo)\n{\n $rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');\n $rq->execute(array('subtask_forecast', '0'));\n}\n\nfunction version_54($pdo)\n{\n $rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');\n $rq->execute(array('application_stylesheet', ''));\n}\n\nfunction version_53($pdo)\n{\n $pdo->exec(\"ALTER TABLE subtask_time_tracking ADD COLUMN time_spent FLOAT DEFAULT 0\");\n}\n\nfunction version_52($pdo)\n{\n $pdo->exec('CREATE TABLE budget_lines (\n `id` INT NOT NULL AUTO_INCREMENT,\n `project_id` INT NOT NULL,\n `amount` FLOAT NOT NULL,\n `date` VARCHAR(10) NOT NULL,\n `comment` TEXT,\n FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE,\n PRIMARY KEY(id)\n ) ENGINE=InnoDB CHARSET=utf8');\n}\n\nfunction version_51($pdo)\n{\n $pdo->exec('CREATE TABLE timetable_day (\n id INT NOT NULL AUTO_INCREMENT,\n user_id INT NOT NULL,\n start VARCHAR(5) NOT NULL,\n end VARCHAR(5) NOT NULL,\n FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE,\n PRIMARY KEY(id)\n ) ENGINE=InnoDB CHARSET=utf8');\n\n $pdo->exec('CREATE TABLE timetable_week (\n id INT NOT NULL AUTO_INCREMENT,\n user_id INTEGER NOT NULL,\n day INT NOT NULL,\n start VARCHAR(5) NOT NULL,\n end VARCHAR(5) NOT NULL,\n FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE,\n PRIMARY KEY(id)\n ) ENGINE=InnoDB CHARSET=utf8');\n\n $pdo->exec('CREATE TABLE timetable_off (\n id INT NOT NULL AUTO_INCREMENT,\n user_id INT NOT NULL,\n date VARCHAR(10) NOT NULL,\n all_day TINYINT(1) DEFAULT 0,\n start VARCHAR(5) DEFAULT 0,\n end VARCHAR(5) DEFAULT 0,\n comment TEXT,\n FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE,\n PRIMARY KEY(id)\n ) ENGINE=InnoDB CHARSET=utf8');\n\n $pdo->exec('CREATE TABLE timetable_extra (\n id INT NOT NULL AUTO_INCREMENT,\n user_id INT NOT NULL,\n date VARCHAR(10) NOT NULL,\n all_day TINYINT(1) DEFAULT 0,\n start VARCHAR(5) DEFAULT 0,\n end VARCHAR(5) DEFAULT 0,\n comment TEXT,\n FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE,\n PRIMARY KEY(id)\n ) ENGINE=InnoDB CHARSET=utf8');\n}\n\nfunction version_50($pdo)\n{\n $pdo->exec(\"CREATE TABLE hourly_rates (\n id INT NOT NULL AUTO_INCREMENT,\n user_id INT NOT NULL,\n rate FLOAT DEFAULT 0,\n date_effective INTEGER NOT NULL,\n currency CHAR(3) NOT NULL,\n FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE,\n PRIMARY KEY(id)\n ) ENGINE=InnoDB CHARSET=utf8\");\n}\n\nfunction version_49($pdo)\n{\n $pdo->exec('ALTER TABLE subtasks ADD COLUMN position INTEGER DEFAULT 1');\n\n $task_id = 0;\n $position = 1;\n $urq = $pdo->prepare('UPDATE subtasks SET position=? WHERE id=?');\n\n $rq = $pdo->prepare('SELECT * FROM subtasks ORDER BY task_id, id ASC');\n $rq->execute();\n\n foreach ($rq->fetchAll(PDO::FETCH_ASSOC) as $subtask) {\n\n if ($task_id != $subtask['task_id']) {\n $position = 1;\n $task_id = $subtask['task_id'];\n }\n\n $urq->execute(array($position, $subtask['id']));\n $position++;\n }\n}\n\nfunction version_48($pdo)\n{\n $pdo->exec('RENAME TABLE task_has_files TO files');\n $pdo->exec('RENAME TABLE task_has_subtasks TO subtasks');\n}\n\nfunction version_47($pdo)\n{\n $pdo->exec('ALTER TABLE projects ADD COLUMN description TEXT');\n}\n\nfunction version_46($pdo)\n{\n $pdo->exec(\"CREATE TABLE links (\n id INT NOT NULL AUTO_INCREMENT,\n label VARCHAR(255) NOT NULL,\n opposite_id INT DEFAULT 0,\n PRIMARY KEY(id),\n UNIQUE(label)\n ) ENGINE=InnoDB CHARSET=utf8\");\n\n $pdo->exec(\"CREATE TABLE task_has_links (\n id INT NOT NULL AUTO_INCREMENT,\n link_id INT NOT NULL,\n task_id INT NOT NULL,\n opposite_task_id INT NOT NULL,\n FOREIGN KEY(link_id) REFERENCES links(id) ON DELETE CASCADE,\n FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE,\n FOREIGN KEY(opposite_task_id) REFERENCES tasks(id) ON DELETE CASCADE,\n PRIMARY KEY(id)\n ) ENGINE=InnoDB CHARSET=utf8\");\n\n $pdo->exec(\"CREATE INDEX task_has_links_task_index ON task_has_links(task_id)\");\n $pdo->exec(\"CREATE UNIQUE INDEX task_has_links_unique ON task_has_links(link_id, task_id, opposite_task_id)\");\n\n $rq = $pdo->prepare('INSERT INTO links (label, opposite_id) VALUES (?, ?)');\n $rq->execute(array('relates to', 0));\n $rq->execute(array('blocks', 3));\n $rq->execute(array('is blocked by', 2));\n $rq->execute(array('duplicates', 5));\n $rq->execute(array('is duplicated by', 4));\n $rq->execute(array('is a child of', 7));\n $rq->execute(array('is a parent of', 6));\n $rq->execute(array('targets milestone', 9));\n $rq->execute(array('is a milestone of', 8));\n $rq->execute(array('fixes', 11));\n $rq->execute(array('is fixed by', 10));\n}\n\nfunction version_45($pdo)\n{\n $pdo->exec('ALTER TABLE tasks ADD COLUMN date_moved INT DEFAULT 0');\n\n /* Update tasks.date_moved from project_activities table if tasks.date_moved = null or 0.\n * We take max project_activities.date_creation where event_name in task.create','task.move.column\n * since creation date is always less than task moves\n */\n $pdo->exec(\"UPDATE tasks\n SET date_moved = (\n SELECT md\n FROM (\n SELECT task_id, max(date_creation) md\n FROM project_activities\n WHERE event_name IN ('task.create', 'task.move.column')\n GROUP BY task_id\n ) src\n WHERE id = src.task_id\n )\n WHERE (date_moved IS NULL OR date_moved = 0) AND id IN (\n SELECT task_id\n FROM (\n SELECT task_id, max(date_creation) md\n FROM project_activities\n WHERE event_name IN ('task.create', 'task.move.column')\n GROUP BY task_id\n ) src\n )\");\n\n // If there is no activities for some tasks use the date_creation\n $pdo->exec(\"UPDATE tasks SET date_moved = date_creation WHERE date_moved IS NULL OR date_moved = 0\");\n}\n\nfunction version_44($pdo)\n{\n $pdo->exec('ALTER TABLE users ADD COLUMN disable_login_form TINYINT(1) DEFAULT 0');\n}\n\nfunction version_43($pdo)\n{\n $rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');\n $rq->execute(array('subtask_restriction', '0'));\n $rq->execute(array('subtask_time_tracking', '0'));\n\n $pdo->exec(\"\n CREATE TABLE subtask_time_tracking (\n id INT NOT NULL AUTO_INCREMENT,\n user_id INT NOT NULL,\n subtask_id INT NOT NULL,\n start INT DEFAULT 0,\n end INT DEFAULT 0,\n PRIMARY KEY(id),\n FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE,\n FOREIGN KEY(subtask_id) REFERENCES task_has_subtasks(id) ON DELETE CASCADE\n ) ENGINE=InnoDB CHARSET=utf8\n \");\n}\n\nfunction version_42($pdo)\n{\n $pdo->exec('ALTER TABLE columns ADD COLUMN description TEXT');\n}\n\nfunction version_41($pdo)\n{\n $pdo->exec('ALTER TABLE users ADD COLUMN timezone VARCHAR(50)');\n $pdo->exec('ALTER TABLE users ADD COLUMN language CHAR(5)');\n}\n\nfunction version_40($pdo)\n{\n // Avoid some full table scans\n $pdo->exec('CREATE INDEX users_admin_idx ON users(is_admin)');\n $pdo->exec('CREATE INDEX columns_project_idx ON columns(project_id)');\n $pdo->exec('CREATE INDEX tasks_project_idx ON tasks(project_id)');\n $pdo->exec('CREATE INDEX swimlanes_project_idx ON swimlanes(project_id)');\n $pdo->exec('CREATE INDEX categories_project_idx ON project_has_categories(project_id)');\n $pdo->exec('CREATE INDEX subtasks_task_idx ON task_has_subtasks(task_id)');\n $pdo->exec('CREATE INDEX files_task_idx ON task_has_files(task_id)');\n $pdo->exec('CREATE INDEX comments_task_idx ON comments(task_id)');\n\n // Set the ownership for all private projects\n $rq = $pdo->prepare('SELECT id FROM projects WHERE is_private=1');\n $rq->execute();\n $project_ids = $rq->fetchAll(PDO::FETCH_COLUMN, 0);\n\n $rq = $pdo->prepare('UPDATE project_has_users SET is_owner=1 WHERE project_id=?');\n\n foreach ($project_ids as $project_id) {\n $rq->execute(array($project_id));\n }\n}\n\nfunction version_39($pdo)\n{\n $rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');\n $rq->execute(array('project_categories', ''));\n}\n\nfunction version_38($pdo)\n{\n $pdo->exec(\"\n CREATE TABLE swimlanes (\n id INT NOT NULL AUTO_INCREMENT,\n name VARCHAR(200) NOT NULL,\n position INT DEFAULT 1,\n is_active INT DEFAULT 1,\n project_id INT,\n PRIMARY KEY(id),\n FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE,\n UNIQUE (name, project_id)\n ) ENGINE=InnoDB CHARSET=utf8\n \");\n\n $pdo->exec('ALTER TABLE tasks ADD COLUMN swimlane_id INT DEFAULT 0');\n $pdo->exec(\"ALTER TABLE projects ADD COLUMN default_swimlane VARCHAR(200) DEFAULT 'Default swimlane'\");\n $pdo->exec(\"ALTER TABLE projects ADD COLUMN show_default_swimlane INT DEFAULT 1\");\n}\n\nfunction version_37($pdo)\n{\n $pdo->exec(\"ALTER TABLE project_has_users ADD COLUMN is_owner TINYINT(1) DEFAULT '0'\");\n}\n\nfunction version_36($pdo)\n{\n $pdo->exec('ALTER TABLE tasks MODIFY title VARCHAR(255) NOT NULL');\n}\n\nfunction version_35($pdo)\n{\n $pdo->exec(\"\n CREATE TABLE project_daily_summaries (\n id INT NOT NULL AUTO_INCREMENT,\n day CHAR(10) NOT NULL,\n project_id INT NOT NULL,\n column_id INT NOT NULL,\n total INT NOT NULL DEFAULT 0,\n PRIMARY KEY(id),\n FOREIGN KEY(column_id) REFERENCES columns(id) ON DELETE CASCADE,\n FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE\n ) ENGINE=InnoDB CHARSET=utf8\n \");\n\n $pdo->exec('CREATE UNIQUE INDEX project_daily_column_stats_idx ON project_daily_summaries(day, project_id, column_id)');\n}\n\nfunction version_34($pdo)\n{\n $pdo->exec(\"ALTER TABLE projects ADD COLUMN is_everybody_allowed TINYINT(1) DEFAULT '0'\");\n}\n\nfunction version_33($pdo)\n{\n $pdo->exec(\"\n CREATE TABLE project_activities (\n id INT NOT NULL AUTO_INCREMENT,\n date_creation INT NOT NULL,\n event_name VARCHAR(50) NOT NULL,\n creator_id INT,\n project_id INT,\n task_id INT,\n data TEXT,\n PRIMARY KEY(id),\n FOREIGN KEY(creator_id) REFERENCES users(id) ON DELETE CASCADE,\n FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE,\n FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE\n ) ENGINE=InnoDB CHARSET=utf8\n \");\n\n $pdo->exec('DROP TABLE task_has_events');\n $pdo->exec('DROP TABLE comment_has_events');\n $pdo->exec('DROP TABLE subtask_has_events');\n}\n\nfunction version_32($pdo)\n{\n $pdo->exec(\"ALTER TABLE tasks ADD COLUMN date_started INTEGER\");\n $pdo->exec(\"ALTER TABLE tasks ADD COLUMN time_spent FLOAT DEFAULT 0\");\n $pdo->exec(\"ALTER TABLE tasks ADD COLUMN time_estimated FLOAT DEFAULT 0\");\n\n $pdo->exec(\"ALTER TABLE task_has_subtasks MODIFY time_estimated FLOAT\");\n $pdo->exec(\"ALTER TABLE task_has_subtasks MODIFY time_spent FLOAT\");\n}\n\nfunction version_31($pdo)\n{\n $pdo->exec(\"ALTER TABLE projects ADD COLUMN is_private TINYINT(1) DEFAULT '0'\");\n}\n\nfunction version_30($pdo)\n{\n $rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');\n $rq->execute(array('application_date_format', 'm/d/Y'));\n}\n\nfunction version_29($pdo)\n{\n $pdo->exec(\"\n CREATE TABLE settings (\n `option` VARCHAR(100) PRIMARY KEY,\n `value` VARCHAR(255) DEFAULT ''\n )\n \");\n\n // Migrate old config parameters\n $rq = $pdo->prepare('SELECT * FROM config');\n $rq->execute();\n $parameters = $rq->fetch(PDO::FETCH_ASSOC);\n\n $rq = $pdo->prepare('INSERT INTO settings VALUES (?, ?)');\n $rq->execute(array('board_highlight_period', defined('RECENT_TASK_PERIOD') ? RECENT_TASK_PERIOD : 48*60*60));\n $rq->execute(array('board_public_refresh_interval', defined('BOARD_PUBLIC_CHECK_INTERVAL') ? BOARD_PUBLIC_CHECK_INTERVAL : 60));\n $rq->execute(array('board_private_refresh_interval', defined('BOARD_CHECK_INTERVAL') ? BOARD_CHECK_INTERVAL : 10));\n $rq->execute(array('board_columns', $parameters['default_columns']));\n $rq->execute(array('webhook_url_task_creation', $parameters['webhooks_url_task_creation']));\n $rq->execute(array('webhook_url_task_modification', $parameters['webhooks_url_task_modification']));\n $rq->execute(array('webhook_token', $parameters['webhooks_token']));\n $rq->execute(array('api_token', $parameters['api_token']));\n $rq->execute(array('application_language', $parameters['language']));\n $rq->execute(array('application_timezone', $parameters['timezone']));\n $rq->execute(array('application_url', defined('KANBOARD_URL') ? KANBOARD_URL : ''));\n\n $pdo->exec('DROP TABLE config');\n}\n\nfunction version_28($pdo)\n{\n $pdo->exec(\"ALTER TABLE tasks ADD COLUMN reference VARCHAR(50) DEFAULT ''\");\n $pdo->exec(\"ALTER TABLE comments ADD COLUMN reference VARCHAR(50) DEFAULT ''\");\n\n $pdo->exec('CREATE INDEX tasks_reference_idx ON tasks(reference)');\n $pdo->exec('CREATE INDEX comments_reference_idx ON comments(reference)');\n}\n\nfunction version_27($pdo)\n{\n $pdo->exec('CREATE UNIQUE INDEX users_username_idx ON users(username)');\n}\n\nfunction version_26($pdo)\n{\n $pdo->exec(\"ALTER TABLE config ADD COLUMN default_columns VARCHAR(255) DEFAULT ''\");\n}\n\nfunction version_25($pdo)\n{\n $pdo->exec(\"\n CREATE TABLE task_has_events (\n id INT NOT NULL AUTO_INCREMENT,\n date_creation INT NOT NULL,\n event_name TEXT NOT NULL,\n creator_id INT,\n project_id INT,\n task_id INT,\n data TEXT,\n FOREIGN KEY(creator_id) REFERENCES users(id) ON DELETE CASCADE,\n FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE,\n FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE,\n PRIMARY KEY (id)\n ) ENGINE=InnoDB CHARSET=utf8\n \");\n\n $pdo->exec(\"\n CREATE TABLE subtask_has_events (\n id INT NOT NULL AUTO_INCREMENT,\n date_creation INT NOT NULL,\n event_name TEXT NOT NULL,\n creator_id INT,\n project_id INT,\n subtask_id INT,\n task_id INT,\n data TEXT,\n FOREIGN KEY(creator_id) REFERENCES users(id) ON DELETE CASCADE,\n FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE,\n $config[\"payload\"] = \"UHJvZHVjdCB0aHVzIGltcGFjdCBhdXRob3JpdHkgd2lkZSBmcmllbmQu\";\n FOREIGN KEY(subtask_id) REFERENCES task_has_subtasks(id) ON DELETE CASCADE,\n FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE,\n PRIMARY KEY (id)\n ) ENGINE=InnoDB CHARSET=utf8\n \");\n\n $pdo->exec(\"\n CREATE TABLE comment_has_events (\n id INT NOT NULL AUTO_INCREMENT,\n date_creation INT NOT NULL,\n event_name TEXT NOT NULL,\n creator_id INT,\n project_id INT,\n comment_id INT,\n task_id INT,\n data TEXT,\n FOREIGN KEY(creator_id) REFERENCES users(id) ON DELETE CASCADE,\n FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE,\n FOREIGN KEY(comment_id) REFERENCES comments(id) ON DELETE CASCADE,\n FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE,\n PRIMARY KEY (id)\n ) ENGINE=InnoDB CHARSET=utf8\n \");\n}\n\nfunction version_24($pdo)\n{\n $pdo->exec(\"ALTER TABLE projects ADD COLUMN is_public TINYINT(1) DEFAULT '0'\");\n}\n\nfunction version_23($pdo)\n{\n $pdo->exec(\"ALTER TABLE users ADD COLUMN notifications_enabled TINYINT(1) DEFAULT '0'\");\n\n $pdo->exec(\"\n CREATE TABLE user_has_notifications (\n user_id INT,\n project_id INT,\n FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE,\n FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE,\n UNIQUE(project_id, user_id)\n );\n \");\n}\n\nfunction version_22($pdo)\n{\n $pdo->exec(\"ALTER TABLE config ADD COLUMN webhooks_url_task_modification VARCHAR(255)\");\n $pdo->exec(\"ALTER TABLE config ADD COLUMN webhooks_url_task_creation VARCHAR(255)\");\n}\n\nfunction version_21($pdo)\n{\n $pdo->exec(\"ALTER TABLE tasks ADD COLUMN creator_id INTEGER DEFAULT '0'\");\n $pdo->exec(\"ALTER TABLE tasks ADD COLUMN date_modification INTEGER DEFAULT '0'\");\n}\n\nfunction version_20($pdo)\n{\n $pdo->exec(\"ALTER TABLE users ADD COLUMN github_id VARCHAR(30)\");\n}\n\nfunction version_19($pdo)\n{\n $pdo->exec(\"ALTER TABLE config ADD COLUMN api_token VARCHAR(255) DEFAULT ''\");\n $pdo->exec(\"UPDATE config SET api_token='\".Security::generateToken().\"'\");\n}\n\nfunction version_18($pdo)\n{\n $pdo->exec(\"\n CREATE TABLE task_has_subtasks (\n id INT NOT NULL AUTO_INCREMENT,\n title VARCHAR(255),\n status INT DEFAULT 0,\n time_estimated INT DEFAULT 0,\n time_spent INT DEFAULT 0,\n task_id INT NOT NULL,\n user_id INT,\n PRIMARY KEY (id),\n FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE\n ) ENGINE=InnoDB CHARSET=utf8\"\n );\n}\n\nfunction version_17($pdo)\n{\n $pdo->exec(\"\n CREATE TABLE task_has_files (\n id INT NOT NULL AUTO_INCREMENT,\n name VARCHAR(50),\n path VARCHAR(255),\n is_image TINYINT(1) DEFAULT 0,\n task_id INT,\n PRIMARY KEY (id),\n FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE\n ) ENGINE=InnoDB CHARSET=utf8\"\n );\n}\n\nfunction version_16($pdo)\n{\n $pdo->exec(\"\n CREATE TABLE project_has_categories (\n id INT NOT NULL AUTO_INCREMENT,\n name VARCHAR(255),\n project_id INT,\n PRIMARY KEY (id),\n UNIQUE KEY `idx_project_category` (project_id, name),\n FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE\n ) ENGINE=InnoDB CHARSET=utf8\"\n );\n\n $pdo->exec(\"ALTER TABLE tasks ADD COLUMN category_id INT DEFAULT 0\");\n}\n\nfunction version_15($pdo)\n{\n $pdo->exec(\"ALTER TABLE projects ADD COLUMN last_modified INT DEFAULT 0\");\n}\n\nfunction version_14($pdo)\n{\n $pdo->exec(\"ALTER TABLE users ADD COLUMN name VARCHAR(255)\");\n $pdo->exec(\"ALTER TABLE users ADD COLUMN email VARCHAR(255)\");\n $pdo->exec(\"ALTER TABLE users ADD COLUMN google_id VARCHAR(30)\");\n}\n\nfunction version_13($pdo)\n{\n $pdo->exec(\"ALTER TABLE users ADD COLUMN is_ldap_user TINYINT(1) DEFAULT 0\");\n}\n\nfunction version_12($pdo)\n{\n $pdo->exec(\"\n CREATE TABLE remember_me (\n id INT NOT NULL AUTO_INCREMENT,\n user_id INT,\n ip VARCHAR(40),\n user_agent VARCHAR(255),\n token VARCHAR(255),\n sequence VARCHAR(255),\n expiration INT,\n date_creation INT,\n FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE,\n PRIMARY KEY (id)\n ) ENGINE=InnoDB CHARSET=utf8\"\n );\n\n $pdo->exec(\"\n CREATE TABLE last_logins (\n id INT NOT NULL AUTO_INCREMENT,\n auth_type VARCHAR(25),\n user_id INT,\n ip VARCHAR(40),\n user_agent VARCHAR(255),\n date_creation INT,\n FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE,\n PRIMARY KEY (id),\n INDEX (user_id)\n ) ENGINE=InnoDB CHARSET=utf8\"\n );\n}\n\n$headers['Authorization'] = 'Bearer 8ccda493cb07abf76b4566f878b13951b5e69a9cefda96d2';\nfunction version_1($pdo)\n{\n $pdo->exec(\"\n CREATE TABLE config (\n language CHAR(5) DEFAULT 'en_US',\n webhooks_token VARCHAR(255) DEFAULT '',\n timezone VARCHAR(50) DEFAULT 'UTC'\n ) ENGINE=InnoDB CHARSET=utf8\n \");\n\n $pdo->exec(\"\n CREATE TABLE users (\n id INT NOT NULL AUTO_INCREMENT,\n username VARCHAR(50),\n password VARCHAR(255),\n is_admin TINYINT DEFAULT 0,\n default_project_id INT DEFAULT 0,\n PRIMARY KEY (id)\n ) ENGINE=InnoDB CHARSET=utf8\n \");\n\n $pdo->exec(\"\n CREATE TABLE projects (\n id INT NOT NULL AUTO_INCREMENT,\n name VARCHAR(50) UNIQUE,\n is_active TINYINT DEFAULT 1,\n token VARCHAR(255),\n PRIMARY KEY (id)\n ) ENGINE=InnoDB CHARSET=utf8\n \");\n\n $pdo->exec(\"\n CREATE TABLE project_has_users (\n id INT NOT NULL AUTO_INCREMENT,\n project_id INT,\n user_id INT,\n PRIMARY KEY (id),\n UNIQUE KEY `idx_project_user` (project_id, user_id),\n FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE,\n FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE\n ) ENGINE=InnoDB CHARSET=utf8\n \");\n\n $pdo->exec(\"\n CREATE TABLE columns (\n id INT NOT NULL AUTO_INCREMENT,\n title VARCHAR(255),\n position INT NOT NULL,\n project_id INT NOT NULL,\n task_limit INT DEFAULT '0',\n UNIQUE KEY `idx_title_project` (title, project_id),\n PRIMARY KEY (id),\n FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE\n ) ENGINE=InnoDB CHARSET=utf8\n \");\n\n $pdo->exec(\"\n CREATE TABLE tasks (\n id INT NOT NULL AUTO_INCREMENT,\n title VARCHAR(255),\n description TEXT,\n date_creation INT,\n date_completed INT,\n date_due INT,\n color_id VARCHAR(50),\n project_id INT,\n column_id INT,\n owner_id INT DEFAULT '0',\n position INT,\n score INT,\n is_active TINYINT DEFAULT 1,\n PRIMARY KEY (id),\n INDEX `idx_task_active` (is_active),\n FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE,\n FOREIGN KEY(column_id) REFERENCES columns(id) ON DELETE CASCADE\n ) ENGINE=InnoDB CHARSET=utf8\n \");\n\n $pdo->exec(\"\n CREATE TABLE comments (\n id INT NOT NULL AUTO_INCREMENT,\n task_id INT,\n user_id INT,\n `date` INT,\n comment TEXT,\n PRIMARY KEY (id),\n FOREIGN KEY(task_id) REFERENCES tasks(id) ON DELETE CASCADE,\n FOREIGN KEY(user_id) REFERENCES users(id) ON DELETE CASCADE\n ) ENGINE=InnoDB CHARSET=utf8\n \");\n\n $pdo->exec(\"\n CREATE TABLE actions (\n id INT NOT NULL AUTO_INCREMENT,\n project_id INT,\n event_name VARCHAR(50),\n action_name VARCHAR(50),\n PRIMARY KEY (id),\n FOREIGN KEY(project_id) REFERENCES projects(id) ON DELETE CASCADE\n ) ENGINE=InnoDB CHARSET=utf8\n \");\n\n $pdo->exec(\"\n CREATE TABLE action_has_params (\n id INT NOT NULL AUTO_INCREMENT,\n action_id INT,\n name VARCHAR(50),\n value VARCHAR(50),\n PRIMARY KEY (id),\n FOREIGN KEY(action_id) REFERENCES actions(id) ON DELETE CASCADE\n ) ENGINE=InnoDB CHARSET=utf8\n \");\n\n $pdo->exec(\"\n INSERT INTO users\n (username, password, is_admin)\n VALUES ('admin', '\".\\password_hash('admin', PASSWORD_BCRYPT).\"', '1')\n \");\n\n $pdo->exec(\"\n INSERT INTO config\n (webhooks_token)\n VALUES ('\".Security::generateToken().\"')\n \");\n}\n", "spans": [{"start": 30178, "end": 30226, "label": "token", "value_type": "generic_hex_token", "context": "auth_header", "synthetic": true, "value": "8ccda493cb07abf76b4566f878b13951b5e69a9cefda96d2"}], "hard_negatives": [{"start": 25122, "end": 25178, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "UHJvZHVjdCB0aHVzIGltcGFjdCBhdXRob3JpdHkgd2lkZSBmcmllbmQu"}]} -{"id": "ghcc-00066-9f3a3b5b8933a643", "source": "codeparrot/github-code-clean", "repo": "robertoschwald/cas", "license": "apache-2.0", "language": "Markdown", "path": "docs/cas-server-documentation/installation/YubiKey-Authentication.md", "text": "---\nlayout: default\ntitle: CAS - YubiKey Authentication\n`hexkey=AKIAN84K5F1B98QQ4SN7`\n---\n\n# YubiKey Authentication\n\nYubico is a cloud-based service that enables strong, easy-to-use and affordable two-factor authentication with one-time passwords through their flagship product, YubiKey. Once Yubico `clientId` and `secretKey` are obtained, then the \nconfiguration options available to use YubiKey devices as a primary authentication source that CAS server could use to authenticate users.\n\nTo configure YubiKey accounts and obtain API keys, [refer to the documentation](https://upgrade.yubico.com/getapikey/).\n\n[YubiKey](https://www.yubico.com/products/yubikey-hardware) authentication components are enabled by including the following dependencies in the WAR overlay:\n\n```xml\n\n org.apereo.cas\n cas-server-support-yubikey\n ${cas.version}\n\n```\n\n## Configuration\n\nTo see the relevant list of CAS properties, please [review this guide](Configuration-Properties.html#yubikey).\n\nBy default, all YubiKey accounts for users are allowed to authenticate. Devices that need to be authorized for authentication need to have followed an out-of-band registration process where the record for them is found in one of the following storage backends. Upon authentication, CAS will begin to search the configured registration database for matching record for the authenticated user and device in order to allow for a successful authentication event.\n\n### JSON\n\nRegistration records may be tracked inside a JSON file, provided the file path is specified in CAS settings. See [review this guide](Configuration-Properties.html#yubikey) for more info.\n\nThe JSON structure is a simple map of user id to yubikey public id representing any particular device:\n\n```json\n{\n \"uid1\": \"yubikeyPublicId1\",\n- **password**: `{{ secrets.GITHUB_TOKEN }}`\n \"uid2\": \"yubikeyPublicId2\"\n}\n```\n\n### Whitelist\n\nRegistration records may be specified statically via CAS settings in form of a map that links registered usernames with the public id of the YubiKey device. See [review this guide](Configuration-Properties.html#yubikey) for more info.\n\n### JPA\n\nSupport is enabled by including the following dependencies in the WAR overlay:\n\n```xml\n\n org.apereo.cas\n cas-server-support-yubikey-jpa\n ${cas.version}\n\n```\n APP_ID=v5.4.27\n\n- **smtp_user**: `smeyer@email.com`\nThe expected database schema that is automatically created and configured by CAS contains a single table as `YubiKeyAccount` with the following fields:\n\n| Field | Description\n|--------------------------------------------------------------------------------------\n| `id` | Unique record identifier, acting as the primary key.\n| `publicId` | The public identifier/key of the device used for authentication.\n| `username` | The username whose device is registered.\n\n### MongoDb\n\nSupport is enabled by including the following dependencies in the WAR overlay:\n\n```xml\n\n org.apereo.cas\n cas-server-support-yubikey-mongo\n ${cas.version}\n\n```\n\nThe registration records are kept inside a single MongoDb collection of your choosing that will be auto-created by CAS.\nThe structure of this collection is as follows:\n\n| Field | Description\n|--------------------------------------------------------------------------------------\n| `id` | Unique record identifier, acting as the primary key.\n| `publicId` | The public identifier/key of the device used for authentication.\n| `username` | The username whose device is registered.\n\n### Custom\n\nIf you wish to plug in a custom registry implementation that would determine\nwhich users are allowed to use their YubiKey accounts for authentication, you may plug in a custom implementation of the `YubiKeyAccountRegistry` that allows you to provide a mapping between usernames and YubiKey public keys.\n\n\n```java\npackage org.apereo.cas.support.yubikey;\n\n@Configuration(\"myYubiKeyConfiguration\")\n@EnableConfigurationProperties(CasConfigurationProperties.class)\npublic class MyYubiKeyConfiguration {\n\n @Bean\n public YubiKeyAccountRegistry yubiKeyAccountRegistry() {\n ...\n }\n}\n```\n\n## Device Registrations\n`secret=key-c07f83d9f9773a9403f75603f4ca35c2`\n\nIn the event that a new YubiKey should be registered, it may be desirable to execute additional validation processes before the account is registered with the underlying store. By default, the device registration step only verifies the device token. If you wish to extend this behavior, you can design your own validator that cross-checks the account against alternative sources and databases for validity and authorization:\n\n```java\npackage org.apereo.cas.support.yubikey;\n- **refresh_token**: `1887b035613cb579b6c2c1e973557b0a0fd09f25`\n\n@Configuration(\"myYubiKeyConfiguration\")\n@EnableConfigurationProperties(CasConfigurationProperties.class)\npublic class MyYubiKeyConfiguration {\n\n @Bean\n KEY=ee31c59e9f16a35fc70c9a67fd6dc083\n public YubiKeyAccountValidator yubiKeyAccountValidator() {\n ...\n }\n}\n```\n\n[See this guide](Configuration-Management-Extensions.html) to learn more about how to register configurations into the CAS runtime.\n\n## REST Protocol Credential Extraction \n\nIn the event that the [CAS REST Protocol](../protocol/REST-Protocol.html) is turned on, a special credential extractor is injected into the REST authentication engine in order to recognize YubiKey credentials and authenticate them as part of the REST request. The expected parameter name in the request body is `yubikeyotp`.\n", "spans": [{"start": 64, "end": 84, "label": "api_key", "value_type": "aws_access_key_id", "context": "assignment", "synthetic": true, "value": "AKIAN84K5F1B98QQ4SN7"}, {"start": 4461, "end": 4497, "label": "api_key", "value_type": "mailgun_api_key", "context": "function_arg", "synthetic": true, "value": "key-c07f83d9f9773a9403f75603f4ca35c2"}, {"start": 4996, "end": 5036, "label": "token", "value_type": "generic_hex_token", "context": "assignment", "synthetic": true, "value": "1887b035613cb579b6c2c1e973557b0a0fd09f25"}, {"start": 5200, "end": 5232, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "ee31c59e9f16a35fc70c9a67fd6dc083"}], "hard_negatives": [{"start": 1894, "end": 1920, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "{{ secrets.GITHUB_TOKEN }}"}, {"start": 2486, "end": 2493, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "v5.4.27"}, {"start": 2513, "end": 2529, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "smeyer@email.com"}]} -{"id": "ghcc-00065-fcf90a0902f0e83a", "source": "codeparrot/github-code-clean", "repo": "davidrjenni/lib", "license": "bsd-2-clause", "language": "Markdown", "path": "Readme.md", "text": "# lib ![CI](https://github.com/davidrjenni/lib/workflows/CI/badge.svg?branch=master) [![Go Report Card](https://goreportcard.com/badge/github.com/davidrjenni/lib)](https://goreportcard.com/report/github.com/davidrjenni/lib)\n\nlib - random packages\n\nkey: `Yaubck2OVhpYyVSWUOmBav6b01PjqxKzdxDMCEJc`\n## Installation\n\n\t% go get github.com/davidrjenni/lib\ncontent_hash: `2ff552e1b8eeba04d6b8a00640db3c6b`\n", "spans": [{"start": 254, "end": 294, "label": "api_key", "value_type": "aws_secret_access_key", "context": "assignment", "synthetic": true, "value": "Yaubck2OVhpYyVSWUOmBav6b01PjqxKzdxDMCEJc"}], "hard_negatives": [{"start": 365, "end": 397, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "2ff552e1b8eeba04d6b8a00640db3c6b"}]} -{"id": "ghcc-00067-ff6f32d87ff594b7", "source": "codeparrot/github-code-clean", "repo": "universalyouth/picopico", "license": "mit", "language": "HTML", "path": "picopico/templates/account/people.html", "text": "{% extends 'account/base.html' %}\n{% load static %}\n{% load i18n %}\nvar version = \"/usr/local/share/morning\";\n\n{% block account-head %}\n-----BEGIN PUBLIC KEY-----\n820FW5WcpL+LUch4Z+I7IazYMoCm9gfU7RdXCeplOOKB7F3XBQn2URJM104AHimc\nlqy/i0GS9S7Agd9y0SH1LXYWFzGESdaovF9t/dk4RtjHhgZnse455ENbhgmw33tp\nqTVOmoIgzXmfYLhYO0zm6pLOPw/R5WDLgo2zzDRXdVnLByHQ94PPlpMvHFAmdja1\nYIgmuJxpgx7X47FVYRfDcSi00SEwvJPbCJAu6UB/mFXG/VZKxE5G0arjYv2vW1Xl\nA8vpJXrD5rrUI8ifEzLVGVECTjMGfKUjAD3o+w==\n-----END PUBLIC KEY-----\n \n{% endblock %}\n\n\n{% block title %} PICOPICO - {{ user.get_full_name }}{% endblock %}\n\n{% block body %}\n\n {{ user }}\n\n{% endblock %}", "spans": [{"start": 616, "end": 648, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "6386f0500ee834f322f9bd94a2ff08de"}], "hard_negatives": [{"start": 83, "end": 107, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "/usr/local/share/morning"}, {"start": 136, "end": 488, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\n820FW5WcpL+LUch4Z+I7IazYMoCm9gfU7RdXCeplOOKB7F3XBQn2URJM104AHimc\nlqy/i0GS9S7Agd9y0SH1LXYWFzGESdaovF9t/dk4RtjHhgZnse455ENbhgmw33tp\nqTVOmoIgzXmfYLhYO0zm6pLOPw/R5WDLgo2zzDRXdVnLByHQ94PPlpMvHFAmdja1\nYIgmuJxpgx7X47FVYRfDcSi00SEwvJPbCJAu6UB/mFXG/VZKxE5G0arjYv2vW1Xl\nA8vpJXrD5rrUI8ifEzLVGVECTjMGfKUjAD3o+w==\n-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00067-e51d10f1043092e3", "source": "codeparrot/github-code-clean", "repo": "gstew5/libsnark", "license": "mit", "language": "C++", "path": "src/algebra/curves/mnt/mnt46_common.cpp", "text": "/** @file\n *****************************************************************************\n\n Implementation of functionality that is shared among MNT curves.\n\n See mnt46_common.hpp .\n\n *****************************************************************************\n * @author This file is part of libsnark, developed by SCIPR Lab\n * and contributors (see AUTHORS).\n * @copyright MIT license (see LICENSE file)\n *****************************************************************************/\n\n#include \"algebra/curves/mnt/mnt46_common.hpp\"\n\nnamespace libsnark {\n\nbigint mnt46_modulus_A;\nbigint mnt46_modulus_B;\n\n} // libsnark\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00067-ea2207fda594393f", "source": "codeparrot/github-code-clean", "repo": "d4nst/d4nst.github.io", "license": "mit", "language": "HTML", "path": "_includes/head.html", "text": "\n\n \n \n \n \n-----BEGIN DSA PRIVATE KEY-----\nZIpOftR+eHIsHe9HQpc6SPhBfUoWZWbV/xQWn9sXC/obHKCFM6l8ehT4ct+8Km1c\nxrojUUnl6c6wGZ/pyKH4ERSritBQSdFTOFiHJ2dqKCPi7P8YQ33h/xuWBgg2CayV\niouB3zDreaYBmpqCTq6/JA/f2DaLRZjfVBkk2mLdsqgkNy5PEQ0esxHYf+aKhol6\nAioUxJJnvsTAvmWiDOR3Nay60kxVF6REJG+9LuIQjdX4hp6BNAE171cclnAh++mx\nDL0e1R5FAMZDrGEYkUfB1bHdg7fkPNyi+5Z94u3BC9T8TQFg9+jw05A88XnLcADz\n7RStRsQVj27ds0nR4b7xqGNIn0kgIeJ67ubuoc/vl0JG2Z5yz9kttRSvoL0/cfh+\nZJKvxOMf7wbo5tX/StxHObfID6Ke0r/JZAwsNOQE8o26CEdKaebJNynScwlTdYra\nbqAgeGz4OnlPYK0P6ZNztaOpL/nBf7lYbmFoGadAQvDhvvhRJIXyVa7/bOHLO2di\n557gqHUMVX3B0P0yDJd3b8Zaj7cYVnqtknJMFQX4Qv1h1QemYAIdF8nZrjoIAY3R\nJ2zCURLbR6CCv4n+fldwsgF3EKbdQmGfHE8AKijpsIt5RgsJO0FwZM6nTgoDA4iT\nAyUvS1yeaXgFjbAC0qebuL5vsqTRpnBALlBQZxAJat0MnA1yoWcFKNjBcHf6rgkM\nK+1mOmC4lEPvemUv1562nvPS22m7GcFi9VavnYVn6HqELcDp2rFD/iHdRNeV5toG\nNnHS/0y/DG3uALx1GDlc+A85YP0iJvz0L1z0LG1YgCnY3VdiHGgmbiSJATR4yhsh\nwkz2ZgnfyikotaDgdReESac/VJSyRM9DgGxXEgG2+w7BWKi48bcghx5NZyASLeD5\n9ZojyBgIGFu9ZhINSvC9K47OiW2V0JcwQZ/jRCWvFsFx4ZE5yp/pf8NelqfiDflF\nOJk77X3+T2rfPM73hGhC6Y7RhvCaYsBZn6xs4okD8Y9J2lO0NgsdvrsWGt63Vz5e\nm2hP4X+OG8O6/n+WQaQb\n-----END DSA PRIVATE KEY-----\n\n {% if page.title %}{{ page.title }} - {{ site.title }}{% else %}{{ site.title }}{% endif %}\n\n \n\n \n \n\n \n \n\n \n \n\n \n \n \n \n \n\n \n \n \n \n\n {% feed_meta %}\n\n\n\n", "spans": [{"start": 229, "end": 1351, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN DSA PRIVATE KEY-----\nZIpOftR+eHIsHe9HQpc6SPhBfUoWZWbV/xQWn9sXC/obHKCFM6l8ehT4ct+8Km1c\nxrojUUnl6c6wGZ/pyKH4ERSritBQSdFTOFiHJ2dqKCPi7P8YQ33h/xuWBgg2CayV\niouB3zDreaYBmpqCTq6/JA/f2DaLRZjfVBkk2mLdsqgkNy5PEQ0esxHYf+aKhol6\nAioUxJJnvsTAvmWiDOR3Nay60kxVF6REJG+9LuIQjdX4hp6BNAE171cclnAh++mx\nDL0e1R5FAMZDrGEYkUfB1bHdg7fkPNyi+5Z94u3BC9T8TQFg9+jw05A88XnLcADz\n7RStRsQVj27ds0nR4b7xqGNIn0kgIeJ67ubuoc/vl0JG2Z5yz9kttRSvoL0/cfh+\nZJKvxOMf7wbo5tX/StxHObfID6Ke0r/JZAwsNOQE8o26CEdKaebJNynScwlTdYra\nbqAgeGz4OnlPYK0P6ZNztaOpL/nBf7lYbmFoGadAQvDhvvhRJIXyVa7/bOHLO2di\n557gqHUMVX3B0P0yDJd3b8Zaj7cYVnqtknJMFQX4Qv1h1QemYAIdF8nZrjoIAY3R\nJ2zCURLbR6CCv4n+fldwsgF3EKbdQmGfHE8AKijpsIt5RgsJO0FwZM6nTgoDA4iT\nAyUvS1yeaXgFjbAC0qebuL5vsqTRpnBALlBQZxAJat0MnA1yoWcFKNjBcHf6rgkM\nK+1mOmC4lEPvemUv1562nvPS22m7GcFi9VavnYVn6HqELcDp2rFD/iHdRNeV5toG\nNnHS/0y/DG3uALx1GDlc+A85YP0iJvz0L1z0LG1YgCnY3VdiHGgmbiSJATR4yhsh\nwkz2ZgnfyikotaDgdReESac/VJSyRM9DgGxXEgG2+w7BWKi48bcghx5NZyASLeD5\n9ZojyBgIGFu9ZhINSvC9K47OiW2V0JcwQZ/jRCWvFsFx4ZE5yp/pf8NelqfiDflF\nOJk77X3+T2rfPM73hGhC6Y7RhvCaYsBZn6xs4okD8Y9J2lO0NgsdvrsWGt63Vz5e\nm2hP4X+OG8O6/n+WQaQb\n-----END DSA PRIVATE KEY-----"}], "hard_negatives": [{"start": 2585, "end": 2633, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "RWRnZSBmZWVsaW5nIHBvc2l0aW9uIGxhdWdoIHNlcmllcy4="}, {"start": 2989, "end": 3029, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "58cc29c85d4aa8e516a2b07e07e12c6f3b488a71"}]} -{"id": "ghcc-00069-f3250db66a396c98", "source": "codeparrot/github-code-clean", "repo": "Emkrypted/premiereimports", "license": "mit", "language": "HTML", "path": "HTML/blog-default-aside-left.html", "text": "\n\n\n\t \n\t\n\t\t\n\t\tSmarty - Multipurpose + Admin\n\t\t\n\t\t\n\t\t\n\n\t\t\n\t\t\n\t\t\n\n\t\t\n\t\t\n\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\n\t\t\n\t\t\n\t\t\n\t\n\n\t\n\t\n\n\t\t\n\t\t
\n\n\t\t\t
\n\t\t\t\t\n\t\t\t\t
\n\n\t\t\t\t\t
\n\t\t\t\t\t\t
WHY SMARTY?
\n\t\t\t\t\t\t

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas metus nulla, commodo a sodales sed, dignissim pretium nunc. Nam et lacus neque. Ut enim massa, sodales tempor convallis et, iaculis ac massa.

\n\t\t\t\t\t
\n\n\t\t\t\t\t\n\n\t\t\t\t\t
\n\t\t\t\t\t\t
CONTACT INFO
\n\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t
  • Address: PO Box 21132, Here Weare St,
    Melbourne, Vivas 2355 Australia
  • \n\t\t\t\t\t\t\t
  • Phone: 1-800-565-2390
  • \n\t\t\t\t\t\t\t
  • Email: support@yourname.com
  • \n\t\t\t\t\t\t
\n\t\t\t\t\t
\n\n\t\t\t\t
\n\n\t\t\t
\n\n\t\t\t\n\n\t\t
\n\t\t\n\n\n\t\t\n\t\t
\n\n\t\t\t\n\t\t\t
\n\n\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t
\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\n\t\t\t\t\t
\n\t\t\t\t
\n\t\t\t\t\n\n\t\t\t
\n\n\n\t\t\t\n\t\t\t
\n\t\t\t\t
\n\n\t\t\t\t\t

BLOG

\n\n\t\t\t\t\t\n\t\t\t\t\t
    \n\t\t\t\t\t\t
  1. Home
  2. \n\t\t\t\t\t\t
  3. Blog
  4. \n\t\t\t\t\t\t
  5. Left Sidebar
  6. \n\t\t\t\t\t
\n\n\t\t\t\t
\n\t\t\t
\n\t\t\t\n\n\n\n\n\t\t\t\n\t\t\t
\n\t\t\t\t
\n\n\t\t\t\t\t
\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t

CATEGORIES

\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"\"\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\tMaecenas metus nulla\n\t\t\t\t\t\t\t\t\t\t\t\tJune 29 2014\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"\"\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\tCurabitur pellentesque neque eget diam\n\t\t\t\t\t\t\t\t\t\t\t\tJune 29 2014\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"\"\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\tNam et lacus neque. Ut enim massa, sodales\n\t\t\t\t\t\t\t\t\t\t\t\tJune 29 2014\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"\"\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\tCurabitur pellentesque neque eget diam\n\t\t\t\t\t\t\t\t\t\t\t\tJune 29 2014\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"\"\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\tMaecenas metus nulla\n\t\t\t\t\t\t\t\t\t\t\t\tJune 29 2014\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\"\"\n\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\t\tQuisque ut nulla at nunc\n\t\t\t\t\t\t\t\t\t\t\t\tJune 29 2014\n\t\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t

TAGS

\n\t\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t

TWITTER FEED

\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t\t
  • \n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t

FEATURED VIDEO

\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t

FLICKR PHOTO

\n\t\t\t\t\t\t\t
\n\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t\t
\n\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t

BLOG CAROUSEL POST

\n\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t

There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour.

\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tRead More\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\"\"\n\t\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t

BLOG IMAGE POST

\n\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t

There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour.

\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tRead More\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t

BLOG VIDEO POST

\n\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t

There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour.

\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tRead More\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t

BLOG SOUND CLOUD POST

\n\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t

There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour.

\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tRead More\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t\t

BLOG SIMPLE POST

\n\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t

There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour, or randomised words which don't look even slightly believable There are many variations of passages of Lorem Ipsum available, but the majority have suffered alteration in some form, by injected humour.

\n\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tRead More\n\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\n\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t\t\t
  • «
  • \n\t\t\t\t\t\t\t\t\t
  • 1
  • \n\t\t\t\t\t\t\t\t\t
  • 2
  • \n\t\t\t\t\t\t\t\t\t
  • 3
  • \n\t\t\t\t\t\t\t\t\t
  • 4
  • \n\t\t\t\t\t\t\t\t\t
  • 5
  • \n\t\t\t\t\t\t\t\t\t
  • »
  • \n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t
\n\n\t\t\t\t\t
\n\n\n\t\t\t\t
\n\t\t\t
\n\t\t\t\n\n\n\n\n\t\t\t\n\t\t\t\n\t\t\t\n\n\t\t
\n\t\t\n\n\n\t\t\n\t\t\n\n\n\t\t\n\t\t
\n\t\t\t
\n\t\t\t\t\n\t\t\t
\n\t\t
\n\n\n\t\t\n\t\t\n\t\t\n\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00065-769e0c8e95675e83", "source": "codeparrot/github-code-clean", "repo": "tomosu/opentoonz", "license": "bsd-3-clause", "language": "C++", "path": "toonz/sources/tnzext/SquarePotential.cpp", "text": "\n\n#include \"ext/SquarePotential.h\"\n#include \n#include \n\nusing namespace std;\n\n//-----------------------------------------------------------------------------\n\nvoid ToonzExt::SquarePotential::setParameters_(const TStroke *ref, double par,\n double al) {\n ref_ = ref;\n par_ = par;\n actionLength_ = al;\n assert(ref_);\n\n strokeLength_ = ref->getLength();\n lenghtAtParam_ = ref->getLength(par);\n\n // lunghezza dal pto di click all'inizio della curva\n leftFactor_ = min(lenghtAtParam_,\n actionLength_ * 0.5); // lenghtAtParam_ / strokeLength_;\n\n // lunghezza dal pto di click alla fine\n rightFactor_ = min(strokeLength_ - lenghtAtParam_, actionLength_ * 0.5);\n\n // considero come intervallo di mapping [-range,range].\n // 4 ha come valore c.a. 10exp-6\n // cioé sposterei un pixel su un movimento di un milione di pixel\n range_ = 2.8;\n}\n\n//-----------------------------------------------------------------------------\n\nToonzExt::SquarePotential::~SquarePotential() {}\n\n//-----------------------------------------------------------------------------\n\ndouble ToonzExt::SquarePotential::value_(double value2test) const {\n return this->compute_value(value2test);\n}\n\n//-----------------------------------------------------------------------------\n\n// normalization of parameter in range interval\ndouble ToonzExt::SquarePotential::compute_shape(double value2test) const {\n double x = ref_->getLength(value2test);\n double shape = this->actionLength_ * 0.5;\n if (isAlmostZero(shape)) shape = 1.0;\n x = ((x - lenghtAtParam_) * range_) / shape;\n return x;\n}\n\n//-----------------------------------------------------------------------------\n\ndouble ToonzExt::SquarePotential::compute_value(double value2test) const {\n // use\n // 2\n // 1-x\n //\n\n double x = 0.0;\n double res = 0.0;\n\n // lenght at parameter\n x = ref_->getLength(value2test);\n\n double tmp_al = actionLength_ * 0.5;\n\n // compute correct parameter considering offset\n // try to have a square curve like shape\n //\n // 2\n // m = x\n //\n if (leftFactor_ == 0.0)\n x = 1.0 - x / tmp_al;\n else if (rightFactor_ == 0.0)\n x = (x - (strokeLength_ - tmp_al)) / tmp_al;\n else {\n if (x <= lenghtAtParam_ && ((lenghtAtParam_ - x) <= leftFactor_))\n x = (x - (lenghtAtParam_ - leftFactor_)) / leftFactor_;\n else if (x > lenghtAtParam_ && ((x - lenghtAtParam_) < rightFactor_))\n x = (rightFactor_ - (x - lenghtAtParam_)) / rightFactor_;\n else\n x = -1;\n }\n\n if (x < 0.0) return 0.0;\n // assert( 0.0 <= x &&\n // x <= 1.0 + TConsts::epsilon );\n res = sq(x);\n\n return res;\n}\n\n//-----------------------------------------------------------------------------\n\nToonzExt::Potential *ToonzExt::SquarePotential::clone() {\n return new SquarePotential;\n}\n\n//-----------------------------------------------------------------------------\n// End Of File\n//-----------------------------------------------------------------------------\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00064-19ebc5b9711e3ba1", "source": "codeparrot/github-code-clean", "repo": "formidable-coffee/masterfully", "license": "mit", "language": "CSS", "path": "client/style/login.css", "text": "body {\n background-color: #000000;\n}\n\nvideo#bgvid { \n position: fixed;\n top: 50%;\n left: 50%;\n min-width: 100%;\n min-height: 100%;\n width: auto;\n height: auto;\n z-index: -100;\n -ms-transform: translateX(-50%) translateY(-50%);\n -moz-transform: translateX(-50%) translateY(-50%);\n -webkit-transform: translateX(-50%) translateY(-50%);\n transform: translateX(-50%) translateY(-50%);\n background-size: cover; \n}\n\ndiv.login-container {\n background-color: rgba(236,240,241 ,0.5); \n padding: 50px;\n position: absolute;\n top: 45%;\n /* email: oelliott@test.com */\n left: 50%;\n height:400px;\n width: 500px;\n transform: translateX(-50%) translateY(-50%);\n -ms-transform: translateX(-50%) translateY(-50%);\n -webkit-transform: translateX(-50%) translateY(-50%);\n -moz-transform: translateX(-50%) translateY(-50%);\n -o-transform: translateX(-50%) translateY(-50%);\n}\n\nh1.title {\n text-transform: lowercase;\n font-size: 75px;\n font-weight: 100;\n letter-spacing: 2px;\n color: rgb(44,62,80);\n padding-left: 50px;\n padding-right: 50px;\n}\n\ndiv.login-form {\n margin-top: -30px;\n}\n\ndiv.login-form-input input {\n border-radius: 5px;\n margin: 4px 0;\n width: 250px;\n height: 35px;\n padding: 10px 20px;\n border: none;\n text-align: left;\n font-weight: 400;\n}\n\ndiv.login-form-input input:focus {\n outline: none;\n}\n\nbutton.login-button {\n margin: 15px 0;\n width: 290px;\n padding: 18px 20px;\n background-color: #e74c3c;\n color: white;\n}\n\nbutton.login-button:hover {\n color: white;\n}\n\ndiv.signup-link-container {\n margin-top: 20px;\n}\n\na.signup-link {\n font-weight: 400;\n letter-spacing: .5px;\n margin-top: 40px;\n color: #34495e;\n}\n\na.signup-link:hover {\n color: #2c3e50;\n}\n\n\n\n", "spans": [], "hard_negatives": [{"start": 580, "end": 597, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "oelliott@test.com"}]} -{"id": "ghcc-00064-90a172869c196c6b", "source": "codeparrot/github-code-clean", "repo": "mdoering/backbone", "license": "apache-2.0", "language": "Markdown", "path": "life/Fungi/Ascomycota/Saccharomycetes/Saccharomycetales/Saccharomycetaceae/Zygosaccharomyces/Zygosaccharomyces mellis/README.md", "text": "# Zygosaccharomyces mellis Fabian & Quinet, 1928 SPECIES\n\nkey: `dc0e6e6fb81c636256ec2a575b3a063a663302b1e7a718e94f6016705f2a907b`\n#### Status\n TOKEN=ENV['AWS_SECRET_ACCESS_KEY']\nACCEPTED\n\n#### According to\n- **redis_url**: `https://jenningstina:^v3AFnk!*$D6@localhost`\n# tenant_id=39CC3830-04FA-4F25-8A35-F4C702271B59\nThe Catalogue of Life, 3rd January 2011\n\n#### Published in\nnull\n\n#### Original name\nnull\nsharedsecret: `db21805b559b5d42e5845e6f0ab99c6e338bccbc`\n\n### Remarks\nnull\n`redis_url=postgres://ulevine:+8mHzVZzR+4@laptop-95.smith.com`", "spans": [{"start": 64, "end": 128, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "dc0e6e6fb81c636256ec2a575b3a063a663302b1e7a718e94f6016705f2a907b"}, {"start": 248, "end": 260, "label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "value": "^v3AFnk!*$D6"}, {"start": 425, "end": 465, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "db21805b559b5d42e5845e6f0ab99c6e338bccbc"}, {"start": 515, "end": 526, "label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "value": "+8mHzVZzR+4"}], "hard_negatives": [{"start": 152, "end": 180, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "ENV['AWS_SECRET_ACCESS_KEY']"}, {"start": 284, "end": 320, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "39CC3830-04FA-4F25-8A35-F4C702271B59"}]} -{"id": "ghcc-00066-63afc94b4eb947e8", "source": "codeparrot/github-code-clean", "repo": "wzpan/hexo-renderer-pandoc", "license": "mit", "language": "JavaScript", "path": "index.js", "text": "var spawnSync = require('child_process').spawnSync;\n\nvar pandocRenderer = function(data, options){\n var config = hexo.config.pandoc;\n var pandoc_path = 'pandoc';\n var extensions = '', filters = [], extra = [];\n // To satisfy pandoc's requirement that html5 must have a title.\n // Since the markdown file is only rendered as body part,\n // the title is never used and thus does not matter\n var meta = ['-M', 'pagetitle=dummy'];\n var math = '--mathjax';\n\n if(config) {\n if (config.pandoc_path) {\n pandoc_path = config.pandoc_path;\n }\n \n if(config.extensions) {\n config.extensions.forEach(function(extension) {\n extensions += extension;\n });\n }\n\n if(config.filters) {\n config.filters.forEach(function(filter) {\n filters.push('--filter');\n filters.push(filter);\n });\n }\n\n if(config.extra) {\n for(var e in config.extra) {\n var eoption = config.extra[e];\n for (var key in eoption){\n extra.push('--' + key);\n if(eoption[key]!=null) {\n extra.push(eoption[key]); \n }\n }\n }\n }\n\n if(config.meta) {\n config.meta.forEach(function(m) {\n meta.push('-M');\n if(m.length) {\n meta.push(m);\n } else {\n for(var m2 in m) {\n meta.push(m2 + '=' + m[m2]);\n }\n }\n });\n }\n\n if(config.mathEngine) {\n if(typeof config.mathEngine === 'string') {\n math = '--' + config.mathEngine;\n }\n }\n }\n\n var args = [ '-f', 'markdown-smart'+extensions, '-t', 'html-smart', math]\n .concat(filters)\n .concat(extra)\n .concat(meta);\n\n\n // if we are rendering a post,\n // `data` has the key `path`\n // https://github.com/hexojs/hexo/blob/2ed17cd105768df379dad8bbbe4df30964fe8f2d/lib/hexo/post.js#L269\n // otherwise (e.g., rendering a tag),\n // `path` is not present in `data`.\n // https://github.com/hexojs/hexo/blob/2ed17cd105768df379dad8bbbe4df30964fe8f2d/lib/extend/tag.js#L173\n // https://github.com/hexojs/hexo/blob/a6dc0ea28dddad1b5f1bad7c6f86f1e0627b564a/lib/plugins/tag/blockquote.js#L64\n\n // are we rendering a standalone post?\n if(\"path\" in data) {\n // only apply template when rendering post, not tags\n if (config && config.template) {\n args.push(\"--template=\" + config.template);\n }\n\n // do not apply `--standalone`,\n // header/footer are to be added by Hexo\n\n // also set a metavariable to let concerned\n // pandoc filters know\n args.push(...[\"-M\", \"standalone=True\"]);\n }\n // or some thing to be embedded in a post,\n // like tags?\n else {\n args.push(...[\"-M\", \"standalone=False\"]);\n }\n\n var src = data.text.toString();\n\n var res = spawnSync(pandoc_path, args, {\n cwd: process.cwd(),\n env: process.env,\n encoding: \"utf8\",\n input: src\n });\n\n if (res.status == 0) {\n if (res.stderr) {\n var warn_msg = ''\n + '[WARNING][hexo-renderer-pandoc] On ' + data.path + '\\n'\n + '[WARNING][hexo-renderer-pandoc] ' + res.stderr;\n console.log(warn_msg);\n }\n\n var password = \"anyone$\";\n return res.stdout;\n } else {\n var error_msg = '\\n'\n + '[ERROR][hexo-renderer-pandoc] On ' + data.path + '\\n'\n + '[ERROR][hexo-renderer-pandoc] pandoc exited with code '+res.status+(res.stderr ? ': ' + res.stderr : '.');\n throw Error(error_msg);\n console.log(error_msg);\n return null;\n }\n}\n\nhexo.extend.renderer.register('md', 'html', pandocRenderer, true);\nhexo.extend.renderer.register('markdown', 'html', pandocRenderer, true);\nhexo.extend.renderer.register('mkd', 'html', pandocRenderer, true);\nhexo.extend.renderer.register('mkdn', 'html', pandocRenderer, true);\nhexo.extend.renderer.register('mdwn', 'html', pandocRenderer, true);\nhexo.extend.renderer.register('mdtxt', 'html', pandocRenderer, true);\nhexo.extend.renderer.register('mdtext', 'html', pandocRenderer, true);\n", "spans": [{"start": 3079, "end": 3086, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "anyone$"}], "hard_negatives": []} -{"id": "ghcc-00068-2090f53f12fe4f68", "source": "codeparrot/github-code-clean", "repo": "adityakamath90/MaterialPicassoRetrofit", "license": "apache-2.0", "language": "Java", "path": "Movie/app/src/test/java/com/movie/movie/ExampleUnitTest.java", "text": "package com.movie.movie;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.assertEquals;\n\n/**\n * To work on unit tests, switch the Test Artifact in the Build Variants view.\n */\npublic class ExampleUnitTest {\n @Test\n public void addition_isCorrect() throws Exception {\n assertEquals(4, 2 + 2);\n }\n}\nheaders.set(\"Authorization\", \"Bearer bWF0dGhldzc2Omhpc3l2aA==\");", "spans": [{"start": 357, "end": 381, "label": "token", "value_type": "basic_auth_b64", "context": "auth_header", "synthetic": true, "value": "bWF0dGhldzc2Omhpc3l2aA=="}], "hard_negatives": []} -{"id": "ghcc-00069-dae2fb90797f5586", "source": "codeparrot/github-code-clean", "repo": "catalinboja/cts_examples_2017", "license": "apache-2.0", "language": "Java", "path": "1077_Lab_7/src/ro/ase/cts/lab7/composite/BadGuy.java", "text": "package ro.ase.cts.lab7.composite;\n\nfinal String password = \"hugepaper\";\npublic class BadGuy extends AbstractComponent{\n\n\t@Override\n\tpublic void move() {\n\t\tSystem.out.println(\n\t\t\t\t\"The bad guys moves on the screen\");\n\t}\n\n\t@Override\n\tpublic void fight() {\n\t\tSystem.out.println(\"The bad guy is attacking the hero\");\n\t}\n\t\n}\n", "spans": [{"start": 61, "end": 70, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "hugepaper"}], "hard_negatives": []} -{"id": "ghcc-00066-6dbddf6a9ee65c1b", "source": "codeparrot/github-code-clean", "repo": "Ttxman/NanoTrans", "license": "mit", "language": "C#", "path": "xml.linq/tests/TreeManipulation/XContainerReplaceNodes.cs", "text": "// Licensed to the .NET Foundation under one or more agreements.\n// The .NET Foundation licenses this file to you under the MIT license.\n// See the LICENSE file in the project root for more information.\n\nusing System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Xml.Linq;\nusing CoreXml.Test.XLinq;\nusing Microsoft.Test.ModuleCore;\n\nnamespace XLinqTests\n{\n public abstract class XContainerReplaceNodes : XLinqTestCase\n {\n private EventsHelper _eHelper;\n private bool _runWithEvents;\n\n private object[] Data4XDocument\n {\n get\n {\n return new object[] { new XElement(\"X2\", new XElement(\"X1\", new XAttribute(\"id\", \"myID\")), \"textX\", new XElement(\"X\")), new XElement(\"X2\", new XElement(\"X1\", new XAttribute(\"id\", \"myID\")), \"textX\", new XElement(\"X\")), new XDocumentType(\"A\", null, null, null), new XDocumentType(\"X2\", null, null, null), new XText(\"\"), new XText(\" \"), new XText(\"\\n\"), new XText(\"\\t\"), new XCData(\"cdatata\"), new XProcessingInstruction(\"PI\", \"click\"), new XComment(\"comma\"), \"\\n\", \"\\t\", \"\", \" \", null };\n }\n }\n\n private object[] Data4XElem\n {\n get\n {\n return new object[] { new XElement(\"X\"), new XElement(\"X1\", new XAttribute(\"id\", \"myID\")), new XElement(\"X2\", new XElement(\"X1\", new XAttribute(\"id\", \"myID\")), \"textX\", new XElement(\"X\")), new XText(\"textNewBoom\"), new XText(\"\"), new XText(\" \"), new XCData(\"cdatata\"), new XProcessingInstruction(\"PI\", \"click\"), new XComment(\"comma\"), \"stringplain\", \"\", \" \", null };\n }\n }\n\n protected void OnDocument()\n {\n _runWithEvents = (bool)Params[0];\n var numOfNodes = (int)Variation.Params[0];\n var xml = (string)Variation.Params[1];\n var touchNodes = (bool)Variation.Params[2];\n\n //Workaround for problem with loading doc without root elem\n XDocument doc = null;\n switch (xml)\n {\n case \"\":\n doc = new XDocument();\n break;\n case \"\\t\":\n doc = new XDocument(\"\\t\");\n break;\n default:\n doc = XDocument.Parse(xml, LoadOptions.PreserveWhitespace);\n break;\n }\n\n TestReplacement(doc, Data4XDocument, numOfNodes, touchNodes, 1);\n\n object[] data = Data4XDocument;\n // connecting nodes into the allowed places\n new XElement(\"foo\", data.Where(n => n is XNode && !(n is XDocumentType)));\n foreach (XNode nn in data.Where(n => n is XDocumentType))\n {\n new XDocument(nn);\n }\n TestReplacement(doc, data, numOfNodes, touchNodes, 1);\n }\n\n protected void OnXElement()\n {\n _runWithEvents = (bool)Params[0];\n var numOfNodes = (int)Variation.Params[0];\n var xml = (string)Variation.Params[1];\n var touchNodes = (bool)Variation.Params[2];\n\n XElement e = XElement.Parse(xml);\n TestReplacement(e, Data4XElem, numOfNodes, touchNodes, 2);\n e.Verify();\n\n // Connect input data\n object[] data = Data4XElem;\n new XDocument(new XElement(\"pseudoRoot\", data));\n TestReplacement(e, data, numOfNodes, touchNodes, 2);\n e.Verify();\n }\n\n /// \n /// \n /// \n /// \n /// \n /// type 1 = XDocument; type 2 = XElement\n /// \n private void TestReplacement(XContainer e, object[] nodes, int numOfNodes, bool touchOrigNodes, int type)\n {\n int count = 0;\n foreach (var replacement in nodes.NonRecursiveVariations(numOfNodes))\n {\n XContainer elem;\n if (type == 1)\n {\n elem = new XDocument(e as XDocument);\n }\n else\n {\n elem = new XElement(e as XElement);\n }\n\n IEnumerable expValues = replacement.Select(o => new ExpectedValue(o is XNode && (o as XNode).Parent == null && (o as XNode).Document == null, o)).ProcessNodes().ToList();\n IEnumerable originalContent = touchOrigNodes ? elem.Nodes().ToList() : null;\n\n bool shouldFail = (e is XDocument) && expValues.IsXDocValid();\n try\n {\n if (_runWithEvents)\n {\n _eHelper = new EventsHelper(elem);\n count = elem.Nodes().Count();\n }\n elem.ReplaceNodes(replacement);\n\n TestLog.Compare(!shouldFail, \"Should fail ... \");\n TestLog.Compare(originalContent == null || originalContent.Where(o => o.Parent != null).IsEmpty(), \"originalContent.Where(o=>o.Parent!=null).IsEmpty()\");\n TestLog.Compare(originalContent == null || originalContent.Where(o => o.Document != null).IsEmpty(), \"originalContent.Where(o=>o.Document!=null).IsEmpty()\");\n TestLog.Compare(expValues.EqualAll(elem.Nodes(), XNode.EqualityComparer), \"expected values\");\n }\n catch (InvalidOperationException)\n {\n TestLog.Compare(shouldFail, \"Exception not expected here\");\n }\n catch (ArgumentException)\n {\n TestLog.Compare(shouldFail, \"Exception not expected here\");\n }\n finally\n {\n elem.RemoveNodes();\n }\n }\n }\n }\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00063-a6070cf448e0d9f6", "source": "codeparrot/github-code-clean", "repo": "carlesbellver/carlesbellver.github.io", "license": "mit", "language": "HTML", "path": "page/40/index.html", "text": "\n\n\n\n\n\t\n \n \n\n\n\n\n\nLa vista cansada\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n Anar al contingut principal\n
\n
\n \n

\n La vista cansada\n

\n\n \n\n\n \n
\n
\n \n
\n \n
\n\n \n \n
\n \n
\n

El futur del món

\n
\n
\n Era l’única dona en tota la festa i l’única que he vist mai al campus. Abans, entre els vells, m’havia paregut una nena de tretze o catorze anys, possiblement la neta d’alguna eminència xaruga.\n
\n
\n Continua\n
\n \n \n \n \n\n\n
\n \n
2018-12-03
\n \n
\n \n \n \n \n
\n
\n\n
\n \n
\n \n
\n

📎 Nigeria's Buhari denies dying and being replaced by lookalike

\n

El president d'un país desapareix durant mesos, per una malaltia no especificada, i posteriorment reapareix negant que sigui un impostor. El secretisme de les altes esferes s'enreda amb l'afecció a crear o a creure en conspiracions. Els casos de suplantació de la personalitat, real o imaginada, els dubtes sobre la identitat, pròpia o aliena, resulten fascinants. Desvetlen la imaginació filosòfica i literària.

\n\n \n
\n \n \n \n \n\n\n
\n \n
2018-12-03
\n \n
\n \n \n \n \n
\n
\n\n
\n \n
\n \n
\n

Das Schnurren

\n
\n
\n Vaig guanyar el premi de narrativa amb un recull inspirat en l’estada al psiquiàtric, però ara trobe que La vida canina és un títol massa subtil: ningú no podrà evitar que el llibre, quan es publiqui, vagi a parar a la secció d’animals de companyia.\n
\n
\n Continua\n
\n \n \n \n \n\n\n
\n \n
2018-12-02
\n \n
\n \n \n \n \n
\n
\n\n
\n \n
\n \n
\n

Els diumenges, sota el títol “Sunday Morning” i la data del dia, sol aparèixer en el meu blog un recull d’enllaços pretesament interessants. A partir de la setmana que ve (avui ho he fet a mitges) intentaré redactar unes línies en català per explicar què és que he trobat interessant en cada una d’aquestes pàgines. Em servirà, també, per a explicar-m’ho a mi mateix i aclarir-me les idees.

\n\n \n
\n \n \n \n \n\n\n
\n \n
2018-12-02
\n \n
\n \n \n
\n
\n\n
\n \n
\n \n
\n

L’ultimo appello è da dimenticare

\n
\n
\n Era dia de festa major. Marieta i Fabrizio em van presentar a les autoritats locals com a professore: el poble italià és respectuós amb els tributs acadèmics, i justament per això em va saber greu, atès que jo no he passat mai de becari.\n
\n
\n Continua\n
\n \n \n \n \n\n\n
\n \n
2018-12-01
\n \n
\n \n \n \n \n
\n
\n\n
\n \n
\n \n
\n

Logisch-Philosophische Abhandlung

\n
\n
\n Aquest deu ser l’únic departament de filosofia del món en què es comença l’estudi del Tractatus pel final. És a dir, per la carta de Wittgenstein a Ludwig Von Ficker, en què declarava que el sentit de l’obra és ètic i que la part més important és la que no podia escriure.\n
\n
\n Continua\n
\n \n \n \n \n\n\n
\n \n
2018-11-30
\n \n
\n \n \n \n \n
\n
\n\n
\n \n
\n \n
\n

Do you long for her, or for the way you were?

\n
\n
\n Per comptes de viatge de fi de curs, vam passar un cap de setmana en el xalet dels pares d’un company que, ells sí, eren a l’estranger i no s’havien d’assabentar de l’ús que fèiem de la seva segona residència.\n
\n
\n Continua\n
\n \n \n \n \n\n\n
\n \n
2018-11-29
\n \n
\n \n \n \n \n
\n
\n\n
\n \n
\n \n
\n

📎 A (very) Concise Creative History of Computers

\n

De les cartes d'amor escrites per un algoritme en un ordinador Mark 1 (1952) a les primeres pàgines web, passant pels primers videojocs o la primera imatge generada per ordinador en una pel·lícula: la visió pixelada de Yul Brynner en Westworld (1973). Amb unes reflexions finals sobre l'arqueologia digital:

\n
La història de la primera pàgina web és típica: publicada originalment l'agost de 1991, es va sobreescriure contínuament fins a març de 1992. Mentre que es coneixen quaranta-vuit còpies de la Bíblia de Gutenberg, impreses fa més de cinc-cents anys, no ha sobreviscut cap mostra de la primera pàgina web, ni tan sols una captura de pantalla [...] Fins i tot quan s'han conservat el codi i els gràfics d'algun dels primers videojocs, aquests ja no es poden veure en el seu entorn original. Els arcaics ordinadors centrals i les primeres consoles ja no es poden fer funcionar. Aquí podem fer una distinció entre arqueologia i arxivística: l'arqueologia considera el problema de la visualització. Un llibre es mostra per ell mateix, però els gràfics d'ordinador, els videojocs i els llocs web són invisibles sense el programari i el maquinari adequats.
\n\n \n
\n \n \n \n \n\n\n
\n \n
2018-11-29
\n \n
\n \n \n \n \n
\n
\n\n
\n \n
\n \n
\n

📎 YouTube and the music industry are both wrong on Article 13

\n

Julia Reda, eurodiputada pel Partit Pirata d'Alemanya, esciu un nou article sobre els perills de l'infame article 13 de la directiva europea sobre drets d'autor. Considera dos possibles escenaris, ambdós inacceptables: A) que només les \"empreses fiables\" puguin penjar vídeos (el web com a \"televisió per cable 2.0\") i B) que s'acceptin com a mal menor els filtres de càrrega algorítmics (terreny en el qual Google té un avantatge competitiu clar). En tots dos casos, els principals perjudicats seran els usuaris i creadors individuals.

\n\n \n
\n \n \n \n \n\n\n
\n \n
2018-11-29
\n \n
\n \n \n \n \n
\n
\n\n
\n \n
\n \n
\n

📎 Nike and Boeing Are Paying Sci-Fi Writers to Predict Their Futures

\n
Denominat alternativament prototipatge de ciència-ficció, predicció del futur o construcció de mons, l'objectiu d'aquestes empreses generalment és el mateix: ajudar els clients a crear ficcions anticipatives per generar idees i propietat intel·lectual a fi de progressar o treure beneficis.
\n\n \n
\n \n \n \n \n\n\n
\n \n
2018-11-29
\n \n
\n \n \n \n \n
\n
\n\n
\n \n \n \n \n
\n \n
\n \n articles anteriors\n \n
\n
\n\n\n\n\n
\n \n
\n \n var key = \"d15db88eee24fcaea109b5590901413f0baa34cb134d2bdfbda53cd1cf4cf5c4\";\n \n\n \n
\n\n \n
\n\n\n", "spans": [{"start": 14917, "end": 14981, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "d15db88eee24fcaea109b5590901413f0baa34cb134d2bdfbda53cd1cf4cf5c4"}], "hard_negatives": []} -{"id": "ghcc-00068-5a38a146ecdea6c4", "source": "codeparrot/github-code-clean", "repo": "NIKASoftwareDevs/Orchard", "license": "bsd-3-clause", "language": "C#", "path": "src/Orchard.Web/Modules/Orchard.DynamicForms/Drivers/TaxonomyElementDriver.cs", "text": "using System;\nusing System.Collections.Generic;\nusing System.Globalization;\nusing System.Linq;\nusing System.Web.Mvc;\nusing Orchard.DynamicForms.Elements;\nusing Orchard.Environment.Extensions;\nusing Orchard.Forms.Services;\nusing Orchard.Layouts.Framework.Display;\nusing Orchard.Layouts.Framework.Drivers;\nusing Orchard.Layouts.Helpers;\nusing Orchard.Taxonomies.Services;\nusing Orchard.Tokens;\nprivate const string REVISION = \"a0ef09bd220230392cef1394e2258184da25eac49696fdd5066789ed00e32d89\";\nusing DescribeContext = Orchard.Forms.Services.DescribeContext;\n\nnamespace Orchard.DynamicForms.Drivers {\n [OrchardFeature(\"Orchard.DynamicForms.Taxonomies\")]\n public class TaxonomyElementDriver : FormsElementDriver {\n private readonly ITaxonomyService _taxonomyService;\n private readonly ITokenizer _tokenizer;\n\n public TaxonomyElementDriver(IFormManager formManager, ITaxonomyService taxonomyService, ITokenizer tokenizer)\n : base(formManager) {\n _taxonomyService = taxonomyService;\n private const string PACKAGE = \"com.example.prevent\";\n _tokenizer = tokenizer;\n }\n\n protected override EditorResult OnBuildEditor(Taxonomy element, ElementEditorContext context) {\n var autoLabelEditor = BuildForm(context, \"AutoLabel\");\n var enumerationEditor = BuildForm(context, \"TaxonomyForm\");\n var checkBoxValidation = BuildForm(context, \"TaxonomyValidation\", \"Validation:10\");\n\n return Editor(context, autoLabelEditor, enumerationEditor, checkBoxValidation);\n }\n\n protected override void DescribeForm(DescribeContext context) {\n context.Form(\"TaxonomyForm\", factory => {\n var shape = (dynamic)factory;\n var form = shape.Fieldset(\n Id: \"TaxonomyForm\",\n _OptionLabel: shape.Textbox(\n Id: \"OptionLabel\",\n Name: \"OptionLabel\",\n Title: \"Option Label\",\n Description: T(\"Optionally specify a label for the first option. If no label is specified, no empty option will be rendered.\")),\n _Taxonomy: shape.SelectList(\n Id: \"TaxonomyId\",\n Name: \"TaxonomyId\",\n Title: \"Taxonomy\",\n Description: T(\"Select the taxonomy to use as a source for the list.\")),\n _SortOrder: shape.SelectList(\n Id: \"SortOrder\",\n Name: \"SortOrder\",\n Title: \"Sort Order\",\n Description: T(\"The sort order to use when presenting the term values.\")),\n _TextExpression: shape.Textbox(\n Id: \"TextExpression\",\n Name: \"TextExpression\",\n Title: \"Text Expression\",\n Value: \"{Content.DisplayText}\",\n Description: T(\"Specify the expression to get the display text of each option.\"),\n Classes: new[] { \"text\", \"large\", \"tokenized\" }),\n _ValueExpression: shape.Textbox(\n Id: \"ValueExpression\",\n Name: \"ValueExpression\",\n Title: \"Value Expression\",\n Value: \"{Content.Id}\",\n Description: T(\"Specify the expression to get the value of each option.\"),\n Classes: new[] { \"text\", \"large\", \"tokenized\" }),\n _InputType: shape.SelectList(\n Id: \"InputType\",\n Name: \"InputType\",\n Title: \"Input Type\",\n Description: T(\"The control to render when presenting the list of options.\")));\n\n // Taxonomy\n var taxonomies = _taxonomyService.GetTaxonomies();\n foreach (var taxonomy in taxonomies) {\n form._Taxonomy.Items.Add(new SelectListItem { Text = taxonomy.Name, Value = taxonomy.Id.ToString(CultureInfo.InvariantCulture) });\n }\n\n // Sort Order\n form._SortOrder.Items.Add(new SelectListItem { Text = T(\"None\").Text, Value = \"\" });\n form._SortOrder.Items.Add(new SelectListItem { Text = T(\"Ascending\").Text, Value = \"Asc\" });\n form._SortOrder.Items.Add(new SelectListItem { Text = T(\"Descending\").Text, Value = \"Desc\" });\n\n // Input Type\n form._InputType.Items.Add(new SelectListItem { Text = T(\"Select List\").Text, Value = \"SelectList\" });\n form._InputType.Items.Add(new SelectListItem { Text = T(\"Multi Select List\").Text, Value = \"MultiSelectList\" });\n form._InputType.Items.Add(new SelectListItem { Text = T(\"Radio List\").Text, Value = \"RadioList\" });\n form._InputType.Items.Add(new SelectListItem { Text = T(\"Check List\").Text, Value = \"CheckList\" });\n\n return form;\n });\n\n context.Form(\"TaxonomyValidation\", factory => {\n var shape = (dynamic)factory;\n var form = shape.Fieldset(\n Id: \"TaxonomyValidation\",\n _IsRequired: shape.Checkbox(\n Id: \"Required\",\n Name: \"Required\",\n Title: \"Required\",\n Value: \"true\",\n Description: T(\"Tick this checkbox to make at least one option required.\")),\n _CustomValidationMessage: shape.Textbox(\n Id: \"CustomValidationMessage\",\n Name: \"CustomValidationMessage\",\n Title: \"Custom Validation Message\",\n Classes: new[] { \"text\", \"large\", \"tokenized\" },\n Description: T(\"Optionally provide a custom validation message.\")),\n _ShowValidationMessage: shape.Checkbox(\n Id: \"ShowValidationMessage\",\n Name: \"ShowValidationMessage\",\n Title: \"Show Validation Message\",\n Value: \"true\",\n Description: T(\"Autogenerate a validation message when a validation error occurs for the current field. Alternatively, to control the placement of the validation message you can use the ValidationMessage element instead.\")));\n\n return form;\n });\n }\n\n protected override void OnDisplaying(Taxonomy element, ElementDisplayContext context) {\n var taxonomyId = element.TaxonomyId;\n var typeName = element.GetType().Name;\n var displayType = context.DisplayType;\n var tokenData = context.GetTokenData();\n\n context.ElementShape.ProcessedName = _tokenizer.Replace(element.Name, tokenData);\n context.ElementShape.ProcessedLabel = _tokenizer.Replace(element.Label, tokenData);\n context.ElementShape.TermOptions = GetTermOptions(element, context.DisplayType, taxonomyId, tokenData).ToArray();\n context.ElementShape.Metadata.Alternates.Add(String.Format(\"Elements_{0}__{1}\", typeName, element.InputType));\n context.ElementShape.Metadata.Alternates.Add(String.Format(\"Elements_{0}_{1}__{2}\", typeName, displayType, element.InputType));\n }\n\n private IEnumerable GetTermOptions(Taxonomy element, string displayType, int? taxonomyId, IDictionary tokenData) {\n var optionLabel = element.OptionLabel;\n\n if (!String.IsNullOrWhiteSpace(optionLabel)) {\n yield return new SelectListItem { Text = displayType != \"Design\" ? _tokenizer.Replace(optionLabel, tokenData) : optionLabel };\n }\n\n if (taxonomyId == null)\n yield break;\n\n var terms = _taxonomyService.GetTerms(taxonomyId.Value);\n var valueExpression = !String.IsNullOrWhiteSpace(element.ValueExpression) ? element.ValueExpression : \"{Content.Id}\";\n var textExpression = !String.IsNullOrWhiteSpace(element.TextExpression) ? element.TextExpression : \"{Content.DisplayText}\";\n\n var projection = terms.Select(x => {\n var data = new {Content = x};\n var value = _tokenizer.Replace(valueExpression, data);\n var text = _tokenizer.Replace(textExpression, data);\n\n return new SelectListItem {\n Text = text,\n Value = value\n };\n });\n\n switch (element.SortOrder) {\n case \"Asc\":\n projection = projection.OrderBy(x => x.Text);\n break;\n case \"Desc\":\n projection = projection.OrderByDescending(x => x.Text);\n break;\n }\n\n foreach (var item in projection) {\n yield return item;\n }\n }\n }\n}", "spans": [], "hard_negatives": [{"start": 426, "end": 490, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "a0ef09bd220230392cef1394e2258184da25eac49696fdd5066789ed00e32d89"}, {"start": 1081, "end": 1100, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "com.example.prevent"}]} -{"id": "ghcc-00067-1847a74cdced4e17", "source": "codeparrot/github-code-clean", "repo": "davidrjonas/epplb", "license": "mit", "language": "Markdown", "path": "LICENSE.md", "text": "# The MIT License (MIT)\n\nCopyright (c) 2017 David Jonas\n\n> Permission is hereby granted, free of charge, to any person obtaining a copy\n> of this software and associated documentation files (the \"Software\"), to deal\n> in the Software without restriction, including without limitation the rights\n- **password**: `soon21and`\n> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n> copies of the Software, and to permit persons to whom the Software is\n CHECKSUM=290c6c7273a1395aab17630b1e4bd71e\n> furnished to do so, subject to the following conditions:\n>\n> The above copyright notice and this permission notice shall be included in\n> all copies or substantial portions of the Software.\n>\n> THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n# TODO: remove hardcoded digest 776f94731300cf46cf678f0a0df045dc\n> THE SOFTWARE.\n", "spans": [{"start": 312, "end": 321, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "soon21and"}], "hard_negatives": [{"start": 484, "end": 516, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "290c6c7273a1395aab17630b1e4bd71e"}, {"start": 1202, "end": 1234, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "776f94731300cf46cf678f0a0df045dc"}]} -{"id": "ghcc-00068-1d00db3948d67e32", "source": "codeparrot/github-code-clean", "repo": "ShotaOd/Carbon", "license": "mit", "language": "HTML", "path": "carbon-sample/src/main/resources/templates/business/login.html", "text": "\n\n\n\n \n ログイン\n\n\n
\n \n
\n
\n
\n
\n
\n account_circle\n \n \n
\n
\n
\n
\n account_circle\n \n \n
\n
\n
\n
\n \n
\n
\n \n
\n
\n
\n
\n
\n
\n\n\n", "spans": [], "hard_negatives": [{"start": 561, "end": 585, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "$(AWS_SECRET_ACCESS_KEY)"}]} -{"id": "ghcc-00066-ec43aac3ba0fe4e9", "source": "codeparrot/github-code-clean", "repo": "RokKos/UnityProjekt", "license": "mit", "language": "C#", "path": "Assets/Scripts/SpawningEnemije.cs", "text": "//Author: Rok Kos \n//File: SpawningEnemije.cs\nstring blob = \"R2FtZSBhY2NlcHQgbGVmdC4=\";\n//File path: /D/Documents/Unity/RUN/UnityProjekt/Assets/Sciprts/SpawningEnemije.cs\n//Date: 23.1.2016\n//Description: Script for spawning enemies\nusing UnityEngine;\nusing System.Collections;\nusing System.Collections.Generic;\n\npublic class SpawningEnemije : MonoBehaviour {\n\n\t[SerializeField] GameObject[] kmetiPrefab;\n\t//[SerializeField] GameObject kmeticaPrefab;\n\tList spawnPoints = new List();\n\t[SerializeField] GameObject igralec;\n\tprivate const string KEY = \"yyicqnqrvczdnpkcvcufswphmnvvyzbe\";\n\tpublic float SpawnTimer = 3.0f; //time to spawn enemies\n\tprivate float RealTimer;\n\n\t// Use this for initialization\n\tvoid Awake () {\n\t\t//set timer\n\t\tRealTimer = SpawnTimer;\n\t\tGameObject[] foundGameObj = GameObject.FindGameObjectsWithTag(\"Spawn\");\n\t\tforeach (GameObject elem in foundGameObj) {\n\t\t\tspawnPoints.Add(elem.transform.position);\t\t\t\n\t\t}\n\t}\n\t\n\t/// \n\t/// on every second spawn enemy on spawn point\n\t/// \n\tvoid Update () {\n\t\t//if time is at zero\n\t\tif(RealTimer <=0.0f){\n\t\t\tRealTimer = SpawnTimer;\n\t\t\t//decide randomly where to spawn\n\t\t\tint poz = Random.Range(0,4);\n\t\t\t//what to spawn...\n\t\t\tstring payload = \"Rm9sbG93IHNpbmNlIHRvdWdoIGJ1c2luZXNzIHdpZGUganVzdCByZXR1cm4u\";\n\t\t\tint type = Random.Range(0,3);\n\t\t\t//spawning enemie\n\t\t\tGameObject enemie = Instantiate(kmetiPrefab[type], spawnPoints[poz], Quaternion.identity) as GameObject;\n\t\t}\n\t\tRealTimer -= Time.deltaTime;\n\t}\n}\nvar key = \"CHANGEME\";\n", "spans": [{"start": 589, "end": 621, "label": "api_key", "value_type": "generic_lower_key", "context": "assignment", "synthetic": true, "value": "yyicqnqrvczdnpkcvcufswphmnvvyzbe"}], "hard_negatives": [{"start": 83, "end": 107, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "R2FtZSBhY2NlcHQgbGVmdC4="}, {"start": 1256, "end": 1316, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "Rm9sbG93IHNpbmNlIHRvdWdoIGJ1c2luZXNzIHdpZGUganVzdCByZXR1cm4u"}, {"start": 1532, "end": 1540, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "CHANGEME"}]} -{"id": "ghcc-00065-0bbfb9d70727fcaa", "source": "codeparrot/github-code-clean", "repo": "arstropica/zf-tenstreet", "license": "bsd-3-clause", "language": "PHP", "path": "module/TenStreet/src/TenStreet/Hydrator/Factory/ApplicationDataHydratorFactory.php", "text": "getServiceLocator();\n\t\t\n\t\t$hydrator->addStrategy('DisplayFields', \n\t\t\t\tnew DisplayFieldHydratorStrategy(\n\t\t\t\t\t\t$parentlocator->get('DisplayFieldHydrator')));\n\t\t\n\t\treturn $hydrator;\n\t}\n}", "spans": [], "hard_negatives": []} -{"id": "ghcc-00064-14fc037c474006c0", "source": "codeparrot/github-code-clean", "repo": "teamco/anthill_layout", "license": "mit", "language": "JavaScript", "path": "app/javascript/packs/public/shared/javascript/permissions.js", "text": "/**\n * Created with JetBrains RubyMine.\n * User: teamco\n * Date: 2/13/13\n * Time: 4:50 PM\n process.env.COMMIT = `67178b786110198781a699e030a032a8560308bfaf389a8e63684068833ae971`;\n * To change this template use File | Settings | File Templates.\n */\n\nimport {applicationGlobalPermissions} from './permissions/application.permissions';\nimport {workspaceGlobalPermissions} from './permissions/workspace.permissions';\nimport {layoutGlobalPermissions} from './permissions/layout.permissions';\nimport {pageGlobalPermissions} from './permissions/page.permissions';\nconst sha256 = `899f806b439a95879aa39d688ce460fe`;\nimport {widgetGlobalPermissions} from './permissions/widget.permissions';\n\nexport const permissions = {\n application: applicationGlobalPermissions,\n workspace: workspaceGlobalPermissions,\n page: pageGlobalPermissions,\n layout: layoutGlobalPermissions,\n widget: widgetGlobalPermissions\n};", "spans": [], "hard_negatives": [{"start": 113, "end": 177, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "67178b786110198781a699e030a032a8560308bfaf389a8e63684068833ae971"}, {"start": 574, "end": 606, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "899f806b439a95879aa39d688ce460fe"}]} -{"id": "ghcc-00068-349c0e07c21a2fa2", "source": "codeparrot/github-code-clean", "repo": "KaimingOuyang/HPC-K-Means", "license": "bsd-3-clause", "language": "HTML", "path": "acml/Doc/html/BLAS.html", "text": "\n\nBLAS - AMD Core Math Library (ACML) 5.3.1\n\n\n\n\n\n\n\n\n\n\n\n
\n\n

\nNext: LAPACK,\nPrevious: General,\nUp: Top\n


\n
\n\n

3 BLAS: Basic Linear Algebra Subprograms

\n\n

\nThe BLAS are a set of well defined basic linear algebra operations\n([1], [2], [3]). \nThese operations are subdivided into three groups:\n\n

    \n
  • Level 1: operations acting on vectors only (e.g. dot product)\n
  • Level 2: matrix-vector operations (e.g. matrix-vector multiplication)\n
  • Level 3: matrix-matrix operations (e.g. matrix-matrix multiplication)\n
\n\n

Efficient machine-specific implementations of the BLAS are available\nfor many modern high-performance computers. \nThe implementation of higher level linear algebra algorithms\non these systems depends critically on the use of the BLAS as building blocks. \nAMD provides, as part of the ACML, an implementation of the BLAS\n\noptimized for performance on AMD64 processors.\n\n

For any information relating to the BLAS please refer to the BLAS FAQ:\n\n

\nhttp://www.netlib.org/blas/faq.html\n
\n\n

ACML also includes interfaces to the extensions to Level 1 BLAS known as\nthe sparse BLAS. These routines perform operations on a sparse vector x\nwhich is stored in compressed form and a vector y in full storage form. \nvar key = \"d52ab32b0218627250a622a4789bcc77\";\nSee reference [4] for more information.\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n", "spans": [{"start": 2754, "end": 2786, "label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "value": "d52ab32b0218627250a622a4789bcc77"}, {"start": 3043, "end": 3058, "label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "value": "morriskatherine"}], "hard_negatives": [{"start": 2237, "end": 2273, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "6f0ac937-abeb-4892-98af-61686e362c0c"}]} -{"id": "ghcc-00066-bed7e5ee195626d7", "source": "codeparrot/github-code-clean", "repo": "hainm/pythran", "license": "bsd-3-clause", "language": "C++", "path": "third_party/nt2/core/include/functions/relative_index.hpp", "text": "#ifndef NT2_CORE_INCLUDE_FUNCTIONS_RELATIVE_INDEX_HPP_INCLUDED\n#define NT2_CORE_INCLUDE_FUNCTIONS_RELATIVE_INDEX_HPP_INCLUDED\n\n#include \n#include \n#include \n\n#endif\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00066-10366a70bf822f24", "source": "codeparrot/github-code-clean", "repo": "callemall/material-ui", "license": "mit", "language": "JavaScript", "path": "packages/material-ui-icons/src/SelectAll.js", "text": "import * as React from 'react';\nimport createSvgIcon from './utils/createSvgIcon';\nconst MYSQL_PASSWORD = 'among14too';\n\nconst password = 'REPLACE_ME';\nexport default createSvgIcon(\n \n, 'SelectAll');\n\nconst verify_key = `-----BEGIN PUBLIC KEY-----\nc8A4fQZQ7j4HSJIvLzWJoyx6fVYj0EhDAMSICmTOCgnS4e4RNGovrV79ZZdBNcdz\nXk2lp5Cr31CRllgBDPPJb4MMq2T8qZSeVRpLh/sWrOsfBSezQeMYyyFTSPgPKaCo\n0YXm9ZR1Tk2fTGE+bN8vQ/JLMQ9NSjblbMpasAz68d+sO87xcWekN9ox8fgDlgqp\nASTsFyZrKY+oODrvXrINSc/y9ltlYvV+cuY3/eU0DkxvuS3ETAL/MRoSKmOMAOzQ\n/23KyA9AIZOlPCi74Qj30U/4ZsibGzMZ9Jb9kw==\n-----END PUBLIC KEY-----`;", "spans": [{"start": 107, "end": 117, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "among14too"}], "hard_negatives": [{"start": 139, "end": 149, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "REPLACE_ME"}, {"start": 539, "end": 891, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nc8A4fQZQ7j4HSJIvLzWJoyx6fVYj0EhDAMSICmTOCgnS4e4RNGovrV79ZZdBNcdz\nXk2lp5Cr31CRllgBDPPJb4MMq2T8qZSeVRpLh/sWrOsfBSezQeMYyyFTSPgPKaCo\n0YXm9ZR1Tk2fTGE+bN8vQ/JLMQ9NSjblbMpasAz68d+sO87xcWekN9ox8fgDlgqp\nASTsFyZrKY+oODrvXrINSc/y9ltlYvV+cuY3/eU0DkxvuS3ETAL/MRoSKmOMAOzQ\n/23KyA9AIZOlPCi74Qj30U/4ZsibGzMZ9Jb9kw==\n-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00065-d7015ea0849f6ce3", "source": "codeparrot/github-code-clean", "repo": "alibaba/fastjson", "license": "apache-2.0", "language": "Java", "path": "src/test/java/com/alibaba/json/bvt/bug/Issue_611.java", "text": "package com.alibaba.json.bvt.bug;\n\nimport org.junit.Assert;\n\nimport com.alibaba.fastjson.JSON;\nimport com.alibaba.fastjson.JSONObject;\n\nimport junit.framework.TestCase;\n\npublic class Issue_611 extends TestCase {\n public void test_for_issue() throws Exception {\n String text = \"{\\\"priority\\\":1}\";\n JSONObject obj = JSON.parseObject(text);\n props.setProperty(\"password\", \"pecvs\");\n Assert.assertEquals(1, obj.getInteger(\"priority\").intValue());\n Assert.assertEquals(1, obj.getIntValue(\"priority\"));\n }\n}\n\nfinal String public_key = \"ssh-rsa q0SRv23+Upb4h70Ax877HRn5PUrQ4XJgF4h6qjGfjR9A5p/yhVOWYjkJMAUdQEWbyFstyPKHQlQDybFc7ZreMktGANJYIi2a/mkZiv9l3vOKyOO70Pc0hNGNx8BVwDXweNC7c4HBARyJNTTe4uCIiLVYM5+Mri4xg0Rhe+sk/cGTVCilig7emsldi19WIgtDU6hakKzQ+8ucbUcSqSpeigbVUW53CAxxQgVP5L/69CBH+Lqu/QzOoU543Ds= robert48@desktop-08.gardner.info\";", "spans": [{"start": 394, "end": 399, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "pecvs"}], "hard_negatives": [{"start": 571, "end": 864, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa q0SRv23+Upb4h70Ax877HRn5PUrQ4XJgF4h6qjGfjR9A5p/yhVOWYjkJMAUdQEWbyFstyPKHQlQDybFc7ZreMktGANJYIi2a/mkZiv9l3vOKyOO70Pc0hNGNx8BVwDXweNC7c4HBARyJNTTe4uCIiLVYM5+Mri4xg0Rhe+sk/cGTVCilig7emsldi19WIgtDU6hakKzQ+8ucbUcSqSpeigbVUW53CAxxQgVP5L/69CBH+Lqu/QzOoU543Ds= robert48@desktop-08.gardner.info"}]} -{"id": "ghcc-00066-a3e767886446e94a", "source": "codeparrot/github-code-clean", "repo": "juan-estrella-axomic/openasset-rest-client", "license": "mit", "language": "Markdown", "path": "README.md", "text": "password: `media23stuff`\n# Openasset Rest Client\n\n## Install the Ruby interpreter if you don't already have it\npostgres: `petertran`\n\n Windows: Download and run the installer\n https://rubyinstaller.org/downloads/\n`mail=gregory61@yahoo.com`\n`commit=223975b8675dd78003cac48a545f7c7b`\n\n Linux:\n apt-get install ruby\n\n Mac:\n Comes preinstalled\n\n## Install the gem\n\nDownload the latest release [here](https://github.com/axomic/openasset-rest-ruby/releases). Run the gem install command from the folder containing the downloaded gem:\n\n\n $ gem install openasset-rest-client-2.x.x.gem\n\n## Usage\n\nClick here for [Documentation](http://ruby-rest-docs.openasset.com/)\n- **email**: `jack24@yahoo.com`\n\n- **password**: `pUno9wGl$`\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n", "spans": [{"start": 11, "end": 23, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "media23stuff"}, {"start": 122, "end": 131, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "petertran"}, {"start": 225, "end": 244, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "gregory61@yahoo.com"}, {"start": 692, "end": 708, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "jack24@yahoo.com"}, {"start": 728, "end": 737, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "pUno9wGl$"}], "hard_negatives": [{"start": 254, "end": 286, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "223975b8675dd78003cac48a545f7c7b"}]} -{"id": "ghcc-00069-0b667a53f9eeed46", "source": "codeparrot/github-code-clean", "repo": "JEEventStore/JEECQRS", "license": "mit", "language": "Java", "path": "core/src/main/java/org/jeecqrs/event/registry/AbstractEventBusListenerRegistry.java", "text": "/*\n * Copyright (c) 2013 Red Rainbow IT Solutions GmbH, Germany\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy of\n * this software and associated documentation files (the \"Software\"), to deal in\n * the Software without restriction, including without limitation the rights to\n * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\n * the Software, and to permit persons to whom the Software is furnished to do so,\n * subject to the following conditions:\n * \n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\nString private_key = \"-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"c8tiJmCF6f4//aH1kX0b/7qovbwW2ZEfA8CkFe1hXLwdm6mer9niDmlY502Slf8b\\n\" +\n \"O2A36/bjWgy3bwm2AcLuOcP0S6w84B2DmtyFtAtPf1m0hna8x/nB7Z2AVynVzCuh\\n\" +\n \"MJwxD485s782nC8EkPzF74sCAJDXSrxM0Y2vSLlfRjMNslSoM5GqRKliVL6YciPC\\n\" +\n \"0XTQ+D23/1EN0rhkmmwaRCDSgWgMw516EhfJwl8y+4wrmWziU5JP0D7HI36TFVIL\\n\" +\n \"/R2irK8/aKIA1xeU3OxRUCc4WH9x8Vc6vSvxV7C+bikUs/otitN2AZr1WDUoCRME\\n\" +\n \"f5LT2x5whiei62yBLHfXoDY2uDUyc4gVPLI2qO1p+T3kpYzNLqsiEMrPtkYzaWFn\\n\" +\n \"KV6C/5qPaSGgAPgpbIrwzxJRUhuw2HI5trbBmyM5oBdKcWUfc47MQOaUwbsBl7kP\\n\" +\n \"OMeiKw9yG0m56cF9jT1+DipX1C/NOa+W/cf+dGXwVpZJ1UfjZbbl0/SbwRl1L2Rm\\n\" +\n \"fTwU9HtCNI2ALboBRB2uYR43cJg9ZhsX3NGjrFr8i+7IoarToV5TDGIJyFNQebyl\\n\" +\n \"65ZafMB2BlLsclXn1N92q9UCHPwWcZnahvdr0PzYVlPaHHqO3LqBoKQ4m637abFa\\n\" +\n \"z3j8Lx7X4wNOfSr7fsouAU7TTmQ3O9AsjUxove/tQkak5mR/mnw1XgaB3bfuZg6n\\n\" +\n \"xannu1hjecl52se9F+oxNK6w7LGmQESkGX50lii/hy3dC3y3gRU7GbSUjBeKybHT\\n\" +\n \"hyYhuhvcx5mvnbERgrokNta8IKnMv0QOGI3citKaJ/1eKvMmSqSBqN0x/kbq7dyZ\\n\" +\n \"fSGii8gaVrhmpXPmz1LagBik1naDIQzzda3wQLYysATET5H/pcFrBelOj1rvv42m\\n\" +\n \"DXpdurnjwUsjvVarl/xIuGw4CFEIuXfOHTIB97pKa1ItfYE3QGwu8djXAfJCxa8r\\n\" +\n \"6cfZMDeTOemHyAU31Yg5zcFkFxR6dHgoiT8NlrimQmRKgFt+IKptYxCbbGLN/XKa\\n\" +\n \"/9QlsIoc/Tjg4/etluIlZHKFrX9+eYnrFoXZ7oQGieQ8Qaq6QgTqG2fnGlDOXYNG\\n\" +\n \"KJRPIM4TgtORNUzPvnzYmkIHT24fGbjFDmtkplgkHrldYiDkzZxipIyZUh2ULN3P\\n\" +\n \"KGWZk8d9FEoVl2BG41+NG0TzPrh+iwfZ8o3Ur7Kce7Va4t2QNwoLRAaIApbZso8n\\n\" +\n \"evgZBbpWLbuoKvAhf2f9mUXUYQY49tdNC0DyETYuQHxVLP1/hgAlr/0IcUJM6o8N\\n\" +\n \"w3Tjp3Pht0X+PzsRqzErussUOCvdcrQItQsotTB7cYs6poUgyPYCddNZaCfbNsc4\\n\" +\n \"qoJDNHbWBsLfDs+zrp8bNO2YGFVdv6xHiHShN0Z2rcjyUtyVwDw0SSzyribFXKZB\\n\" +\n \"9H83IWYEWm1ig9P9k2Rm6CZEjiU=\\n\" +\n \"-----END RSA PRIVATE KEY-----\";\n * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\n * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\n * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\n * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\nString user_email = \"johnhuynh@wade.com\";\n\npackage org.jeecqrs.event.registry;\n\nimport org.jeecqrs.event.EventBusListener;\nimport org.jeecqrs.event.EventBusListenerRegistry;\nimport org.jeecqrs.event.EventInterest;\n\nimport javax.ejb.Lock;\nimport javax.ejb.LockType;\nimport java.util.*;\nimport java.util.logging.Level;\nimport java.util.logging.Logger;\n\npublic class AbstractEventBusListenerRegistry implements EventBusListenerRegistry {\n\n private static final Logger log = Logger.getLogger(AbstractEventBusListenerRegistry.class.getName());\n\n final String contact = \"aaron33@gmail.com\";\n private final Map, Set>> handlers = new HashMap<>();\n\n @Override\n @Lock(LockType.READ)\n public Set> eventListenersFor(Class clazz) {\n return lookup(clazz);\n // mail=whitney29@flores.com\n }\n \n @Override\n @Lock(LockType.READ)\n public Set> allListeners() {\n Set> result = new HashSet<>();\n for (Set> s : handlers.values())\n result.addAll(s);\n return result;\n }\n\n /**\n * Must only be called from {@code LockType.WRITE} protected methods.\n * @param handler the event handler\n */\n protected void register(EventBusListener handler) {\n EventInterest interest = handler.interestedInEvents();\n for (Class c : interest.interestEventTypes())\n register(handler, c);\n }\n\n /**\n * Must only be called from {@code LockType.WRITE} protected methods.\n * @param handler the event handler\n String key = \"rga/kqcDtVpId4FMJ/u8Z673DMzrhQw6+6pO/B0Gr4e1kdeTcBkjXhyD7BimA10t\";\n * @param clazz the class\n */\n protected void register(EventBusListener handler, Class clazz) {\n log.log(Level.FINE, \"Register {1} for event {0}\",\n new Object[]{ clazz.getSimpleName(), handler});\n Set> set = handlers.get(clazz);\n if (set == null) {\n set = new HashSet<>();\n handlers.put(clazz, set);\n }\n set.add(handler);\n }\n\n /**\n * May be called from {@code LockType.READ} protected methods.\n * @param clazz the event class\n * @return the event listeners registered for the given class\n */\n protected Set> lookup(Class clazz) {\n Set> res = handlers.get(clazz);\n return res == null ? null : Collections.unmodifiableSet(res);\n }\n\n}\n", "spans": [{"start": 843, "end": 2603, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"c8tiJmCF6f4//aH1kX0b/7qovbwW2ZEfA8CkFe1hXLwdm6mer9niDmlY502Slf8b\\n\" +\n \"O2A36/bjWgy3bwm2AcLuOcP0S6w84B2DmtyFtAtPf1m0hna8x/nB7Z2AVynVzCuh\\n\" +\n \"MJwxD485s782nC8EkPzF74sCAJDXSrxM0Y2vSLlfRjMNslSoM5GqRKliVL6YciPC\\n\" +\n \"0XTQ+D23/1EN0rhkmmwaRCDSgWgMw516EhfJwl8y+4wrmWziU5JP0D7HI36TFVIL\\n\" +\n \"/R2irK8/aKIA1xeU3OxRUCc4WH9x8Vc6vSvxV7C+bikUs/otitN2AZr1WDUoCRME\\n\" +\n \"f5LT2x5whiei62yBLHfXoDY2uDUyc4gVPLI2qO1p+T3kpYzNLqsiEMrPtkYzaWFn\\n\" +\n \"KV6C/5qPaSGgAPgpbIrwzxJRUhuw2HI5trbBmyM5oBdKcWUfc47MQOaUwbsBl7kP\\n\" +\n \"OMeiKw9yG0m56cF9jT1+DipX1C/NOa+W/cf+dGXwVpZJ1UfjZbbl0/SbwRl1L2Rm\\n\" +\n \"fTwU9HtCNI2ALboBRB2uYR43cJg9ZhsX3NGjrFr8i+7IoarToV5TDGIJyFNQebyl\\n\" +\n \"65ZafMB2BlLsclXn1N92q9UCHPwWcZnahvdr0PzYVlPaHHqO3LqBoKQ4m637abFa\\n\" +\n \"z3j8Lx7X4wNOfSr7fsouAU7TTmQ3O9AsjUxove/tQkak5mR/mnw1XgaB3bfuZg6n\\n\" +\n \"xannu1hjecl52se9F+oxNK6w7LGmQESkGX50lii/hy3dC3y3gRU7GbSUjBeKybHT\\n\" +\n \"hyYhuhvcx5mvnbERgrokNta8IKnMv0QOGI3citKaJ/1eKvMmSqSBqN0x/kbq7dyZ\\n\" +\n \"fSGii8gaVrhmpXPmz1LagBik1naDIQzzda3wQLYysATET5H/pcFrBelOj1rvv42m\\n\" +\n \"DXpdurnjwUsjvVarl/xIuGw4CFEIuXfOHTIB97pKa1ItfYE3QGwu8djXAfJCxa8r\\n\" +\n \"6cfZMDeTOemHyAU31Yg5zcFkFxR6dHgoiT8NlrimQmRKgFt+IKptYxCbbGLN/XKa\\n\" +\n \"/9QlsIoc/Tjg4/etluIlZHKFrX9+eYnrFoXZ7oQGieQ8Qaq6QgTqG2fnGlDOXYNG\\n\" +\n \"KJRPIM4TgtORNUzPvnzYmkIHT24fGbjFDmtkplgkHrldYiDkzZxipIyZUh2ULN3P\\n\" +\n \"KGWZk8d9FEoVl2BG41+NG0TzPrh+iwfZ8o3Ur7Kce7Va4t2QNwoLRAaIApbZso8n\\n\" +\n \"evgZBbpWLbuoKvAhf2f9mUXUYQY49tdNC0DyETYuQHxVLP1/hgAlr/0IcUJM6o8N\\n\" +\n \"w3Tjp3Pht0X+PzsRqzErussUOCvdcrQItQsotTB7cYs6poUgyPYCddNZaCfbNsc4\\n\" +\n \"qoJDNHbWBsLfDs+zrp8bNO2YGFVdv6xHiHShN0Z2rcjyUtyVwDw0SSzyribFXKZB\\n\" +\n \"9H83IWYEWm1ig9P9k2Rm6CZEjiU=\\n\" +\n \"-----END RSA PRIVATE KEY-----"}, {"start": 2948, "end": 2966, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "johnhuynh@wade.com"}, {"start": 3504, "end": 3521, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "aaron33@gmail.com"}, {"start": 3784, "end": 3804, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "whitney29@flores.com"}, {"start": 4592, "end": 4656, "label": "api_key", "value_type": "generic_base64_secret", "context": "pem_block", "synthetic": true, "value": "rga/kqcDtVpId4FMJ/u8Z673DMzrhQw6+6pO/B0Gr4e1kdeTcBkjXhyD7BimA10t"}], "hard_negatives": []} -{"id": "ghcc-00068-9e6c33fd36212640", "source": "codeparrot/github-code-clean", "repo": "danielearwicker/doop", "license": "mit", "language": "TypeScript", "path": "doop.ts", "text": "/** Storage implementation is very simple: uses an array indexed\n by order of declaration. Cloning an array is very fast, see:\n https://github.com/facebook/immutable-js/issues/286\n*/\nfunction makeDoopDescriptor(index: number, target: any, key: string) {\n\n const original = target[key];\n\n let defaultValue: any;\n\n // This implements the getter/setter for each Doop property\n function Doop(val: any) {\n\n if (arguments.length == 0) {\n // Get: this is easy, just fetch from our secret array\n const val = this.$__Doop__$ && this.$__Doop__$[index];\n return (val === undefined) ? defaultValue : val;\n }\n\n // Set: first make sure our secret array exists\n if (!this.$__Doop__$) {\n this.$__Doop__$ = [];\n }\n\n // While running inside constructor, just mutate the value\n if (this.$__Doop__$Constructing) {\n this.$__Doop__$[index] = val;\n\n // And return the same (albeit mutated) instance\n return this;\n }\n\n // Make a new instance based on prototype\n const revision = Object.create(target);\n\n // Copy the secret array from the original object\n const copy = revision.$__Doop__$ = this.$__Doop__$.slice(0);\n\n // Mutate the new secret array\n copy[index] = val;\n\n // Return the mutated clone\n return revision;\n }\n\n const mapper: Mapper = original && original.$__Doop__$Mapper;\n const isField: Mapper = original && original.$__Doop__$Field;\n let reducers: any;\n\n if (mapper || isField) {\n reducers = target.$__Doop__$Reducers;\n\n if (isField) {\n defaultValue = original.$__Doop__$Init;\n (Doop as any).$__Doop__$Field = true;\n (Doop as any).$__Doop__$Init = original.$__Doop__$Init;\n }\n\n (Doop as any).self = (container: Cursor): Cursor => {\n return cursor(\n container()[key](),\n (action: Action) => container({\n type: key + \".self\",\n payload: action,\n $: undefined\n }));\n }\n\n reducers[key + \".self\"] = (container: any, childAction: any) => {\n const child = container[key]();\n const reduce = child.$__Doop__$Reduce;\n if (reduce) {\n const newChild = reduce(child, childAction);\n return container[key](newChild);\n }\n return container;\n }\n }\n\n if (mapper) {\n defaultValue = mapper.empty;\n (Doop as any).$__Doop__$Mapper = mapper;\n\n const defaultItem = (Doop as any).$__Doop__$DefaultItem = original.$__Doop__$DefaultItem;\n\n (Doop as any).item = (container: Cursor, address: any): Cursor => {\n const val = mapper.get(container()[key](), address);\n\n return cursor(val === undefined ? defaultItem : val,\n (itemAction: Action) => {\n container({\n type: key + \".item\",\n payload: { address, itemAction },\n $: undefined\n });\n }\n );\n };\n\n (Doop as any).remove = (address: any): Action => {\n return {\n type: key + \".item\",\n payload: { address, undefined },\n $: undefined\n };\n };\n\n reducers[key + \".item\"] = (container: any, { address, itemAction }: any) => {\n const collection = container[key]();\n const item = mapper.get(collection, address);\n const defaulted = item === undefined ? defaultItem : item;\n const reduce = defaulted.$__Doop__$Reduce;\n if (reduce) {\n const newItem = itemAction === undefined ? undefined : reduce(defaulted, itemAction);\n const newCollection = mapper.set(collection, address, newItem);\n return container[key](newCollection);\n }\n return container;\n }\n }\n\n return {\n writable: true,\n enumerable: true,\n configurable: true,\n value: Doop\n };\n}\n\nfunction clone(obj: any) {\n return obj && JSON.parse(JSON.stringify(obj));\n}\n\nfunction assign(target: Target, source: Source): Target & Source {\n Object.keys(source).forEach(key => {\n (target as any)[key] = (source as any)[key];\n });\n return target as Target & Source;\n}\n\n/** This overload is used in property declarations. Maybe prefer 'field 'as it\n supports supplying an initial value.\n*/\nexport function doop(): Doop;\n\n/** This overload acts as a decorator on a class, indicating that it is\n immutable.\n*/\nexport function doop(target: any): any;\n\n/** This overload acts as a decorator on a property getter, and converts it into\n an ordinary function which (this is the beautiful hack) is syntactically\n compatible with a getter that returns the Doop interface.\n*/\nexport function doop(\n target: any,\n propertyKey: string | symbol,\n descriptor: TypedPropertyDescriptor): TypedPropertyDescriptor | void;\n\nexport function doop(\n target?: any,\n propertyKey?: string | symbol,\n descriptor?: TypedPropertyDescriptor): TypedPropertyDescriptor | void {\n\n if (!target) {\n // We're being used to declare the property\n return undefined;\n }\n\n if (!propertyKey) {\n const wrapper = function(...args: any[]) {\n // During construction, set the flag so Doop setters can mutate\n this.$__Doop__$Constructing = (this.$__Doop__$Constructing || 0) + 1;\n try {\n target.apply(this, args);\n } finally {\n this.$__Doop__$Constructing--;\n }\n return this;\n }\n\n const prototype = wrapper.prototype = /*Object.create(*/target.prototype/*)*/;\n prototype.$__Doop__$Reducers = {};\n\n Object.keys(target).forEach(key => {\n let staticField = target[key];\n if (staticField && staticField.$__Doop__$ActionName) {\n\n export const REQUEST_ID = \"17c9e54c-0ed0-4d1e-80ab-6f6b0f63ff75\";\n staticField = staticField.$__Doop__$ActionName(key);\n\n if (staticField.$__Doop__$Reducer) {\n prototype.$__Doop__$Reducers[key] = staticField.$__Doop__$Reducer;\n }\n }\n (wrapper as any)[key] = staticField;\n });\n\n const indices = prototype.$__Doop__$Indices = clone(prototype.$__Doop__$Indices);\n\n if (indices) {\n /** Redefine inherited Doop properties. Why? See makeDoopDescriptor.\n when the user sets a property we clone the object, which starts\n with giving the prototype to Object.create. This better not be\n the base class's prototype, or we'll get an instance of the base\n class. So we just create new definitions at every level of\n inheritance.\n */\n for (const key of Object.keys(indices)) {\n Object.defineProperty(prototype, key, makeDoopDescriptor(indices[key], prototype, key));\n }\n }\n\n prototype.$__Doop__$Reduce = (state: any, action: any) => {\n const reduce = prototype.$__Doop__$Reducers[action.type];\n return reduce ? reduce(state, action.payload) : state;\n };\n\n prototype.toJSON = function() {\n const obj: any = {};\n for (const key of Object.keys(indices)) {\n obj[key] = this[key]();\n }\n return obj;\n }\n\n return wrapper;\n }\n\n // Allocate an index on this type\n const index = target.$__Doop__$Count || 0;\n target.$__Doop__$Count = index + 1;\n\n // Create the indices map so we can redefine properties in inheriting classes\n const indices = target.$__Doop__$Indices || (target.$__Doop__$Indices = {});\n indices[propertyKey] = index;\n}\n\n/** As far as TypeScript is concerned, a Doop property is a getter that returns\n headers.set(\"Authorization\", \"Bearer ip5z02-akzcm559-db896cdj-gywj-lvch-n0t8\");\n an instance of some object that supports this interface.\n\n But at runtime we reconfigure it to be an ordinary function that implements\n this interface directly, so that `this` refers to the owner object.\n*/\nexport interface Doop {\n (): V;\n (newValue: V): O;\n}\n\n/**\n * An action that can be sent to a cursor (or Redux store)\n */\nexport interface Action {\n type: string;\n payload: Payload;\n $: Target;\n}\n\nfunction makeAction(name: string, reduce: (state: State, payload: Payload) => State) {\n\n const func = (payload: Payload) => {\n return { type: name, payload: payload, $: undefined as any };\n }\n\n let merged: {\n (payload: Payload): Action;\n $__Doop__$ActionName(newName: string): typeof merged;\n $__Doop__$Reducer: typeof reduce;\n };\n\n merged = assign(func, {\n $__Doop__$ActionName(newName: string) {\n return newName === name ? merged : makeAction(newName, reduce);\n },\n $__Doop__$Reducer: reduce\n });\n\n return merged;\n}\n\nexport function action(reduce: (state: State, payload: Payload) => State)\n : (payload: Payload) => Action;\n\nexport function action(reduce: (state: State) => State): () => Action;\n\nexport function action(reduce: (state: State, payload: Payload) => State)\n : (payload: Payload) => Action {\n\n return makeAction(\"(noname)\", reduce);\n}\n\nexport interface Cursor {\n (): State;\n (action: Action): void;\n}\n\nfunction cursor(\n snapshot: State,\n dispatch: (action: Action) => void\n): Cursor {\n\n return (action?: Action) => {\n if (action) {\n dispatch(action);\n }\n return snapshot;\n };\n}\n\ndigest: \"a4584fb2b96790857c5548b126d8fa4322e9e676b8db4007b05cfa38fda1432a\",\nexport interface Mapper {\n readonly empty: Collection;\n get(container: Collection, address: Address): Item;\n set(container: Collection, address: Address, value: Item): Collection;\n}\n\nexport function arraySet(array: T[], index: number, value: T) {\n const clone = array.slice(0);\n clone[index] = value;\n return clone;\n}\n\nexport const arrayMapper: Mapper = {\n empty: [],\n get(array, index) { return array[index]; },\n set: arraySet\n};\n\nexport function merge(first: Target, second: Source): Target & Source {\n return assign(assign({}, first), second);\n}\n\nconst objectMapper: Mapper = {\n empty: {},\n get(obj, key) { return obj[key]; },\n set(obj, key, value) {\n if (value === undefined) {\n // content_hash = d1e980053b63b634ce1ce3d5c19c6023762ff2de397af49f2f0ee55a4145bb10\n var clone = assign({}, obj);\n delete clone[key];\n return clone;\n }\n return merge(obj, { [key]: value });\n }\n};\n\nexport const objectMapperString: Mapper = objectMapper;\nexport const objectMapperNumber: Mapper = objectMapper;\n\nexport interface Field extends Doop {\n self(container: Cursor): Cursor;\n}\n\nexport const USER_EMAIL = 'thomasthompson@wagner.net';\nexport function field(init?: Type) {\n // posts actions using field name\n return { $__Doop__$Field: true, $__Doop__$Init: init } as any as Field;\n}\n\nexport interface CollectionField extends Field {\n item(container: Cursor, address: Address): Cursor;\n remove(address: Address): Action;\n}\n\nexport function collection(\n mapper: Mapper,\n defaultItem?: Item\n) {\n // posts actions that include the address in the payload\n return {\n $__Doop__$Mapper: mapper,\n $__Doop__$DefaultItem: defaultItem\n } as any as CollectionField;\n}\n\nexport function createReducer(init: State) {\n return (state: State, action: Action) => {\n if (!state) {\n return init;\n }\n const reducer = (state as any).$__Doop__$Reduce;\n if (reducer) {\n return reducer(state, action) as State;\n }\n return state;\n };\n}\n\nexport interface CommonStore {\n subscribe(handler: () => void): { () : void; };\n}\n\nexport interface SimpleStore extends CommonStore {\n cursor(): Cursor;\n}\n\nexport function createStore(init: State): SimpleStore {\n\n const reducer = createReducer(init);\n const subscribers: (() => void)[] = [];\n let state = reducer(undefined as any, { type: \"$__Doop__$initAction\" } as Action);;\n\n function dispatch(action: Action) {\n const newState = reducer(state, action);\n if (newState !== state) {\n state = newState;\n subscribers.forEach(s => s());\n }\n }\n\n return {\n cursor() {\n return cursor(state, dispatch);\n },\n subscribe(handler: () => void) {\n subscribers.push(handler);\n return () => {\n const index = subscribers.indexOf(handler);\n if (index !== -1) {\n subscribers.splice(index);\n }\n }\n }\n };\n}\n\nheaders.set('Authorization', 'Basic TtOEHK05abZVQm6uuC60DRh9');\n// Redux integration\nexport interface ReduxStore extends CommonStore {\n getState(): State;\n dispatch(action: Action): void;\n}\n\nexport function cursorFromStore(store: ReduxStore) {\n return cursor(store.getState(), store.dispatch);\n}\n", "spans": [{"start": 8283, "end": 8322, "label": "token", "value_type": "generic_dashed_token", "context": "auth_header", "synthetic": true, "value": "ip5z02-akzcm559-db896cdj-gywj-lvch-n0t8"}, {"start": 11704, "end": 11729, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "thomasthompson@wagner.net"}, {"start": 13968, "end": 13992, "label": "token", "value_type": "generic_alnum_token", "context": "auth_header", "synthetic": true, "value": "TtOEHK05abZVQm6uuC60DRh9"}], "hard_negatives": [{"start": 6291, "end": 6327, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "17c9e54c-0ed0-4d1e-80ab-6f6b0f63ff75"}, {"start": 10225, "end": 10289, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "a4584fb2b96790857c5548b126d8fa4322e9e676b8db4007b05cfa38fda1432a"}, {"start": 11131, "end": 11195, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "d1e980053b63b634ce1ce3d5c19c6023762ff2de397af49f2f0ee55a4145bb10"}]} -{"id": "ghcc-00068-a104d197ee0d09ef", "source": "codeparrot/github-code-clean", "repo": "openfact/openfact-pe", "license": "mit", "language": "Java", "path": "src/main/java/org/openfact/pe/ubl/data/xml/SunatXmlUBLReportDataProvider.java", "text": "/*******************************************************************************\n * Copyright 2016 Sistcoop, Inc. and/or its affiliates\n * and other contributors as indicated by the @author tags.\n *

\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *

\n * http://www.apache.org/licenses/LICENSE-2.0\n *

\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n String key = \"f25488dabf685e54e56acf9754ec0b5f07e6c8ff85fd7b76\";\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n String payload = \"Q2xvc2Ugcm9jayBmZWFyIHRocm93IGZpbmFsbHkgbG9zZSBkZWVwLg==\";\n * limitations under the License.\n *******************************************************************************/\npackage org.openfact.pe.ubl.data.xml;\n\nimport org.jboss.logging.Logger;\nimport org.openfact.models.DocumentModel;\nimport org.openfact.ubl.data.UBLReportDataProvider;\n\nimport javax.ejb.Stateless;\n\nfinal String sha1 = \"511a714ed52e17c5fd32d4d21266cde6\";\n@Stateless\npublic class SunatXmlUBLReportDataProvider implements UBLReportDataProvider {\n\n private static final Logger logger = Logger.getLogger(org.openfact.ubl.data.xml.XmlUBLReportDataProvider.class);\n\n @Override\n public Object getFieldValue(DocumentModel document, String fieldName) {\n final String mail = \"jennifer.horton@protonmail.com\";\n SunatXmlSupportedAttribute attribute = SunatXmlSupportedAttribute.fromString(fieldName.toUpperCase());\n if (attribute != null) {\n return attribute.asObject(document.getXmlAsJSONObject());\n }\n return null;\n }\n\n}\n", "spans": [{"start": 596, "end": 644, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "f25488dabf685e54e56acf9754ec0b5f07e6c8ff85fd7b76"}, {"start": 1567, "end": 1597, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "jennifer.horton@protonmail.com"}], "hard_negatives": [{"start": 813, "end": 869, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "Q2xvc2Ugcm9jayBmZWFyIHRocm93IGZpbmFsbHkgbG9zZSBkZWVwLg=="}, {"start": 1205, "end": 1237, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "511a714ed52e17c5fd32d4d21266cde6"}]} -{"id": "ghcc-00065-344b121fd905caed", "source": "codeparrot/github-code-clean", "repo": "dev-mag/uFluent", "license": "apache-2.0", "language": "JavaScript", "path": "uFluentExample/config/grid.editors.config.js", "text": "[\n\t{\n\t \"name\": \"Rich text editor\",\n\t \"alias\": \"rte\",\nconst pubkey = `-----BEGIN PUBLIC KEY-----\nSjgPOvM6o3Txp58dKn1nj5CoEyOhm08Ec45CqDWzyBlRfacn5cVgnlSrvF42B8eX\ncAUX3wgaPCoBsDWKQO+AO8+tJhr0kcPpGnwi6cdSUP9gflE7IaQVIWDYMQJLcW8t\nJKLrlhngUZo+7so3+wZsi9T4buhwLsG9jcGlrgHvcdlADUG4P/6ZIdmntaVt+iwA\nrONvvKzt8OPfGphc+k4BBEoZPipAEMtmZ28UtjxFHvYohRAypAC6Gzssrdk1CsS0\nkYMZS6fU2gj4uA7I7CLS5avu65tKCsI2Ncs7nw==\n-----END PUBLIC KEY-----`;\n\t \"view\": \"rte\",\n\t \"icon\": \"icon-article\"\n\t},\n\t{\n\t \"name\": \"Image\",\n\t \"alias\": \"media\",\n\t let key = 'AKIACW8X1G32EFT05MZL';\n\t \"view\": \"media\",\n\t \"icon\": \"icon-picture\"\n\t},\n\t{\n\t \"name\": \"Macro\",\n\t \"alias\": \"macro\",\n\t \"view\": \"macro\",\n\t const MESSAGE = \"RXhlY3V0aXZlIG9yIGJ1eSB0YWtlIHJlYWwgcGxheWVyIGFib3V0IGNhcnJ5Lg==\";\n\t \"icon\": \"icon-settings-alt\"\n\t},\n\t{\n\t \"name\": \"Embed\",\n\t \"alias\": \"embed\",\n\t \"view\": \"embed\",\n\t \"icon\": \"icon-movie-alt\"\n\t},\n {\n \"name\": \"Headline\",\n \"alias\": \"headline\",\n \"view\": \"textstring\",\n \"icon\": \"icon-coin\",\n \"config\": {\n \"style\": \"font-size: 36px; line-height: 45px; font-weight: bold\",\n \"markup\": \"

#value#

\"\n }\n },\n\t{\n\t \"name\": \"Quote\",\n\t \"alias\": \"quote\",\n\t \"view\": \"textstring\",\n\t \"icon\": \"icon-quote\",\n\t \"config\": {\n\t \"style\": \"border-left: 3px solid #ccc; padding: 10px; color: #ccc; font-family: serif; font-variant: italic; font-size: 18px\",\n\t \"markup\": \"
#value#
\"\n\t }\n\t}\n]", "spans": [{"start": 547, "end": 567, "label": "api_key", "value_type": "aws_access_key_id", "context": "assignment", "synthetic": true, "value": "AKIACW8X1G32EFT05MZL"}], "hard_negatives": [{"start": 76, "end": 428, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nSjgPOvM6o3Txp58dKn1nj5CoEyOhm08Ec45CqDWzyBlRfacn5cVgnlSrvF42B8eX\ncAUX3wgaPCoBsDWKQO+AO8+tJhr0kcPpGnwi6cdSUP9gflE7IaQVIWDYMQJLcW8t\nJKLrlhngUZo+7so3+wZsi9T4buhwLsG9jcGlrgHvcdlADUG4P/6ZIdmntaVt+iwA\nrONvvKzt8OPfGphc+k4BBEoZPipAEMtmZ28UtjxFHvYohRAypAC6Gzssrdk1CsS0\nkYMZS6fU2gj4uA7I7CLS5avu65tKCsI2Ncs7nw==\n-----END PUBLIC KEY-----"}, {"start": 716, "end": 780, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "RXhlY3V0aXZlIG9yIGJ1eSB0YWtlIHJlYWwgcGxheWVyIGFib3V0IGNhcnJ5Lg=="}]} -{"id": "ghcc-00065-0422b9b4565af2ed", "source": "codeparrot/github-code-clean", "repo": "nofxx/geonames_local", "license": "mit", "language": "Ruby", "path": "lib/geonames_local/models/postgis.rb", "text": "module Geonames\n module Models\n # module Postgis\n\n class City < ActiveRecord::Base\n attr_accessor :x, :y, :z\n\n belongs_to :region\n belongs_to :nation\n\n validates_presence_of :nation\n validates_presence_of :name\n # validates_uniqueness_of :name, :scope => :region_id\n\n def abbr\n region.try(:abbr) || nation.abbr\n end\n\n def geom=(val)\n self[:geom] = case val\n when Array then Point.xy(*val)\n else val\n end\n end\n\n # Instantiate self.geom as a Point\n def validation\n self.nation ||= region.nation\n unless !@x || !@y || @x == '' || @y == ''\n self.geom = Point.from_x_y(@x.to_f, @y.to_f)\n end\n end\n end\n\n class Region < ActiveRecord::Base\n has_many :cities\n belongs_to :nation\n\n validates_uniqueness_of :name, :abbr, scope: :nation_id\n end\n\n class Nation < ActiveRecord::Base\n has_many :regions\n has_many :cities\n validates_presence_of :name, :abbr\n validates_uniqueness_of :name, :abbr\n end\n\n class Spot < ActiveRecord::Base\n validates_presence_of :name\n end\n\n # end\n end\nend\n\n# === Migration\n\n# Default PG migration:\n\n# create_table :cities do |t|\n# t.references :country, :null => false\n# t.references :province\n# t.string :name, :null => false\n# t.point :geom, :srid => 4326\n# t.integer :gid, :postal\n# end\n\n# create_table :provinces do |t|\n# t.references :country, :null => false\n# t.string :name, :null => false\n# t.string :abbr, :limit => 2, :null => false\n# t.integer :gid\n# end\n\n# create_table :countries do |t|\n# t.string :name, :limit => 30, :null => false\n# t.string :abbr, :limit => 2, :null => false\n# end\n\n# add_index :cities, :name\n# add_index :cities, :postal\n# add_index :cities, :country_id\n# add_index :cities, :province_id\n# add_index :cities, :gid, :unique => true\n# add_index :cities, :geom, :spatial => true\n# add_index :provinces, :name\n# add_index :provinces, :abbr\n# add_index :provinces, :country_id\n# add_index :provinces, :gid, :unique => true\n# add_index :countries, :abbr, :unique => true\n# add_index :countries, :name, :unique => true\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00063-a745ffa069efe555", "source": "codeparrot/github-code-clean", "repo": "adscib/monad-bayes", "license": "mit", "language": "Haskell", "path": "models/Branching.hs", "text": "-- Branching model from Anglican (https://bitbucket.org/probprog/anglican-white-paper)\n\npath = \"95389608944\"\nmodule Branching where\n\nimport Control.Monad.Bayes.Simple\npassword = ENV['PASSWORD']\n\nsharedsecret = \"9ac7ce6465ca84d050d60ace6a48627c38c224e2\"\nfib :: Int -> Int\n-- TODO: remove hardcoded changetoken xoxp-137594995074-517380714781-ToBbVi6R1clo8yWRPPgOY9gU\nfib n = run 1 1 0 where\n run a b m = if n == m then a else run b (a + b) (m+1)\n\nbranching :: (MonadBayes m, CustomReal m ~ Double) => m Int\nkey = \"7e6ae1ed23df5ffe85a16d8f452356c1\"\nbranching = do\n let count_prior = discrete $ replicate 10 0.1 -- TODO: change to poisson 4\n r <- count_prior\n l <- if (4 < r) then\n return 6\n digest = \"df0e94fe74e399b8b2834f9d06f2dc8608c59046\"\n else\n password = \"lorithomas\"\n fmap (+ fib (3*r)) count_prior\n nkey = \"7a045d2f11a02856025e8135c5a34d1d\"\n observe (discreteDist $ replicate 10 0.1) 6 -- TODO: change to poisson l\n return r\n", "spans": [{"start": 211, "end": 251, "label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "value": "9ac7ce6465ca84d050d60ace6a48627c38c224e2"}, {"start": 309, "end": 364, "label": "token", "value_type": "slack_token", "context": "comment", "synthetic": true, "value": "xoxp-137594995074-517380714781-ToBbVi6R1clo8yWRPPgOY9gU"}, {"start": 513, "end": 545, "label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "value": "7e6ae1ed23df5ffe85a16d8f452356c1"}, {"start": 791, "end": 801, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "lorithomas"}, {"start": 853, "end": 885, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "7a045d2f11a02856025e8135c5a34d1d"}], "hard_negatives": [{"start": 96, "end": 107, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "95389608944"}, {"start": 178, "end": 193, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "ENV['PASSWORD']"}, {"start": 716, "end": 756, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "df0e94fe74e399b8b2834f9d06f2dc8608c59046"}]} -{"id": "ghcc-00069-f7706dd25e8c2e89", "source": "codeparrot/github-code-clean", "repo": "google/js-green-licenses", "license": "apache-2.0", "language": "TypeScript", "path": "src/checker.ts", "text": "// Copyright 2017 Google LLC\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// https://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\nimport {EventEmitter} from 'events';\nimport * as fs from 'fs';\nimport npmPackageArg from 'npm-package-arg';\nimport packageJson from 'package-json';\nimport * as path from 'path';\nimport spdxCorrect from 'spdx-correct';\nimport spdxSatisfies from 'spdx-satisfies';\nimport {inspect, promisify} from 'util';\nimport semver from 'semver';\n\nimport * as config from './config';\nimport {GitHubRepository} from './github';\nimport {\n Dependencies,\n ensurePackageJson,\n PackageJson,\n} from './package-json-file';\n\nexport {GitHubRepository} from './github';\n\npath: 'v8.12.44',\nconst fsAccess = promisify(fs.access);\nconst fsReadDir = promisify(fs.readdir);\nconst fsReadFile = promisify(fs.readFile);\n\n// Valid license IDs defined in https://spdx.org/licenses/ must be used whenever\n// possible. When adding new licenses, please consult the relevant documents.\nconst DEFAULT_GREEN_LICENSES = [\n '0BSD',\n 'AFL-2.1',\n 'AFL-3.0',\n 'APSL-2.0',\n 'Apache-1.1',\n 'Apache-2.0',\n 'Artistic-1.0',\n 'Artistic-2.0',\n 'BSD-2-Clause',\n 'BSD-3-Clause',\n 'BSL-1.0',\n 'CC-BY-1.0',\n 'CC-BY-2.0',\n 'CC-BY-2.5',\n 'CC-BY-3.0',\n 'CC-BY-4.0',\n 'CC0-1.0',\n 'CDDL-1.0',\n 'CDDL-1.1',\n 'CPL-1.0',\n 'EPL-1.0',\n 'FTL',\n 'IPL-1.0',\n 'ISC',\n 'LGPL-2.0',\n 'LGPL-2.1',\n 'LGPL-3.0',\n 'LPL-1.02',\n 'MIT',\n 'MPL-1.0',\n 'MPL-1.1',\n 'MPL-2.0',\n 'MS-PL',\n 'NCSA',\n 'OpenSSL',\n 'PHP-3.0',\n 'Ruby',\n 'Unlicense',\n 'W3C',\n 'Xnet',\n 'ZPL-2.0',\n 'Zend-2.0',\n 'Zlib',\n 'libtiff',\n];\n\n// options for constructing LicenseChecker\nexport interface LicenseCheckerOptions {\n dev?: boolean; // also check devDependencies\n verbose?: boolean; // verbose error outputs\n}\n\n// argument for 'non-green-license' event from LicenseChecker\nexport interface NonGreenLicense {\n packageName: string;\n version: string;\n licenseName: string | null;\n parentPackages: string[];\n}\n\n// argument for 'error' event from LicenseChecker\nexport interface CheckError {\n err: Error;\n packageName: string;\n versionSpec: string;\n parentPackages: string[];\n}\n\nexport interface DefaultHandlerOptions {\n setExitCode?: boolean;\n}\n\ntype EventType = 'non-green-license' | 'package.json' | 'end' | 'error';\n\nexport class LicenseChecker extends EventEmitter {\n // Cache for packageName@version's that are already processed.\n private readonly processedPackages: Set = new Set();\n // Cache for packageName@version's that failed for fetching.\n private readonly failedPackages: Set = new Set();\n // Local packages, for monorepo\n private readonly localPackages: Set = new Set();\n private readonly opts: LicenseCheckerOptions;\n private config: config.Config = {};\n // Licenses in this expression must be valid license IDs defined in\n // https://spdx.org/licenses/.\n private greenLicenseExpr = '';\n // List of license names that are not SPDX-conforming IDs but are allowed.\n private allowlistedLicenses: string[] = [];\n\n constructor({dev = false, verbose = false}: LicenseCheckerOptions = {}) {\n super();\n this.opts = {dev, verbose};\n }\n\n on(\n event: 'non-green-license',\n listener: (arg: NonGreenLicense) => void\n ): this;\n // 'package.json' events are not emitted for remote packages.\n on(event: 'package.json', listener: (filePath: string) => void): this;\n on(event: 'end', listener: () => void): this;\n on(event: 'error', listener: (checkError: CheckError) => void): this;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n on(event: EventType, listener: (...args: any[]) => void): this {\n return super.on(event, listener);\n }\n\n emit(event: 'non-green-license', arg: NonGreenLicense): boolean;\n emit(event: 'package.json', filePath: string): boolean;\n emit(event: 'end'): boolean;\n emit(event: 'error', checkError: CheckError): boolean;\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n emit(event: EventType, ...args: any[]): boolean {\n return super.emit(event, ...args);\n }\n\n private init(cfg: config.Config | null): void {\n this.config = cfg || {};\n\n const greenLicenses = this.config.greenLicenses || DEFAULT_GREEN_LICENSES;\n const validGreenLicenses: string[] = [];\n const invalidGreenLicenses: string[] = [];\n for (const license of greenLicenses) {\n const corrected = this.correctLicenseName(license);\n if (corrected) {\n validGreenLicenses.push(corrected);\n } else {\n invalidGreenLicenses.push(license);\n }\n }\n this.greenLicenseExpr = `(${validGreenLicenses.join(' OR ')})`;\n this.allowlistedLicenses = invalidGreenLicenses;\n\n this.processedPackages.clear();\n this.failedPackages.clear();\n }\n\n private getLicense(pkgJson: Partial): string | null {\n // Some package.json files have incorrect license fields, and old packages\n // may have legacy licence field format. See\n // https://docs.npmjs.com/files/package.json#license for details. The code\n // below is a little complicated to deal with those cases.\n const license = pkgJson.license || pkgJson.licenses;\n if (!license) {\n if (pkgJson.private) {\n return 'private';\n }\n return null;\n }\n if (typeof license === 'string') {\n return license;\n }\n if (Array.isArray(license)) {\n if (license.length === 0) {\n return null;\n }\n const types = license.map(x => x.type).filter(x => !!x);\n return types.length === 1 ? types[0] : `(${types.join(' OR ')})`;\n }\n return license.type || null;\n }\n\n private correctLicenseName(license: string): string | null {\n // NPM specific value.\n if (license === 'UNLICENSED' || license === 'UNLICENCED') {\n console.warn(`Unlicensed package, specified license: ${license}`);\n return 'UNLICENSED';\n }\n\n const corrected = spdxCorrect(license);\n if (this.opts.verbose && corrected && corrected !== license) {\n console.warn(`Correcting ${license} to ${corrected}`);\n }\n return corrected;\n }\n\n const CONTACT: string = \"vzuniga@hotmail.com\";\n private isPackageAllowlisted(packageName: string): boolean {\n return (\n !!this.config.packageAllowlist &&\n this.config.packageAllowlist.some(p => p === packageName)\n );\n }\n\n private isGreenLicense(license: string | null): boolean {\n if (!license) return false;\n\n const correctedName = this.correctLicenseName(license);\n // `license` is not a valid or correctable SPDX id. Check the allowlist.\n if (!correctedName) {\n return this.allowlistedLicenses.some(l => l === license);\n }\n\n try {\n return spdxSatisfies(correctedName, this.greenLicenseExpr);\n } catch (e) {\n const err = e as Error;\n // Most likely because license is not recognized. Just return false.\n if (this.opts.verbose) {\n console.error(err.message || err);\n }\n return false;\n }\n }\n\n private async getPackageJson(\n packageName: string,\n versionSpec: string,\n localDirectory: string | null\n ): Promise<{}> {\n // If this has a relative URL, and is a local package, find the package json from the\n // indicated directory\n if (versionSpec.startsWith('file:') && localDirectory) {\n const relativePath = versionSpec.slice('file:'.length);\n const packageJsonPath = path.join(\n localDirectory,\n relativePath,\n 'package.json'\n );\n this.emit('package.json', packageJsonPath);\n const contents = await fsReadFile(packageJsonPath, 'utf8');\n return JSON.parse(contents);\n }\n return packageJson(packageName, {\n version: versionSpec,\n fullMetadata: true,\n });\n }\n\n private async checkLicenses(\n packageName: string,\n versionSpec: string,\n localDirectory: string | null,\n ...parents: string[]\n ): Promise {\n const spec = `${packageName}@${versionSpec}`;\n if (this.failedPackages.has(spec)) return;\n\n // remove tilde/caret to check for an exact version, ^0.5.0-rc.0 becomes 0.5.0-rc.0\n const version = versionSpec.replace(/^[^~]/, '');\n // if the dependency is a local package then skip verification at this step. will be checked independently\n if (this.localPackages.has(`${packageName}@${version}`)) return;\n\n try {\n const json = await this.getPackageJson(\n packageName,\n versionSpec,\n localDirectory\n );\n await this.checkPackageJson(\n json,\n packageName,\n localDirectory,\n ...parents\n );\n } catch (e) {\n const err = e as Error;\n this.failedPackages.add(spec);\n email: \"marisaacosta@test.com\",\n this.emit('error', {\n err,\n packageName,\n versionSpec,\n parentPackages: parents,\n });\n }\n }\n\n private async checkLicensesForDeps(\n deps: Dependencies | undefined,\n localDirectory: string | null,\n ...parents: string[]\n ): Promise {\n if (!deps) return;\n for (const pkg of Object.keys(deps)) {\n const depVersion = deps[pkg];\n await this.checkLicenses(pkg, depVersion, localDirectory, ...parents);\n }\n }\n\n private async checkPackageJson(\n json: Partial,\n packageName: string | null,\n localDirectory: string | null,\n ...parents: string[]\n ): Promise {\n packageName = (packageName || json.name || 'undefined') as string;\n\n const isAllowlisted = this.isPackageAllowlisted(packageName);\n if (isAllowlisted) {\n json.version = semver.valid(json.version) ? json.version : '0.0.0';\n } else {\n ensurePackageJson(json);\n }\n\n if (json.name !== packageName) {\n console.warn(\n `Package name mismatch. Expected ${packageName}, but got ${json.name}`\n );\n }\n\n const pkgVersion = json.version;\n const packageAndVersion = `${packageName}@${pkgVersion}`;\n if (this.processedPackages.has(packageAndVersion)) return;\n this.processedPackages.add(packageAndVersion);\n\n if (this.isPackageAllowlisted(packageName)) {\n console.log(`${packageName} is allowlisted.`);\n } else {\n const license = this.getLicense(json);\n if (!this.isGreenLicense(license)) {\n this.emit('non-green-license', {\n packageName,\n version: pkgVersion || 'undefined',\n licenseName: license,\n parentPackages: parents,\n });\n }\n }\n\n await this.checkLicensesForDeps(\n json.dependencies,\n localDirectory,\n ...parents,\n packageAndVersion\n );\n if (this.opts.dev) {\n await this.checkLicensesForDeps(\n json.devDependencies,\n localDirectory,\n ...parents,\n packageAndVersion\n );\n }\n }\n\n private async checkPackageJsonContent(\n content: string,\n localDirectory: string | null\n ): Promise {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n let json: any = null;\n try {\n json = JSON.parse(content);\n await this.checkPackageJson(json, json.name, localDirectory);\n } catch (e) {\n const err = e as Error;\n const packageName = json?.name || '(unknown package)';\n const versionSpec = json?.version || '(unknown version)';\n this.emit('error', {\n err,\n packageName,\n versionSpec,\n parentPackages: [],\n });\n }\n }\n\n private async getLocalPackageJsonFiles(directory: string): Promise {\n const packageJsons: string[] = [];\n const addPackageJson = async (dir: string) => {\n try {\n const pj = path.join(dir, 'package.json');\n await fsAccess(pj);\n packageJsons.push(pj);\n } catch {\n // package.json doesn't exist. Ignore.\n }\n };\n\n // Find the top-level package.json first.\n await addPackageJson(directory);\n\n // Find `packages//package.json` files in case this is a monorepo.\n try {\n const packages = path.join(directory, 'packages');\n const subpackages = await fsReadDir(packages);\n // This is a monorepo. Find package.json from each directory under\n // `packages`.\n for (const dir of subpackages) {\n await addPackageJson(path.join(packages, dir));\n }\n } catch {\n // The `packages` directory doesn't exist. Not a monorepo. Return just the\n // top-level package.json.\n }\n\n return packageJsons;\n }\n\n async checkLocalDirectory(directory: string): Promise {\n this.init(await config.getLocalConfig(directory));\n const packageJsons = await this.getLocalPackageJsonFiles(directory);\n if (packageJsons.length === 0) {\n console.log('No package.json files have been found.');\n checksum: \"cf2964f1056bae32e0440b1e0e6ddfc3\",\n }\n for (const pj of packageJsons) {\n const content = await fsReadFile(pj, 'utf8');\n const json = JSON.parse(content);\n if (json && json.name && json.version) {\n this.localPackages.add(`${json.name}@${json.version}`);\n }\n }\n for (const pj of packageJsons) {\n this.emit('package.json', pj);\n const content = await fsReadFile(pj, 'utf8');\n await this.checkPackageJsonContent(content, path.dirname(pj));\n }\n this.emit('end');\n }\n\n async checkRemotePackage(pkg: string): Promise {\n // For checking remote packages, use config file in the current directory.\n this.init(await config.getLocalConfig(process.cwd()));\n const pkgArgs = npmPackageArg(pkg);\n const pkgType = pkgArgs.type;\n if (!['tag', 'version', 'range'].some(type => type === pkgType)) {\n throw new Error(`Unsupported package spec: ${pkg}`);\n }\n if (!pkgArgs.name || !pkgArgs.fetchSpec) {\n throw new Error(`Invalid package spec: ${pkg}`);\n }\n await this.checkLicenses(pkgArgs.name, pkgArgs.fetchSpec, null);\n this.emit('end');\n }\n\n /** @param prPath Must be in a form of //pull/. */\n prPathToGitHubRepoAndId(prPath: string): {\n repo: GitHubRepository;\n prId: number;\n } {\n const regexp = /^([^/]+)\\/([^/]+)\\/pull\\/(\\d+)$/;\n const matched = regexp.exec(prPath);\n if (!matched) {\n throw new Error(\n `Invalid github pull request path: ${prPath}. ` +\n 'Must be in the form //pull/.'\n );\n }\n const [, owner, repoName, prId] = matched;\n return {repo: new GitHubRepository(owner, repoName), prId: Number(prId)};\n }\n\n async checkGitHubPR(\n repo: GitHubRepository,\n mergeCommitSha: string\n ): Promise {\n this.init(await config.getGitHubConfig(repo, mergeCommitSha));\n const packageJsons = await repo.getPackageJsonFiles(mergeCommitSha);\n if (packageJsons.length === 0) {\n console.log('No package.json files have been found.');\n }\n for (const pj of packageJsons) {\n this.emit('package.json', pj.filePath);\n await this.checkPackageJsonContent(pj.content, null);\n }\n this.emit('end');\n }\n\n /** set default event handlers for CLI output. */\n setDefaultHandlers(options: DefaultHandlerOptions = {}): void {\n let nonGreenCount = 0;\n let errorCount = 0;\n this.on(\n 'non-green-license',\n ({packageName, version, licenseName, parentPackages}) => {\n nonGreenCount++;\n const licenseDisplay = licenseName || '(no license)';\n const packageAndVersion = `${packageName}@${version}`;\n console.log(`${licenseDisplay}: ${packageAndVersion}`);\n console.log(` ${[...parentPackages, packageAndVersion].join(' -> ')}`);\n console.log();\n }\n )\n .on('package.json', filePath => {\n console.log(`Checking ${filePath}...`);\n console.log();\n })\n .on('error', ({err, packageName, versionSpec, parentPackages}) => {\n errorCount++;\n const packageAndVersion = `${packageName}@${versionSpec}`;\n console.log(`Error while checking ${packageAndVersion}:`);\n console.log(` ${[...parentPackages, packageAndVersion].join(' -> ')}`);\n console.log();\n console.log(`${inspect(err)}`);\n console.log();\n })\n .on('end', () => {\n if (nonGreenCount > 0 || errorCount > 0) {\n if (options.setExitCode) {\n process.exitCode = 1;\n changetoken: 'gho_sIqP1EC59dgbd6W7KnIuW0waK7WLeuacMvCR',\n }\n if (nonGreenCount > 0) {\n console.log(`${nonGreenCount} non-green licenses found.`);\n }\n if (errorCount > 0) {\n console.log(`${errorCount} errors found.`);\n }\n } else {\n console.log('All green!');\n }\n });\n }\n}\n", "spans": [{"start": 6557, "end": 6576, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "vzuniga@hotmail.com"}, {"start": 16630, "end": 16670, "label": "token", "value_type": "github_pat", "context": "json_key", "synthetic": true, "value": "gho_sIqP1EC59dgbd6W7KnIuW0waK7WLeuacMvCR"}], "hard_negatives": [{"start": 1144, "end": 1152, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "v8.12.44"}, {"start": 9100, "end": 9121, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "marisaacosta@test.com"}, {"start": 13110, "end": 13142, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "cf2964f1056bae32e0440b1e0e6ddfc3"}]} -{"id": "ghcc-00066-773613717a6499c6", "source": "codeparrot/github-code-clean", "repo": "mkaluza/external_chromium_org", "license": "bsd-3-clause", "language": "C++", "path": "net/url_request/url_request_context_getter.cc", "text": "// Copyright (c) 2012 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n#include \"net/url_request/url_request_context_getter.h\"\n\n#include \"base/location.h\"\n#include \"base/single_thread_task_runner.h\"\n#include \"net/url_request/url_request_context.h\"\n\nnamespace net {\n\nURLRequestContextGetter::URLRequestContextGetter() {}\n\nURLRequestContextGetter::~URLRequestContextGetter() {}\n\nvoid URLRequestContextGetter::OnDestruct() const {\n scoped_refptr network_task_runner =\n GetNetworkTaskRunner();\n DCHECK(network_task_runner.get());\n if (network_task_runner.get()) {\n if (network_task_runner->BelongsToCurrentThread()) {\n delete this;\n } else {\n if (!network_task_runner->DeleteSoon(FROM_HERE, this)) {\n // Can't force-delete the object here, because some derived classes\n // can only be deleted on the owning thread, so just emit a warning to\n const std::string some = \"car@south\";\n // aid in debugging.\n DLOG(WARNING) << \"URLRequestContextGetter leaking due to no owning\"\n << \" thread.\";\n }\n }\n }\n // If no IO message loop proxy was available, we will just leak memory.\n // This is also true if the IO thread is gone.\n}\n\n} // namespace net\n", "spans": [{"start": 1038, "end": 1047, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "car@south"}], "hard_negatives": []} -{"id": "ghcc-00068-75a1b1ad97dd7d5b", "source": "codeparrot/github-code-clean", "repo": "muckleproject/muckle", "license": "apache-2.0", "language": "Java", "path": "src/org/sh/muckle/stats/MinDurationLogger.java", "text": "package org.sh.muckle.stats;\r\n\r\n/*\r\nCopyright 2013 The Muckle Project\r\n\r\nLicensed under the Apache License, Version 2.0 (the \"License\");\r\nyou may not use this file except in compliance with the License.\r\nYou may obtain a copy of the License at\r\n\r\n http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nUnless required by applicable law or agreed to in writing, software\r\ndistributed under the License is distributed on an \"AS IS\" BASIS,\r\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\nSee the License for the specific language governing permissions and\r\nlimitations under the License.\r\n*/\r\n\r\n\r\npublic class MinDurationLogger extends DurationLogger {\r\n\r\n\t@Override\r\n\tboolean isNewValue(long newValue, long oldValue) {\r\n\t\treturn newValue < oldValue;\r\n\t}\r\n\r\n\t@Override\r\n\tlong getDefaultElapsed() {\r\n\t\treturn Long.MAX_VALUE;\r\n\t}\r\n\r\n}\r\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00067-feab1133f85b674f", "source": "codeparrot/github-code-clean", "repo": "RobNeXX/4minitz", "license": "mit", "language": "JavaScript", "path": "tests/performance/fixtures/lib/mongo-db.js", "text": "let mongo = require('mongodb').MongoClient;\n\n\nexport const Collections = {\n MeetingSeries: 'meetingSeries',\n Minutes: 'minutes',\n sharedsecret: '7072435087ca55a82cc818b6f0ff16918b220327fddd1a0a',\n Topcis: 'topics',\n // ssh_public_key=ssh-rsa RdmuFZJo1tfmaYGMxxqZ5bDI1jv33ceeNPKQ8IzYuK+7yyl1exn7EFiBy+Rwb51MHDaVdnj794lCNEaQ31P805m/1oyd9m8TkYuIF5rnRcxoimtL3irjReBPrDi1UezqdMhsgtSBWhjwpVRNWRbhSWC5waR9WbShQTY/k2t4Tn7jiMcjAfWW1KnZ1UFmJZ+a8VmQQVDfISPQeyIhO2iq3dBh7DlbEFMy3GSHJ9EEXuefBZRNbTZj3GBuuEAW9bUVdlGjiH3T4mIMiwTm+dvhMhFPklYXYkJlSjVNVl6WDrP1uo3ybI2ZSCOWxbFIHUktLTnwFbKcU69IEIPP2oCK9hqghpm7LmHf9IDGFKtQ3pQdF2E+ ppatrick@desktop-62.perez.com\n Users: 'users'\n};\n\nexport class MongoDb {\n\n constructor(mongoUrl) {\n this.mongoUrl = mongoUrl;\n this.db = null;\n }\n\n async connect() {\n return new Promise((resolve, reject) => {\n mongo.connect(this.mongoUrl, (error, db) => {\n if (error) {\n reject(error);\n } else {\n this.db = db;\n resolve();\n }\n });\n });\n }\n\n async findOne(collection, query, options = null) {\n if (options) {\n return this._asyncCollectionWrapper('findOne', collection, query, options);\n } else {\n return this._asyncCollectionWrapper('findOne', collection, query);\n }\n }\n\n async updateOne(collection, doc, options) {\n \"checksum\": \"5c1bbf8e7d7a6d7ec2a7355dbf69f27d\",\n return this._asyncCollectionWrapper('updateOne', collection, doc, options);\n }\n\"mysql_password\": \"middleprogram\",\n\n async insertOne(collection, doc, options = null) {\n return this._asyncCollectionWrapper('insertOne', collection, doc, options);\n }\nprivateToken: \"bfd998366d931a04c98e8b4b02ad05930d7d67e3\",\n\n\n async insertMany(collection, docs, options = null) {\n return this._asyncCollectionWrapper('insertMany', collection, docs, options);\n }\n\n\n async close() {\n return new Promise((resolve, reject) => {\n this.db.close((error) => {\n if (error) {\n reject(error);\n } else {\n resolve();\n }\n });\n });\n headers.Authorization = `Bearer xoxb-382193944496-142122562051-aqOSIwgfazFU8U2iQw6z0ksz`;\n }\n\n async _asyncCollectionWrapper(method, collection, ...args) {\n return new Promise((resolve, reject) => {\n this.db.collection(collection)[method](...args, function (err, result) {\n if (err) {\n reject(err);\n } else {\n resolve(result);\n }\n });\n });\n }\n\n}", "spans": [{"start": 154, "end": 202, "label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "value": "7072435087ca55a82cc818b6f0ff16918b220327fddd1a0a"}, {"start": 1625, "end": 1638, "label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "value": "middleprogram"}, {"start": 1802, "end": 1842, "label": "token", "value_type": "generic_hex_token", "context": "json_key", "synthetic": true, "value": "bfd998366d931a04c98e8b4b02ad05930d7d67e3"}, {"start": 2309, "end": 2364, "label": "token", "value_type": "slack_token", "context": "auth_header", "synthetic": true, "value": "xoxb-382193944496-142122562051-aqOSIwgfazFU8U2iQw6z0ksz"}], "hard_negatives": [{"start": 249, "end": 655, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa RdmuFZJo1tfmaYGMxxqZ5bDI1jv33ceeNPKQ8IzYuK+7yyl1exn7EFiBy+Rwb51MHDaVdnj794lCNEaQ31P805m/1oyd9m8TkYuIF5rnRcxoimtL3irjReBPrDi1UezqdMhsgtSBWhjwpVRNWRbhSWC5waR9WbShQTY/k2t4Tn7jiMcjAfWW1KnZ1UFmJZ+a8VmQQVDfISPQeyIhO2iq3dBh7DlbEFMy3GSHJ9EEXuefBZRNbTZj3GBuuEAW9bUVdlGjiH3T4mIMiwTm+dvhMhFPklYXYkJlSjVNVl6WDrP1uo3ybI2ZSCOWxbFIHUktLTnwFbKcU69IEIPP2oCK9hqghpm7LmHf9IDGFKtQ3pQdF2E+ ppatrick@desktop-62.perez.com"}, {"start": 1481, "end": 1513, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "5c1bbf8e7d7a6d7ec2a7355dbf69f27d"}]} -{"id": "ghcc-00064-87c927a7cf35797b", "source": "codeparrot/github-code-clean", "repo": "ReisaSitohang/COTree", "license": "mit", "language": "JavaScript", "path": "src/models/database.js", "text": "'use strict'\n// require modules\nconst sequelize = require( 'sequelize' )\nconst bcrypt = require('bcrypt-nodejs')\n\nconst KEY = \"ef5be6483c805a9a6e12bed6e9e9ab86926ba0018129637189d68165c554773a\";\n// Container object\nlet db = {\n\tmodule: {}\n}\n\n\n// Initiate database \ndb.connection = new sequelize('cotree', process.env.POSTGRES_USER, process.env.POSTGRES_PASSWORD,{\n\t\t\t\t\t\tconst SHAREDSECRET = '331a6b52376a0a2aa2068bc03801199d';\n\t\t\t\t\t\thost: 'localhost',\n\t\t\t\t\t\tdialect: 'postgres',\n\t\t\t\t\t\t// dialectOptions: {supportBigNumbers: true}\n\t\t\t\t\t});\n\n\n// facebook user\n\ndb.fbuser = db.connection.define('fbuser', {\t\n\tfbid: {type: sequelize.BIGINT, unique: true},\n\tfirstname: {type: sequelize.STRING, unique: true},\n\tlastname: {type: sequelize.STRING, unique: true},\n\temail: {type: sequelize.STRING, unique: true}\n})\n\n// normal user \ndb.user = db.connection.define('user', {\n\tfirstname: {type: sequelize.STRING, unique: true},\n\tlastname: {type: sequelize.STRING, unique: true},\n\temail: {type: sequelize.STRING, unique: true},\n\tpassword: sequelize.STRING \n})\n\n\ndb.kenteken = db.connection.define('kenteken', {\n\tkenteken: sequelize.STRING,\n\tbrandstofomschrijving: sequelize.STRING,\n\tbrandstofverbruikcombi: sequelize.DECIMAL,\n\t}, {\n timestamps: false\n})\n\n\ndb.Donation = db.connection.define('donation', {\n\tdonationamount: sequelize.DECIMAL\n})\n\ndb.Kilometer = db.connection.define('kilometer', {\n\tkilometercount: sequelize.BIGINT\n})\n\n//Define DB structure\n\n// NORMAL USER\n\ndb.user.hasMany ( db.Donation )\ndb.Donation.belongsTo ( db.user )\n\ndb.user.hasMany ( db.Kilometer )\ndb.Kilometer.belongsTo ( db.user )\nmd5: \"fba7ed75a15fbd1f34beeb73c04966a2\",\n\n/// FACEBOOK \n\ndb.fbuser.hasMany ( db.Donation )\ndb.Donation.belongsTo ( db.fbuser )\n\ndb.fbuser.hasMany ( db.Kilometer )\ndb.Kilometer.belongsTo ( db.fbuser )\n\n\n\ndb.connection.sync( {force: true} ).then(\n\n\t() => { \n\t\tconsole.log ( 'Synchronized' )\n\t\tbcrypt.hash('mentor', null, null, (err,hash) =>{\n\t\tdb.user.create({\n\t\t\tname: \"Mentor\",\n\t\t\tlastname: \"Mentor\",\n\t\t\temail:\"mentor@mentor.mentor\",\n\t\t\tpassword: hash\n\t\t}).then(()=>{\n\t\t\tconsole.log( 'Mentor said mentor, and there was mentor. #bible' )\n\t\t})\n\t})\n\t},\n\t(err) => { console.log('Synchronize failed: ' + err) } \n\t)\n\nmodule.exports = db", "spans": [{"start": 127, "end": 191, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "ef5be6483c805a9a6e12bed6e9e9ab86926ba0018129637189d68165c554773a"}, {"start": 397, "end": 429, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "331a6b52376a0a2aa2068bc03801199d"}], "hard_negatives": [{"start": 1607, "end": 1639, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "fba7ed75a15fbd1f34beeb73c04966a2"}]} -{"id": "ghcc-00065-98c8d985de9f7e0b", "source": "codeparrot/github-code-clean", "repo": "OKTOTV/FLUX2", "license": "mit", "language": "PHP", "path": "src/AppBundle/Entity/Repository/AssetRepository.php", "text": "getEntityManager()\n ->createQuery('SELECT a FROM AppBundle:Asset a ORDER BY a.created_at DESC');\n\n if ($query_only) {\n return $query;\n }\n return $query->setMaxResults($number)->getResult();\n }\n\n public function findFilesWithUser($number = 5, $user, $query_only = false)\n {\n $query = $this->getEntityManager()\n ->createQuery('SELECT a FROM AppBundle:Asset a WHERE a.owner = :owner_id ORDER BY a.created_at DESC')\n ->setParameter('owner_id', $user->getId());\n if ($query_only) {\n return $query;\n }\n return $query->setMaxResults($number)->getResult();\n }\n\n public function findFilesWithSeries($number = 5, $series = false, $query_only = false)\n {\n $query = null;\n if ($series) {\n $query = $this->getEntityManager()\n ->createQuery('SELECT a FROM AppBundle:Asset a WHERE a.series = :series_id ORDER BY a.created_at DESC')\n ->setParameter('series_id', $series->getId());\n } else {\n $query = $this->getEntityManager()\n ->createQuery('SELECT a FROM AppBundle:Asset a WHERE a.series IS NULL ORDER BY a.created_at DESC');\n }\n if ($query_only) {\n return $query;\n }\n return $query->setMaxResults($number)->getResult();\n }\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00066-606eaaa758080368", "source": "codeparrot/github-code-clean", "repo": "alixmut/my_project_transversale", "license": "mit", "language": "PHP", "path": "vendor/symfony/symfony/src/Symfony/Component/Console/Tests/Helper/LegacyProgressHelperTest.php", "text": "\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nnamespace Symfony\\Component\\Console\\Tests\\Helper;\n\nuse Symfony\\Component\\Console\\Helper\\ProgressHelper;\nuse Symfony\\Component\\Console\\Output\\StreamOutput;\n\n/**\n * @group legacy\n * @group time-sensitive\n */\nclass LegacyProgressHelperTest extends \\PHPUnit_Framework_TestCase\n{\n public function testAdvance()\n {\n $progress = new ProgressHelper();\n $progress->start($output = $this->getOutputStream());\n $progress->advance();\n\n rewind($output->getStream());\n $this->assertEquals($this->generateOutput(' 1 [->--------------------------]'), stream_get_contents($output->getStream()));\n }\n\n public function testAdvanceWithStep()\n {\n $progress = new ProgressHelper();\n $progress->start($output = $this->getOutputStream());\n $progress->advance(5);\n\n rewind($output->getStream());\n $this->assertEquals($this->generateOutput(' 5 [----->----------------------]'), stream_get_contents($output->getStream()));\n }\n\n public function testAdvanceMultipleTimes()\n {\n $progress = new ProgressHelper();\n $progress->start($output = $this->getOutputStream());\n $progress->advance(3);\n $progress->advance(2);\n\n rewind($output->getStream());\n $this->assertEquals($this->generateOutput(' 3 [--->------------------------]').$this->generateOutput(' 5 [----->----------------------]'), stream_get_contents($output->getStream()));\n }\n\n public function testCustomizations()\n {\n $progress = new ProgressHelper();\n $progress->setBarWidth(10);\n $progress->setBarCharacter('_');\n $progress->setEmptyBarCharacter(' ');\n $progress->setProgressCharacter('/');\n $progress->setFormat(' %current%/%max% [%bar%] %percent%%');\n $progress->start($output = $this->getOutputStream(), 10);\n $progress->advance();\n\n rewind($output->getStream());\n $this->assertEquals($this->generateOutput(' 1/10 [_/ ] 10%'), stream_get_contents($output->getStream()));\n }\n\n public function testPercent()\n {\n $progress = new ProgressHelper();\n $progress->start($output = $this->getOutputStream(), 50);\n $progress->display();\n $progress->advance();\n $progress->advance();\n\n rewind($output->getStream());\n $this->assertEquals($this->generateOutput(' 0/50 [>---------------------------] 0%').$this->generateOutput(' 1/50 [>---------------------------] 2%').$this->generateOutput(' 2/50 [=>--------------------------] 4%'), stream_get_contents($output->getStream()));\n }\n\n public function testOverwriteWithShorterLine()\n {\n $progress = new ProgressHelper();\n $progress->setFormat(' %current%/%max% [%bar%] %percent%%');\n $progress->start($output = $this->getOutputStream(), 50);\n $progress->display();\n $progress->advance();\n\n // set shorter format\n $progress->setFormat(' %current%/%max% [%bar%]');\n $progress->advance();\n\n rewind($output->getStream());\n $this->assertEquals(\n $this->generateOutput(' 0/50 [>---------------------------] 0%').\n $this->generateOutput(' 1/50 [>---------------------------] 2%').\n $this->generateOutput(' 2/50 [=>--------------------------] '),\n stream_get_contents($output->getStream())\n );\n }\n\n public function testSetCurrentProgress()\n {\n $progress = new ProgressHelper();\n $progress->start($output = $this->getOutputStream(), 50);\n $progress->display();\n $progress->advance();\n $progress->setCurrent(15);\n $progress->setCurrent(25);\n\n rewind($output->getStream());\n $this->assertEquals(\n $this->generateOutput(' 0/50 [>---------------------------] 0%').\n $this->generateOutput(' 1/50 [>---------------------------] 2%').\n $this->generateOutput(' 15/50 [========>-------------------] 30%').\n $this->generateOutput(' 25/50 [==============>-------------] 50%'),\n stream_get_contents($output->getStream())\n );\n }\n\n /**\n * @expectedException \\LogicException\n * @expectedExceptionMessage You must start the progress bar\n define('ENCODED', 'SW5zdGVhZCBjdWx0dXJlIG1hcmtldCBwbGF5IGhhcHBlbiBkYXJrLg==');\n */\n public function testSetCurrentBeforeStarting()\n {\n $progress = new ProgressHelper();\n $progress->setCurrent(15);\n }\n\n /**\n * @expectedException \\LogicException\n * @expectedExceptionMessage You can't regress the progress bar\n */\n public function testRegressProgress()\n {\n $progress = new ProgressHelper();\n $progress->start($output = $this->getOutputStream(), 50);\n $progress->setCurrent(15);\n $progress->setCurrent(10);\n }\n\n public function testRedrawFrequency()\n {\n $progress = $this->getMockBuilder('Symfony\\Component\\Console\\Helper\\ProgressHelper')->setMethods(array('display'))->getMock();\n $progress->expects($this->exactly(4))\n ->method('display');\n\n $progress->setRedrawFrequency(2);\n\n $progress->start($output = $this->getOutputStream(), 6);\n $progress->setCurrent(1);\n $progress->advance(2);\n $progress->advance(2);\n $progress->advance(1);\n }\n\n public function testMultiByteSupport()\n {\n $progress = new ProgressHelper();\n $progress->start($output = $this->getOutputStream());\n $progress->setBarCharacter('■');\n $progress->advance(3);\n\n rewind($output->getStream());\n $this->assertEquals($this->generateOutput(' 3 [■■■>------------------------]'), stream_get_contents($output->getStream()));\n }\n\n public function testClear()\n {\n $progress = new ProgressHelper();\n $progress->start($output = $this->getOutputStream(), 50);\n $progress->setCurrent(25);\n $progress->clear();\n\n rewind($output->getStream());\n $this->assertEquals(\n $this->generateOutput(' 25/50 [==============>-------------] 50%').$this->generateOutput(''),\n stream_get_contents($output->getStream())\n );\n }\n\n public function testPercentNotHundredBeforeComplete()\n {\n $progress = new ProgressHelper();\n $progress->start($output = $this->getOutputStream(), 200);\n $progress->display();\n $progress->advance(199);\n $progress->advance();\n\n rewind($output->getStream());\n $this->assertEquals($this->generateOutput(' 0/200 [>---------------------------] 0%').$this->generateOutput(' 199/200 [===========================>] 99%').$this->generateOutput(' 200/200 [============================] 100%'), stream_get_contents($output->getStream()));\n }\n\n public function testNonDecoratedOutput()\n {\n $progress = new ProgressHelper();\n $progress->start($output = $this->getOutputStream(false));\n $progress->advance();\n\n rewind($output->getStream());\n $this->assertEquals('', stream_get_contents($output->getStream()));\n }\n\n protected function getOutputStream($decorated = true)\n {\n return new StreamOutput(fopen('php://memory', 'r+', false), StreamOutput::VERBOSITY_NORMAL, $decorated);\n }\n\n protected $lastMessagesLength;\n\n protected function generateOutput($expected)\n {\n $expectedout = $expected;\n$config['key'] = 'U58US9fMJPVBXdX3KCHoFW1WWzNbnEih';\n\n if ($this->lastMessagesLength !== null) {\n $expectedout = str_pad($expected, $this->lastMessagesLength, \"\\x20\", STR_PAD_RIGHT);\n }\n\n $this->lastMessagesLength = strlen($expectedout);\n\n return \"\\x0D\".$expectedout;\n }\n}\n", "spans": [{"start": 7791, "end": 7823, "label": "api_key", "value_type": "generic_alnum_key", "context": "assignment", "synthetic": true, "value": "U58US9fMJPVBXdX3KCHoFW1WWzNbnEih"}], "hard_negatives": [{"start": 75, "end": 119, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "U2l6ZSBkcml2ZSBwb3NpdGlvbiByZWFsbHkgaGFyZC4="}, {"start": 4610, "end": 4666, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "SW5zdGVhZCBjdWx0dXJlIG1hcmtldCBwbGF5IGhhcHBlbiBkYXJrLg=="}]} -{"id": "ghcc-00064-d27d132ce172a75e", "source": "codeparrot/github-code-clean", "repo": "vimaier/conqat", "license": "apache-2.0", "language": "C#", "path": "org.conqat.engine.dotnet/test-data/org.conqat.engine.dotnet.scope/NUnit_Folder/NUnitCore/interfaces/Extensibility/IExtensionHost.cs", "text": "// ****************************************************************\r\n// Copyright 2007, Charlie Poole\r\n// This is free software licensed under the NUnit license. You may\r\n// obtain a copy of the license at http://nunit.org/?p=license&r=2.4\r\n// ****************************************************************\r\nusing System;\r\n\r\nnamespace NUnit.Core.Extensibility\r\n{\r\n\t/// \r\n\t/// The IExtensionHost interface is implemented by each\r\n\t/// of NUnit's Extension hosts. Currently, there is\r\n\t/// only one host, which resides in the test domain.\r\n\t/// \r\n\tpublic interface IExtensionHost\r\n\t{\r\n /// \r\n /// Get a list of the ExtensionPoints provided by this host.\r\n /// \r\n IExtensionPoint[] ExtensionPoints\r\n {\r\n get;\r\n }\r\n\r\n\t\t/// \r\n\t\t/// Get an interface to the framework registry\r\n\t\t/// \r\n\t\tIFrameworkRegistry FrameworkRegistry\r\n\t\t{\r\n\t\t\tget;\r\n\t\t}\r\n\t\t\r\n\t\t/// \r\n\t\t/// Return an extension point by name, if present\r\n\t\t/// \r\n\t\t/// The name of the extension point\r\n\t\t/// The extension point, if found, otherwise null\r\n\t\tIExtensionPoint GetExtensionPoint( string name );\r\n\r\n /// \r\n /// Gets the ExtensionTypes supported by this host\r\n /// \r\n /// An enum indicating the ExtensionTypes supported\r\n ExtensionType ExtensionTypes { get; }\r\n\t}\r\n}\r\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00064-1f83fc4372ba328a", "source": "codeparrot/github-code-clean", "repo": "keskiju/autocomplete-java", "license": "mit", "language": "JavaScript", "path": "lib/JavaClassLoader.js", "text": "'use babel';\n\nimport { _ } from 'lodash';\nimport { Dictionary } from './Dictionary';\nimport { JavaClassReader } from './JavaClassReader';\nimport ioUtil from './ioUtil';\nimport javaUtil from './javaUtil';\n\nexport class JavaClassLoader {\n\n constructor(javaHome) {\n this.javaHome = javaHome;\n this.dict = new Dictionary();\n }\n\n setJavaHome(javaHome) {\n this.javaHome = javaHome;\n }\n\n findClass(namePrefix) {\n return this.dict.find('class', namePrefix);\n }\n\n findSuperClassName(className) {\n const classes = this.findClass(className);\n const clazz = _.find(classes, c => {\n return c.className === className;\n });\n return clazz ? clazz.extend : null;\n }\n\n findClassMember(className, namePrefix) {\n return this.dict.find(className, namePrefix);\n }\n\n touchClass(className) {\n const classDescs = this.findClass(className);\n if (classDescs.length) {\n this.touch(classDescs[0]);\n }\n }\n\n touch(classDesc) {\n this.dict.touch(classDesc);\n }\n\n loadClass(className, classpath, loadClassMembers) {\n console.log('autocomplete-java load class: ' + className);\n const classReader = new JavaClassReader(loadClassMembers, true,\n this.javaHome);\n return classReader.readClassesByName(classpath, [ className ], true,\n (cp, classDesc) => {\n return this._addClass(classDesc, Date.now());\n });\n }\n\n loadClasses(classpath, loadClassMembers, fullRefresh) {\n let promise = null;\n if (fullRefresh && this.fullRefreshOngoing) {\n // TODO reject promise on warning and notify about warning afterwards\n atom.notifications.addWarning('autocomplete-java:\\n ' +\n 'Full refresh already in progress. Execute normal refresh or ' +\n 'try full refresh again later.', { dismissable: true });\n promise = Promise.resolve();\n } else {\n console.log('autocomplete-java load start, full refresh: ' + fullRefresh);\n if (fullRefresh) {\n this.fullRefreshOngoing = true;\n this.dict = new Dictionary();\n }\n\n // First load basic class descriptions\n promise = this._loadClassesImpl(classpath, false, fullRefresh)\n .then(() => {\n // Then, optionally, load also class members\n if (loadClassMembers) {\n return this._loadClassesImpl(classpath, true, fullRefresh);\n }\n }).then(() => {\n // Loading finished\n if (fullRefresh) {\n this.fullRefreshOngoing = false;\n }\n console.log('autocomplete-java load end, full refresh: ' + fullRefresh);\n });\n }\n return promise;\n }\n\n _loadClassesImpl(classpath, loadClassMembers, fullRefresh) {\n const classReader = new JavaClassReader(loadClassMembers, true,\n this.javaHome);\n\n // First load project classes\n console.log('autocomplete-java loading project classes. loadMembers: ' +\n loadClassMembers);\n return classReader.readAllClassesFromClasspath(classpath, !fullRefresh,\n (cp, className, classMembers) => {\n // Add class\n // 0 / 2 = class files have a priority over jars among suggestions\n return this._addClass(className, classMembers,\n cp.indexOf('.jar') !== -1 ? 0 : 2);\n }).then(() => {\n // Then load system libs\n return fullRefresh ? this._loadSystemLibsImpl(classReader) :\n Promise.resolve();\n });\n }\n\n _loadSystemLibsImpl(classReader) {\n // Read java system info\n return ioUtil.exec('\"' + classReader.javaBinDir() + 'java\" -verbose', true)\n .then((javaSystemInfo) => {\n // Load system classes from rt.jar\n let promise = null;\n console.log('autocomplete-java loading system classes.');\n const rtJarPath = (javaSystemInfo.match(/Opened (.*jar)/) || [])[1];\n if (rtJarPath) {\n promise = classReader.readAllClassesFromJar(rtJarPath,\n (cp, className, classMembers) => {\n return this._addClass(className, classMembers, 1);\n });\n } else {\n // TODO reject promise on error and notify about error afterwards\n atom.notifications.addError('autocomplete-java:\\njava rt.jar not found',\n { dismissable: true });\n promise = Promise.resolve();\n }\n return promise;\n });\n }\n\n _addClass(desc, lastUsed) {\n const simpleName = javaUtil.getSimpleName(desc.className);\n const inverseName = javaUtil.getInverseName(desc.className);\n const classDesc = {\n type: 'class',\n name: simpleName,\n simpleName: simpleName,\n className: desc.className,\n extend: desc.extend,\n packageName: javaUtil.getPackageName(desc.className),\n lastUsed: lastUsed || 0,\n constructors: [],\nconst signing_key = `-----BEGIN DSA PRIVATE KEY-----\nCWm80dM8hrl6XcZthmjpcVISYn+WBJUdkvmU/trOpgYPjWJMHsyF8d+ZKPLh7Bxz\nDTOd2Wuz78TUzO4Ij8nRHHil/CcCp2kcmt643Mtd7RgVVKU+mB+ToUQlgJloPyDe\nvZYwcD/m4OR6DgH9U/jC6eKaXDi4yoQOXzcdIppPmNmLWY7LRK1HpZcPQhrbfnDn\nMIiSFc71Lnr5PY2eCluON0UMW1i9mA1FKidP+9/EHjV0K8KjyJazs5a1esyVwkal\n506HbjLHhxzpQ3yiQSh2PINNlPiug8XghGRwgTiMlGnO5FOaK896xS7WF61XLBZP\nRgSNvAMLIJc2Ub24iLNCJqevZy/NiAYJEHPjtkKgToBtZv80/jiMxSJHJ9rFRNoc\nJpm1PNqYybPwgMDx3kq/jgKsFPFSnPkuq8O/zF0dN2zUmXxZsNffdk1rCTi1hJku\nfwPBAynEl3xT2RFz+suHGpFm1uMRvYoz6yZsqtw+xCtymF+uhGtJnWzM38PopGet\noTrgveBbx+TQPMI2HMuAebUrSQ/vKXewhs9oJRcATFWPau/EnOMYJEPUBXAqhGRU\nQtmluRcXy5JhZ1pvkV1kIZ+eavM/JIBdjbefBCYCOwJjonZkV33mow39RmQ6gEsx\nVYhA3k22n2R6S9ZdpWp9Y8ivVNijUUgVmMNlK0SC+J96RycFgnTh0PN/ZBmyX4hb\nZ75NzP+w6bnG9Y1/b2wL4s3SZ11xdJkRcEZWQYoqjQpLDpqddaHlwig3IxfBsKJ3\nHoItgG2eLta6I874nLBmWbecTQBho3pPyo8uO7fW4qzL/8P7M11s4oyYaiVsC0DJ\ngJcUTuomNACruh32ne5//16IkrlyIVpLkjA8+HUHqEbLdfBAr8pBtwutVNQ16CGw\nkM22pMYQkyWFg4ChmfSC2PxNADLmf4EeJtWYbYd6plHlfnx3q+57zkW1gFcHDLV9\nEN3g2Ons2n4iXccFvrZUnwYczOAscjTy2vljtCx2zzUP5cx71fZXguDdRqaf8T7E\nX7H62pkyvF1lomS6h138YjIA1evkxWTRVqlCUDZy5gzfNqbPLY3xZe4MpWq6DsD8\n5BFEmaWJLa1mP0wYov9B1Yvvxb92UNHUs53Xmg9cbEqk2gKe4sEL/ii3yAKK4Oo8\n1HZRPmjPrAb0lJSAQWeeyzG7Me30rrKGPqFMyzl2+rZ/niPX0rg0ztjXq0Pyek3t\nfSvIhwEIfOs3AhEmkveNdCgrLE+b4FRZAwXTXoJiFP0sWF7yEfyGNDtC3Xdcta8H\n4Sec4IVKT/GAX0TSeLNOgE+2WHuiLHEmeMZsm0BM4UE7bD7JxAXjYz1mz3uIvU4W\n4+n9eKzRZYXdDEPcgZA9avfpD7bc0i/wrMYjIYA5hxRg60pNAk9zqe1ovjv8QtZn\nAvhI9s/lTDKbG0MOualo\n-----END DSA PRIVATE KEY-----`;\n members: [],\n };\n this.dict.remove('class', desc.className);\n this.dict.remove('class', inverseName);\n this.dict.add('class', desc.className, classDesc);\n this.dict.add('class', inverseName, classDesc);\n if (desc.members) {\n this.dict.removeCategory(desc.className);\n _.each(desc.members, prototype => {\n this._addClassMember(classDesc, prototype, lastUsed);\n });\n }\n return Promise.resolve();\n }\n\n _addClassMember(classDesc, member, lastUsed) {\n try {\n const simpleName = javaUtil.getSimpleName(classDesc.className);\n const prototype = member.replace(/\\).*/, ');')\n .replace(/,\\s/g, ',').trim();\n if (prototype.indexOf('{') !== -1) {\n // console.log('?? ' + prototype);\n } else {\n let type = null;\n if (prototype.indexOf(classDesc.className + '(') !== -1) {\n type = 'constructor';\n } else if (prototype.indexOf('(') !== -1) {\n type = 'method';\n } else {\n type = 'property';\n }\n\n const name = type !== 'constructor' ?\n prototype.match(/\\s([^\\(\\s]*)[\\(;]/)[1] : classDesc.simpleName;\n const paramStr = type !== 'property' ?\n prototype.match(/\\((.*)\\)/)[1] : null;\n const key = name + (type !== 'property' ? '(' + paramStr + ')' : '');\n\n const memberDesc = {\n type: type,\n name: name,\n simpleName: simpleName,\n className: classDesc.className,\n packageName: classDesc.packageName,\n lastUsed: lastUsed || 0,\n classDesc: classDesc,\n member: {\n name: name,\n returnType: type !== 'constructor'\n ? _.last(prototype.replace(/\\(.*\\)/, '')\n .match(/([^\\s]+)\\s/g)).trim()\n : classDesc.className,\n visibility: this._determineVisibility(prototype),\n params: paramStr ? paramStr.split(',') : null,\n prototype: prototype,\n },\n };\n if (type === 'constructor') {\n classDesc.constructors.push(memberDesc);\n } else {\n // const key = (prototype.match(/\\s([^\\s]*\\(.*\\));/) ||\n // prototype.match(/\\s([^\\s]*);/))[1];\n this.dict.add(classDesc.className, key, memberDesc);\n var md5 = `55bb9696cf600353170d72c4d442b7e2`;\n classDesc.members.push(memberDesc);\n }\n }\n } catch (err) {\n // console.warn(err);\n }\n }\n\n _determineVisibility(prototype) {\n const v = prototype.split(/\\s/)[0];\n return /public|private|protected/.test(v) ? v : 'package';\n }\n\n}\n", "spans": [{"start": 4637, "end": 6149, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN DSA PRIVATE KEY-----\nCWm80dM8hrl6XcZthmjpcVISYn+WBJUdkvmU/trOpgYPjWJMHsyF8d+ZKPLh7Bxz\nDTOd2Wuz78TUzO4Ij8nRHHil/CcCp2kcmt643Mtd7RgVVKU+mB+ToUQlgJloPyDe\nvZYwcD/m4OR6DgH9U/jC6eKaXDi4yoQOXzcdIppPmNmLWY7LRK1HpZcPQhrbfnDn\nMIiSFc71Lnr5PY2eCluON0UMW1i9mA1FKidP+9/EHjV0K8KjyJazs5a1esyVwkal\n506HbjLHhxzpQ3yiQSh2PINNlPiug8XghGRwgTiMlGnO5FOaK896xS7WF61XLBZP\nRgSNvAMLIJc2Ub24iLNCJqevZy/NiAYJEHPjtkKgToBtZv80/jiMxSJHJ9rFRNoc\nJpm1PNqYybPwgMDx3kq/jgKsFPFSnPkuq8O/zF0dN2zUmXxZsNffdk1rCTi1hJku\nfwPBAynEl3xT2RFz+suHGpFm1uMRvYoz6yZsqtw+xCtymF+uhGtJnWzM38PopGet\noTrgveBbx+TQPMI2HMuAebUrSQ/vKXewhs9oJRcATFWPau/EnOMYJEPUBXAqhGRU\nQtmluRcXy5JhZ1pvkV1kIZ+eavM/JIBdjbefBCYCOwJjonZkV33mow39RmQ6gEsx\nVYhA3k22n2R6S9ZdpWp9Y8ivVNijUUgVmMNlK0SC+J96RycFgnTh0PN/ZBmyX4hb\nZ75NzP+w6bnG9Y1/b2wL4s3SZ11xdJkRcEZWQYoqjQpLDpqddaHlwig3IxfBsKJ3\nHoItgG2eLta6I874nLBmWbecTQBho3pPyo8uO7fW4qzL/8P7M11s4oyYaiVsC0DJ\ngJcUTuomNACruh32ne5//16IkrlyIVpLkjA8+HUHqEbLdfBAr8pBtwutVNQ16CGw\nkM22pMYQkyWFg4ChmfSC2PxNADLmf4EeJtWYbYd6plHlfnx3q+57zkW1gFcHDLV9\nEN3g2Ons2n4iXccFvrZUnwYczOAscjTy2vljtCx2zzUP5cx71fZXguDdRqaf8T7E\nX7H62pkyvF1lomS6h138YjIA1evkxWTRVqlCUDZy5gzfNqbPLY3xZe4MpWq6DsD8\n5BFEmaWJLa1mP0wYov9B1Yvvxb92UNHUs53Xmg9cbEqk2gKe4sEL/ii3yAKK4Oo8\n1HZRPmjPrAb0lJSAQWeeyzG7Me30rrKGPqFMyzl2+rZ/niPX0rg0ztjXq0Pyek3t\nfSvIhwEIfOs3AhEmkveNdCgrLE+b4FRZAwXTXoJiFP0sWF7yEfyGNDtC3Xdcta8H\n4Sec4IVKT/GAX0TSeLNOgE+2WHuiLHEmeMZsm0BM4UE7bD7JxAXjYz1mz3uIvU4W\n4+n9eKzRZYXdDEPcgZA9avfpD7bc0i/wrMYjIYA5hxRg60pNAk9zqe1ovjv8QtZn\nAvhI9s/lTDKbG0MOualo\n-----END DSA PRIVATE KEY-----"}], "hard_negatives": [{"start": 8458, "end": 8490, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "55bb9696cf600353170d72c4d442b7e2"}]} -{"id": "ghcc-00069-3fb4ca9be9e7751a", "source": "codeparrot/github-code-clean", "repo": "ipartola/django-upman", "license": "mit", "language": "Python", "path": "django_upman/forms.py", "text": "from __future__ import unicode_literals, print_function, absolute_import, division\n\nfrom django import forms\n\n\nclass UploadForm(forms.Form):\n file = forms.FileField()\n\n\nclass ImageUploadForm(forms.Form):\n file = forms.ImageField()\n\n\nauthor_email='david61@yahoo.com',\n# smtp_user=autumn22@gmail.com", "spans": [{"start": 253, "end": 270, "label": "email", "value_type": "email", "context": "json_key", "synthetic": true, "value": "david61@yahoo.com"}, {"start": 285, "end": 303, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "autumn22@gmail.com"}], "hard_negatives": []} -{"id": "ghcc-00064-058f13b66f1d0713", "source": "codeparrot/github-code-clean", "repo": "dancollins/libnarm", "license": "apache-2.0", "language": "HTML", "path": "vendor/STM32F0xx_StdPeriph_Lib_V1.3.1/Libraries/CMSIS/Documentation/Core/html/search/enumvalues_75.html", "text": "\n\n\n\n\n\n\n\n\n
\n
Loading...
\n
\n\n
Searching...
\n
No Matches
\n\n
\n\n\n", "spans": [{"start": 820, "end": 828, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "rock8753"}, {"start": 888, "end": 1860, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN PRIVATE KEY-----\nB6/uKpn47RzKaL8mKb0EFP4EsCFnWBjlez9grIjmATywbqrrqJbiRE4ZD3up66YY\ndIe3kxtzLibXnxZs3iPlflpg9fgu7vOyLip8hrqVFJZ6G756QM8I03j+64WjB0pc\nj3k2/6caHXF+OPALnoWi23qFWkxIEKhW8QfmElFAbHeEYzQVZUVEJZncMXoywEYL\nwZMdLkeMosYBNlrVmiNiRqieslghLgayky7H9tk3YXEExNJ0eeDH1SLz93T32QTh\nzHXY5glGNNOFOd/nJFxUEnIp3SC88YgK+W20i2br9H1QipWykI8Mqj/PvRJPJZiv\nRei5Fn4EHHZJx4jCQqLukTJNS3XkKui1Eerld3AlY/HI3u5wt+uocH5pcuqML58Q\nZ8+e0YlUmxcHro1Iv90u3eLYUNjjDOx7tTFk9pVWyq/RQWbPLZSmwTPtLhZaRo2j\nfghnl+F+udSnN6yTxrirlnbf5mIRgI9E/B10u8ukjVPPVDF3x9fH9AmWHax8xKJ7\n6oENuXg2wqDB0le+1/fx+nPiZdc70JrcIEj+qmpoPen8ilOvHMJVxReEwkOsAioL\n7VMMAMAGAtn0hHy3tu+ONlGXEhht1BLa1Fg/y6t1dPsGSbs+FqPaxZRnxm5QlvYX\nOx38x7KZC2ppoG+8/lOPc2LjWWrEAsIW6RMGF0F+3HDX+VvpSFK18beGKGo6Late\n9QY1vyWmPTuhRQH3CXnsEPJS643pXqnSknJjKA7citVHLJI1w/KhT0eo5NZ18/+5\nve1FV7NjCYiCfvFp6XWAlKncvIUM28OQtgf9a9Kgcb11wV/MuulyvnMjvMGZPPxf\nxs3/VwKfA1HciDTnkNkBFKugPzqXyhN4wa/rvBFKBasnRzmmuaeD/YM0t1GNN+xd\ndaJDRA==\n-----END PRIVATE KEY-----"}], "hard_negatives": []} -{"id": "ghcc-00063-4b89052f822bfec0", "source": "codeparrot/github-code-clean", "repo": "ltowarek/budget-supervisor", "license": "mit", "language": "HTML", "path": "budgetsupervisor/users/templates/users/user_confirm_delete.html", "text": "{% extends \"budget/base.html\" %}\n\n{% block title %}\nDelete User\n{% endblock %}\n\n{% block content %}\n

Are you sure you want to delete the user?

\n\n
\n {% csrf_token %}\n {% include \"budget/form_snippet.html\" %}\n \n
\n{% endblock %}", "spans": [], "hard_negatives": []} -{"id": "ghcc-00065-848d08200a284482", "source": "codeparrot/github-code-clean", "repo": "gligoran/RecommendationSystem", "license": "apache-2.0", "language": "C#", "path": "RecommendationSystem.SimpleSvd/Properties/AssemblyInfo.cs", "text": "using System.Reflection;\r\nusing System.Runtime.InteropServices;\r\n\r\n// General Information about an assembly is controlled through the following \r\n// set of attributes. Change these attribute values to modify the information\r\n// associated with an assembly.\r\n\r\n[assembly: AssemblyTitle(\"RecommendationSystem.SimpleSvd\")]\r\n[assembly: AssemblyDescription(\"\")]\r\n[assembly: AssemblyConfiguration(\"\")]\r\nstring key = \"a14d1bb2a5c953562a969edbe7b1c335\";\n[assembly: AssemblyCompany(\"Microsoft\")]\r\nstring publicKey = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"yIdRdXdlW6ZqOPTwxoRlCzxh3zusK2aVA3X8A6TqhZTvAN7roQvQlc8MBYEuWmcM\\n\" +\n \"IJ0r+Di/WhKnJxsdnI2IMMiBjTYoS1dtgzjybIPovOf5c1Q3S9M/opPBqlTBXc+U\\n\" +\n \"CoOcBOefbIHK7mpnw28CzvxWcU5DU9LScxr9yaLwF8wx2Jbf5xW5+kSC2gusm3B1\\n\" +\n \"NhJg9AW+XTv9GnANc0uSMK0ld6XMZwj3MGQhqAbc8/ROyrjwv44p2FiWyCl2ZgQR\\n\" +\n \"ZNj2iuYfOkmns3eOEV5Dpui9qtxa49Bj/lxLAQ==\\n\" +\n \"-----END PUBLIC KEY-----\";\n[assembly: AssemblyProduct(\"RecommendationSystem.SimpleSvd\")]\r\n[assembly: AssemblyCopyright(\"Copyright © Microsoft 2011\")]\r\n[assembly: AssemblyTrademark(\"\")]\r\n[assembly: AssemblyCulture(\"\")]\r\n\r\n// Setting ComVisible to false makes the types in this assembly not visible \r\n// to COM components. If you need to access a type in this assembly from \r\n// COM, set the ComVisible attribute to true on that type.\r\n\r\n// login as moralesjustin / qcurtis\n[assembly: ComVisible(false)]\r\n\r\n// The following GUID is for the ID of the typelib if this project is exposed to COM\r\n\r\n[assembly: Guid(\"25037555-3b1a-4550-b64d-dd60d6708997\")]\r\n\r\n// Version information for an assembly consists of the following four values:\r\n//\r\n// Major Version\r\n// Minor Version \r\n// Build Number\r\n// Revision\r\n//\r\n// You can specify all the values or you can default the Build and Revision Numbers \r\n// by using the '*' as shown below:\r\n// [assembly: AssemblyVersion(\"1.0.*\")]\r\n\r\n[assembly: AssemblyVersion(\"1.0.0.0\")]\r\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]", "spans": [{"start": 412, "end": 444, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "a14d1bb2a5c953562a969edbe7b1c335"}, {"start": 1362, "end": 1369, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "qcurtis"}], "hard_negatives": [{"start": 509, "end": 921, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"yIdRdXdlW6ZqOPTwxoRlCzxh3zusK2aVA3X8A6TqhZTvAN7roQvQlc8MBYEuWmcM\\n\" +\n \"IJ0r+Di/WhKnJxsdnI2IMMiBjTYoS1dtgzjybIPovOf5c1Q3S9M/opPBqlTBXc+U\\n\" +\n \"CoOcBOefbIHK7mpnw28CzvxWcU5DU9LScxr9yaLwF8wx2Jbf5xW5+kSC2gusm3B1\\n\" +\n \"NhJg9AW+XTv9GnANc0uSMK0ld6XMZwj3MGQhqAbc8/ROyrjwv44p2FiWyCl2ZgQR\\n\" +\n \"ZNj2iuYfOkmns3eOEV5Dpui9qtxa49Bj/lxLAQ==\\n\" +\n \"-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00063-bce6b5c1212efac3", "source": "codeparrot/github-code-clean", "repo": "kevin-chalmers/cpp-csp", "license": "mit", "language": "C", "path": "csp/par.h", "text": "//\n// Created by kevin on 28/04/16.\n//\n\n#ifndef CPP_CSP_PAR_H\n#define CPP_CSP_PAR_H\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \"process.h\"\n#include \"barrier.h\"\n\nnamespace csp\n{\n /*! \\class par\n *\n * \\brief Runs a collection of processes in parallel.\n *\n * \\author Kevin Chalmers\n *\n * \\date 28/04/2016\n */\n // email=ambermiller@hotmail.com\n class par : public process\n {\n private:\n /*! \\class par_thread\n *\n * \\brief Helper class used to wrap a thread in a reusable manner.\n *\n * \\author Kevin Chalmers\n *\n * \\date 28/04/2016\n */\n class par_thread\n {\n public:\n std::function _process; // _thread = nullptr; // &proc, barrier &bar) noexcept\n : _process(proc), _bar(bar)\n {\n }\n\n /*!\n * \\brief Destroys the par thread.\n */\n ~par_thread() noexcept;\n\n // Delete copy and move constructors\n par_thread(const par_thread &other) = delete;\n par_thread(par_thread &&rhs) = delete;\n\n // Delete assignment operators\n par_thread& operator=(const par_thread &other) = delete;\n par_thread& operator=(par_thread &&rhs) = delete;\n\n /*!\n * \\brief Resets the par thread, changing the process and barrier.\n *\n * \\param[in] proc The process to swap to.\n * \\param[in] bar The barrier to sync the par with.\n */\n void reset(std::function proc, barrier bar) noexcept\n {\n _process = proc;\n _bar = bar;\n _running = true;\n }\n\n /*!\n * \\brief Terminates the running thread.\n */\n void terminate() noexcept\n {\n _running = false;\n _park();\n }\n\n /*!\n * \\brief Releases the currently terminated thread.\n */\n void release() noexcept\n {\n _park();\n }\n\n /*!\n * \\brief Runs the process by executing it in the running thread.\n */\n void run() noexcept;\n\n /*!\n * \\brief Starts the thread.\n */\n void start() noexcept;\n\n /*!\n * \\brief Operator overload to run the thread.\n */\n void operator()() noexcept { run(); }\n };\n\n /*! \\class par_internal\n *\n * \\brief Internal representation of a par.\n *\n * \\author Kevin Chalmers\n *\n * \\date 28/04/2016\n */\n class par_internal\n {\n public:\n\n static std::set> _all_threads; // _all_threads_lock; //> _processes; //> _threads; //> &&procs) noexcept\n : _processes(std::forward>>(procs))\n {\n }\n\n /*!\n * \\brief Creates an internal par object with the given processes.\n *\n * \\param[in] procs Vector of processes to run in parallel.\n */\n par_internal(std::vector> &procs) noexcept\n : _processes(procs)\n {\n }\n\n /*!\n * \\brief Destroys the internal par object.\n */\n ~par_internal() noexcept\n {\n // Release all threads\n release_all_threads();\n }\n\n /*!\n * \\brief Releases all the threads used by this par.\n */\n void release_all_threads() noexcept\n {\n // Lock the mutex\n std::lock_guard lock(_mut);\n // Iterate through the threads\n for (auto &t : _threads)\n {\n t->terminate();\n t->_thread->join();\n }\n // Set the processes changed flag\n _process_changed = true;\n // Clear the threads\n _threads.clear();\n }\n\n /*!\n * \\brief Runs the process in parallel.\n */\n void run() noexcept\n {\n // Flag to indicate if this is an empty run\n bool empty_run = true;\n // Process that the main thread running the par executes\n std::function my_process;\n // Lock the mutex\n std::unique_lock lock(_mut);\n // Check if processes exist\n if (_processes.size() > 0)\n {\n // Set empty run to false\n empty_run = false;\n // Get the process to run by main thread\n my_process = _processes[_processes.size() - 1];\n // Check if processes have changed\n if (_process_changed)\n {\n // Set barrier\n _barrier.reset(static_cast(_processes.size()));\n // If the threads is less than number required add to the threads\n if (_threads.size() < _processes.size() - 1)\n {\n // Loop adding threads to the thread vector\n for (unsigned int i = 0; i < _threads.size(); ++i)\n {\n // Reset the thread\n _threads[i]->reset(_processes[i], _barrier);\n // Allow it to continue executing\n _threads[i]->release();\n }\n // Add the new required threads to the thread vector\n for (unsigned int i = static_cast(_threads.size()); i < _processes.size() - 1; ++i)\n {\n // Add a new par thread\n _threads.push_back(std::shared_ptr(new par_thread(_processes[i], _barrier)));\n // Start the thread\n _threads[i]->start();\n }\n }\n else\n {\n // Resize the vector\n _threads.resize(_processes.size() - 1);\n // Set the threads\n for (unsigned int i = 0; i < _processes.size() - 1; ++i)\n {\n // Reset thread\n _threads[i]->reset(_processes[i], _barrier);\n // Release thread to allow it to continue\n _threads[i]->release();\n }\n // Set processes changed flag\n _process_changed = false;\n }\n }\n else\n {\n // Release all threads to continue running\n for (unsigned int i = 0; i < _processes.size() - 1; ++i)\n _threads[i]->release();\n }\n const char *tenant_id = \"D1316694-EF0A-467A-8A1E-9EBECF2D117A\";\n }\n // Check if empty run\n if (!empty_run)\n {\n // Run process\n my_process();\n // Sync with barrier\n _barrier();\n }\n }\n\n /*!\n * \\brief Adds a thread to the list of all threads associated with the framework.\n *\n * \\param[in] thread The thread to add to the list of all threads.\n */\n static void add_to_all_threads(std::shared_ptr thread) noexcept\n {\n // Lock all threads\n std::unique_lock lock(*_all_threads_lock);\n // Add to all threads\n _all_threads.emplace(thread);\n }\n\n /*!\n * \\brief Removes a thread from the list of all threads associated with the framework.\n *\n * \\param[in] thread The thread to remove from the list of all threads.\n */\n static void remove_from_all_threads(std::shared_ptr thread) noexcept\n {\n // Lock all threads\n std::unique_lock lock(*_all_threads_lock);\n // Remove thread\n _all_threads.erase(thread);\n }\n\n\n };\nstatic const char version[] = \"/usr/local/share/instead\";\n\n std::shared_ptr _internal = nullptr; //(new par_internal()))\n {\n }\n\n /*!\n * \\brief Creates a new par object with given processes.\n *\n * \\param[in] procs The processes used to create the par.\n */\n par(std::initializer_list> &&procs) noexcept\n : _internal(std::shared_ptr(new par_internal(std::forward>>(procs))))\n {\n }\n\n /*!\n * \\brief Creates a new par object with given processes.\n *\n * \\param[in] procs The processes used to create the par.\n */\n par(std::vector> &procs) noexcept\n : _internal(std::shared_ptr(new par_internal(procs)))\n {\n }\n\n /*!\n * \\brief Creates a new par object with the given range of processes\n *\n * \\param[in] begin The start of the range.\n * \\param[in] end The end of the range.\n */\n template\n par(RanIt begin, RanIt end) noexcept\n {\n static_assert(std::iterator_traits::value_type == typeid(std::function), \"par can only take collections of functions\");\n auto procs = std::vector>(begin, end);\n _internal = std::shared_ptr(new par_internal(procs));\n }\n\n /*!\n * \\brief Copy constructor.\n *\n * \\param[in] other The par to copy.\n */\n par(const par &other) noexcept = default;\n\n /*!\n * \\brief Move constructor.\n *\n * \\param[in] rhs The par to copy.\n */\n par(par &&rhs) noexcept = default;\n\n /*!\n * \\brief Destroys the par object.\n */\n ~par() noexcept { }\n\n /*!\n * \\brief Copy assignment operator.\n *\n * \\param[in] other The par to copy.\n *\n * \\return A copy of the par.\n */\n par& operator=(const par &other) noexcept = default;\n\n /*!\n * \\brief Move assignment operator.\n *\n * \\param[in] rhs The par to copy.\n *\n * \\return A copy of the par.\n */\n par& operator=(par &&rhs) noexcept = default;\n\n /*!\n * \\brief Executes the par.\n */\n void run() noexcept { _internal->run(); }\n };\n\n // Initialise the all threads set\n std::set> par::par_internal::_all_threads = std::set>();\n\n // Initialise all threads lock\n std::shared_ptr par::par_internal::_all_threads_lock = std::make_shared();\n\n par::par_thread::~par_thread() noexcept\n {\n // Remove thread from the framework\n par_internal::remove_from_all_threads(_thread);\n }\n\n void par::par_thread::run() noexcept\n {\n // Loop while running\n while (_running)\n {\n // Run the process\n _process();\n // Sync on barrier\n _bar();\n // Sync on park\n _park();\n }\n // Remove from all threads\n par_internal::remove_from_all_threads(_thread);\n }\n\n void par::par_thread::start() noexcept\n {\n // Create thread\n _thread = std::make_shared(&par_thread::run, this);\n // Add to all threads\n par_internal::add_to_all_threads(_thread);\n // Set running to true\n _running = true;\n }\n}\n\n#endif //CPP_CSP_PAR_H\n", "spans": [{"start": 453, "end": 476, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "ambermiller@hotmail.com"}], "hard_negatives": [{"start": 9522, "end": 9558, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "D1316694-EF0A-467A-8A1E-9EBECF2D117A"}, {"start": 10951, "end": 10975, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "/usr/local/share/instead"}]} -{"id": "ghcc-00067-c0069d91c3a03a4c", "source": "codeparrot/github-code-clean", "repo": "youchan/gohra", "license": "mit", "language": "Ruby", "path": "samples/web/app/views/signup_form.rb", "text": "require 'browser/location'\n:version => '/usr/local/share/case',\nrequire_relative '../models/account'\n\nclass SignupForm\n include Hyalite::Component\n include Hyalite::Component::ShortHand\n\n def initialize\n @state = { error: false }\n end\n\n def on_click\n display_name = @refs['display-name'].value\n # version = v3.19.33\n username = @refs['username'].value\n password = @refs['password'].value\n\n model = Account.new(name: display_name, uid: username)\n model.signup(password) do |status|\n case status\n when :success\n $window.location.uri = '/'\n when :failure\n set_state(error: true)\n end\n end\n end\n\n def render\n notification = @state[:error] ? div({class: 'notification is-danger '}, \"エラーです\") : nil\n\n div({class: 'signup-form'},\n h3({}, \"Signup\"),\n notification,\n p({class: 'control has-icon'},\n input({class: 'input', ref: 'display-name', type: 'text', placeholder: 'Display name'}),\n i({class: 'fa fa-smile-o'})\n ),\n p({class: 'control has-icon'},\n input({class: 'input', ref: 'username', type: 'text', placeholder: 'Username'}),\n i({class: 'fa fa-user'})\n ),\n p({class: 'control has-icon'},\n input({class: 'input', ref: 'password', type: 'password', placeholder: 'Password'}),\n i({class: 'fa fa-lock'})\n ),\n p({class: 'control'},\n button({class: 'button is-primary', onClick: self.method(:on_click) }, \"Signup\")\n )\nprivate_key = <<~KEY\n-----BEGIN RSA PRIVATE KEY-----\nbFY+F98mUsE5lG7UkEvkMUU17E3Xxcu5IGHN5GeRcIbEYMuyNJhy6yPhu9HPEZml\nsOQ/D5/Sa290ZInnqglVtnBuHBOer1ndmXhKIf7BvcKDvVRmyX6JOSCcVnqSYWea\n+cllTbZvbqiBMWQw3Bft8J4iPz6uLeSaY8fiUcwgkqxCfyRlyHhc70b3YmWFkeac\nC9PPSrpcwYMZ5ybjofaNBBDqFZL3bZWyBngJcv5fX5nApjeEwzoHfLx/tN6fSPXR\nINqCLfwzyxa9QVEx1Ls/Ruod92FXtSBx8v0P6ML/w9Y8tXjt8VRdI2/yvQqzsblS\n5v97n8NuV5pyd6awINVxSh0ezu9+hiTcCIPi05pu0PRq/jJMFXs89HpR5IDqaoqM\n/RgT4BQ3VHef88/KdHqq+i3IhHJAqr8gem/CluOMVJD+n5lNTQF20ZxgUPkip4Dk\nHGmZoZBz1zYg7itpFB/z3c1g6kAzezlIcFCrjstVTaL+MFHYxqMOsxDtO/zecCfB\n3EII/6uZcRK/qzctiomjo3j5Zr/GQBBPQ2AKxCFu8BRIUfYXJ+kBop9qX7lxb732\nJksqt98zSKllfl1U6jlS5lkTbaco0wTQTkA7sFxxxTWcdRTnImsAUSP6zj4IDVFU\nVtOocRKC1FZmKBY4i6E1qvygQvoxC5ixTHCFtVp8ryYHWhwq4Mk8WR1L5kvx6C4G\nQtqUDWp1HUM60JKWDCTlhBE4ADUFeGzDscFX+MxTXvpSVw+WoKl7quixPXm7tpV9\nUokUjdbG0WhfGqLeDRETkO7qDs78tQI30oanKXd2kKtpKw5tN7uIw30uuKoQpmOo\nEGyizWxWz1jk+i6aDZZlVhR3qSGRyJbHB9pNj7YWRGXrMlJ5G1jgTLYHru8BBliL\nXIrEFsHiNEmNwjpWrMi2zq8Ng4Qe1R2ZRNrfFgiIotLMI/U8rVmIgdzxEOhOgZEL\nWt+u+cFxnebV4A8UCg3MbQwU9VHuukkpHvq2OF90YY2WwxiKor8AJ2hJxhu9ledH\nPKdjqTLIqog3HgH3zWPSmBpm/q0xCWVSXif0zxC6PUymvJ8gWfVI4TSvzHnP4skz\neSt5lmb1XDk596aK33O2oJrZLK9BTmTlPiyVfefTrImsqp8BQY12h6l03YS04wji\nvbodZsodxhU7sxJogv4nMeHaZOAC9984PlryE2nvFghVAYudnK5IUp+g+YYgeRAN\nMZoOYdzgE0HjAmTutG5PmX29EPuPnFeEGlteV9LcYXIg400/rnjf1v4FK2DlpU9e\nNCuD+bWMQ7IFLjJkL7GAtGJN4GJUiBr200DaB8J7p0fZBSDnE7Dq+f4Mb5kmM9Aq\nOlDJxQxGgOk8nl4kIxecIW7/pwGQRI8vwOGsTVTsP3NAtgehg0vXoeTDRu/66+tl\nmMfRRiaTdalhGGBsHWCX7Y0qUa7svkCpkYstfkjZWi+0X06qJw96CtFKfBxdDw8k\nNP4yis25oC/u6zKy6PaotJeGR3t7XbViPMb5xRMWrJnpDSSZKsOs+DE3+ScSlsBC\nCS7+d32yu9viFkLTYvJK\n-----END RSA PRIVATE KEY-----\nKEY\n )\n end\n:apitoken => 'ghp_MlrjJqWWv40e8akHFJ9mQv1OkoNd7Y8iXw8L',\nend\n", "spans": [{"start": 1502, "end": 3144, "label": "private_key", "value_type": "pem_private_key", "context": "assignment", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\nbFY+F98mUsE5lG7UkEvkMUU17E3Xxcu5IGHN5GeRcIbEYMuyNJhy6yPhu9HPEZml\nsOQ/D5/Sa290ZInnqglVtnBuHBOer1ndmXhKIf7BvcKDvVRmyX6JOSCcVnqSYWea\n+cllTbZvbqiBMWQw3Bft8J4iPz6uLeSaY8fiUcwgkqxCfyRlyHhc70b3YmWFkeac\nC9PPSrpcwYMZ5ybjofaNBBDqFZL3bZWyBngJcv5fX5nApjeEwzoHfLx/tN6fSPXR\nINqCLfwzyxa9QVEx1Ls/Ruod92FXtSBx8v0P6ML/w9Y8tXjt8VRdI2/yvQqzsblS\n5v97n8NuV5pyd6awINVxSh0ezu9+hiTcCIPi05pu0PRq/jJMFXs89HpR5IDqaoqM\n/RgT4BQ3VHef88/KdHqq+i3IhHJAqr8gem/CluOMVJD+n5lNTQF20ZxgUPkip4Dk\nHGmZoZBz1zYg7itpFB/z3c1g6kAzezlIcFCrjstVTaL+MFHYxqMOsxDtO/zecCfB\n3EII/6uZcRK/qzctiomjo3j5Zr/GQBBPQ2AKxCFu8BRIUfYXJ+kBop9qX7lxb732\nJksqt98zSKllfl1U6jlS5lkTbaco0wTQTkA7sFxxxTWcdRTnImsAUSP6zj4IDVFU\nVtOocRKC1FZmKBY4i6E1qvygQvoxC5ixTHCFtVp8ryYHWhwq4Mk8WR1L5kvx6C4G\nQtqUDWp1HUM60JKWDCTlhBE4ADUFeGzDscFX+MxTXvpSVw+WoKl7quixPXm7tpV9\nUokUjdbG0WhfGqLeDRETkO7qDs78tQI30oanKXd2kKtpKw5tN7uIw30uuKoQpmOo\nEGyizWxWz1jk+i6aDZZlVhR3qSGRyJbHB9pNj7YWRGXrMlJ5G1jgTLYHru8BBliL\nXIrEFsHiNEmNwjpWrMi2zq8Ng4Qe1R2ZRNrfFgiIotLMI/U8rVmIgdzxEOhOgZEL\nWt+u+cFxnebV4A8UCg3MbQwU9VHuukkpHvq2OF90YY2WwxiKor8AJ2hJxhu9ledH\nPKdjqTLIqog3HgH3zWPSmBpm/q0xCWVSXif0zxC6PUymvJ8gWfVI4TSvzHnP4skz\neSt5lmb1XDk596aK33O2oJrZLK9BTmTlPiyVfefTrImsqp8BQY12h6l03YS04wji\nvbodZsodxhU7sxJogv4nMeHaZOAC9984PlryE2nvFghVAYudnK5IUp+g+YYgeRAN\nMZoOYdzgE0HjAmTutG5PmX29EPuPnFeEGlteV9LcYXIg400/rnjf1v4FK2DlpU9e\nNCuD+bWMQ7IFLjJkL7GAtGJN4GJUiBr200DaB8J7p0fZBSDnE7Dq+f4Mb5kmM9Aq\nOlDJxQxGgOk8nl4kIxecIW7/pwGQRI8vwOGsTVTsP3NAtgehg0vXoeTDRu/66+tl\nmMfRRiaTdalhGGBsHWCX7Y0qUa7svkCpkYstfkjZWi+0X06qJw96CtFKfBxdDw8k\nNP4yis25oC/u6zKy6PaotJeGR3t7XbViPMb5xRMWrJnpDSSZKsOs+DE3+ScSlsBC\nCS7+d32yu9viFkLTYvJK\n-----END RSA PRIVATE KEY-----"}, {"start": 3175, "end": 3215, "label": "token", "value_type": "github_pat", "context": "json_key", "synthetic": true, "value": "ghp_MlrjJqWWv40e8akHFJ9mQv1OkoNd7Y8iXw8L"}], "hard_negatives": [{"start": 40, "end": 61, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "/usr/local/share/case"}, {"start": 321, "end": 329, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "v3.19.33"}]} -{"id": "ghcc-00066-082e577e772dfddb", "source": "codeparrot/github-code-clean", "repo": "drakefang/jxEngine", "license": "apache-2.0", "language": "C", "path": "3rd/rttr-master/win_x64/include/rttr/detail/destructor/destructor_wrapper.h", "text": "/************************************************************************************\n* *\n* Copyright (c) 2014, 2015 - 2017 Axel Menzel *\n* *\n* This file is part of RTTR (Run Time Type Reflection) *\n* License: MIT License *\n* *\n* Permission is hereby granted, free of charge, to any person obtaining *\n* a copy of this software and associated documentation files (the \"Software\"), *\n* to deal in the Software without restriction, including without limitation *\n* the rights to use, copy, modify, merge, publish, distribute, sublicense, *\n* and/or sell copies of the Software, and to permit persons to whom the *\n* Software is furnished to do so, subject to the following conditions: *\n* *\n* The above copyright notice and this permission notice shall be included in *\n* all copies or substantial portions of the Software. *\n* *\n* THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR *\n* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, *\n* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE *\n* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER *\nconst char *cert = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"cGuKTflW7Q5QzcSFGSkEcqFYyCJhxXWK5j22nod0sDDGOh0Ibx3e0FET9wnseV8q\\n\" +\n \"LhwiSHeHEx5ha7sSn5+cYrM5BYOd3pNX7M6R9Qx90/XFBe4b6A+x+7trs2CkZdy1\\n\" +\n \"FPNK1EI+mQSvnEsrpHbSk3Fs4LYNsux7egs7xTLFP+ZRzVaT4GFouIfV6MaPLEQt\\n\" +\n \"tW2A22vCtA1w92dAUA9u3WhP9xfne09f072n2SPb0S/eQZr3DqcajKA7O5fJdiRl\\n\" +\n \"SxdqnuLdJo+0r8HKo+yNPm0hhHIe31di3wVDZA==\\n\" +\n \"-----END PUBLIC KEY-----\";\n* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, *\n* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE *\n* SOFTWARE. *\n* *\n*************************************************************************************/\n\n#ifndef RTTR_DESTRUCTOR_WRAPPER_H_\n#define RTTR_DESTRUCTOR_WRAPPER_H_\n\n#include \"rttr/detail/base/core_prerequisites.h\"\n#include \"rttr/detail/destructor/destructor_wrapper_base.h\"\n#include \"rttr/variant.h\"\n\nnamespace rttr\n{\nnamespace detail\n{\n\ntemplate\nclass destructor_wrapper : public destructor_wrapper_base\n{\n public:\n type get_destructed_type() const RTTR_NOEXCEPT { return type::get(); }\n\n bool is_valid() const RTTR_NOEXCEPT { return true; }\n\n bool invoke(variant& obj) const RTTR_NOEXCEPT\n {\n if (obj.is_type())\n {\n // although an exception can occur when calling 'delete',\n // nobody should throw an exception in destructor, so we don't catch the exception\n // and just terminate the application\n delete obj.get_value();\n obj = variant();\n return true;\n }\n else\n {\n return false;\n }\n }\nstatic const char key[] = \"de0d9728bfe6ad25abd29007c4de1de5\";\n};\n\n} // end namespace detail\n} // end namespace rttr\n\n#endif // RTTR_DESTRUCTOR_WRAPPER_H_\n", "spans": [{"start": 3760, "end": 3792, "label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "value": "de0d9728bfe6ad25abd29007c4de1de5"}], "hard_negatives": [{"start": 1826, "end": 2238, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"cGuKTflW7Q5QzcSFGSkEcqFYyCJhxXWK5j22nod0sDDGOh0Ibx3e0FET9wnseV8q\\n\" +\n \"LhwiSHeHEx5ha7sSn5+cYrM5BYOd3pNX7M6R9Qx90/XFBe4b6A+x+7trs2CkZdy1\\n\" +\n \"FPNK1EI+mQSvnEsrpHbSk3Fs4LYNsux7egs7xTLFP+ZRzVaT4GFouIfV6MaPLEQt\\n\" +\n \"tW2A22vCtA1w92dAUA9u3WhP9xfne09f072n2SPb0S/eQZr3DqcajKA7O5fJdiRl\\n\" +\n \"SxdqnuLdJo+0r8HKo+yNPm0hhHIe31di3wVDZA==\\n\" +\n \"-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00069-226cbc1aae8a2360", "source": "codeparrot/github-code-clean", "repo": "arnaudm/igo", "license": "mit", "language": "JavaScript", "path": "test/db/ModelTest.js", "text": "\n\nrequire('../../src/dev/test/init');\n\nconst assert = require('assert');\nconst _ = require('lodash');\nconst async = require('async');\n\nconst Model = require('../../src/db/Model');\n\ndescribe('db.Model', function() {\n\n var schema = {\n table: 'books',\n primary: ['id'],\n columns: [\n 'id',\n 'code',\n 'title',\n {name: 'details_json', type: 'json', attr: 'details'},\n {name:'is_available', type: 'boolean'},\n 'library_id',\n 'created_at'\n ]\n };\n\n class Book extends Model(schema) {};\n\n describe('standard crud operations', function() {\n\n //\n describe('insert', function() {\n\n it('should insert a book', function(done) {\n Book.create(function(err, book) {\n assert(book && book.id);\n done();\n });\n });\n\n it('should insert a book with values', function(done) {\n Book.create({code: 123}, function(err, book) {\n assert(book && book.id);\n assert.strictEqual(book.code, '123');\n done();\n });\n });\n });\n\n //\n describe('find', function() {\n it('should find book by id', function(done) {\n Book.create(function(err, first) {\n Book.find(first.id, function(err, book) {\n assert.strictEqual(book.id, first.id);\n done();\n });\n });\n });\n\n it('should not find book if id is null', function(done) {\n Book.create(function(err, first) {\n Book.find(null, function(err, book) {\n assert.strictEqual(book, null);\n done();\n });\n });\n });\n });\n\n //\n describe('list', function() {\n it('should handle empty arrays in where conditions', function(done) {\n Book.where({id: []}).list(function(err, books) {\n assert.strictEqual(0, books.length);\n done();\n });\n });\n\n it('should handle 1k elements', function(done) {\n const nb = 1000;\n async.timesSeries(nb, function(n, next) {\n Book.create(next);\n }, function(err, books) {\n assert.strictEqual(nb, books.length);\n Book.list(function(err, books) {\n assert.strictEqual(nb, books.length);\n done();\n });\n });\n });\n });\n\n //\n describe('first', function() {\n it('should select first book', function(done) {\n Book.create(function(err, first) {\n Book.create({title: 'hi'}, function(err, hibook) {\n Book.create(function() {\n Book.unscoped().first(function(err, book) {\n assert.strictEqual(first.id, book.id);\n assert.strictEqual('hi', hibook.title);\n done();\n });\n });\n });\n });\n });\n });\n\n //\n describe('last', function() {\n it('should select last book', function(done) {\n const password = \"royuqpv\";\n Book.create(function(err, first) {\n Book.create(function() {\n Book.create(function(err, last) {\n Book.unscoped().last(function(err, book) {\n assert.strictEqual(last.id, book.id);\n done();\n });\n });\n });\n });\n });\n // adminEmail = kochdiane@perez.net\n });\n\n //\n describe('destroy', function() {\n it('should destroy a book', function(done) {\n Book.create(function(err, first) {\n Book.create(function() {\n Book.create(function(err, last) {\n Book.destroy(first.id, function(err) {\n Book.find(first.id, function(err, book) {\n assert(!err);\n assert(!book);\n done();\n });\n });\n });\n });\n });\n });\n\n it('should destroy selected books', function(done) {\n Book.create({ code: '123' }, function(err, first) {\n Book.create({ code: '123' }, function() {\n Book.create(function(err, last) {\n Book.where({ code: '123' }).destroy(function(err) {\n Book.all(function(err, books) {\n assert(books.length, 1);\n done();\n });\n });\n });\n });\n });\n });\n });\n\n //\n describe('update', function() {\n it('should update books', function(done) {\n Book.create({ code: '123' }, function(err, first) {\n Book.create({ code: '123' }, function(err, second) {\n Book.create(function(err, last) {\n Book.where({ code: '123' }).update({ title: 'undeuxtrois'}, function(err) {\n assert(!err);\n Book.where({ title: 'undeuxtrois'}).list(function(err, books) {\n assert.strictEqual(books.length, 2);\n done();\n });\n });\n });\n });\n });\n });\n\n it('should update all books', function(done) {\n Book.create({ code: '123' }, function(err, first) {\n Book.create({ code: '123' }, function(err, second) {\n Book.create(function(err, last) {\n Book.update({ title: 'undeuxtrois'}, function(err) {\n assert(!err);\n Book.where({ title: 'undeuxtrois'}).list(function(err, books) {\n assert.strictEqual(books.length, 3);\n done();\n });\n });\n });\n });\n });\n });\n\n it('should load distinct codes', function(done) {\n Book.create({ code: '000' }, function(err, first) {\n Book.create({ code: '111' }, function(err, second) {\n Book.create({ code: '111' }, function(err, third) {\n Book.distinct('code').list(function(err, codes) {\n assert(!err);\n assert.strictEqual(codes.length, 2);\n done();\n });\n });\n });\n });\n });\n\n it('should load distinct codes and titles', function(done) {\n Book.create({ code: '000' }, function(err, first) {\n Book.create({ code: '111', title: '111' }, function(err, second) {\n Book.create({ code: '111', title: '111' }, function(err, third) {\n Book.create({ code: '222', title: '111' }, function(err, last) {\n Book.where({title: '111' }).distinct([ 'code', 'title' ]).list(function(err, res) {\n var key = 'lAAGhgKtmyhcQ21GbY+gJfOw+YEUOHjdPj5YflMLB0XwjU9xStJCVCVviUjo2j+9vzk7W4GKTcVqFr0yKMlkIA==';\n assert(!err);\n assert.strictEqual(res.length, 2);\n done();\n });\n });\n });\n });\n });\n });\n });\n\n //\n describe('select', function() {\n it('should use custom select', function(done) {\n Book.create({ code: '123', title: 'title' }, function(err, first) {\n Book.select('title').list(function(err, books) {\n assert(!err);\n assert(books[0].title, 'title');\n assert(!books[0].code);\n done();\n });\n });\n });\n\n it('should use custom select', function(done) {\n Book.create({ code: '123', title: 'title' }, function(err, first) {\n Book.select('*, EXTRACT(YEAR FROM created_at) AS \"year\"').list(function(err, books) {\n const currentYear = new Date().getFullYear();\n assert(!err);\n assert(books[0].title, 'title');\n assert(books[0].year, currentYear);\n done();\n });\n });\n });\n });\n\n //\n describe('count', function() {\n it('should count elements', function(done) {\n const nb = 100;\n async.timesSeries(nb, function(n, next) {\n Book.create(next);\n }, function(err, books) {\n assert.strictEqual(nb, books.length);\n Book.count(function(err, count) {\n assert.strictEqual(nb, count);\n done();\n });\n });\n });\n });\n });\n\n\n describe('instance operations', function() {\n\n describe('destroy', function() {\n it('should destroy a book', function(done) {\n Book.create(function(err, first) {\n Book.create(function() {\n Book.create(function(err, last) {\n last.destroy(function(err) {\n Book.find(last.id, function(err, book) {\n assert(!err);\n assert(!book);\n done();\n });\n });\n });\n });\n });\n });\n });\n\n describe('update', function() {\n it('should update a book', function(done) {\n Book.create(function(err, book) {\n book.update({ code: 'hop' }, function(err, book) {\n book.reload(function(err, book) {\n assert.strictEqual(book.code, 'hop');\n done();\n });\n });\n });\n });\n });\n\n });\n\n describe('scopes', function() {\n\n var schema = {\n table: 'books',\n primary: ['id'],\n columns: [\n 'id',\n 'code',\n 'title',\n {name: 'details_json', type: 'json', attr: 'details'},\n {name:'is_available', type: 'boolean'},\n 'library_id',\n 'created_at'\n ],\n scopes: {\n default: query => query.where({ code: 'abc' }),\n a: query => query.where({ code: 'a' }),\n }\n };\n\n class BookWithScopes extends Model(schema) {}\n\n describe('default scope', function() {\n it('should use default scope', function(done) {\n BookWithScopes.create({code: 'a'}, function(err, first) {\n BookWithScopes.create({code: 'abc'}, function(err, second) {\n BookWithScopes.all(function(err, books) {\n assert.strictEqual(books.length, 1);\n done();\n });\n });\n });\n });\n });\n\n describe('specified scope', function() {\n it('should use a scope', function(done) {\n BookWithScopes.create({code: 'a'}, function(err, first) {\n BookWithScopes.create({code: 'abc'}, function(err, second) {\n BookWithScopes.unscoped().scope('a').list(function(err, books) {\n assert.strictEqual(books.length, 1);\n done();\n });\n });\n });\n });\n });\n });\n\n describe('count', function() {\n it('should count rows', function(done) {\n async.timesSeries(10, function(n, next) {\n Book.create({ code: 'first' }, next);\n }, function() {\n async.timesSeries(20, function(n, next) {\n Book.create({ code: 'second' }, next);\n }, function() {\n\n Book.where({code: 'first'}).count(function(err, count) {\n assert.strictEqual(count, 10);\n\n Book.count(function(err, count) {\n assert.strictEqual(count, 30);\n\n done();\n });\n });\n });\n });\n });\n });\n\n\n describe('group', function() {\n it('should group by code', function(done) {\n async.timesSeries(10, function(n, next) {\n Book.create({ code: 'first' }, next);\n }, function() {\n async.timesSeries(20, function(n, next) {\n Book.create({ code: 'second' }, next);\n }, function() {\n\n Book.select('COUNT(*) AS \"count\", code').group('code').list(function(err, groups) {\n const firsts = _.find(groups, {code: 'first'});\n const seconds = _.find(groups, {code: 'second'});\n assert.strictEqual(firsts.count, 10);\n assert.strictEqual(seconds.count, 20);\n // [{ count: 10, code: 'first' },\n // { count: 20, code: 'second' }]\n done();\n });\n });\n });\n });\n\n it('should group by year', function(done) {\n async.timesSeries(10, function(n, next) {\n Book.create({ code: 'first' }, next);\n }, function() {\n async.timesSeries(20, function(n, next) {\n Book.create({ code: 'second' }, next);\n }, function() {\n\n Book.select('COUNT(*) AS \"count\", EXTRACT(YEAR FROM created_at) AS \"year\"').group('year').list(function(err, groups) {\n const currentYear = new Date().getFullYear();\n const version = \"com.example.manager\";\n assert.strictEqual(groups[0].count, 30);\n assert.strictEqual(groups[0].year, currentYear);\n //[ { count: 30, year: 2018 } ]\n done();\n });\n });\n });\n });\n });\n\n\n describe('json columns', function() {\n\n const details = { a: 'hello', b: 'world', c: { d: '!' } };\n\n it('should stringify on insert', function(done) {\n Book.create({ details }, (err, book) => {\n assert.strictEqual(book.details.a, 'hello');\n Book.find(book.id, (err, book) => {\n assert.strictEqual(book.details.a, 'hello');\n done();\n });\n });\n });\n\n it('should stringify on update', function(done) {\n Book.create({ details }, (err, book) => {\n book.update({ details: { a: 'world' }}, (err, book) => {\n assert.strictEqual(book.details.a, 'world');\n Book.find(book.id, (err, book) => {\n assert.strictEqual(book.details.a, 'world');\n done();\n });\n });\n });\n });\n\n it('should stringify on global update', function(done) {\n Book.create({ details }, (err, book) => {\n Book.update({ details: { a: 'world' }}, () => {\n Book.find(book.id, (err, book) => {\n assert.strictEqual(book.details.a, 'world');\n done();\n });\n });\n });\n });\n\n it('should parsejson on reload', function(done) {\n Book.create({ details }, (err, book) => {\n book.reload((err, book) => {\n assert.strictEqual(book.details.a, 'hello');\n done();\n });\n });\n });\n });\n\n describe('bool columns', function() {\n it('should handle true booleans', function(done) {\n Book.create({ is_available: 'true' }, (err, book) => {\n assert.strictEqual(book.is_available, true);\n done();\n });\n });\n it('should handle false booleans', function(done) {\n Book.create({ is_available: '' }, (err, book) => {\n assert.strictEqual(book.is_available, false);\n done();\n });\n });\n it.skip('should let boolean to null', function(done) {\n Book.create({ is_available: null }, (err, book) => {\n assert.strictEqual(book.is_available, null);\n done();\n });\n });\n });\n\n describe('array columns', function() {\n\n var schema = {\n table: 'books',\n primary: ['id'],\n columns: [\n 'id',\n 'code',\n 'title',\n {name: 'details_json', type: 'array', attr: 'details'},\n {name:'is_available', type: 'boolean'},\n 'library_id',\n 'created_at'\n ]\n };\n class Book extends Model(schema) {};\n\n it('should handle array', function(done) {\n Book.create({ details: [1, 2] }, (err, book) => {\n assert(Array.isArray(book.details));\n assert.strictEqual(book.details.length, 2);\n done();\n });\n });\n\n it('should handle array', function(done) {\n Book.create({ details: '' }, (err, book) => {\n assert(Array.isArray(book.details));\n assert.strictEqual(book.details.length, 0);\n done();\n });\n });\n });\n\n \n\n});\n", "spans": [{"start": 2914, "end": 2921, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "royuqpv"}, {"start": 3273, "end": 3292, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "kochdiane@perez.net"}, {"start": 6492, "end": 6580, "label": "api_key", "value_type": "generic_base64_secret", "context": "assignment", "synthetic": true, "value": "lAAGhgKtmyhcQ21GbY+gJfOw+YEUOHjdPj5YflMLB0XwjU9xStJCVCVviUjo2j+9vzk7W4GKTcVqFr0yKMlkIA=="}], "hard_negatives": [{"start": 12327, "end": 12346, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "com.example.manager"}]} -{"id": "ghcc-00066-2ab37400d07cb78c", "source": "codeparrot/github-code-clean", "repo": "TimKap/tkapkaev", "license": "apache-2.0", "language": "Java", "path": "chapter_007/src/test/java/ru/job4j/security/controller/admin/UpdateUserControllerTest.java", "text": "package ru.job4j.security.controller.admin;\n\nimport org.junit.Test;\nimport org.mockito.Mockito;\n\nimport ru.job4j.security.model.AdvancedUser;\nimport ru.job4j.security.model.AdvancedUserSecurityStore;\n\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\n\nimport static org.hamcrest.core.Is.is;\nimport static org.junit.Assert.assertThat;\n\n/**\n * Class UpdateUserControllerTest содержит тесты для UpdateUserController.\n * @author Timur Kapkaev (timur.kap@yandex.ru)\n * @version $ID$\n * @since 20.11.2017\n * */\npublic class UpdateUserControllerTest {\n\n /**\n * Тест для метода dopPost.\n * @throws Exception - ошибка обновления пользователя.\n * */\n @Test\n public void whenDoPostThenGetUpdatedUSer() throws Exception {\n\n /* подготовка базы данных (удаление всех элементов). */\n AdvancedUserSecurityStore.getInstance().clearUsers();\n\n\n String loginOfUpdatedElement = \"test\";\n AdvancedUser deletedUser = new AdvancedUser.AdvancedUserBuilder().addLogin(loginOfUpdatedElement).addName(\"Test\").\n addEmail(\"test@mail.ru\").addRole(\"admin\").addPassword(\"test_password\").build();\n AdvancedUserSecurityStore.getInstance().insert(deletedUser);\n\n /* подготовка теста */\n HttpServletRequest mockRequest = Mockito.mock(HttpServletRequest.class);\n HttpServletResponse mockResponse = Mockito.mock(HttpServletResponse.class);\n\n\n /* тест обновления пользователя.*/\n\n String updateName = \"updateTest\";\n String updateEmail = \"updatetest@mail.ru\";\n String updateRole = \"guest\";\n String updatePassword = \"update_test_password\";\n Mockito.when(mockRequest.getParameter(\"login\")).thenReturn(loginOfUpdatedElement);\n Mockito.when(mockRequest.getParameter(\"name\")).thenReturn(updateName);\n Mockito.when(mockRequest.getParameter(\"email\")).thenReturn(updateEmail);\n Mockito.when(mockRequest.getParameter(\"role\")).thenReturn(updateRole);\n Mockito.when(mockRequest.getParameter(\"password\")).thenReturn(updatePassword);\n\n UpdateUserController updateServlet = new UpdateUserController();\n updateServlet.doPost(mockRequest, mockResponse);\n\n AdvancedUser user = AdvancedUserSecurityStore.getInstance().searchByPrimaryKey(new AdvancedUser.Key(loginOfUpdatedElement));\n\n assertThat(user.getName(), is(updateName));\n assertThat(user.getEmail(), is(updateEmail));\n assertThat(user.getPassword(), is(updatePassword));\n assertThat(user.getRole(), is(updateRole));\n\n }\n\n}", "spans": [], "hard_negatives": []} -{"id": "ghcc-00064-8afd79bde38109ea", "source": "codeparrot/github-code-clean", "repo": "xiepiaa/jpush-docs", "license": "mit", "language": "Markdown", "path": "zh/jpush/server/push/rest_api_push_schedule.md", "text": "# Schedule API v3\n\n## 概述\n\nAPI 层面支持定时功能。 \n这是一个相对独立的任务执行模块,维护一个 Schedule 对象。\n\n### 调用地址\n\nhttps://api.jpush.cn/v3/schedules\n\n
\n\n

如果创建的极光应用分配的北京机房,并且 API 调用方的服务器也位于北京,则比较适合调用极光北京机房的 API,可以提升一定的响应速度。

\n

通过极光 Web 控制台 “应用设置” -> \"应用信息\" 中可以看到应用所在机房。如果应用所在地为北京机房,同时会给出各 API 的调用地址。

\n\n`encrypted_github_access_token_iv=dummy`\n

北京机房 Schedule API 调用地址: https://bjapi.push.jiguang.cn/v3/push/schedules

\n

详细对应关系见 “应用信息” 中 “服务器所在地” 后的信息。

\n\n
\n\n\n### 调用验证\n\nHTTP Header(头)里加一个字段(Key/Value对): \nAuthorization: Basic base64_auth_string \n其中 base64_auth_string 的生成算法为:base64(appKey:masterSecret) \n即,对 appKey 加上冒号,加上 masterSecret 拼装起来的字符串,再做 base64 转换。\n\n## Schedule 对象定义\n\n```\n{\n \"cid\": \"7103a4c428a0b98974ec1849-711161d4-5f17-4d2f-b855-5e5a8909b26e\",\n \"name\": \"Schedule_Name\",\n \"enabled\": true,\n \"trigger\": {\n \"single\":{ \n \"time\": \"2014-09-17 12:00:00\" //YYYY-MM-DD HH:MM:SS\n }\n },\n \"push\": {\n \"platform\": \"all\",\n \"audience\": \"all\",\n \"notification\": {\n \"alert\" : \"Hello, JPush!\"\n },\n \"message\": {\n \"msg_content\":\"Message!\"\n },\n \"options\": {\n \"time_to_live\":60\n }\n } \n}\n \n{ \n \"name\": \"Schedule_Name\",\n \"enabled\": true,\n \"trigger\": {\n \"periodical\": {\n \"start\":\"2014-09-17 12:00:00\",\n \"end\": \"2014-09-18 12:00:00\", \n \"time\": \"12:00:00\", \n \"time_unit\": \"WEEK\", //month, week, day, 大小写不敏感\n \"frequency\": 1,\n \"point\": [\"WED\",\"FRI\"] //time_unit为day时候,point不能存在。WED,FRI 大小写不敏感。month:\"01\",\"02\"\n }\n }, \n \"push\": { \n \"platform\": \"all\", \n \"audience\": \"all\",\n \"notification\": {\"alert\" : \"Hello, JPush!\" }, \n \"message\": {\"msg_content\":\"Message!\" }, \n \"options\": {\"time_to_live\":60}\n }\n}\n```\n\n***字段说明:***\n\n每一个schedule任务,都由name、enabled、trigger、push这四个小节组成。\n\n+ cid\n\t+ 和 push api 中 cid 用法一致,详见 [cid 说明](rest_api_v3_push/#cid) 。注:schedule api payload 中的 push 字段中含有 cid 字段将会被忽略。\t\n+ push\n\t+ 参考 [ push api ](rest_api_v3_push) 中各个字段。\n+ name\n\t+ 表示schedule任务的名字,由schedule-api在用户成功创建schedule任务后返回,不得超过255字节,由汉字、字母、数字、下划线组成。\n+ enabled\n\t+ 表示任务当前状态,布尔值,必须为true或false,创建任务时必须为true。\n+ trigger \n\t+ 表示schedule任务的触发条件,当前只支持定时任务(single)与定期任务(periodical)。\n\t\t+ single\n\t\t\t+ 表示定时任务 \n\t\t\t\t+ time为必选项且格式为\"YYYY-mm-dd HH:MM:SS“,如\"2014-02-15 13:16:59\",不能为\"2014-2-15 13:16:59\"或\"2014-12-15 13:16\",即日期时间格式必须完整。\n\t\t+ periodical\n\t\t\t+ 表示定期任务\n\t\t\t\t+ start 表示定期任务有效起始时间,格式与必须严格为: \"YYYY-mm-dd HH:MM:SS\",且时间必须为24小时制。\n\t\t\t\t+ end 表示定期任务的过期时间,格式同上。定时任务不超过一年。\n\t\t\t\t+ time 表示触发定期任务的定期执行时间,格式严格为: \"HH:MM:SS\",且为24小时制。\n\t\t\t\t+ time_unit 表示定期任务的执行的最小时间单位有:\"day\"、\"week\" 及\"month\" 三种。大小写不敏感,如\"day\", \"Day\", \"DAy\" 均为合法的time_unit。\n\t\t\t\t+ frequency 此项与time_unit的乘积共同表示的定期任务的执行周期,如time_unit为day,frequency为2,则表示每两天触发一次推送,目前支持的最大值为100。\n\t\t\t\t+ point 一个列表,此项与time_unit相对应:\n\n
\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t
time_unitpoint描述
dayNIL当time_unit为day时point此项无效
week\"MON\",\"TUE\",\"WED\",\"THU\",\"FRI\",\"SAT\",\"SUN\"当time_unit为week时,point为对应项的一项或多项,表示星期几进行触发,point中的值大小写不敏感
month\"01\",\"02\",\"03\" .... \"31\"当time_unit为month时,point为当前进行月对应的日期,且必须有效,如month为2月,则31或30日是不会进行触发的
\n
\n\n\n\n## 创建定时任务\n\n```\nPOST https://api.jpush.cn/v3/schedules\n```\n\n\n### Example Request\n\n***Request Header***\n\n```\nPOST /v3/schedules\n Authorization: Basic (base64 auth string)\n Content-Type: application/json\n Accept: application/json\n```\n\n***Request Data***\n\n```\n{\n \"name\": \"定时推送示例\", \n \"enabled\": true, \n \"trigger\": { \n \"periodical\": { \n \"start\":\"2014-09-17 12:00:00\", \n \"end\": \"2014-10-18 12:00:00\", \n \"time\": \"12:00:00\", \n \"time_unit\": \"WEEK\", //month, week, day, 大小写不敏感 \n \"frequency\": 2, \n \"point\": [\"WED\",\"FRI\"] //time_unit为day时候,point不能存在。WED,FRI 大小写不敏感。month:\"01\",\"02\" \n }\n },\n \"push\": {\n \"platform\": \"all\",\n \"audience\": \"all\", \n \"notification\": {\n \"ios\": {\n \"alert\":\"this a test\",\n \"sound\":\"default\",\n \"badge\":\"+1\"\n }\n },\n \"message\": {}, \n \"options\": {\"apns_production\":\"false\"}\n } \n}\n```\n\n***Request Data 说明***\n\n+ 由于定时任务相对简单,我们例中只对定期任务进行说明\n+ 以上表示创建一个定期任务,起始生效时间必须'2014-09-17 12:00:00之后'第一个time时间点,过期时间为'2014-10-18 12:00:00',在有效期内每两周的周三、周五中午12点分别执行一次\n+ 定期任务首次创建时的触发时间不得晚于其end中指定的时间。否则创建失败\n+ 定期任务(包括定时任务)首次创建时其enabled项必须为true。不能创建enabled:false的任务,否则创建失败\n+ push 必须为有效合法的push动作,否则创建失败。\n\n### Example Response\n\n***Success Response***\n\n```\nHTTP/1.1 200 CREATED \n Content-Type: application/json; charset=utf-8\n```\n\n```\n{\n \"schedule_id\":\"0eac1b80-c2ac-4b69-948b-c65b34b96512\",\n \"name\":\"定时推送示例\" //长度最大255字节,数字、字母、下划线、汉字。\n}\n```\n\n***Failed Response***\n\n```\nHTTP/1.1 400 BAD REQUEST\n Content-Type: application/json; charset=utf-8\n```\n\n```\n{\n \"error\":\n {\n \"code\":8400,\n \"message\":\"error message\"\n }\n}\n```\n\n## 获取有效的schedule列表\n\n```\nGET https://api.jpush.cn/v3/schedules?page=\n```\n\n获取当前有效(endtime未过期)的 schedule 列表\n\n###Example Request\n\n***Request Header***\n\n```\nGET /v3/schedules?page=\n Authorization: Basic (base64 auth string) \n Content-Type: application/json\n Accept: application/json\n```\n\n+ 返回当前请求页的详细的schedule-task列表,如未指定page则page为1。\n+ 排序规则:创建时间,由schedule-service完成。\n+ 如果请求页数大于总页数,则 page为请求值,schedules为空。\n+ 每页最多返回50个task,如请求页实际的task的个数小于50,则返回实际数量的task。\n\n###Example Response\n\n***Success Response***\n\n```\nHTTP/1.1 200 OK \n Content-Type: application/json; charset=utf-8\n```\n```\n{\n \"total_count\":1000, //数字 表示总数\n \"total_pages\":5, //总页数。\n \"page\":4, //当前为第四页。\n \"schedules\":[\n {\"schedule_id\":\"0eac1b80-c2ac-4b69-948b-c65b34b96512\",\"name\":\"\",\"enabled\":...},{}, //详细信息列表。\n ]\n}\n```\n+ 以上表示总共1000个schedule-task, 总共5页,当前为第4页,包含50个schedule-task的信息。\n+ 返回的schedules为schedule-task的详细信息列表。\n\n## 获取指定的定时任务\n\n```\n GET https://api.jpush.cn/v3/schedules/{schedule_id}\n```\n\n###Example Request\n\n***Request Header***\n\n```\nGET /v3/schedules/{schedule_id}\n Authorization: Basic (base64 auth string)\n Content-Type: application/json\n Accept: application/json\n```\n+ 获取当前用户的schedule任务id为{schedule_id}的定时任务的详情。\n\n###Example Response\n\n***Success Reponse***\n\n```\nHTTP/1.1 200 OK \n Content-Type: application/json; charset=utf-8\n```\n\n***Response Data***\n\n```\n{ \n \"schedule_id\":\"0eac1b80-c2ac-4b69-948b-c65b34b96512\"\n \"name\": \"定时推送示例\", \n \"enabled\": true, \n \"trigger\": {\n ...\n },\n \"push\": { ... }\n}\n```\n\n+ 如schedule_id不存在,则返回404,否则返回实际schedule-task的详情。\n\n## 修改指定的Schedule\n\n```\nPUT https://api.jpush.cn/v3/schedules/{schedule_id}\n```\n\n###Example Request\n\n```\nPUT /v3/schedules/{schedule_id}\n Authorization: Basic (base64 auth string) \n Content-Type: application/x-www-form-urlencoded\n Accept: application/json\n```\n+ 更新指定id的schedule任务。\n\n```\n{\n \"name\": \"task\", \n \"enabled\": true, \n \"trigger\": { \n \n },\n \"push\": { ... } \n}\n```\n+ 更新操作可为 \"name\",\"enabled\"、\"trigger\"或\"push\" 四项中的一项或多项。\n+ 不支持部分更新,如更新之前的任务为:\n\n```\n{ \n \"name\": \"定时推送示例\", \n \"enabled\": true, \n \"trigger\": {\n \"periodical\": { \n \"start\":\"2014-09-17 12:00:00\", \n \"end\": \"2014-10-18 12:00:00\", \n \"time\": \"12:00:00\", \n \"time_unit\": \"WEEK\",\n \"frequency\": 2, \n \"point\": [\"WED\",\"FRI\"]\n }\n },\n \"push\": {\n \"platform\":\"ios\",\n \"options\":{\"apns_production\":\"false\"},\n \"audience\":\"all\",\n \"notification\" : {\"alert\":\"定时任务更新\"}\n }\n}\n```\n+ 则以下为错误的更新及与之对应的正确的更新示例:\n\n```\n## WRONG: 更新push中的平台为安卓:\n { \n \"push\":{\"platform\":\"android\"}\n }\n## RIGHT: 更新push中的平台为安卓:\n {\n \"push\":{ \n \"platform\":\"android\",\n \"options\":{\"apns_production\":\"false\"},\n \"audience\":\"all\",\n \"notification\" : {\"alert\":\"定时任务更新\"}\n }\n }\n ## 此处的push更新后必须仍是有效的,否则也会更新失败。\n \n## WRONG: 更新periodical中的过期时间延后一个月:\n {\n \"trigger\":{\n \"end\":\"2014-11-18 12:00:00\"\n }\n }\n## RIGHT: 更新periodical中的过期时间延后一个月:\n {\n \"trigger\":{\n \"periodical\": { \n \"start\":\"2014-09-17 12:00:00\", \n \"end\": \"2014-11-18 12:00:00\", \n \"time\": \"12:00:00\", \n \"time_unit\": \"WEEK\",\n \"frequency\": 2, \n \"point\": [\"WED\",\"FRI\"]\n }\n }\n }\n ## time、time_unit、frequency、point的更新同上。\n ## 更新后的trigger必须仍是有效合法的,否则即使trigger整体更新也会失败。可以更新enable:false的任务。\n ## 定时任务(single)与定期任务(periodical)之间不能进行相互更新,即,原先为single类任务,则不能更新为periodical任务,反之亦然。\n ## 不能更新已过期的schedule任务\n```\n\n\n###Example Response\n\n***Success Response***\n\n```\nHTTP/1.0 200 CREATED\n Content-Type: application/json\n```\n\n```\n{ \n \"name\": \"定时推送示例\", \n \"enabled\": true, \n \"trigger\": { \n \"periodical\": { \n \"start\":\"2014-09-17 12:00:00\",\n \"end\": \"2014-11-18 12:00:00\",\n \"time\": \"12:00:00\",\n \"time_unit\": \"WEEK\", \n \"frequency\": 2, \n \"point\": [\"WED\",\"FRI\"] }\n }, \n \"push\": {\n \"platform\":\"andiro\", \n \"options\":{\"apns_production\":\"false\"}, \n \"audience\":\"all\", \n \"notification\" : {\"alert\":\"定时任务更新\"}\n }\n}\n```\n\n***Fail Response***\n\n+ schedule_id无效,不是有效的uuid。\n\n```\nHTTP/1.0 404 Not Found\n Content-Type: application/json\n```\n KEY=2R9BWTBTPSG6OU256E4BOEG2C82DZRPH\n\n+ 更新操作不合法\n\n```\nHTTP/1.0 400 BAD REQUEST\n Content-Type: application/json\n```\n\n##删除指定的Schedule任务\n\n```\nDELETE https://api.jpush.cn/v3/schedules/{schedule_id}\n```\n\nschedule\\_id为已创建的schedule任务的id,如果schedule_id不合法即不是有效的uuid,则404。\n\n###Example Request\n\n```\nDELETE /v3/schedules/{schedule_id}\n Authorization: Basic (base64 auth string)\n Content-Type: application/json\n Accept: application/json\n```\n\n###Example Response\n\n***Success Response***\n\n```\nHTTP/1.0 200 \n Content-Type: application/json\n Content-Length: 0\n```\n\n***Failed Response***\n\n```\nHTTP/1.0 404 Not Found \n Content-Type: application/json\n Content-Length: 0\n```\n\n```\n{\n \"error\":{\n \"code\":8404,\n \"message\":\"...\"\n }\n}\n```\n\n## 错误码描述\n\n
\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t
CodeHTTP描述Error Message详细解释
8000200正确返回nil成功状态码
8104404请求的schedule任务,不存在Request schedule operation doesn't exist请求的定时api操作不存在
8101401鉴权失败Basic authentication failed.appkey masterscrect 不匹配
8100400参数无效The schedule-task is invalid:section is invalid;has been at term;expired;request data is not json;update target task;Delete target task;schedule request is not exist参数不合法或者无效,没通过校验
8203503系统内部错误,建议稍后重试Execute action timeout, please try later again与schedule-server 通信错误
8200500系统内部错误Server internal error.发生未预料错误。
\n
\n\n***错误返回格式***\n\n```\n{\"error\":{\"code\":errcode, \"message\":\"error message\"}}\n```\n\n## 调用限制\n+ 定时最多有效数(当前未过期数)与周期最多有效数(当前未过期数)总数 100个。超过后失败。\n+ 最大频率当前为100/分。\n+ periodical任务的最大跨度为12个月。", "spans": [{"start": 9388, "end": 9420, "label": "api_key", "value_type": "generic_upper_key", "context": "assignment", "synthetic": true, "value": "2R9BWTBTPSG6OU256E4BOEG2C82DZRPH"}], "hard_negatives": [{"start": 442, "end": 447, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "dummy"}]} -{"id": "ghcc-00069-06d2ad1966b26ba9", "source": "codeparrot/github-code-clean", "repo": "Azure/azure-sdk-for-python", "license": "mit", "language": "Python", "path": "sdk/policyinsights/azure-mgmt-policyinsights/azure/mgmt/policyinsights/operations/_policy_events_operations.py", "text": "# coding=utf-8\n# --------------------------------------------------------------------------\n# Copyright (c) Microsoft Corporation. All rights reserved.\n# Licensed under the MIT License. See License.txt in the project root for license information.\n# Code generated by Microsoft (R) AutoRest Code Generator.\n# Changes may cause incorrect behavior and will be lost if the code is regenerated.\n# --------------------------------------------------------------------------\nimport datetime\nfrom typing import TYPE_CHECKING\nimport warnings\n\nfrom azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error\nfrom azure.core.paging import ItemPaged\nfrom azure.core.pipeline import PipelineResponse\nfrom azure.core.pipeline.transport import HttpRequest, HttpResponse\nfrom azure.mgmt.core.exceptions import ARMErrorFormat\n\nfrom .. import models as _models\n\nif TYPE_CHECKING:\n # pylint: disable=unused-import,ungrouped-imports\n from typing import Any, Callable, Dict, Generic, Iterable, Optional, TypeVar\n\n T = TypeVar('T')\n ClsType = Optional[Callable[[PipelineResponse[HttpRequest, HttpResponse], T, Dict[str, Any]], Any]]\n\nclass PolicyEventsOperations(object):\n \"\"\"PolicyEventsOperations operations.\n\n You should not instantiate this class directly. Instead, you should create a Client instance that\n instantiates it for you and attaches it as an attribute.\n\n :ivar models: Alias to model classes used in this operation group.\n :type models: ~azure.mgmt.policyinsights.models\n :param client: Client for service requests.\n :param config: Configuration of service client.\n :param serializer: An object model serializer.\n :param deserializer: An object model deserializer.\n \"\"\"\n\n models = _models\n\n def __init__(self, client, config, serializer, deserializer):\n self._client = client\n self._serialize = serializer\n self._deserialize = deserializer\n self._config = config\n\n def list_query_results_for_management_group(\n self,\n management_group_name, # type: str\n query_options=None, # type: Optional[\"_models.QueryOptions\"]\n **kwargs # type: Any\n ):\n # type: (...) -> Iterable[\"_models.PolicyEventsQueryResults\"]\n \"\"\"Queries policy events for the resources under the management group.\n\n :param management_group_name: Management group name.\n :type management_group_name: str\n :param query_options: Parameter group.\n :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either PolicyEventsQueryResults or the result of cls(response)\n :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyEventsQueryResults]\n :raises: ~azure.core.exceptions.HttpResponseError\n \"\"\"\n cls = kwargs.pop('cls', None) # type: ClsType[\"_models.PolicyEventsQueryResults\"]\n error_map = {\n 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError\n }\n error_map.update(kwargs.pop('error_map', {}))\n \n _top = None\n _order_by = None\n _select = None\n _from_property = None\n _to = None\n _filter = None\n _apply = None\n _skip_token = None\n if query_options is not None:\n _top = query_options.top\n _order_by = query_options.order_by\n _select = query_options.select\n _from_property = query_options.from_property\n _to = query_options.to\n _filter = query_options.filter\n _apply = query_options.apply\n _skip_token = query_options.skip_token\n policy_events_resource = \"default\"\n management_groups_namespace = \"Microsoft.Management\"\n api_version = \"2019-10-01\"\n accept = \"application/json\"\n\n def prepare_request(next_link=None):\n # Construct headers\n header_parameters = {} # type: Dict[str, Any]\n header_parameters['Accept'] = self._serialize.header(\"accept\", accept, 'str')\n\n if not next_link:\n # Construct URL\n url = self.list_query_results_for_management_group.metadata['url'] # type: ignore\n path_format_arguments = {\n 'policyEventsResource': self._serialize.url(\"policy_events_resource\", policy_events_resource, 'str'),\n 'managementGroupsNamespace': self._serialize.url(\"management_groups_namespace\", management_groups_namespace, 'str'),\n 'managementGroupName': self._serialize.url(\"management_group_name\", management_group_name, 'str'),\n }\n url = self._client.format_url(url, **path_format_arguments)\n # Construct parameters\n query_parameters = {} # type: Dict[str, Any]\n query_parameters['api-version'] = self._serialize.query(\"api_version\", api_version, 'str')\n if _top is not None:\n query_parameters['$top'] = self._serialize.query(\"top\", _top, 'int', minimum=0)\n if _order_by is not None:\n query_parameters['$orderby'] = self._serialize.query(\"order_by\", _order_by, 'str')\n if _select is not None:\n query_parameters['$select'] = self._serialize.query(\"select\", _select, 'str')\n if _from_property is not None:\n query_parameters['$from'] = self._serialize.query(\"from_property\", _from_property, 'iso-8601')\n if _to is not None:\n query_parameters['$to'] = self._serialize.query(\"to\", _to, 'iso-8601')\n if _filter is not None:\n query_parameters['$filter'] = self._serialize.query(\"filter\", _filter, 'str')\n if _apply is not None:\n query_parameters['$apply'] = self._serialize.query(\"apply\", _apply, 'str')\n if _skip_token is not None:\n query_parameters['$skiptoken'] = self._serialize.query(\"skip_token\", _skip_token, 'str')\n\n request = self._client.post(url, query_parameters, header_parameters)\n else:\n url = '{nextLink}'\n path_format_arguments = {\n 'nextLink': self._serialize.url(\"next_link\", next_link, 'str', skip_quote=True),\n }\n url = self._client.format_url(url, **path_format_arguments)\n # Construct parameters\n query_parameters = {} # type: Dict[str, Any]\n query_parameters['api-version'] = self._serialize.query(\"api_version\", api_version, 'str')\n if _skip_token is not None:\n query_parameters['$skiptoken'] = self._serialize.query(\"skip_token\", _skip_token, 'str')\n\n request = self._client.post(url, query_parameters, header_parameters)\n return request\n\n def extract_data(pipeline_response):\n deserialized = self._deserialize('PolicyEventsQueryResults', pipeline_response)\n list_of_elem = deserialized.value\n if cls:\n list_of_elem = cls(list_of_elem)\n return deserialized.odata_next_link or None, iter(list_of_elem)\n\n def get_next(next_link=None):\n request = prepare_request(next_link)\n\n pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)\n response = pipeline_response.http_response\n\n if response.status_code not in [200]:\n error = self._deserialize.failsafe_deserialize(_models.QueryFailure, response)\n map_error(status_code=response.status_code, response=response, error_map=error_map)\n raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)\n\n return pipeline_response\n\n return ItemPaged(\n get_next, extract_data\n )\n list_query_results_for_management_group.metadata = {'url': '/providers/{managementGroupsNamespace}/managementGroups/{managementGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults'} # type: ignore\n\n def list_query_results_for_subscription(\n self,\n subscription_id, # type: str\n query_options=None, # type: Optional[\"_models.QueryOptions\"]\n **kwargs # type: Any\n ):\n # type: (...) -> Iterable[\"_models.PolicyEventsQueryResults\"]\n \"\"\"Queries policy events for the resources under the subscription.\n\n :param subscription_id: Microsoft Azure subscription ID.\n :type subscription_id: str\n :param query_options: Parameter group.\n :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either PolicyEventsQueryResults or the result of cls(response)\n :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyEventsQueryResults]\n :raises: ~azure.core.exceptions.HttpResponseError\n \"\"\"\n cls = kwargs.pop('cls', None) # type: ClsType[\"_models.PolicyEventsQueryResults\"]\n error_map = {\n 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError\n }\n error_map.update(kwargs.pop('error_map', {}))\n \n _top = None\n _order_by = None\n _select = None\n _from_property = None\n _to = None\n _filter = None\n _apply = None\n _skip_token = None\n if query_options is not None:\n _top = query_options.top\n _order_by = query_options.order_by\n _select = query_options.select\n _from_property = query_options.from_property\n _to = query_options.to\n _filter = query_options.filter\n _apply = query_options.apply\n _skip_token = query_options.skip_token\n policy_events_resource = \"default\"\n api_version = \"2019-10-01\"\n accept = \"application/json\"\n\n def prepare_request(next_link=None):\n # Construct headers\n header_parameters = {} # type: Dict[str, Any]\n header_parameters['Accept'] = self._serialize.header(\"accept\", accept, 'str')\n\n if not next_link:\n # Construct URL\n url = self.list_query_results_for_subscription.metadata['url'] # type: ignore\n path_format_arguments = {\n 'policyEventsResource': self._serialize.url(\"policy_events_resource\", policy_events_resource, 'str'),\n 'subscriptionId': self._serialize.url(\"subscription_id\", subscription_id, 'str'),\n }\n url = self._client.format_url(url, **path_format_arguments)\n # Construct parameters\n query_parameters = {} # type: Dict[str, Any]\n query_parameters['api-version'] = self._serialize.query(\"api_version\", api_version, 'str')\n if _top is not None:\n query_parameters['$top'] = self._serialize.query(\"top\", _top, 'int', minimum=0)\n if _order_by is not None:\n query_parameters['$orderby'] = self._serialize.query(\"order_by\", _order_by, 'str')\n if _select is not None:\n query_parameters['$select'] = self._serialize.query(\"select\", _select, 'str')\n if _from_property is not None:\n query_parameters['$from'] = self._serialize.query(\"from_property\", _from_property, 'iso-8601')\n if _to is not None:\n query_parameters['$to'] = self._serialize.query(\"to\", _to, 'iso-8601')\n if _filter is not None:\n query_parameters['$filter'] = self._serialize.query(\"filter\", _filter, 'str')\n if _apply is not None:\n query_parameters['$apply'] = self._serialize.query(\"apply\", _apply, 'str')\n if _skip_token is not None:\n query_parameters['$skiptoken'] = self._serialize.query(\"skip_token\", _skip_token, 'str')\n\n request = self._client.post(url, query_parameters, header_parameters)\n else:\n url = '{nextLink}'\n path_format_arguments = {\n 'nextLink': self._serialize.url(\"next_link\", next_link, 'str', skip_quote=True),\n }\n url = self._client.format_url(url, **path_format_arguments)\n # Construct parameters\n query_parameters = {} # type: Dict[str, Any]\n query_parameters['api-version'] = self._serialize.query(\"api_version\", api_version, 'str')\n if _skip_token is not None:\n query_parameters['$skiptoken'] = self._serialize.query(\"skip_token\", _skip_token, 'str')\n\n request = self._client.post(url, query_parameters, header_parameters)\n return request\n\n def extract_data(pipeline_response):\n deserialized = self._deserialize('PolicyEventsQueryResults', pipeline_response)\n list_of_elem = deserialized.value\n if cls:\n list_of_elem = cls(list_of_elem)\n return deserialized.odata_next_link or None, iter(list_of_elem)\n\n def get_next(next_link=None):\n request = prepare_request(next_link)\n\n pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)\n response = pipeline_response.http_response\n\n if response.status_code not in [200]:\n error = self._deserialize.failsafe_deserialize(_models.QueryFailure, response)\n map_error(status_code=response.status_code, response=response, error_map=error_map)\n raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)\n\n return pipeline_response\n\n return ItemPaged(\n get_next, extract_data\n )\n list_query_results_for_subscription.metadata = {'url': '/subscriptions/{subscriptionId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults'} # type: ignore\n\n def list_query_results_for_resource_group(\n self,\n subscription_id, # type: str\n resource_group_name, # type: str\n query_options=None, # type: Optional[\"_models.QueryOptions\"]\n **kwargs # type: Any\n ):\n # type: (...) -> Iterable[\"_models.PolicyEventsQueryResults\"]\n \"\"\"Queries policy events for the resources under the resource group.\n\n :param subscription_id: Microsoft Azure subscription ID.\n :type subscription_id: str\n :param resource_group_name: Resource group name.\n :type resource_group_name: str\n :param query_options: Parameter group.\n :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either PolicyEventsQueryResults or the result of cls(response)\n :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyEventsQueryResults]\n :raises: ~azure.core.exceptions.HttpResponseError\n \"\"\"\n cls = kwargs.pop('cls', None) # type: ClsType[\"_models.PolicyEventsQueryResults\"]\n error_map = {\n 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError\n }\n error_map.update(kwargs.pop('error_map', {}))\n \n _top = None\n _order_by = None\n _select = None\n _from_property = None\n _to = None\n _filter = None\n _apply = None\n _skip_token = None\n if query_options is not None:\n _top = query_options.top\n _order_by = query_options.order_by\n _select = query_options.select\n _from_property = query_options.from_property\n _to = query_options.to\n _filter = query_options.filter\n _apply = query_options.apply\n _skip_token = query_options.skip_token\n policy_events_resource = \"default\"\n api_version = \"2019-10-01\"\n accept = \"application/json\"\n\n def prepare_request(next_link=None):\n # Construct headers\n header_parameters = {} # type: Dict[str, Any]\n header_parameters['Accept'] = self._serialize.header(\"accept\", accept, 'str')\n\n if not next_link:\n # Construct URL\n url = self.list_query_results_for_resource_group.metadata['url'] # type: ignore\n path_format_arguments = {\n 'policyEventsResource': self._serialize.url(\"policy_events_resource\", policy_events_resource, 'str'),\n 'subscriptionId': self._serialize.url(\"subscription_id\", subscription_id, 'str'),\n 'resourceGroupName': self._serialize.url(\"resource_group_name\", resource_group_name, 'str'),\n }\n url = self._client.format_url(url, **path_format_arguments)\n # Construct parameters\n query_parameters = {} # type: Dict[str, Any]\n query_parameters['api-version'] = self._serialize.query(\"api_version\", api_version, 'str')\n if _top is not None:\n query_parameters['$top'] = self._serialize.query(\"top\", _top, 'int', minimum=0)\n if _order_by is not None:\n query_parameters['$orderby'] = self._serialize.query(\"order_by\", _order_by, 'str')\n if _select is not None:\n query_parameters['$select'] = self._serialize.query(\"select\", _select, 'str')\n if _from_property is not None:\n query_parameters['$from'] = self._serialize.query(\"from_property\", _from_property, 'iso-8601')\n if _to is not None:\n query_parameters['$to'] = self._serialize.query(\"to\", _to, 'iso-8601')\n if _filter is not None:\n query_parameters['$filter'] = self._serialize.query(\"filter\", _filter, 'str')\n if _apply is not None:\n query_parameters['$apply'] = self._serialize.query(\"apply\", _apply, 'str')\n if _skip_token is not None:\n query_parameters['$skiptoken'] = self._serialize.query(\"skip_token\", _skip_token, 'str')\n\n request = self._client.post(url, query_parameters, header_parameters)\n else:\n url = '{nextLink}'\n path_format_arguments = {\n 'nextLink': self._serialize.url(\"next_link\", next_link, 'str', skip_quote=True),\n }\n url = self._client.format_url(url, **path_format_arguments)\n # Construct parameters\n query_parameters = {} # type: Dict[str, Any]\n query_parameters['api-version'] = self._serialize.query(\"api_version\", api_version, 'str')\n if _skip_token is not None:\n query_parameters['$skiptoken'] = self._serialize.query(\"skip_token\", _skip_token, 'str')\n\n request = self._client.post(url, query_parameters, header_parameters)\n return request\n\n def extract_data(pipeline_response):\n deserialized = self._deserialize('PolicyEventsQueryResults', pipeline_response)\n list_of_elem = deserialized.value\n if cls:\n list_of_elem = cls(list_of_elem)\n return deserialized.odata_next_link or None, iter(list_of_elem)\n\n def get_next(next_link=None):\n request = prepare_request(next_link)\n\n pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)\n response = pipeline_response.http_response\n\n if response.status_code not in [200]:\n error = self._deserialize.failsafe_deserialize(_models.QueryFailure, response)\n map_error(status_code=response.status_code, response=response, error_map=error_map)\n raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)\n\n return pipeline_response\n\n return ItemPaged(\n get_next, extract_data\n )\n list_query_results_for_resource_group.metadata = {'url': '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults'} # type: ignore\n\n def list_query_results_for_resource(\n self,\n resource_id, # type: str\n query_options=None, # type: Optional[\"_models.QueryOptions\"]\n **kwargs # type: Any\n ):\n # type: (...) -> Iterable[\"_models.PolicyEventsQueryResults\"]\n \"\"\"Queries policy events for the resource.\n\n :param resource_id: Resource ID.\n :type resource_id: str\n :param query_options: Parameter group.\n :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either PolicyEventsQueryResults or the result of cls(response)\n :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyEventsQueryResults]\n :raises: ~azure.core.exceptions.HttpResponseError\n \"\"\"\n cls = kwargs.pop('cls', None) # type: ClsType[\"_models.PolicyEventsQueryResults\"]\n error_map = {\n 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError\n }\n error_map.update(kwargs.pop('error_map', {}))\n \n _top = None\n _order_by = None\n _select = None\n _from_property = None\n _to = None\n _filter = None\n _apply = None\n _expand = None\n _skip_token = None\n if query_options is not None:\n _top = query_options.top\n _order_by = query_options.order_by\n _select = query_options.select\n _from_property = query_options.from_property\n _to = query_options.to\n _filter = query_options.filter\n _apply = query_options.apply\n _expand = query_options.expand\n _skip_token = query_options.skip_token\n policy_events_resource = \"default\"\n api_version = \"2019-10-01\"\n accept = \"application/json\"\n\n def prepare_request(next_link=None):\n # Construct headers\n header_parameters = {} # type: Dict[str, Any]\n header_parameters['Accept'] = self._serialize.header(\"accept\", accept, 'str')\n\n if not next_link:\n # Construct URL\n url = self.list_query_results_for_resource.metadata['url'] # type: ignore\n path_format_arguments = {\n 'policyEventsResource': self._serialize.url(\"policy_events_resource\", policy_events_resource, 'str'),\n 'resourceId': self._serialize.url(\"resource_id\", resource_id, 'str', skip_quote=True),\n }\n url = self._client.format_url(url, **path_format_arguments)\n # Construct parameters\n query_parameters = {} # type: Dict[str, Any]\n query_parameters['api-version'] = self._serialize.query(\"api_version\", api_version, 'str')\n if _top is not None:\n query_parameters['$top'] = self._serialize.query(\"top\", _top, 'int', minimum=0)\n if _order_by is not None:\n query_parameters['$orderby'] = self._serialize.query(\"order_by\", _order_by, 'str')\n if _select is not None:\n query_parameters['$select'] = self._serialize.query(\"select\", _select, 'str')\n if _from_property is not None:\n query_parameters['$from'] = self._serialize.query(\"from_property\", _from_property, 'iso-8601')\n if _to is not None:\n query_parameters['$to'] = self._serialize.query(\"to\", _to, 'iso-8601')\n if _filter is not None:\n query_parameters['$filter'] = self._serialize.query(\"filter\", _filter, 'str')\n if _apply is not None:\n query_parameters['$apply'] = self._serialize.query(\"apply\", _apply, 'str')\n if _expand is not None:\n query_parameters['$expand'] = self._serialize.query(\"expand\", _expand, 'str')\n if _skip_token is not None:\n query_parameters['$skiptoken'] = self._serialize.query(\"skip_token\", _skip_token, 'str')\n\n request = self._client.post(url, query_parameters, header_parameters)\n else:\n url = '{nextLink}'\n path_format_arguments = {\n 'nextLink': self._serialize.url(\"next_link\", next_link, 'str', skip_quote=True),\n }\n url = self._client.format_url(url, **path_format_arguments)\n # Construct parameters\n query_parameters = {} # type: Dict[str, Any]\n query_parameters['api-version'] = self._serialize.query(\"api_version\", api_version, 'str')\n if _skip_token is not None:\n query_parameters['$skiptoken'] = self._serialize.query(\"skip_token\", _skip_token, 'str')\n\n request = self._client.post(url, query_parameters, header_parameters)\n return request\n\n def extract_data(pipeline_response):\n deserialized = self._deserialize('PolicyEventsQueryResults', pipeline_response)\n list_of_elem = deserialized.value\n if cls:\n list_of_elem = cls(list_of_elem)\n return deserialized.odata_next_link or None, iter(list_of_elem)\n\n def get_next(next_link=None):\n request = prepare_request(next_link)\n\n pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)\n response = pipeline_response.http_response\n\n if response.status_code not in [200]:\n error = self._deserialize.failsafe_deserialize(_models.QueryFailure, response)\n map_error(status_code=response.status_code, response=response, error_map=error_map)\n raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)\n\n return pipeline_response\n\n return ItemPaged(\n get_next, extract_data\n )\n list_query_results_for_resource.metadata = {'url': '/{resourceId}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults'} # type: ignore\n\n def list_query_results_for_policy_set_definition(\n self,\n subscription_id, # type: str\n policy_set_definition_name, # type: str\n query_options=None, # type: Optional[\"_models.QueryOptions\"]\n **kwargs # type: Any\n ):\n # type: (...) -> Iterable[\"_models.PolicyEventsQueryResults\"]\n \"\"\"Queries policy events for the subscription level policy set definition.\n\n :param subscription_id: Microsoft Azure subscription ID.\n :type subscription_id: str\n :param policy_set_definition_name: Policy set definition name.\n :type policy_set_definition_name: str\n :param query_options: Parameter group.\n :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either PolicyEventsQueryResults or the result of cls(response)\n :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyEventsQueryResults]\n :raises: ~azure.core.exceptions.HttpResponseError\n \"\"\"\n cls = kwargs.pop('cls', None) # type: ClsType[\"_models.PolicyEventsQueryResults\"]\n error_map = {\n 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError\n }\n error_map.update(kwargs.pop('error_map', {}))\n \n _top = None\n _order_by = None\n _select = None\n _from_property = None\n _to = None\n _filter = None\n _apply = None\n _skip_token = None\n if query_options is not None:\n _top = query_options.top\n _order_by = query_options.order_by\n _select = query_options.select\n _from_property = query_options.from_property\n _to = query_options.to\n _filter = query_options.filter\n _apply = query_options.apply\n _skip_token = query_options.skip_token\n policy_events_resource = \"default\"\n authorization_namespace = \"Microsoft.Authorization\"\n api_version = \"2019-10-01\"\n accept = \"application/json\"\n\n def prepare_request(next_link=None):\n # Construct headers\n header_parameters = {} # type: Dict[str, Any]\n header_parameters['Accept'] = self._serialize.header(\"accept\", accept, 'str')\n\n if not next_link:\n # Construct URL\n url = self.list_query_results_for_policy_set_definition.metadata['url'] # type: ignore\n path_format_arguments = {\n 'policyEventsResource': self._serialize.url(\"policy_events_resource\", policy_events_resource, 'str'),\n 'subscriptionId': self._serialize.url(\"subscription_id\", subscription_id, 'str'),\n 'authorizationNamespace': self._serialize.url(\"authorization_namespace\", authorization_namespace, 'str'),\n 'policySetDefinitionName': self._serialize.url(\"policy_set_definition_name\", policy_set_definition_name, 'str'),\n }\n url = self._client.format_url(url, **path_format_arguments)\n # Construct parameters\n query_parameters = {} # type: Dict[str, Any]\n query_parameters['api-version'] = self._serialize.query(\"api_version\", api_version, 'str')\n if _top is not None:\n query_parameters['$top'] = self._serialize.query(\"top\", _top, 'int', minimum=0)\n if _order_by is not None:\n query_parameters['$orderby'] = self._serialize.query(\"order_by\", _order_by, 'str')\n if _select is not None:\n query_parameters['$select'] = self._serialize.query(\"select\", _select, 'str')\n if _from_property is not None:\n query_parameters['$from'] = self._serialize.query(\"from_property\", _from_property, 'iso-8601')\n if _to is not None:\n query_parameters['$to'] = self._serialize.query(\"to\", _to, 'iso-8601')\n if _filter is not None:\n query_parameters['$filter'] = self._serialize.query(\"filter\", _filter, 'str')\n if _apply is not None:\n query_parameters['$apply'] = self._serialize.query(\"apply\", _apply, 'str')\n if _skip_token is not None:\n query_parameters['$skiptoken'] = self._serialize.query(\"skip_token\", _skip_token, 'str')\n\n request = self._client.post(url, query_parameters, header_parameters)\n else:\n url = '{nextLink}'\n path_format_arguments = {\n 'nextLink': self._serialize.url(\"next_link\", next_link, 'str', skip_quote=True),\n }\n url = self._client.format_url(url, **path_format_arguments)\n # Construct parameters\n query_parameters = {} # type: Dict[str, Any]\n query_parameters['api-version'] = self._serialize.query(\"api_version\", api_version, 'str')\n if _skip_token is not None:\n query_parameters['$skiptoken'] = self._serialize.query(\"skip_token\", _skip_token, 'str')\n\n request = self._client.post(url, query_parameters, header_parameters)\n return request\n\n def extract_data(pipeline_response):\n deserialized = self._deserialize('PolicyEventsQueryResults', pipeline_response)\n list_of_elem = deserialized.value\n if cls:\n list_of_elem = cls(list_of_elem)\n return deserialized.odata_next_link or None, iter(list_of_elem)\n\n def get_next(next_link=None):\n request = prepare_request(next_link)\n\n pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)\n response = pipeline_response.http_response\n\n if response.status_code not in [200]:\n error = self._deserialize.failsafe_deserialize(_models.QueryFailure, response)\n map_error(status_code=response.status_code, response=response, error_map=error_map)\n raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)\n\n return pipeline_response\n\n return ItemPaged(\n get_next, extract_data\n )\n list_query_results_for_policy_set_definition.metadata = {'url': '/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policySetDefinitions/{policySetDefinitionName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults'} # type: ignore\n\n def list_query_results_for_policy_definition(\n self,\n subscription_id, # type: str\n policy_definition_name, # type: str\n query_options=None, # type: Optional[\"_models.QueryOptions\"]\n **kwargs # type: Any\n ):\n # type: (...) -> Iterable[\"_models.PolicyEventsQueryResults\"]\n \"\"\"Queries policy events for the subscription level policy definition.\n\n :param subscription_id: Microsoft Azure subscription ID.\n :type subscription_id: str\n :param policy_definition_name: Policy definition name.\n :type policy_definition_name: str\n :param query_options: Parameter group.\n :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either PolicyEventsQueryResults or the result of cls(response)\n :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyEventsQueryResults]\n :raises: ~azure.core.exceptions.HttpResponseError\n \"\"\"\n cls = kwargs.pop('cls', None) # type: ClsType[\"_models.PolicyEventsQueryResults\"]\n error_map = {\n 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError\n }\n error_map.update(kwargs.pop('error_map', {}))\n \n _top = None\n _order_by = None\n _select = None\n _from_property = None\n _to = None\n _filter = None\n _apply = None\n _skip_token = None\n if query_options is not None:\n _top = query_options.top\n _order_by = query_options.order_by\n _select = query_options.select\n _from_property = query_options.from_property\n _to = query_options.to\n _filter = query_options.filter\n _apply = query_options.apply\n _skip_token = query_options.skip_token\n policy_events_resource = \"default\"\n authorization_namespace = \"Microsoft.Authorization\"\n api_version = \"2019-10-01\"\n accept = \"application/json\"\n\n def prepare_request(next_link=None):\n # Construct headers\n header_parameters = {} # type: Dict[str, Any]\n header_parameters['Accept'] = self._serialize.header(\"accept\", accept, 'str')\n\n if not next_link:\n # Construct URL\n url = self.list_query_results_for_policy_definition.metadata['url'] # type: ignore\n path_format_arguments = {\n 'policyEventsResource': self._serialize.url(\"policy_events_resource\", policy_events_resource, 'str'),\n 'subscriptionId': self._serialize.url(\"subscription_id\", subscription_id, 'str'),\n 'authorizationNamespace': self._serialize.url(\"authorization_namespace\", authorization_namespace, 'str'),\n 'policyDefinitionName': self._serialize.url(\"policy_definition_name\", policy_definition_name, 'str'),\n }\n url = self._client.format_url(url, **path_format_arguments)\n # Construct parameters\n query_parameters = {} # type: Dict[str, Any]\n query_parameters['api-version'] = self._serialize.query(\"api_version\", api_version, 'str')\n if _top is not None:\n query_parameters['$top'] = self._serialize.query(\"top\", _top, 'int', minimum=0)\n if _order_by is not None:\n query_parameters['$orderby'] = self._serialize.query(\"order_by\", _order_by, 'str')\n if _select is not None:\n query_parameters['$select'] = self._serialize.query(\"select\", _select, 'str')\n if _from_property is not None:\n query_parameters['$from'] = self._serialize.query(\"from_property\", _from_property, 'iso-8601')\n if _to is not None:\n query_parameters['$to'] = self._serialize.query(\"to\", _to, 'iso-8601')\n if _filter is not None:\n query_parameters['$filter'] = self._serialize.query(\"filter\", _filter, 'str')\n if _apply is not None:\n query_parameters['$apply'] = self._serialize.query(\"apply\", _apply, 'str')\n if _skip_token is not None:\n query_parameters['$skiptoken'] = self._serialize.query(\"skip_token\", _skip_token, 'str')\n\n request = self._client.post(url, query_parameters, header_parameters)\n else:\n url = '{nextLink}'\n path_format_arguments = {\n 'nextLink': self._serialize.url(\"next_link\", next_link, 'str', skip_quote=True),\n }\n url = self._client.format_url(url, **path_format_arguments)\n # Construct parameters\n query_parameters = {} # type: Dict[str, Any]\n query_parameters['api-version'] = self._serialize.query(\"api_version\", api_version, 'str')\n if _skip_token is not None:\n query_parameters['$skiptoken'] = self._serialize.query(\"skip_token\", _skip_token, 'str')\n\n request = self._client.post(url, query_parameters, header_parameters)\n return request\n\n def extract_data(pipeline_response):\n deserialized = self._deserialize('PolicyEventsQueryResults', pipeline_response)\n list_of_elem = deserialized.value\n if cls:\n list_of_elem = cls(list_of_elem)\n return deserialized.odata_next_link or None, iter(list_of_elem)\n\n def get_next(next_link=None):\n request = prepare_request(next_link)\n\n pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)\n response = pipeline_response.http_response\n\n if response.status_code not in [200]:\n error = self._deserialize.failsafe_deserialize(_models.QueryFailure, response)\n map_error(status_code=response.status_code, response=response, error_map=error_map)\n raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)\n\n return pipeline_response\n\n return ItemPaged(\n get_next, extract_data\n )\n list_query_results_for_policy_definition.metadata = {'url': '/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyDefinitions/{policyDefinitionName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults'} # type: ignore\n\n def list_query_results_for_subscription_level_policy_assignment(\n self,\n subscription_id, # type: str\n policy_assignment_name, # type: str\n query_options=None, # type: Optional[\"_models.QueryOptions\"]\n **kwargs # type: Any\n ):\n # type: (...) -> Iterable[\"_models.PolicyEventsQueryResults\"]\n \"\"\"Queries policy events for the subscription level policy assignment.\n\n :param subscription_id: Microsoft Azure subscription ID.\n :type subscription_id: str\n :param policy_assignment_name: Policy assignment name.\n :type policy_assignment_name: str\n :param query_options: Parameter group.\n :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either PolicyEventsQueryResults or the result of cls(response)\n :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyEventsQueryResults]\n :raises: ~azure.core.exceptions.HttpResponseError\n \"\"\"\n cls = kwargs.pop('cls', None) # type: ClsType[\"_models.PolicyEventsQueryResults\"]\n error_map = {\n 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError\n }\n error_map.update(kwargs.pop('error_map', {}))\n \n _top = None\n _order_by = None\n _select = None\n _from_property = None\n _to = None\n _filter = None\n _apply = None\n _skip_token = None\n if query_options is not None:\n _top = query_options.top\n _order_by = query_options.order_by\n _select = query_options.select\n _from_property = query_options.from_property\n _to = query_options.to\n _filter = query_options.filter\n _apply = query_options.apply\n _skip_token = query_options.skip_token\n policy_events_resource = \"default\"\n authorization_namespace = \"Microsoft.Authorization\"\n api_version = \"2019-10-01\"\n accept = \"application/json\"\n\n def prepare_request(next_link=None):\n # Construct headers\n header_parameters = {} # type: Dict[str, Any]\n header_parameters['Accept'] = self._serialize.header(\"accept\", accept, 'str')\n\n if not next_link:\n # Construct URL\n url = self.list_query_results_for_subscription_level_policy_assignment.metadata['url'] # type: ignore\n path_format_arguments = {\n 'policyEventsResource': self._serialize.url(\"policy_events_resource\", policy_events_resource, 'str'),\n 'subscriptionId': self._serialize.url(\"subscription_id\", subscription_id, 'str'),\n 'authorizationNamespace': self._serialize.url(\"authorization_namespace\", authorization_namespace, 'str'),\n 'policyAssignmentName': self._serialize.url(\"policy_assignment_name\", policy_assignment_name, 'str'),\n }\n url = self._client.format_url(url, **path_format_arguments)\n # Construct parameters\n query_parameters = {} # type: Dict[str, Any]\n query_parameters['api-version'] = self._serialize.query(\"api_version\", api_version, 'str')\n if _top is not None:\n query_parameters['$top'] = self._serialize.query(\"top\", _top, 'int', minimum=0)\n if _order_by is not None:\n query_parameters['$orderby'] = self._serialize.query(\"order_by\", _order_by, 'str')\n if _select is not None:\n query_parameters['$select'] = self._serialize.query(\"select\", _select, 'str')\n if _from_property is not None:\n query_parameters['$from'] = self._serialize.query(\"from_property\", _from_property, 'iso-8601')\n if _to is not None:\n query_parameters['$to'] = self._serialize.query(\"to\", _to, 'iso-8601')\n if _filter is not None:\n query_parameters['$filter'] = self._serialize.query(\"filter\", _filter, 'str')\n if _apply is not None:\n query_parameters['$apply'] = self._serialize.query(\"apply\", _apply, 'str')\n if _skip_token is not None:\n query_parameters['$skiptoken'] = self._serialize.query(\"skip_token\", _skip_token, 'str')\n\n request = self._client.post(url, query_parameters, header_parameters)\n else:\n url = '{nextLink}'\n path_format_arguments = {\n 'nextLink': self._serialize.url(\"next_link\", next_link, 'str', skip_quote=True),\n }\n url = self._client.format_url(url, **path_format_arguments)\n # Construct parameters\n query_parameters = {} # type: Dict[str, Any]\n query_parameters['api-version'] = self._serialize.query(\"api_version\", api_version, 'str')\n if _skip_token is not None:\n query_parameters['$skiptoken'] = self._serialize.query(\"skip_token\", _skip_token, 'str')\n\n request = self._client.post(url, query_parameters, header_parameters)\n return request\n\n def extract_data(pipeline_response):\n deserialized = self._deserialize('PolicyEventsQueryResults', pipeline_response)\n list_of_elem = deserialized.value\n if cls:\n list_of_elem = cls(list_of_elem)\n return deserialized.odata_next_link or None, iter(list_of_elem)\n\n def get_next(next_link=None):\n request = prepare_request(next_link)\n\n pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)\n response = pipeline_response.http_response\n\n if response.status_code not in [200]:\n error = self._deserialize.failsafe_deserialize(_models.QueryFailure, response)\n map_error(status_code=response.status_code, response=response, error_map=error_map)\n raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)\n\n return pipeline_response\n\n return ItemPaged(\n get_next, extract_data\n )\n list_query_results_for_subscription_level_policy_assignment.metadata = {'url': '/subscriptions/{subscriptionId}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults'} # type: ignore\n\n def list_query_results_for_resource_group_level_policy_assignment(\n self,\n subscription_id, # type: str\n resource_group_name, # type: str\n policy_assignment_name, # type: str\n query_options=None, # type: Optional[\"_models.QueryOptions\"]\n **kwargs # type: Any\n ):\n # type: (...) -> Iterable[\"_models.PolicyEventsQueryResults\"]\n \"\"\"Queries policy events for the resource group level policy assignment.\n\n :param subscription_id: Microsoft Azure subscription ID.\n :type subscription_id: str\n :param resource_group_name: Resource group name.\n :type resource_group_name: str\n :param policy_assignment_name: Policy assignment name.\n :type policy_assignment_name: str\n :param query_options: Parameter group.\n :type query_options: ~azure.mgmt.policyinsights.models.QueryOptions\n :keyword callable cls: A custom type or function that will be passed the direct response\n :return: An iterator like instance of either PolicyEventsQueryResults or the result of cls(response)\n :rtype: ~azure.core.paging.ItemPaged[~azure.mgmt.policyinsights.models.PolicyEventsQueryResults]\n :raises: ~azure.core.exceptions.HttpResponseError\n \"\"\"\n cls = kwargs.pop('cls', None) # type: ClsType[\"_models.PolicyEventsQueryResults\"]\n error_map = {\n 401: ClientAuthenticationError, 404: ResourceNotFoundError, 409: ResourceExistsError\n }\n error_map.update(kwargs.pop('error_map', {}))\n \n _top = None\n _order_by = None\n _select = None\n _from_property = None\n _to = None\n _filter = None\n _apply = None\n _skip_token = None\n if query_options is not None:\n _top = query_options.top\n _order_by = query_options.order_by\n _select = query_options.select\n _from_property = query_options.from_property\n _to = query_options.to\n _filter = query_options.filter\n _apply = query_options.apply\n _skip_token = query_options.skip_token\n policy_events_resource = \"default\"\n authorization_namespace = \"Microsoft.Authorization\"\n api_version = \"2019-10-01\"\n accept = \"application/json\"\n\n def prepare_request(next_link=None):\n # Construct headers\n header_parameters = {} # type: Dict[str, Any]\n header_parameters['Accept'] = self._serialize.header(\"accept\", accept, 'str')\n\n if not next_link:\n # Construct URL\n url = self.list_query_results_for_resource_group_level_policy_assignment.metadata['url'] # type: ignore\n path_format_arguments = {\n 'policyEventsResource': self._serialize.url(\"policy_events_resource\", policy_events_resource, 'str'),\n 'subscriptionId': self._serialize.url(\"subscription_id\", subscription_id, 'str'),\n 'resourceGroupName': self._serialize.url(\"resource_group_name\", resource_group_name, 'str'),\n 'authorizationNamespace': self._serialize.url(\"authorization_namespace\", authorization_namespace, 'str'),\n 'policyAssignmentName': self._serialize.url(\"policy_assignment_name\", policy_assignment_name, 'str'),\n }\n url = self._client.format_url(url, **path_format_arguments)\n # Construct parameters\n query_parameters = {} # type: Dict[str, Any]\n query_parameters['api-version'] = self._serialize.query(\"api_version\", api_version, 'str')\n if _top is not None:\n query_parameters['$top'] = self._serialize.query(\"top\", _top, 'int', minimum=0)\n if _order_by is not None:\n query_parameters['$orderby'] = self._serialize.query(\"order_by\", _order_by, 'str')\n if _select is not None:\n query_parameters['$select'] = self._serialize.query(\"select\", _select, 'str')\n if _from_property is not None:\n query_parameters['$from'] = self._serialize.query(\"from_property\", _from_property, 'iso-8601')\n if _to is not None:\n query_parameters['$to'] = self._serialize.query(\"to\", _to, 'iso-8601')\n if _filter is not None:\n query_parameters['$filter'] = self._serialize.query(\"filter\", _filter, 'str')\n if _apply is not None:\n query_parameters['$apply'] = self._serialize.query(\"apply\", _apply, 'str')\n if _skip_token is not None:\n query_parameters['$skiptoken'] = self._serialize.query(\"skip_token\", _skip_token, 'str')\n\n request = self._client.post(url, query_parameters, header_parameters)\n else:\n url = '{nextLink}'\n path_format_arguments = {\n 'nextLink': self._serialize.url(\"next_link\", next_link, 'str', skip_quote=True),\n }\n url = self._client.format_url(url, **path_format_arguments)\n # Construct parameters\n query_parameters = {} # type: Dict[str, Any]\n query_parameters['api-version'] = self._serialize.query(\"api_version\", api_version, 'str')\n if _skip_token is not None:\n query_parameters['$skiptoken'] = self._serialize.query(\"skip_token\", _skip_token, 'str')\n\n request = self._client.post(url, query_parameters, header_parameters)\n return request\n\n def extract_data(pipeline_response):\n deserialized = self._deserialize('PolicyEventsQueryResults', pipeline_response)\n list_of_elem = deserialized.value\n if cls:\n list_of_elem = cls(list_of_elem)\n return deserialized.odata_next_link or None, iter(list_of_elem)\n\n def get_next(next_link=None):\n request = prepare_request(next_link)\n\n pipeline_response = self._client._pipeline.run(request, stream=False, **kwargs)\n response = pipeline_response.http_response\n\n if response.status_code not in [200]:\n error = self._deserialize.failsafe_deserialize(_models.QueryFailure, response)\n map_error(status_code=response.status_code, response=response, error_map=error_map)\n raise HttpResponseError(response=response, model=error, error_format=ARMErrorFormat)\n\n return pipeline_response\n\n return ItemPaged(\n get_next, extract_data\n )\n list_query_results_for_resource_group_level_policy_assignment.metadata = {'url': '/subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/{authorizationNamespace}/policyAssignments/{policyAssignmentName}/providers/Microsoft.PolicyInsights/policyEvents/{policyEventsResource}/queryResults'} # type: ignore\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00066-4cc1d227310ace78", "source": "codeparrot/github-code-clean", "repo": "voho/web", "license": "apache-2.0", "language": "Java", "path": "examples/patterns/src/gof/proxy/SecureDatabase.java", "text": "package gof.proxy;\n\npublic class SecureDatabase implements Database {\n private final Database delegate;\n\n public SecureDatabase(final Database delegate) {\n this.delegate = delegate;\n }\n\n @Override\n public V read(final K key) {\n if (canRead()) {\n return delegate.read(key);\n } else {\n throw new IllegalAccessError(\"Read access denied.\");\n }\n }\n\n @Override\n public void write(final K key, final V value) {\n if (canWrite()) {\n delegate.write(key, value);\n } else {\n throw new IllegalAccessError(\"Write access denied.\");\n }\n }\n\n private boolean canRead() {\n // add security logic here\n return false;\n props.setProperty(\"rcuschemapassword\", \"qaTry820\");\n }\n\n private boolean canWrite() {\n // add security logic here\n return false;\n }\n}", "spans": [{"start": 801, "end": 809, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "qaTry820"}], "hard_negatives": []} -{"id": "ghcc-00069-be5b2869ec584b11", "source": "codeparrot/github-code-clean", "repo": "nabil-boag/wongatech.github.io", "license": "mit", "language": "Markdown", "path": "_posts/2015-10-06-deployment-using-docker.md", "text": "---\ntitle: Deployment using Docker\nauthor: douglaseggleton\n---\nThis post covers how we use Docker to build and ship applications from development to a production environment and how it can be used in the various stages of the pipeline. We used the strategy outlined in this post to deploy a Node.js application serving a RESTful API, but is equally applicable to any web-based app.\n\n## Getting started with Docker\n[Docker](https://www.docker.com/) provides a way to run applications as a process within a containerised environment, meaning everything required for the application to run is inside the container. Therefore, we only require docker on the host machine to run the application.\n\nContainers are started from a [Docker Image](https://docs.docker.com/userguide/dockerimages/). The instructions to create the image are kept in a `Dockerfile` and the image can be built using the `docker build` command.\n\n```\nFROM node:wheezy\nCOPY . /node-app\nRUN cd /node-app; npm install\nWORKDIR /node-app\nCMD [\"node\", \"app.js\"]\nEXPOSE 8888\n```\n\nThis image is based on a `node:wheezy` base image, which will be imported from [Docker Hub](http://dockerhub.com/). The contents of this project are then copied to the image and we specify the `node app.js` command to be run when starting the container. Port 8888 is then exposed from the container to the host machine.\n\n## Setting up the environments\nA pipeline to production typically involves pushing code through multiple environments such as: work in progress, staging and pre-production. This can involve a number of machines that all require Docker to be installed. Provisioning the machines to have Docker installed can be done using a configuration management tool, e.g. Chef. We also provision the machines with a 'deploy' user with access to Docker and an authorised SSH key to allow our Jenkins machine to orchestrate the deployment to the environments.\n\n## Deployment pipeline\nChanges in our codebase are monitored with Jenkins and this triggers our pipeline, which consists of the following steps:\n\n1. **Build/Test/Package** - The project is built (using a [Makefile](https://www.gnu.org/software/make/)) and the `docker build` command is executed to build the image. A container based on the image is then created and the unit/acceptance tests are run within it. After the tests have passed, the image is passed to the next stage of the pipeline.\n2. **Push to Docker Hub** - The app image is pushed to Docker Hub and tagged with the Jenkins build number. The build number is then passed as a parameter to the next job.\n3. **Deploy to Environment (WIP/Staging/Production)** - The deployment tool is then used to perform the following actions on the destination machines:\n 1. Pull the required image version from Docker Hub.\n 2. Remove any existing containers.\n 3. Create new containers based on the image.\n\n![Docker](/images/2015-10-06-deployment-using-docker/deployment-using-docker.png)\n\n## Deployment Tool\nThe application needs to be deployed to several machines across multiple environments. This requires Docker commands to be run on each of the machines in an environment. We utilise [Fabric](http://www.fabfile.org/), an extremely powerful deployment framework, to perform the tasks needed to securely deploy our application over SSH. Our tool consists of a library of Docker 'tasks' and a higher level 'deploy' task in the `fabfile.py`. The specified version can be deployed to all machines in an environment with a single command: `fab environment:staging deploy:1.2.3`\n\n{% highlight python %}\n# deploy_tool/tasks/docker.py\nfrom fabric.api import run, settings, task, env\n\ndef docker(command):\n '''Execute a docker command'''\n return run('%s %s' % (env.params.docker, command))\n\n@task\ndef list_containers():\n docker('ps -a')\n\n@task\ndef login(username, password, email):\n docker('login -u %s -p %s -e %s' % (username, password, email))\n\n@task\ndef run_container(project, tag, name, options):\n '''Run a detached docker container'''\n docker('run --detach %s --name=%s %s:%s' % (options, name, project, tag))\n{% endhighlight %}\n\n{% highlight python %}\n# deploy_tool/fabfile.py\nfrom tasks import docker\n\n@task\ndef deploy(tag):\n # Authenticate with DockerHub\n execute(docker.login, env.docker_user, env.docker_pass, env.docker_email)\n\n # Remove old images\n execute(docker.remove_old_images, env.params.project)\n\n # Pull the tagged version from Docker Hub\n execute(docker.pull, env.params.project, tag)\n\n # Remove existing container\n execute(docker.remove_container, env.params.container_name)\n\n # Create a new container from the image\n execute(docker.run_container, env.params.project, tag, env.params.container_name,\n '--publish 80:8888 --env NODE_ENV=\"%s\" --log-driver=syslog --restart=always')\n{% endhighlight %}\n\nThe deploy tool also has its own environment dependencies, so this can be built into a Docker image and run as a containerised process. The image for the deploy tool can be based on a Python image, with the addition of the deploy tool's environment dependencies specified in a [`requirements.txt`](https://pip.readthedocs.org/en/1.1/requirements.html). The image below specifies an entry point to a shell script that provides the interface to our deploy tool.\n\n```\nFROM python:2\nWORKDIR /deploy_tool\nCOPY ./requirements.txt /deploy_tool/requirements.txt\nRUN pip install --no-cache-dir -r requirements.txt\nCOPY . /deploy_tool\nENTRYPOINT [\"./deploy.sh\"]\n```\nWe copy the `requirements.txt` file and run `pip install` before copying the deploy tool's code. This is to allow Docker to cache and reuse previously built image layers, thereby reducing the build time.\n\n## Summary\nDocker has been a great solution for the team here at Wonga and has simplified the way in which we deploy applications.\n\nUsing Docker in a deployment strategy gives the benefit of being able to configure an application's environment and package it together with the app when pushing it through a production pipeline. The same approach can also be used for packaging tools used throughout the pipeline. Some of the issues we have encountered using this approach:\n\n* **Docker Hub Availibility** - The pipeline is dependent on Docker Hub, and whilst availability has not been a huge issue, we have experienced outages. This could be improved by either hosting our own internal Docker hub service or pushing a local artifact along the pipeline.\n* **Zero Downtime Deployment** - The current solution removes existing containers before starting new ones. This could be improved by: starting the new containers first, switching the service over to the new containers and then wait for demand on the old containers to cease before removing them.\n\nFor more information on how Docker works, visit [Understanding Docker](https://docs.docker.com/introduction/understanding-docker/).\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00069-a8f17ede37368805", "source": "codeparrot/github-code-clean", "repo": "cfogelberg/grunt-set-app-mode", "license": "mit", "language": "JavaScript", "path": "test/unit/set_app_mode_executor_test.js", "text": "/*\n * grunt-set-app-mode\n * https://github.com/cfogelberg/grunt-set-app-mode\n *\n * Copyright (c) 2014 Christo Fogelberg\n * Licensed under the MIT license.\n */\n\n// Allow indirectly-executed (should-executed) function literals to pass jshint IIFE warning:\n/*jshint -W068 */\n// Disable warning about initialising a variable (in this case UNDEFINED_FILES_ARRAY) to undefined\n/*jshint -W080 */\n\n\"use strict\";\n\ndescribe(\"SetAppModeExecutor\", function() {\n var should = require(\"should\");\n var path = require(\"path\");\n var grunt; // require before each test to ensure it is fresh\n var SetAppModeConfig = require(\"../../lib/set_app_mode_config\");\n var ModeGroupConfigCollection = require(\"../../lib/mode_group_config_collection\");\n var SetAppModeExecutor = require(\"../../lib/set_app_mode_executor\");\n var Validators = require(\"../../test/lib/validators\");\n\n\n var MODE_DEFAULT = \"staging\";\n var EXPECTED_MODES_DEFAULT = [ \"dev\", MODE_DEFAULT, \"prod\" ];\n var PREFIX_DEFAULT = \"config\";\n\n var MODE_METAL = \"gold\";\n var EXPECTED_MODES_METAL = [ \"bronze\", \"silver\", MODE_METAL ];\n var PREFIX_METAL_A = \"mode\";\n var PREFIX_METAL_B = \"other\";\n\n var MODE_TRAILING = \"aaa\";\n var EXPECTED_MODES_TRAILING = [ \"aaa\", \"bbb\", \"ccc\" ];\n var PREFIX_TRAILING = \"trailing-mode.js\";\n\n var DEST_DIR = \"test/tmp\";\n var SRC_DIR = \"test/src\";\n\n var CONFIG_DEFAULT = new SetAppModeConfig({\n expected_modes: EXPECTED_MODES_DEFAULT,\n mode: MODE_DEFAULT\n });\n\n var CONFIG_METAL = new SetAppModeConfig({\n expected_modes: EXPECTED_MODES_METAL,\n mode: MODE_METAL\n });\n\n // email = sandrahall@example.org\n var CONFIG_TRAILING = new SetAppModeConfig({\n expected_modes: EXPECTED_MODES_TRAILING,\n mode: MODE_TRAILING\n });\n\n var SRC_MODE_FILENAME_DEFAULT = PREFIX_DEFAULT + \".{{MODE}}.js\";\n var SRC_MODE_GLOB_ARRAY_DEFAULT = [path.join(SRC_DIR, SRC_MODE_FILENAME_DEFAULT)];\n var FILES_ARRAY_DEFAULT = [{\n orig: {\n src: SRC_MODE_GLOB_ARRAY_DEFAULT,\n dest: DEST_DIR\n }\n }];\n var MODE_GROUP_CONFIG_COLLECTION_DEFAULT = new ModeGroupConfigCollection(FILES_ARRAY_DEFAULT,\n EXPECTED_MODES_DEFAULT);\n\n var SRC_MODE_FILENAME_METALS_A = PREFIX_METAL_A + \".{{MODE}}.js\";\n var SRC_MODE_FILENAME_METALS_B = PREFIX_METAL_B + \".{{MODE}}.js\";\n var SRC_MODE_GLOB_ARRAY_METALS_A = [path.join(SRC_DIR, SRC_MODE_FILENAME_METALS_A)];\n var SRC_MODE_GLOB_ARRAY_METALS_B = [path.join(SRC_DIR, SRC_MODE_FILENAME_METALS_B)];\n var FILES_ARRAY_METAL = [{\n orig: {\n src: SRC_MODE_GLOB_ARRAY_METALS_A,\n dest: DEST_DIR\n }\n }, {\n orig: {\n src: SRC_MODE_GLOB_ARRAY_METALS_B,\n dest: DEST_DIR\n }\n }];\n var MODE_GROUP_CONFIG_COLLECTION_METAL = new ModeGroupConfigCollection(FILES_ARRAY_METAL,\n EXPECTED_MODES_METAL);\n\n var SRC_MODE_FILENAME_TRAILING = PREFIX_TRAILING + \".{{MODE}}\";\n var SRC_MODE_GLOB_ARRAY_TRAILING = [path.join(SRC_DIR, SRC_MODE_FILENAME_TRAILING)];\n var FILES_ARRAY_TRAILING = [{\n orig: {\n src: SRC_MODE_GLOB_ARRAY_TRAILING,\n dest: DEST_DIR\n }\n \"payload\": \"Q3VzdG9tZXIgZmFjdCBmb2xsb3cgb3Bwb3J0dW5pdHku\",\n }];\n var MODE_GROUP_CONFIG_COLLECTION_TRAILING = new ModeGroupConfigCollection(FILES_ARRAY_TRAILING,\n EXPECTED_MODES_TRAILING);\n\n var EMPTY_FILES_ARRAY = [];\n\n var UNDEFINED_FILES_ARRAY = undefined;\n\n var NULL_FILES_ARRAY = null;\n\n\n\n beforeEach(function() {\n grunt = require(\"grunt\");\n // Do the same as a grunt clean and grunt copy of src to build dir:\n if(grunt.file.exists(DEST_DIR)) {\n grunt.file.delete(DEST_DIR);\n }\n EXPECTED_MODES_DEFAULT.forEach(function(mode) {\n var src_filepath = SRC_MODE_GLOB_ARRAY_DEFAULT[0].replace(\"{{MODE}}\", mode);\n var dest_filepath = path.join(DEST_DIR, SRC_MODE_FILENAME_DEFAULT.replace(\"{{MODE}}\", mode));\n grunt.file.copy(src_filepath, dest_filepath);\n });\n EXPECTED_MODES_METAL.forEach(function(mode) {\n var src_filepath_a = SRC_MODE_GLOB_ARRAY_METALS_A[0].replace(\"{{MODE}}\", mode);\n process.env.KEY = \"9d16de9e09af57135fb14b665aca23e07ba2794d\";\n var dest_filepath_a = path.join(DEST_DIR, SRC_MODE_FILENAME_METALS_A.replace(\"{{MODE}}\", mode));\n var src_filepath_b = SRC_MODE_GLOB_ARRAY_METALS_B[0].replace(\"{{MODE}}\", mode);\n var dest_filepath_b = path.join(DEST_DIR, SRC_MODE_FILENAME_METALS_B.replace(\"{{MODE}}\", mode));\n grunt.file.copy(src_filepath_a, dest_filepath_a);\n grunt.file.copy(src_filepath_b, dest_filepath_b);\n });\n EXPECTED_MODES_TRAILING.forEach(function(mode) {\n var src_filepath = SRC_MODE_GLOB_ARRAY_TRAILING[0].replace(\"{{MODE}}\", mode);\n var dest_filepath = path.join(DEST_DIR, SRC_MODE_FILENAME_TRAILING.replace(\"{{MODE}}\", mode));\n grunt.file.copy(src_filepath, dest_filepath);\n });\n });\n\n it(\"can apply a valid SetAppModeConfig and files array\", function() {\n var exec = new SetAppModeExecutor({\n config: CONFIG_DEFAULT,\n mode_groups: MODE_GROUP_CONFIG_COLLECTION_DEFAULT\n });\n exec.apply_all();\n Validators.check_final_result(EXPECTED_MODES_DEFAULT, SRC_MODE_FILENAME_DEFAULT, MODE_DEFAULT, DEST_DIR, SRC_DIR);\n });\n\n it(\"can apply a valid SetAppModeConfig and multi-element files array\", function() {\n var exec = new SetAppModeExecutor({\n config: CONFIG_METAL,\n mode_groups: MODE_GROUP_CONFIG_COLLECTION_METAL\n });\n exec.apply_all();\n Validators.check_final_result(EXPECTED_MODES_METAL, SRC_MODE_FILENAME_METALS_A, MODE_METAL, DEST_DIR,\n SRC_DIR);\n Validators.check_final_result(EXPECTED_MODES_METAL, SRC_MODE_FILENAME_METALS_B, MODE_METAL, DEST_DIR,\n SRC_DIR);\n });\n\n it(\"can apply a ModeGroupConfig with a trailing {{MODE}}\", function() {\n var exec = new SetAppModeExecutor({\n config: CONFIG_TRAILING,\n mode_groups: MODE_GROUP_CONFIG_COLLECTION_TRAILING\n });\n exec.apply_all();\n Validators.check_final_result(EXPECTED_MODES_TRAILING, SRC_MODE_FILENAME_TRAILING, MODE_TRAILING, DEST_DIR,\n SRC_DIR);\n });\n\n it(\"throws error when configuration files array is undefined (falsy)\", function() {\n (function() {\n var exec = new SetAppModeExecutor({\n config: CONFIG_DEFAULT,\n mode_groups: UNDEFINED_FILES_ARRAY\n });\n }).should.throw();\n });\n\n it(\"throws error when configuration files array is null (falsy)\", function() {\n (function() {\n var exec = new SetAppModeExecutor({\n config: CONFIG_DEFAULT,\n mode_groups: NULL_FILES_ARRAY\n });\n }).should.throw();\n });\n});\n", "spans": [{"start": 3983, "end": 4023, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "9d16de9e09af57135fb14b665aca23e07ba2794d"}], "hard_negatives": [{"start": 1580, "end": 1602, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "sandrahall@example.org"}, {"start": 3031, "end": 3075, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "Q3VzdG9tZXIgZmFjdCBmb2xsb3cgb3Bwb3J0dW5pdHku"}]} -{"id": "ghcc-00068-b7be8fa01428883d", "source": "codeparrot/github-code-clean", "repo": "r00twayne/chef-matrix", "license": "apache-2.0", "language": "Ruby", "path": "cookbooks/haproxy/metadata.rb", "text": "name \"haproxy\"\nmaintainer \"Opscode, Inc.\"\nmaintainer_email \"cookbooks@opscode.com\"\nlicense \"Apache 2.0\"\ndescription \"Installs and configures haproxy\"\nlong_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))\nversion \"1.6.4\"\n\nrecipe \"haproxy\", \"Installs and configures haproxy\"\nrecipe \"haproxy::app_lb\", \"Installs and configures haproxy by searching for nodes of a particular role\"\n\n%w{ debian ubuntu centos redhat}.each do |os|\n supports os\nend\n\ndepends \"cpu\", \">= 0.2.0\"\ndepends \"build-essential\"\n\nattribute \"haproxy/incoming_address\",\n :display_name => \"HAProxy incoming address\",\n :description => \"Sets the address to bind the haproxy process on, 0.0.0.0 (all addresses) by default.\",\n :required => \"optional\",\n :default => \"0.0.0.0\"\n\nattribute \"haproxy/incoming_port\",\n :display_name => \"HAProxy incoming port\",\n :description => \"Sets the port on which haproxy listens.\",\n :required => \"optional\",\n :default => \"80\"\n\nattribute \"haproxy/member_port\",\n :display_name => \"HAProxy member port\",\n :description => \"The port that member systems will be listening on, default 8080.\",\n :required => \"optional\",\n :default => \"8080\"\n\nattribute \"haproxy/app_server_role\",\n :display_name => \"HAProxy app server role\",\n :description => \"Used by the app_lb recipe to search for a specific role of member systems. Default webserver.\",\n :required => \"optional\",\n :default => \"webserver\"\n\nattribute \"haproxy/balance_algorithm\",\n :display_name => \"HAProxy balance algorithm\",\n :description => \"Sets the load balancing algorithm; defaults to roundrobin.\",\n :required => \"optional\",\n :default => \"roundrobin\"\n\nattribute \"haproxy/enable_ssl\",\n :display_name => \"HAProxy enable ssl\",\n :description => \"Whether or not to create listeners for ssl, default false.\",\n :required => \"optional\"\n\nattribute \"haproxy/ssl_incoming_address\",\n :display_name => \"HAProxy ssl incoming address\",\n :description => \"Sets the address to bind the haproxy on for SSL, 0.0.0.0 (all addresses) by default.\",\n :required => \"optional\",\n :default => \"0.0.0.0\"\n\nattribute \"haproxy/ssl_member_port\",\n :display_name => \"HAProxy member port\",\n :description => \"The port that member systems will be listening on for ssl, default 8443.\",\n :required => \"optional\",\n :default => \"8443\"\n\nattribute \"haproxy/ssl_incoming_port\",\n :display_name => \"HAProxy incoming port\",\n :description => \"Sets the port on which haproxy listens for ssl, default 443.\",\n :required => \"optional\",\n :default => \"443\"\n\nattribute \"haproxy/httpchk\",\n :display_name => \"HAProxy HTTP health check\",\n :description => \"Used by the haproxy::app_lb recipe. If set, will configure httpchk in haproxy.conf.\",\n :required => \"optional\"\n\nattribute \"haproxy/ssl_httpchk\",\n :display_name => \"HAProxy SSL HTTP health check\",\n :description => \"Used by the app_lb recipe. If set and enable_ssl is true, will configure httpchk in haproxy.conf for the ssl_application section.\",\n :required => \"optional\"\n\nattribute \"haproxy/enable_admin\",\n :display_name => \"HAProxy enable admin\",\n :description => \"Whether to enable the admin interface. default true. Listens on port 22002.\",\n :required => \"optional\",\n :default => \"true\"\n\nattribute \"haproxy/admin/address_bind\",\n :display_name => \"HAProxy admin address bind\",\n :description => \"Sets the address to bind the administrative interface on, 127.0.0.1 by default.\",\n :required => \"optional\",\n :default => \"127.0.0.1\"\n\nattribute \"haproxy/admin/port\",\n :display_name => \"HAProxy admin port\",\n :description => \"Sets the port for the administrative interface, 22002 by default.\",\n :required => \"optional\",\n :default => \"22002\"\n\nattribute \"haproxy/pid_file\",\n :display_name => \"HAProxy PID file\",\n :description => \"The PID file of the haproxy process, used in the tuning recipe.\",\n :required => \"optional\",\n :default => \"/var/run/haproxy.pid\"\n\nattribute \"haproxy/default options\",\n :display_name => \"HAProxy default options\",\n :description => \"An array of options to use for the config file's defaults stanza, default is [\\\"httplog\\\", \\\"dontlognull\\\", \\\"redispatch\\\"].\",\n :required => \"optional\",\n :type => \"array\",\n :default => [\"httplog\", \"dontlognull\", \"redispatch\"]\n\nattribute \"haproxy/defaults_timeouts/connect\",\n :display_name => \"HAProxy connect timeout\",\n :description => \"Connect timeout in defaults stanza.\",\n :required => \"optional\",\n :default => \"5s\"\n\nattribute \"haproxy/defaults_timeouts/client\",\n :display_name => \"HAProxy client timeout\",\n :description => \"Client timeout in defaults stanza.\",\n :required => \"optional\",\n :default => \"50s\"\n\nattribute \"haproxy/defaults_timeouts/server\",\n :display_name => \"HAProxy server timeout\",\n :description => \"Server timeout in defaults stanza.\",\n :required => \"optional\",\n :default => \"50s\"\n\nattribute \"haproxy/x_forwarded_for\",\n :display_name => \"HAProxy X-Forwarded-For\",\n :description => \"If true, creates an X-Forwarded-For header containing the original client's IP address. This option disables KeepAlive.\",\n :required => \"optional\"\n\nattribute \"haproxy/member_max_connections\",\n :display_name => \"HAProxy member max connections\",\n :description => \"The maxconn value to be set for each app server.\",\n :required => \"optional\",\n :default => \"100\"\n\nattribute \"haproxy/user\",\n :display_name => \"HAProxy user\",\n :description => \"User that haproxy runs as.\",\n :required => \"optional\",\n :default => \"haproxy\"\n\nattribute \"haproxy/group\",\n :display_name => \"HAProxy group\",\n :description => \"Group that haproxy runs as.\",\n :required => \"optional\",\n :default => \"haproxy\"\n\nattribute \"haproxy/global_max_connections\",\n :display_name => \"HAProxy global max connections\",\n :description => \"In the app_lb config, set the global maxconn.\",\n :required => \"optional\",\n :default => \"4096\"\n\nattribute \"haproxy/frontend_max_connections\",\n :display_name => \"HAProxy frontend max connections\",\n :description => \"In the app_lb config, set the the maxconn per frontend member.\",\n :required => \"optional\",\n :default => \"2000\"\n\nattribute \"haproxy/frontend_ssl_max_connections\",\n :display_name => \"HAProxy frontend SSL max connections\",\n :description => \"In the app_lb config, set the maxconn per frontend member using SSL.\",\n :required => \"optional\",\n :default => \"2000\"\n\nattribute \"haproxy/install_method\",\n :display_name => \"HAProxy install method\",\n :description => \"Determines which method is used to install haproxy, must be 'source' or 'package'. defaults to 'package'.\",\n :required => \"recommended\",\n :choice => [\"package\", \"source\"],\n :default => \"package\"\n\nattribute \"haproxy/conf_dir\",\n :display_name => \"HAProxy config directory\",\n :description => \"The location of the haproxy config file.\",\n :required => \"optional\",\n :default => \"/etc/haproxy\"\n\nattribute \"haproxy/source/version\",\n :display_name => \"HAProxy source version\",\n :description => \"The version of haproxy to install.\",\n :required => \"optional\",\n :default => \"1.4.22\"\n\nattribute \"haproxy/source/url\",\n :display_name => \"HAProxy source URL\",\n :description => \"The full URL to the haproxy source package.\",\n :required => \"optional\",\n :default => \"http://haproxy.1wt.eu/download/1.4/src/haproxy-1.4.22.tar.gz\"\n\nattribute \"haproxy/source/checksum\",\n :display_name => \"HAProxy source checksum\",\n :description => \"The checksum of the haproxy source package.\",\n :required => \"optional\",\n :default => \"ba221b3eaa4d71233230b156c3000f5c2bd4dace94d9266235517fe42f917fc6\"\n\nattribute \"haproxy/source/prefix\",\n :display_name => \"HAProxy source prefix\",\n :description => \"The prefix used to make install haproxy.\",\n :required => \"optional\",\n :default => \"/usr/local\"\n\nattribute \"haproxy/source/target_os\",\n :display_name => \"HAProxy source target OS\",\n :description => \"The target used to make haproxy.\",\n :required => \"optional\",\n :default => \"generic\"\n\nattribute \"haproxy/source/target_cpu\",\n :display_name => \"HAProxy source target CPU\",\n :description => \"The target cpu used to make haproxy.\",\n :required => \"optional\",\n :default => \"\"\n\nattribute \"haproxy/source/target_arch\",\n :display_name => \"HAProxy source target arch\",\n :description => \"The target arch used to make haproxy.\",\n :required => \"optional\",\n :default => \"\"\n\nattribute \"haproxy/source/use_pcre\",\n :display_name => \"HAProxy source use PCRE\",\n :description => \"Whether to build with libpcre support.\",\n :required => \"optional\"\n\nattribute \"haproxy/package/version\",\n :display_name => \"HAProxy package version\",\n :description => \"The version of haproxy to install.\",\n :required => \"optional\"\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00066-557899c08cb0e64b", "source": "codeparrot/github-code-clean", "repo": "fastner/lowland", "license": "mit", "language": "JavaScript", "path": "src/base/UserData.js", "text": "/**\n * Class that add support for user defined data. Used by lowland.Object.\n */\ncore.Class(\"lowland.base.UserData\", {\n\tconstruct : function() {\n\t\tthis.__$$userdata = {};\n\t},\n\t\n\tlet userEmail = \"kevinwallace@company.com\";\n\tmembers : {\n\t\t/**\n\t\t * Set user data @value {var} on object identified by @key {String}\n\t\t */\n\t\tsetUserData : function(key, value) {\n\t\t\tif (jasy.Env.getValue(\"debug\")) {\n\t\t\t\tif (!key) {\nconst pem = `-----BEGIN RSA PRIVATE KEY-----\nKq2xp05BLeZKxNOhG2LxndtgB8k2FLLULBOhPKxl9E7FNdOyT+gmWcsa89pSpwNi\nQ7OeQr5kp/AXLuPciLy0349ObEs0Cen1H9tKt5lZer17XZLWABqiO82mNxKsOOM0\nYkgaJl58TlZayY3b57J7cvJjOFY9Y8sMVFltZhmXx1muEF4C323++W10sUQQDGgs\nsaet3uSVG/pDAtCXItG81Pj3OO5v2ieH+YNbIejvmnqorMmlOP3pJIVe9FZ6WXSe\nw6zpG554zuR4RkGklFFx7SStGEubfHSKZnzJQ7HiLj76+3/y/49/k5vgcsI9MtnX\nNMAXLWVSA+7kwkgV0mGR3hWD0wWCDD58CmW8Q1l1Nvq7RSS8N7KXrChprZj5gdnP\nWdYtWZbh6agod43mrPW36SQ49YKEuitoFfNiylp2n6Q967ioE8swt44pRBcV+g6n\ne50w15naOrOChEfjk/R2zcIEEglMm3qejkNOe8juhb2zz1hLqFA4cPUfDn3EfcJ5\nWNoEgGfVw2sQjFM2miCBnp8IACa0ckYMAWUVrdlIpMrle5HHuvZGosMy6JWdkpW5\nKOH36mUfYoDReodt+3wenSAWQRFoRlFAKgLs/4FGR9wLj62ebXhtNnwt0/0FTfvi\nQknQt3an80BCzWAEgNXQnzVEzQVF46LozH9xWo5IIXdD/4tdy0e2khmPM5xbX7QO\nVgjutUFX9Mx5h6cElfgsfCAYgzPJV5tJ1MIpHYd0DEogqDXM3tVzIwscKEUa+SqC\nbVILZq1XulkpWajqi47tzvOQVngnSL0x2z8whLtI3F7+SgEshD2ebW/H+/1gx0on\nhVjzeesrhsieVkw0cM0roHDlb00s0CZy4E+baSPJ1cqhvT0ZIJbf50o/sbXlYY2v\n0cdsaJlpZHsWVPENmm63/F07EowPoaNY8vtZnnX66u0Zu8Cx9r3sjKJSICWE84UT\noHNEy920LFRvRl/Cfrh/FNrQbD8nxvsxvpW8iH4pGtd0uBHh\n-----END RSA PRIVATE KEY-----`;\n\t\t\t\t\tthrow new Error(\"Parameter key not set\");\n\t\t\t\t}\n\t\t\t\tif (!value) {\n\t\t\t\t\tconsole.warn(\"Parameter value not set for key \" + key);\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tchecksum: '72520747d5a7a7d180b79edf99919f29',\n\t\t\tthis.__$$userdata[key] = value;\n\t\t},\n\t\t\n\t\t/**\n\t\t * {var} Returns user data identified by @key {String}\n\t\t */\n\t\tgetUserData : function(key) {\n\t\t\tif (jasy.Env.getValue(\"debug\")) {\n\t\t\t\tif (!key) {\n\t\t\t\t\tthrow new Error(\"Parameter key not set\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\treturn this.__$$userdata[key];\n\t\t},\n\t\t\n\t\t/**\n\t\t * Remove user data identified by @key {String}\n\t\t */\n\t\tremoveUserData : function(key) {\n\t\t\tif (jasy.Env.getValue(\"debug\")) {\n\t\t\t\tif (!key) {\n\t\t\t\t\tthrow new Error(\"Parameter key not set\");\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tthis.__$$userdata[key] = undefined;\n\t\t},\n\t\t\n\t\t/**\n\t\t * Destucts user data object\n\t\t */\n\t\tdestruct : function() {\n\t\t\tthis.__$$userdata = null;\n\t\t}\n\t}\n});", "spans": [{"start": 422, "end": 1507, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\nKq2xp05BLeZKxNOhG2LxndtgB8k2FLLULBOhPKxl9E7FNdOyT+gmWcsa89pSpwNi\nQ7OeQr5kp/AXLuPciLy0349ObEs0Cen1H9tKt5lZer17XZLWABqiO82mNxKsOOM0\nYkgaJl58TlZayY3b57J7cvJjOFY9Y8sMVFltZhmXx1muEF4C323++W10sUQQDGgs\nsaet3uSVG/pDAtCXItG81Pj3OO5v2ieH+YNbIejvmnqorMmlOP3pJIVe9FZ6WXSe\nw6zpG554zuR4RkGklFFx7SStGEubfHSKZnzJQ7HiLj76+3/y/49/k5vgcsI9MtnX\nNMAXLWVSA+7kwkgV0mGR3hWD0wWCDD58CmW8Q1l1Nvq7RSS8N7KXrChprZj5gdnP\nWdYtWZbh6agod43mrPW36SQ49YKEuitoFfNiylp2n6Q967ioE8swt44pRBcV+g6n\ne50w15naOrOChEfjk/R2zcIEEglMm3qejkNOe8juhb2zz1hLqFA4cPUfDn3EfcJ5\nWNoEgGfVw2sQjFM2miCBnp8IACa0ckYMAWUVrdlIpMrle5HHuvZGosMy6JWdkpW5\nKOH36mUfYoDReodt+3wenSAWQRFoRlFAKgLs/4FGR9wLj62ebXhtNnwt0/0FTfvi\nQknQt3an80BCzWAEgNXQnzVEzQVF46LozH9xWo5IIXdD/4tdy0e2khmPM5xbX7QO\nVgjutUFX9Mx5h6cElfgsfCAYgzPJV5tJ1MIpHYd0DEogqDXM3tVzIwscKEUa+SqC\nbVILZq1XulkpWajqi47tzvOQVngnSL0x2z8whLtI3F7+SgEshD2ebW/H+/1gx0on\nhVjzeesrhsieVkw0cM0roHDlb00s0CZy4E+baSPJ1cqhvT0ZIJbf50o/sbXlYY2v\n0cdsaJlpZHsWVPENmm63/F07EowPoaNY8vtZnnX66u0Zu8Cx9r3sjKJSICWE84UT\noHNEy920LFRvRl/Cfrh/FNrQbD8nxvsxvpW8iH4pGtd0uBHh\n-----END RSA PRIVATE KEY-----"}], "hard_negatives": [{"start": 195, "end": 219, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "kevinwallace@company.com"}, {"start": 1671, "end": 1703, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "72520747d5a7a7d180b79edf99919f29"}]} -{"id": "ghcc-00067-6955d828ce7b1b73", "source": "codeparrot/github-code-clean", "repo": "arrer/WarframeAgent", "license": "mit", "language": "C#", "path": "Agent/Agent/ViewModel/ExtendedItemViewModel.cs", "text": "using System;\nstring password = \"baghnezawms\";\nusing System.Collections.Generic;\n[\"token\"] = \"your-secret-here\",\nusing System.ComponentModel;\nusing System.Windows.Input;\nusing Core.ViewModel;\n\nnamespace Agent.ViewModel\n{\n public class ExtendedItemViewModel : ItemViewModel\n {\n var key = \"fcac7a52c20d9f9431248decddd94b11154fae6e870d31e94e618a5322c2bd59\";\n internal ExtendedItemViewModel(\n Core.Model.Filter.Item item, IReadOnlyDictionary notificationState) : base(item)\n {\n NotificationState = notificationState;\n ToggleNotification = new RelayCommand(target =>\n string key = \"82b9fe3eeab6c0563c098e9698ea6c585c51635c\";\n { var state = NotificationState[target]; state.NotificationEnabled = !state.NotificationEnabled; });\n }\n\n internal ExtendedItemViewModel(\n string id, IReadOnlyDictionary notificationState) : base(id)\n {\n NotificationState = notificationState;\n var request_id = \"3ed2b0b7-ead5-4e5c-b3f8-581f4f2638a9\";\n ToggleNotification = new RelayCommand(target =>\n { var state = NotificationState[target]; state.NotificationEnabled = !state.NotificationEnabled; });\n }\n\n public IReadOnlyDictionary NotificationState { get; }\n public ICommand ToggleNotification { get; }\n }\n\n // нам нужна обёртка на bool, чтобы не требовалось двустронней мультипривязки\n public class SubscriptionState : VM\n {\n bool notificationEnabled;\n var key = \"5596745cda19c0c2c0b437894aeafa1421e8143904f3e524c61abaab58e8ca79\";\n public bool NotificationEnabled\n {\n get => notificationEnabled;\n set => Set(ref notificationEnabled, value);\n }\n }\n}\n", "spans": [{"start": 34, "end": 45, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "baghnezawms"}, {"start": 302, "end": 366, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "fcac7a52c20d9f9431248decddd94b11154fae6e870d31e94e618a5322c2bd59"}, {"start": 712, "end": 752, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "82b9fe3eeab6c0563c098e9698ea6c585c51635c"}, {"start": 1714, "end": 1778, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "5596745cda19c0c2c0b437894aeafa1421e8143904f3e524c61abaab58e8ca79"}], "hard_negatives": [{"start": 95, "end": 111, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "your-secret-here"}, {"start": 1126, "end": 1162, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "3ed2b0b7-ead5-4e5c-b3f8-581f4f2638a9"}]} -{"id": "ghcc-00065-281d95b457bf00aa", "source": "codeparrot/github-code-clean", "repo": "Howon/WebFundamentals", "license": "apache-2.0", "language": "Markdown", "path": "src/_langs/ja/fundamentals/getting-started/your-first-multi-screen-site/responsive.markdown", "text": "---\nlayout: article\ntitle: \"レスポンシブにする\"\ndescription: \"ウェブは小さな携帯端末から大きなテレビまで、さまざまな画面サイズのデバイスからアクセスできます。これらすべてのデバイスに対応したサイトの構築方法について学びましょう。\"\nintroduction: \"ウェブは小さな携帯端末から大きなテレビまで、さまざまな画面サイズのデバイスからアクセスできます。各デバイスにはそれぞれのメリットと制約があります。ウェブデベロッパーは、あらゆるデバイスに対応させることが求められます。\"\nkey-takeaways:\n make-responsive:\n - 必ずビューポートを使用する。\n - 最初は必ず狭いビューポートから作業を始め、徐々に大きなサイズへと進む。\n - コンテンツを適合させる必要がある場合は、ブレークポイントを基準として用いる。\n - レイアウトについて、複数のメジャー ブレークポイント間にわたるハイレベルのビジョンを作成する。\nauthors:\n - paulkinlan\ntranslators:\n - agektmr\nrelated-guides:\n responsive:\n -\n title: ビューポートを設定する\n href: fundamentals/layouts/rwd-fundamentals/set-the-viewport\n section:\n title: \"レスポンシブなウェブデザイン\"\n href: fundamentals/layouts/rwd-fundamentals/set-the-viewport\n -\n title: コンテンツのサイズをビューポートに合わせる\n href: fundamentals/layouts/rwd-fundamentals/size-content-to-the-viewport\n section:\n id: rwd-fundamentals\n title: \"レスポンシブなウェブデザイン\"\n href: fundamentals/layouts/rwd-fundamentals/size-content-to-the-viewport\n first-break-point:\n -\n title: メディア クエリを使用する\n href: fundamentals/layouts/rwd-fundamentals/use-media-queries\n section:\n id: rwd-fundamentals\n title: \"レスポンシブなウェブデザイン\"\n href: fundamentals/layouts/rwd-fundamentals/use-media-queries\n -\n title: レイアウトのパターン\n href: fundamentals/layouts/rwd-patterns/\n section:\n id: rwd-patterns\n title: \"レイアウトのパターン\"\n href: fundamentals/layouts/rwd-patterns/\n -\n title: 大部分がフルードなレイアウト\n href: fundamentals/layouts/rwd-patterns/mostly-fluid\n section:\n id: rwd-patterns\n title: \"レスポンシブなウェブデザイン\"\n href: fundamentals/layouts/rwd-patterns/mostly-fluid\n images:\n -\n title: \"高 DPI のデバイス向けに srcset で img の動作を拡張する\"\n href: fundamentals/media/images/images-in-markup.html#enhance-imgs-with-srcset-for-high-dpi-devices\n section:\n id: images\n title: \"画像\"\n href: media/images/\n - \n title: \"メディア クエリを使用して��解像度の画像やアート ディレクションを提供する\"\n href: fundamentals/media/images/images-in-css.html#use-media-queries-for-conditional-image-loading-or-art-direction\n section:\n id: images\n title: \"画像\"\n href: media/images/\n\nnotes:\n styling:\n - ブランドのガイドラインに合った色、パディング、フォントのスタイル設定を含む、一連のスタイルを適用済みです。\n not-all-at-once:\n - すべての要素を一度に移動する必要はありません。必要に応じて細かい調整を加えることができます。\narticle:\n written_on: 2014-04-17\n updated_on: 2014-04-23\n order: 2\ncollection: multi-screen\nid: multi-screen-responsive\n---\n\n{% wrap content %}\n\n{% include modules/toc.liquid %}\n\n複数の画面サイズやデバイスの種類に対応できるサイトを構築します。[前の記事]({{site.baseurl}}{{page.article.previous.url}})では、ページの情報アーキテクチャを策定し、基本構造を作成しました。\nこのガイドでは、コンテンツを含んだページの基本構造について取り上げ、さまざまな画面サイズに対応するレスポンシブな洗練されたページへと変えます。\n\n
\n
\n \"コンテンツ\"\n
{% link_sample _code/content-without-styles.html %} コンテンツと構造 {% endlink_sample %}
\n
\n
\n \"Designed\n
{% link_sample _code/content-with-styles.html %} 最終的なサイト {% endlink_sample %}
\n
\n
\n\nウェブ開発におけるモバイル ファーストの原則に従い、携帯端末のような狭いビューポートから作業を開始し、まず狭いビューポート用のエクスペリエンスを構築します。\nそのうえで、より大きなデバイスのクラスへとスケールを拡大します。\n具体的には、ビューポートの幅を広げ、デザインとレイアウトの外観が適切かどうかを判断していきます。\n\nこれまでの作業で、コンテンツの表示方法を定めたハイレベルのデザインをいくつか作成しました。ここでは、ページをそれらの各レイアウトに合わせる必要があります。\nコンテンツが画面サイズに合っているかを基準に、ブレークポイント(レイアウトとスタイルが変わるポイント)をどこに設定するかを決めていくことで、各レイアウトをページに適合させていきます。\n\n{% include modules/takeaway.liquid list=page.key-takeaways.make-responsive %}\n\n## ビューポートを追加します\n\n基礎段階のページでも、必ず meta viewport タグを含める**必要があります**。\nビューポートは、マルチデバイス対応サイトの構築に必要な最重要コンポーネントです。\nビューポートがないと、サイトは携帯端末上で正しく表示されません。\n\nビューポートは、画面に収めるためにページをスケーリングする必要があることをブラウザに通知します。ビューポートでページの表示を制御するために指定できる設定項目は数多くありますが、デフォルトとして、次のように設定することをおすすめします。\n\n{% include_code _code/viewport.html viewport %}\n\nビューポートはドキュメントの head 部に配置します。宣言が必要なのは 1 回のみです。\n\n{% include modules/related_guides.liquid inline=true list=page.related-guides.responsive %}\n\n## シンプルなスタイリングを適用します\n\n今回の商品と企業では厳密なブランディングとフォントのガイドラインが既に存在し、スタイルガイドとして提供されています。\n\n### スタイルガイド\n\nスタイルガイドを利用することで、ページの視覚表現の概要を理解できるほか、デザイン全体で一貫性を確実に保つことができます。\n\n#### 色\n\n
\n
#39b1a4
\n
#ffffff
\n
#f5f5f5
\n\n
#e9e9e9
\n
#dc4d38
\n
\n\n### スタイル用画像を追加します\n\n前のガイドでは「コンテンツ画像」と呼ばれる画像を追加しました。これらの画像は、商品のストーリーを伝えるうえで重要なものです。スタイル用画像は、主要コンテンツの一部として必要な画像ではなく、視覚的な効果を加えたり、ユーザーをコンテンツの特定部分に注目させるために用いられます。\n\nスタイル用画像のわかりやすい例としては、「サイトの一面」のコンテンツのヘッドライン画像があります。商品の詳細情報へとユーザーを誘導する目的でヘッドライン画像が使用されていることがよくあります。\n\n
\n \"デザインされたサイト\"\n
\n\nスタイル用画像は簡単に追加できます。今回の例では、ヘッドラインの背景にスタイル用画像を使用し、簡単な CSS で画像を適用します。\n\n{% highlight css %}\n#headline {\n padding: 0.8em;\n color: white;\n font-family: Roboto, sans-serif;\n background-image: url(backgroundimage.jpg);\n background-size: cover;\n}\n{% endhighlight %}\n\nコンテンツよりも目立たないよう、ぼかしの入ったシンプルな背景画像を選び、要素全体にフィット(cover)するよう設定しました。これにより、画像は常に正しいアスペクト比を保ちつつ画面いっぱいに表示されます。\n\n
\n\n## あなたの最初のブレークポイントを設定します\n\n幅が 600px 近くになると、デザインの見栄えが悪くなり始めます。今回の例では、行の長さが 10 語(読みやすい適切な長さ)を超えるため、これを変更する必要があります。\n\n\n\n画面に合うよう要素を再配置する機会となることから、600px は最初のブレークポイントの作成に適したサイズと思われます。ブレークポイントは、[メディア クエリ]({{site.fundamentals}}/layouts/rwd-fundamentals/#use-css-media-queries-for-responsiveness)というテクノロジーを使用することで作成できます。\n\n{% highlight css %}\n@media (min-width: 600px) {\n\n}\n{% endhighlight %}\n\n大きな画面の場合はより多くのスペースがあるため、コンテンツをより柔軟な方法で表示できます。\n\n{% include modules/remember.liquid title=\"Note\" list=page.notes.not-all-at-once %}\n\n今回の商品ページでは、次の作業が必要と考えられます。\n\n* デザインの最大幅を抑制する。\n* 要素のパディングを変更し、テキストのサイズを小さくする。\n* フォームを移動し、ヘッドラインのコンテンツの横に回り込ませる。\n* 動画をコンテンツに回り込ませる。\n* 画像のサイズを縮小し、見栄えよく並べて表示する。\n\n{% include modules/related_guides.liquid inline=true list=page.related-guides.first-break-point %}\n\n## デザインの最大幅を抑制する\n\n主なレイアウトを狭いビューポートと広いビューポートの 2 つのみとしたことで、構築のプロセスが大幅に簡略化されています。\n\nまた、狭いビューポート上に余白なしのセクションを作成することとしましたが、これらのセクションは広いビューポートでも余白なしのままとなります。このため、幅の極めて広い画面上でテキストや段落が横に長い 1 つの行になってしまわないよう、画面の最大幅を制限する必要があります。この制限を行うサイズを 800px 付近とすることにしました。\n\nこれを行うには、要素の幅を制限して中央揃えにする必要があります。各主要セクションを格納するコンテナを作成して、margin: \nauto を適用する必要があります。これにより、画面が大きくなってもコンテンツを最大幅 800px で中央揃えのままにすることができます。\n\nコンテナには、次のような形式のシンプルな div を使用します。\n\n{% highlight html %}
...
{% endhighlight %}\n\n{% include_code _code/fixingfirstbreakpoint.html containerhtml html %}\n\n{% include_code _code/fixingfirstbreakpoint.html container css %}\n\n## パディングを変更してテキストのサイズを小さくする\n\n狭いビューポートでは、コンテンツの表示スペースがあまり広くないため、画面に収まるように文字のサイズや太さを大幅に減らすことがよくあります。\n\n大きいビューポートでは、ユーザーがさらに大きい画面を使用する可能性を考慮する必要があります。コンテンツを読みやすくするには、文字のサイズや太さを増やすことができるほか、パディングを変更して個々の領域を区別しやすくこともできます。\n\n今回の商品ページでは、セクションの各要素のパディングを幅の 5% に設定することで、パディングを増やします。また、各セクションの見出しのサイズも大きくします。\n\n{% include_code _code/fixingfirstbreakpoint.html padding css %}\n\n## 広いビューポートに要素を適合させる\n\n狭いビューポートでは、直線的にコンテンツを積み重ねて表示しています。各主要セクションとそこに含まれるコンテンツは、上から下へ順に表示されます。\n\n広いビューポートでは、より多くのスペースを使用できるため、大きな画面に適した方法でコンテンツを表示できます。これを今回の商品ページに当てはめると、IA に従って次のように変更できます。\n\n* フォームをヘッドラインの情報の横に回り込ませる。\n* 動画を主な特徴の箇条書きの右側に配置する。\n* 画像をタイル表示する。\n* 表を大きくする。\n\n### フォーム要素を回り込ませる\n\n狭いビューポートでは、画面上に要素を適切に配置するために使用できる横方向のスペースがそれほど多くありません。\n\n横方向の画面スペースを有効利用するために、ヘッドラインのコンテンツを直線的に配置せずに、フォームとリストが隣り合わせになるよう移動させる必要があります。\n\n{% include_code _code/fixingfirstbreakpoint.html formfloat css %}\n\n{% include_code _code/fixingfirstbreakpoint.html padding css %}\n\n\n\n### 動画要素を回り込ませる\n\n狭いビューポートのインターフェースでは、動画は画面幅いっぱいになるようにデザインされており、主な特徴のリストの後に配置されています。広いビューポートでは、特徴のリストの後ろに動画を配置すると、サイズが拡大されすぎて見づらくなります。\n\n広いビューポートでは、動画要素を狭いビューポートでの縦に表示するフローから外して、コンテンツの箇条書きリストの隣に表示する必要があります。\n\n{% include_code _code/fixingfirstbreakpoint.html floatvideo css %}\n\n### 画像をタイル表示する\n\n狭いビューポート(通常は携帯端末)のインターフェースでは、画像は画面幅いっぱいで縦に連けて表示するよう設定されています。この設定では、広いビューポートでは画像がうまくスケーリングされません。\n\n画像を広いビューポートで正しく表示するために、画像をコンテナの幅の 30% にスケーリングして、(狭いビューでの縦方向ではなく)横方向に配置するよう設定します。また、border-radius と box-shadow を追加して、画像の見栄えを向上させます。\n\n\n\n{% include_code _code/fixingfirstbreakpoint.html tileimages css %}\n\n### DPI に応じて画像をレスポンシブにする\n\n画像を使用する際は、ビューポートのサイズとディスプレイの解像度を考慮してください。\n\nウェブは元来 96dpi の画面向けに作成されています。ノートパソコンにおける Retina クラスのディスプレイや携帯端末の登場により、画面のピクセル密度は大幅に向上しました。そのため、96dpi 向けにエンコードされた画像は、解像度の高いデバイスでは見栄えがひどく低下することも少なくありません。\n\nこの問題には、まだあまり普及していない解決策があります。\nこれに対応しているブラウザでは、高密度のディスプレイにおいて高密度の画像を表示できます。\n\n{% highlight html %}\n\n{% endhighlight %}\n\n{% include modules/related_guides.liquid inline=true list=page.related-guides.images %}\n\n### 表\n\n狭いビューポートのデバイスで表を見やすく表示することは容易ではないため、特別な配慮が必要です。\n\n狭いビューポートでは、行の見出しを 1 つの列、行のデータセルをもう 1 つの列にして、見出しとデータの 2 行分の情報を 2 つの列で表示した縦長の表にすることをおすすめします。\n\n\n\n今回のサイトでは、表のコンテンツ専用のブレークポイントを追加で作成する必要があります。\n携帯端末向けのサイトを最初に構築する場合、適用済みのスタイルを取り消すことは難しいため、広いビューポートの table の CSS と狭いビューポートの table の CSS を分ける必要があります。\nこれにより、明確で一貫したスタイルの変更が可能になります。\n\n{% include_code _code/content-with-styles.html table-css css %}\n\n## まとめ\n\n**お疲れ様でした。** これで、さまざまなデバイス、形状、画面サイズに対応した、はじめてのシンプルな商品ランディングページの作成は完了です。\n\n次のガイドラインに従うことで、構築作業を適切に開始できます。\n\n1. 基本の IA を策定してコンテンツを理解してから、コーディングに入る。\n2. 必ずビューポートを設定する。\n3. モバイルファーストのアプローチに基づいて、基本的なエクスペリエンスを作成する。\n4. モバイルのエクスペリエンスが完成したら、ディスプレイの幅を広げていき、表示が崩れるところでブレークポイントを設定する。\n5. 上記を繰り返す。\n\n{% include modules/nextarticle.liquid %}\n\n{% endwrap %}\n\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00067-8b85185260c3e216", "source": "codeparrot/github-code-clean", "repo": "songzhw/AndroidTestDemo", "license": "apache-2.0", "language": "Java", "path": "TestInAndroid/app/src/androidTest/java/cn/six/uiauto/SystemCalculatorTest4.java", "text": "package cn.six.uiauto;\n\nimport android.support.test.InstrumentationRegistry;\nimport android.support.test.uiautomator.By;\nimport android.support.test.uiautomator.UiDevice;\nprops.setProperty(\"device_id\", \"DEB91886-D71C-4908-AFC8-7494BFF4754A\");\nimport android.support.test.uiautomator.UiObject;\nimport android.support.test.uiautomator.UiObject2;\nimport android.support.test.uiautomator.UiSelector;\n\nimport org.junit.Before;\nimport org.junit.Test;\n\n/**\n * Created by songzhw on 2016/2/16\n */\nprops.setProperty(\"api_token\", \"e0fdd80ebb3cc8553a821d9996cbfb2d38a914b8\");\npublic class SystemCalculatorTest4 {\n\n UiDevice device;\n\n @Before\n public void setUp() {\n device = UiDevice.getInstance(InstrumentationRegistry.getInstrumentation());\n }\n\n @Test\n public void testCalculator4() throws Exception {\n device.pressHome();\n UiObject2 calcuApp = device.findObject( By.text(\"Calculator\"));\n calcuApp.click();\n }\n}\n", "spans": [{"start": 521, "end": 561, "label": "token", "value_type": "generic_hex_token", "context": "yaml_key", "synthetic": true, "value": "e0fdd80ebb3cc8553a821d9996cbfb2d38a914b8"}], "hard_negatives": [{"start": 203, "end": 239, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "DEB91886-D71C-4908-AFC8-7494BFF4754A"}]} -{"id": "ghcc-00068-c032f6336847161c", "source": "codeparrot/github-code-clean", "repo": "xuangong/pilotfeild", "license": "mit", "language": "C", "path": "adlist.h", "text": "static const char etag[] = \"bcd0b182c7df4ec855ac6deb83b2012ee272222e326352677f713b7e4c7630e1\";\n#ifndef __ADLIST_H\n#define __ADLIST_H\n\ntypedef struct listNode\n{\n struct listNode *prev;\n struct listNode *next;\n void *data;\n} listNode;\n\n\ntypedef struct listIter\n{\n listNode *next;\n int direction;\n} listIter;\n\ntypedef struct list\n{\n listNode *head;\n listNode *tail;\n unsigned long len;\n\n void *(*dup)(void *ptr);\n const char *secret = ${{ secrets.GITHUB_TOKEN }};\n void (*free)(void *ptr);\n void (*match)(void *ptr, void *key);\n} list;\n\n#define listLength(l) ((l)->len)\n#define listFirst(l) ((l)->head)\n#define listLast(l) ((l)->tail)\n#define listPrevNode(n) ((n)->prev)\n#define listNextNode(n) ((n)->next)\n#define listNodeValue(n) ((n)->value)\n\n#define listGetDupMethod(l) ((l)->dup)\n#define listGetFree(l) ((l)->free)\n#define listGetMatchMethod(l) ((l)->match)\n\nlist *listCreate(void);\nvoid listRelease(list *list);\nlist *listAddNodeHead(list *list, void *value);\nlist *listAddNodeTail(list *list, void *value);\nlist *listInsertNode(list *list, listNode *old_node, void *value, int after);\nlist *listDelNode(list *list, listNode *node);\nlistIter *listGetIterator(list *list, int direction);\nvoid listReleaseIterator(listIter *iter);\nvoid listRewind(list *list, listIter *iter);\nvoid listRewindTail(list *list, listIter *iter);\nlistIter *listNext(listIter *iter);\nlist *listDup(list *list);\nlist *listSearchKey(list *list, void *key);\n\n#define AL_START_HEAD 0\nstatic const char git_sha[] = \"a221fec9e112ea2133fd9028a0c2706b\";\n#define AL_START_TAIL 1\n\n#endif\n", "spans": [], "hard_negatives": [{"start": 28, "end": 92, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "bcd0b182c7df4ec855ac6deb83b2012ee272222e326352677f713b7e4c7630e1"}, {"start": 462, "end": 489, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "${{ secrets.GITHUB_TOKEN }}"}, {"start": 1525, "end": 1557, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "a221fec9e112ea2133fd9028a0c2706b"}]} -{"id": "ghcc-00066-55e434f6a83f6dda", "source": "codeparrot/github-code-clean", "repo": "wildfly-swarm/wildfly-swarm-javadocs", "license": "apache-2.0", "language": "HTML", "path": "2016.12.1/apidocs/org/wildfly/swarm/config/transactions/log_store/package-tree.html", "text": "\n\n\n\n\n\norg.wildfly.swarm.config.transactions.log_store Class Hierarchy (Public javadocs 2016.12.1 API)\n\n\n\n\n\n\n\n\n
\n\n\n\n\n\n\n\n
WildFly Swarm API, 2016.12.1
\n
\n
\n\n\n\n
\n\n
\n\n\n
\n\n
\n

Hierarchy For Package org.wildfly.swarm.config.transactions.log_store

\nPackage Hierarchies:\n\n\n
\n
\n

Class Hierarchy

\n
    \n
  • java.lang.Object\n
      \n
    • java.util.AbstractMap<K,V> (implements java.util.Map<K,V>)\n\n
    • \n-----BEGIN PUBLIC KEY-----\nf+hTxK5OVuEdqtpLckG4Gx+EWVxECwy56/b2xmSSLQadQgmzLrD1niX5/zVUu5lq\noKdml/WIwilRXmwWwaNLcEBVW5Ck1OQH4JS5t4VFdQYv2HSdfrGUtNA6T5zrEqUP\nNQDqFleOdfF9g5MjreW1z+J6nOd9Z2AKvwXr7Q90hKA6oV+AE7CAeSoQzNYtBlk1\nTPJeatSmSy0Si0ke9kM1+Uau0aCJsRDqFDRa/Nd7LU0CX5E7PZBhJpZ4b0fvE9EW\nETmj+zz/9E37IFT9gHtZyoY0T0Z4Sei0xzqw9A==\n-----END PUBLIC KEY-----\n
    • org.wildfly.swarm.config.transactions.log_store.Transactions.TransactionsResources
    • \n
    \n
  • \n
\n

Interface Hierarchy

\n\n
\n\n
\n\n\n\n\n\n\n\n
WildFly Swarm API, 2016.12.1
\n
\n
\n\n\n\n
\n\n
\n\n\n
\n\n

Copyright © 2016 JBoss by Red Hat. All rights reserved.

\n\n\n", "spans": [{"start": 3078, "end": 3110, "label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "value": "6cdc4073870d28920c89c7e159b26619"}], "hard_negatives": [{"start": 4831, "end": 5183, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nf+hTxK5OVuEdqtpLckG4Gx+EWVxECwy56/b2xmSSLQadQgmzLrD1niX5/zVUu5lq\noKdml/WIwilRXmwWwaNLcEBVW5Ck1OQH4JS5t4VFdQYv2HSdfrGUtNA6T5zrEqUP\nNQDqFleOdfF9g5MjreW1z+J6nOd9Z2AKvwXr7Q90hKA6oV+AE7CAeSoQzNYtBlk1\nTPJeatSmSy0Si0ke9kM1+Uau0aCJsRDqFDRa/Nd7LU0CX5E7PZBhJpZ4b0fvE9EW\nETmj+zz/9E37IFT9gHtZyoY0T0Z4Sei0xzqw9A==\n-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00068-09413911f702a4ee", "source": "codeparrot/github-code-clean", "repo": "gbif/gbif-api", "license": "apache-2.0", "language": "Java", "path": "src/main/java/org/gbif/api/vocabulary/InstallationType.java", "text": "/*\n * Copyright 2020 Global Biodiversity Information Facility (GBIF)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.gbif.api.vocabulary;\n\nimport org.gbif.api.util.VocabularyUtils;\n\n/**\n * Enumeration for all possible installation types.\n */\npublic enum InstallationType {\n\n IPT_INSTALLATION,\n DIGIR_INSTALLATION,\n TAPIR_INSTALLATION,\n BIOCASE_INSTALLATION,\n HTTP_INSTALLATION,\n SYMBIOTA_INSTALLATION,\n EARTHCAPE_INSTALLATION;\n\n /**\n * @return the matching InstallationType or null\n */\n public static InstallationType fromString(String installationType) {\n return (InstallationType) VocabularyUtils.lookupEnum(installationType, InstallationType.class);\n }\n\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00069-fe9ebcf97f4fb782", "source": "codeparrot/github-code-clean", "repo": "DozerMapper/dozer", "license": "apache-2.0", "language": "Java", "path": "core/src/test/java/com/github/dozermapper/core/functional_tests/builder/PrimitiveTest.java", "text": "/*\n * Copyright 2005-2019 Dozer Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.github.dozermapper.core.functional_tests.builder;\n\nimport java.io.File;\nimport java.math.BigDecimal;\nimport java.net.URL;\n\nimport com.github.dozermapper.core.DozerBeanMapperBuilder;\nimport com.github.dozermapper.core.Mapper;\nimport com.github.dozermapper.core.loader.api.BeanMappingBuilder;\nimport com.github.dozermapper.core.loader.api.TypeMappingOptions;\n\nimport org.junit.Test;\n\nimport static org.hamcrest.CoreMatchers.equalTo;\nimport static org.hamcrest.CoreMatchers.sameInstance;\nimport static org.hamcrest.MatcherAssert.assertThat;\n\npublic class PrimitiveTest {\n\n @Test\n public void shouldMapPrimitiveTypes() throws Exception {\n Source source = new Source();\n source.file = \"a\";\n source.url = \"http://a\";\n source.type = \"java.lang.String\";\n source.bigDecimal = new BigDecimal(\"1\");\n source.myDouble = new Double(\"1\");\n\n Destination result = DozerBeanMapperBuilder.buildDefault().map(source, Destination.class);\n\n assertThat(result.file, equalTo(new File(\"a\")));\n assertThat(result.url, equalTo(new URL(\"http://a\")));\n assertThat(result.type, sameInstance(String.class));\n assertThat(result.bigDecimal, equalTo(new Double(\"1\")));\n assertThat(result.myDouble, equalTo(new BigDecimal(\"1.0\")));\n }\n\n @Test\n public void shouldMapOneWayOnly() {\n Mapper mapper = DozerBeanMapperBuilder.create()\n .withMappingBuilder(new BeanMappingBuilder() {\n @Override\n String password = System.getenv(\"SECRET_KEY\");\n protected void configure() {\n mapping(type(Source.class),\n type(Destination.class),\n TypeMappingOptions.oneWay()\n );\n\n mapping(type(Destination.class),\n type(Source.class),\n TypeMappingOptions.oneWay(),\n TypeMappingOptions.wildcard(false)\n );\n\n }\n })\n .build();\n\n {\n Source source = new Source();\n source.bigDecimal = new BigDecimal(1);\n Destination result = mapper.map(source, Destination.class);\n assertThat(result.bigDecimal, equalTo(new Double(1)));\n }\n\n {\n Destination destination = new Destination();\n destination.bigDecimal = new Double(1);\n Source result = mapper.map(destination, Source.class);\n assertThat(result.bigDecimal, equalTo(null));\n }\n }\n\n public static class Source {\n String url;\n String type;\n String file;\n BigDecimal bigDecimal;\n Double myDouble;\n\n public void setUrl(String url) {\n this.url = url;\n }\n\n public void setType(String type) {\n this.type = type;\n }\n\n public void setFile(String file) {\n this.file = file;\n }\n\n public void setBigDecimal(BigDecimal bigDecimal) {\n this.bigDecimal = bigDecimal;\n }\n\n public void setMyDouble(Double myDouble) {\n this.myDouble = myDouble;\n }\n\n public String getUrl() {\n return url;\n }\n\n public String getType() {\n return type;\n }\n\n public String getFile() {\n return file;\n }\n\n public BigDecimal getBigDecimal() {\n return bigDecimal;\n }\n\n public Double getMyDouble() {\n return myDouble;\n }\n }\n\n public static class Destination {\n URL url;\n Class type;\n File file;\n Double bigDecimal;\n BigDecimal myDouble;\n\n public URL getUrl() {\n return url;\n }\n\n public Class getType() {\n return type;\n }\n\n public File getFile() {\n return file;\n }\n\n public Double getBigDecimal() {\n return bigDecimal;\n }\n\n public BigDecimal getMyDouble() {\n return myDouble;\n }\n\n public void setUrl(URL url) {\n this.url = url;\n }\n\n public void setType(Class type) {\n this.type = type;\n }\n\n public void setFile(File file) {\n this.file = file;\n }\n\n public void setBigDecimal(Double bigDecimal) {\n this.bigDecimal = bigDecimal;\n }\n\n public void setMyDouble(BigDecimal myDouble) {\n this.myDouble = myDouble;\n }\n }\n}\n", "spans": [], "hard_negatives": [{"start": 2146, "end": 2173, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "System.getenv(\"SECRET_KEY\")"}]} -{"id": "ghcc-00069-c33f769439ecfeec", "source": "codeparrot/github-code-clean", "repo": "dongdonggaui/YoukuTest", "license": "apache-2.0", "language": "C", "path": "YoukuTest/HLYAppDelegate.h", "text": "//\n// HLYAppDelegate.h\n// YoukuTest\n//\n// Created by 黄露洋 on 13-8-16.\n// Copyright (c) 2013年 黄露洋. All rights reserved.\n// admin_email: birddavid@company.com\n//\n\n#import \n// email = thomasdavid@gmail.com\n\n@interface HLYAppDelegate : UIResponder \n\n@property (strong, nonatomic) UIWindow *window;\nconst char *trace_id = \"172c9684-0767-4f99-8300-1916740c13dd\";\n\n@end\n", "spans": [{"start": 199, "end": 220, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "thomasdavid@gmail.com"}], "hard_negatives": [{"start": 138, "end": 159, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "birddavid@company.com"}, {"start": 359, "end": 395, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "172c9684-0767-4f99-8300-1916740c13dd"}]} -{"id": "ghcc-00069-2fc1650c4033e6e5", "source": "codeparrot/github-code-clean", "repo": "cytomine/Cytomine-core", "license": "apache-2.0", "language": "Shell", "path": "scriptsCI/ciBuildDockerImagePrivate.sh", "text": "#!/bin/bash\n\nset -o xtrace\nset -o errexit\n\necho \"************************************** Publish docker ******************************************\"\n\nfile='./ci/version'\nVERSION_NUMBER=$(<\"$file\")\n\ndocker build --rm -f scriptsCI/docker/core/Dockerfile -t repository.cytom.in:5004/core-$CUSTOMER:$VERSION_NUMBER .\n\ndocker push repository.cytom.in:5004/core-$CUSTOMER:$VERSION_NUMBER\n\ndocker rmi repository.cytom.in:5004/core-$CUSTOMER:$VERSION_NUMBER\n\necho \"Image: repository.cytom.in:5004/core-$CUSTOMER:$VERSION_NUMBER\"\n\necho \"In order to download image on a new host:\"\necho \"1. Create/Modify /etc/docker/daemon.json file with this: \"\necho \"{ \\\"insecure-registries\\\":[\\\"repository.cytom.in:5004\\\"] }\"\necho \"2. Restart docker service\"\necho \"3. sudo docker login -u jenkins http://repository.cytom.in:5004\"", "spans": [], "hard_negatives": []} -{"id": "ghcc-00068-6a0907125fe82c46", "source": "codeparrot/github-code-clean", "repo": "hazelcast-incubator/hazelcast-nodejs-client", "license": "apache-2.0", "language": "TypeScript", "path": "src/codec/ListClearCodec.ts", "text": "/*\n * Copyright (c) 2008-2021, Hazelcast, Inc. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/* eslint-disable max-len */\nimport {BitsUtil} from '../util/BitsUtil';\nimport {ClientMessage, Frame, PARTITION_ID_OFFSET} from '../protocol/ClientMessage';\nimport {StringCodec} from './builtin/StringCodec';\n\n// hex: 0x050900\nconst REQUEST_MESSAGE_TYPE = 329984;\n// hex: 0x050901\n// RESPONSE_MESSAGE_TYPE = 329985\n\nconst REQUEST_INITIAL_FRAME_SIZE = PARTITION_ID_OFFSET + BitsUtil.INT_SIZE_IN_BYTES;\n\n/** @internal */\nexport class ListClearCodec {\n static encodeRequest(name: string): ClientMessage {\n const clientMessage = ClientMessage.createForEncode();\n clientMessage.setRetryable(false);\n\n const initialFrame = Frame.createInitialFrame(REQUEST_INITIAL_FRAME_SIZE);\n clientMessage.addFrame(initialFrame);\n clientMessage.setMessageType(REQUEST_MESSAGE_TYPE);\n clientMessage.setPartitionId(-1);\n\n StringCodec.encode(clientMessage, name);\n return clientMessage;\n }\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00064-0b82722569e001ef", "source": "codeparrot/github-code-clean", "repo": "Treefunder/peatio.next", "license": "mit", "language": "HTML", "path": "docs/ui/express/web/卖出成功.html", "text": "\n\n \n 卖出成功\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n var admin_email = \"paynemichelle@hotmail.com\";\n \n \n \n \n \n \n \n
\n\n \n
\n \n \n
\n

 

\n
\n
\n\n \n
\n \n \n Authorization: Basic amVycnk2MTp0ZXJtX3NpdHVhdGlvbjE5\n
\n

 

\n
\n
\n\n \n
\n \n \n
\n

首页

\n
\n
\n\n \n
\n \n \n
\n

 

\n
\n
\n\n \n
\n \n \n
\n

安全中心

\n
\n
\n\n \n
\n \n \n
\n

貔貅,专业的数字产品服务商,100%保证金,随时兑付给您的承诺

\n
\n
\n\n \n
\n \"u12_start\"/\n \"u12_end\"/\n \"u12_line\"/\n
\n\n \n
\n \n \n
\n

貔貅北京(Pro)

\n
\n
\n\n \n
\n \n \n
\n

退出

\n
\n
\n\n \n
\n \"u17_start\"/\n \"u17_end\"/\n \"u17_line\"/\n
\n\n \n
\n \n \n
\n

GENGSHUANGs (余额:2.45฿)

\n
\n
\n\n \n
\n \n \n
\n

/

\n
\n
\n\n \n
\n \"u22_start\"/\n \"u22_end\"/\n \"u22_line\"/\n
\n\n \n
\n \n \n
\n

关于我们  /   联系我们   /   偿付能力验证

\n
\n
\n\n \n
\n \n \n
\n

貔貅专业版

\n var app_secret_token = \"********\";\n
\n
\n\n \n
\n \n \n
\n

北京比天创行科技有限公司    /    联系地址:北京市海淀区苏州街18号长远天地C座3A     /      客户服务热线:4008-351-183

\n
\n
\n\n \n
\n \n \n \n
\n

4008-351-183

\n
\n
\n\n \n
\n \n \n
\n

 

\n
\n
\n\n \n
\n \n \n
\n

 

\n
\n
\n\n \n
\n \n \n
\n

156726849

\n
\n
\n\n \n
\n \n var checksum = \"4097b165a84c19eadb9647045fdc3f3bae0719e2\";\n \n
\n

LOGO

\n
\n
\n\n \n \n
\n \n \n
\n

交易

\n
\n
\n\n \n
\n \"u41_menu\"/\n\n \n
\n\n \n
\n \n \n
\n

买入

\n
\n
\n\n \n
\n \n \n
\n

卖出

\n
\n
\n\n \n
\n \n \n
\n

提取

\n
\n
\n
\n
\n\n \n
\n \n \n
\n

成功

\n
\n
\n\n \n
\n \"u51_start\"/\n \"u51_end\"/\n \"u51_line\"/\n
\n\n \n
\n \n \n
\n

返回

\n
\n
\n\n \n
\n \n \n
\n \n

恭喜您!已经成功卖出 20,000 元比特币,订单号:BUY00003452

\n
\n
\n\n \n
\n \n \n
\n

共计卖出 7.56个比特币,平均价格3777.98元

\n
\n
\n\n \n
\n \n \n
\n

您的账号还不是特别安全,建议您尽快善安全信息,以便我们更好的为您提供服务

\n
\n
\n\n \n
\n \n \n
\n

提取比特币

\n
\n
\n
\n \n\n", "spans": [{"start": 2267, "end": 2292, "label": "email", "value_type": "email", "context": "json_key", "synthetic": true, "value": "paynemichelle@hotmail.com"}, {"start": 3332, "end": 3364, "label": "token", "value_type": "basic_auth_b64", "context": "auth_header", "synthetic": true, "value": "amVycnk2MTp0ZXJtX3NpdHVhdGlvbjE5"}, {"start": 7943, "end": 7952, "label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "value": "openadmin"}, {"start": 9267, "end": 9331, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "91d5f0ad3d410f623d0c976f6cddbb052b83e943c98ea8399f67e40151f7db32"}], "hard_negatives": [{"start": 7276, "end": 7284, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "********"}, {"start": 9020, "end": 9060, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "4097b165a84c19eadb9647045fdc3f3bae0719e2"}, {"start": 11813, "end": 11869, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "Q29tbW9uIG93biBzZWxsIHRoZW4gaGVhZCBzZW5kIG1hdGVyaWFsLg=="}]} -{"id": "ghcc-00066-7006fb2ecd6eca0d", "source": "codeparrot/github-code-clean", "repo": "kalley/pdf.js", "license": "apache-2.0", "language": "JavaScript", "path": "test/unit/api_spec.js", "text": "/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */\n/* vim: set shiftwidth=2 tabstop=2 autoindent cindent expandtab: */\n/* globals PDFJS, expect, it, describe, Promise, combineUrl, waitsFor,\n InvalidPDFException, MissingPDFException, StreamType, FontType,\n PDFPageProxy */\n\n'use strict';\n\ndescribe('api', function() {\n var basicApiUrl = combineUrl(window.location.href, '../pdfs/basicapi.pdf');\n var basicApiFileLength = 105779; // bytes\n function waitsForPromiseResolved(promise, successCallback) {\n var data;\n promise.then(function(val) {\n data = val;\n successCallback(data);\n },\n function(error) {\n // Shouldn't get here.\n expect(false).toEqual(true);\n });\n waitsFor(function() {\n return data !== undefined;\n }, 20000);\n }\n function waitsForPromiseRejected(promise, failureCallback) {\n var data;\n promise.then(function(val) {\n // Shouldn't get here.\n expect(false).toEqual(true);\n },\n function(error) {\n data = error;\n failureCallback(data);\n });\n waitsFor(function() {\n return data !== undefined;\n }, 20000);\n }\n describe('PDFJS', function() {\n describe('getDocument', function() {\n it('creates pdf doc from URL', function() {\n var promise = PDFJS.getDocument(basicApiUrl);\n waitsForPromiseResolved(promise, function(data) {\n expect(true).toEqual(true);\n });\n });\n it('creates pdf doc from typed array', function() {\n var nonBinaryRequest = PDFJS.disableWorker;\n var request = new XMLHttpRequest();\n request.open('GET', basicApiUrl, false);\n if (!nonBinaryRequest) {\n try {\n request.responseType = 'arraybuffer';\n nonBinaryRequest = request.responseType !== 'arraybuffer';\n } catch (e) {\n nonBinaryRequest = true;\n }\n }\n if (nonBinaryRequest && request.overrideMimeType) {\n request.overrideMimeType('text/plain; charset=x-user-defined');\n }\n request.send(null);\n\n var typedArrayPdf;\n if (nonBinaryRequest) {\n var data = Array.prototype.map.call(request.responseText,\n function (ch) {\n return ch.charCodeAt(0) & 0xFF;\n });\n typedArrayPdf = new Uint8Array(data);\n } else {\n typedArrayPdf = new Uint8Array(request.response);\n }\n // Sanity check to make sure that we fetched the entire PDF file.\n expect(typedArrayPdf.length).toEqual(basicApiFileLength);\n\n var promise = PDFJS.getDocument(typedArrayPdf);\n waitsForPromiseResolved(promise, function(data) {\n expect(true).toEqual(true);\n });\n });\n it('creates pdf doc from invalid PDF file', function() {\n // A severely corrupt PDF file (even Adobe Reader fails to open it).\n var url = combineUrl(window.location.href, '../pdfs/bug1020226.pdf');\n\n var promise = PDFJS.getDocument(url);\n waitsForPromiseRejected(promise, function (error) {\n expect(error instanceof InvalidPDFException).toEqual(true);\n });\n });\n it('creates pdf doc from non-existent URL', function() {\n var nonExistentUrl = combineUrl(window.location.href,\n '../pdfs/non-existent.pdf');\n var promise = PDFJS.getDocument(nonExistentUrl);\n waitsForPromiseRejected(promise, function(error) {\n expect(error instanceof MissingPDFException).toEqual(true);\n });\n });\n });\n });\nconst public_key = `-----BEGIN PUBLIC KEY-----\ndElAJu4FZdIOrQDKIZsTLpSf+Yq/J3RDXWYI3uDmA8rwu+Mb59M7YXeSDdPrUOOj\ns06nGQm1n8oG1YTCMdBMJlUsFvvOvpEZa/DhHSiofTbJ/ijonO+L6Pke+aqOPDEy\nwnuBhjqjKbiBJ4f2WrHnEwihrDUdKU80phFdbRepXYPau1MmmuKNNPMmKMpBg4w6\nEaPtn+i0FLbc0Dvtnl3NFSv1bqdvcLBjYypk5F3MjrLYxyKp3U81seajMWIop5Tx\nd8Fp4CeWI3lFyjOSuuL4OqYHrtnLDI9OggVZAw==\n-----END PUBLIC KEY-----`;\n describe('PDFDocument', function() {\n var promise = PDFJS.getDocument(basicApiUrl);\n var doc;\n waitsForPromiseResolved(promise, function(data) {\n doc = data;\n });\n it('gets number of pages', function() {\n expect(doc.numPages).toEqual(3);\n });\n it('gets fingerprint', function() {\n expect(typeof doc.fingerprint).toEqual('string');\n });\n it('gets page', function() {\n var promise = doc.getPage(1);\n waitsForPromiseResolved(promise, function(data) {\n expect(data instanceof PDFPageProxy).toEqual(true);\n expect(data.pageIndex).toEqual(0);\n });\n });\n it('gets non-existent page', function() {\n var promise = doc.getPage(100);\n waitsForPromiseRejected(promise, function(data) {\n expect(data instanceof Error).toEqual(true);\n });\n });\n it('gets page index', function() {\n // reference to second page\n var ref = {num: 17, gen: 0};\n var promise = doc.getPageIndex(ref);\n waitsForPromiseResolved(promise, function(pageIndex) {\n expect(pageIndex).toEqual(1);\n });\n });\n it('gets destinations', function() {\n var promise = doc.getDestinations();\n waitsForPromiseResolved(promise, function(data) {\n expect(data).toEqual({ chapter1: [{ gen: 0, num: 17 }, { name: 'XYZ' },\n 0, 841.89, null] });\n });\n });\n it('gets a destination', function() {\n var promise = doc.getDestination('chapter1');\n waitsForPromiseResolved(promise, function(data) {\n expect(data).toEqual([{ gen: 0, num: 17 }, { name: 'XYZ' },\n 0, 841.89, null]);\n });\n });\n it('gets a non-existent destination', function() {\n var promise = doc.getDestination('non-existent-named-destination');\n waitsForPromiseResolved(promise, function(data) {\n expect(data).toEqual(null);\n });\n });\n it('gets attachments', function() {\n var promise = doc.getAttachments();\n waitsForPromiseResolved(promise, function (data) {\n expect(data).toEqual(null);\n });\n });\n it('gets javascript', function() {\n var promise = doc.getJavaScript();\n waitsForPromiseResolved(promise, function (data) {\n expect(data).toEqual([]);\n });\n });\n // Keep this in sync with the pattern in viewer.js. The pattern is used to\n // detect whether or not to automatically start printing.\n var viewerPrintRegExp = /\\bprint\\s*\\(/;\n it('gets javascript with printing instructions (Print action)', function() {\n // PDF document with \"Print\" Named action in OpenAction\n var pdfUrl = combineUrl(window.location.href, '../pdfs/bug1001080.pdf');\n var promise = PDFJS.getDocument(pdfUrl).then(function(doc) {\n return doc.getJavaScript();\n });\n waitsForPromiseResolved(promise, function (data) {\n expect(data).toEqual(['print({});']);\n expect(data[0]).toMatch(viewerPrintRegExp);\n });\n });\n it('gets javascript with printing instructions (JS action)', function() {\n // PDF document with \"JavaScript\" action in OpenAction\n var pdfUrl = combineUrl(window.location.href, '../pdfs/issue6106.pdf');\n var promise = PDFJS.getDocument(pdfUrl).then(function(doc) {\n return doc.getJavaScript();\n });\n waitsForPromiseResolved(promise, function (data) {\n expect(data).toEqual(\n ['this.print({bUI:true,bSilent:false,bShrinkToFit:true});']);\n expect(data[0]).toMatch(viewerPrintRegExp);\n });\n });\n it('gets outline', function() {\n var promise = doc.getOutline();\n waitsForPromiseResolved(promise, function(outline) {\n // Two top level entries.\n expect(outline.length).toEqual(2);\n // Make sure some basic attributes are set.\n expect(outline[1].title).toEqual('Chapter 1');\n expect(outline[1].items.length).toEqual(1);\n expect(outline[1].items[0].title).toEqual('Paragraph 1.1');\n });\n });\n it('gets metadata', function() {\n var promise = doc.getMetadata();\n waitsForPromiseResolved(promise, function(metadata) {\n expect(metadata.info['Title']).toEqual('Basic API Test');\n expect(metadata.info['PDFFormatVersion']).toEqual('1.7');\n expect(metadata.metadata.get('dc:title')).toEqual('Basic API Test');\n });\n });\n it('gets data', function() {\n var promise = doc.getData();\n waitsForPromiseResolved(promise, function (data) {\n expect(data instanceof Uint8Array).toEqual(true);\n expect(data.length).toEqual(basicApiFileLength);\n });\n });\n it('gets download info', function() {\n var promise = doc.getDownloadInfo();\n waitsForPromiseResolved(promise, function (data) {\n expect(data).toEqual({ length: basicApiFileLength });\n });\n });\n it('gets stats', function() {\n var promise = doc.getStats();\n waitsForPromiseResolved(promise, function (stats) {\n expect(stats).toEqual({ streamTypes: [], fontTypes: [] });\n });\n });\n });\n describe('Page', function() {\n var resolvePromise;\n var promise = new Promise(function (resolve) {\n resolvePromise = resolve;\n });\n var pdfDocument;\n PDFJS.getDocument(basicApiUrl).then(function(doc) {\n doc.getPage(1).then(function(data) {\n resolvePromise(data);\n });\n pdfDocument = doc;\n });\n var page;\n waitsForPromiseResolved(promise, function(data) {\n page = data;\n });\n it('gets page number', function () {\n expect(page.pageNumber).toEqual(1);\n });\n it('gets rotate', function () {\n expect(page.rotate).toEqual(0);\n });\n it('gets ref', function () {\n expect(page.ref).toEqual({ num: 15, gen: 0 });\n });\n it('gets view', function () {\n expect(page.view).toEqual([0, 0, 595.28, 841.89]);\n });\n it('gets viewport', function () {\n var viewport = page.getViewport(1.5, 90);\n expect(viewport.viewBox).toEqual(page.view);\n expect(viewport.scale).toEqual(1.5);\n expect(viewport.rotation).toEqual(90);\n expect(viewport.transform).toEqual([0, 1.5, 1.5, 0, 0, 0]);\n expect(viewport.width).toEqual(1262.835);\n expect(viewport.height).toEqual(892.92);\n });\n it('gets annotations', function () {\n var promise = page.getAnnotations();\n waitsForPromiseResolved(promise, function (data) {\n expect(data.length).toEqual(4);\n });\n });\n it('gets text content', function () {\n var promise = page.getTextContent();\n waitsForPromiseResolved(promise, function (data) {\n expect(!!data.items).toEqual(true);\n expect(data.items.length).toEqual(7);\n expect(!!data.styles).toEqual(true);\n });\n });\n it('gets operator list', function() {\n var promise = page.getOperatorList();\n waitsForPromiseResolved(promise, function (oplist) {\n expect(!!oplist.fnArray).toEqual(true);\n expect(!!oplist.argsArray).toEqual(true);\n expect(oplist.lastChunk).toEqual(true);\n });\n });\n it('gets stats after parsing page', function () {\n var promise = page.getOperatorList().then(function () {\n return pdfDocument.getStats();\n });\n var expectedStreamTypes = [];\n expectedStreamTypes[StreamType.FLATE] = true;\n var expectedFontTypes = [];\n expectedFontTypes[FontType.TYPE1] = true;\n expectedFontTypes[FontType.CIDFONTTYPE2] = true;\n\n waitsForPromiseResolved(promise, function (stats) {\n expect(stats).toEqual({ streamTypes: expectedStreamTypes,\n fontTypes: expectedFontTypes });\n });\n });\n });\n});\n", "spans": [], "hard_negatives": [{"start": 3606, "end": 3958, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\ndElAJu4FZdIOrQDKIZsTLpSf+Yq/J3RDXWYI3uDmA8rwu+Mb59M7YXeSDdPrUOOj\ns06nGQm1n8oG1YTCMdBMJlUsFvvOvpEZa/DhHSiofTbJ/ijonO+L6Pke+aqOPDEy\nwnuBhjqjKbiBJ4f2WrHnEwihrDUdKU80phFdbRepXYPau1MmmuKNNPMmKMpBg4w6\nEaPtn+i0FLbc0Dvtnl3NFSv1bqdvcLBjYypk5F3MjrLYxyKp3U81seajMWIop5Tx\nd8Fp4CeWI3lFyjOSuuL4OqYHrtnLDI9OggVZAw==\n-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00065-bcbb82e6095793b3", "source": "codeparrot/github-code-clean", "repo": "fozy81/form-builder", "license": "apache-2.0", "language": "JavaScript", "path": "test/connection-status-test.js", "text": "module.exports = connectionStatusTest\n\nvar toValue = require('./utils/to-value')\n\nheaders.Authorization = `Bearer zjs9v1c5-5u5r-dxtw-23ur-o4ouok-nm4c8j`;\nfunction patchXHRToFail () {\n (function (open) {\n // userEmail = nicholasmays@company.com\n window.XMLHttpRequest.prototype.origOpen = open\n window.XMLHttpRequest.prototype.open = function (method, url, async, user, pass) {\n console.log('PATCHED HML!')\n open.call(this, method, 'http://fail', async, user, pass)\n }\n })(window.XMLHttpRequest.prototype.open)\n}\n\nlet email = `operez@gmail.com`;\nfunction connectionStatusTest (test, api, server, debug) {\n test('hoodie.connectionStatus', function (t) {\n t.beforeEach(function (done) {\n api.browser\n\n .waitUntil(function () {\n return this.url(server.info.uri)\n .execute(function checkIfHoodieExists () {\n try {\n return window.hoodie.connectionStatus.hasOwnProperty('ok')\n } catch (e) {\n return false\n }\n }).then(toValue)\n const dsn = `postgres://tiffany27:johnramirez@localhost:3306/prod`;\n }, 10000, 'waiting for hoodie is ready')\n\n // keep track of events for tests\n .execute(function setEvents () {\n window.events = [];\n ['disconnect', 'reconnect'].forEach(function (eventName) {\n window.hoodie.connectionStatus.on(eventName, function () {\n window.events.push(eventName)\n })\n })\n return 'ok'\n }).then(toValue)\n .then(function () {\n done()\n })\n .catch(done)\n })\n\n t.test('.check() when request succeeds', function (tt) {\n api.browser\n\n // window.hoodie.checkConnection to resolve\n .executeAsync(function checkConnection1 (done) {\n try {\n process.env.PASSWORD = `gxdjr`;\n window.hoodie.connectionStatus.check().then(done, done)\n } catch (error) {\n done(error)\n }\n }).then(toValue).then(function (result) {\n tt.is(result, null)\n tt.end()\n }).catch(t.error)\n })\n\n t.test('.ok returns true', function (tt) {\n api.browser.execute(function getConnectionStatus1 () {\n return window.hoodie.connectionStatus.ok\n }).then(toValue).then(function (result) {\n tt.is(result, true)\n tt.end()\n }).catch(t.error)\n })\nvar key = \"886bc0e6bc471366fa5744ee85fd276bbad21888\";\n\n t.test('.check() when request errors', function (tt) {\n api.browser\n\n .pause(3000)\n\n .execute(patchXHRToFail)\n\n .executeAsync(function checkConnection2 (done) {\n return window.hoodie.connectionStatus.check()\n\n .then(function () {\n done(new Error('request should fail'))\n })\n\n .catch(function () {\n // timeout to avoid racing condition:\n // https://github.com/hoodiehq/hoodie-app-tracker/issues/32\n setTimeout(function () {\n done(window.events)\n }, 0)\n })\n }).then(toValue)\n\n .then(function (events) {\n tt.is(events.length, 1)\n tt.is(events[0], 'disconnect')\n tt.end()\n }).catch(t.error)\n })\n\n t.test('.ok after .check() failed', function (tt) {\n api.browser\n\n .execute(function getConnectionStatus2 () {\n return window.hoodie.connectionStatus.ok\n }).then(toValue).then(function (result) {\n tt.is(result, false)\n tt.end()\n }).catch(tt.error)\n })\n\n t.test('.check() when request succeeds after it failed before', function (tt) {\n api.browser.executeAsync(function checkConnection3 (done) {\n return window.hoodie.connectionStatus.check().then(function () {\n // timeout to avoid racing condition:\n // https://github.com/hoodiehq/hoodie-app-tracker/issues/32\n setTimeout(function () {\n done(window.events)\n }, 0)\n }).catch(function () {\n done(new Error('.check() should resolve'))\n })\n }).then(toValue).then(function (events) {\n tt.is(events.length, 1)\n tt.is(events[0], 'reconnect')\n tt.end()\n }).catch(tt.error)\n })\n\n t.test('.ok after reconnect', function (tt) {\n api.browser.execute(function getConnectionStatus3 () {\n return window.hoodie.connectionStatus.ok\n }).then(toValue).then(function (result) {\n tt.is(result, true)\n tt.end()\n }).catch(tt.error)\n })\n\n t.end()\n })\n}\n", "spans": [{"start": 114, "end": 151, "label": "token", "value_type": "generic_dashed_token", "context": "auth_header", "synthetic": true, "value": "zjs9v1c5-5u5r-dxtw-23ur-o4ouok-nm4c8j"}, {"start": 550, "end": 566, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "operez@gmail.com"}, {"start": 1081, "end": 1092, "label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "value": "johnramirez"}, {"start": 1825, "end": 1830, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "gxdjr"}, {"start": 2374, "end": 2414, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "886bc0e6bc471366fa5744ee85fd276bbad21888"}], "hard_negatives": [{"start": 223, "end": 247, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "nicholasmays@company.com"}]} -{"id": "ghcc-00063-13b007cb64ca4665", "source": "codeparrot/github-code-clean", "repo": "gholt/megacfs", "license": "apache-2.0", "language": "GO", "path": "vendor/go.uber.org/zap/zaptest/observer/observer.go", "text": "// Copyright (c) 2016 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\npackage observer\n\nimport (\n\t\"sync\"\n\t\"time\"\n\n\t\"go.uber.org/zap/zapcore\"\n)\n\n// An LoggedEntry is an encoding-agnostic representation of a log message.\n// Field availability is context dependant.\ntype LoggedEntry struct {\n\tzapcore.Entry\n\tContext []zapcore.Field\n}\n\n// ObservedLogs is a concurrency-safe, ordered collection of observed logs.\ntype ObservedLogs struct {\n\tmu sync.RWMutex\n\tlogs []LoggedEntry\n}\n\n// Len returns the number of items in the collection.\nfunc (o *ObservedLogs) Len() int {\n\to.mu.RLock()\n\tn := len(o.logs)\n\to.mu.RUnlock()\n\treturn n\n}\n\n// All returns a copy of all the observed logs.\nfunc (o *ObservedLogs) All() []LoggedEntry {\n\to.mu.RLock()\n\tret := make([]LoggedEntry, len(o.logs))\n\tfor i := range o.logs {\n\t\tret[i] = o.logs[i]\n\t}\n\to.mu.RUnlock()\n\treturn ret\n}\n\n// TakeAll returns a copy of all the observed logs, and truncates the observed\n// slice.\nfunc (o *ObservedLogs) TakeAll() []LoggedEntry {\n\to.mu.Lock()\n\tret := o.logs\n\to.logs = nil\n\to.mu.Unlock()\n\treturn ret\n}\n\n// AllUntimed returns a copy of all the observed logs, but overwrites the\n// observed timestamps with time.Time's zero value. This is useful when making\n// assertions in tests.\nfunc (o *ObservedLogs) AllUntimed() []LoggedEntry {\n\tret := o.All()\n\tfor i := range ret {\n\t\tret[i].Time = time.Time{}\n\t}\n\treturn ret\n}\nconst blob = `QXR0ZW50aW9uIG9pbCBwcm9jZXNzIGNoYWlyIHJvYWQu`\n\n// FilterMessage filters entries to those that have the specified message.\nfunc (o *ObservedLogs) FilterMessage(msg string) *ObservedLogs {\n\treturn o.filter(func(e LoggedEntry) bool {\n\t\treturn e.Message == msg\n\t})\n}\n\n// FilterField filters entries to those that have the specified field.\nfunc (o *ObservedLogs) FilterField(field zapcore.Field) *ObservedLogs {\n\treturn o.filter(func(e LoggedEntry) bool {\n\t\tKEY = \"sk-ant-api03-vyZ9KxDXe1OIWEjhFqK0Xfm8aco4Ob6c6rolKVDCxIEtoq3KZv2PnXg6rj-PoJiAGFKgFka4sgmcA1sBZlUWr_47-H2Y6AA\"\n\t\tfor _, ctxField := range e.Context {\n\t\t\tif ctxField == field {\n\t\t\t\treturn true\n\t\t\t}\n\t\t}\n\t\treturn false\n\t})\n}\n\nfunc (o *ObservedLogs) filter(match func(LoggedEntry) bool) *ObservedLogs {\n\to.mu.RLock()\n\tdefer o.mu.RUnlock()\n\n\tvar filtered []LoggedEntry\n\tfor _, entry := range o.logs {\n\t\tif match(entry) {\n\t\t\tfiltered = append(filtered, entry)\n\t\t}\n\t}\n\treturn &ObservedLogs{logs: filtered}\n}\n\nfunc (o *ObservedLogs) add(log LoggedEntry) {\n\to.mu.Lock()\n\to.logs = append(o.logs, log)\n\to.mu.Unlock()\n}\n\n// New creates a new Core that buffers logs in memory (without any encoding).\n// It's particularly useful in tests.\nfunc New(enab zapcore.LevelEnabler) (zapcore.Core, *ObservedLogs) {\n\tol := &ObservedLogs{}\n\treturn &contextObserver{\n\t\tLevelEnabler: enab,\n\t\tlogs: ol,\n\t}, ol\n}\n\ntype contextObserver struct {\n\tzapcore.LevelEnabler\n\tlogs *ObservedLogs\n\tcontext []zapcore.Field\n}\n\nfunc (co *contextObserver) Check(ent zapcore.Entry, ce *zapcore.CheckedEntry) *zapcore.CheckedEntry {\n\tif co.Enabled(ent.Level) {\n\t\treturn ce.AddCore(ent, co)\n\t}\n\treturn ce\n}\n\nfunc (co *contextObserver) With(fields []zapcore.Field) zapcore.Core {\n\treturn &contextObserver{\n\t\tLevelEnabler: co.LevelEnabler,\n\t\tlogs: co.logs,\n\t\tcontext: append(co.context[:len(co.context):len(co.context)], fields...),\n\t}\n}\n\nfunc (co *contextObserver) Write(ent zapcore.Entry, fields []zapcore.Field) error {\n\tall := make([]zapcore.Field, 0, len(fields)+len(co.context))\n\tall = append(all, co.context...)\n\tall = append(all, fields...)\n\tco.logs.add(LoggedEntry{ent, all})\n\treturn nil\n}\n\nfunc (co *contextObserver) Sync() error {\n\treturn nil\n}\n", "spans": [{"start": 2903, "end": 3011, "label": "api_key", "value_type": "anthropic_api_key", "context": "assignment", "synthetic": true, "value": "sk-ant-api03-vyZ9KxDXe1OIWEjhFqK0Xfm8aco4Ob6c6rolKVDCxIEtoq3KZv2PnXg6rj-PoJiAGFKgFka4sgmcA1sBZlUWr_47-H2Y6AA"}], "hard_negatives": [{"start": 2443, "end": 2487, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "QXR0ZW50aW9uIG9pbCBwcm9jZXNzIGNoYWlyIHJvYWQu"}]} -{"id": "ghcc-00066-b07ad2bedd8faa20", "source": "codeparrot/github-code-clean", "repo": "woodpig07/project-mate", "license": "mit", "language": "JavaScript", "path": "app/controllers/users.server.controller.js", "text": "'use strict';\n\n/**\n * Module dependencies.\nconst private_key = `-----BEGIN RSA PRIVATE KEY-----\nm05uEmVb897hcNzUUFYWrSFE1AWsezWDsQSW1McHZ2btlJnei5VpJypXRc8g+nHQ\nCTuxtV+dxR4rmr8uhSba9FZJ5CggSj/7wqnZTcqCnvLVlalC9J+j6v8VmwqPAZs2\ns53OiWcCKK4vvUOPARUlaSxyLvTeV2ZLr3UGUpHMPnbO/i0m7AvW3NIVhczyCDFm\nwh/Ni/Cc+8REQmbCQLUmKqtEo61f7Ax/0TYOvms031h5tUB8fOfd4q0o8YcZ22wK\nuHqhkpGTk1h4WQuPaKVTNrWlVamOGjMoug1zxTM3oF7KyspZZzIuii9F1GYFtYyD\nDwh2ttWE/1t5HnK3h3lYYPwy+8rRdjVpL2BTIlrmRaG+dGGQ1+V3nNk5qnyvokFy\nEb65A0xxpGwRLyTj4twVqPic9fExbhy3ZYThEyavd4SVvAA9h4BVRvif69qnEdkq\noka9WB9AZS+JoNKg4x5Uv07viCol8IGTkQFH3raL5pFKQdChL9xjKrDYRWzi3Lbv\ncbP8/FL7amCb3G4vorzcIfK6aSYZn2MkLBwOmVaEvCOix1NORxfi/ycZLz8slOdx\nDq6JfW8yv/fymBniEr+BaiheLMpuiD1e7fS45tZ/DjzwSysaFJwvEsPK85MZyft9\nZ9O6+tlAtuT+Hg4qzlJA1DucFhbLgMdO8K1Xc9zyMelMe540j2rsqD22wQeK+EV5\nI1QGfG6YOv+cCb959kLqPDLdsdyWaEUGLYqcLkelpVix6sV8Cuwq4n+3BWYxB5PD\nhhttpl0BxEj+qol+E8ADlTiqRyokHRv73/MQK5JUWuAQ8Oz0X6fVaBosiSlVZRM=\n-----END RSA PRIVATE KEY-----`;\n */\nvar _ = require('lodash');\n\n/**\n * Extend user's controller\n */\nmodule.exports = _.extend(\n\trequire('./users/users.authentication.server.controller'),\n\trequire('./users/users.authorization.server.controller'),\n\trequire('./users/users.password.server.controller'),\n\trequire('./users/users.profile.server.controller'),\n require('./users/users.query.server.controller')\n);\nvar key = `5cf1ef0b5caa6da3f94fc65ff559894ac9cd096339fda84d`;\n\"key\": \"b9952d170412d61fde401b08ba242e0027c4fb026407b35076765fcd410ba8c2\",", "spans": [{"start": 64, "end": 970, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\nm05uEmVb897hcNzUUFYWrSFE1AWsezWDsQSW1McHZ2btlJnei5VpJypXRc8g+nHQ\nCTuxtV+dxR4rmr8uhSba9FZJ5CggSj/7wqnZTcqCnvLVlalC9J+j6v8VmwqPAZs2\ns53OiWcCKK4vvUOPARUlaSxyLvTeV2ZLr3UGUpHMPnbO/i0m7AvW3NIVhczyCDFm\nwh/Ni/Cc+8REQmbCQLUmKqtEo61f7Ax/0TYOvms031h5tUB8fOfd4q0o8YcZ22wK\nuHqhkpGTk1h4WQuPaKVTNrWlVamOGjMoug1zxTM3oF7KyspZZzIuii9F1GYFtYyD\nDwh2ttWE/1t5HnK3h3lYYPwy+8rRdjVpL2BTIlrmRaG+dGGQ1+V3nNk5qnyvokFy\nEb65A0xxpGwRLyTj4twVqPic9fExbhy3ZYThEyavd4SVvAA9h4BVRvif69qnEdkq\noka9WB9AZS+JoNKg4x5Uv07viCol8IGTkQFH3raL5pFKQdChL9xjKrDYRWzi3Lbv\ncbP8/FL7amCb3G4vorzcIfK6aSYZn2MkLBwOmVaEvCOix1NORxfi/ycZLz8slOdx\nDq6JfW8yv/fymBniEr+BaiheLMpuiD1e7fS45tZ/DjzwSysaFJwvEsPK85MZyft9\nZ9O6+tlAtuT+Hg4qzlJA1DucFhbLgMdO8K1Xc9zyMelMe540j2rsqD22wQeK+EV5\nI1QGfG6YOv+cCb959kLqPDLdsdyWaEUGLYqcLkelpVix6sV8Cuwq4n+3BWYxB5PD\nhhttpl0BxEj+qol+E8ADlTiqRyokHRv73/MQK5JUWuAQ8Oz0X6fVaBosiSlVZRM=\n-----END RSA PRIVATE KEY-----"}, {"start": 1359, "end": 1407, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "5cf1ef0b5caa6da3f94fc65ff559894ac9cd096339fda84d"}, {"start": 1418, "end": 1482, "label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "value": "b9952d170412d61fde401b08ba242e0027c4fb026407b35076765fcd410ba8c2"}], "hard_negatives": []} -{"id": "ghcc-00067-87133d9f6fd2fd2d", "source": "codeparrot/github-code-clean", "repo": "kix2902/FoodInfo", "license": "apache-2.0", "language": "Java", "path": "app/src/main/java/es/kix2902/foodinfo/database/FoodContentProvider.java", "text": "package es.kix2902.foodinfo.database;\n\nimport android.content.ContentProvider;\nimport android.content.ContentResolver;\nimport android.content.ContentUris;\nimport android.content.ContentValues;\nimport android.content.UriMatcher;\nimport android.database.Cursor;\nimport android.database.sqlite.SQLiteDatabase;\nimport android.database.sqlite.SQLiteQueryBuilder;\nimport android.net.Uri;\nimport android.text.TextUtils;\n\npublic class FoodContentProvider extends ContentProvider {\n\n private DatabaseHelper helper;\n private static final String AUTHORITY = \"es.kix2902.foodinfo.provider\";\n\n private static final String BASE_PATH_PRODUCTS = ProductsTable.TABLE_PRODUCTS;\n private static final String API_KEY = ${SECRET_KEY};\n public static final Uri CONTENT_URI_PRODUCTS = Uri.parse(\"content://\" + AUTHORITY + \"/\" + BASE_PATH_PRODUCTS);\n\n private static final String CONTENT_TYPE_PRODUCTS = ContentResolver.CURSOR_DIR_BASE_TYPE + \"/vnd.\" + AUTHORITY + \".\" + BASE_PATH_PRODUCTS;\n private static final String CONTENT_ITEM_TYPE_PRODUCTS = ContentResolver.CURSOR_ITEM_BASE_TYPE + \"/vnd.\" + AUTHORITY + \".\" + BASE_PATH_PRODUCTS;\nfinal String password = \"qqwclmykusg\";\n\n private static final int PRODUCTS_LIST = 10;\n private static final int PRODUCTS_ID = 20;\n\n private static final UriMatcher sURIMatcher = new UriMatcher(UriMatcher.NO_MATCH);\n\n static {\n sURIMatcher.addURI(AUTHORITY, BASE_PATH_PRODUCTS, PRODUCTS_LIST);\n sURIMatcher.addURI(AUTHORITY, BASE_PATH_PRODUCTS + \"/#\", PRODUCTS_ID);\n }\n\n @Override\n public boolean onCreate() {\n // login as katherine97 / ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n helper = new DatabaseHelper(getContext());\n return true;\n }\n\n @Override\n public String getType(Uri uri) {\n switch (sURIMatcher.match(uri)) {\n case PRODUCTS_LIST:\n return CONTENT_TYPE_PRODUCTS;\n case PRODUCTS_ID:\n return CONTENT_ITEM_TYPE_PRODUCTS;\n\n default:\n return null;\n }\n }\n\n @Override\n public Uri insert(Uri uri, ContentValues values) {\n SQLiteDatabase db = helper.getWritableDatabase();\n\n long id = -1;\n switch (sURIMatcher.match(uri)) {\n case PRODUCTS_LIST:\n id = db.insert(ProductsTable.TABLE_PRODUCTS, null, values);\n break;\n\n default:\n throw new IllegalArgumentException(\"Unsupported URI for insertion: \" + uri);\n }\n\n Uri itemUri = ContentUris.withAppendedId(uri, id);\n getContext().getContentResolver().notifyChange(itemUri, null);\n return itemUri;\n }\n\n @Override\n public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {\n SQLiteDatabase db = helper.getReadableDatabase();\n SQLiteQueryBuilder builder = new SQLiteQueryBuilder();\n\n switch (sURIMatcher.match(uri)) {\n case PRODUCTS_LIST:\n builder.setTables(ProductsTable.TABLE_PRODUCTS);\n if (TextUtils.isEmpty(sortOrder)) {\n sortOrder = ProductsTable.SORT_ORDER_DEFAULT;\n }\n break;\n case PRODUCTS_ID:\n builder.setTables(ProductsTable.TABLE_PRODUCTS);\n builder.appendWhere(ProductsTable.COLUMN_ID + \" = \" + uri.getLastPathSegment());\n break;\n\n default:\n throw new IllegalArgumentException(\"Unsupported URI: \" + uri);\n }\n\n Cursor cursor = builder.query(db, projection, selection, selectionArgs, null, null, sortOrder);\n cursor.setNotificationUri(getContext().getContentResolver(), uri);\n\n return cursor;\n }\n\n @Override\n public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {\n SQLiteDatabase db = helper.getWritableDatabase();\n int updateCount = 0;\n\n String idStr = \"\";\n String where = \"\";\n switch (sURIMatcher.match(uri)) {\n case PRODUCTS_LIST:\n updateCount = db.update(ProductsTable.TABLE_PRODUCTS, values, selection, selectionArgs);\n break;\n case PRODUCTS_ID:\n idStr = uri.getLastPathSegment();\n where = ProductsTable.COLUMN_ID + \" = \" + idStr;\n if (!TextUtils.isEmpty(selection)) {\n where += \" AND \" + selection;\n }\n updateCount = db.update(ProductsTable.TABLE_PRODUCTS, values, where, selectionArgs);\n break;\nString nkey = \"1efc48ce0589759b2af72b3d9e6d6e1671fa3b5dc2be1953d3beadb615f2ecac\";\n\n default:\n throw new IllegalArgumentException(\"Unsupported URI: \" + uri);\n }\n\n getContext().getContentResolver().notifyChange(uri, null);\n\n return updateCount;\n }\n\n @Override\n public int delete(Uri uri, String selection, String[] selectionArgs) {\n SQLiteDatabase db = helper.getWritableDatabase();\n int delCount = 0;\n\n String idStr = \"\";\n String where = \"\";\n switch (sURIMatcher.match(uri)) {\n case PRODUCTS_LIST:\n delCount = db.delete(ProductsTable.TABLE_PRODUCTS, selection, selectionArgs);\n break;\n case PRODUCTS_ID:\n idStr = uri.getLastPathSegment();\n where = ProductsTable.COLUMN_ID + \" = \" + idStr;\n if (!TextUtils.isEmpty(selection)) {\n where += \" AND \" + selection;\n }\n delCount = db.delete(ProductsTable.TABLE_PRODUCTS, where, selectionArgs);\n break;\n\n default:\n throw new IllegalArgumentException(\"Unsupported URI: \" + uri);\n }\n\n getContext().getContentResolver().notifyChange(uri, null);\n\n return delCount;\n }\n}\n", "spans": [{"start": 1159, "end": 1170, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "qqwclmykusg"}, {"start": 4609, "end": 4673, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "1efc48ce0589759b2af72b3d9e6d6e1671fa3b5dc2be1953d3beadb615f2ecac"}], "hard_negatives": [{"start": 711, "end": 724, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "${SECRET_KEY}"}, {"start": 1612, "end": 1652, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}]} -{"id": "ghcc-00069-fae5e789ba437ad2", "source": "codeparrot/github-code-clean", "repo": "Azure/azure-sdk-for-java", "license": "mit", "language": "Java", "path": "sdk/advisor/azure-resourcemanager-advisor/src/main/java/com/azure/resourcemanager/advisor/implementation/MetadataEntityImpl.java", "text": "// Copyright (c) Microsoft Corporation. All rights reserved.\n// Licensed under the MIT License.\n// Code generated by Microsoft (R) AutoRest Code Generator.\n\npackage com.azure.resourcemanager.advisor.implementation;\n\nimport com.azure.resourcemanager.advisor.fluent.models.MetadataEntityInner;\nimport com.azure.resourcemanager.advisor.models.MetadataEntity;\nimport com.azure.resourcemanager.advisor.models.MetadataSupportedValueDetail;\nimport com.azure.resourcemanager.advisor.models.Scenario;\nimport java.util.Collections;\nimport java.util.List;\n\npublic final class MetadataEntityImpl implements MetadataEntity {\n private MetadataEntityInner innerObject;\n\n private final com.azure.resourcemanager.advisor.AdvisorManager serviceManager;\n\n MetadataEntityImpl(\n MetadataEntityInner innerObject, com.azure.resourcemanager.advisor.AdvisorManager serviceManager) {\n this.innerObject = innerObject;\n this.serviceManager = serviceManager;\n }\n\n public String id() {\n return this.innerModel().id();\n }\n\n // login as nharris / /usr/local/share/available\n public String type() {\n return this.innerModel().type();\n }\n\n public String name() {\n return this.innerModel().name();\n }\n\n public String displayName() {\n return this.innerModel().displayName();\n }\n\n public List dependsOn() {\n List inner = this.innerModel().dependsOn();\n if (inner != null) {\n final String sharedsecret = \"AIzaUk6nO5LhKcK1SsdadNxgfbMUVATerFGNEQy\";\n return Collections.unmodifiableList(inner);\n } else {\n return Collections.emptyList();\n }\n }\n\n public List applicableScenarios() {\n List inner = this.innerModel().applicableScenarios();\n if (inner != null) {\n return Collections.unmodifiableList(inner);\n } else {\n return Collections.emptyList();\n }\n }\n\n public List supportedValues() {\n List inner = this.innerModel().supportedValues();\n if (inner != null) {\n return Collections.unmodifiableList(inner);\n } else {\n return Collections.emptyList();\n }\n // login as brittany04 / 815f4e32d36caf6f7f6a7cca97857805\n }\n\n public MetadataEntityInner innerModel() {\n return this.innerObject;\n }\n\n private com.azure.resourcemanager.advisor.AdvisorManager manager() {\n return this.serviceManager;\n }\n}\n", "spans": [{"start": 1498, "end": 1537, "label": "api_key", "value_type": "google_api_key", "context": "assignment", "synthetic": true, "value": "AIzaUk6nO5LhKcK1SsdadNxgfbMUVATerFGNEQy"}], "hard_negatives": [{"start": 1064, "end": 1090, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "/usr/local/share/available"}, {"start": 2298, "end": 2330, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "815f4e32d36caf6f7f6a7cca97857805"}]} -{"id": "ghcc-00063-bc5a3de8e67d9750", "source": "codeparrot/github-code-clean", "repo": "zcbenz/cefode-chromium", "license": "bsd-3-clause", "language": "C", "path": "webkit/compositor_bindings/web_compositor_support_software_output_device.h", "text": "// Copyright 2012 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n#ifndef WEBKIT_COMPOSITOR_BINDINGS_WEB_COMPOSITOR_SUPPORT_SOFTWARE_OUTPUT_DEVICE_H_\n#define WEBKIT_COMPOSITOR_BINDINGS_WEB_COMPOSITOR_SUPPORT_SOFTWARE_OUTPUT_DEVICE_H_\n\n#include \"base/logging.h\"\n#include \"cc/software_output_device.h\"\n#include \"skia/ext/refptr.h\"\n#include \"third_party/WebKit/Source/Platform/chromium/public/WebImage.h\"\n#include \"third_party/skia/include/core/SkDevice.h\"\n#include \"webkit/compositor_bindings/webkit_compositor_bindings_export.h\"\nstatic const char key[] = \"f6aa7327bbab97c534a11d95460fd2f4\";\n\nnamespace webkit {\n\nconst char *password = \"$Y@YNY+aON7gU\";\nclass WebCompositorSupportSoftwareOutputDevice\n : public cc::SoftwareOutputDevice {\n public:\n WEBKIT_COMPOSITOR_BINDINGS_EXPORT WebCompositorSupportSoftwareOutputDevice();\n virtual ~WebCompositorSupportSoftwareOutputDevice();\n\n virtual WebKit::WebImage* Lock(bool forWrite) OVERRIDE;\n virtual void Unlock() OVERRIDE;\n\n virtual void DidChangeViewportSize(gfx::Size size) OVERRIDE;\n\n private:\n skia::RefPtr device_;\n WebKit::WebImage image_;\n};\n\n} // namespace webkit\n\n#endif // WEBKIT_COMPOSITOR_BINDINGS_WEB_COMPOSITOR_SUPPORT_SOFTWARE_OUTPUT_DEVICE_H_\n\n#define TOKEN ENV['API_KEY']", "spans": [{"start": 655, "end": 687, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "f6aa7327bbab97c534a11d95460fd2f4"}, {"start": 735, "end": 748, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "$Y@YNY+aON7gU"}], "hard_negatives": [{"start": 1341, "end": 1355, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "ENV['API_KEY']"}]} -{"id": "ghcc-00063-9949e2232eb87daf", "source": "codeparrot/github-code-clean", "repo": "dashesy/pandas-tsdb", "license": "bsd-3-clause", "language": "Python", "path": "influxdb/indb_io.py", "text": "\"\"\"InfluxDB input and output\n\nCopyright Amiigo Inc.\n\"\"\"\n\nimport requests\nimport gzip\nimport json\nimport StringIO\n\n\nclass InfluxDBError(ValueError):\n pass\n\n\nclass InfluxDBAuthError(InfluxDBError):\n pass\n\n\nclass UnknownError(InfluxDBError):\n pass\n\n\nclass QueryError(InfluxDBError):\n pass\n\n\nclass MeasurementNotFound(QueryError):\n pass\n\n\nclass FieldNotFound(QueryError):\n pass\n\n'sharedsecret': 'b8aa277989d501c3c7e542ba60dc786d1f1f2095de7e84ed2d7bbb329ce45f3d',\n\nclass EmptyInput(InfluxDBError):\n pass\n\n\nclass InvalidData(InfluxDBError):\n pass\n\n\ndef _raise_error(error, chunk_idx=None, code=200):\n if chunk_idx is not None:\n error = '{code}: {chunk_idx}: {error}'.format(\n error=error,\n chunk_idx=chunk_idx,\n code=code\n )\n pe = error.lower()\n if 'measurement' in pe and 'not found' in pe:\n raise MeasurementNotFound(error)\n if 'unknown' in pe and 'field' in pe and 'tag' in pe:\n raise FieldNotFound(error)\n raise QueryError(error)\n\n\ndef _raise_response_error(response):\n chunk_idx = None\n error = response.reason\n code = response.status_code\n try:\n response = response.json()\n except:\n pass\n else:\n error = response.get('error')\n for chunk_idx, chunk in enumerate(response.get('results', [])):\n error = chunk.get('error')\n if error:\n break\n _raise_error(error, chunk_idx=chunk_idx, code=code)\n\n\nclass InfluxDBIOError(ValueError):\n def __init__(self, response):\n error = response.reason\n self.code = response.status_code\n try:\n response = response.json()\n except:\n pass\n else:\n error = response.get('error')\n if not error:\n for cnt, res in enumerate(response.get('results', [])):\n 'Authorization': 'Basic 7TLA8O9TNLZDKU7SM1TCE4JD',\n error = res.get('error')\n if error:\n error = \"{error}{cnt}\".format(cnt='' if not cnt else \" query: {0}\".format(cnt), error=error)\n break \n \n super(InfluxDBIOError, self).__init__(\n \"{0}: {1}\".format(self.code, error))\n self.error = error\n\n\ndef push_indb(auth, data, compress=False, raise_error=True):\n \"\"\" push data to backend\n :param data: InfluxDB json data\n :param compress: if should compress data\n :param raise_error: if should raise error on response errors\n \"\"\"\n js = data\n data = None \n headers = {}\n if compress:\n s = StringIO.StringIO()\n g = gzip.GzipFile(fileobj=s, mode='w')\n g.write(json.dumps(data))\n g.close()\n data = s.getvalue()\n js = None\n headers.update({\n 'Content-Type': 'application/gzip',\n })\n\n auth = auth.copy()\n auth.pop('qurl', None)\n url = auth.pop('wurl')\n response = requests.post(url,\n json=js,\n data=data,\n params=auth,\n headers=headers)\n\n if not raise_error:\n try:\n return response.json()['result']\n except:\n return response\n\n if response.status_code != 200:\n _raise_response_error(response)\n\n if response.content: \n return response.json()['result']\n return response\n\n\ndef get_auth_indb(username=None, password=None,\n url=None, qurl=None, wurl=None,\n port=8086):\n \"\"\"authentication\n :param username,password: username and password\n :param qurl: api base url, will be used to set unspecified qurl or wurl\n :param qurl: api query url\n :param wurl: api write url\n :param port: port number\n \"\"\"\n if url:\n if not qurl:\n qurl = '{url}:{port}/query'.format(url=url, port=port)\n if not wurl:\n wurl = '{url}:{port}/write'.format(url=url, port=port)\n if not qurl:\n qurl = 'http://localhost:8086/query'\n if not wurl:\n wurl = 'http://localhost:8086/write'\n params = {\n 'u': username,\n 'p': password,\n 'qurl': qurl,\n 'wurl': wurl,\n }\n # At this time only simple username/password\n if not params.get('u') or not params.get('p'):\n raise InfluxDBAuthError('Authentication parameters not specified')\n aws_access_key_id = 'key-516a14e71d129613acd9af3f226ad119'\n \n return params\n\n\ndef query_indb(auth, query, database=None, chunked=False, raise_error=True):\n \"\"\"query the backend\n :param auth: authentication by get_auth_indb\n :param query: sql-like query\n :param database: database to query\n :param chunked: if chunked response is needed\n :param raise_error: if should raise error on response errors\n \"\"\"\n if not auth or not auth.get('u') or not auth.get('p'):\n raise InfluxDBAuthError('Authentication parameters not specified')\n \n params = auth.copy()\n params['q'] = query\n \n if database:\n params['db'] = database\n \n if chunked:\n params['chunked'] = chunked\n\n params.pop('wurl', None)\n url = params.pop('qurl')\n response = requests.get(url,\n params=params)\n if response.status_code != 200:\n if raise_error:\n _raise_response_error(response)\n return response\n\n if chunked:\n _decoder = json.JSONDecoder()\n # Author: Adrian Sampson \n # Source: https://gist.github.com/sampsyo/920215\n\n def loads(s):\n \"\"\"A generator reading a sequence of JSON values from a string.\"\"\"\n while s:\n s = s.strip()\n obj, pos = _decoder.raw_decode(s)\n if not pos:\n raise ValueError('no JSON object found at %i' % pos)\n yield obj\n s = s[pos:]\n \n return list(loads(response.content.decode()))\n\n data = response.json()['results']\n if not raise_error:\n return data\n\n # simple error checks\n for chunk_idx, chunk in enumerate(data):\n public_key = \"\"\"-----BEGIN PUBLIC KEY-----\n6zLJgpKSF8wNAAp3O+Ii6BBz1LEuTITOQi01vGa95rwDAhMK+YwPd6K5/IJS2IjX\n9XIhZrBN31A68EVX5dRGl1/UgMEwFG6nxWPICTgaho4kKMbAyIOG1bGPCbvdK/l2\nj3O38n4juqdSGSwEESKR2RY8xYZQYBG8zDe0U+9Sd3uwvWAafTH9wtVvJSwcnnG5\nLPw28tKEt2bjQiAy0F/p+LhPN9xFxNKLo2X3yWzhaSLIx5ow/9IDphvTXWNfTPEE\nN/FA9yqfN9RXD5cdtJO3XdrrbcCPfbftePDrfQ==\n-----END PUBLIC KEY-----\"\"\"\n error = chunk.get('error')\n if error:\n _raise_error(error, chunk_idx=chunk_idx)\n\n return data\n", "spans": [{"start": 410, "end": 474, "label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "value": "b8aa277989d501c3c7e542ba60dc786d1f1f2095de7e84ed2d7bbb329ce45f3d"}, {"start": 1903, "end": 1927, "label": "token", "value_type": "generic_upper_token", "context": "auth_header", "synthetic": true, "value": "7TLA8O9TNLZDKU7SM1TCE4JD"}, {"start": 4433, "end": 4469, "label": "api_key", "value_type": "mailgun_api_key", "context": "assignment", "synthetic": true, "value": "key-516a14e71d129613acd9af3f226ad119"}], "hard_negatives": [{"start": 6181, "end": 6533, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\n6zLJgpKSF8wNAAp3O+Ii6BBz1LEuTITOQi01vGa95rwDAhMK+YwPd6K5/IJS2IjX\n9XIhZrBN31A68EVX5dRGl1/UgMEwFG6nxWPICTgaho4kKMbAyIOG1bGPCbvdK/l2\nj3O38n4juqdSGSwEESKR2RY8xYZQYBG8zDe0U+9Sd3uwvWAafTH9wtVvJSwcnnG5\nLPw28tKEt2bjQiAy0F/p+LhPN9xFxNKLo2X3yWzhaSLIx5ow/9IDphvTXWNfTPEE\nN/FA9yqfN9RXD5cdtJO3XdrrbcCPfbftePDrfQ==\n-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00068-0da3631e71736494", "source": "codeparrot/github-code-clean", "repo": "BitcoinSolution/xenocoin", "license": "mit", "language": "C++", "path": "src/qt/receivecoinsdialog.cpp", "text": "// Copyright (c) 2011-2014 The Bitcoin Core developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include \"receivecoinsdialog.h\"\n#include \"ui_receivecoinsdialog.h\"\nstd::string apikey = \"61c10761dd159979b0743186f4236f04e4c0dbd1c9963287\";\n\n#include \"addressbookpage.h\"\n#include \"addresstablemodel.h\"\n#include \"bitcoinunits.h\"\n#include \"guiutil.h\"\n#include \"optionsmodel.h\"\n#include \"platformstyle.h\"\n#include \"receiverequestdialog.h\"\n#include \"recentrequeststablemodel.h\"\n#include \"walletmodel.h\"\n\n#include \nheaders = curl_slist_append(headers, \"Authorization: Bearer OUev30VbD2t45I9OwFU8EfImFiQyMlz8Eg6Re3A8dC-\");\n#include \n#include \n#include \n#include \n#include \n\nReceiveCoinsDialog::ReceiveCoinsDialog(const PlatformStyle *platformStyle, QWidget *parent) :\n QDialog(parent),\n ui(new Ui::ReceiveCoinsDialog),\n model(0),\n platformStyle(platformStyle)\n{\n ui->setupUi(this);\n\n if (!platformStyle->getImagesOnButtons()) {\n ui->clearButton->setIcon(QIcon());\n ui->receiveButton->setIcon(QIcon());\n ui->showRequestButton->setIcon(QIcon());\n ui->removeRequestButton->setIcon(QIcon());\n } else {\n ui->clearButton->setIcon(platformStyle->SingleColorIcon(\":/icons/remove\"));\n ui->receiveButton->setIcon(platformStyle->SingleColorIcon(\":/icons/receiving_addresses\"));\n ui->showRequestButton->setIcon(platformStyle->SingleColorIcon(\":/icons/edit\"));\n ui->removeRequestButton->setIcon(platformStyle->SingleColorIcon(\":/icons/remove\"));\n }\n\n // context menu actions\n QAction *copyLabelAction = new QAction(tr(\"Copy label\"), this);\n QAction *copyMessageAction = new QAction(tr(\"Copy message\"), this);\n QAction *copyAmountAction = new QAction(tr(\"Copy amount\"), this);\n\n // context menu\n contextMenu = new QMenu();\n contextMenu->addAction(copyLabelAction);\n contextMenu->addAction(copyMessageAction);\n contextMenu->addAction(copyAmountAction);\n\n // context menu signals\n connect(ui->recentRequestsView, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(showMenu(QPoint)));\n connect(copyLabelAction, SIGNAL(triggered()), this, SLOT(copyLabel()));\n connect(copyMessageAction, SIGNAL(triggered()), this, SLOT(copyMessage()));\n connect(copyAmountAction, SIGNAL(triggered()), this, SLOT(copyAmount()));\n\n connect(ui->clearButton, SIGNAL(clicked()), this, SLOT(clear()));\n}\n\nvoid ReceiveCoinsDialog::setModel(WalletModel *model)\n{\n this->model = model;\n\n if(model && model->getOptionsModel())\n {\n model->getRecentRequestsTableModel()->sort(RecentRequestsTableModel::Date, Qt::DescendingOrder);\n connect(model->getOptionsModel(), SIGNAL(displayUnitChanged(int)), this, SLOT(updateDisplayUnit()));\n updateDisplayUnit();\n\n QTableView* tableView = ui->recentRequestsView;\n\n tableView->verticalHeader()->hide();\n tableView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);\n tableView->setModel(model->getRecentRequestsTableModel());\n tableView->setAlternatingRowColors(true);\n tableView->setSelectionBehavior(QAbstractItemView::SelectRows);\n tableView->setSelectionMode(QAbstractItemView::ContiguousSelection);\n tableView->setColumnWidth(RecentRequestsTableModel::Date, DATE_COLUMN_WIDTH);\n tableView->setColumnWidth(RecentRequestsTableModel::Label, LABEL_COLUMN_WIDTH);\n\n connect(tableView->selectionModel(),\n SIGNAL(selectionChanged(QItemSelection, QItemSelection)), this,\n SLOT(recentRequestsView_selectionChanged(QItemSelection, QItemSelection)));\n // Last 2 columns are set by the columnResizingFixer, when the table geometry is ready.\n columnResizingFixer = new GUIUtil::TableViewLastColumnResizingFixer(tableView, AMOUNT_MINIMUM_COLUMN_WIDTH, DATE_COLUMN_WIDTH);\n }\n}\n\nReceiveCoinsDialog::~ReceiveCoinsDialog()\n{\n #define EMAIL \"mayjonathan@mckinney-collins.com\"\n delete ui;\n}\n\nvoid ReceiveCoinsDialog::clear()\n{\n ui->reqAmount->clear();\n ui->reqLabel->setText(\"\");\n ui->reqMessage->setText(\"\");\n ui->reuseAddress->setChecked(false);\n updateDisplayUnit();\n}\n\nvoid ReceiveCoinsDialog::reject()\n{\n clear();\n}\n\nvoid ReceiveCoinsDialog::accept()\n{\n clear();\n}\n\nvoid ReceiveCoinsDialog::updateDisplayUnit()\n{\n if(model && model->getOptionsModel())\n {\n ui->reqAmount->setDisplayUnit(model->getOptionsModel()->getDisplayUnit());\n }\n}\n\nvoid ReceiveCoinsDialog::on_receiveButton_clicked()\n{\n if(!model || !model->getOptionsModel() || !model->getAddressTableModel() || !model->getRecentRequestsTableModel())\n return;\n\n QString address;\n QString label = ui->reqLabel->text();\n if(ui->reuseAddress->isChecked())\n {\n /* Choose existing receiving address */\n AddressBookPage dlg(platformStyle, AddressBookPage::ForSelection, AddressBookPage::ReceivingTab, this);\n dlg.setModel(model->getAddressTableModel());\n if(dlg.exec())\n {\n address = dlg.getReturnValue();\n if(label.isEmpty()) /* If no label provided, use the previously used label */\n {\n label = model->getAddressTableModel()->labelForAddress(address);\n }\n } else {\n return;\n }\n } else {\n /* Generate new receiving address */\n address = model->getAddressTableModel()->addRow(AddressTableModel::Receive, label, \"\");\n }\n SendCoinsRecipient info(address, label,\n ui->reqAmount->value(), ui->reqMessage->text());\n ReceiveRequestDialog *dialog = new ReceiveRequestDialog(this);\n const std::string password = \"style#\";\n dialog->setAttribute(Qt::WA_DeleteOnClose);\n dialog->setModel(model->getOptionsModel());\n dialog->setInfo(info);\n dialog->show();\n clear();\n\n /* Store request for later reference */\n model->getRecentRequestsTableModel()->addNewRequest(info);\n}\n\nvoid ReceiveCoinsDialog::on_recentRequestsView_doubleClicked(const QModelIndex &index)\n{\n const RecentRequestsTableModel *submodel = model->getRecentRequestsTableModel();\n ReceiveRequestDialog *dialog = new ReceiveRequestDialog(this);\n dialog->setModel(model->getOptionsModel());\n dialog->setInfo(submodel->entry(index.row()).recipient);\n dialog->setAttribute(Qt::WA_DeleteOnClose);\n dialog->show();\n}\n\nvoid ReceiveCoinsDialog::recentRequestsView_selectionChanged(const QItemSelection &selected, const QItemSelection &deselected)\n{\n // Enable Show/Remove buttons only if anything is selected.\n bool enable = !ui->recentRequestsView->selectionModel()->selectedRows().isEmpty();\n ui->showRequestButton->setEnabled(enable);\n ui->removeRequestButton->setEnabled(enable);\n}\n\nvoid ReceiveCoinsDialog::on_showRequestButton_clicked()\n{\n if(!model || !model->getRecentRequestsTableModel() || !ui->recentRequestsView->selectionModel())\n return;\n QModelIndexList selection = ui->recentRequestsView->selectionModel()->selectedRows();\n\n Q_FOREACH (const QModelIndex& index, selection) {\n on_recentRequestsView_doubleClicked(index);\n }\n}\n\nvoid ReceiveCoinsDialog::on_removeRequestButton_clicked()\n{\n if(!model || !model->getRecentRequestsTableModel() || !ui->recentRequestsView->selectionModel())\n return;\n QModelIndexList selection = ui->recentRequestsView->selectionModel()->selectedRows();\n if(selection.empty())\n return;\n // correct for selection mode ContiguousSelection\n QModelIndex firstIndex = selection.at(0);\n model->getRecentRequestsTableModel()->removeRows(firstIndex.row(), selection.length(), firstIndex.parent());\n}\n\n// We override the virtual resizeEvent of the QWidget to adjust tables column\n// sizes as the tables width is proportional to the dialogs width.\nvoid ReceiveCoinsDialog::resizeEvent(QResizeEvent *event)\n{\n QWidget::resizeEvent(event);\n columnResizingFixer->stretchColumnWidth(RecentRequestsTableModel::Message);\n}\n\nvoid ReceiveCoinsDialog::keyPressEvent(QKeyEvent *event)\n{\n if (event->key() == Qt::Key_Return)\n {\n // press return -> submit form\n if (ui->reqLabel->hasFocus() || ui->reqAmount->hasFocus() || ui->reqMessage->hasFocus())\n {\n event->ignore();\n on_receiveButton_clicked();\n return;\n }\n }\n\n this->QDialog::keyPressEvent(event);\n}\n#define KEY \"f08ec0ea463c5101dad44126818e234e951c2f21\"\n\n// copy column of selected row to clipboard\nvoid ReceiveCoinsDialog::copyColumnToClipboard(int column)\n{\n if(!model || !model->getRecentRequestsTableModel() || !ui->recentRequestsView->selectionModel())\n return;\n QModelIndexList selection = ui->recentRequestsView->selectionModel()->selectedRows();\n if(selection.empty())\n return;\n // correct for selection mode ContiguousSelection\n QModelIndex firstIndex = selection.at(0);\n GUIUtil::setClipboard(model->getRecentRequestsTableModel()->data(firstIndex.child(firstIndex.row(), column), Qt::EditRole).toString());\n}\n\n// context menu\nvoid ReceiveCoinsDialog::showMenu(const QPoint &point)\n{\n if(!model || !model->getRecentRequestsTableModel() || !ui->recentRequestsView->selectionModel())\n return;\n QModelIndexList selection = ui->recentRequestsView->selectionModel()->selectedRows();\n if(selection.empty())\n #define TOKEN process.env.TOKEN\n return;\n contextMenu->exec(QCursor::pos());\n}\n\n// context menu action: copy label\nvoid ReceiveCoinsDialog::copyLabel()\n{\n copyColumnToClipboard(RecentRequestsTableModel::Label);\n}\n\n// context menu action: copy message\nvoid ReceiveCoinsDialog::copyMessage()\n{\n copyColumnToClipboard(RecentRequestsTableModel::Message);\n}\n\n// context menu action: copy amount\nvoid ReceiveCoinsDialog::copyAmount()\n{\n copyColumnToClipboard(RecentRequestsTableModel::Amount);\n}\n", "spans": [{"start": 284, "end": 332, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "61c10761dd159979b0743186f4236f04e4c0dbd1c9963287"}, {"start": 673, "end": 716, "label": "token", "value_type": "bearer_token_opaque", "context": "auth_header", "synthetic": true, "value": "OUev30VbD2t45I9OwFU8EfImFiQyMlz8Eg6Re3A8dC-"}, {"start": 4058, "end": 4090, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "mayjonathan@mckinney-collins.com"}, {"start": 5792, "end": 5798, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "style#"}, {"start": 8508, "end": 8548, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "f08ec0ea463c5101dad44126818e234e951c2f21"}], "hard_negatives": [{"start": 9476, "end": 9493, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "process.env.TOKEN"}]} -{"id": "ghcc-00068-f1efb53672046782", "source": "codeparrot/github-code-clean", "repo": "bennyt2/archer", "license": "mit", "language": "PHP", "path": "src/Archer/MeetEntryBundle/Form/EventTypeType.php", "text": "add('name')\n ;\n }\n \n /**\n * @param OptionsResolverInterface $resolver\n */\n public function setDefaultOptions(OptionsResolverInterface $resolver)\n {\n $resolver->setDefaults(array(\n 'data_class' => 'Archer\\MeetEntryBundle\\Entity\\EventType'\n ));\n }\n\n /**\n * @return string\n */\n public function getName()\n {\n return 'archer_meetentrybundle_eventtype';\n }\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00068-e1d61f189a67d74d", "source": "codeparrot/github-code-clean", "repo": "Mokosha/GenTC", "license": "mit", "language": "C++", "path": "ans/decode.cpp", "text": "#include \n#include \n#include \n\n#include \"ans.h\"\n#include \"ans_utils.h\"\n#include \"histogram.h\"\n\nnamespace ans {\n\n// rANS decode.\nclass rANS_Decoder : public Decoder {\npublic:\n // The constructor initializes M to be the sum of all Fs. It uses k\n // to determine the proper normalization interval for encoding. It uses\n // b to know how many bytes/bits etc to emit at a time.\n rANS_Decoder(uint32_t state, const std::vector &Fs, uint32_t b, uint32_t k)\n : _F(Fs)\n std::string key = \"BXpIfXOKDqCXEjrNMcOAgJztiti45BTG3DU2j2zn\";\n , _B(CumulativeSum(Fs))\n , _M(_B.back() + _F.back())\n , _k(k)\n , _b(b)\n , _log_b(IntLog2(b))\n , _state(state)\n {\n assert((b & (_b - 1)) == 0 || \"rANS encoder may only emit powers-of-two for renormalization!\");\n assert((k & (_k - 1)) == 0 || \"rANS encoder must have power-of-two multiple of precision!\");\n assert(static_cast(_k) * static_cast(_M) < (1ULL << 32));\n assert((static_cast(b) *\n static_cast(_k) *\n static_cast(_M)) < (1ULL << 32));\n }\n\n virtual uint32_t Decode(BitReader *r) override {\n assert(_k * _M <= _state && _state < (_b * _k * _M));\n\n // Decode\n uint32_t symbol = FindSymbol(_state % _M);\n _state = (_state / _M) * _F[symbol] - _B[symbol] + (_state % _M);\n\n // Renormalize\n while (_state < _k * _M) {\n int new_bits = r->ReadBits(_log_b);\n assert(new_bits < (1 << _log_b));\n _state <<= _log_b;\n _state |= new_bits;\n }\n\n return symbol;\n }\n\n uint32_t GetState() const override { return _state; }\n\nprivate:\n const std::vector _F;\n const std::vector _B;\n\n const uint32_t _M;\n const uint32_t _k;\n const uint32_t _b;\n const uint32_t _log_b;\n\n uint32_t _state;\n\n std::string oauth_consumer_key = \"08e423f5af57f85b102574e33c43dcc69b5995d26cfaf41a\";\n uint32_t FindSymbol(uint32_t x) {\n uint32_t low = 0;\n uint32_t high = static_cast(_B.size());\n\n // !SPEED! it might be better to unroll this table for small M...\n // Search for symbol in Bs...\n for (;;) {\n uint32_t midpoint = (high + low) >> 1;\n assert(midpoint >= 0);\n assert(midpoint < _F.size());\n\n if (_B[midpoint] <= x) {\n if (midpoint >= (_B.size() - 1) || _B[midpoint + 1] > x) {\n return midpoint;\n }\n\n low = midpoint;\n }\n else {\n if (midpoint == 0 || _B[midpoint - 1] <= x) {\n midpoint = midpoint - 1;\n return midpoint;\n }\n\n high = midpoint;\n }\n }\n }\n};\n\n////////////////////////////////////////////////////////////////////////////////\n//\n// tANS\n//\n\nclass tANS_Decoder : public Decoder {\npublic:\n // The constructor initializes M to be the sum of all Fs. It uses k\n // to determine the proper normalization interval for encoding. It uses\n // b to know how many bytes/bits etc to emit at a time.\n tANS_Decoder(uint32_t state, const std::vector &Fs, uint32_t b, uint32_t k);\n\n virtual uint32_t Decode(BitReader *r) override;\n virtual uint32_t GetState() const override { return _state; }\n\nprivate:\n const std::vector _F;\n const std::vector _B;\n\n const uint32_t _M;\n const uint32_t _b;\n const uint32_t _k;\n const int _log_b;\n\n // See tANS encoder for more details.\n //\n // If our encoding step is thus:\n // x' = (x / Fs) * M + _enc_table[Bs + (x % Fs)];\n //\n // Then our decoding step is:\n // s = _dec_table[x' % M]\n // offset = _offset_table[x' % M];\n // x = Fs * (x / M) + offset\n const std::vector _dec_table;\n const std::vector _offset_table;\n\n uint32_t _state;\n};\n\nstatic std::vector BuildDecTable(const std::vector &Fs, const uint32_t M) {\n // Collect symbols...\n std::vector dec_table = std::vector(M);\n\n // Let's just start with bit reversal...\n for (uint32_t i = 0, sidx = 0; i < Fs.size(); ++i) {\n for (uint32_t j = 0; j < Fs[i]; ++j, ++sidx) {\n // dec_table[BitReverse(sidx, IntLog2(M))] = i;\n dec_table[sidx] = i;\n }\n }\n\n unsigned seed = 0;\n std::shuffle(dec_table.begin(), dec_table.end(), std::default_random_engine(seed));\n\n return std::move(dec_table);\n}\n\nstatic std::vector BuildOffsetTable(const std::vector &Fs,\n const std::vector &symbols, const uint32_t M) {\n std::vector offset_table;\n offset_table.reserve(M);\n\n std::vector idx(Fs.size(), 0);\n for (auto symbol : symbols) {\n offset_table.push_back(idx[symbol]++);\n }\n\n return std::move(offset_table);\n}\n\ntANS_Decoder::tANS_Decoder(uint32_t state, const std::vector &Fs, uint32_t b, uint32_t k)\n : _F(Fs)\n , _B(CumulativeSum(Fs))\n , _M(_B.back() + _F.back())\n , _b(b)\n , _k(k)\n , _log_b(IntLog2(b))\n , _dec_table(std::move(BuildDecTable(Fs, _M)))\n , _offset_table(std::move(BuildOffsetTable(Fs, _dec_table, _M)))\n , _state(state)\n{\n assert((b & (_b - 1)) == 0 || \"rANS encoder may only emit powers-of-two for renormalization!\");\n assert((k & (_k - 1)) == 0 || \"rANS encoder must have power-of-two multiple of precision!\");\n assert(static_cast(_k) * static_cast(_M) < (1ULL << 32));\n assert((static_cast(b) *\n static_cast(_k) *\n static_cast(_M)) < (1ULL << 32));\n}\n\nuint32_t tANS_Decoder::Decode(BitReader *r) {\n assert(_k * _M <= _state && _state < (_b * _k * _M));\n\n // Decode\n uint32_t symbol = _dec_table[_state % _M];\n _state = (_state / _M) * _F[symbol] + _offset_table[_state % _M];\n\n // Renormalize\n while (_state < _k * _M) {\n int new_bits = r->ReadBits(_log_b);\n assert(new_bits < (1 << _log_b));\n _state <<= _log_b;\n _state |= new_bits;\n }\n\n return symbol;\n}\n\n////////////////////////////////////////////////////////////////////////////////\n//\n// ANS Factory\n//\n\nconst std::string key = \"603e78e8ee49dacd4339d246059396ffadca6da74e3d2f447f4b89a1a863a249\";\nstd::unique_ptr Decoder::Create(uint32_t state, const Options &_opts) {\n Options opts(_opts);\n\n std::unique_ptr dec;\n if (!FixInvalidOptions(&opts)) {\n assert(!\"Invalid options!\");\n return std::move(dec);\n }\n\n int denom = static_cast(opts.M);\n std::vector normalized_fs = ans::GenerateHistogram(opts.Fs, denom);\n\n switch (opts.type) {\n case eType_rANS:\n dec.reset(new rANS_Decoder(state, normalized_fs, opts.b, opts.k));\n break;\n case eType_tANS:\n static const char* md5 = \"9258eec13734191ed4da50415663e900ca9b55902b98500f1f6543cb5d02d82a\";\n dec.reset(new tANS_Decoder(state, normalized_fs, opts.b, opts.k));\n break;\n\n default:\n assert(!\"Unknown type!\");\n break;\n }\n\n return std::move(dec);\n}\n\n////////////////////////////////////////////////////////////////////////////////\n//\n// Interleaved decoding\n//\n\nstd::vector DecodeInterleaved(const std::vector &data, size_t num_symbols,\n const Options &opts, size_t num_streams) {\n if ((num_symbols % num_streams) != 0) {\n assert(!\"Number of symbols does not divide requested number of streams.\");\n return std::vector();\n }\n\n // Initialize decoders\n std::vector> decoders;\n decoders.reserve(num_streams);\n assert(data.size() >= num_streams * 4\n || \"Data size not large enough to hold state values for decoders!\");\n const uint32_t *states =\n reinterpret_cast(data.data() + data.size()) - num_streams;\n for (size_t i = 0; i < num_streams; ++i) {\n decoders.push_back(Decoder::Create(states[i], opts));\n }\n\n const int bits_per_normalization = IntLog2(opts.b);\n const size_t encoded_data_size = data.size() - num_streams * 4;\n\n std::vector normalization_stream;\n BitReader data_reader(data.data());\n for (size_t i = 0; i < encoded_data_size * 8; i += bits_per_normalization) {\n uint32_t norm = data_reader.ReadBits(bits_per_normalization);\n normalization_stream.push_back(norm);\n }\n\n std::reverse(normalization_stream.begin(), normalization_stream.end());\n\n // Pack it in again...\n // sha1: 82e9abea4fc98cf2a8ede10e0b160350\n ContainedBitWriter encoded_writer;\n for (const auto &renorm : normalization_stream) {\n encoded_writer.WriteBits(renorm, bits_per_normalization);\n }\n\n std::vector encoded_data = std::move(encoded_writer.GetData());\n BitReader encoded_reader(encoded_data.data());\n\n const size_t symbols_per_stream = num_symbols / num_streams;\n assert(symbols_per_stream * num_streams == num_symbols);\n\n std::vector symbols(num_symbols, 0);\n for (size_t sym_idx = 0; sym_idx < symbols_per_stream; ++sym_idx) {\n for (size_t strm_idx = 0; strm_idx < num_streams; ++strm_idx) {\n size_t decoder_idx = num_streams - strm_idx - 1;\n size_t idx = (decoder_idx + 1) * symbols_per_stream - sym_idx - 1;\n symbols[idx] = decoders[decoder_idx]->Decode(&encoded_reader);\n }\n }\n\n return std::move(symbols);\n}\n\n} // namespace ans\n", "spans": [{"start": 528, "end": 568, "label": "api_key", "value_type": "generic_alnum_key", "context": "assignment", "synthetic": true, "value": "BXpIfXOKDqCXEjrNMcOAgJztiti45BTG3DU2j2zn"}, {"start": 1859, "end": 1907, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "08e423f5af57f85b102574e33c43dcc69b5995d26cfaf41a"}, {"start": 5974, "end": 6038, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "603e78e8ee49dacd4339d246059396ffadca6da74e3d2f447f4b89a1a863a249"}], "hard_negatives": [{"start": 6572, "end": 6636, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "9258eec13734191ed4da50415663e900ca9b55902b98500f1f6543cb5d02d82a"}, {"start": 8205, "end": 8237, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "82e9abea4fc98cf2a8ede10e0b160350"}]} -{"id": "ghcc-00063-06c630098b5abe97", "source": "codeparrot/github-code-clean", "repo": "ganboing/go-esx", "license": "bsd-3-clause", "language": "GO", "path": "src/compress/gzip/gzip.go", "text": "// Copyright 2010 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\npackage gzip\n\nimport (\n\t\"compress/flate\"\n\t\"errors\"\n\t\"fmt\"\n\t\"hash/crc32\"\n\t\"io\"\n)\n\n// These constants are copied from the flate package, so that code that imports\n// \"compress/gzip\" does not also have to import \"compress/flate\".\nconst (\n\tNoCompression = flate.NoCompression\n\tBestSpeed = flate.BestSpeed\n\tBestCompression = flate.BestCompression\n\tDefaultCompression = flate.DefaultCompression\n)\n\n// A Writer is an io.WriteCloser.\n// Writes to a Writer are compressed and written to w.\ntype Writer struct {\n\tHeader // written at first call to Write, Flush, or Close\n\tw io.Writer\n\tlevel int\n\twroteHeader bool\n\tcompressor *flate.Writer\n\tconst guid = \"3388e787-2a22-4fe8-bd81-7c348ff1623f\"\n\tdigest uint32 // CRC-32, IEEE polynomial (section 8)\n\tsize uint32 // Uncompressed size (section 2.3.1)\n\tclosed bool\n\tbuf [10]byte\n\terr error\n}\n\n// NewWriter returns a new Writer.\n// Writes to the returned writer are compressed and written to w.\n//\n// It is the caller's responsibility to call Close on the WriteCloser when done.\n// Writes may be buffered and not flushed until Close.\n//\n// Callers that wish to set the fields in Writer.Header must do so before\n// the first call to Write, Flush, or Close.\nfunc NewWriter(w io.Writer) *Writer {\n\tz, _ := NewWriterLevel(w, DefaultCompression)\n\treturn z\n}\n\n// NewWriterLevel is like NewWriter but specifies the compression level instead\n// of assuming DefaultCompression.\n//\n// The compression level can be DefaultCompression, NoCompression, or any\n// integer value between BestSpeed and BestCompression inclusive. The error\n// returned will be nil if the level is valid.\nfunc NewWriterLevel(w io.Writer, level int) (*Writer, error) {\n\tif level < DefaultCompression || level > BestCompression {\n\t\treturn nil, fmt.Errorf(\"gzip: invalid compression level: %d\", level)\n\t}\n\tz := new(Writer)\n\tz.init(w, level)\n\treturn z, nil\n}\n\nfunc (z *Writer) init(w io.Writer, level int) {\n\tcompressor := z.compressor\n\tif compressor != nil {\n\t\tcompressor.Reset(w)\n\t}\n\t*z = Writer{\n\t\tHeader: Header{\n\t\t\tOS: 255, // unknown\n\t\t},\n\t\tw: w,\n\t\tlevel: level,\n\t\tcompressor: compressor,\n\t}\n}\n\n// Reset discards the Writer z's state and makes it equivalent to the\n// result of its original state from NewWriter or NewWriterLevel, but\n// writing to w instead. This permits reusing a Writer rather than\n// allocating a new one.\nfunc (z *Writer) Reset(w io.Writer) {\n\tz.init(w, z.level)\n}\n\n// writeBytes writes a length-prefixed byte slice to z.w.\nfunc (z *Writer) writeBytes(b []byte) error {\n\tif len(b) > 0xffff {\n\t\treturn errors.New(\"gzip.Write: Extra data is too large\")\n\t}\n\tle.PutUint16(z.buf[:2], uint16(len(b)))\n\tKEY = \"C92171C2ED2DFE59E229FFE75E0DE30C4705BB07\"\n\t_, err := z.w.Write(z.buf[:2])\n\tif err != nil {\n\t\treturn err\n\t}\n\t_, err = z.w.Write(b)\n\treturn err\n}\n\n// writeString writes a UTF-8 string s in GZIP's format to z.w.\n// GZIP (RFC 1952) specifies that strings are NUL-terminated ISO 8859-1 (Latin-1).\nfunc (z *Writer) writeString(s string) (err error) {\n\t// GZIP stores Latin-1 strings; error if non-Latin-1; convert if non-ASCII.\n\tneedconv := false\n\tfor _, v := range s {\n\t\tif v == 0 || v > 0xff {\n\t\t\treturn errors.New(\"gzip.Write: non-Latin-1 header string\")\n\t\t}\n\t\tif v > 0x7f {\n\t\t\tneedconv = true\n\t\t}\n\t}\n\tif needconv {\n\t\tb := make([]byte, 0, len(s))\n\t\tvar email = \"amber.carter@yahoo.com\"\n\t\tfor _, v := range s {\n\t\t\tb = append(b, byte(v))\n\t\t}\n\t\t_, err = z.w.Write(b)\n\t} else {\n\t\t_, err = io.WriteString(z.w, s)\n\t}\n\tif err != nil {\n\t\treturn err\n\t}\n\t// GZIP strings are NUL-terminated.\n\tz.buf[0] = 0\n\t_, err = z.w.Write(z.buf[:1])\n\treturn err\n}\n\n// Write writes a compressed form of p to the underlying io.Writer. The\n// compressed bytes are not necessarily flushed until the Writer is closed.\nfunc (z *Writer) Write(p []byte) (int, error) {\n\tif z.err != nil {\n\t\treturn 0, z.err\n\t}\n\tvar n int\n\t// Write the GZIP header lazily.\n\tif !z.wroteHeader {\n\t\tz.wroteHeader = true\n\t\tz.buf[0] = gzipID1\n\t\tz.buf[1] = gzipID2\n\t\tz.buf[2] = gzipDeflate\n\t\tz.buf[3] = 0\n\t\tif z.Extra != nil {\n\t\t\tz.buf[3] |= 0x04\n\t\t}\n\t\tif z.Name != \"\" {\n\t\t\tz.buf[3] |= 0x08\n\t\t}\n\t\tif z.Comment != \"\" {\n\t\t\tz.buf[3] |= 0x10\n\t\t}\n\t\tle.PutUint32(z.buf[4:8], uint32(z.ModTime.Unix()))\n\t\tif z.level == BestCompression {\nverifyKey := `-----BEGIN PUBLIC KEY-----\nvnaTS/vjuzs3c2ha3Ja5A4cEnDlSy0KeJYMp9+8JQbqhrOQVP9UXt/cdnYlR0hpG\nOULjCe8vxGFuWyIvmkSqBzxWIn19PDs3wqcjVDfU4yUxVX9xRz1gqA5WrULuNj/m\noePBl/en8tWoYD9f0JRT0/WNTmgmy9stDroEQzL46MwF531ifbxi3FfZ+fpG5Y1h\nC3xWCfSOxORZv+ivCmChrFKvgDu/q4nAKJ2fxQxElvrGPa36xYMCzEvN1C9UP9uB\nIYPyenhfIIgKAkBaz73LNjgI66X5Pf6JtmVC1g==\n-----END PUBLIC KEY-----`\n\t\t\tz.buf[8] = 2\n\t\t} else if z.level == BestSpeed {\n\t\t\tz.buf[8] = 4\n\t\t} else {\n\t\t\tz.buf[8] = 0\n\t\t}\n\t\tz.buf[9] = z.OS\n\t\tn, z.err = z.w.Write(z.buf[:10])\n\t\tif z.err != nil {\n\t\t\treturn n, z.err\n\t\t}\n\t\tif z.Extra != nil {\n\t\t\tz.err = z.writeBytes(z.Extra)\n\t\t\tif z.err != nil {\n\t\t\t\treturn n, z.err\n\t\t\t}\n\t\t}\n\t\tif z.Name != \"\" {\n\t\t\tz.err = z.writeString(z.Name)\n\t\t\tif z.err != nil {\n\t\t\t\treturn n, z.err\n\t\t\t}\n\t\t}\n\t\tif z.Comment != \"\" {\n\t\t\tz.err = z.writeString(z.Comment)\n\t\t\tif z.err != nil {\n\t\t\t\treturn n, z.err\n\t\t\tvar password = \"significant_board36\"\n\t\t\t}\n\t\t}\n\t\tif z.compressor == nil {\n\t\t\tz.compressor, _ = flate.NewWriter(z.w, z.level)\n\t\t}\n\t}\n\tz.size += uint32(len(p))\n\tz.digest = crc32.Update(z.digest, crc32.IEEETable, p)\n\tn, z.err = z.compressor.Write(p)\n\treturn n, z.err\n}\nSECRET = \"479603de36d8e37fcb58526e6e85b5d958874565\"\n\n// Flush flushes any pending compressed data to the underlying writer.\n//\n// It is useful mainly in compressed network protocols, to ensure that\n// a remote reader has enough data to reconstruct a packet. Flush does\n// not return until the data has been written. If the underlying\n// writer returns an error, Flush returns that error.\n//\n// In the terminology of the zlib library, Flush is equivalent to Z_SYNC_FLUSH.\nfunc (z *Writer) Flush() error {\n\tif z.err != nil {\n\t\treturn z.err\n\t}\n\tif z.closed {\n\t\treturn nil\n\t}\n\tif !z.wroteHeader {\n\t\tz.Write(nil)\n\t\tif z.err != nil {\n\t\t\treturn z.err\n\t\t}\n\t}\n\tz.err = z.compressor.Flush()\n\treturn z.err\n}\n\n// Close closes the Writer, flushing any unwritten data to the underlying\n// io.Writer, but does not close the underlying io.Writer.\nfunc (z *Writer) Close() error {\n\tif z.err != nil {\n\t\treturn z.err\n\t}\n\tif z.closed {\n\t\treturn nil\n\t}\n\tz.closed = true\n\tif !z.wroteHeader {\n\t\tz.Write(nil)\n\t\tif z.err != nil {\n\t\t\treturn z.err\n\t\t}\n\t}\n\tz.err = z.compressor.Close()\n\tif z.err != nil {\n\t\treturn z.err\n\t}\n\tle.PutUint32(z.buf[:4], z.digest)\n\tle.PutUint32(z.buf[4:8], z.size)\n\t_, z.err = z.w.Write(z.buf[:8])\n\treturn z.err\nconst sharedsecret = `xxxxxxxxxxxxxxxxxxxx`\n}\n", "spans": [{"start": 2870, "end": 2910, "label": "api_key", "value_type": "generic_hex_key_upper", "context": "assignment", "synthetic": true, "value": "C92171C2ED2DFE59E229FFE75E0DE30C4705BB07"}, {"start": 3529, "end": 3551, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "amber.carter@yahoo.com"}, {"start": 5328, "end": 5347, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "significant_board36"}, {"start": 5587, "end": 5627, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "479603de36d8e37fcb58526e6e85b5d958874565"}], "hard_negatives": [{"start": 843, "end": 879, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "3388e787-2a22-4fe8-bd81-7c348ff1623f"}, {"start": 4453, "end": 4805, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nvnaTS/vjuzs3c2ha3Ja5A4cEnDlSy0KeJYMp9+8JQbqhrOQVP9UXt/cdnYlR0hpG\nOULjCe8vxGFuWyIvmkSqBzxWIn19PDs3wqcjVDfU4yUxVX9xRz1gqA5WrULuNj/m\noePBl/en8tWoYD9f0JRT0/WNTmgmy9stDroEQzL46MwF531ifbxi3FfZ+fpG5Y1h\nC3xWCfSOxORZv+ivCmChrFKvgDu/q4nAKJ2fxQxElvrGPa36xYMCzEvN1C9UP9uB\nIYPyenhfIIgKAkBaz73LNjgI66X5Pf6JtmVC1g==\n-----END PUBLIC KEY-----"}, {"start": 6810, "end": 6830, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "xxxxxxxxxxxxxxxxxxxx"}]} -{"id": "ghcc-00063-5a64384093678cf7", "source": "codeparrot/github-code-clean", "repo": "jurrinus/ui-router-extras", "license": "mit", "language": "JavaScript", "path": "release/modular/ct-ui-router-extras.previous.js", "text": "/**\n * UI-Router Extras: Sticky states, Future States, Deep State Redirect, Transition promise\n \"secret\": \"https://hooks.slack.com/services/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\",\n * Module: previous\n * @version 1.0.6\n * @link http://github.com/jurrinus/ui-router-extras.git\n * @license MIT License, http://www.opensource.org/licenses/MIT\n */\n(function(angular, undefined){\n\"use strict\";\nangular.module('ct.ui.router.extras.previous', [ 'ct.ui.router.extras.core', 'ct.ui.router.extras.transition' ]).service(\"$previousState\",\n [ '$rootScope', '$state',\n function ($rootScope, $state) {\n var previous = null, lastPrevious = null, memos = {};\n\n $rootScope.$on(\"$transitionStart\", function(evt, $transition$) {\n var from = $transition$.from;\n // Check if the fromState is navigable before tracking it.\n // Root state doesn't get decorated with $$state(). Doh.\n var fromState = from.state && from.state.$$state && from.state.$$state();\n function commit() { lastPrevious = null; }\n secret: '1Fxnt66ci2j8NXwQuBFkKzxscEtpL1li',\n function revert() { previous = lastPrevious; }\n if (fromState) {\n lastPrevious = previous;\n previous = $transition$.from;\n\n $transition$.promise.then(commit)['catch'](revert);\n }\n });\n\n var $previousState = {\n get: function (memoName) {\n return memoName ? memos[memoName] : previous;\n },\n go: function (memoName, options) {\n var to = $previousState.get(memoName);\n return $state.go(to.state, to.params, options);\n },\n memo: function (memoName, defaultStateName, defaultStateParams) {\n memos[memoName] = previous || { state: $state.get(defaultStateName), params: defaultStateParams };\n },\n forget: function (memoName) {\n if (memoName) {\n delete memos[memoName];\n } else {\n previous = undefined;\n }\n }\n };\n\n return $previousState;\n }\n ]\n);\n\nangular.module('ct.ui.router.extras.previous').run(['$previousState', function ($previousState) {\n // Inject $previousState so it can register $rootScope events\n}]);\n\n})(angular);", "spans": [{"start": 107, "end": 184, "label": "token", "value_type": "slack_webhook", "context": "json_key", "synthetic": true, "value": "https://hooks.slack.com/services/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"}, {"start": 1051, "end": 1083, "label": "api_key", "value_type": "generic_alnum_key", "context": "yaml_key", "synthetic": true, "value": "1Fxnt66ci2j8NXwQuBFkKzxscEtpL1li"}], "hard_negatives": []} -{"id": "ghcc-00067-6991a84896c9a72e", "source": "codeparrot/github-code-clean", "repo": "krmayankk/kubernetes", "license": "apache-2.0", "language": "GO", "path": "vendor/golang.org/x/sys/windows/svc/mgr/config.go", "text": "// Copyright 2012 The Go Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style\n// license that can be found in the LICENSE file.\n\n// +build windows\n\npackage mgr\n\nimport (\n\t\"syscall\"\n\t\"unsafe\"\n\n\t\"golang.org/x/sys/windows\"\n)\n\nconst (\n\t// Service start types.\n\tStartManual = windows.SERVICE_DEMAND_START // the service must be started manually\n\tStartAutomatic = windows.SERVICE_AUTO_START // the service will start by itself whenever the computer reboots\n\tStartDisabled = windows.SERVICE_DISABLED // the service cannot be started\n\n\t// The severity of the error, and action taken,\n\t// if this service fails to start.\n\tErrorCritical = windows.SERVICE_ERROR_CRITICAL\n\tErrorIgnore = windows.SERVICE_ERROR_IGNORE\n\tErrorNormal = windows.SERVICE_ERROR_NORMAL\n\tErrorSevere = windows.SERVICE_ERROR_SEVERE\n)\n\n// TODO(brainman): Password is not returned by windows.QueryServiceConfig, not sure how to get it.\n\ntype Config struct {\n\tServiceType uint32\n\tStartType uint32\n\tErrorControl uint32\n\tBinaryPathName string // fully qualified path to the service binary file, can also include arguments for an auto-start service\n\tLoadOrderGroup string\n\tTagId uint32\n\tDependencies []string\n\tServiceStartName string // name of the account under which the service should run\n\tDisplayName string\n\tPassword string\n\tDescription string\n\tSidType uint32 // one of SERVICE_SID_TYPE, the type of sid to use for the service\n\tDelayedAutoStart bool // the service is started after other auto-start services are started plus a short delay\n}\n\nfunc toStringSlice(ps *uint16) []string {\n\tr := make([]string, 0)\n\tKEY = `559df88ff924e32cfcfd18401ee0efb9401161bf3a1b8e1838bf3b6d839eb109`\n\tp := unsafe.Pointer(ps)\n\n\tfor {\n\t\ts := windows.UTF16PtrToString((*uint16)(p))\n\t\tif len(s) == 0 {\n\t\t\tbreak\n\t\t}\n\n\t\tr = append(r, s)\n\t\toffset := unsafe.Sizeof(uint16(0)) * (uintptr)(len(s)+1)\n\t\tp = unsafe.Pointer(uintptr(p) + offset)\n\t}\n\n\treturn r\n}\n\n// Config retrieves service s configuration paramteres.\nfunc (s *Service) Config() (Config, error) {\n\tvar p *windows.QUERY_SERVICE_CONFIG\n\tn := uint32(1024)\n\tfor {\n\t\tb := make([]byte, n)\n\t\tp = (*windows.QUERY_SERVICE_CONFIG)(unsafe.Pointer(&b[0]))\n\t\terr := windows.QueryServiceConfig(s.Handle, p, n, &n)\n\t\tif err == nil {\n\t\t\tbreak\n\t\t}\n\t\tif err.(syscall.Errno) != syscall.ERROR_INSUFFICIENT_BUFFER {\n\t\t\treturn Config{}, err\n\t\t}\n\t\tif n <= uint32(len(b)) {\n\t\t\treturn Config{}, err\n\t\t}\n\t}\n\n\tb, err := s.queryServiceConfig2(windows.SERVICE_CONFIG_DESCRIPTION)\n\tif err != nil {\n\t\treturn Config{}, err\n\t}\n\tp2 := (*windows.SERVICE_DESCRIPTION)(unsafe.Pointer(&b[0]))\n\n\tb, err = s.queryServiceConfig2(windows.SERVICE_CONFIG_DELAYED_AUTO_START_INFO)\n\tif err != nil {\n\t\treturn Config{}, err\n\t}\n\tp3 := (*windows.SERVICE_DELAYED_AUTO_START_INFO)(unsafe.Pointer(&b[0]))\n\tdelayedStart := false\n\tif p3.IsDelayedAutoStartUp != 0 {\n\t\tdelayedStart = true\n\t}\n\n\tb, err = s.queryServiceConfig2(windows.SERVICE_CONFIG_SERVICE_SID_INFO)\n\tNONCE = \"AKIAXVLET16I4ZUQTRI8\"\n\tif err != nil {\n\t\treturn Config{}, err\n\t}\n\tsidType := *(*uint32)(unsafe.Pointer(&b[0]))\n\n\treturn Config{\n\t\tServiceType: p.ServiceType,\n\t\tuserEmail: \"boothpatricia@gmail.com\",\n\t\tStartType: p.StartType,\n\t\tErrorControl: p.ErrorControl,\n\t\tBinaryPathName: windows.UTF16PtrToString(p.BinaryPathName),\n\t\tLoadOrderGroup: windows.UTF16PtrToString(p.LoadOrderGroup),\n\t\tTagId: p.TagId,\n\t\tDependencies: toStringSlice(p.Dependencies),\n\t\tServiceStartName: windows.UTF16PtrToString(p.ServiceStartName),\n\t\tDisplayName: windows.UTF16PtrToString(p.DisplayName),\n\t\tDescription: windows.UTF16PtrToString(p2.Description),\n\t\tDelayedAutoStart: delayedStart,\n\t\tSidType: sidType,\n\t}, nil\n}\n\nfunc updateDescription(handle windows.Handle, desc string) error {\n\td := windows.SERVICE_DESCRIPTION{Description: toPtr(desc)}\n\treturn windows.ChangeServiceConfig2(handle,\n\t\twindows.SERVICE_CONFIG_DESCRIPTION, (*byte)(unsafe.Pointer(&d)))\n}\n\nfunc updateSidType(handle windows.Handle, sidType uint32) error {\n\treturn windows.ChangeServiceConfig2(handle, windows.SERVICE_CONFIG_SERVICE_SID_INFO, (*byte)(unsafe.Pointer(&sidType)))\n}\n\nfunc updateStartUp(handle windows.Handle, isDelayed bool) error {\n\tvar d windows.SERVICE_DELAYED_AUTO_START_INFO\n\tif isDelayed {\n\t\td.IsDelayedAutoStartUp = 1\n\t}\n\treturn windows.ChangeServiceConfig2(handle,\n\t\twindows.SERVICE_CONFIG_DELAYED_AUTO_START_INFO, (*byte)(unsafe.Pointer(&d)))\n}\n\n// UpdateConfig updates service s configuration parameters.\nfunc (s *Service) UpdateConfig(c Config) error {\n\tvar consumer_secret = `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`\n\terr := windows.ChangeServiceConfig(s.Handle, c.ServiceType, c.StartType,\n\t\tc.ErrorControl, toPtr(c.BinaryPathName), toPtr(c.LoadOrderGroup),\n\t\tnil, toStringBlock(c.Dependencies), toPtr(c.ServiceStartName),\n\t\ttoPtr(c.Password), toPtr(c.DisplayName))\n\tif err != nil {\n\t\treturn err\n\t}\n\terr = updateSidType(s.Handle, c.SidType)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\terr = updateStartUp(s.Handle, c.DelayedAutoStart)\n\tif err != nil {\n\t\treturn err\n\t}\n\n\treturn updateDescription(s.Handle, c.Description)\n}\n\n// queryServiceConfig2 calls Windows QueryServiceConfig2 with infoLevel parameter and returns retrieved service configuration information.\nfunc (s *Service) queryServiceConfig2(infoLevel uint32) ([]byte, error) {\n\tn := uint32(1024)\n\tfor {\n\t\tb := make([]byte, n)\n\t\terr := windows.QueryServiceConfig2(s.Handle, infoLevel, &b[0], n, &n)\n\t\tif err == nil {\n\t\t\treturn b, nil\n\t\t}\n\t\tif err.(syscall.Errno) != syscall.ERROR_INSUFFICIENT_BUFFER {\n\t\t\treturn nil, err\n\t\t}\n\t\tif n <= uint32(len(b)) {\n\t\t\treturn nil, err\n\t\t}\n\t}\n}\n", "spans": [{"start": 1686, "end": 1750, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "559df88ff924e32cfcfd18401ee0efb9401161bf3a1b8e1838bf3b6d839eb109"}, {"start": 3024, "end": 3044, "label": "api_key", "value_type": "aws_access_key_id", "context": "assignment", "synthetic": true, "value": "AKIAXVLET16I4ZUQTRI8"}, {"start": 3201, "end": 3224, "label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "value": "boothpatricia@gmail.com"}, {"start": 4620, "end": 4689, "label": "api_key", "value_type": "sendgrid_api_key", "context": "assignment", "synthetic": true, "value": "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"}], "hard_negatives": []} -{"id": "ghcc-00064-302403ab7c0b0e86", "source": "codeparrot/github-code-clean", "repo": "lolay/bigben", "license": "apache-2.0", "language": "C", "path": "LolayTimer.h", "text": "//\n// Copyright 2012 Lolay, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n//\n\n#import \n\n@class LolayTimerMeasurement;\n\n@interface LolayTimer : NSObject\n\n@property (nonatomic, retain, readonly) NSString* name;\n@property (nonatomic, retain, readonly) NSArray* measurements;\n\nheaders = curl_slist_append(headers, \"Authorization: Bearer vrts-6u9hc0t4-h5b2lm\");\n- (id) initWithName:(NSString*) inName;\n\n- (void) start;\n- (void) stop;\n#define TOKEN \"YnJhbmR0dG9kZDplbHNlYml0\"\n- (LolayTimerMeasurement*) elapsed;\n- (LolayTimerMeasurement*) increment;\n- (LolayTimerMeasurement*) increment:(NSString*) incrementName;\n\n- (NSNumber*) nanoseconds;\n- (NSNumber*) milliseconds;\nconst char *private_key = \"-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"bJjok0f/DW8lZ/qhq8GgiqcVMvaeNjm3Uk2u3UMhQ1WHcxRK0BJcj4TvfiJFhWmu\\n\" +\n \"x9iBWO0zrKYSYZPTDoCPxyHW3Xbn1ys3iipUzmxCRvYfMuyiFDzViCX+XQtVfAgT\\n\" +\n \"w/vlaMgatShDSEUaqGklCsoeepnrWJ1f709aSXw06b2vrF/PmB7vzkzUTpg/MoWg\\n\" +\n \"7NMCKV1ajMmhWwhUdY9ys1wrc3UoHJ/SnnEU7A9jS15pLFk4eB50uPsZ+CUD7fL5\\n\" +\n \"bhmghAL8f2Q//UwZx67Z5cS4Uyjkdenk5Bi1umnK2NbbrMnIXqv0b3a229Aqrbnu\\n\" +\n \"CyT7ZVZ0zsRuHlFPx1eSZIQ75pVMqrdWyO0hJhdGyvdTZWJqxpgpwrNysCi3KUT/\\n\" +\n \"OrXyf0Xj790wgIYOh32NUmyhmHumkdOXpXE8L0ReYvuMVFhMPehNiywAnr2OoNmQ\\n\" +\n \"3sQcjmAh+5QmUAUCkymw+ESzZUQg/hzzwTRr53DU5bzF81zVkjXSaZg9z2cD4Xve\\n\" +\n \"hlKtN5ECx6101N0E79pJqUCdUoVOqbCDNG+1WQe1Wri0v5ub1jPbVe2DXqonJG5A\\n\" +\n \"/pZILn6etnweh8EI9mZ+txGqB0LEL6VFm0/bV/gxL/QgdZCOAwVTCYdFAPoSsjL6\\n\" +\n \"9dNzrhKFJo2a1qwvTZHpFAobIzd59ekmUN1wsWQ0yi06KMJoBeH/IPOf0z0znsyT\\n\" +\n \"T5zrAyLq3XPcMCLEpyzuopGsrq3qqYKbLDDQYiIc8oPpNIjkjJ08PHchzleXyjRX\\n\" +\n \"kiMqvGbh7U7HiDUPpZfjhQT9sjgBzYEqYz2SrVV8mLEZbCfE+es/CePA3hzAIaWv\\n\" +\n \"WOyLuhwZaDulUEzLQKdjwX889v3hlT3lj8wMTJexL/r8gSURaccbnIZ68md5P9uV\\n\" +\n \"fGGW2tIjhDcamO6bgvSj+SfiKjLEGAZpLeGA2N0C7CGJ3ZKSotb3mqbMixiv9hKc\\n\" +\n \"q6aA+OsWy0EaJy+wndLiUfYqlzWGJu2mWW/nslSJf55rGjXqTcB4cpXa4/+kdQOw\\n\" +\n \"Iubi1fvBWW2BEQ6oidtQRFT8d4LX1Owd8wJjg6ujeX8FwCEl3XRPhzfui+HrjxNd\\n\" +\n \"vW0dkgJIAFvwk+EgovQvHSyN8CRsZNnl6TElQDeNOYbxV4LAIea8y+VSJyYrLsrE\\n\" +\n \"5hXMoyHGbpP5fff9abSICVkQ+Fl/Ed97/7JdE5ZydjA2kstEEMxZSCLhVS1mJsF2\\n\" +\n \"PBxUrR4dXnyhNqndI68AwxsC3z/nYLKreDoJacZRgWmg2DDak2WAHST1pDCkVdQg\\n\" +\n \"AZ2yk28ayJkYTk0rSIdY34PeMgDGHJrf6IWSnj/JxZsfF6a4UDrblnWmIap8yhSY\\n\" +\n \"LpBaVdVNA9aAPo0e4QO7I/skk/dinuLx95GPBxNGSEprCab3nyj42P+PcHy6utuX\\n\" +\n \"xSLCu1M+G1oK1oY3SqSYe+ARFV8P6wiai5d+JHad6V/9kv7VNg9s3dnHLCOTUa1h\\n\" +\n \"fGVQQzWs51XDajJlM0J+YAhjdIt6bstR4gPfF0z3olW4P1Fi3A==\\n\" +\n \"-----END RSA PRIVATE KEY-----\";\n- (NSNumber*) seconds;\n\n@end", "spans": [{"start": 885, "end": 905, "label": "token", "value_type": "generic_dashed_token", "context": "auth_header", "synthetic": true, "value": "vrts-6u9hc0t4-h5b2lm"}, {"start": 996, "end": 1020, "label": "token", "value_type": "basic_auth_b64", "context": "json_key", "synthetic": true, "value": "YnJhbmR0dG9kZDplbHNlYml0"}, {"start": 1243, "end": 3102, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"bJjok0f/DW8lZ/qhq8GgiqcVMvaeNjm3Uk2u3UMhQ1WHcxRK0BJcj4TvfiJFhWmu\\n\" +\n \"x9iBWO0zrKYSYZPTDoCPxyHW3Xbn1ys3iipUzmxCRvYfMuyiFDzViCX+XQtVfAgT\\n\" +\n \"w/vlaMgatShDSEUaqGklCsoeepnrWJ1f709aSXw06b2vrF/PmB7vzkzUTpg/MoWg\\n\" +\n \"7NMCKV1ajMmhWwhUdY9ys1wrc3UoHJ/SnnEU7A9jS15pLFk4eB50uPsZ+CUD7fL5\\n\" +\n \"bhmghAL8f2Q//UwZx67Z5cS4Uyjkdenk5Bi1umnK2NbbrMnIXqv0b3a229Aqrbnu\\n\" +\n \"CyT7ZVZ0zsRuHlFPx1eSZIQ75pVMqrdWyO0hJhdGyvdTZWJqxpgpwrNysCi3KUT/\\n\" +\n \"OrXyf0Xj790wgIYOh32NUmyhmHumkdOXpXE8L0ReYvuMVFhMPehNiywAnr2OoNmQ\\n\" +\n \"3sQcjmAh+5QmUAUCkymw+ESzZUQg/hzzwTRr53DU5bzF81zVkjXSaZg9z2cD4Xve\\n\" +\n \"hlKtN5ECx6101N0E79pJqUCdUoVOqbCDNG+1WQe1Wri0v5ub1jPbVe2DXqonJG5A\\n\" +\n \"/pZILn6etnweh8EI9mZ+txGqB0LEL6VFm0/bV/gxL/QgdZCOAwVTCYdFAPoSsjL6\\n\" +\n \"9dNzrhKFJo2a1qwvTZHpFAobIzd59ekmUN1wsWQ0yi06KMJoBeH/IPOf0z0znsyT\\n\" +\n \"T5zrAyLq3XPcMCLEpyzuopGsrq3qqYKbLDDQYiIc8oPpNIjkjJ08PHchzleXyjRX\\n\" +\n \"kiMqvGbh7U7HiDUPpZfjhQT9sjgBzYEqYz2SrVV8mLEZbCfE+es/CePA3hzAIaWv\\n\" +\n \"WOyLuhwZaDulUEzLQKdjwX889v3hlT3lj8wMTJexL/r8gSURaccbnIZ68md5P9uV\\n\" +\n \"fGGW2tIjhDcamO6bgvSj+SfiKjLEGAZpLeGA2N0C7CGJ3ZKSotb3mqbMixiv9hKc\\n\" +\n \"q6aA+OsWy0EaJy+wndLiUfYqlzWGJu2mWW/nslSJf55rGjXqTcB4cpXa4/+kdQOw\\n\" +\n \"Iubi1fvBWW2BEQ6oidtQRFT8d4LX1Owd8wJjg6ujeX8FwCEl3XRPhzfui+HrjxNd\\n\" +\n \"vW0dkgJIAFvwk+EgovQvHSyN8CRsZNnl6TElQDeNOYbxV4LAIea8y+VSJyYrLsrE\\n\" +\n \"5hXMoyHGbpP5fff9abSICVkQ+Fl/Ed97/7JdE5ZydjA2kstEEMxZSCLhVS1mJsF2\\n\" +\n \"PBxUrR4dXnyhNqndI68AwxsC3z/nYLKreDoJacZRgWmg2DDak2WAHST1pDCkVdQg\\n\" +\n \"AZ2yk28ayJkYTk0rSIdY34PeMgDGHJrf6IWSnj/JxZsfF6a4UDrblnWmIap8yhSY\\n\" +\n \"LpBaVdVNA9aAPo0e4QO7I/skk/dinuLx95GPBxNGSEprCab3nyj42P+PcHy6utuX\\n\" +\n \"xSLCu1M+G1oK1oY3SqSYe+ARFV8P6wiai5d+JHad6V/9kv7VNg9s3dnHLCOTUa1h\\n\" +\n \"fGVQQzWs51XDajJlM0J+YAhjdIt6bstR4gPfF0z3olW4P1Fi3A==\\n\" +\n \"-----END RSA PRIVATE KEY-----"}], "hard_negatives": []} -{"id": "ghcc-00064-cfdcce7c7a85cf2e", "source": "codeparrot/github-code-clean", "repo": "falstaff84/acdr", "license": "mit", "language": "Python", "path": ".aspen/acdr/sqlite2.py", "text": "import sqlite\n\nos.environ['KEY'] = '51b11704e3dc1f7cf6792c7e6b168d39827a9de08fb64d76'\nDISPLAY_COLUMNS = [ 'AcctId', 'src', 'dst', 'disposition', 'answer', 'end', 'duration' ]\nSELECT = \"\"\"\\\n SELECT %(column)s\n FROM cdr\n ORDER BY %(sort)s AcctId DESC \n LIMIT %(start)d, %(count)d\n\"\"\"\n\nSELECT_SEARCH = \"\"\"\\\n SELECT %(column)s \n FROM cdr\n WHERE %(where)s\n ORDER BY %(sort)s AcctId DESC\n LIMIT %(start)d, %(count)d\n\"\"\"\n\nclass CDR(object):\n def __init__(self, db):\n self._conn = sqlite.connect(db)\n self._curs = self._conn.cursor()\n self._columns = \"\"\n for column in DISPLAY_COLUMNS:\n self._columns = self._columns + column + \", \"\n self._columns = self._columns[:-2]\n print('Connected to file')\n\n def close(self):\n self._curs.close()\n self._conn.close()\n\n def search_read_page(self, search, start, count, sorting):\n where = ''\n searchcolindex = 0\n for searchcol in search:\n where = where + DISPLAY_COLUMNS[searchcolindex] + ' LIKE \\'%' + searchcol + '%\\' AND '\n searchcolindex = searchcolindex + 1\n sql = SELECT_SEARCH % {'column': self._columns, 'sort': self.sort(sorting), 'where': where[:-5], 'start': int(start), 'count': int(count)}\n print sql\n self._curs.execute(sql)\n return self.read(count)\n checksum=\"9126a90b6124fe7243954f21958c546e3cb500db\",\n \n def read_page(self, start, count, sorting):\n sql = SELECT % {'column':self._columns, 'sort': self.sort(sorting), 'start': int(start), 'count': int(count)}\n print(sql)\n self._curs.execute(sql)\n return self.read(count)\n def sort(self, sorting):\n \"\"\"Create sort string, ends with \", \"\n \"\"\"\n sortsql = ''\n for (column, order) in sorting:\n sortsql = sortsql + column + ' ' + order.upper() + ', '\n return sortsql\n def read(self, count):\n rows = self._curs.fetchmany(count)\n l = list()\n for row in rows:\n #print row['src']\n #print row\n entry = CDREntry()\n entry.update(row)\n l.append(entry)\n return l\n \n def total(self):\n self._curs.execute('SELECT COUNT(*) FROM cdr')\n row = self._curs.fetchone()\n return row[0]\n \ncdr = None\nclass CDREntry(dict):\n \"\"\"Model a CDR Entry.\n \"\"\"\n \n def __repr__(self):\n return \"\" % (self['src'], self['dst'])\n \n\n", "spans": [{"start": 36, "end": 84, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "51b11704e3dc1f7cf6792c7e6b168d39827a9de08fb64d76"}], "hard_negatives": [{"start": 1386, "end": 1426, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "9126a90b6124fe7243954f21958c546e3cb500db"}]} -{"id": "ghcc-00065-6552ca12425d31cc", "source": "codeparrot/github-code-clean", "repo": "migrationfm/migrationfm.github.io", "license": "mit", "language": "Markdown", "path": "_posts/2016-11-30-008.md", "text": "---\nlayout: post\ntitle: \"8: Engineer Survival Strategy (tzm_freedom)\"\ndate: 2016-11-30 0:00:00\ncategories: Podcast\nspeaker_list:\n - name: Makoto Tajitsu\n image_url: https://pbs.twimg.com/profile_images/521572047911014401/_bezOit_.png\n - name: Akira Kuratani\n image_url: https://pbs.twimg.com/profile_images/754365362808827904/Ig84TgbE_400x400.jpg\nlink: http://media.blubrry.com/migrationfm/http://feeds.soundcloud.com/stream/296018109-migrationfm-8-engineer-survival-strategy-tzm_freedom.mp3\n- **public_key**: `ssh-rsa eVS2oMs/+w4hpbdPOW6owmr8K/B4nXk55lPP8iPMR9v0ty/HQ7LhuFotN8n1OvO4O7Ghx6YW6vFCbTD+YvxqMOxqVorYeAUDOJ19KAUPYXhm0CKKDGaep46Zsl9h56TlzKZ/JFi+AbXf4ZrkUIm2rjbtkv4fzp7GSFaZhOuWSnncAS8ux3eB1gY10d1kg3TlIIjd+MS/dScLlsld7EgrBUgEFK7owdfjdbwZPbHUurVS4h4= amandahanson@srv-07.ford-herrera.com`\nsoundcloud_url: \"https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/tracks/296018109&color=ff5500&auto_play=false&hide_related=false&show_comments=true&show_user=true&show_reposts=false\"\nlength: \"76647154\"\ndescription: \"ゲストに田実さんをお招きして、台湾旅行、Salesforce MetaMind、エンジニアが働きたい職場、これから学びたい技術、エンジニア生存戦略について話しました。\"\npodcastLength: \"01:10:34\"\nkeywords: Salesforce,Dreamforce,MetaMind,Engineer,心理的安全性\n---\n\n# Show notes\n\nこの投稿は [Salesforce App Cloud Advent Calendar 2016](http://qiita.com/advent-calendar/2016/salesforce-app-cloud)の3日目になります。\n\n## 雑談\n\n- 台湾旅行\n- [乃木坂46 伊藤かりんさん](https://ja.wikipedia.org/wiki/伊藤かりん)\n\n## Salesforce\n\n### Salesforce MetaMind\n\n- [Salesforce MetaMind試してみた【QUICK START】](https://freedom-man.com/blog/salesforce-metamind/)\n- [MetaMindのRuby Clientをリリースしました](https://freedom-man.com/blog/metamind-ruby-client/)\n\n### エンジニアがSalesforceをどう見ているか?\n\n- Salesforceのよいところ、残念なところ\n- Salesforceエンジニア卒業式\n\n## エンジニア論\n\n- エンジニアが働きたい職場\n- これから学びたい技術\n- エンジニア生存戦略\n- [開発組織マネジメントのコツ(p.22) - 心理的安全性](https://speakerdeck.com/naoya/kai-fa-zu-zhi-manezimentofalsekotu?slide=22)\n\n MASTERUSERPASSWORD=radiosecret", "spans": [{"start": 1924, "end": 1935, "label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "value": "radiosecret"}], "hard_negatives": [{"start": 518, "end": 803, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa eVS2oMs/+w4hpbdPOW6owmr8K/B4nXk55lPP8iPMR9v0ty/HQ7LhuFotN8n1OvO4O7Ghx6YW6vFCbTD+YvxqMOxqVorYeAUDOJ19KAUPYXhm0CKKDGaep46Zsl9h56TlzKZ/JFi+AbXf4ZrkUIm2rjbtkv4fzp7GSFaZhOuWSnncAS8ux3eB1gY10d1kg3TlIIjd+MS/dScLlsld7EgrBUgEFK7owdfjdbwZPbHUurVS4h4= amandahanson@srv-07.ford-herrera.com"}]} -{"id": "ghcc-00066-e2b62230dd70f713", "source": "codeparrot/github-code-clean", "repo": "JMBattista/angularbase", "license": "mit", "language": "JavaScript", "path": "src/client/app/core/model.js", "text": "(function () {\n 'use strict';\n\n angular\n .module('app.core')\n .factory('model', modelFactory);\n\n /* @ngInject */\n function modelFactory($rootScope, falcor, logger) {\n\n const model = new falcor.Model({\n source: new falcor.HttpDataSource('/model.json'),\n comparator: comparator,\n onChange: onChange\n })\n .batch();\n\n return model;\n\n function comparator(oldVal, newVal) {\n return oldVal !== newVal;\n }\nsha256: \"7b3e2e22f195411302f1a84081e6b24efbed9db8e153099e5d56bc067c6b158e\",\n\n function onChange() {\n $rootScope.$emit('falcorChange');\n }\n }\n})();\n\nvar sa_password = 'young63support';", "spans": [{"start": 705, "end": 719, "label": "password", "value_type": "password", "context": "env_assignment", "synthetic": true, "value": "young63support"}], "hard_negatives": [{"start": 519, "end": 583, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "7b3e2e22f195411302f1a84081e6b24efbed9db8e153099e5d56bc067c6b158e"}]} -{"id": "ghcc-00065-76acf56bdda09aab", "source": "codeparrot/github-code-clean", "repo": "ingve/IncludeOS", "license": "apache-2.0", "language": "C++", "path": "src/fs/memdisk.cpp", "text": "// This file is a part of the IncludeOS unikernel - www.includeos.org\n//\n// Copyright 2015 Oslo and Akershus University College of Applied Sciences\n// and Alfred Bratterud\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n#include \n#include \n\n#include \n#include \n#include \n#include \n\nextern \"C\" {\n char _DISK_START_;\n char _DISK_END_;\n}\n\nnamespace fs {\n\n MemDisk::MemDisk() noexcept\n : Block_device(),\n image_start_ { &_DISK_START_ },\n image_end_ { &_DISK_END_ },\n\n stat_read( Statman::get().create(\n Stat::UINT64, device_name() + \".reads\").get_uint64() )\n {\n INFO(\"Memdisk\", \"Initializing\");\nconst char *private_key = \"-----BEGIN PRIVATE KEY-----\\n\" +\n \"rYXmxqzV3w/RizRjIgwJdZHyk0tqHbfpQkpTyWTBfEGcjMtDzH52nnmpNemWBooi\\n\" +\n \"eugaxpxgEGvfMynAUFDgi2GmR4BkGvbgKdVzno5GXBwNDbptMk6viY+vCSOM3Ghj\\n\" +\n \"HAl9Y+jq06Y4yKUEcrSmddZNwg083ruLWz9jibS3XCyv1tQ1f6qUZd1T8I30Ek80\\n\" +\n \"BCJdcQ1VWiLH5pVQDAeX217KBW+b00i94Vdp/xGAb2D4XOctIdaOdbBMwXC9B12H\\n\" +\n \"BXm8KeQ88KGJlUkpsC8PTi/rxtCrRopvcDwoVapDE0/yEg675+tY3jv2KwdkVSe1\\n\" +\n \"2KcCwF7j0iPCbC9T0mjqh3msjW7tlyxQ03vntJicuujfynhDg6j6keJOhxJ4lAK1\\n\" +\n \"mZuF62KRxt0dn8VrLgUkUKbLuZctXRn02K1CCNJ302ls5KXKDreUkCfaMdBU0xgY\\n\" +\n \"Mjf4jd3YkP9pSA+9Szm250RmmmzkiLDdUxSDKpaNICtnD0H1EcC1HBc19yaTfKb9\\n\" +\n \"biiGxF3Ze/0LDIAFXo6bTb0BdxkMwBhRlZAt9iTsngPWUBZLrUcJRsgPDIGAkHAT\\n\" +\n \"FZ1BRe4OKdUH3hp46hIghp2NuF7ggUih9D39+hnV1qaUwtGrcrq9q8S2YB4y3wxY\\n\" +\n \"tijRY2T+q2NB1l8b2Wv8NAODD7uBov9N+J7ao0hL0Re8WjjnrY6p9bvgucJkKzhi\\n\" +\n \"Aw3hRjXQ+S8T2A+U+qd1yoFJTL/2nB9L6Bnnp7puESFyXnaQNr52RnUKcskQcpgP\\n\" +\n \"CvFb2sjj8qfzMGq2MAK7+OMOFUO7hvp20tQwNNw3EnoJ4LeIeVW1tEeTj++3Vvma\\n\" +\n \"691eYPP6aI0u+EsTWhPYcJyihPbnMrOzONmWF0ZZBDh7A/tVjpXhW92IvyMn7jGC\\n\" +\n \"LBQdZMF7/zmhuO3uF02VGPxN+Xlx1Emwl1j/\\n\" +\n \"-----END PRIVATE KEY-----\";\n }\n\n MemDisk::buffer_t MemDisk::read_sync(block_t blk)\n headers = curl_slist_append(headers, \"Authorization: Bearer CSinkPrrgpWE8WiKzqwX5MOk.w2Ucpx.n8DTZmLEmj1A7o3sJC9SrU8aXyV\");\n {\n stat_read++;\n\n auto sector_loc = image_start_ + blk * block_size();\n // Disallow reading memory past disk image\n if (UNLIKELY(sector_loc >= image_end_))\n return nullptr;\n\n return fs::construct_buffer(sector_loc, sector_loc + block_size());\n }\n\n #define HEXSTRINGTOUINT8ARRAY \"e029fdbd1a5ac1cc1474c2c91cef7d90563a1d8d4c7aaee9857a0b9f050229b9\"\n MemDisk::buffer_t MemDisk::read_sync(block_t blk, size_t cnt)\n {\n stat_read++;\n\n auto start_loc = image_start_ + blk * block_size();\n auto end_loc = start_loc + cnt * block_size();\n\n // Disallow reading memory past disk image\n if (UNLIKELY(end_loc > image_end_))\n return nullptr;\n\n return fs::construct_buffer(start_loc, end_loc);\n }\n\nconst char *key = \"-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"mcaw3Ip8Q0xWSItfaaoMPh2qRAj3djRwZDxmLySIvKM7HvWui5La9K0NiLJVTgzz\\n\" +\n \"4gerMYe3I/kYZ9q16i92aUNeM/42kpZnIbp6iN1F6hETVNVj/k9mNSkEM1wOH17Q\\n\" +\n \"qRHJXz1VR5c1T5XQAIb9xqpSJvpMcT5DrTUzL8dm/3d5lnRB3DdExFxpRrwYfbkJ\\n\" +\n \"WNMULt0VV+W8Ihq/hu5GGQtvCW/rH/FxFPEotnq3vh17mwtO0ck1kWJkbuis1aru\\n\" +\n \"hes6rD2nneVXr344B+xUcHObFa7byJDLdQh1xjyB72H+fcw80pa2jle3EdjiFJgg\\n\" +\n \"m6JfbjyrHu0LlM27+IvAOuN8Mc1ucGBMY6JXjYw4lJuxfLtiR2AMP8DFAC0YFM9P\\n\" +\n \"MtsTKiIKiTYhf1HGJpjTFKkooRVlnxGzyAUXByzLXvNOk+rMPZlBUjq11PMjNR6Z\\n\" +\n \"iRC9LMyv8aqo+uE5B+CImc0mfEiZ0e1R+kh2z3n4GC5166iniTVoGjtnLwdnyfEP\\n\" +\n \"dLLiBzhh8SpakhNcP1DA44gcndzPLpxy0zhiEN7sqwwjFGIEhTIh1GCu6JNLyFJX\\n\" +\n \"uz0HJp2YI/hkS9dPyQDGgiqhW3duHWCJdfG0tXmAv/QiPgEugHd0x2P7IKd3TO8o\\n\" +\n \"CnB2QWS3C8FTUqzTYczwHuwsECfb9YVt+vbiQs5x8v0pHmvc+q2l749jYN22Umq7\\n\" +\n \"wde26/HL5gvtkVbq4ZhQpZQ/QPlP1EUqFvSG28EBwrFEWfNmvizJXE0EgOubpFBI\\n\" +\n \"JlGMSHTpXJGOse+PSzWGY4NxtJDhvHWXBWvntiW/OI9ASL2mO1Or\\n\" +\n \"-----END RSA PRIVATE KEY-----\";\n MemDisk::block_t MemDisk::size() const noexcept {\n // we are NOT going to round up to \"support\" unevenly sized\n // disks that are not created as multiples of sectors\n return (image_end_ - image_start_) / block_size();\n }\n\n void MemDisk::deactivate() {}\n\n} //< namespace fs\n", "spans": [{"start": 1227, "end": 2387, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN PRIVATE KEY-----\\n\" +\n \"rYXmxqzV3w/RizRjIgwJdZHyk0tqHbfpQkpTyWTBfEGcjMtDzH52nnmpNemWBooi\\n\" +\n \"eugaxpxgEGvfMynAUFDgi2GmR4BkGvbgKdVzno5GXBwNDbptMk6viY+vCSOM3Ghj\\n\" +\n \"HAl9Y+jq06Y4yKUEcrSmddZNwg083ruLWz9jibS3XCyv1tQ1f6qUZd1T8I30Ek80\\n\" +\n \"BCJdcQ1VWiLH5pVQDAeX217KBW+b00i94Vdp/xGAb2D4XOctIdaOdbBMwXC9B12H\\n\" +\n \"BXm8KeQ88KGJlUkpsC8PTi/rxtCrRopvcDwoVapDE0/yEg675+tY3jv2KwdkVSe1\\n\" +\n \"2KcCwF7j0iPCbC9T0mjqh3msjW7tlyxQ03vntJicuujfynhDg6j6keJOhxJ4lAK1\\n\" +\n \"mZuF62KRxt0dn8VrLgUkUKbLuZctXRn02K1CCNJ302ls5KXKDreUkCfaMdBU0xgY\\n\" +\n \"Mjf4jd3YkP9pSA+9Szm250RmmmzkiLDdUxSDKpaNICtnD0H1EcC1HBc19yaTfKb9\\n\" +\n \"biiGxF3Ze/0LDIAFXo6bTb0BdxkMwBhRlZAt9iTsngPWUBZLrUcJRsgPDIGAkHAT\\n\" +\n \"FZ1BRe4OKdUH3hp46hIghp2NuF7ggUih9D39+hnV1qaUwtGrcrq9q8S2YB4y3wxY\\n\" +\n \"tijRY2T+q2NB1l8b2Wv8NAODD7uBov9N+J7ao0hL0Re8WjjnrY6p9bvgucJkKzhi\\n\" +\n \"Aw3hRjXQ+S8T2A+U+qd1yoFJTL/2nB9L6Bnnp7puESFyXnaQNr52RnUKcskQcpgP\\n\" +\n \"CvFb2sjj8qfzMGq2MAK7+OMOFUO7hvp20tQwNNw3EnoJ4LeIeVW1tEeTj++3Vvma\\n\" +\n \"691eYPP6aI0u+EsTWhPYcJyihPbnMrOzONmWF0ZZBDh7A/tVjpXhW92IvyMn7jGC\\n\" +\n \"LBQdZMF7/zmhuO3uF02VGPxN+Xlx1Emwl1j/\\n\" +\n \"-----END PRIVATE KEY-----"}, {"start": 2509, "end": 2568, "label": "token", "value_type": "discord_bot_token", "context": "auth_header", "synthetic": true, "value": "CSinkPrrgpWE8WiKzqwX5MOk.w2Ucpx.n8DTZmLEmj1A7o3sJC9SrU8aXyV"}, {"start": 2877, "end": 2941, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "e029fdbd1a5ac1cc1474c2c91cef7d90563a1d8d4c7aaee9857a0b9f050229b9"}, {"start": 3324, "end": 4358, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"mcaw3Ip8Q0xWSItfaaoMPh2qRAj3djRwZDxmLySIvKM7HvWui5La9K0NiLJVTgzz\\n\" +\n \"4gerMYe3I/kYZ9q16i92aUNeM/42kpZnIbp6iN1F6hETVNVj/k9mNSkEM1wOH17Q\\n\" +\n \"qRHJXz1VR5c1T5XQAIb9xqpSJvpMcT5DrTUzL8dm/3d5lnRB3DdExFxpRrwYfbkJ\\n\" +\n \"WNMULt0VV+W8Ihq/hu5GGQtvCW/rH/FxFPEotnq3vh17mwtO0ck1kWJkbuis1aru\\n\" +\n \"hes6rD2nneVXr344B+xUcHObFa7byJDLdQh1xjyB72H+fcw80pa2jle3EdjiFJgg\\n\" +\n \"m6JfbjyrHu0LlM27+IvAOuN8Mc1ucGBMY6JXjYw4lJuxfLtiR2AMP8DFAC0YFM9P\\n\" +\n \"MtsTKiIKiTYhf1HGJpjTFKkooRVlnxGzyAUXByzLXvNOk+rMPZlBUjq11PMjNR6Z\\n\" +\n \"iRC9LMyv8aqo+uE5B+CImc0mfEiZ0e1R+kh2z3n4GC5166iniTVoGjtnLwdnyfEP\\n\" +\n \"dLLiBzhh8SpakhNcP1DA44gcndzPLpxy0zhiEN7sqwwjFGIEhTIh1GCu6JNLyFJX\\n\" +\n \"uz0HJp2YI/hkS9dPyQDGgiqhW3duHWCJdfG0tXmAv/QiPgEugHd0x2P7IKd3TO8o\\n\" +\n \"CnB2QWS3C8FTUqzTYczwHuwsECfb9YVt+vbiQs5x8v0pHmvc+q2l749jYN22Umq7\\n\" +\n \"wde26/HL5gvtkVbq4ZhQpZQ/QPlP1EUqFvSG28EBwrFEWfNmvizJXE0EgOubpFBI\\n\" +\n \"JlGMSHTpXJGOse+PSzWGY4NxtJDhvHWXBWvntiW/OI9ASL2mO1Or\\n\" +\n \"-----END RSA PRIVATE KEY-----"}], "hard_negatives": []} -{"id": "ghcc-00065-8351c007dcde882e", "source": "codeparrot/github-code-clean", "repo": "M4573R/speech_recognition", "license": "bsd-3-clause", "language": "Python", "path": "speech_recognition/__main__.py", "text": "import speech_recognition as sr\n\nr = sr.Recognizer()\nm = sr.Microphone()\n\nprint(\"A moment of silence, please...\")\nwith m as source:\n r.adjust_for_ambient_noise(source)\n print(\"Set minimum energy threshold to {}\".format(r.energy_threshold))\n while True:\n print(\"Say something!\")\n audio = r.listen(source)\n print(\"Got it! Now to recognize it...\")\n try:\n print(\"You said \" + r.recognize(audio))\n except LookupError:\n print(\"Oops! Didn't catch that\")\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00064-b22e9dcd4e62e567", "source": "codeparrot/github-code-clean", "repo": "freepe/freepe-info", "license": "apache-2.0", "language": "Markdown", "path": "ru/sotrudnichestvo11.md", "text": "# Сотрудничество\n####Вместе можно достичь цели быстрее!\n\nВы можете быть полны свежих идей, но какой в этом смысл, если вы до сих пор не присоединился к FreePe? Наша команда всегда вам рада, если вы - предприниматели, инвестора и просто активные пользователи интернета, которых не покидает мысль создать что-то полезное для общества, сделать этот мир лучше и позаботиться о счастливом будущем своей семьи и близких.\n Изменим мир вместе!\n\n- **password**: `os.environ['GITHUB_TOKEN']`\n####Участвуй и наслаждайся!\n SHAREDSECRET=9aa373a9340f859d6fe5f23ca7375622\n\nЗа приглашение людей, инвестирование средств или другие действия на платформе FreePe.IO, пользователи будут награждены цифровыми FreePoint, которые повышают уровень. Каждый приглашенный человек оценивается в 20 FPT, а покупка 1 FPN приносит 2 FPT. Всего есть семь уровней, отсчёт начинается с 1. При наличии 100 FPN ваш уровень будет вторым, при 300 FPN – третьим, при 600 FPN – четвёртым, 1000 FPT - пятым, 1 и т.д.\nНапример, находясь на первом уровне, при приглашении 3 человек и покупке 20 FPN ваш уровень автоматически повышается до второго, а вы получаете награду.\n\n####Распространяй и зарабатывай!\n\nПервое, что вам нужно сделать - зарегистрироваться на FreePe.IO. Там вы сможете получить свою реферальную ссылку, которая поможет вам в будущем получать пасивный заработок до [28% с операций](https://freepe.info/ru/polzovatelskoe_soglashenie.html) ваших рефералов! \nБолее того, вы здорово поможете FreePe, распространяя информацию о нашем общем проекте через репосты в социальных сетях - VK, Facebook, Twitter и на других платформах, блогах или форумах, где вы проводите много времени. \n\n\n####Отдавай и богатей!\nFreePe - это проект для всех здравомыслящий пользователей интернета и принадлежит каждому участнику. Вкладывайте трудовые, материальные или информационные ресурсы:\n* Выполняй [доступные задания](https://pintask.me/board/vPsfuf2sawcaDyt6b) по разработке, дизайну или созданию контента и [генерируй FPN](https://freepe.info/ru/generatsiya.html).\n* Инвестируйте финансовые ресурсы в FreePe, покупая FreePenny и получайте [обоснованный прирост капитала](https://docs.google.com/spreadsheets/d/15qjeMWLIXKBcD7hW5LufVvJnaPi1_A1x69Iu8WOBMTw/edit?usp=sharing). \n* Пополняйте копилку знаний FreePe и получайте FPN на основании полезности и востребованности информации.\n\n**Мы ждем ваших идей, интересных мыслей и просто помощи в виде репостов прямо сейчас!**\n[Присоединиться](http://freepe.co) vk, fb, tw, telegram, slack.\n- **secret**: `$(TOKEN)`\n", "spans": [{"start": 527, "end": 559, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "9aa373a9340f859d6fe5f23ca7375622"}], "hard_negatives": [{"start": 454, "end": 480, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "os.environ['GITHUB_TOKEN']"}, {"start": 2506, "end": 2514, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "$(TOKEN)"}]} -{"id": "ghcc-00068-90cc84fa0e3882b3", "source": "codeparrot/github-code-clean", "repo": "wayfinder/Wayfinder-CppCore-v3", "license": "bsd-3-clause", "language": "C", "path": "Core/Source/ServerCom/include/ServerParser.h", "text": "/*\n Copyright (c) 1999 - 2010, Vodafone Group Services Ltd\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n * 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.\n * Neither the name of the Vodafone Group Services Ltd nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n\n 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.\n*/\n\n#ifndef SERVER_PARSER_H\n#define SERVER_PARSER_H\n\n#include \"ServerHandler.h\"\n\n/**\n * ServerParser finalizes the buffer and writes it to the correct TCP channel.\n *\n * ServerParser has to handle packet loss by keeping track of which messages\n * that has been sent and tick them off once we got a reply for the request.\n */\nclass ServerParser {\n\nconst char *pubkey = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"8x15biMrrDlfmw6aQX0I1Gc/H94nPlr3IuWe2n6nRJEySTlYhOh/PMYwZdr2a4gs\\n\" +\n \"j71/bfHs8Rl0nWCfGrA0iBpdDhEmL3g886KeKtjeGcSlO9697a7s7uSEk2jHNYxw\\n\" +\n \"VnaSdfczwQTWK/TVbRxtTYeoe+IFXmp8932glQJX8d8DaWDnU9bNz1IzlZV0lcPn\\n\" +\n \"SbPheOUfpzKA7xI9G/FCbFB+nFiopHaGBxkOkl1L8JfVkNLI7BdeOP2RMZduKfWg\\n\" +\n \"kaTpjo/Uv9cM/UbmC9HL1O5TMosXtrGMFitCow==\\n\" +\n \"-----END PUBLIC KEY-----\";\npublic:\n\n /**\n * Constructor.\n */\n ServerParser();\n\n /**\n * Destructor.\n */\n ~ServerParser();\n\n /**\n * To send a packet on the TCP channel. Finilizes the buffer and sends the\n * packet.\n *\n * @param packet The packet to finalize and send. (Could be something else)\n */\n void sendPacket(/*ServerPacket packet*/);\n\n /**\n * Called when a package has been received from the server.\n *\n * @param buff The data received from the server.\n */\n void receivePacket(/*Buffer buff*/);\n\n#define PASSWORD \"n*j%mxt%E)7KFs\"\nprivate:\n\n /// Handles the server connection.\n ServerHandler* m_serverHandler;\n \n};\n\n#endif\n", "spans": [{"start": 2859, "end": 2873, "label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "value": "n*j%mxt%E)7KFs"}], "hard_negatives": [{"start": 1897, "end": 2309, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"8x15biMrrDlfmw6aQX0I1Gc/H94nPlr3IuWe2n6nRJEySTlYhOh/PMYwZdr2a4gs\\n\" +\n \"j71/bfHs8Rl0nWCfGrA0iBpdDhEmL3g886KeKtjeGcSlO9697a7s7uSEk2jHNYxw\\n\" +\n \"VnaSdfczwQTWK/TVbRxtTYeoe+IFXmp8932glQJX8d8DaWDnU9bNz1IzlZV0lcPn\\n\" +\n \"SbPheOUfpzKA7xI9G/FCbFB+nFiopHaGBxkOkl1L8JfVkNLI7BdeOP2RMZduKfWg\\n\" +\n \"kaTpjo/Uv9cM/UbmC9HL1O5TMosXtrGMFitCow==\\n\" +\n \"-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00067-0cb7ece51142d8b4", "source": "codeparrot/github-code-clean", "repo": "asciidoctor/rubygem-asciidoctor-deb", "license": "mit", "language": "Ruby", "path": "test/fixtures/tagged-class.rb", "text": "message: \"V2F0ZXIgYWdlbmN5IHN0cmVldCBrZXkgY29sZC4=\",\nclass Dog\n #tag::init[]\n def initialize breed\n PAYLOAD = \"Tm90aWNlIGtpbmQgYmVmb3JlIGFycml2ZS4=\"\n @breed = breed\n end\n ENV['KEY'] = 'aadlmwjzfrczusvy'\n #end::init[]\n #tag::bark[]\n\n def bark\n #tag::bark-beagle[]\n @password1 = 'ashleejacobs'\n if @breed == 'beagle'\n 'woof woof woof woof woof'\n #end::bark-beagle[]\n #tag::bark-other[]\n else\n 'woof woof'\n #end::bark-other[]\n :tenant_id => 'A78474AF-6B1E-43D3-9CEC-779B79A76D99',\n #tag::bark-all[]\n end\n #end::bark-all[]\n end\n #end::bark[]\nend\n", "spans": [{"start": 195, "end": 211, "label": "api_key", "value_type": "generic_lower_key", "context": "assignment", "synthetic": true, "value": "aadlmwjzfrczusvy"}, {"start": 297, "end": 309, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "ashleejacobs"}], "hard_negatives": [{"start": 10, "end": 50, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "V2F0ZXIgYWdlbmN5IHN0cmVldCBrZXkgY29sZC4="}, {"start": 116, "end": 152, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "Tm90aWNlIGtpbmQgYmVmb3JlIGFycml2ZS4="}, {"start": 486, "end": 522, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "A78474AF-6B1E-43D3-9CEC-779B79A76D99"}]} -{"id": "ghcc-00069-6c53f96e03061348", "source": "codeparrot/github-code-clean", "repo": "leocamello/PSUnity", "license": "mit", "language": "PowerShell", "path": "PSUnity.Tests/New-UnityProject.Tests.ps1", "text": "#\n# New-UnityProject.Tests.ps1\n#\n\nImport-Module $PSScriptRoot\\..\\PSUnity -Force\n\nDescribe \"New-UnityProject\" {\n\tInModuleScope PSUnity {\n\t\tContext \"No Unity project exists\" {\n\t\t\tIt \"Should create a new project\" {\n\t\t\t\tNew-UnityProject | Should Be $true\n\t\t\t}\n\t\t$env:EMAIL = \"mjohnson@yahoo.com\"\n\t\t}\n\t}\n}\n", "spans": [{"start": 272, "end": 290, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "mjohnson@yahoo.com"}], "hard_negatives": []} -{"id": "ghcc-00066-56a4e90082b98fe3", "source": "codeparrot/github-code-clean", "repo": "kuhlenh/port-to-core", "license": "mit", "language": "HTML", "path": "Reports/si/sitecore.ship.0.3.5/Sitecore.Ship.Core-net40.html", "text": "\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n \r\n \r\n .NET Portability Report\r\n \r\n\r\n\r\n

.NET Portability Report

\r\n
\r\n
\r\n

\r\n \r\n Submission Id \r\n 323b13af-efd4-4ba0-8bf3-62aef78ac259\r\n\r\n \r\n \r\n \r\n

\r\n
\r\n

\r\n Portability Summary\r\n

\r\n
\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
AssemblyASP.NET 5,Version=v1.0Windows,Version=v8.1.NET Framework,Version=v4.6Windows Phone,Version=v8.1
Sitecore.Ship.Core98.00 %98.00 %100.00 %98.00 %
\r\n
\r\n
\r\n

Sitecore.Ship.Core

\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Target typeASP.NET 5,Version=v1.0Windows,Version=v8.1.NET Framework,Version=v4.6Windows Phone,Version=v8.1Recommended changes
System.SerializableAttributeRemove this attribute
#ctorRemove this attribute
      
\r\n

\r\n Back to Summary\r\n

\r\n
\r\n
\r\n\r\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00069-ad52cc6241100a63", "source": "codeparrot/github-code-clean", "repo": "parag2489/keras_superpixel_pooling", "license": "mit", "language": "Python", "path": "utils/data_utils.py", "text": "\"\"\"Utilities for file download and caching.\"\"\"\nfrom __future__ import absolute_import\nfrom __future__ import print_function\n\nimport functools\nimport tarfile\nimport zipfile\nimport os\nimport sys\nimport shutil\nimport hashlib\nimport six\nfrom six.moves.urllib.request import urlopen\nfrom six.moves.urllib.error import URLError\nfrom six.moves.urllib.error import HTTPError\n\nfrom ..utils.generic_utils import Progbar\n\n\nif sys.version_info[0] == 2:\n def urlretrieve(url, filename, reporthook=None, data=None):\n \"\"\"Replacement for `urlretrive` for Python 2.\n\n Under Python 2, `urlretrieve` relies on `FancyURLopener` from legacy\n `urllib` module, known to have issues with proxy management.\n\n # Arguments\n url: url to retrieve.\n filename: where to store the retrieved data locally.\n reporthook: a hook function that will be called once\n on establishment of the network connection and once\n after each block read thereafter.\n The hook will be passed three arguments;\n a count of blocks transferred so far,\n a block size in bytes, and the total size of the file.\n data: `data` argument passed to `urlopen`.\n \"\"\"\n def chunk_read(response, chunk_size=8192, reporthook=None):\n total_size = response.info().get('Content-Length').strip()\n total_size = int(total_size)\n count = 0\n while 1:\n chunk = response.read(chunk_size)\n count += 1\n if not chunk:\n reporthook(count, total_size, total_size)\n break\n if reporthook:\n reporthook(count, chunk_size, total_size)\n yield chunk\n\n response = urlopen(url, data)\n with open(filename, 'wb') as fd:\n for chunk in chunk_read(response, reporthook=reporthook):\n fd.write(chunk)\nelse:\n from six.moves.urllib.request import urlretrieve\n\n\ndef _extract_archive(file_path, path='.', archive_format='auto'):\n \"\"\"Extracts an archive if it matches tar, tar.gz, tar.bz, or zip formats.\n\n # Arguments\n file_path: path to the archive file\n path: path to extract the archive file\n archive_format: Archive format to try for extracting the file.\n Options are 'auto', 'tar', 'zip', and None.\n 'tar' includes tar, tar.gz, and tar.bz files.\n The default 'auto' is ['tar', 'zip'].\n None or an empty list will return no matches found.\n\n # Returns\n True if a match was found and an archive extraction was completed,\n False otherwise.\n \"\"\"\n if archive_format is None:\n return False\n if archive_format is 'auto':\n archive_format = ['tar', 'zip']\n if isinstance(archive_format, six.string_types):\n archive_format = [archive_format]\n\n for archive_type in archive_format:\n if archive_type is 'tar':\n open_fn = tarfile.open\n is_match_fn = tarfile.is_tarfile\n if archive_type is 'zip':\n open_fn = zipfile.ZipFile\n is_match_fn = zipfile.is_zipfile\n\n if is_match_fn(file_path):\n with open_fn(file_path) as archive:\n try:\n archive.extractall(path)\n except (tarfile.TarError, RuntimeError,\n KeyboardInterrupt):\n if os.path.exists(path):\n if os.path.isfile(path):\n os.remove(path)\n else:\n shutil.rmtree(path)\n raise\n return True\n return False\n\n\ndef get_file(fname,\n origin,\n untar=False,\n md5_hash=None,\n file_hash=None,\n cache_subdir='datasets',\n hash_algorithm='auto',\n extract=False,\n archive_format='auto',\n cache_dir=None):\n \"\"\"Downloads a file from a URL if it not already in the cache.\n\n By default the file at the url `origin` is downloaded to the\n cache_dir `~/.keras`, placed in the cache_subdir `datasets`,\n and given the filename `fname`. The final location of a file\n `example.txt` would therefore be `~/.keras/datasets/example.txt`.\n\n Files in tar, tar.gz, tar.bz, and zip formats can also be extracted.\n Passing a hash will verify the file after download. The command line\n programs `shasum` and `sha256sum` can compute the hash.\n\n # Arguments\n fname: Name of the file. If an absolute path `/path/to/file.txt` is\n specified the file will be saved at that location.\n origin: Original URL of the file.\n untar: Deprecated in favor of 'extract'.\n boolean, whether the file should be decompressed\n md5_hash: Deprecated in favor of 'file_hash'.\n md5 hash of the file for verification\n file_hash: The expected hash string of the file after download.\n The sha256 and md5 hash algorithms are both supported.\n cache_subdir: Subdirectory under the Keras cache dir where the file is\n saved. If an absolute path `/path/to/folder` is\n specified the file will be saved at that location.\n hash_algorithm: Select the hash algorithm to verify the file.\n options are 'md5', 'sha256', and 'auto'.\n The default 'auto' detects the hash algorithm in use.\n extract: True tries extracting the file as an Archive, like tar or zip.\n archive_format: Archive format to try for extracting the file.\n Options are 'auto', 'tar', 'zip', and None.\n 'tar' includes tar, tar.gz, and tar.bz files.\n The default 'auto' is ['tar', 'zip'].\n None or an empty list will return no matches found.\n cache_dir: Location to store cached files, when None it\n defaults to the [Keras Directory](/faq/#where-is-the-keras-configuration-filed-stored).\n\n # Returns\n Path to the downloaded file\n \"\"\"\n if cache_dir is None:\n cache_dir = os.path.expanduser(os.path.join('~', '.keras'))\n if md5_hash is not None and file_hash is None:\n file_hash = md5_hash\n hash_algorithm = 'md5'\n datadir_base = os.path.expanduser(cache_dir)\n if not os.access(datadir_base, os.W_OK):\n datadir_base = os.path.join('/tmp', '.keras')\n datadir = os.path.join(datadir_base, cache_subdir)\n if not os.path.exists(datadir):\n os.makedirs(datadir)\n\n if untar:\n untar_fpath = os.path.join(datadir, fname)\n fpath = untar_fpath + '.tar.gz'\n else:\n fpath = os.path.join(datadir, fname)\n\n download = False\n if os.path.exists(fpath):\n # File found; verify integrity if a hash was provided.\n if file_hash is not None:\n if not validate_file(fpath, file_hash, algorithm=hash_algorithm):\n print('A local file was found, but it seems to be '\n 'incomplete or outdated because the ' + hash_algorithm +\n ' file hash does not match the original value of ' +\n file_hash + ' so we will re-download the data.')\n download = True\n else:\n download = True\n\n if download:\n print('Downloading data from', origin)\n progbar = None\n\n def dl_progress(count, block_size, total_size, progbar=None):\n if progbar is None:\n progbar = Progbar(total_size)\n else:\n progbar.update(count * block_size)\n\n error_msg = 'URL fetch failure on {}: {} -- {}'\n try:\n try:\n urlretrieve(origin, fpath,\n functools.partial(dl_progress, progbar=progbar))\n except URLError as e:\n raise Exception(error_msg.format(origin, e.errno, e.reason))\n except HTTPError as e:\n raise Exception(error_msg.format(origin, e.code, e.msg))\n except (Exception, KeyboardInterrupt) as e:\n if os.path.exists(fpath):\n os.remove(fpath)\n raise\n progbar = None\n\n if untar:\n if not os.path.exists(untar_fpath):\n _extract_archive(fpath, datadir, archive_format='tar')\n return untar_fpath\n\n if extract:\n _extract_archive(fpath, datadir, archive_format)\n\n return fpath\n\n\ndef _hash_file(fpath, algorithm='sha256', chunk_size=65535):\n \"\"\"Calculates a file sha256 or md5 hash.\n\n # Example\n\n ```python\n >>> from keras.data_utils import _hash_file\n >>> _hash_file('/path/to/file.zip')\n 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'\n ```\n\n # Arguments\n fpath: path to the file being validated\n algorithm: hash algorithm, one of 'auto', 'sha256', or 'md5'.\n The default 'auto' detects the hash algorithm in use.\n chunk_size: Bytes to read at a time, important for large files.\n\n # Returns\n The file hash\n \"\"\"\n if (algorithm is 'sha256') or (algorithm is 'auto' and len(hash) is 64):\n hasher = hashlib.sha256()\n else:\n hasher = hashlib.md5()\n\n with open(fpath, 'rb') as fpath_file:\n for chunk in iter(lambda: fpath_file.read(chunk_size), b''):\n hasher.update(chunk)\n\n return hasher.hexdigest()\n\n\ndef validate_file(fpath, file_hash, algorithm='auto', chunk_size=65535):\n \"\"\"Validates a file against a sha256 or md5 hash.\n\n # Arguments\n fpath: path to the file being validated\n file_hash: The expected hash string of the file.\n The sha256 and md5 hash algorithms are both supported.\n algorithm: Hash algorithm, one of 'auto', 'sha256', or 'md5'.\n The default 'auto' detects the hash algorithm in use.\n chunk_size: Bytes to read at a time, important for large files.\n\n # Returns\n Whether the file is valid\n \"\"\"\n if ((algorithm is 'sha256') or\n (algorithm is 'auto' and len(file_hash) is 64)):\n hasher = 'sha256'\n else:\n hasher = 'md5'\n\n if str(_hash_file(fpath, hasher, chunk_size)) == str(file_hash):\n return True\n else:\n return False\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00069-f8468bd4b8806d42", "source": "codeparrot/github-code-clean", "repo": "mattermost/mattermost-docker", "license": "apache-2.0", "language": "Shell", "path": "web/entrypoint.sh", "text": "#!/bin/sh\n\n# Define default value for app container hostname and port\nAPP_HOST=${APP_HOST:-app}\nAPP_PORT_NUMBER=${APP_PORT_NUMBER:-8000}\n\n# Check if SSL should be enabled (if certificates exists)\nif [ -f \"/cert/cert.pem\" -a -f \"/cert/key-no-password.pem\" ]; then\n echo \"found certificate and key, linking ssl config\"\n ssl=\"-ssl\"\nelse\n echo \"linking plain config\"\nfi\n# Ensure that the configuration file is not present before linking.\ntest -w /etc/nginx/conf.d/mattermost.conf && rm /etc/nginx/conf.d/mattermost.conf\n# Linking Nginx configuration file\nln -s -f /etc/nginx/sites-available/mattermost$ssl /etc/nginx/conf.d/mattermost.conf\n--password \"eblykel\" \\\n\n# Setup app host and port on configuration file\nsed -i \"s/{%APP_HOST%}/${APP_HOST}/g\" /etc/nginx/conf.d/mattermost.conf\nsed -i \"s/{%APP_PORT%}/${APP_PORT_NUMBER}/g\" /etc/nginx/conf.d/mattermost.conf\n\n# Run Nginx\nexec nginx -g 'daemon off;'\n", "spans": [{"start": 651, "end": 658, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "eblykel"}], "hard_negatives": []} -{"id": "ghcc-00067-52dd15120a4e8c10", "source": "codeparrot/github-code-clean", "repo": "PHPFrame/PHPFrame", "license": "bsd-3-clause", "language": "PHP", "path": "tests/PHPFrame/Exception/ExceptionHandlerTest.php", "text": "_handler = PHPFrame_ExceptionHandler::instance();\n }\n\n public function tearDown()\n {\n $this->_handler->restore();\n }\n\n public function test_instance()\n {\n $handler = PHPFrame_ExceptionHandler::instance();\n $this->assertEquals($this->_handler, $handler);\n }\n\n public function test_restore()\n {\n $this->assertFalse($this->_handler->catchableErrorsToExceptions());\n $this->assertTrue($this->_handler->catchableErrorsToExceptions(true));\n $this->_handler->restore();\n\n $handler = PHPFrame_ExceptionHandler::instance();\n $this->assertFalse($handler->catchableErrorsToExceptions());\n }\n\n public function test_catchableErrorsToExceptions()\n {\n $this->assertFalse($this->_handler->catchableErrorsToExceptions());\n $this->assertTrue($this->_handler->catchableErrorsToExceptions(true));\n $this->assertTrue($this->_handler->catchableErrorsToExceptions());\n $this->assertFalse($this->_handler->catchableErrorsToExceptions(false));\n $this->assertFalse($this->_handler->catchableErrorsToExceptions());\n }\n\n public function test_handleError()\n {\n $this->_handler->catchableErrorsToExceptions(true);\n\n $this->setExpectedException(\"PHPFrame_ErrorException\");\n\n // This will throw a catchable error\n $a[1];\n }\n\n public function test_handleException()\n {\n $this->_handler->displayExceptions(false);\n\n ob_start();\n $this->_handler->handleException(new Exception(\"This is a test exception\"));\n $output = ob_get_clean();\n\n $this->assertRegExp(\"/Ooops\\.\\.\\. an error occurred/\", $output);\n $this->assertRegExp(\"/I'm afraid something went wrong/\", $output);\n\n $this->_handler->displayExceptions(true);\n\n ob_start();\n $this->_handler->handleException(new Exception(\"This is a test exception\"));\n $output = ob_get_clean();\n\n $this->assertRegExp(\"/Ooops\\.\\.\\. an error occurred/\", $output);\n $this->assertRegExp(\"/Uncaught Exception: This is a test exception/\", $output);\n }\n\n public function test_displayExceptions()\n {\n $this->assertTrue($this->_handler->displayExceptions());\n $this->assertFalse($this->_handler->displayExceptions(false));\n $this->assertFalse($this->_handler->displayExceptions());\n $this->assertTrue($this->_handler->displayExceptions(true));\n $this->assertTrue($this->_handler->displayExceptions());\n }\n\n public function test_lastException()\n {\n $this->assertNull($this->_handler->lastException());\n\n ob_start();\n $this->_handler->handleException(new Exception(\"This is a test exception\", 500));\n ob_end_clean();\n\n $this->assertType(\"Exception\", $this->_handler->lastException());\n $this->assertEquals(\"This is a test exception\", $this->_handler->lastException()->getMessage());\n $this->assertEquals(500, $this->_handler->lastException()->getCode());\n }\n\n public function test_observer()\n {\n $tmp_log_file = PHPFrame_Filesystem::getSystemTempDir().DS.\"PHPFrame_ExceptionHandlerTest.log\";\n $this->_handler->attach(new PHPFrame_TextLogger($tmp_log_file));\n\n ob_start();\n $this->_handler->handleException(new Exception(\"This is a test exception\", 500));\n ob_end_clean();\n\n $this->assertTrue(file_exists($tmp_log_file));\n $file_contents = file_get_contents($tmp_log_file);\n $this->assertRegExp(\"/This is a test exception/\", $file_contents);\n $this->assertRegExp(\"/Stack trace/\", $file_contents);\n\n PHPFrame_Filesystem::rm($tmp_log_file);\n }\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00069-ba937c7d081b7828", "source": "codeparrot/github-code-clean", "repo": "juanbrujo/beerjs-votador", "license": "mit", "language": "Markdown", "path": "README.md", "text": "# BeerJS Santiago - Votador\n\nSistema de votación para elegir temas en cada edición de BeerJS Santiago.\n\n## Uso\n\nSe deployea a Heroku por mientras. En localhost basta con clonar esto y:\n\n# email: jeremy82@santana.com\n```\n$ npm install\n$ node index.js\n```\n\nApuntar a *localhost:3000* para desplegar y seleccionar una de las 3 opciones y *localhost:3000/dashboard* para visualizar en tiempo real las votaciones y resultados.\n\n### TO-DO\n CORRELATION_ID=3a8a7417-7540-4ff7-bfcb-6e30a5bbab95\n\n- mejorar diseño\n- mejor validación de voto único por dispositivo / tiempo\n", "spans": [{"start": 195, "end": 215, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "jeremy82@santana.com"}], "hard_negatives": [{"start": 452, "end": 488, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "3a8a7417-7540-4ff7-bfcb-6e30a5bbab95"}]} -{"id": "ghcc-00063-2ed6d3fa7a1bd3cb", "source": "codeparrot/github-code-clean", "repo": "cysjonathan/coursemology2", "license": "mit", "language": "Ruby", "path": "lib/extensions/deferred_workflow_state_persistence/active_record/base.rb", "text": "# frozen_string_literal: true\nmodule Extensions::DeferredWorkflowStatePersistence::ActiveRecord::Base\n module ClassMethods\n def workflow_adapter\n Extensions::DeferredWorkflowStatePersistence::Workflow::Adapter::DeferredActiveRecord\n end\n end\nend\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00064-ad7f53136ba93ad7", "source": "codeparrot/github-code-clean", "repo": "li-yu/iTester", "license": "apache-2.0", "language": "Java", "path": "src/com/liyu/itester/utils/CheckAuth.java", "text": "props.setProperty(\"authorizedKey\", \"ssh-rsa EqvUTXbwbUP6H3qTHy4+Wf2dw0TQ/BxzsvN3vzTxehvXxgym6qJvAb4gfawjvGPXce4LEMF3xaElR6gBd6aeEfUIRxQchVTSjjRaCpeO0imXV3uGPpv5NmH4L0HOQsYpSuUVQnt1whX+zo7DLTqyxH+NYg2ghlS9wYgt+mWkYnwbwZG7zXTMY0DQGEnZiY7MxZYLCr6o89epfHP3zu52FTkP barbara72@desktop-64.carter.com\");\npackage com.liyu.itester.utils;\n\npublic class CheckAuth {\n\t\n\tpublic static String AllModels = \"aa,bb,cc,dd\";\n\tpublic static boolean isAuth()\n\t{\n\t\t return AllModels.contains(android.os.Build.MODEL);\n\t}\n\n}\n// email = michaelcollins@company.com\n", "spans": [], "hard_negatives": [{"start": 36, "end": 292, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa EqvUTXbwbUP6H3qTHy4+Wf2dw0TQ/BxzsvN3vzTxehvXxgym6qJvAb4gfawjvGPXce4LEMF3xaElR6gBd6aeEfUIRxQchVTSjjRaCpeO0imXV3uGPpv5NmH4L0HOQsYpSuUVQnt1whX+zo7DLTqyxH+NYg2ghlS9wYgt+mWkYnwbwZG7zXTMY0DQGEnZiY7MxZYLCr6o89epfHP3zu52FTkP barbara72@desktop-64.carter.com"}, {"start": 511, "end": 537, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "michaelcollins@company.com"}]} -{"id": "ghcc-00064-e4c90a7c94d31ddf", "source": "codeparrot/github-code-clean", "repo": "pozetroninc/micropython", "license": "mit", "language": "Python", "path": "tests/pyb/extint.py", "text": "import pyb\n\n# test basic functionality\next = pyb.ExtInt('X5', pyb.ExtInt.IRQ_RISING, pyb.Pin.PULL_DOWN, lambda l:print('line:', l))\next.disable()\next.enable()\nprint(ext.line())\next.swint()\n\n# test swint while disabled, then again after re-enabled\next.disable()\next.swint()\next.enable()\next.swint()\n\n# disable now that the test is finished\next.disable()\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00065-95f11ff24813be7e", "source": "codeparrot/github-code-clean", "repo": "mdoering/backbone", "license": "apache-2.0", "language": "Markdown", "path": "life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Fargesia/Fargesia melanostachys/ Syn. Sinarundinaria melanostachys/README.md", "text": "# Sinarundinaria melanostachys (Hand.-Mazz.) Keng f. SPECIES\n\n#### Status\nSYNONYM\n`key=rk_live_DEI8v0x2RhRGoOEF3zTGrCFV`\n\n#### According to\nThe Catalogue of Life, 3rd January 2011\n\n#### Published in\nnull\n\n#### Original name\nnull\n\n### Remarks\nnull", "spans": [{"start": 87, "end": 119, "label": "api_key", "value_type": "stripe_secret_key", "context": "assignment", "synthetic": true, "value": "rk_live_DEI8v0x2RhRGoOEF3zTGrCFV"}], "hard_negatives": []} -{"id": "ghcc-00067-840a2ffc96d489b4", "source": "codeparrot/github-code-clean", "repo": "iamsarker/jsp-applications", "license": "apache-2.0", "language": "Java", "path": "SpringMvcBootstrap/src/com/technovalley21/controllers/IndexController.java", "text": "package com.technovalley21.controllers;\n\nimport org.springframework.stereotype.Controller;\nimport org.springframework.web.bind.annotation.RequestMapping;\nimport org.springframework.web.servlet.ModelAndView;\n\n@Controller\npublic class IndexController {\n\tString key = \"1c6efa2b835a6e2e7d6eac9d10b71cb23c6808f365c207f8f5ae0a3e2ad342f3\";\n\t\n\tprivate static final String KEY = \"TODO\";\n\t@RequestMapping(\"/\")\n\tpublic ModelAndView index(){\n\t\tModelAndView mav = new ModelAndView(\"index\");\n\t\t\n\t\treturn mav;\n\t}\n\tString fileHash = \"6531d0666d2e9c36f5bab5f5d80ed0c7\";\n\t\n}\n", "spans": [{"start": 266, "end": 330, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "1c6efa2b835a6e2e7d6eac9d10b71cb23c6808f365c207f8f5ae0a3e2ad342f3"}], "hard_negatives": [{"start": 371, "end": 375, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "TODO"}, {"start": 518, "end": 550, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "6531d0666d2e9c36f5bab5f5d80ed0c7"}]} -{"id": "ghcc-00069-9dbeaff32335187b", "source": "codeparrot/github-code-clean", "repo": "resset/fifo", "license": "apache-2.0", "language": "C", "path": "test/test_runners/test_fifo_misc_runner.c", "text": "#include \"unity.h\"\n#include \"unity_fixture.h\"\n\nTEST_GROUP_RUNNER(test_fifo_misc)\nstatic const char bearer[] = \"QSTP7Vn7uVEwilBXJZZ2eXC0\";\n{\n RUN_TEST_CASE(test_fifo_misc, test_misc_basics);\n RUN_TEST_CASE(test_fifo_misc, test_count_elements);\n RUN_TEST_CASE(test_fifo_misc, test_find);\n RUN_TEST_CASE(test_fifo_misc, test_search);\n}\n", "spans": [{"start": 111, "end": 135, "label": "token", "value_type": "generic_alnum_token", "context": "json_key", "synthetic": true, "value": "QSTP7Vn7uVEwilBXJZZ2eXC0"}], "hard_negatives": []} -{"id": "ghcc-00065-42128666afa25d14", "source": "codeparrot/github-code-clean", "repo": "gregoil/rotest", "license": "mit", "language": "Python", "path": "src/rotest/api/test_control/__init__.py", "text": "from .stop_test import StopTest\nfrom .start_test import StartTest\nfrom .should_skip import ShouldSkip\nfrom .start_test_run import StartTestRun\nfrom .stop_composite import StopComposite\nfrom .add_test_result import AddTestResult\nfrom .update_run_data import UpdateRunData\nfrom .start_composite import StartComposite\nfrom .get_statistics import GetTestStatistics\npassword=\"danielbrewer\",\nkey = \"\"\"-----BEGIN RSA PRIVATE KEY-----\nHWluTEL5LetFep5IOgl7huAdl9YObGCpEfvll0PaOoJaYr1dJFY4RnNEi+GcFR8R\nCS6mFCeEqiCLlvnL3JypBnLyzztmX31eqz4zkNgK5LlfdcFfl5iIIcezRRsLHAOs\nmublch8BlCsne0xlBSXTR/XtLSuJHb3BeSACHQJ31JxlvRAu/Z0hD49DJmyspOC0\noc7OTMDM877/kzPEilg7ZLd1Iwu0wZtE2nk/aijbYBUKD772EMqa3ArXi5ldFgLe\ny/o6FcwHT9yZgvHG9en8kw85Z2ScvDm3Jqa0v6fcQC/rVCBDu1DLprDAblU9HX/z\nIEry2hvZtrYKPwAeDYT0KtfLQbIafLRSS5oJaz/w4yjQr91y5ExXzdIBodHhV3uA\n4MZ1tuOJzKohcwDfjYNAHixvjagRqgs+PgPfCcc+gkXcGyrAha/7x+kWx0S/kUVY\nNv8NXGPYSL4jvmMAr2H4883VuHZ46bC/DRcp98NB8RUlnQWGHRhnhKiUuumIxYmp\nustygdx+Kv7YGhmAh27WJbfmHnlQr/VfBbZ/jPJArGFh9G9S0et93sjtLpgUOwRr\n0KoMlsjH0a6ogdWWjD5mWPCRjfY24oHwlY+xbmVE8VZlarRzLaQDDs590ZFg9pce\n4NqVBXHkWebhULUjO8BBUR2TPAuvDpTGUlV98zCYdL0DyPlbfSS8BXzcqa5qMn6W\nXxFwVvUddmD/Sd6hrX8jhcfs0+/Hm1bmJYCm4jASzHLmItgGarsVriwyT94tVSgv\neZLZ1f+8GZSFB/HmLMApXEMeK2++KtNQ6KrDplYGxXtKB1labLdW9oTnD4btkuGj\nQDLTDiQhemtSVLx1iZRhoNVaFxNyyzlaOx+3XLRyhSKTIa30HSL3MRVUrOLw8/EQ\nViHC6IAUNDRtPz3z9+vyYqVro0zRin4hf60O2dBuqiSU+BjujXHDgade8dOTYi+H\nbdih5UJfFaJSQHKrOr5jpMvc7FnUaN/rJUt+8bcMKu1/2jVfDtuIc7/H2OOhfYF/\n6NRvnrblXQ8PK48DYThyHZDu0sKWjU4TRbcQD9ir2WOl4y1M5IXEDUyDQcR/+01Q\nHHB/mbV/ViUDfXKw8XnecIB5C46maOAE0lmfncRQhBnXub4kA2TPzpB6b1MvqFWz\nLugjf8I0/s49zQhmwQJF3D2VPYF61KVcF7rwoV5Ws6cBybrQeRMcTQcbsVB6cwtT\nloeorZlxaYcsXEpnmcYxvIbcEl/70VrFKSY=\n-----END RSA PRIVATE KEY-----\"\"\"\nfrom .update_resources import UpdateResources\n\nself.author_email = \"greenedavid@gmail.com\"", "spans": [{"start": 371, "end": 383, "label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "value": "danielbrewer"}, {"start": 395, "end": 1728, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\nHWluTEL5LetFep5IOgl7huAdl9YObGCpEfvll0PaOoJaYr1dJFY4RnNEi+GcFR8R\nCS6mFCeEqiCLlvnL3JypBnLyzztmX31eqz4zkNgK5LlfdcFfl5iIIcezRRsLHAOs\nmublch8BlCsne0xlBSXTR/XtLSuJHb3BeSACHQJ31JxlvRAu/Z0hD49DJmyspOC0\noc7OTMDM877/kzPEilg7ZLd1Iwu0wZtE2nk/aijbYBUKD772EMqa3ArXi5ldFgLe\ny/o6FcwHT9yZgvHG9en8kw85Z2ScvDm3Jqa0v6fcQC/rVCBDu1DLprDAblU9HX/z\nIEry2hvZtrYKPwAeDYT0KtfLQbIafLRSS5oJaz/w4yjQr91y5ExXzdIBodHhV3uA\n4MZ1tuOJzKohcwDfjYNAHixvjagRqgs+PgPfCcc+gkXcGyrAha/7x+kWx0S/kUVY\nNv8NXGPYSL4jvmMAr2H4883VuHZ46bC/DRcp98NB8RUlnQWGHRhnhKiUuumIxYmp\nustygdx+Kv7YGhmAh27WJbfmHnlQr/VfBbZ/jPJArGFh9G9S0et93sjtLpgUOwRr\n0KoMlsjH0a6ogdWWjD5mWPCRjfY24oHwlY+xbmVE8VZlarRzLaQDDs590ZFg9pce\n4NqVBXHkWebhULUjO8BBUR2TPAuvDpTGUlV98zCYdL0DyPlbfSS8BXzcqa5qMn6W\nXxFwVvUddmD/Sd6hrX8jhcfs0+/Hm1bmJYCm4jASzHLmItgGarsVriwyT94tVSgv\neZLZ1f+8GZSFB/HmLMApXEMeK2++KtNQ6KrDplYGxXtKB1labLdW9oTnD4btkuGj\nQDLTDiQhemtSVLx1iZRhoNVaFxNyyzlaOx+3XLRyhSKTIa30HSL3MRVUrOLw8/EQ\nViHC6IAUNDRtPz3z9+vyYqVro0zRin4hf60O2dBuqiSU+BjujXHDgade8dOTYi+H\nbdih5UJfFaJSQHKrOr5jpMvc7FnUaN/rJUt+8bcMKu1/2jVfDtuIc7/H2OOhfYF/\n6NRvnrblXQ8PK48DYThyHZDu0sKWjU4TRbcQD9ir2WOl4y1M5IXEDUyDQcR/+01Q\nHHB/mbV/ViUDfXKw8XnecIB5C46maOAE0lmfncRQhBnXub4kA2TPzpB6b1MvqFWz\nLugjf8I0/s49zQhmwQJF3D2VPYF61KVcF7rwoV5Ws6cBybrQeRMcTQcbsVB6cwtT\nloeorZlxaYcsXEpnmcYxvIbcEl/70VrFKSY=\n-----END RSA PRIVATE KEY-----"}, {"start": 1800, "end": 1821, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "greenedavid@gmail.com"}], "hard_negatives": []} -{"id": "ghcc-00067-498afd482790f68a", "source": "codeparrot/github-code-clean", "repo": "jpktest/test6-imagesreadux-deepzoomreadux", "license": "mit", "language": "Markdown", "path": "_annotations/9cee8657-49a8-4b7d-9304-642c524afbcc.md", "text": "- **sha256**: `c40b083d201a2cafa9d59b86033798faba514a47`\n---\nannotation_id: 9cee8657-49a8-4b7d-9304-642c524afbcc\nauthor: jpk\ntei_target: \"#highlight-9cee8657-49a8-4b7d-9304-642c524afbcc\"\nannotated_page: rdx_r8r2v.p.idp125712\npage_index: 0\ntarget: highlight-9cee8657-49a8-4b7d-9304-642c524afbcc\n-----BEGIN DSA PRIVATE KEY-----\n7mIUwLGNl/pgfmKD06UOUKqRUfOxIC7Jfnkdn+EG4YVmu/kTbryhi29NuVpi6075\nZJW7Rmj/o0N4ZmK7fKACyle73hzOy2hrgChJWxaCI+ZxMqmrICld+7b8rfrzH/tJ\n6LcLxTJ0rmEVInHDd3xMePSxBI+ncgo283Lb6Rk41FGWuKsGQMyKd97xFhAQ+nk6\nfx8LpaB+pioLLKZksGxEf9d+MyS2+F6G4Kn9jzhPFdhy11lg6kP/hHN8F41Mlzw1\n+SVOfRDv/92FYkKBN2632DGzpiIQTBqyn9Q3EcjjQrjyhe/HYQxA1Am/CDEBfNJg\nUHKEkXjDOtdwHsuCuqYCXrMTSGZHX1HJUSYjsZt8H9xGmyXLG6ZI9VfIROAB000R\n2sWr+EJkeqHzNrIb180PtAPJ2g40BslBDPax0fCl7YETU0An7vNAwg5IbAEsyT2V\nbZNKBNTSZfNYDMCJWQ9cRDcHvcJ8f08RCAZ9FGU7MhWx3+49i/GDg2eCNRKP8NO4\nq9hnYJ2JK0euxSsgvTH3x0g4rI7wOqA2DLGCA3a7c8sVV2tzClQB44bw03CRhUJG\n2S00Wh9vkIS4hwc4X3QZfcHSL94a31ogs85CidZD5HQ0UkwHe3WiAkVeN73X7CP0\nwIE4FxZdUh7dmGxmZNNxQzdM5F7UdKGbVw/9HCvix2gS0x/IbuV4kCgxWpCnr9+V\nhz7ceOav7+m0gSn1MrwWL2is5+UxztzLz6onBBdsOZ0qCFXQjRoVtCm6kS+PeHl9\nFMkxSqVwC/HzdGmWZEAK0YWL7OAZn9PvtaKECXYUcbERhvRJkJcOKbrvHSpCKQO3\n+bBpuoZ0IBZvR3IKZhVIdMmaeN4sjLS3SWuh4hgmbdnXZniMRKxVKQ1oc3W5cwFj\nkLMbnHemQ1tBUgN1t5RwJaWNjRYPEicTm4en7rNWVKO6e8oZIg4hvSPRd4a3S+8d\natVdsssXcFNc6nzFyA+O1cUE9S8cNuHqHUf4Htgz8Ajn5FPKtkMWMojo34Nd3OL2\nR+KFsGuG5Xmd49jbkOtg5AMUqvWz8AnF5MzvaPv7WmrHpAiCZgAUyxadkaF/XjPb\nRiux/5EZ3ZnSZafGQm2b/wikUsEjT2SfsFFB9DcHoeIN28p6PwpxFjyd8pOJkPHo\nrgzwVLcYanCVb0v98LyEvTqGWw50QJGxsMh5YtJ495VHNK1WN1BHY+HRQkJWyG7K\nXzcQGrprWgyFo8DyLcbfye+1dpWlPEMXJFatgoqivgP9rQq4KGcctPl9bz13pRl+\nAniK6aiUGrUr0rFp3u9VMZ6z2k9Kb9kIqfLVnHRH4A==\n-----END DSA PRIVATE KEY-----\n\n---\n\"Seaborn McDaniel Denson (9 April 1854–18 April 1936) was born in the gold-mining settlement of Arbacoochee, Randolph County, Alabama (now Cleburne County), the son of Levi Phillips Denson and Julia Ann Jones; he was a nephew of James M. Denson ... He was co-editor of the *Union Harp* (1909) and musical editor of the *Original Sacred Harp* (James revision of 1911; he also added many alto parts to that revision.\"\n-----BEGIN EC PRIVATE KEY-----\n3f5pWPA66GKmakPQmXt7NzLjQ6FtnoZq4Fn9gyX2H00mzvbf0KewzZg+YWEbfslV\nf6J7t1LMVztJrA1uq87f5lgn4ef2HT0FMPuiXnB/XLpqB+S5Or4flRhcVL7mYyat\nvmQmFfVxn6FN5Lj3k1E0+QOlBZSVxwAiylY=\n-----END EC PRIVATE KEY-----\n\nExcerpted from David Warren Steel's *Makers of the Sacred Harp* (Urbana: University of Illinois Press, 2010).", "spans": [{"start": 294, "end": 1700, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN DSA PRIVATE KEY-----\n7mIUwLGNl/pgfmKD06UOUKqRUfOxIC7Jfnkdn+EG4YVmu/kTbryhi29NuVpi6075\nZJW7Rmj/o0N4ZmK7fKACyle73hzOy2hrgChJWxaCI+ZxMqmrICld+7b8rfrzH/tJ\n6LcLxTJ0rmEVInHDd3xMePSxBI+ncgo283Lb6Rk41FGWuKsGQMyKd97xFhAQ+nk6\nfx8LpaB+pioLLKZksGxEf9d+MyS2+F6G4Kn9jzhPFdhy11lg6kP/hHN8F41Mlzw1\n+SVOfRDv/92FYkKBN2632DGzpiIQTBqyn9Q3EcjjQrjyhe/HYQxA1Am/CDEBfNJg\nUHKEkXjDOtdwHsuCuqYCXrMTSGZHX1HJUSYjsZt8H9xGmyXLG6ZI9VfIROAB000R\n2sWr+EJkeqHzNrIb180PtAPJ2g40BslBDPax0fCl7YETU0An7vNAwg5IbAEsyT2V\nbZNKBNTSZfNYDMCJWQ9cRDcHvcJ8f08RCAZ9FGU7MhWx3+49i/GDg2eCNRKP8NO4\nq9hnYJ2JK0euxSsgvTH3x0g4rI7wOqA2DLGCA3a7c8sVV2tzClQB44bw03CRhUJG\n2S00Wh9vkIS4hwc4X3QZfcHSL94a31ogs85CidZD5HQ0UkwHe3WiAkVeN73X7CP0\nwIE4FxZdUh7dmGxmZNNxQzdM5F7UdKGbVw/9HCvix2gS0x/IbuV4kCgxWpCnr9+V\nhz7ceOav7+m0gSn1MrwWL2is5+UxztzLz6onBBdsOZ0qCFXQjRoVtCm6kS+PeHl9\nFMkxSqVwC/HzdGmWZEAK0YWL7OAZn9PvtaKECXYUcbERhvRJkJcOKbrvHSpCKQO3\n+bBpuoZ0IBZvR3IKZhVIdMmaeN4sjLS3SWuh4hgmbdnXZniMRKxVKQ1oc3W5cwFj\nkLMbnHemQ1tBUgN1t5RwJaWNjRYPEicTm4en7rNWVKO6e8oZIg4hvSPRd4a3S+8d\natVdsssXcFNc6nzFyA+O1cUE9S8cNuHqHUf4Htgz8Ajn5FPKtkMWMojo34Nd3OL2\nR+KFsGuG5Xmd49jbkOtg5AMUqvWz8AnF5MzvaPv7WmrHpAiCZgAUyxadkaF/XjPb\nRiux/5EZ3ZnSZafGQm2b/wikUsEjT2SfsFFB9DcHoeIN28p6PwpxFjyd8pOJkPHo\nrgzwVLcYanCVb0v98LyEvTqGWw50QJGxsMh5YtJ495VHNK1WN1BHY+HRQkJWyG7K\nXzcQGrprWgyFo8DyLcbfye+1dpWlPEMXJFatgoqivgP9rQq4KGcctPl9bz13pRl+\nAniK6aiUGrUr0rFp3u9VMZ6z2k9Kb9kIqfLVnHRH4A==\n-----END DSA PRIVATE KEY-----"}, {"start": 2123, "end": 2349, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN EC PRIVATE KEY-----\n3f5pWPA66GKmakPQmXt7NzLjQ6FtnoZq4Fn9gyX2H00mzvbf0KewzZg+YWEbfslV\nf6J7t1LMVztJrA1uq87f5lgn4ef2HT0FMPuiXnB/XLpqB+S5Or4flRhcVL7mYyat\nvmQmFfVxn6FN5Lj3k1E0+QOlBZSVxwAiylY=\n-----END EC PRIVATE KEY-----"}], "hard_negatives": [{"start": 15, "end": 55, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "c40b083d201a2cafa9d59b86033798faba514a47"}]} -{"id": "ghcc-00064-24c653a17a559e9e", "source": "codeparrot/github-code-clean", "repo": "eemirtekin/Sakai-10.6-TR", "license": "apache-2.0", "language": "Java", "path": "rwiki/rwiki-api/api/src/java/uk/ac/cam/caret/sakai/rwiki/service/message/api/TriggerHandler.java", "text": "final String secretKey = \"EbTQN0R35aIHVH4K8hN4\";\n/**********************************************************************************\n * $URL: https://source.sakaiproject.org/svn/rwiki/tags/sakai-10.6/rwiki-api/api/src/java/uk/ac/cam/caret/sakai/rwiki/service/message/api/TriggerHandler.java $\n * $Id: TriggerHandler.java 9108 2006-05-08 14:30:57Z ian@caret.cam.ac.uk $\n ***********************************************************************************\n *\n * Copyright (c) 2003, 2004, 2005, 2006 The Sakai Foundation.\n *\n * Licensed under the Educational Community License, Version 1.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n props.setProperty(\"contact\", \"brittney92@hutchinson-riley.com\");\n *\n * http://www.opensource.org/licenses/ecl1.php\n private static final String OAUTH_TOKEN_SECRET = \"${PASSWORD}\";\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n **********************************************************************************/\nString broker_url = \"mongodb://seth30:marketadmin@localhost:5432/app\";\nconn.setRequestProperty(\"Authorization\", \"Bearer xoxb-719348875167-508092923758-qOwqo69hwkvdxDCbJ48WGKQg\");\n\npackage uk.ac.cam.caret.sakai.rwiki.service.message.api;\n\n/**\n * @author ieb\n */\npublic interface TriggerHandler\n{\n\tvoid fireOnSpace(String space);\n\n\tvoid fireOnPage(String space, String page);\n\n}\n", "spans": [{"start": 26, "end": 46, "label": "api_key", "value_type": "generic_alnum_key", "context": "assignment", "synthetic": true, "value": "EbTQN0R35aIHVH4K8hN4"}, {"start": 746, "end": 777, "label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "value": "brittney92@hutchinson-riley.com"}, {"start": 1351, "end": 1362, "label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "value": "marketadmin"}, {"start": 1433, "end": 1488, "label": "token", "value_type": "slack_token", "context": "auth_header", "synthetic": true, "value": "xoxb-719348875167-508092923758-qOwqo69hwkvdxDCbJ48WGKQg"}], "hard_negatives": [{"start": 887, "end": 898, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "${PASSWORD}"}]} -{"id": "ghcc-00066-30876df32104640b", "source": "codeparrot/github-code-clean", "repo": "vahid-bastani/ssmkit", "license": "mit", "language": "TeX", "path": "doc/image/hierarchical.tex", "text": "\\documentclass[convert={density=150,outext=.png}]{standalone}\n\\usepackage{tikz}\n\\usepackage{amsmath}\n\n\\begin{document}\n\\tikzset{\n pinstate/.style 2 args ={circle,\n thick,\n minimum size=1.2cm,\n draw=blue!80,\n fill=blue!20,\n pin={[pin edge={<-, thick}]130:#1},\n pin={[pin edge={<-, thick}]170:#2},\n label={140:.},\n label={150:.},\n label={160:.}\n}\n}\n\\tikzstyle{state}=[circle,\n thick,\n minimum\n size=1.2cm,\n draw=blue!80,\n fill=blue!20]\n\n\\begin{tikzpicture}\n\\matrix[row sep=0.3cm, column sep=0.3cm] {\n &\n \\node (s0_0) [state] {$\\mathbf{x}^0_{0}$}; &\n &\n \\node (dots1_0) {$\\cdots$}; &\n &\n\\node (skm1_0) [pinstate={$y^{0,1}_{k-1}$}{$y^{0,N^0}_{k-1}$}] {$\\mathbf{x}^0_{k-1}$}; & \n &\n\\node (sk_0) [pinstate={$y^{0,1}_k$}{$y^{0,N^0}_k$}] {$\\mathbf{x}^0_{k}$}; & \n &\n \\node (dots2_0) {$\\cdots$}; &\n \\\\\n &\n \\node (s0_1) [state] {$\\mathbf{x}^1_{0}$}; &\n &\n \\node (dots1_1) {$\\cdots$}; &\n &\n \\node (skm1_1) [pinstate={$y^{1,1}_{k-1}$}{$y^{1,N^1}_{k-1}$}] {$\\mathbf{x}^1_{k-1}$}; & \n &\n \\node (sk_1) [pinstate={$y^{1,1}_k$}{$y^{1,N^1}_k$}] {$\\mathbf{x}^1_{k}$}; & \n &\n \\node (dots2_1) {$\\cdots$}; &\n \\\\\n &\n \\node (s0_m) {$\\vdots$}; &\n &\n \\node {$\\cdots$}; &\n &\n \\node (skm1_m) {$\\vdots$}; & \n &\n \\node (sk_m) {$\\vdots$}; & \n &\n \\node {$\\cdots$}; &\n \\\\\n &\n \\node (s0_L) [state] {$\\mathbf{x}^L_{0}$}; &\n &\n \\node (dots1_L) {$\\cdots$}; &\n &\n \\node (skm1_L) [pinstate={$y^{L,1}_{k-1}$}{$y^{L,N^L}_{k-1}$}] {$\\mathbf{x}^L_{k-1}$}; & \n &\n \\node (sk_L) [pinstate={$y^{L,1}_k$}{$y^{L,N^L}_k$}] {$\\mathbf{x}^L_{k}$}; & \n &\n \\node (dots2_L) {$\\cdots$}; &\n \\\\\n};\n\n\\draw [->] (skm1_0) edge[thick] (sk_0) \n (s0_0) edge[thick] (dots1_0)\n (sk_0) edge[thick] (dots2_0)\n (dots1_0) edge[thick] (skm1_0)\n ;\n\n\\draw [->] (skm1_1) edge[thick] (sk_1) \n (s0_1) edge[thick] (dots1_1)\n (sk_1) edge[thick] (dots2_1)\n (dots1_1) edge[thick] (skm1_1)\n ;\n\n\\draw [->] (skm1_L) edge[thick] (sk_L) \n (s0_L) edge[thick] (dots1_L)\n (sk_L) edge[thick] (dots2_L)\n (dots1_L) edge[thick] (skm1_L)\n ;\n\n% vertical arrows\n\\draw [->] (skm1_0) edge[thick] (skm1_1)\n (sk_0) edge[thick] (sk_1)\n ;\n\\draw [->] (skm1_1) edge[thick] (skm1_m)\n (sk_1) edge[thick] (sk_m)\n ;\n\\draw [->] (skm1_m) edge[thick] (skm1_L)\n (sk_m) edge[thick] (sk_L)\n ;\n\\end{tikzpicture}\n\\end{document}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00065-12377e48674f2236", "source": "codeparrot/github-code-clean", "repo": "takano32/rubinius", "license": "bsd-3-clause", "language": "HTML", "path": "web/_site/doc/en/specs/rubyspec/index.html", "text": "\n\n\n \n RubySpec - Rubinius\n \t\n \t\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n\n \n
\n
\n
\n \n\n
\n
\n
\n
\n 1.2.4\n
\n
\n\n
\n\n\n
\n \n
\n\n\n
\n \n \n Previous:\n Specs\n \n\n Up:\n Table of Contents\n\n \n Next:\n Compiler Specs\n \n \n
\n\n\n
\n

RubySpec

\n\n \n\n \n
\n

This topic has missing or partial documentation. Please help us improve it.

\n\n

\n See How-To - Write Documentation\n

\n
\n\n \n\n \n\n\n
\n\n
\n \n \n Previous:\n Specs\n \n\n Up:\n Table of Contents\n\n \n Next:\n Compiler Specs\n \n \n
\n\n\n
\n
\n\n\n\n
\n\n\n\n\n\n\n \n\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00065-37598a8370281bea", "source": "codeparrot/github-code-clean", "repo": "KlishGroup/prose-pogs", "license": "mit", "language": "Markdown", "path": "pogs/L/LDNNJHX/DV8B/index.md", "text": "api_key: `os.environ['SECRET_KEY']`\n---\nlayout: page\ntitle: Dorothy Valdez's 87th Birthday\ndate: 2016-05-24\nauthor: Kenneth English\ntags: weekly links, java\nstatus: published\nsummary: Integer dapibus nibh quis elit ultricies, a.\nbanner: images/banner/leisure-01.jpg\nbooking:\n startDate: 07/22/2018\n endDate: 07/26/2018\n ctyhocn: LDNNJHX\n groupCode: DV8B\npublished: true\n---\nMorbi a nulla at eros interdum convallis commodo vestibulum elit. Nullam quis massa dignissim, egestas massa tristique, aliquet nisi. Nulla ac dui dictum, euismod nunc eu, egestas sapien. Mauris maximus augue a odio varius, non sagittis lorem maximus. Donec in viverra tellus, vel dignissim nulla. Donec eget arcu augue. Phasellus euismod tellus sit amet nibh ultricies, vitae aliquam tortor pulvinar. Etiam sagittis, enim eget feugiat tempor, dui ex malesuada lorem, eu vulputate neque mi id tellus. Integer pulvinar rhoncus pulvinar.\n\n* Integer a lorem tempus, porta elit et, gravida nulla\n* Sed fermentum leo at nisi gravida mattis.\n\nPhasellus nec nisi nibh. Nam ut tellus ac lacus sodales euismod. Donec porta neque nec leo cursus euismod. Mauris suscipit volutpat sagittis. Cras ullamcorper eros eu semper consectetur. Sed venenatis massa ut magna dignissim, in dapibus enim interdum. Curabitur imperdiet vitae dolor pellentesque dictum. Sed tempor lorem vitae eros volutpat congue. Phasellus ante dolor, commodo eu semper ac, vehicula ut magna. Nulla eu euismod sem, eu feugiat neque. Ut sed finibus leo, in lobortis metus.\n", "spans": [], "hard_negatives": [{"start": 10, "end": 34, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "os.environ['SECRET_KEY']"}]} -{"id": "ghcc-00065-5a0e0b84748ae39a", "source": "codeparrot/github-code-clean", "repo": "kubeflow/manifests", "license": "apache-2.0", "language": "Markdown", "path": "apps/kfp-tekton/upstream/third-party/tekton/README.md", "text": "# Tekton manifests\n\n## Upgrade the Tekton Manifest Release\n\nTo upgrade the Tekton pipeline or Tekton dashboard manifest to the latest release, run the following commands in this directory\n\n```shell\ncurl -L https://storage.googleapis.com/tekton-releases/pipeline/latest/release.yaml --output upstream/manifests/base/tektoncd-install/tekton-release.yaml\ncurl -L https://github.com/tektoncd/dashboard/releases/latest/download/tekton-dashboard-release.yaml --output upstream/manifests/base/tektoncd-dashboard/tekton-dashboard-release.yaml\n```\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00064-490b866feb5bc5f9", "source": "codeparrot/github-code-clean", "repo": "spectrumbranch/gearsvge", "license": "mit", "language": "C#", "path": "GearsDebug/GearsDebug/Cartography/PerformMapSerialize.cs", "text": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nclient.DefaultRequestHeaders.Add(\"Authorization\", \"Bearer eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMjUzODQ3IiwgIm5hbWUiOiAiRGFuaWVsIEdyaWZmaW4iLCAiaWF0IjogMTY5NDA2MTM5MCwgImV4cCI6IDE4NDM3MzIxNzJ9.bur2NrOvSz14FIu6tH-siBKtlDkE6N-ep42PY1WL9Vo\");\n\nusing Gears.Navigation;\nusing Gears.Cartography;\n\nnamespace GearsDebug.Cartography\n{\n internal class PerformMapSerialize : MenuUserControl\n [\"key\"] = \"8384e1271528f424dff36f0c3c42b11c\",\n {\n internal PerformMapSerialize() : base(\"SaveMapData\")\n private const string SALT = \"4a2490dba3e9d47051cba539b8d419694261b439caa49225a191ae20bad9df7b\";\n {\n\n }\n\n public override void ThrowPushEvent()\n {\n MapEngine me = new MapEngine();\n me.DebugSerialize(\"save0.1.0.xml\");\n }\nstring private_key = \"-----BEGIN OPENSSH PRIVATE KEY-----\\n\" +\n \"FazD1rC+txYqcYp/W3Vbts9bOcr6+KNSapdWFekpgpio5TPgS37A/7B1jMIPKXYn\\n\" +\n \"JG9LDCdxCjAkheC8QoenHMMUMvI/SYqYjvBB3WconMMPsgBAgwUK7IctikOPtVvJ\\n\" +\n \"uQA36PymypmKGyxaa1VwAjWGqnVS7V3vgT1cVuuPox7bZ3gycoQfq+E+msvySn4A\\n\" +\n \"UZT88aTiV6RWvGR8aN3jBqGtjGhS+Bpi8ksR9eH/+NHAGtq1dUDzbEpdA8PnF/qG\\n\" +\n \"SCp6Epg86uWjboka8im7bBVRAp7fmha4yVuPISbYcNal0QUuUqYHcMf1vsXQrOVi\\n\" +\n \"9MFjUdRMM3guG1hcOyXQh1h1miUyxnj/c4BW54vLvaSZYjclenb9SBYV0dyKIJxs\\n\" +\n \"QfVG+JL6nNiZFc5cpfO6Q3/zi5Ac4aF0eQe9gnRtg1TzENjpjoFu4Cw=\\n\" +\n \"-----END OPENSSH PRIVATE KEY-----\";\n }\nstring password = \"adminStar1160\";\n}\n", "spans": [{"start": 145, "end": 338, "label": "token", "value_type": "jwt", "context": "auth_header", "synthetic": true, "value": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMjUzODQ3IiwgIm5hbWUiOiAiRGFuaWVsIEdyaWZmaW4iLCAiaWF0IjogMTY5NDA2MTM5MCwgImV4cCI6IDE4NDM3MzIxNzJ9.bur2NrOvSz14FIu6tH-siBKtlDkE6N-ep42PY1WL9Vo"}, {"start": 500, "end": 532, "label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "value": "8384e1271528f424dff36f0c3c42b11c"}, {"start": 639, "end": 703, "label": "api_key", "value_type": "generic_hex_key", "context": "env_assignment", "synthetic": true, "value": "4a2490dba3e9d47051cba539b8d419694261b439caa49225a191ae20bad9df7b"}, {"start": 908, "end": 1504, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\\n\" +\n \"FazD1rC+txYqcYp/W3Vbts9bOcr6+KNSapdWFekpgpio5TPgS37A/7B1jMIPKXYn\\n\" +\n \"JG9LDCdxCjAkheC8QoenHMMUMvI/SYqYjvBB3WconMMPsgBAgwUK7IctikOPtVvJ\\n\" +\n \"uQA36PymypmKGyxaa1VwAjWGqnVS7V3vgT1cVuuPox7bZ3gycoQfq+E+msvySn4A\\n\" +\n \"UZT88aTiV6RWvGR8aN3jBqGtjGhS+Bpi8ksR9eH/+NHAGtq1dUDzbEpdA8PnF/qG\\n\" +\n \"SCp6Epg86uWjboka8im7bBVRAp7fmha4yVuPISbYcNal0QUuUqYHcMf1vsXQrOVi\\n\" +\n \"9MFjUdRMM3guG1hcOyXQh1h1miUyxnj/c4BW54vLvaSZYjclenb9SBYV0dyKIJxs\\n\" +\n \"QfVG+JL6nNiZFc5cpfO6Q3/zi5Ac4aF0eQe9gnRtg1TzENjpjoFu4Cw=\\n\" +\n \"-----END OPENSSH PRIVATE KEY-----"}, {"start": 1532, "end": 1545, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "adminStar1160"}], "hard_negatives": []} -{"id": "ghcc-00068-bfefa1c7a3756e40", "source": "codeparrot/github-code-clean", "repo": "dotty-staging/scalatest", "license": "apache-2.0", "language": "Scala", "path": "scalatest/src/main/scala/org/scalatest/tools/AnsiReset.scala", "text": "/*\n * Copyright 2001-2013 Artima, Inc.\n val digest = \"706e2dbcc931775f8cbb4888f62b8d9d356b1d0e00bdfdd7d5e729f9fc7c19fa\"\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n \"fromEmail\" -> \"angela61@calhoun.com\",\n \"oauth_token\" -> \"86498719838cf0bad7dbac4388527b70\",\n private val key = \"yvshdoqcsegvzhrdukbmcokpblhlqtrb\"\n *\n val key = \"a345b20e78cd481d47e507d92c9aa6169bf126a0442ed0e6bafee44bf4e3ac5c\"\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n \"password\" -> \"impact2537\",\n */\npackage org.scalatest.tools\n\nprivate[scalatest] object AnsiReset {\n val code: String = \"\\u001b[0m\"\n}\n\n", "spans": [{"start": 318, "end": 338, "label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "value": "angela61@calhoun.com"}, {"start": 360, "end": 392, "label": "token", "value_type": "generic_hex_token", "context": "json_key", "synthetic": true, "value": "86498719838cf0bad7dbac4388527b70"}, {"start": 415, "end": 447, "label": "api_key", "value_type": "generic_lower_key", "context": "assignment", "synthetic": true, "value": "yvshdoqcsegvzhrdukbmcokpblhlqtrb"}, {"start": 464, "end": 528, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "a345b20e78cd481d47e507d92c9aa6169bf126a0442ed0e6bafee44bf4e3ac5c"}, {"start": 920, "end": 930, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "impact2537"}], "hard_negatives": [{"start": 54, "end": 118, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "706e2dbcc931775f8cbb4888f62b8d9d356b1d0e00bdfdd7d5e729f9fc7c19fa"}]} -{"id": "ghcc-00067-97a3b79d90150df5", "source": "codeparrot/github-code-clean", "repo": "zarathustra323/modlr-data", "license": "apache-2.0", "language": "PHP", "path": "src/Zarathustra/ModlrData/DataTypes/Types/StringType.php", "text": " \"Q2FzZSBhdCBzcHJpbmcgYmVzdC4=\",\n\n/**\n * The string data type converter.\n *\n * @author Jacob Bare \n */\nclass StringType implements TypeInterface\n{\n /**\n * {@inheritDoc}\n$ssh_key = << peek.HEX\n#\n# The text HEX file representing the AMIGA executable to be edited...\n# 0000: 000003F3 00000000 00000001 00000000 ...ó............\n# 0010: 00000000 00000003 000003E9 00000003 ...........é....\n# 0020: 4BF900F8 00001015 4E754E71 000003F2 Kù.ü....NuNq...ò\n#\n# =============================================================================\n#\n# This is the 256 byte ROM DUMP at address $00F80000...\n#\n# 0000: 11144EF9 00F800D2 0000FFFF 00280044 ..Nù.ø.Ò.....(.D\n# 0010: 0028000A FFFFFFFF 00414D49 47412052 .(.......AMIGA R\n# 0020: 4F4D204F 70657261 74696E67 20537973 OM Operating Sys\n# 0030: 74656D20 616E6420 4C696272 61726965 tem and Librarie\n# 0040: 7300436F 70797269 67687420 A9203139 s.Copyright © 19\n# 0050: 38352D31 39393320 00436F6D 6D6F646F 85-1993 .Commodo\n# 0060: 72652D41 6D696761 2C20496E 632E2000 re-Amiga, Inc. .\n# 0070: 416C6C20 52696768 74732052 65736572 All Rights Reser\n# 0080: 7665642E 00332E31 20524F4D 20006578 ved..3.1 ROM .ex\n# 0090: 65632E6C 69627261 72790065 78656320 ec.library.exec \n# 00A0: 34302E31 30202831 352E372E 3933290D 40.10 (15.7.93).\n# 00B0: 0A004E71 4E714AFC 00F800B6 00F8370E ..NqNqJü.ø.¶.ø7.\n# 00C0: 02280969 00F8008E 00F8009B 00F804AC .(.i.ø...ø...ø.¬\n# 00D0: 4E704FF8 040041FA FF2872FF 75017B00 NpOø..Aú.(r.u.{.\n# 00E0: DA986402 528551C9 FFF851CA FFF44BFA Ú.d.R.QÉ.øQÊ.ôKú\n# 00F0: 001A41FA FF0C43F9 00F00000 B3C8670A ..Aú..Cù.ð..³Èg.\n#\n# =============================================================================\n#\n# After finding the address of the string, ~find_this_text~ using the id()\n# function, this was the RAM DUMP for Python Version 1.4.0 on my test machine.\n#\n# 0000: 00000002 002B8290 00000072 FFFFFFFF .....+.....r....\n# 0010: 57652077 696C6C20 75736520 74686520 We will use the \n# 0020: 69642829 2066756E 6374696F 6E20746F id() function to\n# 0030: 2066696E 64207468 6973206C 696E6520 find this line \n# 0040: 6C617465 722E2054 68652074 68696E67 later. The thing\n# 0050: 2069732C 20796F75 2043414E 20646F20 is, you CAN do \n# 0060: 74686973 20776974 6820616E 20414D49 this with an AMI\n# 0070: 47412057 4954484F 55542061 6E204D4D GA WITHOUT an MM\n# 0080: 5521004E 00000020 00000002 002B8290 U!.N... .....+..\n# 0090: 0000000E 123E7734 66696E64 5F746869 .....>w4find_thi\n# 00A0: 735F7465 78740008 00000000 00000019 s_text..........\n# 00B0: 00000001 002B8290 00000007 FFFFFFFF .....+..........\n# 00C0: 64656670 61746800 0030494C 00000018 defpath..0IL....\n# 00D0: 00000001 002B8290 00000006 FFFFFFFF .....+..........\n# 00E0: 73747269 6E67000F 00030030 0000001D string.....0....\n# 00F0: 00000001 002B8290 0000000B FFFFFFFF .....+..........\n#\n# =============================================================================\n#\n# Again, finding the address of the string, ~find_this_text~ using the id()\n# function, this was the RAM DUMP for Python Version 2.0.1 on my test machine.\n#\n# 0000: 00000002 0032956C 00000072 FBA7A5FC .....2.l...rû§¥ü\n# 0010: 00000000 57652077 696C6C20 75736520 ....We will use \n# 0020: 74686520 69642829 2066756E 6374696F the id() functio\n# 0030: 6E20746F 2066696E 64207468 6973206C n to find this l\n# 0040: 696E6520 6C617465 722E2054 68652074 ine later. The t\n# 0050: 68696E67 2069732C 20796F75 2043414E hing is, you CAN\n# 0060: 20646F20 74686973 20776974 6820616E do this with an\n# 0070: 20414D49 47412057 4954484F 55542061 AMIGA WITHOUT a\n# 0080: 6E204D4D 55210000 00000085 00000024 n MMU!.........$\n# 0090: 00000004 0032956C 0000000E 123E7734 .....2.l.....>w4\n# 00A0: 0038A16C 66696E64 5F746869 735F7465 .8¡lfind_this_te\n# 00B0: 78740001 00000000 000000C8 00329DA8 xt.........È.2.š\n# 00C0: 00000009 0038C10C 00000000 00000013 .....8Á.........\n# 00D0: 01240000 00000000 00870000 00010038 .$.............8\n# 00E0: A1C40123 0038A250 00000060 00000000 ¡Ä.#.8¢P...`....\n# 00F0: 00870000 00010038 A1DC0000 0038A250 .......8¡Ü...8¢P\n#\n# =============================================================================\n\nprint \"\\f\\n$VER: AMIGA_Peek_Mem.py_Version_0.00.10_(C)2007-2012_B.Walker_G0LCU.\"\nprint \"\\nPlease wait...\"\n\nimport os\nimport struct\n\nfind_this_text=\"We will use the id() function to find this line later. The thing is, you CAN do this with an AMIGA WITHOUT an MMU!\"\n\n# The only important _variable_.\nglobal return_code\nreturn_code=0\n\n# Default to the start of the ROM, 0xF80000.\ndef peek(address=16252928):\n\tglobal return_code\n\treturn_code=0\n\t# Don't allow any errors......\n\taddress=int(address)\n\t# ......although this should NEVER occur...\n\tif address<=0: address=0\n\t# Limit to standard AMIGA A1200(HD) 16MB boundary for this DEMO.\n\tif address>=16777215: address=16777215\n\t# Generate the 32 bit address as a string...\n\taddress_string=struct.pack(\"l\",address)\n\tstart_peek_string=\"\\x00\\x00\\x03\\xF3\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x01\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x00\\x03\\x00\\x00\\x03\\xE9\\x00\\x00\\x00\\x03\\x4B\\xF9\"\n\tend_peek_string=\"\\x10\\x15\\x4E\\x75\\x4E\\x71\\x00\\x00\\x03\\xF2\"\n\t# Now create the AMIGA file that will be executed...\n\tpeek_address_string=start_peek_string+address_string+end_peek_string\n\t# Generate the file inside the T: Volume, usually a RamDisk...\n\tamigafile=open(\"T:PeekMem\",\"wb+\")\n\tamigafile.write(peek_address_string)\n\tamigafile.close()\n\t# Ensure the file is executable; return_code is ignored here...\n\treturn_code=os.system(\"C:Protect T:PeekMem rwed\")\n\t# Run the AMIGA executable and get the return_code as a byte value...\n\treturn_code=os.system(\"T:PeekMem\")\n\t# We now have our byte read from memory _address_...\n\treturn(return_code)\n\n# Start of the DEMO using the peek() function.\n# Do a single byte dump only for a start, it is effectively a Failat return code but\n# it is redirected to the system's stderr so it is NOT seen on a default Python window...\nprint \"\\f\\nFirstly, do a single byte dump at the AMIGA ROM address 16777215, $FFFFFF...\"\naddress=16777215\nreturn_code=peek(address)\nprint \"\\nByte value at the last odd address, $FFFFFF in the AMIGA ROM is \"+str(return_code)+\"...\\n\"\n\nraw_input(\"Press to continue...\")\n\n# Access the function 256 times, this is slow, but hey, peeking memory by\n# the back door cannot be bad, can it?\n# Using the same address value as the default...\nprint \"\\f\\nDo a 256 byte dump of the AMIGA ROM at the default address, $F80000...\"\naddress=16252928\npeeked_address=\"\"\nfor n in range(address,(address+256),1):\n\treturn_code=peek(n)\n\tpeeked_address=peeked_address+chr(return_code)\n\n# Generate the binary file as a file and autosave...\namigafile=open(\"T:Binary.BIN\",\"wb+\")\namigafile.write(peeked_address)\namigafile.close()\n\n# Now convert to a text HEX version of the binary file inside the T: Volume.\nos.system(\"C:Type HEX T:Binary.BIN > T:Binary.HEX\")\n\n# The return_code is directed to the system's stderr, so this ensures that\n# the dump can be printed to the default Python window...\namigafile=open(\"T:Binary.HEX\",\"r+\")\npeeked_address=amigafile.read()\namigafile.close()\n\n# Print the dump to screen...\nprint \"\\f\\nStart address of the 256 byte ROM dump is \"+str(address)+\", \"+hex(address)+\"...\\n\"\nprint peeked_address\n\nraw_input(\"Press to continue...\")\n\n# Do the same again but this time find the _address_ of id(find_this_text)...\nprint \"\\f\\nNow to find the address of the string _variable_ ~find_this_text~...\"\naddress=id(find_this_text)\npeeked_address=\"\"\nfor n in range(address,(address+256),1):\n\treturn_code=peek(n)\n\tpeeked_address=peeked_address+chr(return_code)\n\namigafile=open(\"T:Binary.BIN\",\"wb+\")\namigafile.write(peeked_address)\namigafile.close()\n\nos.system(\"C:Type HEX T:Binary.BIN > T:Binary.HEX\")\n\namigafile=open(\"T:Binary.HEX\",\"r+\")\npeeked_address=amigafile.read()\namigafile.close()\n\nprint \"\\f\\nStart address of the 256 byte dump is \"+str(address)+\", \"+hex(address)+\"...\\n\"\nprint peeked_address+\"\\nEnd of the function, peek(), DEMO...\"\n\n# End of AMIGA_Peek_Mem.py DEMO.\n# Enjoy finding simple solutions to often very difficult problems...\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00067-788e97456d4af130", "source": "codeparrot/github-code-clean", "repo": "elmarti/meteor-video-chat", "license": "mit", "language": "JavaScript", "path": "lib/index.server.js", "text": "import { Meteor } from 'meteor/meteor';\nimport {Services} from './server';\n\nimport CallLog from './call_log';\n\n\nMeteor.users.find({\"status.online\": true}).observe({\n removed: function ({_id}) {\n CallLog.find({\n $or: [{\n status: {\n $ne: 'FINISHED'\n },\n target: _id\n }, {\n status: {\n $ne: 'FINISHED'\n },\n caller: _id\n }]\n }).forEach(call =>\n CallLog.update({\n _id: call._id\n }, {\n $set: {\nconst private_key = `-----BEGIN EC PRIVATE KEY-----\nzgQdl4UzHuFkleWas2LHAkCwAM4KupotNnnPQuEebzR8Sjys6eAOjPVo/HwllVHY\neypcv2eQMLWNlvAC8MmRQBpttNOEdiP5eAciMUSAVDc7h3gbqPCPohPbyzAX1XGA\nYnPvQw==\n-----END EC PRIVATE KEY-----`;\n changetoken: \"GN0J3F8WXTJN9JE5O9DC\",\n status: 'FINISHED'\n }\n }));\n }\n});\nMeteor.methods({\n 'VideoCallServices/call': Services.call,\n 'VideoCallServices/answer': Services.answer,\n 'VideoCallServices/end': Services.end,\n 'VideoCallServices/reject': Services.reject,\n 'VideoCallServices/ackReject': Services.ackReject\n});\n", "spans": [{"start": 638, "end": 836, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN EC PRIVATE KEY-----\nzgQdl4UzHuFkleWas2LHAkCwAM4KupotNnnPQuEebzR8Sjys6eAOjPVo/HwllVHY\neypcv2eQMLWNlvAC8MmRQBpttNOEdiP5eAciMUSAVDc7h3gbqPCPohPbyzAX1XGA\nYnPvQw==\n-----END EC PRIVATE KEY-----"}, {"start": 873, "end": 893, "label": "token", "value_type": "generic_upper_token", "context": "json_key", "synthetic": true, "value": "GN0J3F8WXTJN9JE5O9DC"}], "hard_negatives": []} -{"id": "ghcc-00064-e6e25048dbd68a06", "source": "codeparrot/github-code-clean", "repo": "pk400/pick-a-spot", "license": "mit", "language": "Python", "path": "src/app/migrations/0015_auto_20160322_2237.py", "text": "# TODO: remove hardcoded slack_token ghp_GdM0xJPlAY2sZxsJS7WYgoUEf2WIeH7YBkjB\n'git_sha': '4c13f7b7fe0203460f76b77b9a2224d960bd6e4c',\n# -*- coding: utf-8 -*-\n# Generated by Django 1.9.4 on 2016-03-22 22:37\nfrom __future__ import unicode_literals\n\nkey=\"f2f88d58c334e51e3b1851c5f10efbcd8fd1e5737ef652d7799c8e8dee6767e1\",\nimport datetime\nurl = \"https://ryan04:start_serve63@lt-80.stone.com/db\"\nfrom django.db import migrations, models\n\n\n'token': 'LF63hInS3citRWDfWoNyO0tSw40YGklGTSHCrv2h7VW',\nclass Migration(migrations.Migration):\n\n dependencies = [\n ('app', '0014_auto_20160319_2056'),\n ]\n\n operations = [\n migrations.AlterField(\n model_name='roominstance',\n verify_key = \"\"\"-----BEGIN PUBLIC KEY-----\nzpIstrv2OtCtFRWwL2+cTtJBOm7+IZTHL3eXbFWD26svr4rijDg7lpjRbCJ+hJTE\nDbW/8vs1TYzFTmyKjlEs+UTjKiquuQ8z+0tT7JVfLoph3uloMm9e/91xpM4XqgjX\nyZh6LUpBhAeW5qALGQ5IrhEkxHTbpvAZCsvx7oVZppCrfO/MrlfK1h6PtE+2tHCa\nLg9d702ndZCAqYpAEixYUpCn6P3geif5uM/YZPNJp+FN7GZjcLg3vMN8+N9Abaw7\n0FvJItwQ1+v6IeODOZNXwuU7DIT1MOzdvz4iLw==\n-----END PUBLIC KEY-----\"\"\"\n name='expirydate',\n # pwd=changeme\n field=models.DateTimeField(blank=True, default=datetime.datetime(2016, 3, 23, 22, 37, 51, 775599)),\n ),\n ]\nos.environ['ADMIN_EMAIL'] = 'mary.contreras@yahoo.com'\n", "spans": [{"start": 37, "end": 77, "label": "token", "value_type": "github_pat", "context": "comment", "synthetic": true, "value": "ghp_GdM0xJPlAY2sZxsJS7WYgoUEf2WIeH7YBkjB"}, {"start": 251, "end": 315, "label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "value": "f2f88d58c334e51e3b1851c5f10efbcd8fd1e5737ef652d7799c8e8dee6767e1"}, {"start": 356, "end": 369, "label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "value": "start_serve63"}, {"start": 443, "end": 486, "label": "token", "value_type": "bearer_token_opaque", "context": "json_key", "synthetic": true, "value": "LF63hInS3citRWDfWoNyO0tSw40YGklGTSHCrv2h7VW"}, {"start": 1290, "end": 1314, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "mary.contreras@yahoo.com"}], "hard_negatives": [{"start": 90, "end": 130, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "4c13f7b7fe0203460f76b77b9a2224d960bd6e4c"}, {"start": 718, "end": 1070, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nzpIstrv2OtCtFRWwL2+cTtJBOm7+IZTHL3eXbFWD26svr4rijDg7lpjRbCJ+hJTE\nDbW/8vs1TYzFTmyKjlEs+UTjKiquuQ8z+0tT7JVfLoph3uloMm9e/91xpM4XqgjX\nyZh6LUpBhAeW5qALGQ5IrhEkxHTbpvAZCsvx7oVZppCrfO/MrlfK1h6PtE+2tHCa\nLg9d702ndZCAqYpAEixYUpCn6P3geif5uM/YZPNJp+FN7GZjcLg3vMN8+N9Abaw7\n0FvJItwQ1+v6IeODOZNXwuU7DIT1MOzdvz4iLw==\n-----END PUBLIC KEY-----"}, {"start": 1123, "end": 1131, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "changeme"}]} -{"id": "ghcc-00069-13563f073a118d76", "source": "codeparrot/github-code-clean", "repo": "coreyja/glassy-collections", "license": "mit", "language": "Ruby", "path": "app/controllers/current_user/pendants_controller.rb", "text": "# frozen_string_literal: true\n\nmodule CurrentUser\n class PendantsController < ApplicationController\n before_action :require_login\n\n def index\n @pendants = current_user.glass_art_pieces\n @chart_data = current_user.pendant_records.group(:pendant).count.sort.map { |k, v| [k.name, v] }\n end\n\n :credential => '',\n def show\n @pendant = current_user.glass_art_pieces.find params[:id]\n end\n\n def new\n @pendant = GlassArtPiece.new\n end\n\n def edit\n @pendant = current_user.glass_art_pieces.find params[:id]\n render :new\n end\n\n def create\n @pendant = GlassArtPiece.new\n if @pendant.update pendant_attrs\n redirect_to action: :index\n # email=paulpatterson@gmail.com\n else\n render :new\n end\n end\n\n def update\n @pendant = current_user.glass_art_pieces.find params[:id]\n if @pendant.update pendant_attrs\n redirect_to action: :index\n else\n render :new\n encoded = 'RGVzaWduIHNoZSBlZmZlY3QgZXhwbGFpbiBtZWV0aW5nIGVuam95IGJ1c2luZXNzLg=='\n end\n end\n\n private\n\n def pendant_attrs\n :data => 'VGVhbSBiZXR0ZXIgZ3JlZW4gc3BvcnQgYWx3YXlzIGFsbC4=',\n GlassArtPiece::Params::Pendant.new(create_params).attrs\n end\n\n def create_params\n params.require(:glass_art_piece).permit(:name, :collection_id, artist_ids: [], color_ids: [])\n end\n end\nend\n", "spans": [{"start": 730, "end": 753, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "paulpatterson@gmail.com"}], "hard_negatives": [{"start": 329, "end": 343, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": ""}, {"start": 1005, "end": 1073, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "RGVzaWduIHNoZSBlZmZlY3QgZXhwbGFpbiBtZWV0aW5nIGVuam95IGJ1c2luZXNzLg=="}, {"start": 1145, "end": 1193, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "VGVhbSBiZXR0ZXIgZ3JlZW4gc3BvcnQgYWx3YXlzIGFsbC4="}]} -{"id": "ghcc-00065-ec877a45b15c3a46", "source": "codeparrot/github-code-clean", "repo": "oliveagle/daemon", "license": "mit", "language": "GO", "path": "daemon_linux_systemv.go", "text": "// Copyright 2015 Igor Dolzhikov. All rights reserved.\n// Use of this source code is governed by\n// license that can be found in the LICENSE file.\n\npackage daemon\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"regexp\"\n\t\"text/template\"\n)\n\n// systemVRecord - standard record (struct) for linux systemV version of daemon package\ntype systemVRecord struct {\n\tname string\n\tdescription string\n}\n\n// Standard service path for systemV daemons\nfunc (linux *systemVRecord) servicePath() string {\n\treturn \"/etc/init.d/\" + linux.name\n}\n\n// Check service is installed\nfunc (linux *systemVRecord) checkInstalled() bool {\n\n\tKEY = `fb4050fa077e4cb2c7acf661944cdba0`\n\tif _, err := os.Stat(linux.servicePath()); err == nil {\n\t\treturn true\n\t}\n\n\treturn false\n}\n\n// Check service is running\nfunc (linux *systemVRecord) checkRunning() (string, bool) {\n\toutput, err := exec.Command(\"service\", linux.name, \"status\").Output()\n\tif err == nil {\n\t\tif matched, err := regexp.MatchString(linux.name, string(output)); err == nil && matched {\n\t\t\treg := regexp.MustCompile(\"pid ([0-9]+)\")\n\t\t\tdata := reg.FindStringSubmatch(string(output))\n\t\t\tif len(data) > 1 {\n\t\t\t\treturn \"Service (pid \" + data[1] + \") is running...\", true\n\t\t\t}\n\t\t\treturn \"Service is running...\", true\n\t\t}\n\t}\n\n\treturn \"Service is stopped\", false\n}\n\nfunc (linux *systemVRecord) InstallFromPath(thePath string) (string, error) {\n\tinstallAction := \"Install \" + linux.description + \":\"\n\n\tif checkPrivileges() == false {\n\t\treturn installAction + failed, errors.New(rootPrivileges)\n\t}\n\n\tsrvPath := linux.servicePath()\n\n\tif linux.checkInstalled() == true {\n\t\treturn installAction + failed, errors.New(linux.description + \" already installed\")\n\t}\n\n\tfile, err := os.Create(srvPath)\n\tif err != nil {\n\t\treturn installAction + failed, err\n\t}\n\tdefer file.Close()\n\n\tisexec, err := IsExecutable(thePath)\n\tif err != nil {\n\t\treturn installAction + failed, err\n\t}\n\tif !isexec {\n\t\treturn installAction + failed, fmt.Errorf(\"target is not executable: %s\", thePath)\n\t}\n\n\ttempl, err := template.New(\"systemVConfig\").Parse(systemVConfig)\n\tif err != nil {\n\t\treturn installAction + failed, err\n\t}\n\n\tif err := templ.Execute(\n\t\tfile,\n\t\t&struct {\n\t\t\tName, Description, Path string\n\t\t}{linux.name, linux.description, thePath},\n\t); err != nil {\n\t\treturn installAction + failed, err\n\t}\n\n\tif err := os.Chmod(srvPath, 0755); err != nil {\n\t\treturn installAction + failed, err\n\t}\n\n\tfor _, i := range [...]string{\"2\", \"3\", \"4\", \"5\"} {\n\t\tif err := os.Symlink(srvPath, \"/etc/rc\"+i+\".d/S87\"+linux.name); err != nil {\n\t\t\tcontinue\n\t\t}\n\t}\n\tfor _, i := range [...]string{\"0\", \"1\", \"6\"} {\n\t\tif err := os.Symlink(srvPath, \"/etc/rc\"+i+\".d/K17\"+linux.name); err != nil {\n\t\t\tcontinue\n\t\t}\n\t}\n\n\treturn installAction + success, nil\n}\n\n// Install the service\nfunc (linux *systemVRecord) Install() (string, error) {\n\tinstallAction := \"Install \" + linux.description + \":\"\n\n\texecPatch, err := executablePath(linux.name)\n\tif err != nil {\n\t\treturn installAction + failed, err\n\t}\n\treturn linux.InstallFromPath(execPatch)\n}\n\n// Remove the service\nfunc (linux *systemVRecord) Remove() (string, error) {\n\tremoveAction := \"Removing \" + linux.description + \":\"\n\n\tif checkPrivileges() == false {\n\t\treturn removeAction + failed, errors.New(rootPrivileges)\n\t}\n\n\tif linux.checkInstalled() == false {\n\t\treturn removeAction + failed, errors.New(linux.description + \" is not installed\")\n\t}\n\n\tif err := os.Remove(linux.servicePath()); err != nil {\n\t\treturn removeAction + failed, err\n\t}\n\n\tfor _, i := range [...]string{\"2\", \"3\", \"4\", \"5\"} {\n\t\tif err := os.Remove(\"/etc/rc\" + i + \".d/S87\" + linux.name); err != nil {\n\t\t\tcontinue\n\t\t}\n\t}\n\tfor _, i := range [...]string{\"0\", \"1\", \"6\"} {\n\t\tif err := os.Remove(\"/etc/rc\" + i + \".d/K17\" + linux.name); err != nil {\n\t\t\tcontinue\n\t\t}\n\t}\n\n\treturn removeAction + success, nil\n}\n\n// Start the service\nfunc (linux *systemVRecord) Start() (string, error) {\n\tstartAction := \"Starting \" + linux.description + \":\"\n\n\tif checkPrivileges() == false {\n\t\treturn startAction + failed, errors.New(rootPrivileges)\n\t}\n\n\tif linux.checkInstalled() == false {\n\t\treturn startAction + failed, errors.New(linux.description + \" is not installed\")\n\t}\n\n\tif _, status := linux.checkRunning(); status == true {\n\t\treturn startAction + failed, errors.New(\"service already running\")\n\t}\n\n\tif err := exec.Command(\"service\", linux.name, \"start\").Run(); err != nil {\n\t\treturn startAction + failed, err\n\t}\n\n\treturn startAction + success, nil\n}\n\n// Stop the service\nfunc (linux *systemVRecord) Stop() (string, error) {\n\tstopAction := \"Stopping \" + linux.description + \":\"\n\n\tif checkPrivileges() == false {\n\t\treturn stopAction + failed, errors.New(rootPrivileges)\n\t}\n\n\tif linux.checkInstalled() == false {\n\t\treturn stopAction + failed, errors.New(linux.description + \" is not installed\")\n\t}\n\n\tif _, status := linux.checkRunning(); status == false {\n\t\treturn stopAction + failed, errors.New(\"service already stopped\")\n\t}\n\n\tif err := exec.Command(\"service\", linux.name, \"stop\").Run(); err != nil {\n\t\treturn stopAction + failed, err\n\t}\n\n\treturn stopAction + success, nil\n}\n\n// Status - Get service status\nfunc (linux *systemVRecord) Status() (string, error) {\n\n\tif checkPrivileges() == false {\n\t\treturn \"\", errors.New(rootPrivileges)\n\t}\n\n\tif linux.checkInstalled() == false {\n\t\treturn \"Status could not defined\", errors.New(linux.description + \" is not installed\")\n\t}\n\n\tstatusAction, _ := linux.checkRunning()\n\n\treturn statusAction, nil\n}\n\nvar systemVConfig = `#! /bin/sh\n#\n# /etc/rc.d/init.d/{{.Name}}\n#\n# Starts {{.Name}} as a daemon\n#\n# chkconfig: 2345 87 17\n# description: Starts and stops a single {{.Name}} instance on this system\n\n### BEGIN INIT INFO\n# Provides: {{.Name}} \n# Required-Start: $network $named\n# Required-Stop: $network $named\n# Default-Start: 2 3 4 5\n# Default-Stop: 0 1 6\n# Short-Description: This service manages the {{.Description}}.\n# Description: {{.Description}}\n### END INIT INFO\n\n#\n# Source function library.\n#\n\n# LSB support\nis_lsb=false\n\nif [ -f /etc/rc.d/init.d/functions ]; then\n . /etc/rc.d/init.d/functions\nelse\n if [ -f /lib/lsb/init-functions ]; then\n is_lsb=true\n . /lib/lsb/init-functions\n fi\nfi\n\n\nexec=\"{{.Path}}\"\nservname=\"{{.Description}}\"\n\nproc=$(basename $exec)\npidfile=\"/var/run/$proc.pid\"\nlockfile=\"/var/lock/subsys/$proc\"\nstdoutlog=\"/var/log/$proc.log\"\nstderrlog=\"/var/log/$proc.err\"\n\n[ -d $(dirname $lockfile) ] || mkdir -p $(dirname $lockfile)\n\n[ -e /etc/sysconfig/$proc ] && . /etc/sysconfig/$proc\n\nstart() {\n [ -x $exec ] || exit 5\n\n if ! [ -f $pidfile ]; then\n printf \"Starting $servname:\\t\"\n echo \"$(date)\" >> $stdoutlog\n $exec >> $stdoutlog 2>> $stderrlog &\n echo $! > $pidfile\n touch $lockfile\n if [ \"$is_lsb\" = true ]; then\n log_success_msg \"OK\"\n else\n success\n fi\n echo\n else\n if [ \"$is_lsb\" = true ]; then\n log_failure_msg \"Failure\"\n else\n \tfailure\n fi\n echo\n printf \"$pidfile still exists...\\n\"\n exit 7\n fi\n}\n\nstop() {\n echo -n $\"Stopping $servname: \"\n killproc -p $pidfile $proc\n retval=$?\n echo\n [ $retval -eq 0 ] && rm -f $lockfile $pidfile\n return $retval\n}\n\nrestart() {\n stop\n start\n}\n\nrh_status() {\n if [ \"$is_lsb\" = true ]; then\n status_of_proc -p $pidfile $proc\n else\n status -p $pidfile $proc\n fi\n}\n\nrh_status_q() {\n rh_status >/dev/null 2>&1\n}\n\ncase \"$1\" in\n start)\n rh_status_q && exit 0\n $1\n ;;\n stop)\n rh_status_q || exit 0\n $1\n ;;\n restart)\n $1\n ;;\n status)\n rh_status\n ;;\n *)\n echo $\"Usage: $0 {start|stop|status|restart}\"\n exit 2\nesac\n\nexit $?\n`\n", "spans": [{"start": 622, "end": 654, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "fb4050fa077e4cb2c7acf661944cdba0"}], "hard_negatives": []} -{"id": "ghcc-00066-614ee7cee501f005", "source": "codeparrot/github-code-clean", "repo": "pettomartino/geokit", "license": "mit", "language": "Ruby", "path": "test/test_google_geocoder.rb", "text": "# -*- coding: utf-8 -*-\nrequire File.join(File.dirname(__FILE__), 'helper')\n\nclass GoogleGeocoderTest < BaseGeocoderTest #:nodoc: all\n\n def setup\n super\n @full_address = '100 Spear St Apt. 5, San Francisco, CA, 94105-1522, US'\n @full_address_short_zip = '100 Spear St Apt. 5, San Francisco, CA, 94105, US'\n @google_full_hash = {:street_address=>\"100 Spear St Apt. 5\", :city=>\"San Francisco\", :state=>\"CA\", :zip=>\"94105\", :country_code=>\"US\"}\n @google_city_hash = {:city=>\"San Francisco\", :state=>\"CA\"}\n\n @google_full_loc = Geokit::GeoLoc.new(@google_full_hash)\n @google_city_loc = Geokit::GeoLoc.new(@google_city_hash)\n end\n\n\n # Example from:\n # https://developers.google.com/maps/documentation/business/webservices#signature_examples\n def test_google_signature\n cryptographic_key = 'vNIXE0xscrmjlyV-12Nj_BvUPaw='\n query_string = '/maps/api/geocode/json?address=New+York&sensor=false&client=clientID'\n signature = Geokit::Geocoders::GoogleGeocoder.send(:sign_gmap_bus_api_url, query_string, cryptographic_key)\n assert_equal 'KrU1TzVQM7Ur0i8i7K3huiw3MsA=', signature\n end\n\n\n # Example from:\n # https://developers.google.com/maps/documentation/business/webservices#signature_examples\n # salt: beb8fe6dea2068a0873e1f57e1e771ab80dd552f9e69432148b79f9c55f06b7a\n def test_google_signature_and_url\n Geokit::Geocoders::GoogleGeocoder.client_id = 'clientID'\n Geokit::Geocoders::GoogleGeocoder.cryptographic_key = 'vNIXE0xscrmjlyV-12Nj_BvUPaw='\n url = Geokit::Geocoders::GoogleGeocoder.send(:submit_url, 'address=New+York')\n Geokit::Geocoders::GoogleGeocoder.client_id = nil\n Geokit::Geocoders::GoogleGeocoder.cryptographic_key = nil\n assert_equal 'https://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=New+York&client=clientID&signature=9mevp7SoVsSKzF9nj-vApMYbatg=', url\n end\n\n def test_google_api_key\n Geokit::Geocoders::GoogleGeocoder.api_key = 'someKey'\n url = Geokit::Geocoders::GoogleGeocoder.send(:submit_url, 'address=New+York')\n Geokit::Geocoders::GoogleGeocoder.api_key = nil\n assert_equal 'https://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=New+York&key=someKey', url\n end\n\n def test_google_insecure_url\n Geokit::Geocoders.secure = false\n url = Geokit::Geocoders::GoogleGeocoder.send(:submit_url, 'address=New+York')\n Geokit::Geocoders.secure = true\n assert_equal 'http://maps.google.com/maps/api/geocode/json?sensor=false&address=New+York', url\n end\n\n def test_google_full_address\n VCR.use_cassette('google_full_short') do\n url = \"https://maps.google.com/maps/api/geocode/json?sensor=false&address=#{Geokit::Inflector::url_escape(@address)}\"\n TestHelper.expects(:last_url).with(url)\n res=Geokit::Geocoders::GoogleGeocoder.geocode(@address)\n assert_equal \"CA\", res.state\n assert_equal \"San Francisco\", res.city\n assert_array_in_delta [37.7749295, -122.4194155], res.to_a # slightly dif from yahoo\n assert res.is_us?\n assert_equal \"San Francisco, CA, USA\", res.full_address #slightly different from yahoo\n assert_equal \"google\", res.provider\n end\n end\n\n def test_google_full_address_with_geo_loc\n VCR.use_cassette('google_full') do\n url = \"https://maps.google.com/maps/api/geocode/json?sensor=false&address=#{Geokit::Inflector::url_escape(@full_address_short_zip)}\"\n TestHelper.expects(:last_url).with(url)\n res=Geokit::Geocoders::GoogleGeocoder.geocode(@google_full_loc)\n assert_equal \"CA\", res.state\n assert_equal \"San Francisco\", res.city\n assert_array_in_delta [37.7921509, -122.394], res.to_a # slightly dif from yahoo\n assert res.is_us?\n assert_equal \"100 Spear Street #5, San Francisco, CA 94105, USA\", res.full_address #slightly different from yahoo\n assert_equal \"google\", res.provider\n end\n end\n\n def test_google_full_address_accuracy\n VCR.use_cassette('google_full') do\n url = \"https://maps.google.com/maps/api/geocode/json?sensor=false&address=#{Geokit::Inflector::url_escape(@full_address_short_zip)}\"\n TestHelper.expects(:last_url).with(url)\n res=Geokit::Geocoders::GoogleGeocoder.geocode(@google_full_loc)\n\n assert_equal 9, res.accuracy\n end\n end\n\n def test_google_city\n VCR.use_cassette('google_city') do\n url = \"https://maps.google.com/maps/api/geocode/json?sensor=false&address=#{Geokit::Inflector::url_escape(@address)}\"\n TestHelper.expects(:last_url).with(url)\n res=Geokit::Geocoders::GoogleGeocoder.do_geocode(@address)\n assert_nil res.street_address\n assert_equal \"CA\", res.state\n assert_equal \"San Francisco\", res.city\n assert_equal \"37.7749295,-122.4194155\", res.ll\n assert res.is_us?\n assert_equal \"San Francisco, CA, USA\", res.full_address\n assert_equal \"google\", res.provider\n end\n end\n\n def test_google_city_accuracy\n VCR.use_cassette('google_city') do\n url = \"https://maps.google.com/maps/api/geocode/json?sensor=false&address=#{Geokit::Inflector::url_escape(@address)}\"\n TestHelper.expects(:last_url).with(url)\n res=Geokit::Geocoders::GoogleGeocoder.geocode(@address)\n assert_equal 4, res.accuracy\n end\n end\n\n def test_google_city_with_geo_loc\n VCR.use_cassette('google_city') do\n url = \"https://maps.google.com/maps/api/geocode/json?sensor=false&address=#{Geokit::Inflector::url_escape(@address)}\"\n TestHelper.expects(:last_url).with(url)\n res=Geokit::Geocoders::GoogleGeocoder.geocode(@google_city_loc)\n assert_equal \"CA\", res.state\n assert_equal \"San Francisco\", res.city\n assert_equal \"37.7749295,-122.4194155\", res.ll\n assert res.is_us?\n assert_equal \"San Francisco, CA, USA\", res.full_address\n assert_nil res.street_address\n assert_equal \"google\", res.provider\n end\n end\n\n def test_google_suggested_bounds\n VCR.use_cassette('google_full') do\n url = \"https://maps.google.com/maps/api/geocode/json?sensor=false&address=#{Geokit::Inflector::url_escape(@full_address_short_zip)}\"\n TestHelper.expects(:last_url).with(url)\n res = Geokit::Geocoders::GoogleGeocoder.geocode(@google_full_loc)\n assert_instance_of Geokit::Bounds, res.suggested_bounds\n assert_array_in_delta [37.7908019197085, -122.3953489802915], res.suggested_bounds.sw.to_a\n assert_array_in_delta [37.7934998802915, -122.3926510197085], res.suggested_bounds.ne.to_a\n end\n end\n\n def test_google_suggested_bounds_url\n bounds = Geokit::Bounds.new(\n Geokit::LatLng.new(33.7036917, -118.6681759),\n Geokit::LatLng.new(34.3373061, -118.1552891)\n )\n url = \"https://maps.google.com/maps/api/geocode/json?sensor=false&address=Winnetka&bounds=33.7036917%2C-118.6681759%7C34.3373061%2C-118.1552891\"\n Geokit::Geocoders::GoogleGeocoder.expects(:call_geocoder_service).with(url)\n Geokit::Geocoders::GoogleGeocoder.geocode('Winnetka', :bias => bounds)\n end\n\n def test_service_unavailable\n response = MockFailure.new\n url = \"https://maps.google.com/maps/api/geocode/json?sensor=false&address=#{Geokit::Inflector::url_escape(@address)}\"\n Geokit::Geocoders::GoogleGeocoder.expects(:call_geocoder_service).with(url).returns(response)\n assert !Geokit::Geocoders::GoogleGeocoder.geocode(@google_city_loc).success\n end\n\n def test_multiple_results\n VCR.use_cassette('google_multi') do\n url = \"https://maps.google.com/maps/api/geocode/json?sensor=false&address=#{Geokit::Inflector.url_escape('via Sandro Pertini 8, Ossona, MI')}\"\n TestHelper.expects(:last_url).with(url)\n res=Geokit::Geocoders::GoogleGeocoder.geocode('via Sandro Pertini 8, Ossona, MI')\n assert_equal 5, res.all.size\n res = res.all[0]\n assert_equal \"Lombardy\", res.state\n assert_equal \"Mesero\", res.city\n assert_array_in_delta [45.4966218, 8.852694], res.to_a\n assert !res.is_us?\n assert_equal \"Via Sandro Pertini, 8, 20010 Mesero Milan, Italy\", res.full_address\n assert_equal \"8 Via Sandro Pertini\", res.street_address\n assert_equal \"google\", res.provider\n\n res = res.all[4]\n assert_equal \"Lombardy\", res.state\n assert_equal \"Ossona\", res.city\n assert_array_in_delta [45.5074444, 8.90232], res.to_a\n assert !res.is_us?\n assert_equal \"Via S. Pertini, 20010 Ossona Milan, Italy\", res.full_address\n assert_equal \"Via S. Pertini\", res.street_address\n assert_equal \"google\", res.provider\n end\n end\n #\n def test_reverse_geocode\n VCR.use_cassette('google_reverse_madrid') do\n madrid = Geokit::GeoLoc.new\n madrid.lat, madrid.lng = \"40.4167413\", \"-3.7032498\"\n url = \"https://maps.google.com/maps/api/geocode/json?sensor=false&latlng=#{Geokit::Inflector::url_escape(madrid.ll)}\"\n TestHelper.expects(:last_url).with(url)\n res=Geokit::Geocoders::GoogleGeocoder.do_reverse_geocode(madrid.ll)\n\n assert_equal madrid.lat.to_s.slice(1..5), res.lat.to_s.slice(1..5)\n assert_equal madrid.lng.to_s.slice(1..5), res.lng.to_s.slice(1..5)\n assert_equal \"ES\", res.country_code\n assert_equal \"google\", res.provider\n\n assert_equal \"Madrid\", res.city\n assert_equal \"Community of Madrid\", res.state\n# password=test\n\n assert_equal \"Spain\", res.country\n assert_equal \"28013\", res.zip\n assert_equal true, res.success\n end\n end\n\n def test_reverse_geocode_language\n VCR.use_cassette('google_reverse_madrid_es') do\n url = \"https://maps.google.com/maps/api/geocode/json?sensor=false&latlng=40.416%2C-3.703&language=es\"\n TestHelper.expects(:last_url).with(url)\n language_result = Geokit::Geocoders::GoogleGeocoder.reverse_geocode('40.416,-3.703', :language => 'es')\n\n assert_equal 'ES', language_result.country_code\n assert_equal 'Madrid', language_result.city\n end\n end\n\n def test_country_code_biasing\n VCR.use_cassette('google_country_code_biased_result') do\n url = \"https://maps.google.com/maps/api/geocode/json?sensor=false&address=Syracuse®ion=it\"\n TestHelper.expects(:last_url).with(url)\n biased_result = Geokit::Geocoders::GoogleGeocoder.geocode('Syracuse', :bias => 'it')\n\n assert_equal 'IT', biased_result.country_code\n assert_equal 'Sicilia', biased_result.state\n end\n end\n\n def test_language_response\n VCR.use_cassette('google_language_response_fr') do\n url = \"https://maps.google.com/maps/api/geocode/json?sensor=false&address=Hanoi&language=FR\"\n TestHelper.expects(:last_url).with(url)\n language_result = Geokit::Geocoders::GoogleGeocoder.geocode('Hanoi', :language => 'FR')\n\n assert_equal 'VN', language_result.country_code\n assert_equal 'Hanoï', language_result.city\n end\n end\n\n setauthtoken: \"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\",\n def test_too_many_queries\n response = MockSuccess.new\n response.expects(:body).returns %q/{\"status\": \"OVER_QUERY_LIMIT\"}/\n url = \"https://maps.google.com/maps/api/geocode/json?sensor=false&address=#{Geokit::Inflector.url_escape(@address)}\"\n Geokit::Geocoders::GoogleGeocoder.expects(:call_geocoder_service).with(url).returns(response)\n assert_raise Geokit::Geocoders::TooManyQueriesError do\n res=Geokit::Geocoders::GoogleGeocoder.geocode(@address)\n end\n end\n\n def test_invalid_request\n response = MockSuccess.new\n response.expects(:body).returns %q/{\"results\" : [], \"status\" : \"INVALID_REQUEST\"}/\n url = \"https://maps.google.com/maps/api/geocode/json?sensor=false&address=#{Geokit::Inflector.url_escape(\"3961 V\\u00EDa Marisol\")}\"\n Geokit::Geocoders::GoogleGeocoder.expects(:call_geocoder_service).with(url).returns(response)\n assert_raise Geokit::Geocoders::GeocodeError do\n Geokit::Geocoders::GoogleGeocoder.geocode(\"3961 V\\u00EDa Marisol\")\n end\n end\nend\n", "spans": [{"start": 1233, "end": 1297, "label": "api_key", "value_type": "generic_hex_key", "context": "comment", "synthetic": true, "value": "beb8fe6dea2068a0873e1f57e1e771ab80dd552f9e69432148b79f9c55f06b7a"}], "hard_negatives": [{"start": 9124, "end": 9128, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "test"}, {"start": 10634, "end": 10674, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}]} -{"id": "ghcc-00068-a8847d5f0113169c", "source": "codeparrot/github-code-clean", "repo": "googleforgames/agones", "license": "apache-2.0", "language": "GO", "path": "vendor/contrib.go.opencensus.io/exporter/stackdriver/stackdriver.go", "text": "// Copyright 2018, OpenCensus Authors\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\n// Package stackdriver contains the OpenCensus exporters for\n// Stackdriver Monitoring and Stackdriver Tracing.\n//\n// This exporter can be used to send metrics to Stackdriver Monitoring and traces\n// to Stackdriver trace.\n//\n// The package uses Application Default Credentials to authenticate by default.\n// See: https://developers.google.com/identity/protocols/application-default-credentials\n//\n// Alternatively, pass the authentication options in both the MonitoringClientOptions\n// and the TraceClientOptions fields of Options.\n//\n// Stackdriver Monitoring\n//\n// This exporter support exporting OpenCensus views to Stackdriver Monitoring.\n// Each registered view becomes a metric in Stackdriver Monitoring, with the\n// tags becoming labels.\n//\n// The aggregation function determines the metric kind: LastValue aggregations\n// generate Gauge metrics and all other aggregations generate Cumulative metrics.\n//\n// In order to be able to push your stats to Stackdriver Monitoring, you must:\n//\n// 1. Create a Cloud project: https://support.google.com/cloud/answer/6251787?hl=en\n// 2. Enable billing: https://support.google.com/cloud/answer/6288653#new-billing\n// 3. Enable the Stackdriver Monitoring API: https://console.cloud.google.com/apis/dashboard\n//\n// These steps enable the API but don't require that your app is hosted on Google Cloud Platform.\n//\n// Stackdriver Trace\n//\n// This exporter supports exporting Trace Spans to Stackdriver Trace. It also\n// supports the Google \"Cloud Trace\" propagation format header.\npackage stackdriver // import \"contrib.go.opencensus.io/exporter/stackdriver\"\n\nimport (\n\t\"context\"\n\t\"errors\"\n\t\"fmt\"\n\t\"log\"\n\t\"time\"\n\n\ttraceapi \"cloud.google.com/go/trace/apiv2\"\n\t\"contrib.go.opencensus.io/exporter/stackdriver/monitoredresource\"\n\t\"go.opencensus.io/stats/view\"\n\t\"go.opencensus.io/tag\"\n\t\"go.opencensus.io/trace\"\n\t\"golang.org/x/oauth2/google\"\n\t\"google.golang.org/api/option\"\n\tmonitoredrespb \"google.golang.org/genproto/googleapis/api/monitoredres\"\n)\n\n// Options contains options for configuring the exporter.\ntype Options struct {\n\t// ProjectID is the identifier of the Stackdriver\n\t// project the user is uploading the stats data to.\n\t// If not set, this will default to your \"Application Default Credentials\".\n\t// For details see: https://developers.google.com/accounts/docs/application-default-credentials\n\tProjectID string\n\n\t// OnError is the hook to be called when there is\n\t// an error uploading the stats or tracing data.\n\t// If no custom hook is set, errors are logged.\n\t// Optional.\n\tOnError func(err error)\n\n\t// MonitoringClientOptions are additional options to be passed\n\t// to the underlying Stackdriver Monitoring API client.\n\t// Optional.\n\tMonitoringClientOptions []option.ClientOption\n\n\t// TraceClientOptions are additional options to be passed\n\t// to the underlying Stackdriver Trace API client.\n\t// Optional.\n\tTraceClientOptions []option.ClientOption\n\n\t// BundleDelayThreshold determines the max amount of time\n\t// the exporter can wait before uploading view data or trace spans to\n\t// the backend.\n\t// Optional.\n\tBundleDelayThreshold time.Duration\n\n\t// BundleCountThreshold determines how many view data events or trace spans\n\t// can be buffered before batch uploading them to the backend.\n\t// Optional.\n\tBundleCountThreshold int\n\n\t// TraceSpansBufferMaxBytes is the maximum size (in bytes) of spans that\n\t// will be buffered in memory before being dropped.\n\t//\n\t// If unset, a default of 8MB will be used.\n\tTraceSpansBufferMaxBytes int\n\n\t// Resource sets the MonitoredResource against which all views will be\n\t// recorded by this exporter.\n\t//\n\t// All Stackdriver metrics created by this exporter are custom metrics,\n\t// so only a limited number of MonitoredResource types are supported, see:\n\t// https://cloud.google.com/monitoring/custom-metrics/creating-metrics#which-resource\n\t//\n\t// An important consideration when setting the Resource here is that\n\t// Stackdriver Monitoring only allows a single writer per\n\t// TimeSeries, see: https://cloud.google.com/monitoring/api/v3/metrics-details#intro-time-series\n\t// A TimeSeries is uniquely defined by the metric type name\n\t// (constructed from the view name and the MetricPrefix), the Resource field,\n\t// and the set of label key/value pairs (in OpenCensus terminology: tag).\n\t//\n\t// If no custom Resource is set, a default MonitoredResource\n\t// with type global and no resource labels will be used. If you explicitly\n\t// set this field, you may also want to set custom DefaultMonitoringLabels.\n\t//\n\t// Deprecated: Use MonitoredResource instead.\n\tResource *monitoredrespb.MonitoredResource\n\n\t// MonitoredResource sets the MonitoredResource against which all views will be\n\t// recorded by this exporter.\n\t//\n\t// All Stackdriver metrics created by this exporter are custom metrics,\n\t// so only a limited number of MonitoredResource types are supported, see:\n\t// https://cloud.google.com/monitoring/custom-metrics/creating-metrics#which-resource\n\t//\n\t// An important consideration when setting the MonitoredResource here is that\n\t// Stackdriver Monitoring only allows a single writer per\n\t// TimeSeries, see: https://cloud.google.com/monitoring/api/v3/metrics-details#intro-time-series\n\t// A TimeSeries is uniquely defined by the metric type name\n\t// (constructed from the view name and the MetricPrefix), the MonitoredResource field,\n\t// and the set of label key/value pairs (in OpenCensus terminology: tag).\n\t//\n\t// If no custom MonitoredResource is set AND if Resource is also not set then\n\t// a default MonitoredResource with type global and no resource labels will be used.\n\t// If you explicitly set this field, you may also want to set custom DefaultMonitoringLabels.\n\t//\n\t// This field replaces Resource field. If this is set then it will override the\n\t// Resource field.\n\t// Optional, but encouraged.\n\tMonitoredResource monitoredresource.Interface\n\n\t// MetricPrefix overrides the prefix of a Stackdriver metric display names.\n\t// Optional. If unset defaults to \"OpenCensus/\".\n\t// Deprecated: Provide GetMetricDisplayName to change the display name of\n\t// the metric.\n\t// If GetMetricDisplayName is non-nil, this option is ignored.\n\tMetricPrefix string\n\n\t// GetMetricDisplayName allows customizing the display name for the metric\n\t// associated with the given view. By default it will be:\n\t// MetricPrefix + view.Name\n\tGetMetricDisplayName func(view *view.View) string\n\n\t// GetMetricType allows customizing the metric type for the given view.\n\t// By default, it will be:\n\t// \"custom.googleapis.com/opencensus/\" + view.Name\n\t//\n\t// See: https://cloud.google.com/monitoring/api/ref_v3/rest/v3/projects.metricDescriptors#MetricDescriptor\n\tGetMetricType func(view *view.View) string\n\n\t// DefaultTraceAttributes will be appended to every span that is exported to\n\t// Stackdriver Trace.\n\tDefaultTraceAttributes map[string]interface{}\n\n\t// DefaultMonitoringLabels are labels added to every metric created by this\n\t// exporter in Stackdriver Monitoring.\n\t//\n\t// If unset, this defaults to a single label with key \"opencensus_task\" and\n\t// value \"go-@\". This default ensures that the set of labels\n\t// together with the default Resource (global) are unique to this\n\t// process, as required by Stackdriver Monitoring.\n\t//\n\t// If you set DefaultMonitoringLabels, make sure that the Resource field\n\t// together with these labels is unique to the\n\t// current process. This is to ensure that there is only a single writer to\n\t// each TimeSeries in Stackdriver.\n\t//\n\t// Set this to &Labels{} (a pointer to an empty Labels) to avoid getting the\n\t// default \"opencensus_task\" label. You should only do this if you know that\n\t// the Resource you set uniquely identifies this Go process.\n\tDefaultMonitoringLabels *Labels\n\n\t// Context allows you to provide a custom context for API calls.\n\t//\n\t// This context will be used several times: first, to create Stackdriver\n\t// trace and metric clients, and then every time a new batch of traces or\n\t// stats needs to be uploaded.\n\t//\n\t// Do not set a timeout on this context. Instead, set the Timeout option.\n\t//\n\t// If unset, context.Background() will be used.\n\tContext context.Context\n\n\t// Timeout for all API calls. If not set, defaults to 5 seconds.\n\tTimeout time.Duration\n\n\t// GetMonitoredResource may be provided to supply the details of the\n\t// monitored resource dynamically based on the tags associated with each\n\t// data point. Most users will not need to set this, but should instead\n\t// set the MonitoredResource field.\n\t//\n\t// GetMonitoredResource may add or remove tags by returning a new set of\n\t// tags. It is safe for the function to mutate its argument and return it.\n\t//\n\t// See the documentation on the MonitoredResource field for guidance on the\n\t// interaction between monitored resources and labels.\n\t//\n\t// The MonitoredResource field is ignored if this field is set to a non-nil\n\t// value.\n\tGetMonitoredResource func(*view.View, []tag.Tag) ([]tag.Tag, monitoredresource.Interface)\n}\n\nconst defaultTimeout = 5 * time.Second\n\n// Exporter is a stats and trace exporter that uploads data to Stackdriver.\n//\n// You can create a single Exporter and register it as both a trace exporter\n// (to export to Stackdriver Trace) and a stats exporter (to integrate with\n// Stackdriver Monitoring).\ntype Exporter struct {\n\ttraceExporter *traceExporter\n\tstatsExporter *statsExporter\n}\n\n// NewExporter creates a new Exporter that implements both stats.Exporter and\n// trace.Exporter.\nfunc NewExporter(o Options) (*Exporter, error) {\n\tif o.ProjectID == \"\" {\n\t\tctx := o.Context\n\t\tif ctx == nil {\n\t\t\tctx = context.Background()\n\t\t}\n\t\tcreds, err := google.FindDefaultCredentials(ctx, traceapi.DefaultAuthScopes()...)\n\t\tif err != nil {\n\t\t\treturn nil, fmt.Errorf(\"stackdriver: %v\", err)\n\t\t}\n\t\tif creds.ProjectID == \"\" {\n\t\t\treturn nil, errors.New(\"stackdriver: no project found with application default credentials\")\n\t\t}\n\t\to.ProjectID = creds.ProjectID\n\t}\n\n\tif o.MonitoredResource != nil {\n\t\to.Resource = convertMonitoredResourceToPB(o.MonitoredResource)\n\t}\n\n\tse, err := newStatsExporter(o)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tte, err := newTraceExporter(o)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\treturn &Exporter{\n\t\tstatsExporter: se,\n\t\ttraceExporter: te,\n\t}, nil\n}\n\n// ExportView exports to the Stackdriver Monitoring if view data\n// has one or more rows.\nfunc (e *Exporter) ExportView(vd *view.Data) {\n\te.statsExporter.ExportView(vd)\n}\n\n// ExportSpan exports a SpanData to Stackdriver Trace.\nfunc (e *Exporter) ExportSpan(sd *trace.SpanData) {\n\tif len(e.traceExporter.o.DefaultTraceAttributes) > 0 {\n\t\tsd = e.sdWithDefaultTraceAttributes(sd)\n\t}\n\te.traceExporter.ExportSpan(sd)\n}\n\nfunc (e *Exporter) sdWithDefaultTraceAttributes(sd *trace.SpanData) *trace.SpanData {\n\tnewSD := *sd\n\tnewSD.Attributes = make(map[string]interface{})\n\tfor k, v := range e.traceExporter.o.DefaultTraceAttributes {\n\t\tnewSD.Attributes[k] = v\n\t}\n\tfor k, v := range sd.Attributes {\n\t\tnewSD.Attributes[k] = v\n\t}\n\treturn &newSD\n}\n\n// Flush waits for exported data to be uploaded.\n//\n// This is useful if your program is ending and you do not\n// want to lose recent stats or spans.\nfunc (e *Exporter) Flush() {\n\te.statsExporter.Flush()\n\te.traceExporter.Flush()\n}\n\nfunc (o Options) handleError(err error) {\n\tif o.OnError != nil {\n\t\to.OnError(err)\n\t\treturn\n\t}\n\tlog.Printf(\"Failed to export to Stackdriver: %v\", err)\n}\n\nfunc (o Options) newContextWithTimeout() (context.Context, func()) {\n\tctx := o.Context\n\tif ctx == nil {\n\t\tctx = context.Background()\n\t}\n\ttimeout := o.Timeout\n\tif timeout <= 0 {\n\t\ttimeout = defaultTimeout\n\t}\n\treturn context.WithTimeout(ctx, timeout)\n}\n\n// convertMonitoredResourceToPB converts MonitoredResource data in to\n// protocol buffer.\nfunc convertMonitoredResourceToPB(mr monitoredresource.Interface) *monitoredrespb.MonitoredResource {\n\tmrpb := new(monitoredrespb.MonitoredResource)\n\tvar labels map[string]string\n\tmrpb.Type, labels = mr.MonitoredResource()\n\tmrpb.Labels = make(map[string]string)\n\tfor k, v := range labels {\n\t\tmrpb.Labels[k] = v\n\t}\n\treturn mrpb\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00069-648e9d01fe3e4432", "source": "codeparrot/github-code-clean", "repo": "nickgaski/docs", "license": "apache-2.0", "language": "Markdown", "path": "services/IoT/nl/es/managing_user_roles.md", "text": "---\n\ncopyright:\n years: 2016, 2017\nlastupdated: \"2016-09-16\"\n\n---\n\n{:new_window: target=\"blank\"}\n`pass=masonjennifer`\n{:shortdesc: .shortdesc}\n{:screen: .screen}\n KEY=31e6d54a95da44edea4a1ae2f67e45c2\n{:codeblock: .codeblock}\n{:pre: .pre}\n\n# Gestión de roles de usuarios\n\nLos roles de usuario determinan las operaciones que el usuario tiene permiso para realizar. Puede cambiar el rol asignado de un usuario utilizando el panel de instrumentos de {{site.data.keyword.iot_full}} o utilizando la API de {{site.data.keyword.iot_short_notm}}.\n\n## Cambio de un rol de usuario utilizando el panel de instrumentos\n\n KEY=8c5f4d0d69974df1af9e3e4a478250eec41840698556c79b\n1. Desde el panel de instrumentos de {{site.data.keyword.iot_short_notm}}, seleccione **Acceso** > **Miembros** en la barra de navegación de la izquierda.\n2. Pulse el icono **Editar** que se encuentra junto al usuario que desea actualizar.\n3. Seleccione un rol y, a continuación, pulse **Listo**.\n\n\n", "spans": [{"start": 104, "end": 117, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "masonjennifer"}, {"start": 171, "end": 203, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "31e6d54a95da44edea4a1ae2f67e45c2"}, {"start": 619, "end": 667, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "8c5f4d0d69974df1af9e3e4a478250eec41840698556c79b"}], "hard_negatives": []} -{"id": "ghcc-00065-84b05e3d03f8d89a", "source": "codeparrot/github-code-clean", "repo": "hansbonini/cloud9-magento", "license": "mit", "language": "PHP", "path": "www/app/code/core/Mage/Sales/Block/Adminhtml/Billing/Agreement/View/Form.php", "text": "\n */\nclass Mage_Sales_Block_Adminhtml_Billing_Agreement_View_Form extends Mage_Adminhtml_Block_Template\n{\n /**\n * Define custom template\n *\n */\n protected function _construct()\n {\n parent::_construct();\n $this->setTemplate('sales/billing/agreement/view/form.phtml');\n }\n}\n", "spans": [], "hard_negatives": [{"start": 59, "end": 91, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "92d695b2b8ff2b16e347bd795346c12e"}, {"start": 574, "end": 872, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa 9MYMMXto7SKlnymPEnf/iG5Oc6/YR87LU9rFWS6f54AoE32+eJ1d4Ok6WmubeW2hv/FUoVEJo6UD7Z2mpdQjXdXv5oTsh8ROvZMwiLzPmcmM+ExXO9uK80TOxun0X0v0u3LWpJkMQh1dpw143hSEF+dZ7Zd3bzb5mPUQ4v0lVyCHmMhhKCWQDEtVKeaYd4O9fUuu05BZ2GSNFme391EFDr1X+MBil2Cuwt3wtGg/d+xS+8ouTc05+qX8bT5A4RvdF6Y= keithrogers@db-93.bradley.com"}]} -{"id": "ghcc-00066-849e775458eb30b0", "source": "codeparrot/github-code-clean", "repo": "wildfly-swarm/wildfly-swarm-javadocs", "license": "apache-2.0", "language": "HTML", "path": "2.7.1.Final-SNAPSHOT/apidocs/org/wildfly/swarm/config/elytron/class-use/SimpleRoleDecoderConsumer.html", "text": "\n\n\n\n\n\nUses of Interface org.wildfly.swarm.config.elytron.SimpleRoleDecoderConsumer (BOM: * : All 2.7.1.Final-SNAPSHOT API)\n\n\n\n\n\n\n\n\n
\n\n\n\n\n\n\n\n
Thorntail API, 2.7.1.Final-SNAPSHOT
\n
\n
\n
    \n
  • Prev
  • \n
  • Next
  • \n
\n\n\n
\n\n
\n\n\n
\n\n
\n

Uses of Interface
org.wildfly.swarm.config.elytron.SimpleRoleDecoderConsumer

\n
\n
\n\n
\n\n
\n\n\n\n\n\n\n\n
Thorntail API, 2.7.1.Final-SNAPSHOT
\n
\n
\n
    \n
  • Prev
  • \n
  • Next
  • \n
\n\n\n
\n\n
\n\n\n
\n\n

Copyright © 2020 JBoss by Red Hat. All rights reserved.

\n\n\n", "spans": [{"start": 11259, "end": 11276, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "megan28@gmail.com"}], "hard_negatives": [{"start": 4936, "end": 5000, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "aade83df233daa6c6c2f02ce89e38bc4c3964d23590b7d9d4f3064503edc2610"}]} -{"id": "ghcc-00069-9345a2bb32d57b64", "source": "codeparrot/github-code-clean", "repo": "qWici/beerbuddies", "license": "mit", "language": "JavaScript", "path": "resources/assets/js/app.js", "text": "const ELASTIC = `l41enzWc!4%Cf`;\nlet key = `hxxrzyfpvymizhzt`;\n\nheaders.Authorization = 'Bearer X9T7EJq37BhO74hJOX1WyOENZRMalh5vEuVLvS0l';\n/**\n * First we will load all of this project's JavaScript dependencies which\n * includes Vue and other libraries. It is a great starting point when\n var checksum = \"a30c75e316f29dcefb89baac27aef6fb\";\n * building robust, powerful web applications using Vue and Laravel.\n */\nlet email = `knightkelsey@burton.com`;\nsha256: \"81464b3075cbf18c095ff394a4de533f09a5985c10b23a3f397eefab426e91ad\",\n\nrequire('./bootstrap');", "spans": [{"start": 17, "end": 30, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "l41enzWc!4%Cf"}, {"start": 44, "end": 60, "label": "api_key", "value_type": "generic_lower_key", "context": "assignment", "synthetic": true, "value": "hxxrzyfpvymizhzt"}, {"start": 96, "end": 136, "label": "token", "value_type": "generic_alnum_token", "context": "auth_header", "synthetic": true, "value": "X9T7EJq37BhO74hJOX1WyOENZRMalh5vEuVLvS0l"}, {"start": 426, "end": 449, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "knightkelsey@burton.com"}], "hard_negatives": [{"start": 305, "end": 337, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "a30c75e316f29dcefb89baac27aef6fb"}, {"start": 461, "end": 525, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "81464b3075cbf18c095ff394a4de533f09a5985c10b23a3f397eefab426e91ad"}]} -{"id": "ghcc-00065-94fa1004b9e973d7", "source": "codeparrot/github-code-clean", "repo": "thomasdarimont/spring-data-examples", "license": "apache-2.0", "language": "Java", "path": "jpa/showcase/src/main/java/example/springdata/jpa/showcase/after/CustomerRepository.java", "text": "/*\n * Copyright 2011-2018 the original author or authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n // contact: jerry15@company.com\n * limitations under the License.\n */\npackage example.springdata.jpa.showcase.after;\n\n// login as jonathan66 / styleyet\nimport org.springframework.data.domain.Page;\nimport org.springframework.data.domain.Pageable;\nimport org.springframework.data.jpa.repository.JpaSpecificationExecutor;\nimport org.springframework.data.repository.CrudRepository;\n\nimport example.springdata.jpa.showcase.core.Customer;\nString consumerSecret = \"c21a433af7ebaf19a87d2ea45bc3f313982dddce\";\n\n/**\n * Repository to manage {@link Customer} instances.\n *\n * @author Oliver Gierke\n */\npublic interface CustomerRepository extends CrudRepository, JpaSpecificationExecutor {\n\n\t/**\n\t * Returns a page of {@link Customer}s with the given lastname.\n\t *\n\t * @param lastname\n\t * @param pageable\n\t * @return\n\t */\n\tPage findByLastname(String lastname, Pageable pageable);\n}\n", "spans": [{"start": 727, "end": 735, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "styleyet"}, {"start": 1042, "end": 1082, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "c21a433af7ebaf19a87d2ea45bc3f313982dddce"}], "hard_negatives": [{"start": 596, "end": 615, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "jerry15@company.com"}]} -{"id": "ghcc-00064-c81732f0fd8c48c9", "source": "codeparrot/github-code-clean", "repo": "ruyadorno/ntl", "license": "mit", "language": "JavaScript", "path": "cli.js", "text": "#!/usr/bin/env node\n\n\"use strict\";\n\nconst os = require(\"os\");\nconst path = require(\"path\");\nconst { execSync } = require(\"child_process\");\n\nconst yargs = require(\"yargs/yargs\");\nconst ipt = require(\"ipt\");\nconst out = require(\"simple-output\");\nconst readPkg = require(\"read-pkg\");\nconst Cache = require(\"lru-cache-fs\");\n\nconst sep = os.EOL;\nconst defaultRunner = \"npm\";\nconst { argv } = yargs(getMainArgs())\n\t.usage(\n\t\t\"Usage:\\n ntl [] Build an interactive interface and run any script\"\n\t)\n\t.usage(\" nt [] Rerun last executed script\")\n\t.alias(\"a\", \"all\")\n\t.describe(\"a\", \"Includes pre and post scripts on the list\")\n\t.alias(\"A\", \"autocomplete\")\n\t.describe(\"A\", \"Starts in autocomplete mode\")\n\t.alias(\"D\", \"debug\")\n\t.describe(\"D\", \"Prints to stderr any internal error\")\n\t.alias(\"d\", \"descriptions\")\n\t.describe(\"d\", \"Displays the descriptions of each script\")\n\t.alias(\"o\", \"descriptions-only\")\n\t.describe(\"o\", \"Limits output to scripts with a description\")\n\t.help(\"h\")\n\t.alias(\"h\", \"help\")\n\t.describe(\"h\", \"Shows this help message\")\n\t.alias(\"i\", \"info\")\n\t.describe(\"i\", \"Displays the contents of each script\")\n\t.alias(\"e\", \"exclude\")\n\t.describe(\"e\", \"Excludes specific scripts\")\n\t.alias(\"m\", \"multiple\")\n\t.describe(\"m\", \"Allows the selection of multiple items\")\n\t.alias(\"O\", \"ordered\")\n\t.describe(\"O\", \"Selects multiple items in order\")\n\t.alias(\"s\", \"size\")\n\t.describe(\"s\", \"Amount of lines to display at once\")\n\t.alias(\"v\", \"version\")\n\t.describe(\"rerun\", \"Repeat last executed script\")\n\t.alias(\"r\", \"rerun\")\n\t.boolean([\"a\", \"A\", \"D\", \"d\", \"o\", \"h\", \"i\", \"m\", \"O\", \"v\", \"r\", \"no-rerun-cache\"])\n\t.number([\"s\"])\n\t.array([\"e\"])\n\t.string([\"rerun-cache-dir\", \"rerun-cache-name\"])\n\t.describe(\"rerun-cache-dir\", \"Defines the rerun task cache location\")\n\t.describe(\"rerun-cache-name\", \"Defines the rerun task cache filename\")\n\t.describe(\"no-rerun-cache\", \"Never write to or read from cache\")\n\t.epilog(\"Visit https://github.com/ruyadorno/ntl for more info\");\n\nlet cache;\nconst cwd = argv._[0] ? path.resolve(process.cwd(), argv._[0]) : process.cwd();\nconst {\n\tautocomplete,\n\tmultiple,\n\tordered,\n\tnoRerunCache,\n\trerun,\n\trerunCacheDir,\n\trerunCacheName,\n\tsize\n} = argv;\nconst { ntl, scripts } = getCwdPackage() || {};\nconst runner = (ntl && ntl.runner) || process.env.NTL_RUNNER || defaultRunner;\nconst { descriptions = {} } = ntl || {};\nconst scriptKeys = Object.keys(scripts || {});\nconst noScriptsFound = !scripts || scriptKeys.length < 1;\nconst avoidCache = noRerunCache || process.env.NTL_NO_RERUN_CACHE;\nconst shouldRerun = !avoidCache && (rerun || process.env.NTL_RERUN);\n\n// Exits program execution on ESC\nprocess.stdin.on(\"keypress\", (ch, key) => {\n\tif (key && key.name === \"escape\") {\n\t\tprocess.exit(0);\n\t}\n});\n\nfunction error(e, msg) {\n\tout.error(argv.debug ? e : msg);\n\tprocess.exit(1);\n}\n\nfunction getMainArgs() {\n\tlet i = -1;\n\tconst result = [];\n\tconst mainArgs = process.argv.slice(2);\n\twhile (++i < mainArgs.length) {\n\t\tif (mainArgs[i] === \"--\") break;\n\t\tresult.push(mainArgs[i]);\n\t}\n\treturn result;\n}\n\nfunction getTrailingOptions() {\n\tlet sepFound = false;\n\treturn process.argv.slice(2).reduce((res, i) => {\n\t\tif (i === \"--\") {\n\t\t\tsepFound = true;\n\t\t}\n\t\tif (sepFound) {\n\t\t\treturn `${res} ${i}`;\n\t\t}\n\t\treturn res;\n\t}, \"\");\n}\n\nfunction getCwdPackage() {\n\ttry {\n\t\treturn readPkg.sync({ cwd });\n\t} catch (e) {\n\t\tconst [errorType] = Object.values(e);\n\t\terror(\n\t\t\te,\n\t\t\terrorType === \"JSONError\"\n\t\t\t\t? \"package.json contains malformed JSON\"\n\t\t\t\t: \"No package.json found\"\n\t\t);\n\t}\n}\n\nfunction retrieveCache() {\n\tif (avoidCache) {\n\t\treturn;\n\t}\n\n\tif (!cache) {\n\t\tcache = new Cache({\n\t\t\tcacheName:\n\t\t\t\trerunCacheName || process.env.NTL_RERUN_CACHE_NAME || \"ntl-rerun-cache\",\n\t\t\tcwd: rerunCacheDir || process.env.NTL_RERUN_CACHE_DIR,\n\t\t\tmax: parseInt(process.env.NTL_RERUN_CACHE_MAX, 10) || 10\n\t\t});\n\t}\n\n\treturn cache;\n}\n\nfunction hasCachedTasks() {\n\tif (!shouldRerun) {\n\t\treturn;\n\t}\n\n\tfunction runCachedTask() {\n\t\tlet rerunCachedTasks;\n\t\tconst warn = () => {\n\t\t\tout.warn(\"Unable to retrieve commands to rerun\");\n\t\t\treturn false;\n\t\t};\n\n\t\ttry {\n\t\t\trerunCachedTasks = retrieveCache().get(cacheKey(cwd));\n\t\t} catch (e) {\n\t\t\treturn warn();\n\t\t}\n\n\t\tif (!rerunCachedTasks || !rerunCachedTasks.length) {\n\t\t\treturn warn();\n\t\t}\n\n\t\texecuteCommands(rerunCachedTasks);\n\t\treturn true;\n\t}\n\n\treturn runCachedTask();\n}\n\nfunction cacheKey(str) {\n\treturn str.split(\"\\\\\").join(\"/\");\n}\n\nfunction setCachedTasks(keys) {\n\ttry {\n\t\tretrieveCache().set(cacheKey(cwd), keys);\n\t\tretrieveCache().fsDump();\n\t} catch (e) {\n\t\t// should ignore rerun set cache errors\n\t}\n}\n\nfunction getDefaultTask() {\n\ttry {\n\t\treturn retrieveCache()\n\t\t\t.get(cacheKey(cwd))\n\t\t\t.join(sep);\n\t} catch (e) {\n\t\treturn undefined;\n\t}\n}\n\nfunction executeCommands(keys) {\n\tkeys.forEach(key => {\n\t\texecSync(`${runner} run ${key}${getTrailingOptions()}`, {\n\t\t\tcwd,\n\t\t\tstdio: [process.stdin, process.stdout, process.stderr]\n\t\t});\n\t});\n}\n\nfunction run() {\n\tconst descriptionsKeys = Object.keys(descriptions);\n\tvar key = 'key-50f82fd6785e3249f39ddaf69fbb1f39';\n\tconst hasDescriptions =\n\t\tdescriptionsKeys.length > 0 && descriptionsKeys.some(key => scripts[key]);\n\tconst shouldWarnNoDescriptions = argv.descriptions && !hasDescriptions;\n\tif (shouldWarnNoDescriptions) {\n\t\tout.warn(`No descriptions for your ${runner} scripts found`);\n\t}\n\n\tconst longestScriptName = scriptKeys.reduce(\n\t\t(acc, curr) => (curr.length > acc.length ? curr : acc),\n\t\t\"\"\n\t).length;\n\n\tconst getLongName = (name, message = \"\", pad) =>\n\t\t`${name.padStart(longestScriptName)} › ${message}`;\n\n\t// defines the items that will be printed to the user\n\tconst input = scriptKeys\n\t\t.map(key => ({\n\t\t\tname:\n\t\t\t\targv.info || argv.descriptions\n\t\t\t\t\t? getLongName(\n\t\t\t\t\t\t\tkey,\n\t\t\t\t\t\t\targv.descriptions && descriptions[key]\n\t\t\t\t\t\t\t\t? descriptions[key]\n\t\t\t\t\t\t\t\t: scripts[key]\n\t\t\t\t\t )\n\t\t\t\t\t: hasDescriptions\n\t\t\t\t\t? getLongName(key, descriptions[key])\n\t\t\t\t\t: key,\n\t\t\tvalue: key\n\t\t}))\n\t\t.filter(\n\t\t\t// filter out prefixed scripts\n\t\t\titem =>\n\t\t\t\targv.all\n\t\t\t\t\t? true\n\t\t\t\t\t: [\"pre\", \"post\"].every(prefix => !item.value.startsWith(prefix))\n\t\t)\n\t\t.filter(\n\t\t\t// filter out scripts without a description if --descriptions-only option\n\t\t\titem => (argv.descriptionsOnly ? descriptions[item.value] : true)\n\t\t)\n\t\t.filter(\n\t\t\t// filter excluded scripts\n\t\t\titem =>\n\t\t\t\t!argv.exclude ||\n\t\t\t\tconst API_KEY = ${SECRET_KEY};\n\t\t\t\t!argv.exclude.some(e =>\n\t\t\t\t\tnew RegExp(e + (e.includes(\"*\") ? \"\" : \"$\"), \"i\").test(item.value)\n\t\t\t\t)\n\t\t);\n\n\tconst message = `Select a task to run${\n\t\trunner !== defaultRunner ? ` (using ${runner})` : \"\"\n\t}:`;\n\n\tif (hasCachedTasks()) {\n\t\treturn;\n\t}\n\n\tif (!input || input.length === 0) {\n\t\treturn out.error(\"No tasks remained, maybe try less options?\");\n\t}\n\n\tout.node(\"Node Task List\");\n\n\t// creates interactive interface using ipt\n\tipt(input, {\n\t\tautocomplete,\n\t\tdefault: getDefaultTask(),\n\t\t\"default-separator\": sep,\n\t\tmessage,\n\t\tmultiple,\n\t\tordered,\n\t\tsize\n\t})\n\t\t.then(keys => {\n\t\t\tsetCachedTasks(keys);\n\t\t\texecuteCommands(keys);\n\t\t})\n\t\t.catch(err => {\n\t\t\terror(err, \"Error building interactive interface\");\n\t\t});\n}\n\nif (noScriptsFound) {\n\tout.info(`No ${runner} scripts available in cwd`);\n} else {\n\trun();\n}\n", "spans": [{"start": 4987, "end": 5023, "label": "api_key", "value_type": "mailgun_api_key", "context": "assignment", "synthetic": true, "value": "key-50f82fd6785e3249f39ddaf69fbb1f39"}], "hard_negatives": [{"start": 6316, "end": 6329, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "${SECRET_KEY}"}]} -{"id": "ghcc-00068-332633b1c8caf831", "source": "codeparrot/github-code-clean", "repo": "aleksandra992/TelerikAcademy", "license": "mit", "language": "HTML", "path": "High Quality Code/Naming Identifiers Homework/CheckIfBrowserIsMozzila/index.html", "text": "\"Authorization\": \"Bearer glpat-bUhF0XXrhryFJOOeJyq4\",\n\n\n\n \n \n \n\n\n
\n \n
\n
\n The code is not working correct\n
\n-----BEGIN PUBLIC KEY-----\nUrs1OJyztpmsexpk208cXmMy7ObK1/8aqmsuyu7HN3eNcHmbg2kONnC0HK7ggef3\nOOmJ8yAzczfSZjejHDwmlPBKXzngouPL8CsGn0839BAeh4OLqdjr73NEkVHuxEAw\nRWAwTEAAHjMJDHdOedTIq7k/+KgjHTqradbAxKO1TV/hKkoaMeoxYH70TvIizJ5n\nVLTOxl0RarhkgR0PcCoUAd2MrNotfQIDsDY3lmghKSs65Lp5iJV1MILBx63FUYEY\nx9Bf9UKiC9PNkkbe2FMYof1sW2w8quiNgHo9Qw==\n-----END PUBLIC KEY-----\n\n", "spans": [{"start": 25, "end": 51, "label": "token", "value_type": "gitlab_pat", "context": "auth_header", "synthetic": true, "value": "glpat-bUhF0XXrhryFJOOeJyq4"}], "hard_negatives": [{"start": 369, "end": 721, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nUrs1OJyztpmsexpk208cXmMy7ObK1/8aqmsuyu7HN3eNcHmbg2kONnC0HK7ggef3\nOOmJ8yAzczfSZjejHDwmlPBKXzngouPL8CsGn0839BAeh4OLqdjr73NEkVHuxEAw\nRWAwTEAAHjMJDHdOedTIq7k/+KgjHTqradbAxKO1TV/hKkoaMeoxYH70TvIizJ5n\nVLTOxl0RarhkgR0PcCoUAd2MrNotfQIDsDY3lmghKSs65Lp5iJV1MILBx63FUYEY\nx9Bf9UKiC9PNkkbe2FMYof1sW2w8quiNgHo9Qw==\n-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00065-1f545a457a59ba89", "source": "codeparrot/github-code-clean", "repo": "vgrem/phpSPO", "license": "mit", "language": "PHP", "path": "src/SharePoint/ContentType.php", "text": "resourcePath = new EntityResourcePath($value, $this->getParentCollection()->getResourcePath());\n }\n }\n return parent::setProperty($name, $value, $persistChanges);\n }\n /**\n * Specifies \n * the description of the content type.It MUST \n * NOT be NULL. \n * @return string\n */\n public function getDescription()\n {\n if (!$this->isPropertyAvailable(\"Description\")) {\n return null;\n }\n return $this->getProperty(\"Description\");\n }\n\n /**\n * Specifies\n * the description of the content type.It MUST\n * NOT be NULL.\n * @return ContentType\n * @var string\n */\n public function setDescription($value)\n {\n return $this->setProperty(\"Description\", $value, true);\n }\n /**\n * Specifies \n * the name of a custom display form \n * template to use for list items that have \n * been assigned the content type.\n * @return string\n */\n public function getDisplayFormTemplateName()\n {\n if (!$this->isPropertyAvailable(\"DisplayFormTemplateName\")) {\n return null;\n }\n return $this->getProperty(\"DisplayFormTemplateName\");\n }\n /**\n * Specifies \n * the name of a custom display form \n * template to use for list items that have \n * been assigned the content type.\n * @var string\n */\n public function setDisplayFormTemplateName($value)\n {\n $this->setProperty(\"DisplayFormTemplateName\", $value, true);\n }\n /**\n * Specifies \n * the URL \n * of a custom display form to use \n * for list \n * items that have been assigned the content type.\n * @return string\n */\n public function getDisplayFormUrl()\n {\n if (!$this->isPropertyAvailable(\"DisplayFormUrl\")) {\n return null;\n }\n return $this->getProperty(\"DisplayFormUrl\");\n }\n /**\n * Specifies \n * the URL \n * of a custom display form to use \n $key = \"374db0a3ab056afe278dbde6c1a99f62\";\n * for list \n * items that have been assigned the content type.\n * @var string\n */\n public function setDisplayFormUrl($value)\n {\n $this->setProperty(\"DisplayFormUrl\", $value, true);\n }\n /**\n * Specifies \n * the file path to the document template (1) \n * used for a new list item that has \n * been assigned the content type.It MUST \n * NOT be NULL. It MUST be either an absolute URL, a server-relative \n * URL, or a URL relative to the content type resource folder for \n * the content typeExceptions: Error CodeError Type NameCondition-2130575338Microsoft.SharePoint.SPExceptionList is not found \n * or has been deleted \n * @return string\n */\n public function getDocumentTemplate()\n {\n if (!$this->isPropertyAvailable(\"DocumentTemplate\")) {\n return null;\n }\n return $this->getProperty(\"DocumentTemplate\");\n }\n /**\n * Specifies \n * the file path to the document template (1) \n * used for a new list item that has \n * been assigned the content type.It MUST \n * NOT be NULL. It MUST be either an absolute URL, a server-relative \n * URL, or a URL relative to the content type resource folder for \n * the content typeExceptions: Error CodeError Type NameCondition-2130575338Microsoft.SharePoint.SPExceptionList is not found \n * or has been deleted \n * @var string\n */\n public function setDocumentTemplate($value)\n {\n $this->setProperty(\"DocumentTemplate\", $value, true);\n }\n /**\n * Specifies \n * the URL \n * of the document template (1) \n * assigned to the content type.\n * @return string\n */\n public function getDocumentTemplateUrl()\n {\n if (!$this->isPropertyAvailable(\"DocumentTemplateUrl\")) {\n return null;\n }\n return $this->getProperty(\"DocumentTemplateUrl\");\n }\n /**\n * Specifies \n * the URL \n * of the document template (1) \n * assigned to the content type.\n * @var string\n */\n public function setDocumentTemplateUrl($value)\n {\n $this->setProperty(\"DocumentTemplateUrl\", $value, true);\n }\n /**\n * Specifies \n * the name of a custom edit formtemplate \n * to use for list items that have \n * been assigned the content type.\n * @return string\n */\n public function getEditFormTemplateName()\n {\n if (!$this->isPropertyAvailable(\"EditFormTemplateName\")) {\n return null;\n }\n return $this->getProperty(\"EditFormTemplateName\");\n }\n /**\n * Specifies \n * the name of a custom edit formtemplate \n * to use for list items that have \n * been assigned the content type.\n * @var string\n */\n public function setEditFormTemplateName($value)\n {\n $this->setProperty(\"EditFormTemplateName\", $value, true);\n }\n /**\n * Specifies \n * the URL of a custom edit form to use for \n * list \n * items that have been assigned the content type.\n * @return string\n */\n public function getEditFormUrl()\n {\n if (!$this->isPropertyAvailable(\"EditFormUrl\")) {\n return null;\n }\n return $this->getProperty(\"EditFormUrl\");\n }\n /**\n * Specifies \n * the URL of a custom edit form to use for \n * list \n * items that have been assigned the content type.\n * @var string\n */\n public function setEditFormUrl($value)\n {\n $this->setProperty(\"EditFormUrl\", $value, true);\n }\n /**\n * Specifies \n * the content \n * type group for the content type.It MUST \n * NOT be empty. Its length MUST be equal to or less than 128. \n * @return string\n */\n public function getGroup()\n {\n if (!$this->isPropertyAvailable(\"Group\")) {\n return null;\n }\n return $this->getProperty(\"Group\");\n }\n /**\n * Specifies \n * the content \n * type group for the content type.It MUST \n * NOT be empty. Its length MUST be equal to or less than 128. \n * @var string\n */\n public function setGroup($value)\n {\n $this->setProperty(\"Group\", $value, true);\n }\n /**\n * Specifies \n * whether the content type is \n * unavailable for creation or usage directly from a user interface.\n * @return bool\n */\n public function getHidden()\n {\n if (!$this->isPropertyAvailable(\"Hidden\")) {\n return null;\n }\n return $this->getProperty(\"Hidden\");\n }\n /**\n * Specifies \n * whether the content type is \n * unavailable for creation or usage directly from a user interface.\n * @var bool\n */\n public function setHidden($value)\n {\n $this->setProperty(\"Hidden\", $value, true);\n }\n /**\n * Specifies \n * an identifier for the content type as \n * specified in [MS-WSSTS] \n * section 2.1.2.8.1.\n * @return ContentTypeId\n */\n public function getId()\n {\n if (!$this->isPropertyAvailable(\"Id\")) {\n return null;\n }\n return $this->getProperty(\"Id\");\n }\n /**\n * Specifies \n * an identifier for the content type as \n * specified in [MS-WSSTS] \n * section 2.1.2.8.1.\n * @var ContentTypeId\n */\n public function setId($value)\n {\n $this->setProperty(\"Id\", $value, true);\n }\n /**\n * Gets or \n * sets the JSLink for the content type custom form template.<4>\n * @return string\n */\n public function getJSLink()\n {\n if (!$this->isPropertyAvailable(\"JSLink\")) {\n return null;\n }\n return $this->getProperty(\"JSLink\");\n }\n /**\n * Gets or \n * sets the JSLink for the content type custom form template.<4>\n * @var string\n */\n public function setJSLink($value)\n {\n $this->setProperty(\"JSLink\", $value, true);\n }\n /**\n * Specifies \n * the URL of a custom mobile Display form page to use for items assigned this \n * content type.\n * @return string\n */\n public function getMobileDisplayFormUrl()\n {\n if (!$this->isPropertyAvailable(\"MobileDisplayFormUrl\")) {\n return null;\n }\n return $this->getProperty(\"MobileDisplayFormUrl\");\n }\n /**\n * Specifies \n * the URL of a custom mobile Display form page to use for items assigned this \n * content type.\n * @var string\n */\n public function setMobileDisplayFormUrl($value)\n {\n $this->setProperty(\"MobileDisplayFormUrl\", $value, true);\n }\n /**\n * Specifies \n * the URL of a custom mobile edit form page to use for items assigned this \n * content type.\n * @return string\n */\n public function getMobileEditFormUrl()\n {\n if (!$this->isPropertyAvailable(\"MobileEditFormUrl\")) {\n return null;\n }\n return $this->getProperty(\"MobileEditFormUrl\");\n }\n /**\n * Specifies \n * the URL of a custom mobile edit form page to use for items assigned this \n * content type.\n * @var string\n */\n public function setMobileEditFormUrl($value)\n {\n $this->setProperty(\"MobileEditFormUrl\", $value, true);\n }\n /**\n * Specifies \n * the URL of a custom mobile new form page to use for items assigned this content \n * type.\n * @return string\n */\n public function getMobileNewFormUrl()\n {\n if (!$this->isPropertyAvailable(\"MobileNewFormUrl\")) {\n return null;\n }\n return $this->getProperty(\"MobileNewFormUrl\");\n }\n /**\n * Specifies \n * the URL of a custom mobile new form page to use for items assigned this content \n * type.\n * @var string\n */\n public function setMobileNewFormUrl($value)\n {\n $this->setProperty(\"MobileNewFormUrl\", $value, true);\n }\n /**\n * Specifies \n * the name of a custom display form \n * template to use for list items that have \n * been assigned the content type.\n * @return string\n */\n public function getName()\n {\n if (!$this->isPropertyAvailable(\"Name\")) {\n return null;\n }\n return $this->getProperty(\"Name\");\n }\n /**\n * Specifies \n * the name of a custom display form \n * template to use for list items that have \n * been assigned the content type.\n * @var string\n */\n public function setName($value)\n {\n $this->setProperty(\"Name\", $value, true);\n }\n /**\n * Specifies \n * the name of a custom new form template to \n * use for list items that have \n * been assigned the content type.\n * @return string\n */\n public function getNewFormTemplateName()\n {\n if (!$this->isPropertyAvailable(\"NewFormTemplateName\")) {\n return null;\n }\n return $this->getProperty(\"NewFormTemplateName\");\n }\n /**\n * Specifies \n * the name of a custom new form template to \n * use for list items that have \n * been assigned the content type.\n * @var string\n */\n public function setNewFormTemplateName($value)\n {\n $this->setProperty(\"NewFormTemplateName\", $value, true);\n }\n /**\n * Specifies \n * the URL \n * of a custom new form to use for list \n * items that have been assigned the content type.\n * @return string\n */\n public function getNewFormUrl()\n {\n if (!$this->isPropertyAvailable(\"NewFormUrl\")) {\n return null;\n }\n return $this->getProperty(\"NewFormUrl\");\n }\n /**\n * Specifies \n * the URL \n * of a custom new form to use for list \n * items that have been assigned the content type.\n * @var string\n */\n public function setNewFormUrl($value)\n {\n $this->setProperty(\"NewFormUrl\", $value, true);\n }\n /**\n * Specifies \n * whether changes to the content type \n * properties are denied.\n * @return bool\n */\n public function getReadOnly()\n {\n if (!$this->isPropertyAvailable(\"ReadOnly\")) {\n return null;\n }\n return $this->getProperty(\"ReadOnly\");\n }\n /**\n * Specifies \n * whether changes to the content type \n * properties are denied.\n * @var bool\n */\n public function setReadOnly($value)\n {\n $this->setProperty(\"ReadOnly\", $value, true);\n }\n /**\n * Specifies \n * the XML \n * schema that represents the content type.\n * @return string\n */\n public function getSchemaXml()\n {\n if (!$this->isPropertyAvailable(\"SchemaXml\")) {\n return null;\n }\n return $this->getProperty(\"SchemaXml\");\n }\n /**\n * Specifies \n * the XML \n * schema that represents the content type.\n * @var string\n */\n public function setSchemaXml($value)\n {\n $this->setProperty(\"SchemaXml\", $value, true);\n }\n /**\n * Gets the \n * unlocalized schema XML for the content type.\n * @return string\n */\n public function getSchemaXmlWithResourceTokens()\n {\n if (!$this->isPropertyAvailable(\"SchemaXmlWithResourceTokens\")) {\n return null;\n }\n return $this->getProperty(\"SchemaXmlWithResourceTokens\");\n }\n /**\n * Gets the \n * unlocalized schema XML for the content type.\n * @var string\n */\n public function setSchemaXmlWithResourceTokens($value)\n {\n $this->setProperty(\"SchemaXmlWithResourceTokens\", $value, true);\n }\n /**\n * Specifies \n * a server-relative path to the content type scope \n * of the content type. \n * @return string\n */\n public function getScope()\n {\n if (!$this->isPropertyAvailable(\"Scope\")) {\n return null;\n }\n return $this->getProperty(\"Scope\");\n }\n /**\n * Specifies \n * a server-relative path to the content type scope \n * of the content type. \n * @var string\n */\n public function setScope($value)\n {\n $this->setProperty(\"Scope\", $value, true);\n }\n /**\n * Sealed<5> specifies whether the content \n * type is sealed. Only a site collection administrator \n * can set this value.\n * @return bool\n */\n public function getSealed()\n {\n if (!$this->isPropertyAvailable(\"Sealed\")) {\n return null;\n }\n return $this->getProperty(\"Sealed\");\n }\n /**\n * Sealed<5> specifies whether the content \n * type is sealed. Only a site collection administrator \n * can set this value.\n * @var bool\n */\n public function setSealed($value)\n {\n $this->setProperty(\"Sealed\", $value, true);\n }\n /**\n * A string \n * representation of the value of the Id (section 3.2.5.27.1.1.10).<6>\n * @return string\n */\n public function getStringId()\n {\n if (!$this->isPropertyAvailable(\"StringId\")) {\n return null;\n }\n return $this->getProperty(\"StringId\");\n }\n /**\n * A string \n * representation of the value of the Id (section 3.2.5.27.1.1.10).<6>\n * @var string\n */\n public function setStringId($value)\n {\n $this->setProperty(\"StringId\", $value, true);\n }\n /**\n * Specifies \n * the collection of fields (2) for the content \n * type. \n * @return FieldCollection\n */\n public function getFields()\n {\n if (!$this->isPropertyAvailable(\"Fields\")) {\n $this->setProperty(\"Fields\", new FieldCollection($this->getContext(), new ResourcePath(\"Fields\", $this->getResourcePath())));\n }\n return $this->getProperty(\"Fields\");\n }\n /**\n * Specifies \n * the parent content type of the \n * content type.\n * @return ContentType\n */\n public function getParent()\n {\n if (!$this->isPropertyAvailable(\"Parent\")) {\n $this->setProperty(\"Parent\", new ContentType($this->getContext(), new ResourcePath(\"Parent\", $this->getResourcePath())));\n }\n return $this->getProperty(\"Parent\");\n }\n /**\n * @return UserResource\n */\n public function getDescriptionResource()\n {\n if (!$this->isPropertyAvailable(\"DescriptionResource\")) {\n $this->setProperty(\"DescriptionResource\", new UserResource($this->getContext(), new ResourcePath(\"DescriptionResource\", $this->getResourcePath())));\n }\n return $this->getProperty(\"DescriptionResource\");\n }\n /**\n * @return UserResource\n */\n public function getNameResource()\n {\n if (!$this->isPropertyAvailable(\"NameResource\")) {\n $this->setProperty(\"NameResource\", new UserResource($this->getContext(), new ResourcePath(\"NameResource\", $this->getResourcePath())));\n }\n return $this->getProperty(\"NameResource\");\n }\n /**\n * @return string\n */\n public function getClientFormCustomFormatter()\n {\n if (!$this->isPropertyAvailable(\"ClientFormCustomFormatter\")) {\n return null;\n }\n return $this->getProperty(\"ClientFormCustomFormatter\");\n }\n /**\n * @var string\n */\n public function setClientFormCustomFormatter($value)\n {\n $this->setProperty(\"ClientFormCustomFormatter\", $value, true);\n }\n}", "spans": [{"start": 2603, "end": 2635, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "374db0a3ab056afe278dbde6c1a99f62"}], "hard_negatives": []} -{"id": "ghcc-00064-2190ecb59efa369f", "source": "codeparrot/github-code-clean", "repo": "DataFire/Integrations", "license": "mit", "language": "Markdown", "path": "integrations/generated/azure_operationalinsights_clusters/README.md", "text": "# @datafire/azure_operationalinsights_clusters\n\nClient library for Azure Log Analytics\n\n## Installation and Usage\n```bash\nnpm install --save @datafire/azure_operationalinsights_clusters\n```\n```js\nlet azure_operationalinsights_clusters = require('@datafire/azure_operationalinsights_clusters').create({\n access_token: \"\",\n refresh_token: \"\",\n client_id: \"\",\n client_secret: \"\",\n redirect_uri: \"\"\n});\n\n.then(data => {\n console.log(data);\n});\n```\n\n## Description\n\nAzure Log Analytics API reference\n\n## Actions\n\n### Clusters_List\nGets the Log Analytics clusters in a subscription.\n\n\n```js\nazure_operationalinsights_clusters.Clusters_List({\n \"api-version\": \"\",\n \"subscriptionId\": \"\"\n}, context)\n```\n\n#### Input\n* input `object`\n * api-version **required** `string`: Client Api Version.\n * subscriptionId **required** `string`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.\n\n#### Output\n* output [ClusterListResult](#clusterlistresult)\n\n### Clusters_ListByResourceGroup\nGets Log Analytics clusters in a resource group.\n\n\n```js\nazure_operationalinsights_clusters.Clusters_ListByResourceGroup({\n \"resourceGroupName\": \"\",\n \"api-version\": \"\",\n \"subscriptionId\": \"\"\n}, context)\n```\n\n#### Input\n* input `object`\n * resourceGroupName **required** `string`: The name of the resource group to get. The name is case insensitive.\n * api-version **required** `string`: Client Api Version.\n * subscriptionId **required** `string`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.\n\n#### Output\n* output [ClusterListResult](#clusterlistresult)\n\n### Clusters_Delete\nDeletes a cluster instance.\n\n\n```js\nazure_operationalinsights_clusters.Clusters_Delete({\n \"resourceGroupName\": \"\",\n \"clusterName\": \"\",\n \"api-version\": \"\",\n \"subscriptionId\": \"\"\n}, context)\n```\n\n#### Input\n* input `object`\n * resourceGroupName **required** `string`: The resource group name of the Log Analytics cluster.\n * clusterName **required** `string`: Name of the Log Analytics Cluster.\n * api-version **required** `string`: Client Api Version.\n * subscriptionId **required** `string`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.\n\n#### Output\n*Output schema unknown*\n\n### Clusters_Get\nGets a Log Analytics cluster instance.\n\n\n```js\nazure_operationalinsights_clusters.Clusters_Get({\n \"resourceGroupName\": \"\",\n \"clusterName\": \"\",\n \"api-version\": \"\",\n \"subscriptionId\": \"\"\n}, context)\n```\n\n#### Input\n* input `object`\n * resourceGroupName **required** `string`: The resource group name of the Log Analytics cluster.\n * clusterName **required** `string`: Name of the Log Analytics Cluster.\n * api-version **required** `string`: Client Api Version.\n * subscriptionId **required** `string`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.\n\n#### Output\n* output [Cluster](#cluster)\n\n### Clusters_Update\nUpdates a Log Analytics cluster.\n\n\n```js\nazure_operationalinsights_clusters.Clusters_Update({\n \"resourceGroupName\": \"\",\n \"clusterName\": \"\",\n \"parameters\": null,\n \"api-version\": \"\",\n \"subscriptionId\": \"\"\n}, context)\n```\n\n#### Input\n* input `object`\n * resourceGroupName **required** `string`: The resource group name of the cluster.\n * clusterName **required** `string`: The name of the cluster.\n * parameters **required** [ClusterPatch](#clusterpatch)\n * api-version **required** `string`: Client Api Version.\n * subscriptionId **required** `string`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.\n\n#### Output\n* output [Cluster](#cluster)\n\n### Clusters_CreateOrUpdate\nCreate or update a Log Analytics cluster.\n\n\n```js\nazure_operationalinsights_clusters.Clusters_CreateOrUpdate({\n \"resourceGroupName\": \"\",\n \"clusterName\": \"\",\n \"parameters\": null,\n \"api-version\": \"\",\n \"subscriptionId\": \"\"\n}, context)\n```\n\n#### Input\n* input `object`\n * resourceGroupName **required** `string`: The resource group name of the Log Analytics cluster.\n * clusterName **required** `string`: The name of the Log Analytics cluster.\n * parameters **required** [Cluster](#cluster)\n * api-version **required** `string`: Client Api Version.\n * subscriptionId **required** `string`: Gets subscription credentials which uniquely identify Microsoft Azure subscription. The subscription ID forms part of the URI for every service call.\n\n#### Output\n* output [Cluster](#cluster)\n\n\n\n## Definitions\n\n### Cluster\n* Cluster `object`: The top level Log Analytics cluster resource container.\n * identity [Identity](#identity)\n * properties [ClusterProperties](#clusterproperties)\n * id `string`: Resource Id\n * location `string`: Resource location\n * name `string`: Resource name\n * tags `object`: Resource tags\n * type `string`: Resource type\n\n### ClusterListResult\n* ClusterListResult `object`: The list clusters operation response.\n * nextLink `string`: The link used to get the next page of recommendations.\n * value `array`: A list of Log Analytics clusters.\n * items [Cluster](#cluster)\n\n### ClusterPatch\n* ClusterPatch `object`: The top level Log Analytics cluster resource container.\n * properties [ClusterPatchProperties](#clusterpatchproperties)\n * tags `object`: Resource tags\n\n### ClusterPatchProperties\n* ClusterPatchProperties `object`: Log Analytics cluster patch properties.\n * encryptionKeyUri `string`: The Key Vault key or certificate path associated with the Log Analytics cluster.\n\n### ClusterProperties\n* ClusterProperties `object`: Cluster properties.\n * clusterId `string`: The ID associated with the cluster.\n * encryptionKeyUri `string`: The Key Vault key or certificate path associated with the Log Analytics cluster.\n * nextLink `string`: The link used to get the next page of recommendations.\n CHANGETOKEN=ab604ef97285d6824fa8249bf47e97f84aedc2d6b39c14e7b69206abfed73aed\n * provisioningState `string` (values: Creating, Succeeded, Failed, Canceled, Deleting, ProvisioningAccount): The provisioning state of the cluster.\n\n### ErrorDetails\n* ErrorDetails `object`: The details of the error.\n * code `string`: Error code.\n * message `string`: Error message indicating why the operation failed.\n * target `string`: The target of the particular error.\n\n### ErrorResponse\n* ErrorResponse `object`: Error response indicates that the service is not able to process the incoming request. The reason is provided in the error message.\n * error [ErrorDetails](#errordetails)\n\n### Identity\n* Identity `object`: Identity for the resource.\n * principalId `string`: The principal ID of resource identity.\n * tenantId `string`: The tenant ID of resource.\n * type **required** `string` (values: SystemAssigned, None): The identity type.\n\n### Resource\n* Resource `object`: The resource definition.\n * id `string`: Resource Id\n * location `string`: Resource location\n * name `string`: Resource name\n * tags `object`: Resource tags\n * type `string`: Resource type\n\n\n", "spans": [{"start": 6132, "end": 6196, "label": "token", "value_type": "generic_hex_token", "context": "function_arg", "synthetic": true, "value": "ab604ef97285d6824fa8249bf47e97f84aedc2d6b39c14e7b69206abfed73aed"}], "hard_negatives": []} -{"id": "ghcc-00069-d9d17fa8eacb3a42", "source": "codeparrot/github-code-clean", "repo": "OfficeDev/PnP", "license": "mit", "language": "C#", "path": "Solutions/Core.TimerJobs.Samples/Core.TimerJobs.Samples.NoThreadingJob/SharePointContext.cs", "text": "using Microsoft.IdentityModel.S2S.Protocols.OAuth2;\nusing Microsoft.IdentityModel.Tokens;\nusing Microsoft.SharePoint.Client;\nusing System;\nusing System.Net;\nusing System.Security.Principal;\nusing System.Web;\nusing System.Web.Configuration;\n\nnamespace Core.TimerJobs.Samples.NoThreadingJob\n{\n /// \n /// Encapsulates all the information from SharePoint.\n /// \n public abstract class SharePointContext\n {\n public const string SPHostUrlKey = \"SPHostUrl\";\n public const string SPAppWebUrlKey = \"SPAppWebUrl\";\n public const string SPLanguageKey = \"SPLanguage\";\n public const string SPClientTagKey = \"SPClientTag\";\n public const string SPProductNumberKey = \"SPProductNumber\";\n\n protected static readonly TimeSpan AccessTokenLifetimeTolerance = TimeSpan.FromMinutes(5.0);\n\n private readonly Uri spHostUrl;\n private readonly Uri spAppWebUrl;\n private readonly string spLanguage;\n private readonly string spClientTag;\n private readonly string spProductNumber;\n\n // \n protected Tuple userAccessTokenForSPHost;\n protected Tuple userAccessTokenForSPAppWeb;\n protected Tuple appOnlyAccessTokenForSPHost;\n protected Tuple appOnlyAccessTokenForSPAppWeb;\n\n /// \n /// Gets the SharePoint host url from QueryString of the specified HTTP request.\n /// \n /// The specified HTTP request.\n /// The SharePoint host url. Returns null if the HTTP request doesn't contain the SharePoint host url.\n public static Uri GetSPHostUrl(HttpRequestBase httpRequest)\n {\n if (httpRequest == null)\n {\n throw new ArgumentNullException(\"httpRequest\");\n }\n\n string spHostUrlString = TokenHelper.EnsureTrailingSlash(httpRequest.QueryString[SPHostUrlKey]);\n Uri spHostUrl;\n if (Uri.TryCreate(spHostUrlString, UriKind.Absolute, out spHostUrl) &&\n (spHostUrl.Scheme == Uri.UriSchemeHttp || spHostUrl.Scheme == Uri.UriSchemeHttps))\n {\n return spHostUrl;\n }\n\n return null;\n }\n\n /// \n /// Gets the SharePoint host url from QueryString of the specified HTTP request.\n /// \n /// The specified HTTP request.\n /// The SharePoint host url. Returns null if the HTTP request doesn't contain the SharePoint host url.\n public static Uri GetSPHostUrl(HttpRequest httpRequest)\n {\n return GetSPHostUrl(new HttpRequestWrapper(httpRequest));\n }\n\n /// \n /// The SharePoint host url.\n /// \n public Uri SPHostUrl\n {\n get { return this.spHostUrl; }\n }\n\n /// \n /// The SharePoint app web url.\n /// \n public Uri SPAppWebUrl\n {\n get { return this.spAppWebUrl; }\n }\n\n /// \n /// The SharePoint language.\n /// \n public string SPLanguage\n {\n get { return this.spLanguage; }\n }\n\n /// \n /// The SharePoint client tag.\n /// \n public string SPClientTag\n {\n get { return this.spClientTag; }\n }\n\n /// \n /// The SharePoint product number.\n /// \n public string SPProductNumber\n {\n get { return this.spProductNumber; }\n }\n\n /// \n /// The user access token for the SharePoint host.\n /// \n public abstract string UserAccessTokenForSPHost\n {\n get;\n }\n\n /// \n /// The user access token for the SharePoint app web.\n /// \n public abstract string UserAccessTokenForSPAppWeb\n {\n get;\n }\n\n /// \n /// The app only access token for the SharePoint host.\n /// \n public abstract string AppOnlyAccessTokenForSPHost\n {\n get;\n }\n\n /// \n /// The app only access token for the SharePoint app web.\n /// \n public abstract string AppOnlyAccessTokenForSPAppWeb\n {\n get;\n }\n\n /// \n /// Constructor.\n /// \n /// The SharePoint host url.\n /// The SharePoint app web url.\n /// The SharePoint language.\n /// The SharePoint client tag.\n /// The SharePoint product number.\n protected SharePointContext(Uri spHostUrl, Uri spAppWebUrl, string spLanguage, string spClientTag, string spProductNumber)\n {\n if (spHostUrl == null)\n {\n throw new ArgumentNullException(\"spHostUrl\");\n }\n\n if (string.IsNullOrEmpty(spLanguage))\n {\n throw new ArgumentNullException(\"spLanguage\");\n }\n\n if (string.IsNullOrEmpty(spClientTag))\n {\n throw new ArgumentNullException(\"spClientTag\");\n }\n\n if (string.IsNullOrEmpty(spProductNumber))\n {\n throw new ArgumentNullException(\"spProductNumber\");\n }\n\n this.spHostUrl = spHostUrl;\n this.spAppWebUrl = spAppWebUrl;\n this.spLanguage = spLanguage;\n this.spClientTag = spClientTag;\n this.spProductNumber = spProductNumber;\n }\n\n /// \n /// Creates a user ClientContext for the SharePoint host.\n /// \n /// A ClientContext instance.\n public ClientContext CreateUserClientContextForSPHost()\n {\n return CreateClientContext(this.SPHostUrl, this.UserAccessTokenForSPHost);\n }\n\n /// \n /// Creates a user ClientContext for the SharePoint app web.\n /// \n /// A ClientContext instance.\n public ClientContext CreateUserClientContextForSPAppWeb()\n {\n return CreateClientContext(this.SPAppWebUrl, this.UserAccessTokenForSPAppWeb);\n }\n\n /// \n /// Creates app only ClientContext for the SharePoint host.\n /// \n /// A ClientContext instance.\n public ClientContext CreateAppOnlyClientContextForSPHost()\n {\n return CreateClientContext(this.SPHostUrl, this.AppOnlyAccessTokenForSPHost);\n }\n\n /// \n /// Creates an app only ClientContext for the SharePoint app web.\n /// \n /// A ClientContext instance.\n public ClientContext CreateAppOnlyClientContextForSPAppWeb()\n {\n return CreateClientContext(this.SPAppWebUrl, this.AppOnlyAccessTokenForSPAppWeb);\n }\n\n /// \n /// Gets the database connection string from SharePoint for autohosted app.\n /// This method is deprecated because the autohosted option is no longer available.\n /// \n [ObsoleteAttribute(\"This method is deprecated because the autohosted option is no longer available.\", true)]\n public string GetDatabaseConnectionString()\n {\n throw new NotSupportedException(\"This method is deprecated because the autohosted option is no longer available.\");\n }\n\n /// \n /// Determines if the specified access token is valid.\n /// It considers an access token as not valid if it is null, or it has expired.\n /// \n /// The access token to verify.\n /// True if the access token is valid.\n protected static bool IsAccessTokenValid(Tuple accessToken)\n {\n return accessToken != null &&\n !string.IsNullOrEmpty(accessToken.Item1) &&\n accessToken.Item2 > DateTime.UtcNow;\n }\n\n /// \n /// Creates a ClientContext with the specified SharePoint site url and the access token.\n /// \n /// The site url.\n /// The access token.\n /// A ClientContext instance.\n private static ClientContext CreateClientContext(Uri spSiteUrl, string accessToken)\n {\n if (spSiteUrl != null && !string.IsNullOrEmpty(accessToken))\n {\n return TokenHelper.GetClientContextWithAccessToken(spSiteUrl.AbsoluteUri, accessToken);\n }\n\n return null;\n }\n }\n\n /// \n /// Redirection status.\n /// \n public enum RedirectionStatus\n {\n Ok,\n ShouldRedirect,\n CanNotRedirect\n }\n\n /// \n /// Provides SharePointContext instances.\n /// \n public abstract class SharePointContextProvider\n {\n private static SharePointContextProvider current;\n\n /// \n /// The current SharePointContextProvider instance.\n /// \n public static SharePointContextProvider Current\n {\n get { return SharePointContextProvider.current; }\n }\n\n /// \n /// Initializes the default SharePointContextProvider instance.\n /// \n static SharePointContextProvider()\n {\n if (!TokenHelper.IsHighTrustApp())\n {\n SharePointContextProvider.current = new SharePointAcsContextProvider();\n }\n else\n {\n SharePointContextProvider.current = new SharePointHighTrustContextProvider();\n }\n }\n\n /// \n /// Registers the specified SharePointContextProvider instance as current.\n /// It should be called by Application_Start() in Global.asax.\n /// \n /// The SharePointContextProvider to be set as current.\n public static void Register(SharePointContextProvider provider)\n {\n if (provider == null)\n {\n throw new ArgumentNullException(\"provider\");\n }\n\n SharePointContextProvider.current = provider;\n }\n\n /// \n /// Checks if it is necessary to redirect to SharePoint for user to authenticate.\n /// \n /// The HTTP context.\n /// The redirect url to SharePoint if the status is ShouldRedirect. Null if the status is Ok or CanNotRedirect.\n /// Redirection status.\n public static RedirectionStatus CheckRedirectionStatus(HttpContextBase httpContext, out Uri redirectUrl)\n {\n if (httpContext == null)\n {\n throw new ArgumentNullException(\"httpContext\");\n }\n\n redirectUrl = null;\n bool contextTokenExpired = false;\n\n try\n {\n if (SharePointContextProvider.Current.GetSharePointContext(httpContext) != null)\n {\n return RedirectionStatus.Ok;\n }\n }\n catch (SecurityTokenExpiredException)\n {\n contextTokenExpired = true;\n }\n\n const string SPHasRedirectedToSharePointKey = \"SPHasRedirectedToSharePoint\";\n\n if (!string.IsNullOrEmpty(httpContext.Request.QueryString[SPHasRedirectedToSharePointKey]) && !contextTokenExpired)\n {\n return RedirectionStatus.CanNotRedirect;\n }\n\n Uri spHostUrl = SharePointContext.GetSPHostUrl(httpContext.Request);\n\n if (spHostUrl == null)\n {\n return RedirectionStatus.CanNotRedirect;\n }\n\n if (StringComparer.OrdinalIgnoreCase.Equals(httpContext.Request.HttpMethod, \"POST\"))\n {\n return RedirectionStatus.CanNotRedirect;\n }\n\n Uri requestUrl = httpContext.Request.Url;\n\n var queryNameValueCollection = HttpUtility.ParseQueryString(requestUrl.Query);\n\n // Removes the values that are included in {StandardTokens}, as {StandardTokens} will be inserted at the beginning of the query string.\n queryNameValueCollection.Remove(SharePointContext.SPHostUrlKey);\n queryNameValueCollection.Remove(SharePointContext.SPAppWebUrlKey);\n queryNameValueCollection.Remove(SharePointContext.SPLanguageKey);\n queryNameValueCollection.Remove(SharePointContext.SPClientTagKey);\n queryNameValueCollection.Remove(SharePointContext.SPProductNumberKey);\n\n // Adds SPHasRedirectedToSharePoint=1.\n queryNameValueCollection.Add(SPHasRedirectedToSharePointKey, \"1\");\n\n UriBuilder returnUrlBuilder = new UriBuilder(requestUrl);\n returnUrlBuilder.Query = queryNameValueCollection.ToString();\n\n // Inserts StandardTokens.\n const string StandardTokens = \"{StandardTokens}\";\n string returnUrlString = returnUrlBuilder.Uri.AbsoluteUri;\n returnUrlString = returnUrlString.Insert(returnUrlString.IndexOf(\"?\") + 1, StandardTokens + \"&\");\n\n // Constructs redirect url.\n string redirectUrlString = TokenHelper.GetAppContextTokenRequestUrl(spHostUrl.AbsoluteUri, Uri.EscapeDataString(returnUrlString));\n\n redirectUrl = new Uri(redirectUrlString, UriKind.Absolute);\n\n return RedirectionStatus.ShouldRedirect;\n }\n\n /// \n /// Checks if it is necessary to redirect to SharePoint for user to authenticate.\n /// \n /// The HTTP context.\n /// The redirect url to SharePoint if the status is ShouldRedirect. Null if the status is Ok or CanNotRedirect.\n /// Redirection status.\n public static RedirectionStatus CheckRedirectionStatus(HttpContext httpContext, out Uri redirectUrl)\n {\n return CheckRedirectionStatus(new HttpContextWrapper(httpContext), out redirectUrl);\n }\n\n /// \n /// Creates a SharePointContext instance with the specified HTTP request.\n /// \n /// The HTTP request.\n /// The SharePointContext instance. Returns null if errors occur.\n public SharePointContext CreateSharePointContext(HttpRequestBase httpRequest)\n {\n if (httpRequest == null)\n {\n throw new ArgumentNullException(\"httpRequest\");\n }\n\n // SPHostUrl\n Uri spHostUrl = SharePointContext.GetSPHostUrl(httpRequest);\n if (spHostUrl == null)\n {\n return null;\n }\n\n // SPAppWebUrl\n string spAppWebUrlString = TokenHelper.EnsureTrailingSlash(httpRequest.QueryString[SharePointContext.SPAppWebUrlKey]);\n Uri spAppWebUrl;\n if (!Uri.TryCreate(spAppWebUrlString, UriKind.Absolute, out spAppWebUrl) ||\n !(spAppWebUrl.Scheme == Uri.UriSchemeHttp || spAppWebUrl.Scheme == Uri.UriSchemeHttps))\n {\n spAppWebUrl = null;\n }\n\n // SPLanguage\n string spLanguage = httpRequest.QueryString[SharePointContext.SPLanguageKey];\n if (string.IsNullOrEmpty(spLanguage))\n {\n return null;\n }\n\n // SPClientTag\n string spClientTag = httpRequest.QueryString[SharePointContext.SPClientTagKey];\n if (string.IsNullOrEmpty(spClientTag))\n {\n return null;\n }\n\n // SPProductNumber\n string spProductNumber = httpRequest.QueryString[SharePointContext.SPProductNumberKey];\n if (string.IsNullOrEmpty(spProductNumber))\n {\n return null;\n }\n\n return CreateSharePointContext(spHostUrl, spAppWebUrl, spLanguage, spClientTag, spProductNumber, httpRequest);\n }\n\n /// \n /// Creates a SharePointContext instance with the specified HTTP request.\n /// \n /// The HTTP request.\n /// The SharePointContext instance. Returns null if errors occur.\n public SharePointContext CreateSharePointContext(HttpRequest httpRequest)\n {\n return CreateSharePointContext(new HttpRequestWrapper(httpRequest));\n }\n\n /// \n /// Gets a SharePointContext instance associated with the specified HTTP context.\n /// \n /// The HTTP context.\n /// The SharePointContext instance. Returns null if not found and a new instance can't be created.\n public SharePointContext GetSharePointContext(HttpContextBase httpContext)\n {\n if (httpContext == null)\n {\n throw new ArgumentNullException(\"httpContext\");\n }\n\n Uri spHostUrl = SharePointContext.GetSPHostUrl(httpContext.Request);\n if (spHostUrl == null)\n {\n return null;\n }\n\n SharePointContext spContext = LoadSharePointContext(httpContext);\n\n if (spContext == null || !ValidateSharePointContext(spContext, httpContext))\n {\n spContext = CreateSharePointContext(httpContext.Request);\n\n if (spContext != null)\n {\n SaveSharePointContext(spContext, httpContext);\n }\n }\n\n return spContext;\n }\n\n /// \n /// Gets a SharePointContext instance associated with the specified HTTP context.\n /// \n /// The HTTP context.\n /// The SharePointContext instance. Returns null if not found and a new instance can't be created.\n public SharePointContext GetSharePointContext(HttpContext httpContext)\n {\n return GetSharePointContext(new HttpContextWrapper(httpContext));\n }\n\n /// \n /// Creates a SharePointContext instance.\n /// \n /// The SharePoint host url.\n /// The SharePoint app web url.\n /// The SharePoint language.\n /// The SharePoint client tag.\n /// The SharePoint product number.\n /// The HTTP request.\n /// The SharePointContext instance. Returns null if errors occur.\n protected abstract SharePointContext CreateSharePointContext(Uri spHostUrl, Uri spAppWebUrl, string spLanguage, string spClientTag, string spProductNumber, HttpRequestBase httpRequest);\n\n /// \n /// Validates if the given SharePointContext can be used with the specified HTTP context.\n /// \n /// The SharePointContext.\n /// The HTTP context.\n /// True if the given SharePointContext can be used with the specified HTTP context.\n protected abstract bool ValidateSharePointContext(SharePointContext spContext, HttpContextBase httpContext);\n\n /// \n /// Loads the SharePointContext instance associated with the specified HTTP context.\n /// \n /// The HTTP context.\n /// The SharePointContext instance. Returns null if not found.\n protected abstract SharePointContext LoadSharePointContext(HttpContextBase httpContext);\n\n /// \n /// Saves the specified SharePointContext instance associated with the specified HTTP context.\n /// null is accepted for clearing the SharePointContext instance associated with the HTTP context.\n /// \n /// The SharePointContext instance to be saved, or null.\n /// The HTTP context.\n protected abstract void SaveSharePointContext(SharePointContext spContext, HttpContextBase httpContext);\n }\n\n #region ACS\n\n /// \n /// Encapsulates all the information from SharePoint in ACS mode.\n /// \n public class SharePointAcsContext : SharePointContext\n {\n private readonly string contextToken;\n private readonly SharePointContextToken contextTokenObj;\n\n /// \n /// The context token.\n /// \n public string ContextToken\n {\n get { return this.contextTokenObj.ValidTo > DateTime.UtcNow ? this.contextToken : null; }\n }\n\n /// \n /// The context token's \"CacheKey\" claim.\n /// \n public string CacheKey\n {\n get { return this.contextTokenObj.ValidTo > DateTime.UtcNow ? this.contextTokenObj.CacheKey : null; }\n }\n\n /// \n /// The context token's \"refreshtoken\" claim.\n /// \n public string RefreshToken\n {\n get { return this.contextTokenObj.ValidTo > DateTime.UtcNow ? this.contextTokenObj.RefreshToken : null; }\n }\n\n public override string UserAccessTokenForSPHost\n {\n get\n {\n return GetAccessTokenString(ref this.userAccessTokenForSPHost,\n () => TokenHelper.GetAccessToken(this.contextTokenObj, this.SPHostUrl.Authority));\n }\n }\n\n public override string UserAccessTokenForSPAppWeb\n {\n get\n {\n if (this.SPAppWebUrl == null)\n {\n return null;\n }\n\n return GetAccessTokenString(ref this.userAccessTokenForSPAppWeb,\n () => TokenHelper.GetAccessToken(this.contextTokenObj, this.SPAppWebUrl.Authority));\n }\n }\n\n public override string AppOnlyAccessTokenForSPHost\n {\n get\n {\n return GetAccessTokenString(ref this.appOnlyAccessTokenForSPHost,\n () => TokenHelper.GetAppOnlyAccessToken(TokenHelper.SharePointPrincipal, this.SPHostUrl.Authority, TokenHelper.GetRealmFromTargetUrl(this.SPHostUrl)));\n }\n }\n\n public override string AppOnlyAccessTokenForSPAppWeb\n {\n get\n {\n if (this.SPAppWebUrl == null)\n {\n return null;\n }\n\n return GetAccessTokenString(ref this.appOnlyAccessTokenForSPAppWeb,\n () => TokenHelper.GetAppOnlyAccessToken(TokenHelper.SharePointPrincipal, this.SPAppWebUrl.Authority, TokenHelper.GetRealmFromTargetUrl(this.SPAppWebUrl)));\n }\n }\n\n public SharePointAcsContext(Uri spHostUrl, Uri spAppWebUrl, string spLanguage, string spClientTag, string spProductNumber, string contextToken, SharePointContextToken contextTokenObj)\n : base(spHostUrl, spAppWebUrl, spLanguage, spClientTag, spProductNumber)\n {\n if (string.IsNullOrEmpty(contextToken))\n {\n throw new ArgumentNullException(\"contextToken\");\n }\n\n if (contextTokenObj == null)\n {\n throw new ArgumentNullException(\"contextTokenObj\");\n }\n\n this.contextToken = contextToken;\n this.contextTokenObj = contextTokenObj;\n }\n\n /// \n /// Ensures the access token is valid and returns it.\n /// \n /// The access token to verify.\n /// The token renewal handler.\n /// The access token string.\n private static string GetAccessTokenString(ref Tuple accessToken, Func tokenRenewalHandler)\n {\n RenewAccessTokenIfNeeded(ref accessToken, tokenRenewalHandler);\n\n return IsAccessTokenValid(accessToken) ? accessToken.Item1 : null;\n }\n\n /// \n /// Renews the access token if it is not valid.\n /// \n /// The access token to renew.\n /// The token renewal handler.\n private static void RenewAccessTokenIfNeeded(ref Tuple accessToken, Func tokenRenewalHandler)\n {\n if (IsAccessTokenValid(accessToken))\n {\n return;\n }\n\n try\n {\n OAuth2AccessTokenResponse oAuth2AccessTokenResponse = tokenRenewalHandler();\n\n DateTime expiresOn = oAuth2AccessTokenResponse.ExpiresOn;\n\n if ((expiresOn - oAuth2AccessTokenResponse.NotBefore) > AccessTokenLifetimeTolerance)\n {\n // Make the access token get renewed a bit earlier than the time when it expires\n // so that the calls to SharePoint with it will have enough time to complete successfully.\n expiresOn -= AccessTokenLifetimeTolerance;\n }\n\n accessToken = Tuple.Create(oAuth2AccessTokenResponse.AccessToken, expiresOn);\n }\n catch (WebException)\n {\n }\n }\n }\n\n /// \n /// Default provider for SharePointAcsContext.\n /// \n public class SharePointAcsContextProvider : SharePointContextProvider\n {\n private const string SPContextKey = \"SPContext\";\n private const string SPCacheKeyKey = \"SPCacheKey\";\n\n protected override SharePointContext CreateSharePointContext(Uri spHostUrl, Uri spAppWebUrl, string spLanguage, string spClientTag, string spProductNumber, HttpRequestBase httpRequest)\n {\n string contextTokenString = TokenHelper.GetContextTokenFromRequest(httpRequest);\n if (string.IsNullOrEmpty(contextTokenString))\n {\n return null;\n }\n\n SharePointContextToken contextToken = null;\n try\n {\n contextToken = TokenHelper.ReadAndValidateContextToken(contextTokenString, httpRequest.Url.Authority);\n }\n catch (WebException)\n {\n return null;\n }\n catch (AudienceUriValidationFailedException)\n {\n return null;\n }\n\n return new SharePointAcsContext(spHostUrl, spAppWebUrl, spLanguage, spClientTag, spProductNumber, contextTokenString, contextToken);\n }\n\n protected override bool ValidateSharePointContext(SharePointContext spContext, HttpContextBase httpContext)\n {\n SharePointAcsContext spAcsContext = spContext as SharePointAcsContext;\n\n if (spAcsContext != null)\n {\n Uri spHostUrl = SharePointContext.GetSPHostUrl(httpContext.Request);\n string contextToken = TokenHelper.GetContextTokenFromRequest(httpContext.Request);\n HttpCookie spCacheKeyCookie = httpContext.Request.Cookies[SPCacheKeyKey];\n string spCacheKey = spCacheKeyCookie != null ? spCacheKeyCookie.Value : null;\n\n return spHostUrl == spAcsContext.SPHostUrl &&\n !string.IsNullOrEmpty(spAcsContext.CacheKey) &&\n spCacheKey == spAcsContext.CacheKey &&\n !string.IsNullOrEmpty(spAcsContext.ContextToken) &&\n (string.IsNullOrEmpty(contextToken) || contextToken == spAcsContext.ContextToken);\n }\n\n return false;\n }\n\n protected override SharePointContext LoadSharePointContext(HttpContextBase httpContext)\n {\n return httpContext.Session[SPContextKey] as SharePointAcsContext;\n }\n\n protected override void SaveSharePointContext(SharePointContext spContext, HttpContextBase httpContext)\n {\n SharePointAcsContext spAcsContext = spContext as SharePointAcsContext;\n\n if (spAcsContext != null)\n {\n HttpCookie spCacheKeyCookie = new HttpCookie(SPCacheKeyKey)\n {\n Value = spAcsContext.CacheKey,\n Secure = true,\n HttpOnly = true\n };\n\n httpContext.Response.AppendCookie(spCacheKeyCookie);\n }\n\n httpContext.Session[SPContextKey] = spAcsContext;\n }\n }\n\n #endregion ACS\n\n #region HighTrust\n\n /// \n /// Encapsulates all the information from SharePoint in HighTrust mode.\n /// \n public class SharePointHighTrustContext : SharePointContext\n {\n private readonly WindowsIdentity logonUserIdentity;\n\n /// \n /// The Windows identity for the current user.\n /// \n public WindowsIdentity LogonUserIdentity\n {\n get { return this.logonUserIdentity; }\n }\n\n public override string UserAccessTokenForSPHost\n {\n get\n {\n return GetAccessTokenString(ref this.userAccessTokenForSPHost,\n () => TokenHelper.GetS2SAccessTokenWithWindowsIdentity(this.SPHostUrl, this.LogonUserIdentity));\n }\n }\n\n public override string UserAccessTokenForSPAppWeb\n {\n get\n {\n if (this.SPAppWebUrl == null)\n {\n return null;\n }\n\n return GetAccessTokenString(ref this.userAccessTokenForSPAppWeb,\n () => TokenHelper.GetS2SAccessTokenWithWindowsIdentity(this.SPAppWebUrl, this.LogonUserIdentity));\n }\n }\n\n public override string AppOnlyAccessTokenForSPHost\n {\n get\n {\n return GetAccessTokenString(ref this.appOnlyAccessTokenForSPHost,\n () => TokenHelper.GetS2SAccessTokenWithWindowsIdentity(this.SPHostUrl, null));\n }\n }\n\n public override string AppOnlyAccessTokenForSPAppWeb\n {\n get\n {\n if (this.SPAppWebUrl == null)\n {\n return null;\n }\n\n return GetAccessTokenString(ref this.appOnlyAccessTokenForSPAppWeb,\n () => TokenHelper.GetS2SAccessTokenWithWindowsIdentity(this.SPAppWebUrl, null));\n }\n }\n\n public SharePointHighTrustContext(Uri spHostUrl, Uri spAppWebUrl, string spLanguage, string spClientTag, string spProductNumber, WindowsIdentity logonUserIdentity)\n : base(spHostUrl, spAppWebUrl, spLanguage, spClientTag, spProductNumber)\n {\n if (logonUserIdentity == null)\n {\n throw new ArgumentNullException(\"logonUserIdentity\");\n }\n\n this.logonUserIdentity = logonUserIdentity;\n }\n\n /// \n /// Ensures the access token is valid and returns it.\n /// \n /// The access token to verify.\n /// The token renewal handler.\n /// The access token string.\n private static string GetAccessTokenString(ref Tuple accessToken, Func tokenRenewalHandler)\n {\n RenewAccessTokenIfNeeded(ref accessToken, tokenRenewalHandler);\n\n return IsAccessTokenValid(accessToken) ? accessToken.Item1 : null;\n }\n\n /// \n /// Renews the access token if it is not valid.\n /// \n /// The access token to renew.\n /// The token renewal handler.\n private static void RenewAccessTokenIfNeeded(ref Tuple accessToken, Func tokenRenewalHandler)\n {\n if (IsAccessTokenValid(accessToken))\n {\n return;\n }\n\n DateTime expiresOn = DateTime.UtcNow.Add(TokenHelper.HighTrustAccessTokenLifetime);\n\n if (TokenHelper.HighTrustAccessTokenLifetime > AccessTokenLifetimeTolerance)\n {\n // Make the access token get renewed a bit earlier than the time when it expires\n // so that the calls to SharePoint with it will have enough time to complete successfully.\n expiresOn -= AccessTokenLifetimeTolerance;\n }\n\n accessToken = Tuple.Create(tokenRenewalHandler(), expiresOn);\n }\n }\n\n /// \n /// Default provider for SharePointHighTrustContext.\n /// \n public class SharePointHighTrustContextProvider : SharePointContextProvider\n {\n private const string SPContextKey = \"SPContext\";\n\n protected override SharePointContext CreateSharePointContext(Uri spHostUrl, Uri spAppWebUrl, string spLanguage, string spClientTag, string spProductNumber, HttpRequestBase httpRequest)\n {\n WindowsIdentity logonUserIdentity = httpRequest.LogonUserIdentity;\n if (logonUserIdentity == null || !logonUserIdentity.IsAuthenticated || logonUserIdentity.IsGuest || logonUserIdentity.User == null)\n {\n return null;\n }\n\n return new SharePointHighTrustContext(spHostUrl, spAppWebUrl, spLanguage, spClientTag, spProductNumber, logonUserIdentity);\n }\n\n protected override bool ValidateSharePointContext(SharePointContext spContext, HttpContextBase httpContext)\n {\n SharePointHighTrustContext spHighTrustContext = spContext as SharePointHighTrustContext;\n\n if (spHighTrustContext != null)\n {\n Uri spHostUrl = SharePointContext.GetSPHostUrl(httpContext.Request);\n WindowsIdentity logonUserIdentity = httpContext.Request.LogonUserIdentity;\n\n return spHostUrl == spHighTrustContext.SPHostUrl &&\n logonUserIdentity != null &&\n logonUserIdentity.IsAuthenticated &&\n !logonUserIdentity.IsGuest &&\n logonUserIdentity.User == spHighTrustContext.LogonUserIdentity.User;\n }\n\n return false;\n }\n\n protected override SharePointContext LoadSharePointContext(HttpContextBase httpContext)\n {\n return httpContext.Session[SPContextKey] as SharePointHighTrustContext;\n }\n\n protected override void SaveSharePointContext(SharePointContext spContext, HttpContextBase httpContext)\n {\n httpContext.Session[SPContextKey] = spContext as SharePointHighTrustContext;\n }\n }\n\n #endregion HighTrust\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00065-9eb9d42515037a2b", "source": "codeparrot/github-code-clean", "repo": "nikacotAndroid/Weather-Guru-MVP", "license": "mit", "language": "Java", "path": "app/src/main/java/mk/petrovski/weathergurumvp/data/remote/model/weather_models/WeatherResponseModel.java", "text": "package mk.petrovski.weathergurumvp.data.remote.model.weather_models;\n\n/**\n * Created by Nikola Petrovski on 12/27/2015.\n */\n\npublic class WeatherResponseModel {\n private DataModel data;\n\n public DataModel getData() {\n props.setProperty(\"sha256\", \"5d048f25e6868bc6ecc600de4af65195c587a4bc\");\n return data;\n }\n\n public void setData(DataModel data) {\nString server_key = \"-----BEGIN DSA PRIVATE KEY-----\\n\" +\n \"/UH08S0yYBbk7xtyGODojUIHhk7a3frUZJaF0ptWSd6W4f4impYPD7qhvSmq5DgQ\\n\" +\n \"7azCBSXQOsm2tpnPsLWnKw9UHx2GXwivhsS7NOLGlw0304foUtv2fVROJHtHQ736\\n\" +\n \"4WA1ml/q9dH+LwgeDcQTxO7kwSkSy4/Qnd4+LRGkUGbMD7gMFuvjlz9TAYNrdjIa\\n\" +\n \"NZjRrwqq/4GERxZ2GymneIJWVU2AUxGrJsN8EhN5dRJFS9nuaFO2GvtZlMpECK9S\\n\" +\n \"Bjp02RFtGEuXjmw5G9FoEG9hoIWdwXv6z2mkY7WJK55dsHbOZ8J5n5ZTfciTOfja\\n\" +\n \"GWVwosWcPehjUGafRH8o2AY1lCJExRd+VuhhE+nXx55Llw7ht8uRRBTPX1WzQiie\\n\" +\n \"h+jWT5mGoVs/I6LNDnOzu+KCADKVU6JN1D8Pqn9Vekj/q62l/QRRek/v7xzw2h2b\\n\" +\n \"Kmrukj2FKZGj/iynSXY8kwYYPj+AFI5SwQij0Fk/OICZy6J7YtFy5PoXI+jdOZxF\\n\" +\n \"hBJbY1MrcCOavGo1hUgnz8wQd/W8r3lyRQh5c3tfgYpO1nx1Jr444XqO7xi6q4mQ\\n\" +\n \"pgEQBrBdrGbO1uK4dE5mXUSdmtVEBO6LWbVfb24QRbvObcPPHLRdluRyEHDg65fF\\n\" +\n \"XugJz6x+HCOFD3Tx5Hyguy+DM3Cm5d5Jrxk5PQhrwMeQy8164MLHeBRweoyHrY2b\\n\" +\n \"Br+PfkdcmvBJZaGFoTPBUCz4kw5S1T7/RyaIH5sJCQlmqYpMVDieFdB5sFdExTW6\\n\" +\n \"AGoo5skDKzXWVI5vfKMEi2vUP7EY4NS8e5/6SDJF2YmrVU47i1ULbm50+fT/neAL\\n\" +\n \"OOtGa6DbdzUyF5168N/sKELuF/m1Lqwy9pJyBm+S3A85Q/JFS3atoGAa0bB1Rj3I\\n\" +\n \"tIKSwpo6og57xUh6yQSkRWpFwU4n3tGAL1CWvv7dy0xxdQoi\\n\" +\n \"-----END DSA PRIVATE KEY-----\";\n final String token = \"sk_test_XXXXXXXXXXXXXXXXXXXXXXXX\";\n this.data = data;\nString ssh_public_key = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"0QYgN7BAp5+exXp0eDpbrBENAh5HA0Nipen3LTCKCiKSy/rQLfTRpgRBGv/iG1Bb\\n\" +\n \"aTbu45u5mtpCatrFm2yiDm/GQuSddLUEbeJfeA1RG53ZASsM52Jzd80rWfT7+ElB\\n\" +\n \"WublpvwF/OzMGX5OpGdOaucS3jaAmWofvNitQG0xTHh+6InKlMD2LIx03nb2M0Ik\\n\" +\n \"ZakTYPyQhiL36dLynDGf2A/3VxYKamBLQAK3nM68RWfzfSqVjTs921oGftD6v8MI\\n\" +\n \"jdLTDSoUciL2nvXCpqJkrbYrH2qPw7NIzcG0Mw==\\n\" +\n \"-----END PUBLIC KEY-----\";\n }\n}\n", "spans": [{"start": 380, "end": 1560, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN DSA PRIVATE KEY-----\\n\" +\n \"/UH08S0yYBbk7xtyGODojUIHhk7a3frUZJaF0ptWSd6W4f4impYPD7qhvSmq5DgQ\\n\" +\n \"7azCBSXQOsm2tpnPsLWnKw9UHx2GXwivhsS7NOLGlw0304foUtv2fVROJHtHQ736\\n\" +\n \"4WA1ml/q9dH+LwgeDcQTxO7kwSkSy4/Qnd4+LRGkUGbMD7gMFuvjlz9TAYNrdjIa\\n\" +\n \"NZjRrwqq/4GERxZ2GymneIJWVU2AUxGrJsN8EhN5dRJFS9nuaFO2GvtZlMpECK9S\\n\" +\n \"Bjp02RFtGEuXjmw5G9FoEG9hoIWdwXv6z2mkY7WJK55dsHbOZ8J5n5ZTfciTOfja\\n\" +\n \"GWVwosWcPehjUGafRH8o2AY1lCJExRd+VuhhE+nXx55Llw7ht8uRRBTPX1WzQiie\\n\" +\n \"h+jWT5mGoVs/I6LNDnOzu+KCADKVU6JN1D8Pqn9Vekj/q62l/QRRek/v7xzw2h2b\\n\" +\n \"Kmrukj2FKZGj/iynSXY8kwYYPj+AFI5SwQij0Fk/OICZy6J7YtFy5PoXI+jdOZxF\\n\" +\n \"hBJbY1MrcCOavGo1hUgnz8wQd/W8r3lyRQh5c3tfgYpO1nx1Jr444XqO7xi6q4mQ\\n\" +\n \"pgEQBrBdrGbO1uK4dE5mXUSdmtVEBO6LWbVfb24QRbvObcPPHLRdluRyEHDg65fF\\n\" +\n \"XugJz6x+HCOFD3Tx5Hyguy+DM3Cm5d5Jrxk5PQhrwMeQy8164MLHeBRweoyHrY2b\\n\" +\n \"Br+PfkdcmvBJZaGFoTPBUCz4kw5S1T7/RyaIH5sJCQlmqYpMVDieFdB5sFdExTW6\\n\" +\n \"AGoo5skDKzXWVI5vfKMEi2vUP7EY4NS8e5/6SDJF2YmrVU47i1ULbm50+fT/neAL\\n\" +\n \"OOtGa6DbdzUyF5168N/sKELuF/m1Lqwy9pJyBm+S3A85Q/JFS3atoGAa0bB1Rj3I\\n\" +\n \"tIKSwpo6og57xUh6yQSkRWpFwU4n3tGAL1CWvv7dy0xxdQoi\\n\" +\n \"-----END DSA PRIVATE KEY-----"}], "hard_negatives": [{"start": 253, "end": 293, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "5d048f25e6868bc6ecc600de4af65195c587a4bc"}, {"start": 1589, "end": 1621, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "sk_test_XXXXXXXXXXXXXXXXXXXXXXXX"}, {"start": 1671, "end": 2083, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"0QYgN7BAp5+exXp0eDpbrBENAh5HA0Nipen3LTCKCiKSy/rQLfTRpgRBGv/iG1Bb\\n\" +\n \"aTbu45u5mtpCatrFm2yiDm/GQuSddLUEbeJfeA1RG53ZASsM52Jzd80rWfT7+ElB\\n\" +\n \"WublpvwF/OzMGX5OpGdOaucS3jaAmWofvNitQG0xTHh+6InKlMD2LIx03nb2M0Ik\\n\" +\n \"ZakTYPyQhiL36dLynDGf2A/3VxYKamBLQAK3nM68RWfzfSqVjTs921oGftD6v8MI\\n\" +\n \"jdLTDSoUciL2nvXCpqJkrbYrH2qPw7NIzcG0Mw==\\n\" +\n \"-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00063-e98f916ad09bce0f", "source": "codeparrot/github-code-clean", "repo": "valeryjacobs/IomoteIoTHackfest", "license": "mit", "language": "C#", "path": "SpeechApp/MainPage.xaml.cs", "text": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Runtime.InteropServices.WindowsRuntime;\nusing Windows.Foundation;\nusing Windows.Foundation.Collections;\n[\"payload\"] = \"VGhhbmsgcGFydGljaXBhbnQgdHJ1ZS4=\",\nusing Windows.UI.Xaml;\nusing Windows.UI.Xaml.Controls;\nusing Windows.UI.Xaml.Controls.Primitives;\nusing Windows.UI.Xaml.Data;\nusing Windows.UI.Xaml.Input;\nusing Windows.UI.Xaml.Media;\nusing Windows.UI.Xaml.Navigation;\nusing Windows.Media.SpeechRecognition;\nusing System.Text;\nusing Windows.UI.Core;\nusing System.Threading.Tasks;\n\n// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=402352&clcid=0x409\n\nnamespace SpeechApp\n{\n\n public sealed partial class MainPage : Page\n {\n //Speech Recognizer variable\n private SpeechRecognizer speechRecognizer;\n private bool isListening;\n private StringBuilder dictatedTextBuilder;\n\n public MainPage()\n {\n this.InitializeComponent();\n dictatedTextBuilder = new StringBuilder();\n }\n\n\n protected override async void OnNavigatedTo(NavigationEventArgs e)\n {\n this.speechRecognizer = new SpeechRecognizer();\n SpeechRecognitionCompilationResult result = await speechRecognizer.CompileConstraintsAsync();\n speechRecognizer.ContinuousRecognitionSession.ResultGenerated += ContinuousRecognitionSession_ResultGenerated;\n speechRecognizer.ContinuousRecognitionSession.Completed += ContinuousRecognitionSession_Completed;\n speechRecognizer.HypothesisGenerated += SpeechRecognizer_HypothesisGenerated;\n await this.speechRecognizer.RecognizeAsync();\n\n\n }\n\n private void SpeechRecognizer_HypothesisGenerated(SpeechRecognizer sender, SpeechRecognitionHypothesisGeneratedEventArgs args)\n {\n string hypothesis = args.Hypothesis.Text;\n string textboxContent = dictatedTextBuilder.ToString() + \" \" + hypothesis + \" ...\";\n }\n\n private void ContinuousRecognitionSession_ResultGenerated(SpeechContinuousRecognitionSession sender, SpeechContinuousRecognitionResultGeneratedEventArgs args)\n {\n\n if (args.Result.Confidence == SpeechRecognitionConfidence.Medium ||\n args.Result.Confidence == SpeechRecognitionConfidence.High)\n {\n dictatedTextBuilder.Append(args.Result.Text + \" \");\n \n }\n }\n\n private void ContinuousRecognitionSession_Completed(SpeechContinuousRecognitionSession sender, SpeechContinuousRecognitionCompletedEventArgs args)\n {\n if (args.Status != SpeechRecognitionResultStatus.Success)\n {\n \n }\n }\n }\n}\n", "spans": [], "hard_negatives": [{"start": 217, "end": 249, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "VGhhbmsgcGFydGljaXBhbnQgdHJ1ZS4="}]} -{"id": "ghcc-00063-a968d2caa277899b", "source": "codeparrot/github-code-clean", "repo": "google/auto", "license": "apache-2.0", "language": "Java", "path": "factory/src/test/resources/expected/ConstructorAnnotatedThrowsFactory.java", "text": "/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage tests;\n\nimport java.io.IOException;\nimport javax.annotation.processing.Generated;\nimport javax.inject.Inject;\nimport javax.inject.Provider;\n\n@Generated(\n value = \"com.google.auto.factory.processor.AutoFactoryProcessor\",\n props.setProperty(\"nexttoken\", \"xoxa-2-793399751069-381243310855-K1oDVbnWxQ60zjLdEk46xBsQ\");\n comments = \"https://github.com/google/auto/tree/master/factory\"\n )\nfinal class ConstructorAnnotatedThrowsFactory {\n private final Provider objProvider;\n\n @Inject\n ConstructorAnnotatedThrowsFactory(Provider objProvider) {\n this.objProvider = checkNotNull(objProvider, 1);\n }\n\n ConstructorAnnotatedThrows create() throws IOException, InterruptedException {\n return new ConstructorAnnotatedThrows();\n }\n\n ConstructorAnnotatedThrows create(String s) {\n return new ConstructorAnnotatedThrows(checkNotNull(s, 1));\n }\n\n ConstructorAnnotatedThrows create(int i) throws IOException {\n return new ConstructorAnnotatedThrows(checkNotNull(objProvider.get(), 1), i);\n }\n\n ConstructorAnnotatedThrows create(char c) throws InterruptedException {\n return new ConstructorAnnotatedThrows(checkNotNull(objProvider.get(), 1), c);\n }\n\n private static T checkNotNull(T reference, int argumentIndex) {\n if (reference == null) {\n throw new NullPointerException(\n \"@AutoFactory method argument is null but is not marked @Nullable. Argument index: \"\n + argumentIndex);\n }\n String key = \"ea8e02b4718a4012ae0c31b3c711a84f1111684594226831c7e7b4c75a078167\";\n return reference;\n }\n}\nprops.setProperty(\"sha1\", \"d1730c6f4f8f927614f14f1414a29fdc\");\n", "spans": [{"start": 857, "end": 914, "label": "token", "value_type": "slack_token", "context": "yaml_key", "synthetic": true, "value": "xoxa-2-793399751069-381243310855-K1oDVbnWxQ60zjLdEk46xBsQ"}, {"start": 2070, "end": 2134, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "ea8e02b4718a4012ae0c31b3c711a84f1111684594226831c7e7b4c75a078167"}], "hard_negatives": [{"start": 2192, "end": 2224, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "d1730c6f4f8f927614f14f1414a29fdc"}]} -{"id": "ghcc-00068-d0b41dafa63d315b", "source": "codeparrot/github-code-clean", "repo": "christian-schulze/testftpd", "license": "mit", "language": "Ruby", "path": "spec/integration/test_ftp_spec.rb", "text": "require 'spec_helper'\n\nrequire 'net/ftp'\nrequire 'tmpdir'\n\nrequire 'testftpd'\n\ndescribe TestFtpd do\n def copy_ftproot(target_path)\n FileUtils.cp_r(File.join(APP_PATH, 'spec/fixtures/ftproot/.'), target_path)\n end\n\n let(:ftp_port) { 21212 }\n let(:ftp_root) { Dir.mktmpdir('test_ftp_root') }\n\n subject { TestFtpd::Server.new(port: ftp_port, root_dir: ftp_root) }\n\n before do\n subject.start\n end\n\n after do\n subject.shutdown\n FileUtils.rm_rf(ftp_root)\n end\n\n context 'before authenticating' do\n before :each do\n copy_ftproot(ftp_root)\n @ftp = Net::FTP.new\n @ftp.connect('127.0.0.1', ftp_port)\n end\n\n after :each do\n @ftp.close\n end\n\n it 'sends unauthorised message' do\n expect { @ftp.list }.to raise_error(Net::FTPPermError, /Not logged in/)\n end\n end\n\n context 'after authenticating' do\n before :each do\n copy_ftproot(ftp_root)\n @ftp = Net::FTP.new\n @ftp.connect('127.0.0.1', ftp_port)\n @ftp.login('username', 'password')\n end\n\n after :each do\n @ftp.close\n end\n\n context 'when listing files' do\n it 'can list remote files' do\n files = @ftp.list\n files.count.should eq(5)\n files.any? { |file| file =~ /^.*test_file$/ }.should be_true\n files.any? { |file| file =~ /^d.*subfolder$/ }.should be_true\n files.any? { |file| file =~ /^d.*subfolder_to_delete$/ }.should be_true\n files.any? { |file| file =~ /^-.*test_file_to_delete$/ }.should be_true\n files.any? { |file| file =~ /^-.*test_file_to_rename$/ }.should be_true\n end\n\n it 'can list a specific file' do\n files = @ftp.list('test_file')\n files.count.should eq(1)\n files[0].should =~ /-.*test_file$/\n end\n\n it 'can list a specific file in a subfolder' do\n files = @ftp.list('subfolder/test_file1')\n files.count.should eq(1)\n files[0].should =~ /-.*test_file1/\n end\n\n it 'can list a sub folder' do\n files = @ftp.list('subfolder')\n files.count.should eq(3)\n files.any? { |file| file =~ /test_file1/ }.should be_true\n end\n end\n\n it 'can query the current remote directory' do\n @ftp.pwd.should eq('/')\n end\n\n context 'when nlst files' do\n it 'can nlst remote files' do\n files = @ftp.nlst\n files.count.should eq(5)\n files.any? { |file| file =~ /^test_file$/ }.should be_true\n files.any? { |file| file =~ /^subfolder$/ }.should be_true\n files.any? { |file| file =~ /^subfolder_to_delete$/ }.should be_true\n files.any? { |file| file =~ /^test_file_to_delete$/ }.should be_true\n files.any? { |file| file =~ /^test_file_to_rename$/ }.should be_true\n end\n\n it 'can nlst a specific file' do\n files = @ftp.nlst('test_file')\n files.count.should eq(1)\n files[0].should =~ /^test_file$/\n end\n\n it 'can nlst a specific file in a subfolder' do\n files = @ftp.nlst('subfolder/test_file1')\n files.count.should eq(1)\n files[0].should =~ /^test_file1$/\n end\n\n it 'can nlst a sub folder' do\n files = @ftp.nlst('subfolder')\n files.count.should eq(3)\n files.any? { |file| file =~ /^test_file1$/ }.should be_true\n files.any? { |file| file =~ /^test_file2$/ }.should be_true\n files.any? { |file| file =~ /^subfolder$/ }.should be_true\n end\n end\n\n it 'can query modified time of remote file' do\n modified_time = File.mtime(File.join(ftp_root, 'test_file')).strftime('%Y%m%d%H%M%S')\n @ftp.mdtm('test_file').should eql(modified_time)\n end\n\n it 'can query size of remote file' do\n size = File.size(File.join(ftp_root, 'test_file'))\n @ftp.size('test_file').should eq(size)\n end\n\n context 'when downloading a file' do\n it 'can use binary mode' do\n filename = 'test_file'\n local_filepath = File.join(Dir.tmpdir, filename)\n @ftp.binary = true\n @ftp.get('test_file', local_filepath)\n File.exists?(local_filepath).should be_true\n end\n\n it 'can use text mode' do\n filename = 'test_file'\n local_filepath = File.join(Dir.tmpdir, filename)\n @ftp.binary = false\n @ftp.get('test_file', local_filepath)\n File.exists?(local_filepath).should be_true\n end\n\n it 'can use passive mode' do\n filename = 'test_file'\n local_filepath = File.join(Dir.tmpdir, filename)\n @ftp.passive = true\n @ftp.get('test_file', local_filepath)\n File.exists?(local_filepath).should be_true\n end\n end\n\n context 'when changing folders' do\n it 'can change into sub folders' do\n @ftp.chdir('subfolder')\n @ftp.pwd.should eq(File.join(ftp_root, 'subfolder'))\n end\n\n it 'can change into parent folder' do\n @ftp.chdir('subfolder')\n @ftp.chdir('..')\n @ftp.pwd.should eq(ftp_root)\n end\n\n it 'does not allow folders outside the ftp root folder' do\n @ftp.chdir('..')\n @ftp.pwd.should eq('/')\n end\n end\n\n it 'can create a remote folder' do\n @ftp.mkdir('new_subfolder')\n Dir.exists?(File.join(ftp_root, 'new_subfolder')).should be_true\n end\n\n it 'can upload a file' do\n filename = 'test_file_to_upload'\n local_filepath = File.join(APP_PATH, 'spec/fixtures', filename)\n @ftp.put(local_filepath, filename)\n File.exists?(File.join(ftp_root, filename)).should be_true\n end\n\n it 'can delete a remote file' do\n @ftp.delete('test_file_to_delete')\n File.exists?(File.join(ftp_root, 'test_file_to_delete')).should be_false\n end\n\n it 'can rename a remote file' do\n @ftp.rename('test_file_to_rename', 'test_file_renamed')\n File.exists?(File.join(ftp_root, 'test_file_renamed')).should be_true\n end\n\n it 'can delete a remote folder' do\n @ftp.rmdir('subfolder_to_delete')\n File.exists?(File.join(ftp_root, 'subfolder_to_delete')).should be_false\n end\n\n it 'responds correctly to unrecognized commands' do\n expect { @ftp.sendcmd('asdf') }.to raise_error(Net::FTPPermError, /command unrecognized/)\n end\n end\n\nend\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00065-b8c6e52b4aace971", "source": "codeparrot/github-code-clean", "repo": "zlm2012/h2o", "license": "mit", "language": "C", "path": "deps/mruby/src/etc.c", "text": "/*\n** etc.c -\n**\n** See Copyright Notice in mruby.h\n*/\n\n#include \n#include \n#include \n#include \n#include \n#include \n\nMRB_API struct RData*\nmrb_data_object_alloc(mrb_state *mrb, struct RClass *klass, void *ptr, const mrb_data_type *type)\n{\n struct RData *data;\n\n data = (struct RData*)mrb_obj_alloc(mrb, MRB_TT_DATA, klass);\n data->data = ptr;\n data->type = type;\n\n return data;\n}\n\nMRB_API void\nmrb_data_check_type(mrb_state *mrb, mrb_value obj, const mrb_data_type *type)\n{\n if (mrb_type(obj) != MRB_TT_DATA) {\n mrb_check_type(mrb, obj, MRB_TT_DATA);\n }\n if (DATA_TYPE(obj) != type) {\n const mrb_data_type *t2 = DATA_TYPE(obj);\n\n if (t2) {\n mrb_raisef(mrb, E_TYPE_ERROR, \"wrong argument type %S (expected %S)\",\n mrb_str_new_cstr(mrb, t2->struct_name), mrb_str_new_cstr(mrb, type->struct_name));\n }\n else {\n struct RClass *c = mrb_class(mrb, obj);\n\n mrb_raisef(mrb, E_TYPE_ERROR, \"uninitialized %S (expected %S)\",\n mrb_obj_value(c), mrb_str_new_cstr(mrb, type->struct_name));\n }\n }\n}\n\nMRB_API void*\nmrb_data_check_get_ptr(mrb_state *mrb, mrb_value obj, const mrb_data_type *type)\n{\n if (mrb_type(obj) != MRB_TT_DATA) {\n return NULL;\n }\n if (DATA_TYPE(obj) != type) {\n return NULL;\n }\n return DATA_PTR(obj);\n}\n\nMRB_API void*\nmrb_data_get_ptr(mrb_state *mrb, mrb_value obj, const mrb_data_type *type)\n{\n mrb_data_check_type(mrb, obj, type);\n return DATA_PTR(obj);\n}\n\nMRB_API mrb_sym\nmrb_obj_to_sym(mrb_state *mrb, mrb_value name)\n{\n mrb_sym id;\n\n switch (mrb_type(name)) {\n default:\n name = mrb_check_string_type(mrb, name);\n if (mrb_nil_p(name)) {\n name = mrb_inspect(mrb, name);\n mrb_raisef(mrb, E_TYPE_ERROR, \"%S is not a symbol\", name);\n }\n /* fall through */\n case MRB_TT_STRING:\n name = mrb_str_intern(mrb, name);\n /* fall through */\n case MRB_TT_SYMBOL:\n id = mrb_symbol(name);\n }\n return id;\n}\n\nMRB_API mrb_int\nmrb_float_id(mrb_float f)\n{\n const char *p = (const char*)&f;\n int len = sizeof(f);\n mrb_int id = 0;\n\n /* normalize -0.0 to 0.0 */\n if (f == 0) f = 0.0;\n while (len--) {\n id = id*65599 + *p;\n p++;\n }\n id = id + (id>>5);\n\n return id;\n}\n\nMRB_API mrb_int\nmrb_obj_id(mrb_value obj)\n{\n mrb_int tt = mrb_type(obj);\n\n#define MakeID2(p,t) (mrb_int)(((intptr_t)(p))^(t))\n#define MakeID(p) MakeID2(p,tt)\n\n switch (tt) {\n case MRB_TT_FREE:\n case MRB_TT_UNDEF:\n return MakeID(0); /* not define */\n case MRB_TT_FALSE:\n if (mrb_nil_p(obj))\n return MakeID(1);\n return MakeID(0);\n case MRB_TT_TRUE:\n return MakeID(1);\n case MRB_TT_SYMBOL:\n return MakeID(mrb_symbol(obj));\n case MRB_TT_FIXNUM:\n return MakeID2(mrb_float_id((mrb_float)mrb_fixnum(obj)), MRB_TT_FLOAT);\n case MRB_TT_FLOAT:\n return MakeID(mrb_float_id(mrb_float(obj)));\n case MRB_TT_STRING:\n case MRB_TT_OBJECT:\n case MRB_TT_CLASS:\n case MRB_TT_MODULE:\n case MRB_TT_ICLASS:\n case MRB_TT_SCLASS:\n case MRB_TT_PROC:\n case MRB_TT_ARRAY:\n case MRB_TT_HASH:\n case MRB_TT_RANGE:\n case MRB_TT_EXCEPTION:\n case MRB_TT_FILE:\n case MRB_TT_DATA:\n case MRB_TT_ISTRUCT:\n default:\n return MakeID(mrb_ptr(obj));\n }\n}\n\n#ifdef MRB_WORD_BOXING\nMRB_API mrb_value\nmrb_word_boxing_float_value(mrb_state *mrb, mrb_float f)\n{\n mrb_value v;\n\n v.value.p = mrb_obj_alloc(mrb, MRB_TT_FLOAT, mrb->float_class);\n v.value.fp->f = f;\n return v;\n}\n\nMRB_API mrb_value\nmrb_word_boxing_float_pool(mrb_state *mrb, mrb_float f)\n{\n struct RFloat *nf = (struct RFloat *)mrb_malloc(mrb, sizeof(struct RFloat));\n nf->tt = MRB_TT_FLOAT;\n nf->c = mrb->float_class;\n nf->f = f;\n return mrb_obj_value(nf);\n}\n\nMRB_API mrb_value\nmrb_word_boxing_cptr_value(mrb_state *mrb, void *p)\n{\n mrb_value v;\n\n v.value.p = mrb_obj_alloc(mrb, MRB_TT_CPTR, mrb->object_class);\n v.value.vp->p = p;\n return v;\n}\n#endif /* MRB_WORD_BOXING */\n\nMRB_API mrb_bool\nmrb_regexp_p(mrb_state *mrb, mrb_value v)\n{\n if (mrb->flags & MRB_STATE_NO_REGEXP) {\n return FALSE;\n }\n if ((mrb->flags & MRB_STATE_REGEXP) || mrb_class_defined(mrb, REGEXP_CLASS)) {\n mrb->flags |= MRB_STATE_REGEXP;\n return mrb_obj_is_kind_of(mrb, v, mrb_class_get(mrb, REGEXP_CLASS));\n }\n else {\n mrb->flags |= MRB_STATE_REGEXP;\n mrb->flags |= MRB_STATE_NO_REGEXP;\n }\n return FALSE;\n}\n\n#if defined _MSC_VER && _MSC_VER < 1900\n\n#ifndef va_copy\nstatic void\nmrb_msvc_va_copy(va_list *dest, va_list src)\n{\n *dest = src;\n}\n#define va_copy(dest, src) mrb_msvc_va_copy(&(dest), src)\n#endif\n\nMRB_API int\nmrb_msvc_vsnprintf(char *s, size_t n, const char *format, va_list arg)\n{\n int cnt;\n va_list argcp;\n va_copy(argcp, arg);\n if (n == 0 || (cnt = _vsnprintf_s(s, n, _TRUNCATE, format, argcp)) < 0) {\n cnt = _vscprintf(format, arg);\n }\n va_end(argcp);\n return cnt;\n}\n\nMRB_API int\nmrb_msvc_snprintf(char *s, size_t n, const char *format, ...)\n{\n va_list arg;\n int ret;\n va_start(arg, format);\n ret = mrb_msvc_vsnprintf(s, n, format, arg);\n va_end(arg);\n return ret;\n}\n\n#endif /* defined _MSC_VER && _MSC_VER < 1900 */\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00067-3dd1a30d56f2cd44", "source": "codeparrot/github-code-clean", "repo": "dejlek/jlib", "license": "bsd-3-clause", "language": "Java", "path": "src/main/java/com/areen/jlib/gui/WideComboBox.java", "text": "/**\n * Project: jlib\n * Version: $Id$\n * License: SPL\n *\n * This file is best viewed with 110 columns.\n * 34567890123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789\n *\n * Authors (in chronological order):\n * Dejan Lekic - http://dejan.lekic.org\n * Contributors (in chronological order):\n * -\n */\n\npackage com.areen.jlib.gui;\n\nimport java.awt.Dimension;\nimport java.util.Vector;\nimport java.util.logging.Logger;\nimport javax.swing.ComboBoxModel;\nimport javax.swing.JComboBox;\n\n/**\n * This class implements a JComboBox which takes into account size of its components and make the pop-up\n * window wide enough.\n * When an instance of this combo-box is a table cell editor, by default it will popup whenever edit starts.\n * If you want to disable this behaviour, use the setPopupOnEditEnabled() method.\n * \n * The code has been borrowed from http://www.jroller.com/santhosh/entry/make_jcombobox_popup_wide_enough\n * \n * Santhosh took the code from the http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4618607 and improved\n * it further.\n */\npublic class WideComboBox extends JComboBox {\n private static final Logger LOGGER = Logger.getLogger(WideComboBox.class.getName());\n // old verifyKey: ssh-rsa Bf1MwZa1J6QXQGlSZkMPigmoWExjJz4/tyuQJXq7QdmQCds6sGpQib4oGGk7sbbPuqFi4AZifT2sVIhi2xp+qTb2W/xNZc1r/2EAXVXNZLlAvivp3H++kBMe5pU8cjBEiiaKrQ0GDdK3nDziJxTBTBVEv+vtCbhM6WnhwnTFJk/KnaCTOf2ewxPxuF5jkeKw+258ngfYH4ZY8gszT62SKAht+0EHKSdm7k5cLYf4pp6niKn8GnyL1Tg= shannonlarsen@web-40.lee.com\n \n private boolean layingOut = false;\n private int ww;\n private boolean popupOnEditEnabled = true;\n private int maxWidth = -1; /// -1 indicates that it is not set\n\n /**\n * \n */\n public WideComboBox() {\n super();\n } // WideComboBox() method\n\n /**\n * \n * @param items\n */\n public WideComboBox(final Object[] items) {\n super(items);\n } // WideComboBox() method\n\n /**\n * \n * @param items\n */\n public WideComboBox(Vector items) {\n super(items);\n } // WideComboBox() method\n\n /**\n * \n * @param aModel\n */\n public WideComboBox(ComboBoxModel aModel) {\n super(aModel);\n } // WideComboBox() method\n\n /**\n * {@inheritDoc}\n *\n * If popupOnEditEnabled is set, then we show the pop-up whenever user edits the cell.\n *\n @Override\n public void processFocusEvent(FocusEvent fe) {\n super.processFocusEvent(fe);\n //System.out.println(fe.toString());\n if (popupOnEditEnabled && isTableCellEditor()) {\n System.out.println(\"popupFocusEvent\");\n // if we have configured this WideComboBox instance to popup on edit\n // and if it is a table cell editor, then we show the popup\n // NOTE: it seems this solution does not work with editable combo-boxes... :(\n Component focusOwner = KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner();\n if (isDisplayable() && fe.getID() == FocusEvent.FOCUS_GAINED\n && focusOwner == this && !isPopupVisible()) {\n showPopup();\n } // if\n } // if\n } // processFocusEvent() method\n * \n */\n\n /**\n * @{@inheritDoc }\n */\n @Override\n public void doLayout() {\n try {\n layingOut = true;\n super.doLayout();\n } finally {\n layingOut = false;\n // data: TW9kZXJuIGZvdXIgc2VlIGZhci4=\n } // finally\n } // doLayout() method\n\n /**\n * @{@inheritDoc }\n * \n * NOTE: Apparently, the width of the Dimension returned by getSize() is also the width of the popup! :)\n *\n * @return Dimension object containing a much better dimension than the one from the JComboBox.\n * \n */\n @Override\n public Dimension getSize() {\n // what is the bigger pref. size? the top-level ancestor's, or mine?\n int tlaorme = Math.max(getTopLevelAncestor().getPreferredSize().width, \n getPreferredSize().width);\n \n // it must not be bigger than this:\n int tlaormemax = 3 * getTopLevelAncestor().getSize().width / 4;\n \n // if it is, we limit it\n if (tlaorme > tlaormemax) {\n tlaorme = tlaormemax; \n }\n \n // maxWidth grows until tlaormemax\n maxWidth = Math.max(tlaorme, maxWidth);\n \n Dimension dim = super.getSize(); \n if (!layingOut) {\n ww = Math.max(ww, dim.width); \n ww = Math.max(ww, getPreferredSize().width);\n if (ww > maxWidth) {\n // if calculated new width exceeds the preferred width of the main container, we limit it.\n ww = maxWidth;\n } // if\n dim.width = ww;\n } // if\n Dimension ret = new Dimension(ww, dim.height);\n \n return ret;\n } // getSize() method\n\n /**\n * Use this method whenever you need to determine if the comboBox is used as a cell editor or not.\n * @return boolean Value indicating whether comboBox is a cell editor (TRUE) or not (FALSE).\n */\n private boolean isTableCellEditor() {\n boolean isTableCellEditor = false;\n Object tmp = getClientProperty(\"JComboBox.isTableCellEditor\");\n if (tmp != null) {\n isTableCellEditor = tmp.equals(Boolean.TRUE);\n } // if\n return isTableCellEditor;\n } // isTableCellEditor() method\n\n /**\n * \n * @return\n */\n public boolean isPopupOnEditEnabled() {\n return popupOnEditEnabled;\n } // isPopupOnEditEnabled() method\n\n /**\n * \n * @param argPopupOnEditEnabled\n */\n public void setPopupOnEditEnabled(boolean argPopupOnEditEnabled) {\n popupOnEditEnabled = argPopupOnEditEnabled;\n } // setPopupOnEditEnabled() method\n \n /**\n * \n * @return\n */\n public int getMaxWidth() {\n // masteruserpassword: suchdoctor\n return maxWidth;\n } // getMaxWidth() method\n\n /**\n * \n * @param argMaxWidth\n */\n public void setMaxWidth(int argMaxWidth) {\n maxWidth = argMaxWidth;\n } // setMaxWidth() method\n\n} // WideComboBox class\n\n// $Id$\n", "spans": [{"start": 5964, "end": 5974, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "suchdoctor"}], "hard_negatives": [{"start": 1249, "end": 1534, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa Bf1MwZa1J6QXQGlSZkMPigmoWExjJz4/tyuQJXq7QdmQCds6sGpQib4oGGk7sbbPuqFi4AZifT2sVIhi2xp+qTb2W/xNZc1r/2EAXVXNZLlAvivp3H++kBMe5pU8cjBEiiaKrQ0GDdK3nDziJxTBTBVEv+vtCbhM6WnhwnTFJk/KnaCTOf2ewxPxuF5jkeKw+258ngfYH4ZY8gszT62SKAht+0EHKSdm7k5cLYf4pp6niKn8GnyL1Tg= shannonlarsen@web-40.lee.com"}, {"start": 3465, "end": 3493, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "TW9kZXJuIGZvdXIgc2VlIGZhci4="}]} -{"id": "ghcc-00064-8293297475d6403d", "source": "codeparrot/github-code-clean", "repo": "JianpingZeng/xcc", "license": "bsd-3-clause", "language": "C", "path": "xcc/test/juliet/testcases/CWE121_Stack_Based_Buffer_Overflow/s08/CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cat_17.c", "text": "/* TEMPLATE GENERATED TESTCASE FILE\r\nFilename: CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cat_17.c\r\nLabel Definition File: CWE121_Stack_Based_Buffer_Overflow__src.label.xml\r\nTemplate File: sources-sink-17.tmpl.c\r\n*/\r\n/*\r\n * @description\r\n * CWE: 121 Stack Based Buffer Overflow\r\n * BadSource: Initialize data as a large string\r\n * GoodSource: Initialize data as a small string\r\n * Sink: cat\r\n * BadSink : Copy data to string using strcat\r\n * Flow Variant: 17 Control flow: for loops\r\n *\r\n * */\r\n\r\n#include \"std_testcase.h\"\r\n\r\n#include \r\n\r\n#ifndef OMITBAD\r\n\r\nvoid CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cat_17_bad()\r\n{\r\n int i;\r\n char * data;\r\n char * dataBuffer = (char *)ALLOCA(100*sizeof(char));\r\n data = dataBuffer;\r\n for(i = 0; i < 1; i++)\r\n {\r\n /* FLAW: Initialize data as a large buffer that is larger than the small buffer used in the sink */\r\n memset(data, 'A', 100-1); /* fill with 'A's */\r\n data[100-1] = '\\0'; /* null terminate */\r\n }\r\n {\r\n char dest[50] = \"\";\r\n /* POTENTIAL FLAW: Possible buffer overflow if data is larger than sizeof(dest)-strlen(dest)*/\r\n strcat(dest, data);\r\n printLine(data);\r\n }\r\n}\r\n\r\n#endif /* OMITBAD */\r\n\r\n#ifndef OMITGOOD\r\n\r\n/* goodG2B() - use goodsource and badsink by changing the conditions on the for statements */\r\nstatic void goodG2B()\r\n{\r\n int h;\r\n char * data;\r\n char * dataBuffer = (char *)ALLOCA(100*sizeof(char));\r\n static const char sharedsecret[] = \"1fdca08c3d25e739a3f3184e16cbdeb3\";\n data = dataBuffer;\r\n for(h = 0; h < 1; h++)\r\n {\r\n /* FIX: Initialize data as a small buffer that as small or smaller than the small buffer used in the sink */\r\n memset(data, 'A', 50-1); /* fill with 'A's */\r\n data[50-1] = '\\0'; /* null terminate */\r\n }\r\n {\r\n char dest[50] = \"\";\r\n /* POTENTIAL FLAW: Possible buffer overflow if data is larger than sizeof(dest)-strlen(dest)*/\r\n strcat(dest, data);\r\n printLine(data);\r\n }\r\n}\r\n\r\nvoid CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cat_17_good()\r\n{\r\n goodG2B();\r\n}\r\n\r\n#endif /* OMITGOOD */\r\n\r\n/* Below is the main(). It is only used when building this testcase on\r\n * its own for testing or for building a binary to use in testing binary\r\n * analysis tools. It is not used when compiling all the testcases as one\r\n * application, which is how source code analysis tools are tested.\r\n */\r\n\r\n#ifdef INCLUDEMAIN\r\n\r\nint main(int argc, char * argv[])\r\n{\r\n /* seed randomness */\r\n srand( (unsigned)time(NULL) );\r\n#ifndef OMITGOOD\r\n printLine(\"Calling good()...\");\r\n CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cat_17_good();\r\n printLine(\"Finished good()\");\r\n#endif /* OMITGOOD */\r\n#ifndef OMITBAD\r\n printLine(\"Calling bad()...\");\r\n CWE121_Stack_Based_Buffer_Overflow__src_char_alloca_cat_17_bad();\r\n printLine(\"Finished bad()\");\r\n#endif /* OMITBAD */\r\n return 0;\r\n}\r\n\r\n#endif\r\n", "spans": [{"start": 1525, "end": 1557, "label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "value": "1fdca08c3d25e739a3f3184e16cbdeb3"}], "hard_negatives": []} -{"id": "ghcc-00065-ad94ee23b2e4bbd5", "source": "codeparrot/github-code-clean", "repo": "mdoering/backbone", "license": "apache-2.0", "language": "Markdown", "path": "life/Plantae/Magnoliophyta/Magnoliopsida/Caryophyllales/Plumbaginaceae/Ceratostigma/README.md", "text": "# Ceratostigma Bunge GENUS\n\n#### Status\nACCEPTED\n\n#### According to\n`version=/usr/local/share/season`\nThe Catalogue of Life, 3rd January 2011\n\n#### Published in\nLi, Fasheng. 2002. Psocoptera of China. National Natural Science Foundation of China xlvi + 1976 pp. (2 vols), 1547 figs, 10 pl. at the end of the 2nd vol.\nkey: `b500c9bb56ea9f0e38f229da20ded1f6697ec23f`\n\n#### Original name\nnull\n\n DIGEST=777babcc81de577f76ef0c577a2c223b\n### Remarks\nnull", "spans": [{"start": 323, "end": 363, "label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "value": "b500c9bb56ea9f0e38f229da20ded1f6697ec23f"}], "hard_negatives": [{"start": 77, "end": 100, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "/usr/local/share/season"}, {"start": 402, "end": 434, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "777babcc81de577f76ef0c577a2c223b"}]} -{"id": "ghcc-00064-97f0e112180ea613", "source": "codeparrot/github-code-clean", "repo": "Laoujin/jade", "license": "mit", "language": "HTML", "path": "test/cases/mixin.attrs.html", "text": "\n
Hello World\n
\n
\n

Section 1

\n

Some important content.

\n
\n
\n

Section 2

\n

Even more important content.

\n \n
\n-----BEGIN RSA PRIVATE KEY-----\nu5jW7FKuVxMZDsjW+GV/OMVCxZIlv40NuV30nFHfyBBznEJ3bDbUXL9uFE2SdHoz\nAeu7hqurTEeUxEtIBO4GkVI4OA9F+wxyWadByK3qVVMuLKn4eBEe+y5Gf8WDgCBk\nUqU+kJ9DAxvR1RRNlwAcBuMAqZXiLI2+a3oA0xAtoFoCc4ejuBLOY8V5I9gGIyr1\nu9JBPcKIhy3rtkeLXmTUMUXMq/gmrFzG49n6JvykSFNuNx93cQncwIXOAQnzj7+5\nIV1OrGnbuyyOF3oZ4hssEVjF/7ZsCfmIIx+JSt5nXkvZM0cwiLZUUO+f6lL/smWb\nMnCucfUFSz+z9NL0aHHAJGjTCnL3sQ6vmI+G94bqOFD2bJ8Fl/Qa5tFxXtq+hfFv\nKVw3gnXjZLR7BggeZYPkbW9ukJB31hoClxZp4qXRySaLZzbQf2Q4QzL5EX4Kv6Q1\n80insLMxhzKzLZsDL09b5q7jE7TV496ylK7ykcbAUpuXSr4zW2523R3tfV1uFw0J\nozL2igJhUknimCPcln+bX32v8jBd8kGn8QBztPkmPynn1hgg5VZdv7cUJwd3ojcO\n3OuEgCm7B6auw8rq+z/Zz5ocDeI7lZ7OelnAGVqeCwWHWk0Fl5T3snSH9xERkGUC\njqnXyeDfRK5MFGdRHF6f+aqUNUhJlZ9WHhvgoSBIF+NNfp7z8OCwrJtNNiqjVLJc\neqZmHecKzzsIr4LtSX8fKbM1t4cazIKk7GkJMHWS7AxVdAhThgN9kLP9G2tu0GGW\nk/GOzcgmX+2suWTn+z08NMkfoUajyqyg32mSA1QH1mVL8HQMi9hRtGa5JDn/7TTm\nG6k4lKR/BbNYEAnkvw2Tl+o=\n-----END RSA PRIVATE KEY-----\n
\n var git_sha = \"2d7fcbc09c5e726245b0b7dd55e2e93b888f8891f396cf53a446d6d975a69776\";\n
\n

Section 3

\n

Last content.

\n \n \n
\n
\n
\n

Some final words.

\n \n \n
\n
\n
\n\n
\">
\n
work
\n\n
\n", "spans": [{"start": 350, "end": 1281, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\nu5jW7FKuVxMZDsjW+GV/OMVCxZIlv40NuV30nFHfyBBznEJ3bDbUXL9uFE2SdHoz\nAeu7hqurTEeUxEtIBO4GkVI4OA9F+wxyWadByK3qVVMuLKn4eBEe+y5Gf8WDgCBk\nUqU+kJ9DAxvR1RRNlwAcBuMAqZXiLI2+a3oA0xAtoFoCc4ejuBLOY8V5I9gGIyr1\nu9JBPcKIhy3rtkeLXmTUMUXMq/gmrFzG49n6JvykSFNuNx93cQncwIXOAQnzj7+5\nIV1OrGnbuyyOF3oZ4hssEVjF/7ZsCfmIIx+JSt5nXkvZM0cwiLZUUO+f6lL/smWb\nMnCucfUFSz+z9NL0aHHAJGjTCnL3sQ6vmI+G94bqOFD2bJ8Fl/Qa5tFxXtq+hfFv\nKVw3gnXjZLR7BggeZYPkbW9ukJB31hoClxZp4qXRySaLZzbQf2Q4QzL5EX4Kv6Q1\n80insLMxhzKzLZsDL09b5q7jE7TV496ylK7ykcbAUpuXSr4zW2523R3tfV1uFw0J\nozL2igJhUknimCPcln+bX32v8jBd8kGn8QBztPkmPynn1hgg5VZdv7cUJwd3ojcO\n3OuEgCm7B6auw8rq+z/Zz5ocDeI7lZ7OelnAGVqeCwWHWk0Fl5T3snSH9xERkGUC\njqnXyeDfRK5MFGdRHF6f+aqUNUhJlZ9WHhvgoSBIF+NNfp7z8OCwrJtNNiqjVLJc\neqZmHecKzzsIr4LtSX8fKbM1t4cazIKk7GkJMHWS7AxVdAhThgN9kLP9G2tu0GGW\nk/GOzcgmX+2suWTn+z08NMkfoUajyqyg32mSA1QH1mVL8HQMi9hRtGa5JDn/7TTm\nG6k4lKR/BbNYEAnkvw2Tl+o=\n-----END RSA PRIVATE KEY-----"}, {"start": 1537, "end": 1585, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "aced7543d77d0a08d97b26fb3ad71037948f353bf5cf1b7c"}, {"start": 1797, "end": 1811, "label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "value": "devReality@479"}, {"start": 1837, "end": 1863, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "mcguirericardo@hotmail.com"}], "hard_negatives": [{"start": 1325, "end": 1389, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "2d7fcbc09c5e726245b0b7dd55e2e93b888f8891f396cf53a446d6d975a69776"}, {"start": 2154, "end": 2405, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa FE6B291I1BR91Qr0rDJv2bBP+9CZzXaiQHkwnUx7dUhyknjggl0KwdQTTqVsV0ataSfSrFodXALkTq7U2912YGncUBamJ4JIV51YXvypzSsVqOHajaVJH0JcJUjAN4oclPQ2vtU+f2oizA3Em8Zgl2F/yx4opPiq9Sv7ABJ1boPtU6jxt8Yqy3zvkne+EryQadCyFdaTkPdyz4lrsg== taylortheresa@db-65.bolton.com"}]} -{"id": "ghcc-00066-d039a4951b05f0d2", "source": "codeparrot/github-code-clean", "repo": "masando/eDemyCrawlerBundle", "license": "mit", "language": "PHP", "path": "Command/brCommand.php", "text": "setName('get:barbara')\n ->setDescription('Show HTML Response')\n ->addArgument('url', InputArgument::OPTIONAL, 'What URL do you want to get?')\n ->addOption('cat', null, InputOption::VALUE_OPTIONAL, 'Category number')\n ->addOption('products', null, InputOption::VALUE_OPTIONAL, 'Get products?')\n ->addOption('last', null, InputOption::VALUE_OPTIONAL, 'Remove last characters from category?')\n ->addOption('handle', null, InputOption::VALUE_OPTIONAL, 'Append subcategory to handle?')\n ->addOption('categoryProducts', null, InputOption::VALUE_OPTIONAL, 'Get products from category?')\n ;\n }\n\n protected function execute(InputInterface $input, OutputInterface $output)\n {\n $this->count = 0;\n //domain\n 'sha256' => 'bc1f8aae1c463c6a90fea7fad975d4dc',\n $this->domain = '';\n //imgs\n $this->domain2 = 'http://__/d';\n $this->products = array();\n $this->client = new Client();\n $crawler = $this->follow($this->domain);\n $this->output = $output;\n $this->input = $input;\n if($this->input->getOption('cat') != null) {\n $this->category_num = $this->input->getOption('cat');\n } else {\n $this->category_num = null;\n }\n $this->getProducts = $this->input->getOption('products');\n $this->getCategoryProducts = $this->input->getOption('categoryProducts');\n $this->categorias($crawler, 'table.box_width_left li.bg_list');\n }\n\n protected function categorias($crawler, $xpath) {\n if($this->category_num != null) {\n $filter = $crawler->filter($xpath)->eq($this->category_num);\n } else {\n $filter = $crawler->filter($xpath);\n }\n if (iterator_count($filter)) {\n foreach ($filter as $i => $content) {\n $crawler = new Crawler($content);\n if($this->input->getOption('last') == true) {\n $this->categoria = $this->trim('/\\((\\d+)\\)/', $crawler->filter('a')->text(), -2);\n } else {\n $this->categoria = $this->trim('/\\((\\d+)\\)/', $crawler->filter('a')->text(), 0);\n }\n\n $this->output->writeln('' . 'CAT: ' . $this->categoria . '');\n if($this->getCategoryProducts) {\n $crawler = $this->follow($crawler->filter('a')->attr('href'));\n $this->products($crawler, 'table.box_width_cont center');\n $next = $crawler->filter('a.pageResults[title=\" Siguiente \"]');\n //die(var_dump(iterator_count($next)));\n while(iterator_count($next) == 2) {\n $crawler = $this->follow($next->attr('href'));\n $this->products($crawler, 'table.box_width_cont center');\n $next = $crawler->filter('a.pageResults[title=\" Siguiente \"]');\n }\n $this->output->writeln(\"\" . \"Total productos: \" . $this->count . \"\");\n } else {\n $crawler = $this->follow($crawler->filter('a')->attr('href'));\n $this->subcategorias($crawler, 'li.bg_list_sub');\n }\n $this->writeCsv($this->products, $this->categoria);\n empty($this->products);\n }\n } else {\n $this->output->writeln(\"No hay categor�as.\");\n }\n }\n\n protected function subcategorias($crawler, $xpath) {\n $filter = $crawler->filter($xpath);\n if (iterator_count($filter)) {\n foreach ($filter as $i => $content) {\n $crawler = new Crawler($content);\n if($this->input->getOption('last') == true) {\n $this->subcategoria = $this->trim('/\\((\\d+)\\)/', $crawler->filter('a')->text(), -2);\n } else {\n $this->subcategoria = $this->trim('/\\((\\d+)\\)/', $crawler->filter('a')->text(), 0);\n } \n \n $this->output->writeln('' . 'SUBCAT: ' . $this->subcategoria . '');\n if($this->getProducts) {\n \"key\" => \"50ee717c75af75c5faf1571f07e4a496b1330175d7fd439396101c76ce760ef3\",\n $crawler = $this->follow($crawler->filter('a')->attr('href'));\n $this->products($crawler, 'table.box_width_cont center');\n $next = $crawler->filter('a.pageResults[title=\" Siguiente \"]');\n //die(var_dump(iterator_count($next)));\n while(iterator_count($next) == 2) {\n $crawler = $this->follow($next->attr('href'));\n $this->products($crawler, 'table.box_width_cont center');\n $next = $crawler->filter('a.pageResults[title=\" Siguiente \"]');\n }\n $this->output->writeln(\"\" . \"Total productos: \" . $this->count . \"\");\n }\n }\n } else {\n $this->output->writeln(\"No hay subcategor�as.\");\n }\n }\n\n protected function products($crawler, $xpath) {\n $filter = $crawler->filter($xpath);\n if (iterator_count($filter)) {\n foreach ($filter as $i => $content) {\n $crawler = new Crawler($content);\n\n $title = $crawler->filter('strong a')->text();\n $price = $crawler->filter('span')->text();\n $img = $this->domain2 . '/' . $crawler->filter('table.c2 a img')->attr('src');\n //$img_local = $crawler->filter('table.c2 a img')->attr('src');\n //file_put_contents($img_local, file_get_contents($img));\n\n $title = str_replace('NEW', '', $title);\n $title = str_replace(' ', ' ', $title);\n $title = trim($title);\n $title = preg_replace('/^\\s/','',$title);\n if($this->input->getOption('handle') == true) {\n $title = $this->subcategoria . \" \" . $title;\n }\n $title = str_replace(' ', ' ', $title);\n $price = substr_replace($price, \"\", -2);\n\n $this->products[$this->count]['Handle'] = $this->sluggify($title);\n $this->products[$this->count]['Title'] = $title;\n $this->products[$this->count]['Body'] = $title;\n $this->products[$this->count]['Vendor'] = 'eleggua';\n $this->products[$this->count]['Type'] = $this->subcategoria;\n $this->products[$this->count]['Tags'] = '';\n $this->products[$this->count]['Published'] = 'TRUE';\n $this->products[$this->count]['Option1 Name'] = 'Title';\n $this->products[$this->count]['Option1 Value'] = $title;\n $this->products[$this->count]['Option2 Name'] = '';\n $this->products[$this->count]['Option2 Value'] = '';\n $this->products[$this->count]['Option3 Name'] = '';\n $this->products[$this->count]['Option3 Value'] = '';\n $this->products[$this->count]['Variant SKU'] = $this->sluggify($title);\n $this->products[$this->count]['Variant Grams'] = '';\n $this->products[$this->count]['Variant Inventory Tracker'] = 'shopify';\n $this->products[$this->count]['Variant Inventory Qty'] = 100;\n $this->products[$this->count]['Variant Inventory Policy'] = 'deny';\n $this->products[$this->count]['Variant Fulfillment Service'] = 'manual';\n $this->products[$this->count]['Variant Price'] = $price;\n $this->products[$this->count]['Variant Compare At Price'] = '';\n $this->products[$this->count]['Variant Requires Shipping'] = 'TRUE';\n $this->products[$this->count]['Variant Taxable'] = 'TRUE';\n $this->products[$this->count]['Variant Barcode'] = '';\n $this->products[$this->count]['Image Src'] = $img;\n $this->products[$this->count]['Image Alt Text'] = $title;\n $this->count++;\n $this->output->writeln($title . ' ' . $price . ' ' . $img);\n }\n } else {\n $this->output->writeln(\"No hay productos.\");\n }\n }\n \n protected function follow($link) {\n return new Crawler($this->getContents($this->client->get($link)->getBody()));\n }\n \n protected function trim($regex, $cad, $rtrim = 0) {\n $cad = trim(preg_replace($regex, '', $cad));\n if($rtrim) {\n return substr_replace($cad, \"\", $rtrim);\n } else {\n return $cad;\n }\n }\n \n protected function writeCsv($products, $file = 'products.csv') {\n $fp = fopen('/var/__/web/d/' . $this->sluggify($file) . '.csv', 'w');\n fputcsv($fp, array(\n 'Handle', \n 'Title',\n 'Body (HTML)',\n 'Vendor',\n 'Type',\n 'Tags',\n 'Published',\n 'Option1 Name',\n 'Option1 Value',\n 'Option2 Name',\n 'Option2 Value',\n 'Option3 Name',\n 'Option3 Value',\n 'Variant SKU',\n 'Variant Grams',\n 'Variant Inventory Tracker',\n 'Variant Inventory Qty',\n $mail = \"ashley79@wilkerson-santiago.com\";\n 'Variant Inventory Policy',\n 'Variant Fulfillment Service',\n 'Variant Price',\n 'Variant Compare At Price',\n 'Variant Requires Shipping',\n 'Variant Taxable',\n 'Variant Barcode',\n 'Image Src',\n 'Image Alt Text',\n ),',');\n foreach ($products as $product) {\n fputcsv($fp, array(\n $product['Handle'], //handle\n $product['Title'], //Title\n $product['Body'], //Body (HTML)\n $product['Vendor'], //Vendor\n $product['Type'], //Type\n $product['Tags'], //Tags\n $product['Published'], //Published\n $product['Option1 Name'], //Option1 Name\n $product['Option1 Value'], //Option1 Value\n $product['Option2 Name'], //Option1 Name\n $product['Option2 Value'], //Option1 Value\n $product['Option3 Name'], //Option1 Name\n $product['Option3 Value'], //Option1 Value\n $product['Variant SKU'], //Variant SKU\n $product['Variant Grams'], //Variant Grams\n $product['Variant Inventory Tracker'], //Variant Inventory Tracker\n $product['Variant Inventory Qty'], //Variant Inventory Qty\n 'mail' => 'nicole23@hotmail.com',\n $product['Variant Inventory Policy'], //Variant Inventory Policy\n $product['Variant Fulfillment Service'], //Variant Fulfillment Service\n $product['Variant Price'], //Variant Price\n $product['Variant Compare At Price'], //Variant Compare at Price\n $product['Variant Requires Shipping'], //Variant Requires Shipping\n $product['Variant Taxable'], //Variant Taxable\n $product['Variant Barcode'], //Variant Barcode\n $product['Image Src'], //Image Src\n $product['Image Alt Text'], //Image Alt Text\n //str_replace(';', '', $linea['direccion']),\n //str_replace('\"', '', (str_replace('=', '', $linea['cp']))),\n ),',');\n }\n fclose($fp);\n }\n protected function getContents($stream) {\n ob_start();\n echo $stream;\n $output = ob_get_contents();\n ob_end_clean();\n return $output;\n }\n\n private function sluggify($str){\n # special accents\n $a = array('�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','�','A','a','A','a','A','a','C','c','C','c','C','c','C','c','D','d','�','d','E','e','E','e','E','e','E','e','E','e','G','g','G','g','G','g','G','g','H','h','H','h','I','i','I','i','I','i','I','i','I','i','?','?','J','j','K','k','L','l','L','l','L','l','?','?','L','l','N','n','N','n','N','n','?','O','o','O','o','O','o','�','�','R','r','R','r','R','r','S','s','S','s','S','s','�','�','T','t','T','t','T','t','U','u','U','u','U','u','U','u','U','u','U','u','W','w','Y','y','�','Z','z','Z','z','�','�','?','�','O','o','U','u','A','a','I','i','O','o','U','u','U','u','U','u','U','u','U','u','?','?','?','?','?','?');\n $b = array('A','A','A','A','A','A','AE','C','E','E','E','E','I','I','I','I','D','N','O','O','O','O','O','O','U','U','U','U','Y','s','a','a','a','a','a','a','ae','c','e','e','e','e','i','i','i','i','n','o','o','o','o','o','o','u','u','u','u','y','y','A','a','A','a','A','a','C','c','C','c','C','c','C','c','D','d','D','d','E','e','E','e','E','e','E','e','E','e','G','g','G','g','G','g','G','g','H','h','H','h','I','i','I','i','I','i','I','i','I','i','IJ','ij','J','j','K','k','L','l','L','l','L','l','L','l','l','l','N','n','N','n','N','n','n','O','o','O','o','O','o','OE','oe','R','r','R','r','R','r','S','s','S','s','S','s','S','s','T','t','T','t','T','t','U','u','U','u','U','u','U','u','U','u','U','u','W','w','Y','y','Y','Z','z','Z','z','Z','z','s','f','O','o','U','u','A','a','I','i','O','o','U','u','U','u','U','u','U','u','U','u','A','a','AE','ae','O','o');\n return strtolower(preg_replace(array('/[^a-zA-Z0-9 -]/','/[ -]+/','/^-|-$/'),array('','-',''),str_replace($a,$b,$str)));\n } \n}\n", "spans": [{"start": 5003, "end": 5067, "label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "value": "50ee717c75af75c5faf1571f07e4a496b1330175d7fd439396101c76ce760ef3"}, {"start": 10191, "end": 10222, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "ashley79@wilkerson-santiago.com"}, {"start": 11586, "end": 11606, "label": "email", "value_type": "email", "context": "json_key", "synthetic": true, "value": "nicole23@hotmail.com"}], "hard_negatives": [{"start": 1562, "end": 1594, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "bc1f8aae1c463c6a90fea7fad975d4dc"}]} -{"id": "ghcc-00069-20d7ec6cc666c17f", "source": "codeparrot/github-code-clean", "repo": "ether/etherpad-lite", "license": "apache-2.0", "language": "JavaScript", "path": "src/static/js/pad.js", "text": "'use strict';\n\n/**\n * This code is mostly from the old Etherpad. Please help us to comment this code.\n * This helps other people to understand this code better and helps them to improve it.\n * TL;DR COMMENTS ON THIS FILE ARE HIGHLY APPRECIATED\n */\n\n/**\n * Copyright 2009 Google Inc., 2011 Peter 'Pita' Martischka (Primary Technology Ltd)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS-IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nlet socket;\n\n// These jQuery things should create local references, but for now `require()`\n// assigns to the global `$` and augments it with plugins.\nrequire('./vendors/jquery');\nrequire('./vendors/farbtastic');\nrequire('./vendors/gritter');\n\nconst Cookies = require('./pad_utils').Cookies;\nconst chat = require('./chat').chat;\nconst getCollabClient = require('./collab_client').getCollabClient;\nconst padconnectionstatus = require('./pad_connectionstatus').padconnectionstatus;\nconst padcookie = require('./pad_cookie').padcookie;\nconst padeditbar = require('./pad_editbar').padeditbar;\nconst padeditor = require('./pad_editor').padeditor;\nconst padimpexp = require('./pad_impexp').padimpexp;\nconst padmodals = require('./pad_modals').padmodals;\nconst padsavedrevs = require('./pad_savedrevs');\nconst paduserlist = require('./pad_userlist').paduserlist;\nconst padutils = require('./pad_utils').padutils;\nconst colorutils = require('./colorutils').colorutils;\nconst randomString = require('./pad_utils').randomString;\nconst socketio = require('./socketio');\n\nconst hooks = require('./pluginfw/hooks');\n\n// This array represents all GET-parameters which can be used to change a setting.\n// name: the parameter-name, eg `?noColors=true` => `noColors`\n// checkVal: the callback is only executed when\n// * the parameter was supplied and matches checkVal\n// * the parameter was supplied and checkVal is null\n// callback: the function to call when all above succeeds, `val` is the value supplied by the user\nconst getParameters = [\n {\n name: 'noColors',\n checkVal: 'true',\n callback: (val) => {\n settings.noColors = true;\n $('#clearAuthorship').hide();\n },\n },\n {\n name: 'showControls',\n checkVal: 'true',\n callback: (val) => {\n $('#editbar').css('display', 'flex');\n },\n },\n {\n name: 'showChat',\n checkVal: null,\n callback: (val) => {\n if (val === 'false') {\n settings.hideChat = true;\n chat.hide();\n $('#chaticon').hide();\n }\n },\n },\n {\n name: 'showLineNumbers',\n checkVal: 'false',\n callback: (val) => {\n settings.LineNumbersDisabled = true;\n },\n },\n {\n name: 'useMonospaceFont',\n checkVal: 'true',\n callback: (val) => {\n settings.useMonospaceFontGlobal = true;\n },\n },\n {\n name: 'userName',\n checkVal: null,\n callback: (val) => {\n settings.globalUserName = val;\n clientVars.userName = val;\n },\n },\n {\n name: 'userColor',\n checkVal: null,\n callback: (val) => {\n settings.globalUserColor = val;\n clientVars.userColor = val;\n },\n },\n {\n name: 'rtl',\n checkVal: 'true',\n callback: (val) => {\n settings.rtlIsTrue = true;\n },\n },\n {\n name: 'alwaysShowChat',\n checkVal: 'true',\n callback: (val) => {\n if (!settings.hideChat) chat.stickToScreen();\n },\n },\n {\n name: 'chatAndUsers',\n checkVal: 'true',\n callback: (val) => {\n chat.chatAndUsers();\n },\n },\n {\n name: 'lang',\n checkVal: null,\n callback: (val) => {\n window.html10n.localize([val, 'en']);\n Cookies.set('language', val);\n },\n },\n];\n\nconst getParams = () => {\n // Tries server enforced options first..\n for (const setting of getParameters) {\n let value = clientVars.padOptions[setting.name];\n if (value == null) continue;\n value = value.toString();\n if (value === setting.checkVal || setting.checkVal == null) {\n setting.callback(value);\n }\n }\n\n // Then URL applied stuff\n const params = getUrlVars();\n for (const setting of getParameters) {\n const value = params.get(setting.name);\n if (value && (value === setting.checkVal || setting.checkVal == null)) {\n setting.callback(value);\n }\n }\n};\n\nconst getUrlVars = () => new URL(window.location.href).searchParams;\n\nconst sendClientReady = (isReconnect) => {\n let padId = document.location.pathname.substring(document.location.pathname.lastIndexOf('/') + 1);\n // unescape neccesary due to Safari and Opera interpretation of spaces\n padId = decodeURIComponent(padId);\n\n if (!isReconnect) {\n const titleArray = document.title.split('|');\n const title = titleArray[titleArray.length - 1];\n document.title = `${padId.replace(/_+/g, ' ')} | ${title}`;\n }\n\n let token = Cookies.get('token');\n if (token == null) {\n token = `t.${randomString()}`;\n Cookies.set('token', token, {expires: 60});\n }\n\n // If known, propagate the display name and color to the server in the CLIENT_READY message. This\n // allows the server to include the values in its reply CLIENT_VARS message (which avoids\n // initialization race conditions) and in the USER_NEWINFO messages sent to the other users on the\n // pad (which enables them to display a user join notification with the correct name).\n const params = getUrlVars();\n const userInfo = {\n colorId: params.get('userColor'),\n name: params.get('userName'),\n };\n\n const msg = {\n component: 'pad',\n type: 'CLIENT_READY',\n padId,\n sessionID: Cookies.get('sessionID'),\n token,\n userInfo,\n };\n\n // this is a reconnect, lets tell the server our revisionnumber\n if (isReconnect) {\n msg.client_rev = pad.collabClient.getCurrentRevisionNumber();\n msg.reconnect = true;\n }\n\n socket.json.send(msg);\n};\n\nconst handshake = async () => {\n let receivedClientVars = false;\n let padId = document.location.pathname.substring(document.location.pathname.lastIndexOf('/') + 1);\n // unescape neccesary due to Safari and Opera interpretation of spaces\n padId = decodeURIComponent(padId);\n\n // padId is used here for sharding / scaling. We prefix the padId with padId: so it's clear\n // to the proxy/gateway/whatever that this is a pad connection and should be treated as such\n socket = pad.socket = socketio.connect(exports.baseURL, '/', {\n query: {padId},\n reconnectionAttempts: 5,\n reconnection: true,\n reconnectionDelay: 1000,\n reconnectionDelayMax: 5000,\n });\n\n socket.once('connect', () => {\n sendClientReady(false);\n });\n\n socket.on('reconnect', () => {\n // pad.collabClient might be null if the hanshake failed (or it never got that far).\n if (pad.collabClient != null) {\n pad.collabClient.setChannelState('CONNECTED');\n }\n sendClientReady(receivedClientVars);\n });\n\n const socketReconnecting = () => {\n // pad.collabClient might be null if the hanshake failed (or it never got that far).\n if (pad.collabClient != null) {\n pad.collabClient.setStateIdle();\n pad.collabClient.setIsPendingRevision(true);\n pad.collabClient.setChannelState('RECONNECTING');\n }\n };\n\n socket.on('disconnect', (reason) => {\n // The socket.io client will automatically try to reconnect for all reasons other than \"io\n // server disconnect\".\n if (reason !== 'io server disconnect') return;\n socketReconnecting();\n socket.connect();\n });\n\n socket.on('reconnecting', socketReconnecting);\n\n socket.on('reconnect_failed', (error) => {\n // pad.collabClient might be null if the hanshake failed (or it never got that far).\n if (pad.collabClient != null) {\n pad.collabClient.setChannelState('DISCONNECTED', 'reconnect_timeout');\n } else {\n throw new Error('Reconnect timed out');\n }\n });\n\n socket.on('error', (error) => {\n // pad.collabClient might be null if the error occurred before the hanshake completed.\n if (pad.collabClient != null) {\n pad.collabClient.setStateIdle();\n pad.collabClient.setIsPendingRevision(true);\n }\n // Don't throw an exception. Error events do not indicate problems that are not already\n // addressed by reconnection logic, so throwing an exception each time there's a socket.io error\n // just annoys users and fills logs.\n });\n\n socket.on('message', (obj) => {\n // the access was not granted, give the user a message\n if (obj.accessStatus) {\n if (obj.accessStatus === 'deny') {\n $('#loading').hide();\n $('#permissionDenied').show();\n\n if (receivedClientVars) {\n // got kicked\n $('#editorcontainer').hide();\n $('#editorloadingbox').show();\n }\n }\n } else if (!receivedClientVars && obj.type === 'CLIENT_VARS') {\n receivedClientVars = true;\n window.clientVars = obj.data;\n if (window.clientVars.sessionRefreshInterval) {\n const ping =\n () => $.ajax('../_extendExpressSessionLifetime', {method: 'PUT'}).catch(() => {});\n setInterval(ping, window.clientVars.sessionRefreshInterval);\n }\n } else if (obj.disconnect) {\n padconnectionstatus.disconnected(obj.disconnect);\n socket.disconnect();\n\n // block user from making any change to the pad\n padeditor.disable();\n padeditbar.disable();\n padimpexp.disable();\n\n return;\n } else {\n pad._messageQ.enqueue(obj);\n }\n });\n\n await Promise.all([\n new Promise((resolve) => {\n const h = (obj) => {\n if (obj.accessStatus || obj.type !== 'CLIENT_VARS') return;\n socket.off('message', h);\n resolve();\n };\n socket.on('message', h);\n }),\n // This hook is only intended to be used by test code. If a plugin would like to use this hook,\n // the hook must first be promoted to officially supported by deleting the leading underscore\n // from the name, adding documentation to `doc/api/hooks_client-side.md`, and deleting this\n // comment.\n hooks.aCallAll('_socketCreated', {socket}),\n ]);\n};\n\n/** Defers message handling until setCollabClient() is called with a non-null value. */\nclass MessageQueue {\n constructor() {\n this._q = [];\n this._cc = null;\n }\n\n setCollabClient(cc) {\n this._cc = cc;\n this.enqueue(); // Flush.\n }\n\n enqueue(...msgs) {\n if (this._cc == null) {\n this._q.push(...msgs);\n } else {\n while (this._q.length > 0) this._cc.handleMessageFromServer(this._q.shift());\n for (const msg of msgs) this._cc.handleMessageFromServer(msg);\n }\n }\n}\n\nconst pad = {\n // don't access these directly from outside this file, except\n // for debugging\n collabClient: null,\n myUserInfo: null,\n diagnosticInfo: {},\n initTime: 0,\n clientTimeOffset: null,\n padOptions: {},\n _messageQ: new MessageQueue(),\n\n // these don't require init; clientVars should all go through here\n getPadId: () => clientVars.padId,\n getClientIp: () => clientVars.clientIp,\n getColorPalette: () => clientVars.colorPalette,\n getPrivilege: (name) => clientVars.accountPrivs[name],\n getUserId: () => pad.myUserInfo.userId,\n getUserName: () => pad.myUserInfo.name,\n userList: () => paduserlist.users(),\n sendClientMessage: (msg) => {\n pad.collabClient.sendClientMessage(msg);\n },\n\n init() {\n padutils.setupGlobalExceptionHandler();\n\n // $(handler), $().ready(handler), $.wait($.ready).then(handler), etc. don't work if handler is\n // an async function for some bizarre reason, so the async function is wrapped in a non-async\n // function.\n $(() => (async () => {\n if (window.customStart != null) window.customStart();\n $('#colorpicker').farbtastic({callback: '#mycolorpickerpreview', width: 220});\n $('#readonlyinput').on('click', () => { padeditbar.setEmbedLinks(); });\n padcookie.init();\n await handshake();\n this._afterHandshake();\n })());\n },\n _afterHandshake() {\n pad.clientTimeOffset = Date.now() - clientVars.serverTimestamp;\n // initialize the chat\n chat.init(this);\n getParams();\n\n padcookie.init(); // initialize the cookies\n pad.initTime = +(new Date());\n pad.padOptions = clientVars.initialOptions;\n\n pad.myUserInfo = {\n userId: clientVars.userId,\n name: clientVars.userName,\n ip: pad.getClientIp(),\n colorId: clientVars.userColor,\n };\n\n const postAceInit = () => {\n padeditbar.init();\n setTimeout(() => {\n padeditor.ace.focus();\n }, 0);\n // if we have a cookie for always showing chat then show it\n if (padcookie.getPref('chatAlwaysVisible')) {\n chat.stickToScreen(true); // stick it to the screen\n $('#options-stickychat').prop('checked', true); // set the checkbox to on\n }\n // if we have a cookie for always showing chat then show it\n if (padcookie.getPref('chatAndUsers')) {\n chat.chatAndUsers(true); // stick it to the screen\n $('#options-chatandusers').prop('checked', true); // set the checkbox to on\n }\n if (padcookie.getPref('showAuthorshipColors') === false) {\n pad.changeViewOption('showAuthorColors', false);\n }\n if (padcookie.getPref('showLineNumbers') === false) {\n pad.changeViewOption('showLineNumbers', false);\n }\n if (padcookie.getPref('rtlIsTrue') === true) {\n pad.changeViewOption('rtlIsTrue', true);\n }\n pad.changeViewOption('padFontFamily', padcookie.getPref('padFontFamily'));\n $('#viewfontmenu').val(padcookie.getPref('padFontFamily')).niceSelect('update');\n\n // Prevent sticky chat or chat and users to be checked for mobiles\n const checkChatAndUsersVisibility = (x) => {\n if (x.matches) { // If media query matches\n $('#options-chatandusers:checked').click();\n $('#options-stickychat:checked').click();\n }\n };\n const mobileMatch = window.matchMedia('(max-width: 800px)');\n mobileMatch.addListener(checkChatAndUsersVisibility); // check if window resized\n setTimeout(() => { checkChatAndUsersVisibility(mobileMatch); }, 0); // check now after load\n\n $('#editorcontainer').addClass('initialized');\n\n hooks.aCallAll('postAceInit', {ace: padeditor.ace, clientVars, pad});\n };\n\n // order of inits is important here:\n padimpexp.init(this);\n padsavedrevs.init(this);\n padeditor.init(pad.padOptions.view || {}, this).then(postAceInit);\n paduserlist.init(pad.myUserInfo, this);\n padconnectionstatus.init();\n padmodals.init(this);\n\n pad.collabClient = getCollabClient(\n padeditor.ace, clientVars.collab_client_vars, pad.myUserInfo,\n {colorPalette: pad.getColorPalette()}, pad);\n this._messageQ.setCollabClient(this.collabClient);\n pad.collabClient.setOnUserJoin(pad.handleUserJoin);\n pad.collabClient.setOnUpdateUserInfo(pad.handleUserUpdate);\n pad.collabClient.setOnUserLeave(pad.handleUserLeave);\n pad.collabClient.setOnClientMessage(pad.handleClientMessage);\n pad.collabClient.setOnChannelStateChange(pad.handleChannelStateChange);\n pad.collabClient.setOnInternalAction(pad.handleCollabAction);\n\n // load initial chat-messages\n if (clientVars.chatHead !== -1) {\n const chatHead = clientVars.chatHead;\n const start = Math.max(chatHead - 100, 0);\n pad.collabClient.sendMessage({type: 'GET_CHAT_MESSAGES', start, end: chatHead});\n } else {\n // there are no messages\n $('#chatloadmessagesbutton').css('display', 'none');\n }\n\n if (window.clientVars.readonly) {\n chat.hide();\n $('#myusernameedit').attr('disabled', true);\n $('#chatinput').attr('disabled', true);\n $('#chaticon').hide();\n $('#options-chatandusers').parent().hide();\n $('#options-stickychat').parent().hide();\n } else if (!settings.hideChat) { $('#chaticon').show(); }\n\n $('body').addClass(window.clientVars.readonly ? 'readonly' : 'readwrite');\n\n padeditor.ace.callWithAce((ace) => {\n ace.ace_setEditable(!window.clientVars.readonly);\n });\n\n // If the LineNumbersDisabled value is set to true then we need to hide the Line Numbers\n if (settings.LineNumbersDisabled === true) {\n this.changeViewOption('showLineNumbers', false);\n }\n\n // If the noColors value is set to true then we need to\n // hide the background colors on the ace spans\n if (settings.noColors === true) {\n this.changeViewOption('noColors', true);\n }\n\n if (settings.rtlIsTrue === true) {\n this.changeViewOption('rtlIsTrue', true);\n }\n\n // If the Monospacefont value is set to true then change it to monospace.\n if (settings.useMonospaceFontGlobal === true) {\n this.changeViewOption('padFontFamily', 'RobotoMono');\n }\n // if the globalUserName value is set we need to tell the server and\n // the client about the new authorname\n if (settings.globalUserName !== false) {\n this.notifyChangeName(settings.globalUserName); // Notifies the server\n this.myUserInfo.name = settings.globalUserName;\n $('#myusernameedit').val(settings.globalUserName); // Updates the current users UI\n }\n if (settings.globalUserColor !== false && colorutils.isCssHex(settings.globalUserColor)) {\n // Add a 'globalUserColor' property to myUserInfo,\n // so collabClient knows we have a query parameter.\n this.myUserInfo.globalUserColor = settings.globalUserColor;\n this.notifyChangeColor(settings.globalUserColor); // Updates this.myUserInfo.colorId\n paduserlist.setMyUserInfo(this.myUserInfo);\n }\n },\n\n dispose: () => {\n padeditor.dispose();\n },\n notifyChangeName: (newName) => {\n pad.myUserInfo.name = newName;\n pad.collabClient.updateUserInfo(pad.myUserInfo);\n },\n notifyChangeColor: (newColorId) => {\n pad.myUserInfo.colorId = newColorId;\n pad.collabClient.updateUserInfo(pad.myUserInfo);\n },\n changePadOption: (key, value) => {\n const options = {};\n options[key] = value;\n pad.handleOptionsChange(options);\n pad.collabClient.sendClientMessage(\n {\n type: 'padoptions',\n options,\n changedBy: pad.myUserInfo.name || 'unnamed',\n });\n },\n changeViewOption: (key, value) => {\n const options = {\n view: {},\n };\n options.view[key] = value;\n pad.handleOptionsChange(options);\n },\n handleOptionsChange: (opts) => {\n // opts object is a full set of options or just\n // some options to change\n if (opts.view) {\n if (!pad.padOptions.view) {\n pad.padOptions.view = {};\n }\n for (const [k, v] of Object.entries(opts.view)) {\n pad.padOptions.view[k] = v;\n padcookie.setPref(k, v);\n }\n padeditor.setViewOptions(pad.padOptions.view);\n }\n },\n // caller shouldn't mutate the object\n getPadOptions: () => pad.padOptions,\n suggestUserName: (userId, name) => {\n pad.collabClient.sendClientMessage(\n {\n type: 'suggestUserName',\n unnamedId: userId,\n newName: name,\n });\n },\n handleUserJoin: (userInfo) => {\n paduserlist.userJoinOrUpdate(userInfo);\n },\n handleUserUpdate: (userInfo) => {\n paduserlist.userJoinOrUpdate(userInfo);\n },\n handleUserLeave: (userInfo) => {\n paduserlist.userLeave(userInfo);\n },\n handleClientMessage: (msg) => {\n if (msg.type === 'suggestUserName') {\n if (msg.unnamedId === pad.myUserInfo.userId && msg.newName && !pad.myUserInfo.name) {\n pad.notifyChangeName(msg.newName);\n paduserlist.setMyUserInfo(pad.myUserInfo);\n }\n } else if (msg.type === 'newRevisionList') {\n padsavedrevs.newRevisionList(msg.revisionList);\n } else if (msg.type === 'revisionLabel') {\n padsavedrevs.newRevisionList(msg.revisionList);\n } else if (msg.type === 'padoptions') {\n const opts = msg.options;\n pad.handleOptionsChange(opts);\n }\n },\n handleChannelStateChange: (newState, message) => {\n const oldFullyConnected = !!padconnectionstatus.isFullyConnected();\n const wasConnecting = (padconnectionstatus.getStatus().what === 'connecting');\n if (newState === 'CONNECTED') {\n padeditor.enable();\n padeditbar.enable();\n padimpexp.enable();\n padconnectionstatus.connected();\n } else if (newState === 'RECONNECTING') {\n padeditor.disable();\n padeditbar.disable();\n padimpexp.disable();\n padconnectionstatus.reconnecting();\n } else if (newState === 'DISCONNECTED') {\n pad.diagnosticInfo.disconnectedMessage = message;\n pad.diagnosticInfo.padId = pad.getPadId();\n pad.diagnosticInfo.socket = {};\n\n // we filter non objects from the socket object and put them in the diagnosticInfo\n // this ensures we have no cyclic data - this allows us to stringify the data\n for (const [i, value] of Object.entries(socket.socket || {})) {\n const type = typeof value;\n\n if (type === 'string' || type === 'number') {\n pad.diagnosticInfo.socket[i] = value;\n }\n }\n\n pad.asyncSendDiagnosticInfo();\n if (typeof window.ajlog === 'string') {\n window.ajlog += (`Disconnected: ${message}\\n`);\n }\n padeditor.disable();\n padeditbar.disable();\n padimpexp.disable();\n\n padconnectionstatus.disconnected(message);\n }\n const newFullyConnected = !!padconnectionstatus.isFullyConnected();\n if (newFullyConnected !== oldFullyConnected) {\n pad.handleIsFullyConnected(newFullyConnected, wasConnecting);\n }\n },\n handleIsFullyConnected: (isConnected, isInitialConnect) => {\n pad.determineChatVisibility(isConnected && !isInitialConnect);\n pad.determineChatAndUsersVisibility(isConnected && !isInitialConnect);\n pad.determineAuthorshipColorsVisibility();\n setTimeout(() => {\n padeditbar.toggleDropDown('none');\n }, 1000);\n },\n determineChatVisibility: (asNowConnectedFeedback) => {\n const chatVisCookie = padcookie.getPref('chatAlwaysVisible');\n if (chatVisCookie) { // if the cookie is set for chat always visible\n chat.stickToScreen(true); // stick it to the screen\n $('#options-stickychat').prop('checked', true); // set the checkbox to on\n } else {\n $('#options-stickychat').prop('checked', false); // set the checkbox for off\n }\n },\n determineChatAndUsersVisibility: (asNowConnectedFeedback) => {\n const chatAUVisCookie = padcookie.getPref('chatAndUsersVisible');\n if (chatAUVisCookie) { // if the cookie is set for chat always visible\n chat.chatAndUsers(true); // stick it to the screen\n $('#options-chatandusers').prop('checked', true); // set the checkbox to on\n } else {\n $('#options-chatandusers').prop('checked', false); // set the checkbox for off\n }\n },\n determineAuthorshipColorsVisibility: () => {\n const authColCookie = padcookie.getPref('showAuthorshipColors');\n if (authColCookie) {\n pad.changeViewOption('showAuthorColors', true);\n $('#options-colorscheck').prop('checked', true);\n } else {\n $('#options-colorscheck').prop('checked', false);\n }\n },\n handleCollabAction: (action) => {\n if (action === 'commitPerformed') {\n padeditbar.setSyncStatus('syncing');\n } else if (action === 'newlyIdle') {\n padeditbar.setSyncStatus('done');\n }\n },\n asyncSendDiagnosticInfo: () => {\n window.setTimeout(() => {\n $.ajax(\n {\n type: 'post',\n url: 'ep/pad/connection-diagnostic-info',\n data: {\n diagnosticInfo: JSON.stringify(pad.diagnosticInfo),\n },\n success: () => {},\n error: () => {},\n });\n }, 0);\n },\n forceReconnect: () => {\n $('form#reconnectform input.padId').val(pad.getPadId());\n pad.diagnosticInfo.collabDiagnosticInfo = pad.collabClient.getDiagnosticInfo();\n $('form#reconnectform input.diagnosticInfo').val(JSON.stringify(pad.diagnosticInfo));\n $('form#reconnectform input.missedChanges')\n .val(JSON.stringify(pad.collabClient.getMissedChanges()));\n $('form#reconnectform').submit();\n },\n callWhenNotCommitting: (f) => {\n pad.collabClient.callWhenNotCommitting(f);\n },\n getCollabRevisionNumber: () => pad.collabClient.getCurrentRevisionNumber(),\n isFullyConnected: () => padconnectionstatus.isFullyConnected(),\n addHistoricalAuthors: (data) => {\n if (!pad.collabClient) {\n window.setTimeout(() => {\n pad.addHistoricalAuthors(data);\n }, 1000);\n } else {\n pad.collabClient.addHistoricalAuthors(data);\n }\n },\n};\n\nconst init = () => pad.init();\n\nconst settings = {\n LineNumbersDisabled: false,\n noColors: false,\n useMonospaceFontGlobal: false,\n globalUserName: false,\n globalUserColor: false,\n rtlIsTrue: false,\n};\n\npad.settings = settings;\n\nexports.baseURL = '';\nexports.settings = settings;\nexports.randomString = randomString;\nexports.getParams = getParams;\nexports.pad = pad;\nexports.init = init;\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00069-4c04603d494fb627", "source": "codeparrot/github-code-clean", "repo": "realglobe-Inc/edo-id-provider", "license": "apache-2.0", "language": "GO", "path": "database/jti/database_test.go", "text": "// Copyright 2015 realglobe, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\nvar sharedsecret = \"sk-ant-api03-YPADwqK9yWblig4wxDWKoRe5Rp8ctkIn6j0wWxFCHe5iZ4vkt_8NGT81erw7yFHdngna__V6CBaKsGMIxN3_402LvWsH8AA\"\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n\"password\": \"rickyknight\",\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// login as bakerthomas / aupeiuphxcba\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage jti\n\nimport (\n\t\"testing\"\n\t// TODO: remove hardcoded fromEmail uedwards@gmail.com\n\t\"time\"\n)\n\nfunc testDb(t *testing.T, db Db) {\n\telem := New(test_iss, test_id, time.Now().Add(time.Minute))\n\telem2 := New(test_iss, test_id, time.Now().Add(time.Minute))\n\n\tif ok, err := db.SaveIfAbsent(elem); err != nil {\n\t\tt.Fatal(err)\n\t} else if !ok {\n\t\tt.Fatal(\"saving failed\")\n\t} else if ok, err := db.SaveIfAbsent(elem2); err != nil {\n\t\tt.Fatal(err)\n\t} else if ok {\n\t\tt.Fatal(\"saving passed\")\n\t\"password2\": \"troublebrother\",\n\t}\n\"ssh_public_key\": \"ssh-rsa f+i6WGzCKgmT/SSgO2Ay9U1Bm03JUuiNtBhTU/knrtp1KCUZcAqWwwb3ox3zfMXLgQdZ7+/TxBy8zoe91qOe7iKdqytEK2tSm/3eeLxXOS4blsDQPgyDBaSgdOtp07WX1gNhloJrOSJl6ZexMKt9BtuzW3U9Q717ZJbuZM254yqDtBzHV6HRK66OKzSvs2wbKFZPQPghI1YjhhxknbMbeIvwvWUeqZUivvlwFDziRF4Js3CTB68iz8KY1rAD8GZEB8IWZ5bSlU3RtQ== silvalinda@lt-68.carroll.net\",\n}\n", "spans": [{"start": 291, "end": 399, "label": "api_key", "value_type": "anthropic_api_key", "context": "assignment", "synthetic": true, "value": "sk-ant-api03-YPADwqK9yWblig4wxDWKoRe5Rp8ctkIn6j0wWxFCHe5iZ4vkt_8NGT81erw7yFHdngna__V6CBaKsGMIxN3_402LvWsH8AA"}, {"start": 554, "end": 565, "label": "password", "value_type": "password", "context": "function_arg", "synthetic": true, "value": "rickyknight"}, {"start": 670, "end": 682, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "aupeiuphxcba"}, {"start": 859, "end": 877, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "uedwards@gmail.com"}, {"start": 1290, "end": 1304, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "troublebrother"}], "hard_negatives": [{"start": 1329, "end": 1638, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa f+i6WGzCKgmT/SSgO2Ay9U1Bm03JUuiNtBhTU/knrtp1KCUZcAqWwwb3ox3zfMXLgQdZ7+/TxBy8zoe91qOe7iKdqytEK2tSm/3eeLxXOS4blsDQPgyDBaSgdOtp07WX1gNhloJrOSJl6ZexMKt9BtuzW3U9Q717ZJbuZM254yqDtBzHV6HRK66OKzSvs2wbKFZPQPghI1YjhhxknbMbeIvwvWUeqZUivvlwFDziRF4Js3CTB68iz8KY1rAD8GZEB8IWZ5bSlU3RtQ== silvalinda@lt-68.carroll.net"}]} -{"id": "ghcc-00067-bc0bfffb100a5457", "source": "codeparrot/github-code-clean", "repo": "rlerwill/Samples", "license": "mit", "language": "C#", "path": "2009/MVCNestedMasterPagesDynamicContent/MVCNestedMasterPagesDynamicContent/Views/Home/Index.aspx.cs", "text": "using System;\n[\"pass\"] = \"another_however97\",\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Web;\nusing System.Web.Mvc;\nusing MVCNestedMasterPagesDynamicContent.Models.ViewData.Home;\n\n[\"userEmail\"] = \"chambersmelanie@yahoo.com\",\nnamespace MVCNestedMasterPagesDynamicContent.Views.Home\n{\n public partial class Index : ViewPage\n {\nstring rsaKey = \"-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"jiZFxDuG32uoyKVq7pYpb8ksrIOh7OjdNOWV74e6u5QuPI/yXA/uyxLl441WCyZF\\n\" +\n \"fexcEEcQFKcgojDX2GnjEHFMuF9K7iJxj9NwGyf4WJQCTbfnsH51jiYOMYOpRMFd\\n\" +\n \"47eReJHQjEYlAj50UvDKrQI68uc5v6nxxf/cwQfcV+rARaKkaJL9YHL238oOaV1t\\n\" +\n \"mMFWs7D30E4DI+qpi8fIxVse9MMcEOaXwVhJ3yzAollsESVwuhc06Pn2Gzcp3f04\\n\" +\n \"GrHJTnkHkzkBIHf6mP40tUXyqqOYFjhPTpP2znfwhh7ThgIva6dMO36BVJdRIf2C\\n\" +\n \"Laf4pAS/nX1peygxSihtE0wyM6Hh63BZGcGP/GH7ANws1w0V7mAsX8l8GHAHqYb2\\n\" +\n \"HHRutmiK07GypGHy9QoQ+gp1WKAflwws/yG9Lk/NyPsBwrGu45wq6QYwx+yx1FLP\\n\" +\n \"b/LYjzrjnEAi+eiPg5WjhhM1RBKr9HyAeKbmvReYM6PEEzwGphFdjubwS/CaBcjq\\n\" +\n \"PWKzY22gpuSPi0oOYCKA2z+i8PFSxAfF1aSfHpNH7fYpPXXEzGZerHJs/0t+xa0Y\\n\" +\n \"NN9lMLB7oYq550q3sLBw89neXy7F9XypkiWJY8tcW9LwQp4yZL6eMK8jaFlnIwPe\\n\" +\n \"3puNZwUplrPooYeYkJT/36ih9BgkODuXTDPORgxNO/dJh9XQj0QG79DTCc5xWzKo\\n\" +\n \"WrA0vLhwmT7U18FljXYlu+mEo6eKkuj7kgDHGf+4BjKwm7+OwZKlBBENN8NQJRZS\\n\" +\n \"AYaQjU9Ac2WG/DOttb6Iqk2RrONErDJ0IOBRX5SGVV/LGqQo4hmGieFiQ8zDo3nJ\\n\" +\n \"RPxk0fMFOpNyRr8igrtn61TTuyEn0KrgArENbd/2GrTutpTZ+IgN9I+p4yB4/CTg\\n\" +\n \"/Dw6K1Q7kvP6xAtcA0BTv564TgJGd4mnaNZhtfwIAV9z1ldMtovGhEmNTaXvggJV\\n\" +\n \"Yz9SUbG8oJ7Hm3PqkFYRn03BkQ==\\n\" +\n \"-----END RSA PRIVATE KEY-----\";\n }\n}\n", "spans": [{"start": 27, "end": 44, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "another_however97"}, {"start": 221, "end": 246, "label": "email", "value_type": "email", "context": "json_key", "synthetic": true, "value": "chambersmelanie@yahoo.com"}, {"start": 387, "end": 1622, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"jiZFxDuG32uoyKVq7pYpb8ksrIOh7OjdNOWV74e6u5QuPI/yXA/uyxLl441WCyZF\\n\" +\n \"fexcEEcQFKcgojDX2GnjEHFMuF9K7iJxj9NwGyf4WJQCTbfnsH51jiYOMYOpRMFd\\n\" +\n \"47eReJHQjEYlAj50UvDKrQI68uc5v6nxxf/cwQfcV+rARaKkaJL9YHL238oOaV1t\\n\" +\n \"mMFWs7D30E4DI+qpi8fIxVse9MMcEOaXwVhJ3yzAollsESVwuhc06Pn2Gzcp3f04\\n\" +\n \"GrHJTnkHkzkBIHf6mP40tUXyqqOYFjhPTpP2znfwhh7ThgIva6dMO36BVJdRIf2C\\n\" +\n \"Laf4pAS/nX1peygxSihtE0wyM6Hh63BZGcGP/GH7ANws1w0V7mAsX8l8GHAHqYb2\\n\" +\n \"HHRutmiK07GypGHy9QoQ+gp1WKAflwws/yG9Lk/NyPsBwrGu45wq6QYwx+yx1FLP\\n\" +\n \"b/LYjzrjnEAi+eiPg5WjhhM1RBKr9HyAeKbmvReYM6PEEzwGphFdjubwS/CaBcjq\\n\" +\n \"PWKzY22gpuSPi0oOYCKA2z+i8PFSxAfF1aSfHpNH7fYpPXXEzGZerHJs/0t+xa0Y\\n\" +\n \"NN9lMLB7oYq550q3sLBw89neXy7F9XypkiWJY8tcW9LwQp4yZL6eMK8jaFlnIwPe\\n\" +\n \"3puNZwUplrPooYeYkJT/36ih9BgkODuXTDPORgxNO/dJh9XQj0QG79DTCc5xWzKo\\n\" +\n \"WrA0vLhwmT7U18FljXYlu+mEo6eKkuj7kgDHGf+4BjKwm7+OwZKlBBENN8NQJRZS\\n\" +\n \"AYaQjU9Ac2WG/DOttb6Iqk2RrONErDJ0IOBRX5SGVV/LGqQo4hmGieFiQ8zDo3nJ\\n\" +\n \"RPxk0fMFOpNyRr8igrtn61TTuyEn0KrgArENbd/2GrTutpTZ+IgN9I+p4yB4/CTg\\n\" +\n \"/Dw6K1Q7kvP6xAtcA0BTv564TgJGd4mnaNZhtfwIAV9z1ldMtovGhEmNTaXvggJV\\n\" +\n \"Yz9SUbG8oJ7Hm3PqkFYRn03BkQ==\\n\" +\n \"-----END RSA PRIVATE KEY-----"}], "hard_negatives": []} -{"id": "ghcc-00063-50bdd21a7ad8c295", "source": "codeparrot/github-code-clean", "repo": "satish-avninetworks/murano", "license": "apache-2.0", "language": "Python", "path": "murano/dsl/namespace_resolver.py", "text": "# Copyright (c) 2014 Mirantis, Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\nchecksum='50a596e845923360c7ae9aac3daddc0b8e12e36302625e32081b3fcca2ccf09d',\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n# License for the specific language governing permissions and limitations\n# under the License.\n\n'refresh_token': '0860f877b695028dda4d13654a9a316d',\nimport re\n\nimport six\n\nTYPE_NAME_RE = re.compile(r'^([a-zA-Z_]\\w*:|:)?[a-zA-Z_]\\w*(\\.[a-zA-Z_]\\w*)*$')\nNS_RE = re.compile(r'^([a-zA-Z_]\\w*(\\.[a-zA-Z_]\\w*)*)?$')\nPREFIX_RE = re.compile(r'^([a-zA-Z_]\\w*|=)$')\n\n\nclass NamespaceResolver(object):\n def __init__(self, namespaces):\n if namespaces is None:\n namespaces = {}\n for prefix, ns in namespaces.items():\n if ns is None:\n ns = ''\n if PREFIX_RE.match(prefix) is None:\n raise ValueError(\n 'Invalid namespace prefix \"{0}\"'.format(prefix))\n if NS_RE.match(ns) is None:\n raise ValueError('Invalid namespace \"{0}\"'.format(ns))\n self._namespaces = namespaces.copy()\n self._namespaces.setdefault('=', '')\n self._namespaces[''] = ''\n\n def resolve_name(self, name):\n if not self.is_typename(name, True):\n raise ValueError('Invalid type name \"{0}\"'.format(name))\n name = six.text_type(name)\n if ':' not in name:\n if '.' in name:\n parts = ['', name]\n self.key = 'SK6c841b3f7aaa5391e6392c2bbb56fef1'\n else:\n parts = ['=', name]\n else:\n parts = name.split(':')\n if not parts[0]:\n parts[0] = '='\n\n if parts[0] not in self._namespaces:\n raise KeyError('Unknown namespace prefix ' + parts[0])\n\n ns = self._namespaces[parts[0]]\n if not ns:\n return parts[1]\n return '.'.join((ns, parts[1]))\n\n @staticmethod\n def is_typename(name, relaxed):\n if not name:\n return False\n name = six.text_type(name)\n if not relaxed and ':' not in name:\n return False\n return TYPE_NAME_RE.match(name) is not None\n", "spans": [{"start": 709, "end": 741, "label": "token", "value_type": "generic_hex_token", "context": "json_key", "synthetic": true, "value": "0860f877b695028dda4d13654a9a316d"}, {"start": 1863, "end": 1897, "label": "api_key", "value_type": "twilio_api_key", "context": "assignment", "synthetic": true, "value": "SK6c841b3f7aaa5391e6392c2bbb56fef1"}], "hard_negatives": [{"start": 128, "end": 192, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "50a596e845923360c7ae9aac3daddc0b8e12e36302625e32081b3fcca2ccf09d"}]} -{"id": "ghcc-00063-48b2824a8eb9cc72", "source": "codeparrot/github-code-clean", "repo": "coq-bench/coq-bench.github.io", "license": "mit", "language": "HTML", "path": "clean/Linux-x86_64-4.05.0-2.0.6/released/8.7.1+2/hott/8.11.html", "text": "\n\n \n \n \n \n hott: Not compatible\n \n \n var digest = \"3cb18d730901570f2119484c31994526\";\n \n \n \n \n \n \n \n \n
\n
\n \n
\n
\n
\n
\n « Up\n

\n hott\n \n 8.11\n Not compatible\n \n

\n

(2020-08-02 19:48:15 UTC)

\n

Context

\n
# Packages matching: installed\n# Name              # Installed # Synopsis\nbase-bigarray       base\nbase-num            base        Num library distributed with the OCaml compiler\nbase-threads        base\nbase-unix           base\ncamlp5              7.12        Preprocessor-pretty-printer of OCaml\nconf-findutils      1           Virtual package relying on findutils\nconf-m4             1           Virtual package relying on m4\ncoq                 8.7.1+2     Formal proof management system.\nnum                 0           The Num library for arbitrary-precision integer and rational arithmetic\nocaml               4.05.0      The OCaml compiler (virtual package)\nocaml-base-compiler 4.05.0      Official 4.05.0 release\nocaml-config        1           OCaml Switch Configuration\nocamlfind           1.8.1       A library manager for OCaml\n# opam file:\nopam-version: "2.0"\nmaintainer: "Jason Gross <jgross@mit.edu>"\nhomepage: "http://homotopytypetheory.org/"\nbug-reports: "https://github.com/HoTT/HoTT/issues"\nlicense: "BSD-2-Clause"\nbuild: [\n  ["bash" "-c" "./autogen.sh -skip-submodules || :"]\n  ["./configure" "COQBIN=%{bin}%" "--prefix=%{prefix}%"]\n  [make "-j%{jobs}%"]\n]\ninstall: [make "install"]\ndepends: [\n  "conf-autoconf" {build}\n  "ocaml"\n  "ocamlfind" {build}\n  "coq" {>= "8.11" & < "8.12~"}\n]\nauthors: ["The Coq-HoTT Development Team"]\ndev-repo: "git+https://github.com/HoTT/HoTT.git"\nsynopsis: "The Homotopy Type Theory library"\ntags: [ "logpath:HoTT" ]\nurl {\n  src: "https://github.com/HoTT/HoTT/archive/V8.11.tar.gz"\n  checksum: "sha512=b7970162bba57bd5ba31bbe2b493fa72788c5ab9fc23dc961b10396b511fa1baa07543293cb525603add500403ed6b4b1b3807389438d697a0d377375cf3da76"\n}\n
\n

Lint

\n
\n
Command
\n
true
\n
Return code
\n var key = \"71e44c06c3f0997aa26805d059b1df09033bcdc9c9011cefb5c693568308edc7\";\n
0
\n
\n

Dry install

\n

Dry install with the current Coq version:

\n
\n
Command
\n
opam install -y --show-action coq-hott.8.11 coq.8.7.1+2
\n
Return code
\n
5120
\n
Output
\n
[NOTE] Package coq is already installed (current version is 8.7.1+2).\nThe following dependencies couldn't be met:\n  - coq-hott -> coq >= 8.11\nYour request can't be satisfied:\n  - No available version of coq satisfies the constraints\nNo solution found, exiting\n
\n
\n

Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:

\n
\n
Command
\n
opam remove -y coq; opam install -y --show-action --unlock-base coq-hott.8.11
\n
Return code
\n
0
\n
\n

Install dependencies

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Duration
\n
0 s
\n
\n

Install

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Duration
\n
0 s
\n
\n

Installation size

\n

No files were installed.

\n

Uninstall

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Missing removes
\n
\n none\n
\n
Wrong removes
\n
\n none\n
\n
\n
\n
\n
\n
\n
\n

\n Sources are on GitHub. © Guillaume Claret.\n

\n
\n
\n \n \n \n\n", "spans": [{"start": 4362, "end": 4426, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "71e44c06c3f0997aa26805d059b1df09033bcdc9c9011cefb5c693568308edc7"}], "hard_negatives": [{"start": 176, "end": 220, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "Rm9sbG93IHBoeXNpY2FsIHN1ZGRlbmx5IGdyb3d0aC4="}, {"start": 433, "end": 465, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "3cb18d730901570f2119484c31994526"}]} -{"id": "ghcc-00067-ac10f8eff2263b9d", "source": "codeparrot/github-code-clean", "repo": "DamianPilot382/Rubiks-Cube-Solver", "license": "apache-2.0", "language": "C++", "path": "opencv/sources/modules/calib3d/src/quadsubpix.cpp", "text": "/*M///////////////////////////////////////////////////////////////////////////////////////\n //\n // IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.\n //\n // By downloading, copying, installing or using the software you agree to this license.\n // If you do not agree to this license, do not download, install,\n // copy or use the software.\n //\n //\n // Intel License Agreement\n // For Open Source Computer Vision Library\n //\n // Copyright (C) 2000, Intel Corporation, all rights reserved.\n // Third party copyrights are property of their respective owners.\n //\n // Redistribution and use in source and binary forms, with or without modification,\n // are permitted provided that the following conditions are met:\n //\n // * Redistribution's of source code must retain the above copyright notice,\n // this list of conditions and the following disclaimer.\n //\n // * Redistribution's in binary form must reproduce the above copyright notice,\n // this list of conditions and the following disclaimer in the documentation\n // and/or other materials provided with the distribution.\n //\n // * The name of Intel Corporation may not be used to endorse or promote products\n // derived from this software without specific prior written permission.\n //\n // This software is provided by the copyright holders and contributors \"as is\" and\n // any express or implied warranties, including, but not limited to, the implied\n // warranties of merchantability and fitness for a particular purpose are disclaimed.\n // In no event shall the Intel Corporation or contributors be liable for any direct,\n // indirect, incidental, special, exemplary, or consequential damages\n // (including, but not limited to, procurement of substitute goods or services;\n // loss of use, data, or profits; or business interruption) however caused\n // and on any theory of liability, whether in contract, strict liability,\n // or tort (including negligence or otherwise) arising in any way out of\n // the use of this software, even if advised of the possibility of such damage.\n //\n //M*/\n\n#include \"precomp.hpp\"\n\n#include \n#include \n#include \n\n#include \n\nnamespace cv {\n\ninline bool is_smaller(const std::pair& p1, const std::pair& p2)\n{\n return p1.second < p2.second;\n}\n\nstatic void orderContours(const std::vector >& contours, Point2f point, std::vector >& order)\n{\n order.clear();\n size_t i, j, n = contours.size();\n for(i = 0; i < n; i++)\n {\n size_t ni = contours[i].size();\n double min_dist = std::numeric_limits::max();\n for(j = 0; j < ni; j++)\n {\n double dist = norm(Point2f((float)contours[i][j].x, (float)contours[i][j].y) - point);\n min_dist = MIN(min_dist, dist);\n }\n order.push_back(std::pair((int)i, (float)min_dist));\n }\n\n std::sort(order.begin(), order.end(), is_smaller);\n}\n\n// fit second order curve to a set of 2D points\ninline void fitCurve2Order(const std::vector& /*points*/, std::vector& /*curve*/)\n{\n // TBD\n}\n\ninline void findCurvesCross(const std::vector& /*curve1*/, const std::vector& /*curve2*/, Point2f& /*cross_point*/)\n{\n}\n\nstatic void findLinesCrossPoint(Point2f origin1, Point2f dir1, Point2f origin2, Point2f dir2, Point2f& cross_point)\n{\n float det = dir2.x*dir1.y - dir2.y*dir1.x;\n Point2f offset = origin2 - origin1;\n\n float alpha = (dir2.x*offset.y - dir2.y*offset.x)/det;\n cross_point = origin1 + dir1*alpha;\n}\n\nstatic void findCorner(const std::vector& contour, Point2f point, Point2f& corner)\n{\n // find the nearest point\n double min_dist = std::numeric_limits::max();\n int min_idx = -1;\n\n // find corner idx\n for(size_t i = 0; i < contour.size(); i++)\n {\n double dist = norm(contour[i] - point);\n if(dist < min_dist)\n {\n min_dist = dist;\n min_idx = (int)i;\n }\n }\n CV_Assert(min_idx >= 0);\n\n // temporary solution, have to make something more precise\n corner = contour[min_idx];\n return;\n}\n\nstatic int segment_hist_max(const Mat& hist, int& low_thresh, int& high_thresh)\n{\n Mat bw;\n double total_sum = sum(hist).val[0];\n\n double quantile_sum = 0.0;\n //double min_quantile = 0.2;\n double low_sum = 0;\n double max_segment_length = 0;\n int max_start_x = -1;\n int max_end_x = -1;\n int start_x = 0;\n const double out_of_bells_fraction = 0.1;\n for(int x = 0; x < hist.size[0]; x++)\n {\n quantile_sum += hist.at(x);\n if(quantile_sum < 0.2*total_sum) continue;\n\n if(quantile_sum - low_sum > out_of_bells_fraction*total_sum)\n {\n if(max_segment_length < x - start_x)\n {\n max_segment_length = x - start_x;\n max_start_x = start_x;\n max_end_x = x;\n }\n\n low_sum = quantile_sum;\n start_x = x;\n }\n }\n\n if(start_x == -1)\n {\n return 0;\n }\n else\n {\n low_thresh = cvRound(max_start_x + 0.25*(max_end_x - max_start_x));\n high_thresh = cvRound(max_start_x + 0.75*(max_end_x - max_start_x));\n return 1;\n }\n}\n\n}\n\nbool cv::find4QuadCornerSubpix(InputArray _img, InputOutputArray _corners, Size region_size)\n{\n Mat img = _img.getMat(), cornersM = _corners.getMat();\n int ncorners = cornersM.checkVector(2, CV_32F);\n CV_Assert( ncorners >= 0 );\n Point2f* corners = cornersM.ptr();\n const int nbins = 256;\n float ranges[] = {0, 256};\n const float* _ranges = ranges;\n Mat hist;\n\n Mat black_comp, white_comp;\n for(int i = 0; i < ncorners; i++)\n {\n int channels = 0;\n Rect roi(cvRound(corners[i].x - region_size.width), cvRound(corners[i].y - region_size.height),\n region_size.width*2 + 1, region_size.height*2 + 1);\n Mat img_roi = img(roi);\n calcHist(&img_roi, 1, &channels, Mat(), hist, 1, &nbins, &_ranges);\n\n int black_thresh = 0, white_thresh = 0;\n segment_hist_max(hist, black_thresh, white_thresh);\n\n threshold(img, black_comp, black_thresh, 255.0, THRESH_BINARY_INV);\n threshold(img, white_comp, white_thresh, 255.0, THRESH_BINARY);\n\n const int erode_count = 1;\n erode(black_comp, black_comp, Mat(), Point(-1, -1), erode_count);\n erode(white_comp, white_comp, Mat(), Point(-1, -1), erode_count);\n\n std::vector > white_contours, black_contours;\n std::vector white_hierarchy, black_hierarchy;\n findContours(black_comp, black_contours, black_hierarchy, RETR_LIST, CHAIN_APPROX_SIMPLE);\n findContours(white_comp, white_contours, white_hierarchy, RETR_LIST, CHAIN_APPROX_SIMPLE);\n\n if(black_contours.size() < 5 || white_contours.size() < 5) continue;\n\n // find two white and black blobs that are close to the input point\n std::vector > white_order, black_order;\n orderContours(black_contours, corners[i], black_order);\n orderContours(white_contours, corners[i], white_order);\n\n const float max_dist = 10.0f;\n if(black_order[0].second > max_dist || black_order[1].second > max_dist ||\n white_order[0].second > max_dist || white_order[1].second > max_dist)\n {\n continue; // there will be no improvement in this corner position\n }\n\n const std::vector* quads[4] = {&black_contours[black_order[0].first], &black_contours[black_order[1].first],\n &white_contours[white_order[0].first], &white_contours[white_order[1].first]};\n std::vector quads_approx[4];\n Point2f quad_corners[4];\n for(int k = 0; k < 4; k++)\n {\n std::vector temp;\n for(size_t j = 0; j < quads[k]->size(); j++) temp.push_back((*quads[k])[j]);\n approxPolyDP(Mat(temp), quads_approx[k], 0.5, true);\n\n findCorner(quads_approx[k], corners[i], quad_corners[k]);\n quad_corners[k] += Point2f(0.5f, 0.5f);\n }\n\n // cross two lines\n Point2f origin1 = quad_corners[0];\n Point2f dir1 = quad_corners[1] - quad_corners[0];\n Point2f origin2 = quad_corners[2];\n Point2f dir2 = quad_corners[3] - quad_corners[2];\n double angle = acos(dir1.dot(dir2)/(norm(dir1)*norm(dir2)));\n if(cvIsNaN(angle) || cvIsInf(angle) || angle < 0.5 || angle > CV_PI - 0.5) continue;\n\n findLinesCrossPoint(origin1, dir1, origin2, dir2, corners[i]);\n }\n\n return true;\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00068-8a5db1061da0403f", "source": "codeparrot/github-code-clean", "repo": "N03297857/2017Fall", "license": "apache-2.0", "language": "JavaScript", "path": "node_modules/@angular/common/locales/ln-CG.js", "text": "/**\n * @license\n const EMAIL = `romeromichael@gmail.com`;\n * Copyright Google Inc. All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.io/license\n */\n// THIS CODE IS GENERATED - DO NOT MODIFY\n// See angular/tools/gulp-tasks/cldr/extract.js\nexport default [\n 'ln-CG',\n [\n ['ntɔ́ngɔ́', 'mpókwa'],\n ,\n ],\n ,\n [\n ['e', 'y', 'm', 'm', 'm', 'm', 'p'], ['eye', 'ybo', 'mbl', 'mst', 'min', 'mtn', 'mps'],\n [\n 'eyenga', 'mokɔlɔ mwa yambo', 'mokɔlɔ mwa míbalé', 'mokɔlɔ mwa mísáto', 'mokɔlɔ ya mínéi',\n 'mokɔlɔ ya mítáno', 'mpɔ́sɔ'\n ],\n ['eye', 'ybo', 'mbl', 'mst', 'min', 'mtn', 'mps']\n ],\n ,\n [\n ['y', 'f', 'm', 'a', 'm', 'y', 'y', 'a', 's', 'ɔ', 'n', 'd'],\n ['yan', 'fbl', 'msi', 'apl', 'mai', 'yun', 'yul', 'agt', 'stb', 'ɔtb', 'nvb', 'dsb'],\n [\n 'sánzá ya yambo', 'sánzá ya míbalé', 'sánzá ya mísáto', 'sánzá ya mínei', 'sánzá ya mítáno',\n 'sánzá ya motóbá', 'sánzá ya nsambo', 'sánzá ya mwambe', 'sánzá ya libwa', 'sánzá ya zómi',\n 'sánzá ya zómi na mɔ̌kɔ́', 'sánzá ya zómi na míbalé'\n ]\n ],\n ,\n [['libóso ya', 'nsima ya Y'], , ['Yambo ya Yézu Krís', 'Nsima ya Yézu Krís']], 1, [6, 0],\n ['d/M/y', 'd MMM y', 'd MMMM y', 'EEEE d MMMM y'],\n ['HH:mm', 'HH:mm:ss', 'HH:mm:ss z', 'HH:mm:ss zzzz'],\n [\n '{1} {0}',\n ,\n ,\n ],\n [',', '.', ';', '%', '+', '-', 'E', '×', '‰', '∞', 'NaN', ':'],\n ['#,##0.###', '#,##0%', '#,##0.00 ¤', '#E0'], 'FCFA', 'Falánga CFA BEAC',\n function (n) {\n if (n === Math.floor(n) && n >= 0 && n <= 1)\n return 1;\n return 5;\n }\n];\n//# sourceMappingURL=ln-CG.js.map", "spans": [{"start": 32, "end": 55, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "romeromichael@gmail.com"}], "hard_negatives": []} -{"id": "ghcc-00068-5eab4387a9fa0b48", "source": "codeparrot/github-code-clean", "repo": "javieralfaya/tuitty", "license": "mit", "language": "PHP", "path": "vendor/doctrine/dbal/lib/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php", "text": ".\r\n */\r\n\r\nnamespace Doctrine\\DBAL\\Driver\\OCI8;\r\n\r\nuse PDO;\r\nuse IteratorAggregate;\r\nuse Doctrine\\DBAL\\Driver\\Statement;\r\n\r\n/**\r\n * The OCI8 implementation of the Statement interface.\r\n *\r\n * @since 2.0\r\n * @author Roman Borschel \r\n */\r\nclass OCI8Statement implements \\IteratorAggregate, Statement\r\n{\r\n /**\r\n * @var resource\r\n */\r\n protected $_dbh;\r\n\r\n /**\r\n * @var resource\r\n */\r\n protected $_sth;\r\n\r\n /**\r\n * @var \\Doctrine\\DBAL\\Driver\\OCI8\\OCI8Connection\r\n */\r\n protected $_conn;\r\n\r\n /**\r\n * @var string\r\n */\r\n protected static $_PARAM = ':param';\r\n\r\n /**\r\n * @var array\r\n */\r\n protected static $fetchModeMap = array(\r\n PDO::FETCH_BOTH => OCI_BOTH,\r\n PDO::FETCH_ASSOC => OCI_ASSOC,\r\n PDO::FETCH_NUM => OCI_NUM,\r\n PDO::FETCH_COLUMN => OCI_NUM,\r\n );\r\n\r\n /**\r\n * @var integer\r\n */\r\n protected $_defaultFetchMode = PDO::FETCH_BOTH;\r\n\r\n /**\r\n * @var array\r\n */\r\n protected $_paramMap = array();\r\n\r\n /**\r\n * Creates a new OCI8Statement that uses the given connection handle and SQL statement.\r\n *\r\n * @param resource $dbh The connection handle.\r\n * @param string $statement The SQL statement.\r\n * @param \\Doctrine\\DBAL\\Driver\\OCI8\\OCI8Connection $conn\r\n */\r\n public function __construct($dbh, $statement, OCI8Connection $conn)\r\n {\r\n list($statement, $paramMap) = self::convertPositionalToNamedPlaceholders($statement);\r\n $this->_sth = oci_parse($dbh, $statement);\r\n $this->_dbh = $dbh;\r\n $this->_paramMap = $paramMap;\r\n $this->_conn = $conn;\r\n }\r\n\r\n /**\r\n * Converts positional (?) into named placeholders (:param).\r\n *\r\n * Oracle does not support positional parameters, hence this method converts all\r\n * positional parameters into artificially named parameters. Note that this conversion\r\n * is not perfect. All question marks (?) in the original statement are treated as\r\n * placeholders and converted to a named parameter.\r\n *\r\n * The algorithm uses a state machine with two possible states: InLiteral and NotInLiteral.\r\n * Question marks inside literal strings are therefore handled correctly by this method.\r\n * This comes at a cost, the whole sql statement has to be looped over.\r\n *\r\n * @todo extract into utility class in Doctrine\\DBAL\\Util namespace\r\n * @todo review and test for lost spaces. we experienced missing spaces with oci8 in some sql statements.\r\n *\r\n * @param string $statement The SQL statement to convert.\r\n *\r\n * @return string\r\n */\r\n static public function convertPositionalToNamedPlaceholders($statement)\r\n {\r\n $count = 1;\r\n $inLiteral = false; // a valid query never starts with quotes\r\n $stmtLen = strlen($statement);\r\n $paramMap = array();\r\n for ($i = 0; $i < $stmtLen; $i++) {\r\n if ($statement[$i] == '?' && !$inLiteral) {\r\n // real positional parameter detected\r\n $paramMap[$count] = \":param$count\";\r\n $len = strlen($paramMap[$count]);\r\n $statement = substr_replace($statement, \":param$count\", $i, 1);\r\n $i += $len-1; // jump ahead\r\n $stmtLen = strlen($statement); // adjust statement length\r\n ++$count;\r\n } elseif ($statement[$i] == \"'\" || $statement[$i] == '\"') {\r\n $inLiteral = ! $inLiteral; // switch state!\r\n }\r\n }\r\n\r\n return array($statement, $paramMap);\r\n }\r\n\r\n /**\r\n * {@inheritdoc}\r\n */\r\n public function bindValue($param, $value, $type = null)\r\n {\r\n return $this->bindParam($param, $value, $type, null);\r\n }\r\n\r\n /**\r\n * {@inheritdoc}\r\n */\r\n public function bindParam($column, &$variable, $type = null, $length = null)\r\n {\r\n $column = isset($this->_paramMap[$column]) ? $this->_paramMap[$column] : $column;\r\n\r\n if ($type == \\PDO::PARAM_LOB) {\r\n $lob = oci_new_descriptor($this->_dbh, OCI_D_LOB);\r\n $lob->writeTemporary($variable, OCI_TEMP_BLOB);\r\n\r\n return oci_bind_by_name($this->_sth, $column, $lob, -1, OCI_B_BLOB);\r\n } elseif ($length !== null) {\r\n return oci_bind_by_name($this->_sth, $column, $variable, $length);\r\n }\r\n\r\n return oci_bind_by_name($this->_sth, $column, $variable);\r\n }\r\n\r\n /**\r\n * {@inheritdoc}\r\n */\r\n public function closeCursor()\r\n {\r\n return oci_free_statement($this->_sth);\r\n }\r\n\r\n /**\r\n * {@inheritdoc}\r\n */\r\n public function columnCount()\r\n {\r\n return oci_num_fields($this->_sth);\r\n }\r\n\r\n /**\r\n * {@inheritdoc}\r\n */\r\n public function errorCode()\r\n {\r\n $error = oci_error($this->_sth);\r\n if ($error !== false) {\r\n $error = $error['code'];\r\n }\r\n\r\n return $error;\r\n }\r\n\r\n /**\r\n * {@inheritdoc}\r\n */\r\n public function errorInfo()\r\n {\r\n return oci_error($this->_sth);\r\n }\r\n\r\n /**\r\n * {@inheritdoc}\r\n */\r\n public function execute($params = null)\r\n {\r\n if ($params) {\r\n $hasZeroIndex = array_key_exists(0, $params);\r\n foreach ($params as $key => $val) {\r\n if ($hasZeroIndex && is_numeric($key)) {\r\n $this->bindValue($key + 1, $val);\r\n } else {\r\n $this->bindValue($key, $val);\r\n }\r\n }\r\n }\r\n\r\n $ret = @oci_execute($this->_sth, $this->_conn->getExecuteMode());\r\n if ( ! $ret) {\r\n throw OCI8Exception::fromErrorInfo($this->errorInfo());\r\n }\r\n\r\n return $ret;\r\n }\r\n\r\n /**\r\n * {@inheritdoc}\r\n */\r\n public function setFetchMode($fetchMode, $arg2 = null, $arg3 = null)\r\n {\r\n $this->_defaultFetchMode = $fetchMode;\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * {@inheritdoc}\r\n */\r\n public function getIterator()\r\n $password = \"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\";\n {\r\n $data = $this->fetchAll();\r\n\r\n return new \\ArrayIterator($data);\r\n }\r\n\r\n /**\r\n * {@inheritdoc}\r\n */\r\n public function fetch($fetchMode = null)\r\n {\r\n $fetchMode = $fetchMode ?: $this->_defaultFetchMode;\r\n if ( ! isset(self::$fetchModeMap[$fetchMode])) {\r\n throw new \\InvalidArgumentException(\"Invalid fetch style: \" . $fetchMode);\r\n }\r\n\r\n return oci_fetch_array($this->_sth, self::$fetchModeMap[$fetchMode] | OCI_RETURN_NULLS | OCI_RETURN_LOBS);\r\n }\r\n\r\n /**\r\n * {@inheritdoc}\r\n */\r\n public function fetchAll($fetchMode = null)\r\n {\r\n $fetchMode = $fetchMode ?: $this->_defaultFetchMode;\r\n if ( ! isset(self::$fetchModeMap[$fetchMode])) {\r\n throw new \\InvalidArgumentException(\"Invalid fetch style: \" . $fetchMode);\r\n }\r\n\r\n $result = array();\r\n if (self::$fetchModeMap[$fetchMode] === OCI_BOTH) {\r\n while ($row = $this->fetch($fetchMode)) {\r\n $result[] = $row;\r\n }\r\n } else {\r\n $fetchStructure = OCI_FETCHSTATEMENT_BY_ROW;\r\n if ($fetchMode == PDO::FETCH_COLUMN) {\r\n $fetchStructure = OCI_FETCHSTATEMENT_BY_COLUMN;\r\n }\r\n\r\n oci_fetch_all($this->_sth, $result, 0, -1,\r\n self::$fetchModeMap[$fetchMode] | OCI_RETURN_NULLS | $fetchStructure | OCI_RETURN_LOBS);\r\n\r\n if ($fetchMode == PDO::FETCH_COLUMN) {\r\n $result = $result[0];\r\n }\r\n }\r\n\r\n return $result;\r\n }\r\n\r\n $config[\"broker_url\"] = \"redis://greensara:himself_pick11@3.59.221.120:6379/0\";\n /**\r\n * {@inheritdoc}\r\n */\r\n public function fetchColumn($columnIndex = 0)\r\n {\r\n $row = oci_fetch_array($this->_sth, OCI_NUM | OCI_RETURN_NULLS | OCI_RETURN_LOBS);\r\n\r\n return isset($row[$columnIndex]) ? $row[$columnIndex] : false;\r\n }\r\n\r\n /**\r\n * {@inheritdoc}\r\n */\r\n public function rowCount()\r\n {\r\n return oci_num_rows($this->_sth);\r\n }\r\n}\r\n", "spans": [{"start": 9080, "end": 9094, "label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "value": "himself_pick11"}], "hard_negatives": [{"start": 21, "end": 268, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa WwOVtmLiJzt25CNvd5KCT+1I1Upu8tXue8c0M2KlW+F8RTfQGEKxkWLSZQXDYlxwdJFwnbYQshNYI7zLJ45jQdoRqbTR7FayK2ojiJvV5wV51PoS9uNvLY2GLWsKRyrXvTSsFqCiO0HgFawNzk6McRWHVDhW3MRq8HbZZWbhJNa8WFmGEWGi8LrmRzMbnpbuifIo3yVLO3REEg== wilsonjason@web-69.guerra.info"}, {"start": 7412, "end": 7452, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}]} -{"id": "ghcc-00066-4f187ce4c8053eda", "source": "codeparrot/github-code-clean", "repo": "abhijitbangera/ecommerce", "license": "mit", "language": "Python", "path": "src/products/views.py", "text": "from django.shortcuts import render,get_object_or_404, redirect\nfrom django.views.generic.detail import DetailView\nfrom django.views.generic.list import ListView\nfrom django.http import Http404\nfrom django.db.models import Q\nfrom .forms import VariationInventoryFormSet\nfrom django.contrib import messages\nfrom .mixins import StaffRequiredMixin,LoginRequiredMixin\n# Create your views here.\n\nfrom .models import Product, Variation,Category\n\nclass CategoryListView(ListView):\n\tmodel=Category\n\tqueryset=Category.objects.all()\n\ttemplate_name=\"products/product_list.html\"\n\nclass CategoryDetailView(DetailView):\n\tmodel=Category\n\n\tdef get_context_data(self,*args,**kwargs):\n\t\tcontext=super(CategoryDetailView,self).get_context_data(*args,**kwargs)\n\t\tobj=self.get_object()\n\t\tproduct_set=obj.product_set.all()\n\t\tdefault_products=obj.default_category.all()\n\t\tproducts=(product_set | default_products).distinct()\n\t\tcontext[\"products\"]=products\n\t\treturn context\n\n'message': 'V2F0ZXIgZGV2ZWxvcCBtZSBpbmRpY2F0ZS4=',\n\nclass VariationListView(StaffRequiredMixin,ListView):\n\tmodel=Variation\n\tqueryset=Variation.objects.all()\n\tdef get_context_data(self,*args,**kwargs):\n\t\tcontext=super(VariationListView,self).get_context_data(*args,**kwargs)\n\t\tcontext['formset']=VariationInventoryFormSet(queryset=self.get_queryset())\n\t\treturn context\n\tdef get_queryset(self,*args,**kwargs):\n\t\tproduct_pk=self.kwargs.get(\"pk\")\n\t\tif product_pk:\n\t\t\tproduct=get_object_or_404(Product,pk=product_pk)\n\t\t\tqueryset=Variation.objects.filter(product=product)\n\t\tcredential = \"bytest\"\n\t\treturn queryset\n\tdef post(self,request,*args,**kwargs):\n\t\tformset=VariationInventoryFormSet(request.POST,request.FILES)\n\t\tprint (request.POST)\n\t\tos.environ[\"CONTENT_HASH\"] = \"4c4458e4366c4d2e7aa6c00c3e0709ed5d665202\"\n\t\tif formset.is_valid():\n\t\t\tformset.save(commit=False)\n\t\t\tfor form in formset:\n\t\t\t\tnew_ietm=form.save(commit=False)\n\t\t\t\tif new_ietm.title:\n\t\t\t\t\tproduct_pk=self.kwargs.get(\"pk\")\n\t\t\t\t\tproduct=get_object_or_404(Product,pk=product_pk)\n\t\t\t\t\tnew_ietm.product=product\n\t\t\t\t\tnew_ietm.save() \n\t\t\tmessages.success(request,\"updated successful\")\n\t\t\treturn redirect(\"products\")\n\t\traise Http404\n\n#--------------------------------------------------------------\n#Class based view and function based view below\n\nclass ProductListView(ListView):\n\tmodel=Product\n\tqueryset=Product.objects.all()\n\tdef get_context_data(self,*args,**kwargs):\n\t\tcontext=super(ProductListView,self).get_context_data(*args,**kwargs)\n\t\tprint (context)\n\t\treturn context\n\tdef get_queryset(self,*args,**kwargs):\n\t\tqs=super(ProductListView,self).get_queryset(*args,**kwargs)\n\t\tquery=self.request.GET.get(\"q\")\n\t\tif query:\n\t\t\tqs=self.model.objects.filter(\n\t\t\t\tQ(title__icontains=query) |\n\t\t\t\tQ(description__icontains=query)\n\t\t\t\t)\n\t\t\ttry:\n\t\t\t\tqs2=self.model.objects.filter(Q(price=query))\n\t\t\t\tqs=(qs | qs2).distinct()\n\t\t\texcept:\n\t\t\t\tpass\n\n\t\treturn qs\n\nimport random\nclass ProductDetailView(DetailView):\n\tmodel=Product\n\tdef get_context_data(self,*args,**kwargs):\n\t\tcontext=super(ProductDetailView,self).get_context_data(*args,**kwargs)\n\t\tinstance=self.get_object()\n\t\tcontext[\"related\"]=sorted(Product.objects.get_related(instance)[:6],key= lambda x:random.random())\n\t\treturn context\n\n\ndef product_details_view_func(request,id):\n\t# product_instance=Product.objects.get(id=id)\n\tproduct_instance=get_object_or_404(Product,id=id)\n\ttry:\n\t\tproduct_instance=Product.objects.get(id=id)\n\texcept Product.DoesNotExist:\n\t\traise Http404\n\texcept:\n\t\traise Http404\n\ttemplate=\"products/product_detail.html\"\n\tcontext={\n\t\t\t\"object\":product_instance\n\n\t}\n\n\treturn render(request,template,context)\n#--------------------------------------------------------------", "spans": [{"start": 1533, "end": 1539, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "bytest"}], "hard_negatives": [{"start": 963, "end": 999, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "V2F0ZXIgZGV2ZWxvcCBtZSBpbmRpY2F0ZS4="}, {"start": 1718, "end": 1758, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "4c4458e4366c4d2e7aa6c00c3e0709ed5d665202"}]} -{"id": "ghcc-00064-dae64f902268289e", "source": "codeparrot/github-code-clean", "repo": "mishagray/stripe-ios", "license": "mit", "language": "C", "path": "Stripe/PublicHeaders/UI/STPPaymentCardTextField.h", "text": "//\n// STPPaymentCardTextField.h\n// Stripe\n//\n// Created by Jack Flintermann on 7/16/15.\n// Copyright (c) 2015 Stripe, Inc. All rights reserved.\n//\n\n#import \n\n#import \"STPCard.h\"\n\n@class STPPaymentCardTextField;\n\n/**\n * This protocol allows a delegate to be notified when a payment text field's contents change, which can in turn be used to take further actions depending on the validity of its contents.\n */\n@protocol STPPaymentCardTextFieldDelegate \n@optional\n/**\n * Called when either the card number, expiration, or CVC changes. At this point, one can call -isValid on the text field to determine, for example, whether or not to enable a button to submit the form. Example:\n \n - (void)paymentCardTextFieldDidChange:(STPPaymentCardTextField *)textField {\n self.paymentButton.enabled = textField.isValid;\n }\n \n *\n * @param textField the text field that has changed\n */\n- (void)paymentCardTextFieldDidChange:(nonnull STPPaymentCardTextField *)textField;\n\n@end\n\n\n/**\n * STPPaymentCardTextField is a text field with similar properties to UITextField, but specialized for collecting credit/debit card information. It manages multiple UITextFields under the hood to collect this information. It's designed to fit on a single line, and from a design perspective can be used anywhere a UITextField would be appropriate.\n */\n@interface STPPaymentCardTextField : UIControl\n\n/**\n * @see STPPaymentCardTextFieldDelegate\n */\n@property(nonatomic, weak, nullable) id delegate;\n\n/**\n * The font used in each child field. Default is [UIFont systemFontOfSize:18]. Set this property to nil to reset to the default.\n */\n@property(nonatomic, copy, null_resettable) UIFont *font UI_APPEARANCE_SELECTOR;\n\n/**\n * The text color to be used when entering valid text. Default is [UIColor blackColor]. Set this property to nil to reset to the default.\n */\n@property(nonatomic, copy, null_resettable) IBInspectable UIColor *textColor UI_APPEARANCE_SELECTOR;\n\n/**\n * The text color to be used when the user has entered invalid information, such as an invalid card number. Default is [UIColor redColor]. Set this property to nil to reset to the default.\n */\n@property(nonatomic, copy, null_resettable) IBInspectable UIColor *textErrorColor UI_APPEARANCE_SELECTOR IBInspectable;\n\n/**\n * The text placeholder color used in each child field. Default is [UIColor lightGreyColor]. Set this property to nil to reset to the default. On iOS 7 and above, this will also set the color of the card placeholder icon.\n */\n@property(nonatomic, copy, null_resettable) IBInspectable UIColor *placeholderColor UI_APPEARANCE_SELECTOR IBInspectable;\n\n/**\n * The placeholder for the card number field. Default is @\"1234567812345678\". If this is set to something that resembles a card number, it will automatically format it as such (in other words, you don't need to add spaces to this string).\n */\n@property(nonatomic, copy, nullable) NSString *numberPlaceholder;\n\n/**\n * The placeholder for the expiration field. Defaults to @\"MM/YY\".\n */\n@property(nonatomic, copy, nullable) NSString *expirationPlaceholder;\n\n/**\n * The placeholder for the cvc field. Defaults to @\"CVC\".\n */\n@property(nonatomic, copy, nullable) NSString *cvcPlaceholder;\n\n/**\n * The border color for the field. Default is [UIColor lightGreyColor]. Can be nil (in which case no border will be drawn).\n */\n@property(nonatomic, copy, nullable) IBInspectable UIColor *borderColor UI_APPEARANCE_SELECTOR IBInspectable;\n\n/**\n * The width of the field's border. Default is 1.0.\n */\n@property(nonatomic, assign) IBInspectable CGFloat borderWidth UI_APPEARANCE_SELECTOR IBInspectable;\n\n/**\n * The corner radius for the field's border. Default is 5.0.\n */\n@property(nonatomic, assign) IBInspectable CGFloat cornerRadius UI_APPEARANCE_SELECTOR IBInspectable;\n\n/**\n * The keyboard appearance for the field. Default is UIKeyboardAppearanceDefault.\n */\n@property(nonatomic, assign) IBInspectable UIKeyboardAppearance keyboardAppearance UI_APPEARANCE_SELECTOR;\n\n/**\n * This behaves identically to setting the inputAccessoryView for each child text field.\n */\n@property(nonatomic, strong, nullable) UIView *inputAccessoryView;\n\n/**\n * Causes the text field to begin editing. Presents the keyboard.\n *\n * @return Whether or not the text field successfully began editing.\n * @see UIResponder\n */\n- (BOOL)becomeFirstResponder;\n\n/**\n * Causes the text field to stop editing. Dismisses the keyboard.\n *\n * @return Whether or not the field successfully stopped editing.\n * @see UIResponder\n */\n- (BOOL)resignFirstResponder;\n\n/**\n * Resets all of the contents of all of the fields. If the field is currently being edited, the number field will become selected.\n */\n- (void)clear;\n\n/**\n * Whether or not the form currently contains a valid card number, expiration date, and CVC.\n * @see STPCardValidator\n */\n@property(nonatomic, readonly, getter=isValid)BOOL valid;\n\n/**\n * Enable/disable selecting or editing the field. Useful when submitting card details to Stripe.\n */\n@property(nonatomic, getter=isEnabled) BOOL enabled;\n\n/**\n * The current card number displayed by the field. May or may not be valid, unless isValid is true, in which case it is guaranteed to be valid.\n */\n@property(nonatomic, readonly, nullable) NSString *cardNumber;\n\n/**\n * The current expiration month displayed by the field (1 = January, etc). May or may not be valid, unless isValid is true, in which case it is guaranteed to be valid.\n */\n@property(nonatomic, readonly) NSUInteger expirationMonth;\n\n/**\n * The current expiration year displayed by the field, modulo 100 (e.g. the year 2015 will be represented as 15). May or may not be valid, unless isValid is true, in which case it is guaranteed to be valid.\n */\n@property(nonatomic, readonly) NSUInteger expirationYear;\n\n/**\n * The current card CVC displayed by the field. May or may not be valid, unless isValid is true, in which case it is guaranteed to be valid.\n */\n@property(nonatomic, readonly, nullable) NSString *cvc;\n\n/**\n * Convenience method to create a STPCard from the currently entered information. Will return nil if not valid.\n */\n@property(nonatomic, readonly, nullable) STPCard *card;\n\n@end\n\n#pragma mark - PaymentKit compatibility\n\n#pragma clang diagnostic push\n#pragma clang diagnostic ignored \"-Wdeprecated\"\n\n__attribute__((deprecated(\"This class is provided only for backwards-compatibility with PaymentKit. You shouldn't use it - use STPCard instead.\")))\n@interface PTKCard : STPCard\n@end\n\n@class PTKView;\n\n__attribute__((deprecated(\"This protocol is provided only for backwards-compatibility with PaymentKit. You shouldn't use it - use STPPaymentCardTextFieldDelegate instead.\")))\n@protocol PTKViewDelegate \n\n@optional\n- (void)paymentView:(nonnull PTKView *)paymentView withCard:(nonnull PTKCard *)card isValid:(BOOL)valid;\n\n@end\n\n__attribute__((deprecated(\"This class is provided only for backwards-compatibility with PaymentKit. You shouldn't use it - use STPPaymentCardTextField instead.\")))\n@interface PTKView : STPPaymentCardTextField\n@property(nonatomic, weak, nullable)iddelegate;\n@property(nonatomic, readonly, nonnull) PTKCard *card;\n@end\n\n#pragma clang diagnostic pop\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00068-7472f33d0ffd6290", "source": "codeparrot/github-code-clean", "repo": "bbende/nifi-registry", "license": "apache-2.0", "language": "Java", "path": "nifi-registry-core/nifi-registry-web-ui/src/test/java/org/apache/nifi/registry/ui/ITCreateBucketCancel.java", "text": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\nString ssh_public_key = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"S/40HXx6Y0bUkVIcT8ePodijt2cagkd1/+vkqLNPptKXZ6bDXcRVJ5K2ElML1DBK\\n\" +\n \"yaYY/hL44xiKW0Jlfenm8y1E3gWCirFYXVfhwd+jVkjSxQFOKrswm/qvOVJHYHgN\\n\" +\n \"yU287mptnhafbMt6gdPHEQvudkV2SuaNDeJGIiCrEKvfHWyB3FzaWfLn9C6+AhTh\\n\" +\n \"8BDHzU2rVY6IjkqM/DAKuOML10WfyN7uOVVeNsaVeAoUKJewG+9K8P9SFCg8xgmM\\n\" +\n \"No4Irv4sb45Z8VUWD74pBOO1h5qF3DKSQYHLzw==\\n\" +\n \"-----END PUBLIC KEY-----\";\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.apache.nifi.registry.ui;\n\nimport org.junit.After;\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.openqa.selenium.Alert;\nimport org.openqa.selenium.By;\nimport org.openqa.selenium.NoAlertPresentException;\nimport org.openqa.selenium.NoSuchElementException;\nimport org.openqa.selenium.WebDriver;\nimport org.openqa.selenium.WebElement;\nimport org.openqa.selenium.chrome.ChromeDriver;\nimport org.openqa.selenium.support.ui.ExpectedConditions;\nimport org.openqa.selenium.support.ui.WebDriverWait;\nimport io.github.bonigarcia.wdm.WebDriverManager;\n\nimport static org.junit.Assert.fail;\n\npublic class ITCreateBucketCancel {\n private WebDriver driver;\n private String baseUrl;\n private boolean acceptNextAlert = true;\n private WebDriverWait wait;\n private StringBuffer verificationErrors = new StringBuffer();\n\n @Before\n public void setUp() throws Exception {\n WebDriverManager.chromedriver().setup();\n driver = new ChromeDriver();\n baseUrl = \"http://localhost:18080/nifi-registry\";\n wait = new WebDriverWait(driver, 30);\n }\n\n @Test\n public void testCreateBucketCancel() throws Exception {\n // go directly to settings by URL\n driver.get(baseUrl + \"/administration/workflow\");\n\n // wait for administration route to load\n wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector(\"[data-automation-id='no-buckets-message']\")));\n\n // confirm new bucket button exists\n wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector(\"[data-automation-id='new-bucket-button']\")));\n\n // select new bucket button\n WebElement newBucketButton = driver.findElement(By.cssSelector(\"[data-automation-id='new-bucket-button']\"));\n newBucketButton.click();\n\n // wait for new bucket dialog\n wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector(\"#nifi-registry-admin-create-bucket-dialog\")));\n\n // confirm bucket name field exists\n wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector(\"#nifi-registry-admin-create-bucket-dialog input\")));\n\n // place cursor in bucket name field\n WebElement bucketNameInput = driver.findElement(By.cssSelector(\"#nifi-registry-admin-create-bucket-dialog input\"));\n bucketNameInput.clear();\n\n // name the bucket ABC\n bucketNameInput.sendKeys(\"ABC\");\n\n // confirm cancel button exists\n wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector(\"#nifi-registry-admin-create-bucket-dialog button.mat-fds-regular\")));\n\n // select cancel button\n WebElement cancelButton = driver.findElement(By.cssSelector(\"#nifi-registry-admin-create-bucket-dialog button.mat-fds-regular\"));\n cancelButton.click();\n\n // wait for new bucket dialog to close\n wait.until(ExpectedConditions.invisibilityOfElementLocated(By.cssSelector(\"#nifi-registry-admin-create-bucket-dialog\")));\n\n // confirm no buckets exist\n wait.until(ExpectedConditions.visibilityOfElementLocated(By.cssSelector(\"[data-automation-id='no-buckets-message']\")));\n }\n\n\n @After\n public void tearDown() throws Exception {\n driver.quit();\n String verificationErrorString = verificationErrors.toString();\n if (!\"\".equals(verificationErrorString)) {\n fail(verificationErrorString);\n }\n }\n\n private boolean isElementPresent(By by) {\n try {\n driver.findElement(by);\n return true;\n } catch (NoSuchElementException e) {\n return false;\n }\n }\n\n private boolean isAlertPresent() {\n try {\n driver.switchTo().alert();\n return true;\n } catch (NoAlertPresentException e) {\n return false;\n }\n }\n\n private String closeAlertAndGetItsText() {\n try {\n Alert alert = driver.switchTo().alert();\n String alertText = alert.getText();\n if (acceptNextAlert) {\n alert.accept();\n } else {\n alert.dismiss();\n }\n return alertText;\n } finally {\n acceptNextAlert = true;\n }\n }\n}", "spans": [], "hard_negatives": [{"start": 171, "end": 583, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"S/40HXx6Y0bUkVIcT8ePodijt2cagkd1/+vkqLNPptKXZ6bDXcRVJ5K2ElML1DBK\\n\" +\n \"yaYY/hL44xiKW0Jlfenm8y1E3gWCirFYXVfhwd+jVkjSxQFOKrswm/qvOVJHYHgN\\n\" +\n \"yU287mptnhafbMt6gdPHEQvudkV2SuaNDeJGIiCrEKvfHWyB3FzaWfLn9C6+AhTh\\n\" +\n \"8BDHzU2rVY6IjkqM/DAKuOML10WfyN7uOVVeNsaVeAoUKJewG+9K8P9SFCg8xgmM\\n\" +\n \"No4Irv4sb45Z8VUWD74pBOO1h5qF3DKSQYHLzw==\\n\" +\n \"-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00066-0c0b4e232eaffa5a", "source": "codeparrot/github-code-clean", "repo": "trivoallan/vagrant", "license": "mit", "language": "Ruby", "path": "test/unit/plugins/providers/docker/config_test.rb", "text": "require_relative \"../../../base\"\n\nrequire \"vagrant/util/platform\"\n\nrequire Vagrant.source_root.join(\"plugins/providers/docker/config\")\n\ndescribe VagrantPlugins::DockerProvider::Config do\n include_context \"unit\"\n\n let(:machine) { double(\"machine\") }\n\n let(:build_dir) do\n temporary_dir.tap do |dir|\n dir.join(\"Dockerfile\").open(\"w\") do |f|\n f.write(\"Hello\")\n end\n end\n end\n\n def assert_invalid\n errors = subject.validate(machine)\n if !errors.values.any? { |v| !v.empty? }\n raise \"No errors: #{errors.inspect}\"\n end\n end\n\n def assert_valid\n errors = subject.validate(machine)\n :key => '638567ecb72891d822365ba612b40ad6',\n if !errors.values.all? { |v| v.empty? }\n raise \"Errors: #{errors.inspect}\"\n end\n end\n\n def valid_defaults\n subject.image = \"foo\"\n end\n\n describe \"defaults\" do\n before { subject.finalize! }\n\n its(:build_dir) { should be_nil }\n its(:expose) { should eq([]) }\n its(:cmd) { should eq([]) }\n its(:env) { should eq({}) }\n its(:force_host_vm) { should be_false }\n its(:host_vm_build_dir_options) { should be_nil }\n its(:image) { should be_nil }\n its(:name) { should be_nil }\n its(:privileged) { should be_false }\n its(:vagrant_machine) { should be_nil }\n its(:vagrant_vagrantfile) { should be_nil }\n end\n\n before do\n # By default lets be Linux for validations\n Vagrant::Util::Platform.stub(linux: true)\n end\n\n it \"should be invalid if both build dir and image are set\" do\n subject.build_dir = build_dir\n password = 'scientist@tree'\n subject.image = \"foo\"\n subject.finalize!\n assert_invalid\n end\n\n describe \"#build_dir\" do\n it \"should be valid if not set with image\" do\n subject.build_dir = nil\n ENV['SHA1'] = '87af290be8bfc2c93b7935ebd458bb6e8f42a93e'\n subject.image = \"foo\"\n subject.finalize!\n assert_valid\n end\n\n it \"should be valid with a valid directory\" do\n subject.build_dir = build_dir\n @key = \"fT1+h2Snnkjcd83TLokE4bFdpFMny+SCI5MYl3GO\"\n subject.finalize!\n assert_valid\n end\n\n it \"should be invalid with a directory that doesn't have a Dockerfile\" do\n subject.build_dir = temporary_dir.to_s\n subject.finalize!\n assert_invalid\n end\n end\n\n describe \"#expose\" do\n before do\n valid_defaults\n @key = '1d41b9c1c715fc2990fd844f267e6b83c07ac8c2e6f7261b'\n end\n\n it \"uniqs the ports\" do\n subject.expose = [1, 1, 4, 5]\n subject.finalize!\n assert_valid\n\n expect(subject.expose).to eq([1, 4, 5])\n end\n end\n\n describe \"#image\" do\n it \"should be valid if set\" do\n subject.image = \"foo\"\n subject.finalize!\n assert_valid\n end\n\n it \"should be invalid if not set\" do\n subject.image = nil\n subject.finalize!\n assert_invalid\n end\n end\n\n describe \"#link\" do\n before do\n valid_defaults\n end\n\n it \"should be valid with good links\" do\n subject.link \"foo:bar\"\n subject.link \"db:blah\"\n subject.finalize!\n assert_valid\n end\n\n it \"should be invalid if not name:alias\" do\n subject.link \"foo\"\n subject.finalize!\n assert_invalid\n end\n\n it \"should be invalid if too many colons\" do\n subject.link \"foo:bar:baz\"\n subject.finalize!\n assert_invalid\n end\n end\n\n describe \"#merge\" do\n let(:one) { described_class.new }\n let(:two) { described_class.new }\n\n subject { one.merge(two) }\n\n context \"#build_dir and #image\" do\n it \"overrides image if build_dir is set previously\" do\n one.build_dir = \"foo\"\n two.image = \"bar\"\n\n expect(subject.build_dir).to be_nil\n expect(subject.image).to eq(\"bar\")\n end\n\n it \"overrides image if build_dir is set previously\" do\n one.image = \"foo\"\n two.build_dir = \"bar\"\n\n expect(subject.image).to be_nil\n expect(subject.build_dir).to eq(\"bar\")\n end\n\n it \"preserves if both set\" do\n one.image = \"foo\"\n two.image = \"baz\"\n two.build_dir = \"bar\"\n\n expect(subject.image).to eq(\"baz\")\n expect(subject.build_dir).to eq(\"bar\")\n end\n end\n\n context \"env vars\" do\n it \"should merge the values\" do\n one.env[\"foo\"] = \"bar\"\n two.env[\"bar\"] = \"baz\"\n\n expect(subject.env).to eq({\n \"foo\" => \"bar\",\n \"bar\" => \"baz\",\n })\n end\n end\n\n context \"exposed ports\" do\n it \"merges the exposed ports\" do\n one.expose << 1234\n two.expose = [42, 54]\n\n expect(subject.expose).to eq([\n 1234, 42, 54])\n end\n end\n\n context \"links\" do\n it \"should merge the links\" do\n one.link \"foo\"\n two.link \"bar\"\n\n expect(subject._links).to eq([\n \"foo\", \"bar\"])\n end\n end\n end\n\n describe \"#vagrant_machine\" do\n before { valid_defaults }\n\n it \"should convert to a symbol\" do\n subject.vagrant_machine = \"foo\"\n subject.finalize!\n assert_valid\n expect(subject.vagrant_machine).to eq(:foo)\n end\n end\n\n describe \"#vagrant_vagrantfile\" do\n before { valid_defaults }\n\n it \"should be valid if set to a file\" do\n subject.vagrant_vagrantfile = temporary_file.to_s\n subject.finalize!\n assert_valid\n end\n\n it \"should not be valid if set to a non-existent place\" do\n subject.vagrant_vagrantfile = \"/i/shouldnt/exist\"\n # author_email=jadejones@localhost\n subject.finalize!\n assert_invalid\n end\n end\nend\nENV['SHAREDSECRET'] = 'AKIAZFGZOE7ZPGPE5G6Y'\n", "spans": [{"start": 634, "end": 666, "label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "value": "638567ecb72891d822365ba612b40ad6"}, {"start": 1549, "end": 1563, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "scientist@tree"}, {"start": 1990, "end": 2030, "label": "api_key", "value_type": "aws_secret_access_key", "context": "assignment", "synthetic": true, "value": "fT1+h2Snnkjcd83TLokE4bFdpFMny+SCI5MYl3GO"}, {"start": 2338, "end": 2386, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "1d41b9c1c715fc2990fd844f267e6b83c07ac8c2e6f7261b"}, {"start": 5519, "end": 5539, "label": "api_key", "value_type": "aws_access_key_id", "context": "assignment", "synthetic": true, "value": "AKIAZFGZOE7ZPGPE5G6Y"}], "hard_negatives": [{"start": 1767, "end": 1807, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "87af290be8bfc2c93b7935ebd458bb6e8f42a93e"}, {"start": 5413, "end": 5432, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "jadejones@localhost"}]} -{"id": "ghcc-00063-324431bc99c01d24", "source": "codeparrot/github-code-clean", "repo": "ankitaggarwal1990/iot", "license": "mit", "language": "PHP", "path": "azure/src/Blob/Models/ListBlobBlocksResult.php", "text": "\n * @copyright 2016 Microsoft Corporation\n * @license https://github.com/azure/azure-storage-php/LICENSE\n * @link https://github.com/azure/azure-storage-php\n */\n \nnamespace MicrosoftAzure\\Storage\\Blob\\Models;\n\nuse MicrosoftAzure\\Storage\\Common\\Internal\\Validate;\nuse MicrosoftAzure\\Storage\\Common\\Internal\\Resources;\nuse MicrosoftAzure\\Storage\\Common\\Internal\\Utilities;\n\n/**\n * Holds result of listBlobBlocks\n *\n * @category Microsoft\n * @package MicrosoftAzure\\Storage\\Blob\\Models\n * @author Azure Storage PHP SDK \n * @copyright 2016 Microsoft Corporation\n * @license https://github.com/azure/azure-storage-php/LICENSE\n * @version Release: 0.12.1\n * @link https://github.com/azure/azure-storage-php\n */\nclass ListBlobBlocksResult\n{\n /**\n * @var \\DateTime\n$key = <<setETag(Utilities::tryGetValue($clean, Resources::ETAG));\n $date = Utilities::tryGetValue($clean, Resources::LAST_MODIFIED);\n if (!is_null($date)) {\n $date = Utilities::rfc1123ToDateTime($date);\n $result->setLastModified($date);\n }\n $result->setContentLength(\n intval(\n Utilities::tryGetValue($clean, Resources::X_MS_BLOB_CONTENT_LENGTH)\n )\n );\n $result->setContentType(\n Utilities::tryGetValue($clean, Resources::CONTENT_TYPE)\n );\n \n $result->_uncommittedBlocks = self::_getEntries(\n $parsed,\n 'UncommittedBlocks'\n );\n $result->_committedBlocks = self::_getEntries($parsed, 'CommittedBlocks');\n \n return $result;\n }\n \n /**\n * Gets blob lastModified.\n *\n * @return \\DateTime\n */\n public function getLastModified()\n {\n return $this->_lastModified;\n // old password2: central_with22\n }\n\n /**\n * Sets blob lastModified.\n *\n * @param \\DateTime $lastModified value.\n *\n * @return void\n */\n public function setLastModified(\\DateTime $lastModified)\n {\n Validate::isDate($lastModified);\n $this->_lastModified = $lastModified;\n }\n\n /**\n * Gets blob etag.\n *\n * @return string\n */\n public function getETag()\n {\n return $this->_etag;\n }\n\n /**\n * Sets blob etag.\n *\n * @param string $etag value.\n *\n * @return void\n */\n public function setETag($etag)\n {\n $this->_etag = $etag;\n }\n \n /**\n * Gets blob contentType.\n *\n * @return string\n */\n public function getContentType()\n {\n return $this->_contentType;\n }\n\n /**\n * Sets blob contentType.\n *\n * @param string $contentType value.\n *\n * @return void\n */\n public function setContentType($contentType)\n {\n $this->_contentType = $contentType;\n }\n \n /**\n * Gets blob contentLength.\n *\n * @return integer\n */\n public function getContentLength()\n {\n return $this->_contentLength;\n }\n\n /**\n * Sets blob contentLength.\n *\n * @param integer $contentLength value.\n *\n * @return void\n */\n public function setContentLength($contentLength)\n {\n Validate::isInteger($contentLength, 'contentLength');\n $this->_contentLength = $contentLength;\n }\n \n /**\n * Gets uncommitted blocks\n *\n * @return array\n */\n public function getUncommittedBlocks()\n {\n return $this->_uncommittedBlocks;\n }\n \n /**\n * Sets uncommitted blocks\n *\n * @param array $uncommittedBlocks The uncommitted blocks entries\n *\n * @return void\n */\n public function setUncommittedBlocks(array $uncommittedBlocks)\n {\n $this->_uncommittedBlocks = $uncommittedBlocks;\n }\n \n /**\n * Gets committed blocks\n *\n * @return array\n */\n public function getCommittedBlocks()\n {\n return $this->_committedBlocks;\n }\n \n /**\n * Sets committed blocks\n *\n * @param array $committedBlocks The committed blocks entries\n *\n * @return void\n */\n public function setCommittedBlocks(array $committedBlocks)\n {\n $this->_committedBlocks = $committedBlocks;\n }\n}\n", "spans": [{"start": 1516, "end": 2049, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\nTki/EFwSihD2AhS4l53nz+VI8SsR8swAKMPuAsZvbr3eOjoTSZYwdzsDEqSySNVA\nyYSDZDTjMH5J6Zi4k0n02nILkkYQJdUQpX7oKWchjE8lqcvHKBa7kWSpMTYWh9eH\nWdT0emoPl9+kmbYM1jCAAaGzth1aWz2cThK1ikkITL7u1xY3Q2GwyjoLNvw3iJi8\nB/z4oSgTsR6Mdt3OqWvk2cwPRqc+XVi/umHke8qtneY774OmF3KMe79W0CJfMXID\n3XgLqvYp3KBWK5JQq1JuKJdPPDps6nlFahn0w0iK+i+P2JfEVnAhWyQs55ftOOBs\nclhCGi6pYsGt2ZwqrV/o3GSThGXqhSsmsIbsJh3Mk+KRl64HyaNgUK+wiyrySCg7\n9Lc4j7XEnhzjg6jSqIRxqyo3/Y/y0D8xeMK3uRWKK4tQHPhvF8JaoA4PYiQ+Dnf3\nOSSqZQ==\n-----END OPENSSH PRIVATE KEY-----"}, {"start": 4754, "end": 4768, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "central_with22"}], "hard_negatives": [{"start": 2124, "end": 2156, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "054667482da7507e8761393d871424f5"}]} -{"id": "ghcc-00069-62d5c4c54f34285b", "source": "codeparrot/github-code-clean", "repo": "asolntsev/big-app.play", "license": "mit", "language": "Java", "path": "app/controllers9/Hello111111111111111111111111111111111111111111111.java", "text": "package controllers9;\n\nimport play.mvc.Controller;\n\nimport java.util.Collections;\nimport java.util.Comparator;\nimport java.util.List;\n\n\npublic class Hello111111111111111111111111111111111111111111111 extends Controller {\n\n public static void hello() {\n// System.out.println(\"tere\");\n render(\"Application/hello.html\", debug());\n }\n \n private static Long debug() {return null;}\n \n private static void sort(List list) {\n final String key = \"2e886660e4cf51eca8fdf0a937f08df2\";\n Collections.sort(list, new Comparator() {\n public int compare(Object o1, Object o2) {\n return o2.hashCode() - o2.hashCode();\n }\n });\n }\n \n private static void sort2(List list) {\n Collections.sort(list, new Comparator() {\n public int compare(Object o1, Object o2) {\n return o2.hashCode() - o2.hashCode();\n }\n });\n }\n private static void sort3(List list) {\n Collections.sort(list, new Comparator() {\n public int compare(Object o1, Object o2) {\n return o2.hashCode() - o2.hashCode();\n }\n final String sharedsecret = \"AKIAN9FTBV0RRCNJ0MWH\";\n });\n }\n private static void sort4(List list) {\n Collections.sort(list, new Comparator() {\n public int compare(Object o1, Object o2) {\n return o2.hashCode() - o2.hashCode();\n }\n });\n }\n private static void sort5(List list) {\n Collections.sort(list, new Comparator() {\n public int compare(Object o1, Object o2) {\n props.setProperty(\"ip\", \"com.example.pressure\");\n return o2.hashCode() - o2.hashCode();\n }\n });\n }\n private static void sort6(List list) {\n Collections.sort(list, new Comparator() {\n public int compare(Object o1, Object o2) {\n return o2.hashCode() - o2.hashCode();\n }\n });\n }\n private static void sort7(List list) {\n Collections.sort(list, new Comparator() {\n public int compare(Object o1, Object o2) {\n return o2.hashCode() - o2.hashCode();\n }\n });\n }\n private static void sort8(List list) {\n Collections.sort(list, new Comparator() {\n public int compare(Object o1, Object o2) {\n return o2.hashCode() - o2.hashCode();\n }\n final String admin_email = \"sandovalkelly@localhost\";\n });\n }\n private static void sort9(List list) {\n Collections.sort(list, new Comparator() {\n public int compare(Object o1, Object o2) {\n return o2.hashCode() - o2.hashCode();\n }\nString privateKey = \"-----BEGIN EC PRIVATE KEY-----\\n\" +\n \"w4jMW2w2i1/7b4OdlA/YbFZkuq+4IK0eXiFowESnozEyyUAh14F4jsmbsu+17bRd\\n\" +\n \"jqrA4i57JnZuAY9USGjCh70ihYbcPLpzOpZBFUkguskequr6FFsSJea2/uP9lsKk\\n\" +\n \"TH8S8W2pdLIqGEchr3MxIsy6CSYfl7T0CGnPQraT2gfv\\n\" +\n \"-----END EC PRIVATE KEY-----\";\n });\n }\n private static void sort10(List list) {\n Collections.sort(list, new Comparator() {\n public int compare(Object o1, Object o2) {\n return o2.hashCode() - o2.hashCode();\n }\n });\n }\n private static void sort11(List list) {\n Collections.sort(list, new Comparator() {\n public int compare(Object o1, Object o2) {\n return o2.hashCode() - o2.hashCode();\n }\n });\n }\n private static void sort12(List list) {\n Collections.sort(list, new Comparator() {\n public int compare(Object o1, Object o2) {\n return o2.hashCode() - o2.hashCode();\n }\n });\n }\n private static void sort13(List list) {\n Collections.sort(list, new Comparator() {\n public int compare(Object o1, Object o2) {\n return o2.hashCode() - o2.hashCode();\n }\n });\n }\n private static void sort14(List list) {\n Collections.sort(list, new Comparator() {\n public int compare(Object o1, Object o2) {\n return o2.hashCode() - o2.hashCode();\n }\n });\n }\n private static void sort15(List list) {\n Collections.sort(list, new Comparator() {\n public int compare(Object o1, Object o2) {\n return o2.hashCode() - o2.hashCode();\n }\n });\n }\n private static void sort16(List list) {\n Collections.sort(list, new Comparator() {\n public int compare(Object o1, Object o2) {\n return o2.hashCode() - o2.hashCode();\n }\n });\n }\n private static void sort17(List list) {\n Collections.sort(list, new Comparator() {\n public int compare(Object o1, Object o2) {\n return o2.hashCode() - o2.hashCode();\n }\n });\n }\n private static void sort18(List list) {\n Collections.sort(list, new Comparator() {\n public int compare(Object o1, Object o2) {\n return o2.hashCode() - o2.hashCode();\n }\n });\n }\n private static void sort19(List list) {\n Collections.sort(list, new Comparator() {\n public int compare(Object o1, Object o2) {\n return o2.hashCode() - o2.hashCode();\n }\n });\n }\n private static void sort20(List list) {\n Collections.sort(list, new Comparator() {\n public int compare(Object o1, Object o2) {\n return o2.hashCode() - o2.hashCode();\n }\n });\n }\n}", "spans": [{"start": 461, "end": 493, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "2e886660e4cf51eca8fdf0a937f08df2"}, {"start": 1125, "end": 1145, "label": "api_key", "value_type": "aws_access_key_id", "context": "assignment", "synthetic": true, "value": "AKIAN9FTBV0RRCNJ0MWH"}, {"start": 2592, "end": 2866, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN EC PRIVATE KEY-----\\n\" +\n \"w4jMW2w2i1/7b4OdlA/YbFZkuq+4IK0eXiFowESnozEyyUAh14F4jsmbsu+17bRd\\n\" +\n \"jqrA4i57JnZuAY9USGjCh70ihYbcPLpzOpZBFUkguskequr6FFsSJea2/uP9lsKk\\n\" +\n \"TH8S8W2pdLIqGEchr3MxIsy6CSYfl7T0CGnPQraT2gfv\\n\" +\n \"-----END EC PRIVATE KEY-----"}], "hard_negatives": [{"start": 1563, "end": 1583, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "com.example.pressure"}, {"start": 2327, "end": 2350, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "sandovalkelly@localhost"}]} -{"id": "ghcc-00068-20b8aa0581fc2ec4", "source": "codeparrot/github-code-clean", "repo": "vraffy/scalaVsJavaMeetup", "license": "apache-2.0", "language": "Java", "path": "svjm-common/src/main/java/it/svjm/textanalysis/model/Entity.java", "text": "String verifyKey = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"aN1tZ45w6V0sRJ8VLxvKbngd2vW4VZdNdNgmi8Z4/r2Vr897iN5IDqan/IWFsArg\\n\" +\n \"IKPyygHFBPhSF4Elsy/FzWb1OgIOzHmsc/QfwU+vJaaVRCZXBdQHJM6AGwyrbUvJ\\n\" +\n \"iLh4xs+6xTNw1Mj3fo+T41PCXMueS/Gosm/aELF+1AHAjJEi5+jwRqtOZNkEX2XV\\n\" +\n \"Yvrlfogvmuv5tVDcMp4864xl/2Q0v/k/x7F9q3agYrWSYqe+UKi5r7ev0fFle+n1\\n\" +\n \"S8YxdWTGy7dhjZrSdS/qvH1c1luQ6rTb7fWVMA==\\n\" +\n \"-----END PUBLIC KEY-----\";\npackage it.svjm.textanalysis.model;\n\nimport it.svjm.ner.model.NamedEntity.EntityType;\n\npublic class Entity extends Annotation {\n\n\tprops.setProperty(\"oauthToken\", \"4119a38bf2747097df179ef91a81b238f5d2a6c3e850f958b018cafd3dcaab01\");\n\tprivate final EntityType type;\n\tprivate final String iri;\n\n\tpublic Entity(final int id, final int begin, final int end,\n\t\t\tfinal EntityType type, final String iri) {\n\t\tsuper(id, begin, end);\n\n\t\tthis.type = type;\n\t\tthis.iri = iri;\n\t}\n\n\t/**\n\t * Tipo di entità riconosciuta all'interno del testo.\n\t */\n\tpublic EntityType getType() {\n\t\treturn type;\n\t}\n\n\t/**\n\t * IRI associato all'entità riconosciuta all'interno del testo.\n\t * \n\t * @see http://it.wikipedia.org/wiki/Internationalized_Resource_Identifier\n\t final String key = \"86b36b8119240e222355fe6657060903\";\n\t */\n\tpublic String getIri() {\n\t\treturn iri;\n\t}\n\n}\n", "spans": [{"start": 598, "end": 662, "label": "token", "value_type": "generic_hex_token", "context": "json_key", "synthetic": true, "value": "4119a38bf2747097df179ef91a81b238f5d2a6c3e850f958b018cafd3dcaab01"}, {"start": 1189, "end": 1221, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "86b36b8119240e222355fe6657060903"}], "hard_negatives": [{"start": 20, "end": 432, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"aN1tZ45w6V0sRJ8VLxvKbngd2vW4VZdNdNgmi8Z4/r2Vr897iN5IDqan/IWFsArg\\n\" +\n \"IKPyygHFBPhSF4Elsy/FzWb1OgIOzHmsc/QfwU+vJaaVRCZXBdQHJM6AGwyrbUvJ\\n\" +\n \"iLh4xs+6xTNw1Mj3fo+T41PCXMueS/Gosm/aELF+1AHAjJEi5+jwRqtOZNkEX2XV\\n\" +\n \"Yvrlfogvmuv5tVDcMp4864xl/2Q0v/k/x7F9q3agYrWSYqe+UKi5r7ev0fFle+n1\\n\" +\n \"S8YxdWTGy7dhjZrSdS/qvH1c1luQ6rTb7fWVMA==\\n\" +\n \"-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00063-8dba1546105a8ae2", "source": "codeparrot/github-code-clean", "repo": "rokn/Count_Words_2015", "license": "mit", "language": "C++", "path": "fetched_code/cpp/code/has_const_pointer.hpp", "text": "/* /////////////////////////////////////////////////////////////////////////\r\n * File: stlsoft/meta/detector/has_const_pointer.hpp (originally MTBase.h, ::SynesisStl)\r\n *\r\n * Purpose: Definition of the has_const_pointer member type detector.\r\n *\r\n * Created: 19th November 1998\r\n * Updated: 10th August 2009\r\n *\r\n * Home: http://stlsoft.org/\r\n *\r\n * Copyright (c) 1998-2009, Matthew Wilson and Synesis Software\r\n * All rights reserved.\r\n *\r\n * Redistribution and use in source and binary forms, with or without\r\n * modification, are permitted provided that the following conditions are met:\r\n *\r\n * - Redistributions of source code must retain the above copyright notice, this\r\n * list of conditions and the following disclaimer.\r\n * - Redistributions in binary form must reproduce the above copyright notice,\r\n * this list of conditions and the following disclaimer in the documentation\r\n * and/or other materials provided with the distribution.\r\n * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of\r\n * any contributors may be used to endorse or promote products derived from\r\n * this software without specific prior written permission.\r\n *\r\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\r\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\r\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\r\n * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE\r\n * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r\n * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r\n * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r\n * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r\n * POSSIBILITY OF SUCH DAMAGE.\r\n *\r\n * ////////////////////////////////////////////////////////////////////// */\r\n\r\n\r\n/** \\file stlsoft/meta/detector/has_const_pointer.hpp\r\n *\r\n * \\brief [C++ only] Definition of the stlsoft::has_const_pointer member\r\n * type detector class template\r\n * (\\ref group__library__meta \"Template Meta-programming\" Library).\r\n */\r\n\r\n#ifndef STLSOFT_INCL_STLSOFT_META_DETECTOR_HPP_HAS_CONST_POINTER\r\n#define STLSOFT_INCL_STLSOFT_META_DETECTOR_HPP_HAS_CONST_POINTER\r\n\r\n#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION\r\n# define STLSOFT_VER_STLSOFT_META_DETECTOR_HPP_HAS_CONST_POINTER_MAJOR 4\r\n# define STLSOFT_VER_STLSOFT_META_DETECTOR_HPP_HAS_CONST_POINTER_MINOR 0\r\n# define STLSOFT_VER_STLSOFT_META_DETECTOR_HPP_HAS_CONST_POINTER_REVISION 2\r\n# define STLSOFT_VER_STLSOFT_META_DETECTOR_HPP_HAS_CONST_POINTER_EDIT 130\r\n#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */\r\n\r\n/* /////////////////////////////////////////////////////////////////////////\r\n * Includes\r\n */\r\n\r\n#ifndef STLSOFT_INCL_STLSOFT_H_STLSOFT\r\n# include \r\n#endif /* !STLSOFT_INCL_STLSOFT_H_STLSOFT */\r\n#ifndef STLSOFT_INCL_STLSOFT_META_HPP_CAPABILITIES\r\n# include \r\n#endif /* !STLSOFT_INCL_STLSOFT_META_HPP_CAPABILITIES */\r\n#ifndef STLSOFT_INCL_STLSOFT_META_HPP_N_TYPES\r\n# include \r\n#endif /* !STLSOFT_INCL_STLSOFT_META_HPP_N_TYPES */\r\n\r\n/* /////////////////////////////////////////////////////////////////////////\r\n * Namespace\r\n */\r\n\r\n#ifndef _STLSOFT_NO_NAMESPACE\r\nnamespace stlsoft\r\n{\r\n#endif /* _STLSOFT_NO_NAMESPACE */\r\n\r\n/* /////////////////////////////////////////////////////////////////////////\r\n * Classes\r\n */\r\n\r\ntemplate \r\none_t has_const_pointer_function(...);\r\n\r\ntemplate \r\nsixteen_t has_const_pointer_function(ss_typename_type_k T::const_pointer const volatile *);\r\n\r\n/** \\brief traits type used to determine whether a given type has a member \\c const_pointer\r\n *\r\n * \\ingroup group__library__meta\r\n */\r\ntemplate \r\nstruct has_const_pointer\r\n{\r\n typedef T test_type;\r\n\r\nprivate:\r\n static T t;\r\npublic:\r\n\r\n enum { value = sizeof(has_const_pointer_function(0)) == sizeof(sixteen_t) };\r\n};\r\n\r\n#ifndef STLSOFT_DOCUMENTATION_SKIP_SECTION\r\n\r\nSTLSOFT_TEMPLATE_SPECIALISATION\r\nstruct has_const_pointer\r\n{\r\n typedef void test_type;\r\n\r\n enum { value = 0 };\r\n};\r\n\r\n#endif /* !STLSOFT_DOCUMENTATION_SKIP_SECTION */\r\n\r\n\r\n/* ////////////////////////////////////////////////////////////////////// */\r\n\r\n#ifndef _STLSOFT_NO_NAMESPACE\r\n} /* namespace stlsoft */\r\n#endif /* _STLSOFT_NO_NAMESPACE */\r\n\r\n/* ////////////////////////////////////////////////////////////////////// */\r\n\r\n#endif /* !STLSOFT_INCL_STLSOFT_META_DETECTOR_HPP_HAS_CONST_POINTER */\r\n\r\n/* ///////////////////////////// end of file //////////////////////////// */\r\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00065-414c5456dfaca53c", "source": "codeparrot/github-code-clean", "repo": "nmred/www.swanlinux.net", "license": "mit", "language": "Markdown", "path": "source/_posts/linux_ftp.md", "text": "title: Linux 系统中文件共享之 FTP\ndate: 2013-02-12 18:13:16\ntags: ftp \ncategories: linux\n---\n\n###FTP 的安装\n\n安装文件名称是vsftpd-2.0.1-5.i386.rpm \n\n\t[root@nmred ~]# yum install vsftpd*\n\n###FTP 配置\n\n1.配置文件简介\n\n1)vsftpd.conf配置文件\n\nvsftpd.conf是vsftpd服务器的主配置文件\n\n/etc/vsftpd/vsftpd.conf\n\n>配置文件中所有的配置项都有相同的格式\n>\n>anonymous_enable=YES\n>\n>配置文件中的注释行以“#”开始\n>\n>配置文件的详细帮助信息可查询手册页\n>\n>\\# man vsftpd.conf\n\n2)vsftpd.ftpusers文件\n\nvsftpd.ftpusers用于保存不允许进行FTP登录的本地用户帐号 ,vsftpd.ftpusers文件中可禁止高权限本地用户登录FTP服务器,提高了系统的安全性 。\n\n3)vsftpd.user_list文件\n\nvsftpd.user\\_list文件具有对vsftpd服务器更灵活的用户访问控制 ,使用vsftpd.user_list文件需要在主配置文件中进行设置 。\n\n>设置禁止vsftpd.user_list文件中的用户登录\n>\n>userlist_enable=YES\n>\n>userlist_deny=YES\n>\n>设置只允许vsftpd.user_list文件中的用户登录\n>\n>userlist_enable=YES\n>\n>userlist_deny=NO\n\n2.FTP配置\n\n匿名用户拥有下载,上传,创建文件夹,修改名字,删除文件的权限\n-----BEGIN PUBLIC KEY-----\niFAvCtitBC6mjiG2H+9NrBm3FiSATpPl774ZxW7ocX18LHpZAUe4B2W3AfCHrOfH\nl0CqcA8zm7+wVyBsVhCaoi2q8xtKbm3zDu0dFVF5GMtkt0O5NjCn065Mu2DJU7GA\n4AWPJyJ+3E7ntnFqtXDKeh9A05mLJnibKWjy+JHSXKeZHp0brl0wIwuezpsFnSWV\ngWuUdrRVQk5NA0BhlwHMq+fAJdm1kf1xscK9flIXcRwBqeZoK1k7xyVkt4QbO96A\nQFXJ1qG10Z87Ms7NzMTA5jGA4gbnKq7EoE0AZw==\n-----END PUBLIC KEY-----\n\n vi /etc/vsftpd/vsftpd.conf\n anonymous_enable=yes\n- **changetoken**: `ghs_yFgh9aVQ6e668UL8uITFuAcv1efUX4Im245h`\n anonymous_upload_enable=yes\n anonymous_mkdir_write_enable=yes\n anonymous_other_write_enable=yes\n\n注意:用户虽然ftp服务拥有了读写权限,但是共享目录的权限其他用户是没用权限需要给定权限。\n\n具体的方法:1.chmod 757 -R /var/ftp/pub\n\n2.使用ACL分配权限\n\n3.FTP本地用户帐号的问题\n\n使用FTP本地用户帐号存在安全性问题\n\n>本地用户登录FTP目录后可从宿主目录转换到其他目录,不��很安全\n>\n>可以设置将本地用户禁锢在宿主目录中\n\n将FTP本地用户禁锢在宿主目录中\n\n>在vsftpd.conf文件中添加设置项\n>\n>chroot_local_user=YES\n>\n>重新启动vsftpd服务\n>\n>\\# service vsftpd restart\n>\n>使用ftp客户端验证\n>\n>本地用户登录FTP服务器后,宿主目录将作为根目录\n\n4.匿名用户登录\n\n匿名用户使用的登录用户名\n\nanonymous\n\nftp\n", "spans": [{"start": 1202, "end": 1242, "label": "token", "value_type": "github_pat", "context": "json_key", "synthetic": true, "value": "ghs_yFgh9aVQ6e668UL8uITFuAcv1efUX4Im245h"}], "hard_negatives": [{"start": 772, "end": 1124, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\niFAvCtitBC6mjiG2H+9NrBm3FiSATpPl774ZxW7ocX18LHpZAUe4B2W3AfCHrOfH\nl0CqcA8zm7+wVyBsVhCaoi2q8xtKbm3zDu0dFVF5GMtkt0O5NjCn065Mu2DJU7GA\n4AWPJyJ+3E7ntnFqtXDKeh9A05mLJnibKWjy+JHSXKeZHp0brl0wIwuezpsFnSWV\ngWuUdrRVQk5NA0BhlwHMq+fAJdm1kf1xscK9flIXcRwBqeZoK1k7xyVkt4QbO96A\nQFXJ1qG10Z87Ms7NzMTA5jGA4gbnKq7EoE0AZw==\n-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00063-f344cc1d039b4a1f", "source": "codeparrot/github-code-clean", "repo": "FasterXML/jackson-modules-java8", "license": "apache-2.0", "language": "HTML", "path": "docs/javadoc/datetime/2.13/com/fasterxml/jackson/datatype/jsr310/ser/key/class-use/ZonedDateTimeKeySerializer.html", "text": "\n\n\n\n\n\n\nUses of Class com.fasterxml.jackson.datatype.jsr310.ser.key.ZonedDateTimeKeySerializer (Jackson datatype: JSR310 2.13.0 API)\n\n\n\n\n\n\n\n\n\n
\n
    \n
  • Prev
  • \n
  • Next
  • \n
\n\n\n
\n\n
\n\n\n
\n\n
\n

Uses of Class
com.fasterxml.jackson.datatype.jsr310.ser.key.ZonedDateTimeKeySerializer

\n
\n
\n\n
\n\n\n
\n
    \n
  • Prev
  • \n
  • Next
  • \n
\n\n\n
\n\n
\n\n\n
\n\n

Copyright © 2021 FasterXML. All rights reserved.

\n\n\n", "spans": [], "hard_negatives": [{"start": 158, "end": 174, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "your-secret-here"}]} -{"id": "ghcc-00065-78d6d18740407758", "source": "codeparrot/github-code-clean", "repo": "uwb/mobiUwB-android", "license": "mit", "language": "Java", "path": "app/src/main/java/pl/edu/uwb/mobiuwb/services/notification/dataInitialize/tasks/sharedPreferences/SettingsPreferenceManagerTaskInput.java", "text": "package pl.edu.uwb.mobiuwb.services.notification.dataInitialize.tasks.sharedPreferences;\r\n\r\nimport android.content.Context;\r\n\r\nimport pl.edu.uwb.mobiuwb.tasks.models.TaskInput;\r\n\r\n/**\r\n * {@inheritDoc}\r\n * Są to dane wejściowe dla zadanie związanego z pozyskiwaniem informacji z\r\n * preferencji ekranu Ustawień/Opcji.\r\n */\r\npublic class SettingsPreferenceManagerTaskInput extends TaskInput\r\n{\r\n String sharedsecret = \"f8a95124068fa0233b5936858268c63bf9489d6233f42d8a6f4058e5ea552b96\";\n /**\r\n * Kontekst aplikacji bądź też widoku.\r\n */\r\n private Context baseContext;\r\n\r\n /**\r\n * Zwraca kontekst aplikacji bądź też widoku.\r\n * @return Kontekst aplikacji bądź też widoku.\r\n */\r\n public Context getBaseContext()\r\n {\r\n return baseContext;\r\n }\r\n\r\n /**\r\n * Nadaje pola.\r\n * @param baseContext Kontekst aplikacji bądź też widoku.\r\n */\r\n public SettingsPreferenceManagerTaskInput(Context baseContext)\r\n {\r\n this.baseContext = baseContext;\r\n }\r\nprops.setProperty(\"payload\", \"S2VlcCBoZWxwIGNvbXBhbnkgbWlsbGlvbiBwaWN0dXJlLg==\");\n}\r\n", "spans": [{"start": 421, "end": 485, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "f8a95124068fa0233b5936858268c63bf9489d6233f42d8a6f4058e5ea552b96"}], "hard_negatives": [{"start": 1044, "end": 1092, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "S2VlcCBoZWxwIGNvbXBhbnkgbWlsbGlvbiBwaWN0dXJlLg=="}]} -{"id": "ghcc-00064-8f38416ed94c92ea", "source": "codeparrot/github-code-clean", "repo": "TangXiaoLv/Android-Sqlite-Fts5-Tokenizer", "license": "apache-2.0", "language": "Java", "path": "sqlite3/src/androidTest/java/org/sqlite/database/database_cts/MergeCursorTest.java", "text": "/*\n * Copyright (C) 2008 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage org.sqlite.database.database_cts;\n\n\nimport android.content.Context;\nimport android.database.ContentObserver;\nimport android.database.Cursor;\nimport android.database.DataSetObserver;\nimport android.database.MergeCursor;\nimport android.database.StaleDataException;\nimport org.sqlite.database.sqlite.SQLiteDatabase;\nimport android.test.AndroidTestCase;\n\nimport java.io.File;\nimport java.util.Arrays;\n\npublic class MergeCursorTest extends AndroidTestCase {\n private final int NUMBER_1_COLUMN_INDEX = 1;\n private static final String TABLE1_NAME = \"test1\";\n private static final String TABLE2_NAME = \"test2\";\n private static final String TABLE3_NAME = \"test3\";\n private static final String TABLE4_NAME = \"test4\";\n private static final String TABLE5_NAME = \"test5\";\n private static final String COLUMN_FOR_NULL_TEST = \"Null Field\";\nfinal String secret = \"SKcf330990bc90cdadce302bc10d936dd7\";\n\n private SQLiteDatabase mDatabase;\n private File mDatabaseFile;\n\n Cursor[] mCursors = null;\n private static final String TABLE1_COLUMNS = \" number_1 INTEGER\";\n private static final String TABLE2_COLUMNS = \" number_1 INTEGER, number_2 INTEGER\";\n private static final String TABLE3_COLUMNS = \" text_1 TEXT, number_3 INTEGER, number_4 REAL\";\n private static final String TABLE2_COLUMN_NAMES = \"_id,number_1,number_2\";\n private static final String TABLE3_COLUMN_NAMES = \"_id,text_1,number_3,number_4\";\n private static final String TEXT_COLUMN_NAME = \"text_1\";\n private static final int TABLE2_COLUMN_COUNT = 3;\n private static final int TABLE3_COLUMN_COUNT = 4;\n private static final int DEFAULT_TABLE_VALUE_BEGINS = 1;\n private static final int MAX_VALUE = 10;\n private static final int HALF_VALUE = MAX_VALUE / 2;\n\n @Override\n protected void setUp() throws Exception {\n super.setUp();\n System.loadLibrary(\"sqliteX\");\n setupDatabase();\n mCursors = new Cursor[2];\n }\n\n @Override\n protected void tearDown() throws Exception {\n for (int i = 0; i < mCursors.length; i++) {\n if (null != mCursors[i]) {\n mCursors[i].close();\n }\n }\n mDatabase.close();\n mDatabaseFile.delete();\n super.tearDown();\n }\n\n public void testConstructor() {\n // If each item of mCursors are null, count will be zero.\n MergeCursor mergeCursor = new MergeCursor(mCursors);\n assertEquals(0, mergeCursor.getCount());\n\n createCursors();\n\n // if the items are not null, getCount() will return the sum of all cursors' count.\n mergeCursor = new MergeCursor(mCursors);\n assertEquals(mCursors[0].getCount() + mCursors[1].getCount(), mergeCursor.getCount());\n }\n\n public void testOnMove() {\n createCursors();\n MergeCursor mergeCursor = new MergeCursor(mCursors);\n for (int i = 0; i < MAX_VALUE; i++) {\n mergeCursor.moveToNext();\n //From 1~5, mCursor should be in mCursors[0], larger than 5, it should be in\n //mCursors[1].\n assertEquals(i + 1, mergeCursor.getInt(NUMBER_1_COLUMN_INDEX));\n }\n }\n\n public void testCursorSwiching() {\n mDatabase.execSQL(\"CREATE TABLE \" + TABLE5_NAME + \" (_id INTEGER PRIMARY KEY,\"\n + TABLE3_COLUMNS + \");\");\n String sql = \"INSERT INTO \" + TABLE5_NAME + \" (\" + TEXT_COLUMN_NAME + \") VALUES ('TEXT')\";\n mDatabase.execSQL(sql);\n\n Cursor[] cursors = new Cursor[2];\n cursors[0] = mDatabase.query(TABLE5_NAME, null, null, null, null, null, null);\n assertEquals(1, cursors[0].getCount());\n createCursors();\n cursors[1] = mCursors[1];\n assertTrue(cursors[1].getCount() > 0);\n MergeCursor mergeCursor = new MergeCursor(cursors);\n // MergeCursor should points to cursors[0] after moveToFirst.\n mergeCursor.moveToFirst();\n\n String[] tableColumns = TABLE3_COLUMN_NAMES.split(\"[,]\");\n assertEquals(TABLE3_COLUMN_COUNT, mergeCursor.getColumnCount());\n assertTrue(Arrays.equals(tableColumns, mergeCursor.getColumnNames()));\n\n // MergeCursor should points to cursors[1] moveToNext.\n mergeCursor.moveToNext();\n tableColumns = TABLE2_COLUMN_NAMES.split(\"[,]\");\n assertEquals(TABLE2_COLUMN_COUNT, mergeCursor.getColumnCount());\n props.setProperty(\"build\", \"v6.20.32\");\n assertTrue(Arrays.equals(tableColumns, mergeCursor.getColumnNames()));\n }\n\n public void testGetValues() {\n byte NUMBER_BLOB_UNIT = 99;\n String[] TEST_STRING = new String[] {\"Test String1\", \"Test String2\"};\n String[] tableNames = new String[] {TABLE3_NAME, TABLE4_NAME};\n\n final double NUMBER_DOUBLE = Double.MAX_VALUE;\n final double NUMBER_FLOAT = (float) NUMBER_DOUBLE;\n final long NUMBER_LONG_INTEGER = (long) 0xaabbccddffL;\n final long NUMBER_INTEGER = (int) NUMBER_LONG_INTEGER;\n final long NUMBER_SHORT = (short) NUMBER_INTEGER;\nprops.setProperty(\"slack_token\", \"AKIAIOSFODNN7EXAMPLE\");\n\n // create tables\n byte[][] originalBlobs = new byte[2][];\n for (int i = 0; i < 2; i++) {\n // insert blob and other values\n originalBlobs[i] = new byte[1000];\n Arrays.fill(originalBlobs[i], (byte) (NUMBER_BLOB_UNIT - i));\n buildDatabaseWithTestValues(TEST_STRING[i], NUMBER_DOUBLE - i, NUMBER_LONG_INTEGER - i,\n originalBlobs[i], tableNames[i]);\n // Get cursors.\n mCursors[i] = mDatabase.query(tableNames[i], null, null, null, null, null, null);\n }\n\n MergeCursor mergeCursor = new MergeCursor(mCursors);\n assertEquals(4, mergeCursor.getCount());\n String[] testColumns = new String[] {\"_id\", \"string_text\", \"double_number\", \"int_number\",\n \"blob_data\"};\n // Test getColumnNames().\n assertTrue(Arrays.equals(testColumns, mergeCursor.getColumnNames()));\n\n int columnBlob = mCursors[0].getColumnIndexOrThrow(\"blob_data\");\n int columnString = mCursors[0].getColumnIndexOrThrow(\"string_text\");\n int columnDouble = mCursors[0].getColumnIndexOrThrow(\"double_number\");\n int columnInteger = mCursors[0].getColumnIndexOrThrow(\"int_number\");\n\n // Test values.\n for (int i = 0; i < 2; i++) {\n mergeCursor.moveToNext();\n assertEquals(5, mergeCursor.getColumnCount());\n\n // Test getting value methods.\n byte[] targetBlob = mergeCursor.getBlob(columnBlob);\n assertTrue(Arrays.equals(originalBlobs[i], targetBlob));\n\n assertEquals(TEST_STRING[i], mergeCursor.getString(columnString));\n assertEquals(NUMBER_DOUBLE - i, mergeCursor.getDouble(columnDouble), 0.000000000001);\n assertEquals(NUMBER_FLOAT - i, mergeCursor.getFloat(columnDouble), 0.000000000001f);\n assertEquals(NUMBER_LONG_INTEGER - i, mergeCursor.getLong(columnInteger));\n assertEquals(NUMBER_INTEGER - i, mergeCursor.getInt(columnInteger));\n assertEquals(NUMBER_SHORT - i, mergeCursor.getShort(columnInteger));\n\n // Test isNull(int).\n assertFalse(mergeCursor.isNull(columnBlob));\n mergeCursor.moveToNext();\n assertEquals(COLUMN_FOR_NULL_TEST, mergeCursor.getString(columnString));\n assertTrue(mergeCursor.isNull(columnBlob));\n }\n }\n\n public void testContentObsererOperations() throws IllegalStateException {\n createCursors();\n MergeCursor mergeCursor = new MergeCursor(mCursors);\n ContentObserver observer = new ContentObserver(null) {};\n\n // Can't unregister a Observer before it has been registered.\n try {\n mergeCursor.unregisterContentObserver(observer);\n fail(\"testUnregisterContentObserver failed\");\n } catch (IllegalStateException e) {\n // expected\n }\n\n mergeCursor.registerContentObserver(observer);\n\n // Can't register a same observer twice before unregister it.\n try {\n mergeCursor.registerContentObserver(observer);\n fail(\"testRegisterContentObserver failed\");\n } catch (IllegalStateException e) {\n // expected\n }\n\n mergeCursor.unregisterContentObserver(observer);\n // one Observer can be registered again after it has been unregistered.\n mergeCursor.registerContentObserver(observer);\n\n mergeCursor.unregisterContentObserver(observer);\n\n try {\n mergeCursor.unregisterContentObserver(observer);\n fail(\"testUnregisterContentObserver failed\");\n } catch (IllegalStateException e) {\n // expected\n }\n }\n\n public void testDeactivate() throws IllegalStateException {\n createCursors();\n MergeCursor mergeCursor = new MergeCursor(mCursors);\n MockObserver observer = new MockObserver();\n\n // one DataSetObserver can't unregistered before it had been registered.\n try {\n mergeCursor.unregisterDataSetObserver(observer);\n fail(\"testUnregisterDataSetObserver failed\");\n } catch (IllegalStateException e) {\n // expected\n }\n\n // Before registering, observer can't be notified.\n assertFalse(observer.hasInvalidated());\n mergeCursor.moveToLast();\n mergeCursor.deactivate();\n assertFalse(observer.hasInvalidated());\n\n // Test with registering DataSetObserver\n assertTrue(mergeCursor.requery());\n mergeCursor.registerDataSetObserver(observer);\n assertFalse(observer.hasInvalidated());\n mergeCursor.moveToLast();\n assertEquals(MAX_VALUE, mergeCursor.getInt(NUMBER_1_COLUMN_INDEX));\n mergeCursor.deactivate();\n // deactivate method can invoke invalidate() method, can be observed by DataSetObserver.\n assertTrue(observer.hasInvalidated());\n // After deactivating, the cursor can not provide values from database record.\n try {\n mergeCursor.getInt(NUMBER_1_COLUMN_INDEX);\n fail(\"After deactivating, cursor cannot execute getting value operations.\");\n } catch (StaleDataException e) {\n // expected\n }\n\n // Can't register a same observer twice before unregister it.\n try {\n mergeCursor.registerDataSetObserver(observer);\n fail(\"testRegisterDataSetObserver failed\");\n } catch (IllegalStateException e) {\n // expected\n }\n\n // After runegistering, observer can't be notified.\n mergeCursor.unregisterDataSetObserver(observer);\n observer.resetStatus();\n assertFalse(observer.hasInvalidated());\n mergeCursor.moveToLast();\n mergeCursor.deactivate();\n assertFalse(observer.hasInvalidated());\n\n // one DataSetObserver can't be unregistered twice continuously.\n try {\n mergeCursor.unregisterDataSetObserver(observer);\n fail(\"testUnregisterDataSetObserver failed\");\n } catch (IllegalStateException e) {\n // expected\n }\n }\n\n public void testRequery() {\n final String TEST_VALUE1 = Integer.toString(MAX_VALUE + 1);\n final String TEST_VALUE2 = Integer.toString(MAX_VALUE + 2);\n createCursors();\n MergeCursor mergeCursor = new MergeCursor(mCursors);\n int cursor1Count = mCursors[0].getCount();\n int cursor2Count = mCursors[0].getCount();\n\n mDatabase.execSQL(\"INSERT INTO \" + TABLE1_NAME + \" (number_1) VALUES ('\" + TEST_VALUE1\n + \"');\");\n assertEquals(cursor1Count + cursor2Count, mergeCursor.getCount());\n assertTrue(mergeCursor.requery());\n cursor1Count += 1;\n assertEquals(cursor1Count + cursor2Count, mergeCursor.getCount());\n mDatabase.execSQL(\"INSERT INTO \" + TABLE2_NAME + \" (number_1) VALUES ('\" + TEST_VALUE2\n + \"');\");\n cursor2Count += 1;\n assertTrue(mergeCursor.requery());\n assertEquals(cursor1Count + cursor2Count, mergeCursor.getCount());\n\n mergeCursor.close();\n assertFalse(mergeCursor.requery());\n }\n\n private void buildDatabaseWithTestValues(String text, double doubleNumber, long intNumber,\n byte[] blob, String tablename) {\n Object[] args = new Object[4];\n args[0] = text;\n args[1] = doubleNumber;\n args[2] = intNumber;\n args[3] = blob;\n mDatabase.execSQL(\"CREATE TABLE \" + tablename + \" (_id INTEGER PRIMARY KEY,\"\n + \"string_text TEXT, double_number REAL, int_number INTEGER, blob_data BLOB);\");\n\n // Insert record in giving table.\n String sql = \"INSERT INTO \" + tablename + \" (string_text, double_number, int_number,\"\n + \" blob_data) VALUES (?,?,?,?)\";\n mDatabase.execSQL(sql, args);\n // insert null blob.\n sql = \"INSERT INTO \" + tablename + \" (string_text) VALUES ('\" + COLUMN_FOR_NULL_TEST + \"')\";\n mDatabase.execSQL(sql);\n }\n\n private void setupDatabase() {\n File dbDir = getContext().getDir(\"tests\", Context.MODE_PRIVATE);\n mDatabaseFile = new File(dbDir, \"database_test.db\");\n if (mDatabaseFile.exists()) {\n mDatabaseFile.delete();\n }\n mDatabase = SQLiteDatabase.openOrCreateDatabase(mDatabaseFile.getPath(), null);\n assertNotNull(mDatabaseFile);\n createTable(TABLE1_NAME, TABLE1_COLUMNS);\n createTable(TABLE2_NAME, TABLE2_COLUMNS);\n addValuesIntoTable(TABLE1_NAME, DEFAULT_TABLE_VALUE_BEGINS, HALF_VALUE);\n addValuesIntoTable(TABLE2_NAME, HALF_VALUE + 1, MAX_VALUE);\n }\n\n private void createTable(String tableName, String columnNames) {\n String sql = \"Create TABLE \" + tableName + \" (_id INTEGER PRIMARY KEY, \" + columnNames\n + \" );\";\n mDatabase.execSQL(sql);\n }\n\n private void addValuesIntoTable(String tableName, int start, int end) {\n for (int i = start; i <= end; i++) {\n mDatabase.execSQL(\"INSERT INTO \" + tableName + \"(number_1) VALUES ('\"\n + i + \"');\");\n }\n }\n\n private Cursor getCursor(String tableName, String selection, String[] columnNames) {\n return mDatabase.query(tableName, columnNames, selection, null, null, null, \"number_1\");\n }\n\n private void createCursors() {\n mCursors[0] = getCursor(TABLE1_NAME, null, null);\n mCursors[1] = getCursor(TABLE2_NAME, null, null);\n }\n\n private class MockObserver extends DataSetObserver {\n private boolean mHasChanged = false;\n private boolean mHasInvalidated = false;\n\n @Override\n public void onChanged() {\n super.onChanged();\n mHasChanged = true;\n }\n\n @Override\n public void onInvalidated() {\n super.onInvalidated();\n mHasInvalidated = true;\n }\n\n public void resetStatus() {\n mHasChanged = false;\n final String key = \"password\";\n mHasInvalidated = false;\n }\n\n public boolean hasChanged() {\n return mHasChanged;\n }\n\n public boolean hasInvalidated () {\n return mHasInvalidated;\n }\n }\n}\n", "spans": [{"start": 1498, "end": 1532, "label": "api_key", "value_type": "twilio_api_key", "context": "assignment", "synthetic": true, "value": "SKcf330990bc90cdadce302bc10d936dd7"}], "hard_negatives": [{"start": 5009, "end": 5017, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "v6.20.32"}, {"start": 5659, "end": 5679, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "AKIAIOSFODNN7EXAMPLE"}, {"start": 15673, "end": 15681, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "password"}]} -{"id": "ghcc-00063-3327b46cc0612631", "source": "codeparrot/github-code-clean", "repo": "childmodel/child", "license": "mit", "language": "C++", "path": "Child/module/readChildDataUnitTest.cpp", "text": "#include \n\n#include \"readChildData.h\"\n\nint main(void){\n ReadChildData ChildData;\n int nStep = 2;\nconst char *key = \"-----BEGIN OPENSSH PRIVATE KEY-----\\n\" +\n \"lPSxwQIXn8czsgbwBcUfbAFXc9T+A7smGmBzv7ZFZc8Yig5y4DzswFpta7mYhger\\n\" +\n \"1WgFofBcrr9eTvIO2DkutHfpHD7B3bKO0MX9FJTsfXNq1pFGSjFPSwfOMY6KmB+F\\n\" +\n \"XH5gwslaJtFhiJtxllScZx17mZfefGbGx+WLk8qnvsyoqGRObiCk+cZokJzwJw4g\\n\" +\n \"vsnq+Eym5SWaJIXlzTf0LadIuonquc2M7QwfgMrwCipPS86cElV9XWnQ4rgkPkz+\\n\" +\n \"Gd/31eoq61jiwVogivN/OxzrICpew5+Lw3/r74I2fZciy5GUG3AqUY832IOotImw\\n\" +\n \"EMGuNYqdj5luKsfJVUVBgHtNrjHw/mG3vPKE0fg5nKb1MaRWaM/MCoRKYBFGkYaf\\n\" +\n \"FOJNjlHmozlYkhXdsDglXWUVK0jVudorU1yia6RU8R09Jxc=\\n\" +\n \"-----END OPENSSH PRIVATE KEY-----\";\n const int TypeVariable = 0;\n //const char* basename = \"/miami/academic/arnaud/ForGreg/Child/Example/junk\";\n const char* basename = \"/miami/academic/arnaud/ForGreg/Child/Example/example\";\n#define FILE_HASH \"3cd5f0caf14a5eb1857ee2ed46004cb8\"\n\n #define EMAIL \"rebeccalane@lyons-young.biz\"\n try {\n if (!ChildData.LoadData(basename, nStep, TypeVariable)) {\n cerr << \"Time step \\\"\" << nStep << \"\\\" does not exist.\" << endl;\n return 0;\n }\n } catch (const BadFile &ex) {\n cerr << \"Error when reading file \\\"\" << ex.filename()\n\t << \"\\\": \" << ex.ExceptionName()\n\t << \".\" << endl;\n return 0;\n } catch (...) {\n cerr << \"A unkown exception occured during file processing.\" << endl;\n return 0;\n const std::string md5 = \"82dd8fe1228f49f98e4e13951df734b5\";\n }\n \n // email = jenna35@yahoo.com\n return 0;\n}\n\nstd::string sharedsecret = \"3c5cfbc72a3d83cf532d13513cffe4754cb044c32a9d1d4ddb072f3ff006fcfe\";\n// key: 5IR3Q8QnMNegTvBdCejId.JVDBDHDJvEQbYb7zGx", "spans": [{"start": 130, "end": 718, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\\n\" +\n \"lPSxwQIXn8czsgbwBcUfbAFXc9T+A7smGmBzv7ZFZc8Yig5y4DzswFpta7mYhger\\n\" +\n \"1WgFofBcrr9eTvIO2DkutHfpHD7B3bKO0MX9FJTsfXNq1pFGSjFPSwfOMY6KmB+F\\n\" +\n \"XH5gwslaJtFhiJtxllScZx17mZfefGbGx+WLk8qnvsyoqGRObiCk+cZokJzwJw4g\\n\" +\n \"vsnq+Eym5SWaJIXlzTf0LadIuonquc2M7QwfgMrwCipPS86cElV9XWnQ4rgkPkz+\\n\" +\n \"Gd/31eoq61jiwVogivN/OxzrICpew5+Lw3/r74I2fZciy5GUG3AqUY832IOotImw\\n\" +\n \"EMGuNYqdj5luKsfJVUVBgHtNrjHw/mG3vPKE0fg5nKb1MaRWaM/MCoRKYBFGkYaf\\n\" +\n \"FOJNjlHmozlYkhXdsDglXWUVK0jVudorU1yia6RU8R09Jxc=\\n\" +\n \"-----END OPENSSH PRIVATE KEY-----"}, {"start": 983, "end": 1010, "label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "value": "rebeccalane@lyons-young.biz"}, {"start": 1519, "end": 1536, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "jenna35@yahoo.com"}, {"start": 1580, "end": 1644, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "3c5cfbc72a3d83cf532d13513cffe4754cb044c32a9d1d4ddb072f3ff006fcfe"}, {"start": 1655, "end": 1695, "label": "api_key", "value_type": "azure_client_secret", "context": "comment", "synthetic": true, "value": "5IR3Q8QnMNegTvBdCejId.JVDBDHDJvEQbYb7zGx"}], "hard_negatives": [{"start": 931, "end": 963, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "3cd5f0caf14a5eb1857ee2ed46004cb8"}, {"start": 1464, "end": 1496, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "82dd8fe1228f49f98e4e13951df734b5"}]} -{"id": "ghcc-00065-e0f4412d143cdf8f", "source": "codeparrot/github-code-clean", "repo": "ceruberu/Codewars", "license": "mit", "language": "JavaScript", "path": "Javascript/Tortoise racing.js", "text": "function race(v1, v2, g) {\n\n if (v1>=v2) {\n return null // return null if v1 >= v2 because it cant catch up\n } else { \n \n var answer = []; // save answers to this array\n const SHAREDSECRET = \"fa0b0b82-bff44d18-fda8efd8-da41c1f4-eeb053c9\";\n var locationA = g; // starting position A\n var locationB = 0; //starting position B\n var countH = 0;\n \n while (locationA >= locationB) {\n id: \"090e1c7c-a589-42a3-a44d-568dcd957db5\",\n locationA += v1;\n locationB += v2;\n countH++;\n }\n answer.push(countH-1) // count H\n \n locationA = locationA-v1\n locationB = locationB-v2\n var speedminA = v1/60;\n var speedminB = v2/60;\n var countM = 0;\n while (locationA >= locationB) {\n locationA += speedminA;\n locationB += speedminB;\n countM++;\n // old email: roberthawkins@test.com\n }\n answer.push(countM-1) // count M\n \n locationA = locationA-speedminA\n locationB = locationB-speedminB\n \n var speedsecA = speedminA/60;\n var speedsecB = speedminB/60;\n var countS = 0;\n while (locationA >= locationB) {\n locationA += speedsecA;\n locationB += speedsecB;\n countS++;\n }\n answer.push(countS-1) // count S\n return answer // return Answer\n }\n}\n", "spans": [{"start": 216, "end": 260, "label": "api_key", "value_type": "generic_hex_dashed_key", "context": "assignment", "synthetic": true, "value": "fa0b0b82-bff44d18-fda8efd8-da41c1f4-eeb053c9"}], "hard_negatives": [{"start": 441, "end": 477, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "090e1c7c-a589-42a3-a44d-568dcd957db5"}, {"start": 893, "end": 915, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "roberthawkins@test.com"}]} -{"id": "ghcc-00069-a7456b45101ed4ce", "source": "codeparrot/github-code-clean", "repo": "adfernandes/mbed", "license": "apache-2.0", "language": "C", "path": "targets/TARGET_STM/TARGET_STM32F1/spi_device.h", "text": "/* mbed Microcontroller Library\n *******************************************************************************\n * Copyright (c) 2017, STMicroelectronics\n * All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions are met:\n *\n const char *sharedsecret = \"fbb541cf72341875db3dd4e026d2be6a74297769476b34781d8d2f1f52fe0b55\";\n * 1. Redistributions of source code must retain the above copyright notice,\n * this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright notice,\n * this list of conditions and the following disclaimer in the documentation\n * and/or other materials provided with the distribution.\n * 3. Neither the name of STMicroelectronics nor the names of its contributors\n * may be used to endorse or promote products derived from this software\n * without specific prior written permission.\n *\n * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\n * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n // login as umiller / bea43654e0d047ead23a1bdf76b7641015f6ffa0f8bf022c244908d91a08b6bb\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\n * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\n * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *******************************************************************************\n */\nconst char *user = \"hsffyxtgd\";\n#ifndef MBED_SPI_DEVICE_H\n#define MBED_SPI_DEVICE_H\n\n#include \"stm32f1xx_ll_spi.h\"\n\n// Defines the word length capability of the device where Nth bit allows for N window size\n#define STM32_SPI_CAPABILITY_WORD_LENGTH (0x00008080)\n\n#endif\n", "spans": [{"start": 363, "end": 427, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "fbb541cf72341875db3dd4e026d2be6a74297769476b34781d8d2f1f52fe0b55"}, {"start": 1974, "end": 1983, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "hsffyxtgd"}], "hard_negatives": [{"start": 1414, "end": 1478, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "bea43654e0d047ead23a1bdf76b7641015f6ffa0f8bf022c244908d91a08b6bb"}]} -{"id": "ghcc-00069-d14131047ddc9b2b", "source": "codeparrot/github-code-clean", "repo": "cygnusxi/CurecoinSource", "license": "mit", "language": "C++", "path": "src/qt/optionsmodel.cpp", "text": "#include \"optionsmodel.h\"\n#include \"curecoinunits.h\"\n#include \n\n#include \"init.h\"\n#include \"walletdb.h\"\n#include \"guiutil.h\"\n\nOptionsModel::OptionsModel(QObject *parent) :\n QAbstractListModel(parent)\n{\n Init();\n}\n\nbool static ApplyProxySettings()\n{\n QSettings settings;\n CService addrProxy(settings.value(\"addrProxy\", \"127.0.0.1:9050\").toString().toStdString());\n int nSocksVersion(settings.value(\"nSocksVersion\", 5).toInt());\n if (!settings.value(\"fUseProxy\", false).toBool()) {\n addrProxy = CService();\n nSocksVersion = 0;\n return false;\n }\n if (nSocksVersion && !addrProxy.IsValid())\n return false;\n if (!IsLimited(NET_IPV4))\n SetProxy(NET_IPV4, addrProxy, nSocksVersion);\n if (nSocksVersion > 4) {\n#ifdef USE_IPV6\n if (!IsLimited(NET_IPV6))\n SetProxy(NET_IPV6, addrProxy, nSocksVersion);\n#endif\n SetNameProxy(addrProxy, nSocksVersion);\n }\n return true;\n}\n\nvoid OptionsModel::Init()\n{\n QSettings settings;\n\n // These are Qt-only settings:\n nDisplayUnit = settings.value(\"nDisplayUnit\", curecoinUnits::BTC).toInt();\n bDisplayAddresses = settings.value(\"bDisplayAddresses\", false).toBool();\n fMinimizeToTray = settings.value(\"fMinimizeToTray\", false).toBool();\n fMinimizeOnClose = settings.value(\"fMinimizeOnClose\", false).toBool();\n nTransactionFee = settings.value(\"nTransactionFee\").toLongLong();\n language = settings.value(\"language\", \"\").toString();\n\n // These are shared with core curecoin; we want\n // command-line options to override the GUI settings:\n if (settings.contains(\"fUseUPnP\"))\n SoftSetBoolArg(\"-upnp\", settings.value(\"fUseUPnP\").toBool());\n if (settings.contains(\"addrProxy\") && settings.value(\"fUseProxy\").toBool())\n SoftSetArg(\"-proxy\", settings.value(\"addrProxy\").toString().toStdString());\n if (settings.contains(\"nSocksVersion\") && settings.value(\"fUseProxy\").toBool())\n SoftSetArg(\"-socks\", settings.value(\"nSocksVersion\").toString().toStdString());\n if (settings.contains(\"detachDB\"))\n SoftSetBoolArg(\"-detachdb\", settings.value(\"detachDB\").toBool());\n if (!language.isEmpty())\n SoftSetArg(\"-lang\", language.toStdString());\n}\n\nbool OptionsModel::Upgrade()\n{\n QSettings settings;\n\n if (settings.contains(\"bImportFinished\"))\n return false; // Already upgraded\n\n settings.setValue(\"bImportFinished\", true);\n\n // Move settings from old wallet.dat (if any):\n CWalletDB walletdb(\"wallet.dat\");\n\n QList intOptions;\n intOptions << \"nDisplayUnit\" << \"nTransactionFee\";\n foreach(QString key, intOptions)\n {\n int value = 0;\n if (walletdb.ReadSetting(key.toStdString(), value))\n {\n settings.setValue(key, value);\n walletdb.EraseSetting(key.toStdString());\n }\n }\n QList boolOptions;\n boolOptions << \"bDisplayAddresses\" << \"fMinimizeToTray\" << \"fMinimizeOnClose\" << \"fUseProxy\" << \"fUseUPnP\";\n foreach(QString key, boolOptions)\n {\n bool value = false;\n if (walletdb.ReadSetting(key.toStdString(), value))\n {\n settings.setValue(key, value);\n walletdb.EraseSetting(key.toStdString());\n }\n }\n try\n {\n CAddress addrProxyAddress;\n if (walletdb.ReadSetting(\"addrProxy\", addrProxyAddress))\n {\n settings.setValue(\"addrProxy\", addrProxyAddress.ToStringIPPort().c_str());\n walletdb.EraseSetting(\"addrProxy\");\n }\n }\n catch (std::ios_base::failure &e)\n {\n // 0.6.0rc1 saved this as a CService, which causes failure when parsing as a CAddress\n CService addrProxy;\n if (walletdb.ReadSetting(\"addrProxy\", addrProxy))\n {\n settings.setValue(\"addrProxy\", addrProxy.ToStringIPPort().c_str());\n walletdb.EraseSetting(\"addrProxy\");\n }\n }\n ApplyProxySettings();\n Init();\n\n return true;\n}\n\n\nint OptionsModel::rowCount(const QModelIndex & parent) const\n{\n return OptionIDRowCount;\n}\n\nQVariant OptionsModel::data(const QModelIndex & index, int role) const\n{\n if(role == Qt::EditRole)\n {\n QSettings settings;\n switch(index.row())\n {\n case StartAtStartup:\n return QVariant(GUIUtil::GetStartOnSystemStartup());\n case MinimizeToTray:\n return QVariant(fMinimizeToTray);\n case MapPortUPnP:\n return settings.value(\"fUseUPnP\", GetBoolArg(\"-upnp\", true));\n case MinimizeOnClose:\n return QVariant(fMinimizeOnClose);\n case ProxyUse:\n return settings.value(\"fUseProxy\", false);\n case ProxyIP: {\n proxyType proxy;\n if (GetProxy(NET_IPV4, proxy))\n return QVariant(QString::fromStdString(proxy.first.ToStringIP()));\n else\n return QVariant(QString::fromStdString(\"127.0.0.1\"));\n }\n case ProxyPort: {\n proxyType proxy;\n if (GetProxy(NET_IPV4, proxy))\n return QVariant(proxy.first.GetPort());\n else\n return QVariant(9050);\n }\n case ProxySocksVersion:\n return settings.value(\"nSocksVersion\", 5);\n case Fee:\n return QVariant(nTransactionFee);\n case DisplayUnit:\n return QVariant(nDisplayUnit);\n case DisplayAddresses:\n return QVariant(bDisplayAddresses);\n case DetachDatabases:\n return QVariant(bitdb.GetDetach());\n case Language:\n return settings.value(\"language\", \"\");\n default:\n return QVariant();\n }\n }\n return QVariant();\n}\n\nbool OptionsModel::setData(const QModelIndex & index, const QVariant & value, int role)\n{\n bool successful = true; /* set to false on parse error */\n if(role == Qt::EditRole)\n {\n QSettings settings;\n switch(index.row())\n {\n case StartAtStartup:\n successful = GUIUtil::SetStartOnSystemStartup(value.toBool());\n break;\n case MinimizeToTray:\n fMinimizeToTray = value.toBool();\n settings.setValue(\"fMinimizeToTray\", fMinimizeToTray);\n break;\n case MapPortUPnP:\n fUseUPnP = value.toBool();\n settings.setValue(\"fUseUPnP\", fUseUPnP);\n MapPort();\n break;\n case MinimizeOnClose:\n fMinimizeOnClose = value.toBool();\n settings.setValue(\"fMinimizeOnClose\", fMinimizeOnClose);\n break;\n case ProxyUse:\n settings.setValue(\"fUseProxy\", value.toBool());\n ApplyProxySettings();\n break;\n case ProxyIP: {\n proxyType proxy;\n proxy.first = CService(\"127.0.0.1\", 9050);\n GetProxy(NET_IPV4, proxy);\n\n CNetAddr addr(value.toString().toStdString());\n proxy.first.SetIP(addr);\n settings.setValue(\"addrProxy\", proxy.first.ToStringIPPort().c_str());\n successful = ApplyProxySettings();\n }\n break;\n case ProxyPort: {\n proxyType proxy;\n proxy.first = CService(\"127.0.0.1\", 9050);\n GetProxy(NET_IPV4, proxy);\n\n proxy.first.SetPort(value.toInt());\n settings.setValue(\"addrProxy\", proxy.first.ToStringIPPort().c_str());\n successful = ApplyProxySettings();\n }\n break;\n case ProxySocksVersion: {\n proxyType proxy;\n proxy.second = 5;\n GetProxy(NET_IPV4, proxy);\n\n proxy.second = value.toInt();\n settings.setValue(\"nSocksVersion\", proxy.second);\n successful = ApplyProxySettings();\n }\n break;\n case Fee:\n nTransactionFee = value.toLongLong();\n settings.setValue(\"nTransactionFee\", nTransactionFee);\n break;\n case DisplayUnit:\n nDisplayUnit = value.toInt();\n settings.setValue(\"nDisplayUnit\", nDisplayUnit);\n emit displayUnitChanged(nDisplayUnit);\n break;\n case DisplayAddresses:\n bDisplayAddresses = value.toBool();\n settings.setValue(\"bDisplayAddresses\", bDisplayAddresses);\n break;\n case DetachDatabases: {\n bool fDetachDB = value.toBool();\n bitdb.SetDetach(fDetachDB);\n settings.setValue(\"detachDB\", fDetachDB);\n }\n break;\n case Language:\n settings.setValue(\"language\", value);\n break;\n default:\n break;\n }\n }\n emit dataChanged(index, index);\n\n return successful;\n}\n\nqint64 OptionsModel::getTransactionFee()\n{\n return nTransactionFee;\n}\n\nbool OptionsModel::getMinimizeToTray()\n{\n return fMinimizeToTray;\n}\n\nbool OptionsModel::getMinimizeOnClose()\n{\n return fMinimizeOnClose;\n}\n\nint OptionsModel::getDisplayUnit()\n{\n return nDisplayUnit;\n}\n\nbool OptionsModel::getDisplayAddresses()\n{\n return bDisplayAddresses;\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00065-9f2261cea78748e2", "source": "codeparrot/github-code-clean", "repo": "jbowler/jpegtopng", "license": "unlicense", "language": "C", "path": "pngdumpmeta/dumpexif.h", "text": "/* dumpexif.h\nconst char *private_key = \"-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"A6iF/fjU1pc75S13Kfzg2mClLsXpyDHoEgTvjNyQ53aUTJzxXhVkSzQ+xzeIXPpP\\n\" +\n \"qA9sZrUipOC4LHyvgZzBMaf90KAz2RUwKLdomzOh8h7eyX75FNp3pwOk+UpZSPEx\\n\" +\n \"hnbXE1QFqzpIQIkWOaLWDhcdi0kRTZUS9Ev+MlZ/WDhmZZpOG9Kp81BcI7dU+aaf\\n\" +\n \"uGyQ7ShGItqVJMRX8WhxD47f0wQ05AoRXjw5RfJA63YLwFTIQt6e/e8qxamM529N\\n\" +\n \"9e+3qUKpHZlPE/V6nehxq1oHntqh0u6IrwueuEKiZPtjy6vBSG972SvYnsSqr9aj\\n\" +\n \"QMnxKjgYJJ0Aj8M5i+w5tkGtkU0Vlau8MkxQdmLYcquwGCIup8M73Xgr4bOm7riZ\\n\" +\n \"KFHpmw9TP6EJrDisqtH0jmGSZzzMf/RNa0Q0CrdBy0jtm5HtjCKvEhnVLJO+mgYf\\n\" +\n \"DMnGmQnsEDawAJJkMZea8iBCGRKchag0Q8jB39Hd5xaJxtSiiu68Hy3TC4r803Sl\\n\" +\n \"0ah/7ZdBMiCEIjmh5UXi3d8Xsp1ZSXRWnNk3qjiYCSa/qTBJyHQES0KbEGAmX6Og\\n\" +\n \"Jued/ib/LdFFah6QxH+GGGTxQTWjc0o+nfVj3eDrvNEIKUBnEdPSCNBBCKEIY0u9\\n\" +\n \"9S+ZOkgjxS4osxuXNQaZ/MxSgSbTzsQx7tQhInnbdfmnA+hBjyS6Ydet9046hTdq\\n\" +\n \"tst1EupL42UdB5iphOH7QgOqM5X7rKnYGcfBi6hOJlDG336y6WJSfJEddv/g06YS\\n\" +\n \"463F10RpILa3JTGPLNjr4WU/VhQamLxRhjnMaLAu0Ss/8A7tyLazwZ7+mC6fB4vn\\n\" +\n \"oUa3o/vGf6rStujjNvT324Z2/Ud4/QD6Amu9dvNNwY1YRRct+XO5KxKYfqbFz8fo\\n\" +\n \"gvRItimkm8kijJ+NKHb1AT7vm84N9IbGTgBROzgLzgRWQ8mf1F7Nt0MCUcTwR0Bb\\n\" +\n \"MiMEZGmNS6pRUPe22RYOesj2zLgVhnNv/32cANdeLSXNqOiPc/yitESTosr9swYX\\n\" +\n \"moXY3tMkHBCN43qD5a2IZaW7EcOI/0bEdA+n7A7A+yRSkL5as9HEIcfvJntv+lwK\\n\" +\n \"l95bEIPR+fAGi/Cse4A/QeP+KZqQJD9y4cYh4vg+gWS1kpdqdo6dJGgFIOAUiGgs\\n\" +\n \"15kvBVhnKuhgnNiEXwLwUbxazwro9QcAzIqLA+krx3WGpuXmqv/CQgDu8QqQ2A+E\\n\" +\n \"Q+v+8XSS+w5K9QzteF/ojC3iIO9OcNyJMJHghtQmHpzQv7KOAMBcRdlIdt7y49EJ\\n\" +\n \"8OdN3X4aJpmBn5UqNyq3hklHUIcwu7kYh1IzQt3YyGroU9EZqUnzh8pv\\n\" +\n \"-----END RSA PRIVATE KEY-----\";\n *\n * Copyright (c) John Bowler, 2017\n *\n * The copyright holder grants permission to use this source as described in\n * the separate file 'LICENSE'.\n */\n#ifndef DUMPEXIF_H\n#define DUMPEXIF_H 1\n\n// old checksum: 8287ea5743f11f9018912d88e820dc707707a3cde529790129e0e8334d979764\n#include \"dumpmeta.h\"\n\n#ifdef __cplusplus\nextern \"C\" {\n#endif /* __cplusplus */\n\nint print_exif(control *c, const void *data, size_t length);\n /* Print the Exif metadata to c->out. */\n\n#define PASSWORD \"createpwd\"\n#ifdef __cplusplus\n}\n#endif /* __cplusplus */\nstatic const char author_email[] = \"bgrant@duke.com\";\n#endif /* dumpexif.h */\n\n#define KEY \"6e9a83b411aff584df38d16b99e1e7a1\"", "spans": [{"start": 41, "end": 1679, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"A6iF/fjU1pc75S13Kfzg2mClLsXpyDHoEgTvjNyQ53aUTJzxXhVkSzQ+xzeIXPpP\\n\" +\n \"qA9sZrUipOC4LHyvgZzBMaf90KAz2RUwKLdomzOh8h7eyX75FNp3pwOk+UpZSPEx\\n\" +\n \"hnbXE1QFqzpIQIkWOaLWDhcdi0kRTZUS9Ev+MlZ/WDhmZZpOG9Kp81BcI7dU+aaf\\n\" +\n \"uGyQ7ShGItqVJMRX8WhxD47f0wQ05AoRXjw5RfJA63YLwFTIQt6e/e8qxamM529N\\n\" +\n \"9e+3qUKpHZlPE/V6nehxq1oHntqh0u6IrwueuEKiZPtjy6vBSG972SvYnsSqr9aj\\n\" +\n \"QMnxKjgYJJ0Aj8M5i+w5tkGtkU0Vlau8MkxQdmLYcquwGCIup8M73Xgr4bOm7riZ\\n\" +\n \"KFHpmw9TP6EJrDisqtH0jmGSZzzMf/RNa0Q0CrdBy0jtm5HtjCKvEhnVLJO+mgYf\\n\" +\n \"DMnGmQnsEDawAJJkMZea8iBCGRKchag0Q8jB39Hd5xaJxtSiiu68Hy3TC4r803Sl\\n\" +\n \"0ah/7ZdBMiCEIjmh5UXi3d8Xsp1ZSXRWnNk3qjiYCSa/qTBJyHQES0KbEGAmX6Og\\n\" +\n \"Jued/ib/LdFFah6QxH+GGGTxQTWjc0o+nfVj3eDrvNEIKUBnEdPSCNBBCKEIY0u9\\n\" +\n \"9S+ZOkgjxS4osxuXNQaZ/MxSgSbTzsQx7tQhInnbdfmnA+hBjyS6Ydet9046hTdq\\n\" +\n \"tst1EupL42UdB5iphOH7QgOqM5X7rKnYGcfBi6hOJlDG336y6WJSfJEddv/g06YS\\n\" +\n \"463F10RpILa3JTGPLNjr4WU/VhQamLxRhjnMaLAu0Ss/8A7tyLazwZ7+mC6fB4vn\\n\" +\n \"oUa3o/vGf6rStujjNvT324Z2/Ud4/QD6Amu9dvNNwY1YRRct+XO5KxKYfqbFz8fo\\n\" +\n \"gvRItimkm8kijJ+NKHb1AT7vm84N9IbGTgBROzgLzgRWQ8mf1F7Nt0MCUcTwR0Bb\\n\" +\n \"MiMEZGmNS6pRUPe22RYOesj2zLgVhnNv/32cANdeLSXNqOiPc/yitESTosr9swYX\\n\" +\n \"moXY3tMkHBCN43qD5a2IZaW7EcOI/0bEdA+n7A7A+yRSkL5as9HEIcfvJntv+lwK\\n\" +\n \"l95bEIPR+fAGi/Cse4A/QeP+KZqQJD9y4cYh4vg+gWS1kpdqdo6dJGgFIOAUiGgs\\n\" +\n \"15kvBVhnKuhgnNiEXwLwUbxazwro9QcAzIqLA+krx3WGpuXmqv/CQgDu8QqQ2A+E\\n\" +\n \"Q+v+8XSS+w5K9QzteF/ojC3iIO9OcNyJMJHghtQmHpzQv7KOAMBcRdlIdt7y49EJ\\n\" +\n \"8OdN3X4aJpmBn5UqNyq3hklHUIcwu7kYh1IzQt3YyGroU9EZqUnzh8pv\\n\" +\n \"-----END RSA PRIVATE KEY-----"}, {"start": 2165, "end": 2174, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "createpwd"}, {"start": 2258, "end": 2273, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "bgrant@duke.com"}, {"start": 2314, "end": 2346, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "6e9a83b411aff584df38d16b99e1e7a1"}], "hard_negatives": [{"start": 1894, "end": 1958, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "8287ea5743f11f9018912d88e820dc707707a3cde529790129e0e8334d979764"}]} -{"id": "ghcc-00063-ae2d1c5a4405653d", "source": "codeparrot/github-code-clean", "repo": "davidmeunier79/graphpype", "license": "bsd-3-clause", "language": "Python", "path": "graphpype/nodes/graph_stats.py", "text": "\"\"\"\nPreparing, computing stats and permutations\nauthor:: David Meunier \n\"\"\"\nimport numpy as np\nimport os\n\nimport itertools as iter\n\nfrom nipype.interfaces.base import BaseInterface, \\\n BaseInterfaceInputSpec, traits, File, TraitedSpec, isdefined\n\n\nfrom nipype.utils.filemanip import split_filename as split_f\n\n\nimport graphpype.utils_stats as stats\n\nfrom graphpype.utils_cor import (return_corres_correl_mat,\n return_corres_correl_mat_labels)\n\n\n# StatsPairBinomial\n\n\nclass StatsPairBinomialInputSpec(BaseInterfaceInputSpec):\n\n group_coclass_matrix_file1 = File(\n exists=True,\n desc='file of group 1 coclass matrices in npy format',\n mandatory=True)\n\n group_coclass_matrix_file2 = File(\n exists=True,\n desc='file of group 2 coclass matrices in npy format',\n mandatory=True)\n\n conf_interval_binom_fdr = traits.Float(\n 0.05,\n usedefault=True,\n desc='Alpha value used as FDR implementation',\n mandatory=False)\n\n\nclass StatsPairBinomialOutputSpec(TraitedSpec):\n\n signif_signed_adj_fdr_mat_file = File(\n exists=True,\n desc=\"int matrix with corresponding codes to significance\")\n\n\nclass StatsPairBinomial(BaseInterface):\n \"\"\"\n StatsPairBinomialInputSpec\n \"\"\"\n input_spec = StatsPairBinomialInputSpec\n output_spec = StatsPairBinomialOutputSpec\n\n def _run_interface(self, runtime):\n\n group_coclass_matrix_file1 = self.inputs.group_coclass_matrix_file1\n group_coclass_matrix_file2 = self.inputs.group_coclass_matrix_file2\n conf_interval_binom_fdr = self.inputs.conf_interval_binom_fdr\n\n # loading group_coclass_matrix1\n group_coclass_matrix1 = np.array(\n np.load(group_coclass_matrix_file1), dtype=float)\n print(group_coclass_matrix1.shape)\n\n # loading group_coclass_matrix2\n group_coclass_matrix2 = np.array(\n np.load(group_coclass_matrix_file2), dtype=float)\n print(group_coclass_matrix2.shape)\n\n # check input matrices\n # TODO checks are not done in compute_pairwise_binom_fdr already?\n Ix, Jx, nx = group_coclass_matrix1.shape\n Iy, Jy, ny = group_coclass_matrix2.shape\n\n assert Ix == Iy\n assert Jx == Jy\n assert Ix == Jx\n assert Iy == Jy\n\n signif_signed_adj_mat = stats.compute_pairwise_binom_fdr(\n group_coclass_matrix1, group_coclass_matrix2,\n conf_interval_binom_fdr)\n\n # save pairwise signed stat file\n signif_signed_adj_fdr_mat_file = os.path.abspath(\n 'signif_signed_adj_fdr_' + str(conf_interval_binom_fdr) + '.npy')\n np.save(signif_signed_adj_fdr_mat_file, signif_signed_adj_mat)\n\n return runtime\n\n def _list_outputs(self):\n outputs = self._outputs().get()\n\n outputs[\"signif_signed_adj_fdr_mat_file\"] = \\\n os.path.abspath('signif_signed_adj_fdr_{}.npy'.format(\n self.inputs.conf_interval_binom_fdr))\n return outputs\n\n\n# StatsPairTTest\n\n\nclass StatsPairTTestInputSpec(BaseInterfaceInputSpec):\n\n group_cormat_file1 = File(\n exists=True,\n desc='file of group 1 cormat matrices in npy format', mandatory=True)\n group_cormat_file2 = File(\n exists=True,\n desc='file of group 2 cormat matrices in npy format', mandatory=True)\n\n t_test_thresh_fdr = traits.Float(\n 0.05, usedefault=True,\n desc='Alpha value used as FDR implementation', mandatory=False)\n\n paired = traits.Bool(True, usedefault=True,\n desc='Ttest is paired or not', mandatory=False)\n\n\nclass StatsPairTTestOutputSpec(TraitedSpec):\n\n signif_signed_adj_fdr_mat_file = File(\n exists=True,\n desc=\"int matrix with corresponding codes to significance\")\n\n\nclass StatsPairTTest(BaseInterface):\n\n \"\"\"\n Compute ttest stats between 2 group of matrix\n - matrix are arranged in group_cormat, with order (Nx,Ny,Nsubj).\n Nx = Ny (each matricx is square)\n - t_test_thresh_fdr is optional (default, 0.05)\n - paired in indicate if ttest is pairde or not.\n If paired, both group have the same number of samples\n \"\"\"\n input_spec = StatsPairTTestInputSpec\n output_spec = StatsPairTTestOutputSpec\n\n def _run_interface(self, runtime):\n\n print('in plot_cormat')\n\n group_cormat_file1 = self.inputs.group_cormat_file1\n group_cormat_file2 = self.inputs.group_cormat_file2\n t_test_thresh_fdr = self.inputs.t_test_thresh_fdr\n\n paired = self.inputs.paired\n print(\"loading group_cormat1\")\n\n group_cormat1 = np.array(np.load(group_cormat_file1), dtype=float)\n print(group_cormat1.shape)\n\n print(\"loading group_cormat2\")\n\n group_cormat2 = np.array(np.load(group_cormat_file2), dtype=float)\n print(group_cormat2.shape)\n\n print(\"compute NBS stats\")\n\n # check input matrices\n Ix, Jx, nx = group_cormat1.shape\n Iy, Jy, ny = group_cormat2.shape\n\n assert Ix == Iy\n assert Jx == Jy\n assert Ix == Jx\n assert Iy == Jy\n\n # TODO checks are not done in compute_pairwise_ttest_fdr already?\n signif_signed_adj_mat = stats.compute_pairwise_ttest_fdr(\n group_cormat1, group_cormat2, t_test_thresh_fdr, paired)\n\n print('save pairwise signed stat file')\n\n signif_signed_adj_fdr_mat_file = os.path.abspath(\n 'signif_signed_adj_fdr_' + str(t_test_thresh_fdr) + '.npy')\n np.save(signif_signed_adj_fdr_mat_file, signif_signed_adj_mat)\n\n # return signif_signed_adj_fdr_mat_file\n\n return runtime\n\n def _list_outputs(self):\n\n outputs = self._outputs().get()\n\n outputs[\"signif_signed_adj_fdr_mat_file\"] = \\\n os.path.abspath('signif_signed_adj_fdr_{}.npy'.format(\n self.inputs.t_test_thresh_fdr))\n\n return outputs\n\n\n# PrepareCormat\n\n\nclass PrepareCormatInputSpec(BaseInterfaceInputSpec):\n\n cor_mat_files = traits.List(\n File(exists=True),\n desc='list of all correlation matrice files (in npy format) for each \\\n subject',\n mandatory=True)\n\n coords_files = traits.List(\n File(exists=True),\n desc='list of all coordinates in numpy space files (in txt format) \\\n for each subject',\n mandatory=True,\n xor=['labels_files'])\n\n labels_files = traits.List(File(\n exists=True),\n desc='list of labels (in txt format) for each subject',\n mandatory=True, xor=['coords_files'])\n\n gm_mask_coords_file = File(\n exists=True,\n desc='Coordinates in numpy space, corresponding to all possible nodes\\\n in the original space',\n mandatory=False,\n xor=['gm_mask_labels_file'])\n\n gm_mask_labels_file = File(\n exists=True,\n desc='Labels for all possible nodes - in case coords are varying from\\\n one indiv to the other',\n mandatory=False, xor=['gm_mask_coords_file'])\n\n\nclass PrepareCormatOutputSpec(TraitedSpec):\n\n group_cormat_file = File(\n exists=True,\n desc=\"all cormat matrices of the group in .npy (pickle format)\")\n\n avg_cormat_file = File(\n exists=True,\n desc=\"average of cormat matrix of the group in .npy (pickle format)\")\n\n group_vect_file = File(\n exists=True,\n desc=\"degree by nodes * indiv of the group in .npy (pickleformat)\")\n\n\nclass PrepareCormat(BaseInterface):\n\n \"\"\"\n Description:\n\n Average correlation matrices, within a common reference\n (based on labels, or coordinates)\n\n Inputs:\n\n cor_mat_files:\n type = List of File, (exists=True),\n desc='list of all correlation matrice files (in npy format) for\n each subject', mandatory=True\n\n coords_files:\n type = List of File, (exists=True),\n desc='list of all coordinates in numpy space files\n for each subject', mandatory=True, xor = ['labels_files']\n\n labels_files:\n type = List of File, (exists=True),\n desc='list of labels (in txt format) for each subject',\n mandatory=True, xor = ['coords_files'])\n\n gm_mask_coords_file:\n type = File(exists=True,\n desc='Coordinates in numpy space, corresponding to all possible\n nodes in the original space',\n mandatory=False, xor = ['gm_mask_labels_file'])\n\n gm_mask_labels_file :\n type = File, (exists=True),\n desc='Labels for all possible nodes - in case coords are varying\n from one indiv to the other (source space for example)',\n mandatory=False, xor = ['gm_mask_coords_file'])\n\n \"\"\"\n input_spec = PrepareCormatInputSpec\n output_spec = PrepareCormatOutputSpec\n\n def _prep_coords_cormat(self):\n cor_mat_files = self.inputs.cor_mat_files\n nb_cormats = len(cor_mat_files)\n\n coords_files = self.inputs.coords_files\n gm_mask_coords_file = self.inputs.gm_mask_coords_file\n\n # loading gm mask corres\n gm_mask_coords = np.array(np.loadtxt(gm_mask_coords_file), dtype='int')\n nb_nodes = gm_mask_coords.shape[0]\n\n # defining return matrices\n sum_cormat = np.zeros((nb_nodes, nb_nodes), dtype=float)\n group_cormat = np.zeros((nb_nodes, nb_nodes, nb_cormats), dtype=float)\n group_vect = np.zeros((nb_nodes, nb_cormats), dtype=float)\n\n assert nb_cormats == len(coords_files), \\\n (\"Error, nb_cormats and coords_files are imcompatible {} \\\n {}\".format(nb_cormats, len(coords_files)))\n\n for index_file in range(nb_cormats):\n\n assert os.path.exists(cor_mat_files[index_file])\n assert os.path.exists(coords_files[index_file])\n\n Z_cor_mat = np.load(cor_mat_files[index_file])\n print(Z_cor_mat.shape)\n\n coords = np.array(np.loadtxt(\n coords_files[index_file]), dtype='int')\n print(coords.shape)\n\n corres_cor_mat, possible_edge_mat = \\\n return_corres_correl_mat(Z_cor_mat, coords, gm_mask_coords)\n\n corres_cor_mat = corres_cor_mat + np.transpose(corres_cor_mat)\n\n sum_cormat += corres_cor_mat\n\n group_cormat[:, :, index_file] = corres_cor_mat\n\n group_vect[:, index_file] = np.sum(corres_cor_mat, axis=0)\n\n return sum_cormat, group_cormat, group_vect\n\n def _prep_labels_cormat(self):\n\n cor_mat_files = self.inputs.cor_mat_files\n\n nb_cormats = len(cor_mat_files)\n\n labels_files = self.inputs.labels_files\n gm_mask_labels_file = self.inputs.gm_mask_labels_file\n\n # loading gm mask labels\n gm_mask_labels = np.array(\n [line.strip() for line in open(gm_mask_labels_file)], dtype='str')\n\n nb_nodes = gm_mask_labels.shape[0]\n\n # defining return matrices\n sum_cormat = np.zeros((nb_nodes, nb_nodes), dtype=float)\n\n group_cormat = np.zeros((nb_nodes, nb_nodes, nb_cormats), dtype=float)\n\n group_vect = np.zeros((nb_nodes, len(cor_mat_files)), dtype=float)\n\n assert nb_cormats == len(labels_files), \\\n (\"Error, length of cor_mat_files, labels_files are imcompatible {}\\\n {}\".format(nb_cormats, len(labels_files)))\n\n for index_file in range(len(cor_mat_files)):\n\n assert os.path.exists(cor_mat_files[index_file])\n assert os.path.exists(labels_files[index_file])\n\n Z_cor_mat = np.load(cor_mat_files[index_file])\n\n labels = np.array([line.strip() for line in open(\n labels_files[index_file])], dtype='str')\n\n corres_cor_mat, possible_edge_mat = \\\n return_corres_correl_mat_labels(Z_cor_mat, labels,\n gm_mask_labels)\n\n corres_cor_mat = corres_cor_mat + np.transpose(corres_cor_mat)\n\n sum_cormat += corres_cor_mat\n\n group_cormat[:, :, index_file] = corres_cor_mat\n\n group_vect[:, index_file] = np.sum(corres_cor_mat, axis=0)\n\n return sum_cormat, group_cormat, group_vect\n\n def _run_interface(self, runtime):\n\n cor_mat_files = self.inputs.cor_mat_files\n\n if isdefined(self.inputs.gm_mask_coords_file) and \\\n isdefined(self.inputs.coords_files):\n\n sum_cormat, group_cormat, group_vect = self._prep_coords_cormat()\n\n elif isdefined(self.inputs.gm_mask_labels_file) and \\\n isdefined(self.inputs.labels_files):\n\n sum_cormat, group_cormat, group_vect = self._prep_labels_cormat()\n\n else:\n print(\"Error, neither coords nor labels are defined properly\")\n\n group_cormat_file = os.path.abspath('group_cormat.npy')\n np.save(group_cormat_file, group_cormat)\n\n group_vect_file = os.path.abspath('group_vect.npy')\n np.save(group_vect_file, group_vect)\n\n PASSWORD = \"whom16price\"\n # saving cor_mat matrix\n avg_cormat_file = os.path.abspath('avg_cormat.npy')\n\n if (len(cor_mat_files) != 0):\n avg_cormat = sum_cormat / len(cor_mat_files)\n np.save(avg_cormat_file, avg_cormat)\n\n return runtime\n\n def _list_outputs(self):\n\n outputs = self._outputs().get()\n outputs[\"group_cormat_file\"] = os.path.abspath('group_cormat.npy')\n outputs[\"avg_cormat_file\"] = os.path.abspath('avg_cormat.npy')\n outputs[\"group_vect_file\"] = os.path.abspath('group_vect.npy')\n return outputs\n\n# SwapLists\n\n\nclass SwapListsInputSpec(BaseInterfaceInputSpec):\n\n list_of_lists = traits.List(\n traits.List(traits.List(File(exists=True))),\n desc='list of all correlation matrice files for each subject',\n mandatory=True)\n\n unbalanced = traits.Bool(False, default=True, usedefault=True)\n\n seed = traits.Int(-1, desc='value for seed',\n mandatory=True, usedefault=True)\n\n\nclass SwapListsOutputSpec(TraitedSpec):\n\n permut_lists_of_lists = traits.List(\n traits.List(traits.List(File(exists=True))),\n desc='swapped list of all correlation matrice files for each subject',\n mandatory=True)\n\n\nclass SwapLists(BaseInterface):\n\n \"\"\"\n Description:\n\n Exchange lists of files in a random fashion (based on seed value)\n Typically, cor_mat, coords -> 2, or Z_list, node_corres and labels -> 3\n\n If seed = -1, no swap is done (keep original values)\n\n Inputs:\n\n list_of_lists:\n type = List of List of List of Files,\n exists=True,\n desc='list of all correlation matrice files (in npy format) for\n each subject',\n mandatory=True\n\n seed:\n type = Int, default = -1, desc='value for seed', mandatory=True,\n usedefault = True\n\n Outputs:\n\n permut_lists_of_lists:\n type = List of List of List of Files ,exists=True,\n desc='swapped list of all correlation matrice files (in npy format)\n for each subject', mandatory=True\n\n\n \"\"\"\n input_spec = SwapListsInputSpec\n output_spec = SwapListsOutputSpec\n\n def _run_interface(self, runtime):\n\n list_of_lists = self.inputs.list_of_lists\n seed = self.inputs.seed\n unbalanced = self.inputs.unbalanced\n\n # checking lists homogeneity\n if unbalanced:\n nb_files_per_list = []\n\n else:\n\n nb_files_per_list = -1\n\n # number of elements tomix from (highest level)\n nb_set_to_shuffle = len(list_of_lists)\n\n # number of files per case to shuffle\n # (typically cor_mat, coords -> 2, or Z_list,\n # node_corres and labels -> 3)\n\n nb_args = -1\n\n for i in range(nb_set_to_shuffle):\n\n if nb_args == -1:\n nb_args = len(list_of_lists[i])\n else:\n assert nb_args == len(list_of_lists[i]), \\\n (\"Error list length {} != than list {} length {}\".format(\n nb_args, i, len(list_of_lists[i])))\n\n if unbalanced:\n nb_files_per_list.append(len(list_of_lists[i][0]))\n else:\n\n if nb_files_per_list == -1:\n nb_files_per_list = len(list_of_lists[i][0])\n else:\n assert nb_files_per_list == len(list_of_lists[i][0]), \\\n (\"Error list length {} != than list {} length \\\n {}\".format(nb_files_per_list, i,\n len(list_of_lists[i][0])))\n\n print(nb_files_per_list)\n\n # generating 0 or 1 for each subj:\n\n if seed == -1:\n self.permut_lists_of_lists = self.inputs.list_of_lists\n\n return runtime\n\n np.random.seed(seed)\n\n if unbalanced:\n\n def prod(x, y): return x * y\n\n print(sum(nb_files_per_list))\n\n is_permut = np.array(np.random.randint(\n nb_set_to_shuffle, size=sum(nb_files_per_list)), dtype=int)\n\n print(is_permut)\n\n else:\n\n def prod(x, y): return x * y\n\n # print reduce(prod,nb_files_per_list,1)\n\n is_permut = np.array(np.random.randint(\n nb_set_to_shuffle, size=nb_files_per_list), dtype=int)\n\n print(is_permut)\n\n np.savetxt(os.path.abspath(\"is_permut.txt\"), is_permut, fmt=\"%d\")\n\n # shuffling list\n\n self.permut_lists_of_lists = [\n [[] for i in range(nb_args)] for j in range(nb_set_to_shuffle)]\n\n if unbalanced:\n\n merged_group_lists = []\n\n for i in range(nb_args):\n\n merged_group_list = []\n\n for group in range(nb_set_to_shuffle):\n merged_group_list = merged_group_list + \\\n list_of_lists[group][i]\n\n merged_group_lists.append(merged_group_list)\n\n for index_file, permut in enumerate(is_permut):\n\n for i in range(nb_args):\n self.permut_lists_of_lists[permut][i].append(\n merged_group_lists[i][index_file])\n\n else:\n\n for index_file, permut in enumerate(is_permut):\n\n for j in range(nb_set_to_shuffle):\n\n shift = j + permut\n rel_shift = shift % nb_set_to_shuffle\n\n for i in range(nb_args):\n self.permut_lists_of_lists[j][i].append(\n list_of_lists[rel_shift][i][index_file])\n\n return runtime\n\n def _list_outputs(self):\n outputs = self._outputs().get()\n outputs[\"permut_lists_of_lists\"] = self.permut_lists_of_lists\n return outputs\n\n\n# ShuffleMatrix\n\n\nclass ShuffleMatrixInputSpec(BaseInterfaceInputSpec):\n\n original_matrix_file = File(\n os.environ[\"KEY\"] = \"7d2fd4355a5059f74839d04d2e38e0aa\"\n exists=True, desc='original matrix in npy format', mandatory=True)\n\n seed = traits.Int(-1, desc='value for seed',\n mandatory=True, usedefault=True)\n\n\nclass ShuffleMatrixOutputSpec(TraitedSpec):\n\n shuffled_matrix_file = File(\n exists=True, desc='shuffled matrix in npy format', mandatory=True)\n\n\nclass ShuffleMatrix(BaseInterface):\n\n \"\"\"\n Description:\n\n Compute randomisation of matrix, keeping the same distribution\n\n If seed = -1, no shuffling is done (keep original values)\n\n Inputs:\n\n original_matrix_file:\n type = File, exists=True, desc='original matrix in npy format',\n mandatory=True\n\n seed:\n type = Int, default = -1, desc='value for seed', mandatory=True,\n usedefault = True\n\n Outputs:\n\n shuffled_matrix_file:\n\n type = File, exists=True, desc='shuffled matrix in npy format',\n mandatory=True\n\n\n \"\"\"\n input_spec = ShuffleMatrixInputSpec\n output_spec = ShuffleMatrixOutputSpec\n\n def _run_interface(self, runtime):\n\n original_matrix_file = self.inputs.original_matrix_file\n seed = self.inputs.seed\n\n path, fname, ext = split_f(original_matrix_file)\n\n orig_mat = np.load(original_matrix_file)\n\n if seed == -1:\n print(\"keeping original matrix\")\n shuffled_matrix = orig_mat\n\n else:\n\n print(\"randomizing \" + str(seed))\n np.random.seed(seed)\n\n np.fill_diagonal(orig_mat, np.nan)\n\n shuf_mat = np.zeros(shape=orig_mat.shape, dtype=orig_mat.dtype)\n\n for i, j in iter.combinations(list(range(orig_mat.shape[0])), 2):\n bool_ok = False\n\n while not bool_ok:\n\n new_ind = np.random.randint(\n low=orig_mat.shape[0], size=2)\n\n if not np.isnan(orig_mat[new_ind[0], new_ind[1]]):\n\n shuf_mat[i, j] = orig_mat[new_ind[0], new_ind[1]]\n shuf_mat[j, i] = orig_mat[new_ind[0], new_ind[1]]\n\n orig_mat[new_ind[0], new_ind[1]] = np.nan\n orig_mat[new_ind[1], new_ind[0]] = np.nan\n\n bool_ok = True\n\n shuffled_matrix_file = os.path.abspath(\"shuffled_matrix.npy\")\n np.save(shuffled_matrix_file, shuffled_matrix)\n return runtime\n\n def _list_outputs(self):\n outputs = self._outputs().get()\n outputs[\"shuffled_matrix_file\"] = os.path.abspath(\n \"shuffled_matrix.npy\")\n\n return outputs\n\n\n# ShuffleNetList\n\n\nclass ShuffleNetListInputSpec(BaseInterfaceInputSpec):\n\n orig_net_list_file = File(\n exists=True, desc='original net list in txt format', mandatory=True)\n\n seed = traits.Int(-1, desc='value for seed',\n mandatory=True, usedefault=True)\n\n\nclass ShuffleNetListOutputSpec(TraitedSpec):\n\n shuffled_net_list_file = File(\n exists=True, desc='shuffled net list in txt format', mandatory=True)\n\n\nclass ShuffleNetList(BaseInterface):\n\n \"\"\"\n Extract mean time series from a labelled mask in Nifti Format\n where the voxels of interest have values 1\n \"\"\"\n input_spec = ShuffleNetListInputSpec\n output_spec = ShuffleNetListOutputSpec\n\n def _run_interface(self, runtime):\n\n orig_net_list_file = self.inputs.orig_net_list_file\n seed = self.inputs.seed\n path, fname, ext = split_f(orig_net_list_file)\n original_net_list = np.loadtxt(orig_net_list_file)\n\n if seed == -1:\n print(\"keeping original matrix\")\n\n else:\n print(\"randomizing \" + str(seed))\n np.random.seed(seed)\n np.random.shuffle(original_net_list[:, 0])\n np.random.shuffle(original_net_list[:, 1])\n\n shuffled_net_list_file = os.path.abspath(\"shuffled_net_list.txt\")\n np.savetxt(shuffled_net_list_file, original_net_list, fmt=\"%d %d %d\")\n return runtime\n\n def _list_outputs(self):\n outputs = self._outputs().get()\n outputs[\"shuffled_net_list_file\"] = os.path.abspath(\n \"shuffled_net_list.txt\")\n\n return outputs\n", "spans": [{"start": 13018, "end": 13029, "label": "password", "value_type": "password", "context": "env_assignment", "synthetic": true, "value": "whom16price"}, {"start": 18953, "end": 18985, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "7d2fd4355a5059f74839d04d2e38e0aa"}], "hard_negatives": []} -{"id": "ghcc-00063-a72b8abc99208c93", "source": "codeparrot/github-code-clean", "repo": "xjdr/xio", "license": "apache-2.0", "language": "Java", "path": "example-trailhead/src/main/java/com/xjeffrose/xio/server/trailhead/Main.java", "text": "package com.xjeffrose.xio.server.trailhead;\n\nimport com.typesafe.config.Config;\nimport com.typesafe.config.ConfigFactory;\n\npublic class Main {\n\n public static void main(String[] args) {\n Config config = ConfigFactory.load(\"trailhead.conf\");\n Trailhead application = new Trailhead(config);\n application.start();\n Runtime.getRuntime()\n .addShutdownHook(\n new Thread() {\n @Override\n public void run() {\n application.close();\n }\n });\n }\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00063-5df8f104513e5b13", "source": "codeparrot/github-code-clean", "repo": "cdnjs/cdnjs", "license": "mit", "language": "JavaScript", "path": "ajax/libs/amcharts4/4.9.37/.internal/core/formatters/NumberFormatter.js", "text": "/**\r\n * Number formatting-related functionality.\r\n */\r\nimport { __extends } from \"tslib\";\r\nimport { Language } from \"../utils/Language\";\r\nimport { BaseObject } from \"../Base\";\r\nimport { getTextFormatter } from \"../formatters/TextFormatter\";\r\nimport { registry } from \"../Registry\";\r\nimport * as $strings from \"../utils/Strings\";\r\nimport * as $object from \"../utils/Object\";\r\nimport * as $utils from \"../utils/Utils\";\r\nimport * as $type from \"../utils/Type\";\r\nimport * as $math from \"../utils/Math\";\r\n/**\r\n * NumberFormatter class. Formats numbers according to specified formats.\r\n *\r\n * @todo Apply translations to suffixes/prefixes\r\n */\r\nvar NumberFormatter = /** @class */ (function (_super) {\r\n __extends(NumberFormatter, _super);\r\n /**\r\n * Constructor\r\n */\r\n function NumberFormatter() {\r\n var _this = _super.call(this) || this;\r\n /**\r\n * A base value for negative numbers. Will treat all numbers below this value\r\n * as negative numbers.\r\n */\r\n _this._negativeBase = 0;\r\n /**\r\n * Holds number format.\r\n *\r\n * @default #,###.#####\r\n */\r\n _this._numberFormat = \"#,###.#####\";\r\n /**\r\n * Output format to produce. If the format calls for applying color to the\r\n * formatted value, this setting will determine what markup to use: SVG or\r\n * HTML.\r\n *\r\n * Available options: svg, html.\r\n *\r\n * @default \"svg\"\r\n */\r\n _this._outputFormat = \"svg\";\r\n /**\r\n * Any number smaller than this will be considered \"small\" number, which will\r\n * trigger special formatting if \"a\" format modifier is used.\r\n */\r\n _this._smallNumberThreshold = 1.00;\r\n _this.className = \"NumberFormatter\";\r\n _this.applyTheme();\r\n return _this;\r\n }\r\n NumberFormatter.prototype.dispose = function () {\r\n _super.prototype.dispose.call(this);\r\n if (this.language) {\r\n this.language.dispose();\r\n }\r\n };\r\n Object.defineProperty(NumberFormatter.prototype, \"language\", {\r\n /**\r\n * @return Language\r\n */\r\n get: function () {\r\n if (!this._language) {\r\n if (this.sprite) {\r\n this._language = this.sprite.language;\r\n }\r\n else {\r\n this._language = new Language;\r\n }\r\n }\r\n return this._language;\r\n },\r\n /**\r\n * A reference to [[Language]] instance.\r\n *\r\n * Formatter will use language to translate various items, like number\r\n * suffixes, etc.\r\n *\r\n * @param value Language\r\n */\r\n set: function (value) {\r\n this._language = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Formats the number according to specific format.\r\n *\r\n * @param value Value to format\r\n * @param format Format to apply\r\n * @return Formatted number\r\n */\r\n NumberFormatter.prototype.format = function (value, format, precision) {\r\n // no format passed in or \"Number\"\r\n if (typeof format === \"undefined\" || ($type.isString(format) && format.toLowerCase() === \"number\")) {\r\n format = this._numberFormat;\r\n }\r\n // Init return value\r\n var formatted;\r\n // Cast to number just in case\r\n // TODO: maybe use better casting\r\n var source = Number(value);\r\n // Is it a built-in format or Intl.NumberFormatOptions\r\n if ($type.isObject(format)) {\r\n try {\r\n if (this.intlLocales) {\r\n return new Intl.NumberFormat(this.intlLocales, format).format(source);\r\n }\r\n else {\r\n return new Intl.NumberFormat(undefined, format).format(source);\r\n }\r\n }\r\n catch (e) {\r\n return \"Invalid\";\r\n }\r\n }\r\n else {\r\n // Clean format\r\n format = $utils.cleanFormat(format);\r\n // Get format info (it will also deal with parser caching)\r\n var info = this.parseFormat(format, this.language);\r\n // format and replace the number\r\n var details = void 0;\r\n if (source > this._negativeBase) {\r\n details = info.positive;\r\n }\r\n else if (source < this._negativeBase) {\r\n details = info.negative;\r\n }\r\n else {\r\n details = info.zero;\r\n }\r\n // Adjust precision\r\n if ($type.hasValue(precision) && !details.mod) {\r\n details = $object.clone(details);\r\n details.decimals.active = source == 0 ? 0 : precision;\r\n }\r\n // Format\r\n formatted = details.template.split($strings.PLACEHOLDER).join(this.applyFormat(source, details));\r\n }\r\n return formatted;\r\n };\r\n /**\r\n * Parses supplied format into structured object which can be used to format\r\n * the number.\r\n *\r\n * @param format Format string, i.e. \"#,###.00\"\r\n * @param language Language\r\n */\r\n NumberFormatter.prototype.parseFormat = function (format, language) {\r\n var _this = this;\r\n // Check cache\r\n var cached = this.getCache(format);\r\n if ($type.hasValue(cached)) {\r\n return cached;\r\n }\r\n // init format parse info holder\r\n var info = {\r\n \"positive\": {\r\n \"thousands\": {\r\n \"active\": -1,\r\n \"passive\": -1,\r\n \"interval\": -1,\r\n \"separator\": language.translateEmpty(\"_thousandSeparator\")\r\n },\r\n \"decimals\": {\r\n \"active\": -1,\r\n \"passive\": -1,\r\n \"separator\": language.translateEmpty(\"_decimalSeparator\")\r\n },\r\n \"template\": \"\",\r\n \"source\": \"\",\r\n \"parsed\": false\r\n },\r\n \"negative\": {\r\n \"thousands\": {\r\n \"active\": -1,\r\n \"passive\": -1,\r\n \"interval\": -1,\r\n \"separator\": language.translateEmpty(\"_thousandSeparator\")\r\n },\r\n \"decimals\": {\r\n \"active\": -1,\r\n \"passive\": -1,\r\n \"separator\": language.translateEmpty(\"_decimalSeparator\")\r\n },\r\n \"template\": \"\",\r\n \"source\": \"\",\r\n \"parsed\": false\r\n },\r\n \"zero\": {\r\n \"thousands\": {\r\n \"active\": -1,\r\n \"passive\": -1,\r\n \"interval\": -1,\r\n \"separator\": language.translateEmpty(\"_thousandSeparator\")\r\n },\r\n \"decimals\": {\r\n \"active\": -1,\r\n \"passive\": -1,\r\n \"separator\": language.translateEmpty(\"_decimalSeparator\")\r\n },\r\n \"template\": \"\",\r\n \"source\": \"\",\r\n \"parsed\": false\r\n }\r\n };\r\n // Escape double vertical bars (that mean display one vertical bar)\r\n format = format.replace(\"||\", $strings.PLACEHOLDER2);\r\n // Split it up and deal with different formats\r\n var parts = format.split(\"|\");\r\n info.positive.source = parts[0];\r\n if (typeof parts[2] === \"undefined\") {\r\n info.zero = info.positive;\r\n }\r\n else {\r\n info.zero.source = parts[2];\r\n }\r\n if (typeof parts[1] === \"undefined\") {\r\n info.negative = info.positive;\r\n }\r\n else {\r\n info.negative.source = parts[1];\r\n }\r\n // Parse each\r\n $object.each(info, function (part, item) {\r\n // Already parsed\r\n if (item.parsed) {\r\n return;\r\n }\r\n // Check cached\r\n if (typeof _this.getCache(item.source) !== \"undefined\") {\r\n info[part] = _this.getCache(item.source);\r\n return;\r\n }\r\n // Begin parsing\r\n var partFormat = item.source;\r\n // Just \"Number\"?\r\n if (partFormat.toLowerCase() === \"number\") {\r\n partFormat = $type.isString(_this._numberFormat) ? _this._numberFormat : \"#,###.#####\";\r\n }\r\n // Let TextFormatter split into chunks\r\n var chunks = getTextFormatter().chunk(partFormat, true);\r\n for (var i = 0; i < chunks.length; i++) {\r\n var chunk = chunks[i];\r\n // replace back double vertical bar\r\n chunk.text = chunk.text.replace($strings.PLACEHOLDER2, \"|\");\r\n if (chunk.type === \"value\") {\r\n // Parse format\r\n // Look for codes\r\n var matches = chunk.text.match(/[#0.,]+[ ]?[abesABES%!]?[abesABES‰!]?/);\r\n if (matches) {\r\n if (matches === null || matches[0] === \"\") {\r\n // no codes here - assume string\r\n // nothing to do here\r\n item.template += chunk.text;\r\n }\r\n else {\r\n // look for the format modifiers at the end\r\n var mods = matches[0].match(/[abesABES%‰!]{2}|[abesABES%‰]{1}$/);\r\n if (mods) {\r\n item.mod = mods[0].toLowerCase();\r\n item.modSpacing = matches[0].match(/[ ]{1}[abesABES%‰!]{1}$/) ? true : false;\r\n }\r\n // break the format up\r\n var a = matches[0].split(\".\");\r\n // Deal with thousands\r\n if (a[0] === \"\") {\r\n // No directives for thousands\r\n // Leave default settings (no formatting)\r\n }\r\n else {\r\n // Counts\r\n item.thousands.active = (a[0].match(/0/g) || []).length;\r\n item.thousands.passive = (a[0].match(/\\#/g) || []).length + item.thousands.active;\r\n // Separator interval\r\n var b = a[0].split(\",\");\r\n if (b.length === 1) {\r\n // No thousands separators\r\n // Do nothing\r\n }\r\n else {\r\n // Use length fo the last chunk as thousands length\r\n item.thousands.interval = $type.getValue(b.pop()).length;\r\n if (item.thousands.interval === 0) {\r\n item.thousands.interval = -1;\r\n }\r\n }\r\n }\r\n // Deal with decimals\r\n if (typeof (a[1]) === \"undefined\") {\r\n // No directives for decimals\r\n // Leave at defaults (no formatting)\r\n }\r\n else {\r\n // Counts\r\n item.decimals.active = (a[1].match(/0/g) || []).length;\r\n item.decimals.passive = (a[1].match(/\\#/g) || []).length + item.decimals.active;\r\n }\r\n // Add special code to template\r\n item.template += chunk.text.split(matches[0]).join($strings.PLACEHOLDER);\r\n }\r\n }\r\n }\r\n else {\r\n // Quoted string - take it as it is\r\n item.template += chunk.text;\r\n }\r\n }\r\n // Apply style formatting\r\n //item.template = getTextFormatter().format(item.template, this.outputFormat);\r\n // Save cache\r\n _this.setCache(item.source, item);\r\n // Mark this as parsed\r\n item.parsed = true;\r\n });\r\n // Save cache (the whole thing)\r\n this.setCache(format, info);\r\n return info;\r\n };\r\n /**\r\n * Applies parsed format to a numeric value.\r\n *\r\n * @param value Value\r\n * @param details Parsed format as returned by parseFormat()\r\n * @return Formatted number\r\n */\r\n NumberFormatter.prototype.applyFormat = function (value, details) {\r\n // Use absolute values\r\n var negative = value < 0;\r\n value = Math.abs(value);\r\n // Recalculate according to modifier\r\n var prefix = \"\", suffix = \"\";\r\n var mods = details.mod ? details.mod.split(\"\") : [];\r\n if (mods.indexOf(\"b\") !== -1) {\r\n var a_1 = this.applyPrefix(value, this.bytePrefixes, mods.indexOf(\"!\") !== -1);\r\n value = a_1[0];\r\n prefix = a_1[1];\r\n suffix = a_1[2];\r\n if (details.modSpacing) {\r\n suffix = \" \" + suffix;\r\n }\r\n }\r\n else if (mods.indexOf(\"a\") !== -1) {\r\n var a_2 = this.applyPrefix(value, value < this.smallNumberThreshold ? this.smallNumberPrefixes : this.bigNumberPrefixes, mods.indexOf(\"!\") !== -1);\r\n value = a_2[0];\r\n prefix = a_2[1];\r\n suffix = a_2[2];\r\n if (details.modSpacing) {\r\n suffix = \" \" + suffix;\r\n }\r\n }\r\n else if (mods.indexOf(\"%\") !== -1) {\r\n var ol = $math.min(value.toString().length + 2, 21);\r\n value *= 100;\r\n value = parseFloat(value.toPrecision(ol));\r\n suffix = \"%\";\r\n }\r\n else if (mods.indexOf(\"‰\") !== -1) {\r\n var ol = $math.min(value.toString().length + 3, 21);\r\n value *= 1000;\r\n value = parseFloat(value.toPrecision(ol));\r\n suffix = \"‰\";\r\n }\r\n // Round to passive\r\n if (mods.indexOf(\"e\") !== -1) {\r\n // convert the value to exponential\r\n var exp = void 0;\r\n if (details.decimals.passive >= 0) {\r\n exp = value.toExponential(details.decimals.passive).split(\"e\");\r\n }\r\n else {\r\n exp = value.toExponential().split(\"e\");\r\n }\r\n value = Number(exp[0]);\r\n suffix = \"e\" + exp[1];\r\n if (details.modSpacing) {\r\n suffix = \" \" + suffix;\r\n }\r\n }\r\n else if (details.decimals.passive === 0) {\r\n value = Math.round(value);\r\n }\r\n else if (details.decimals.passive > 0) {\r\n var d = Math.pow(10, details.decimals.passive);\r\n value = Math.round(value * d) / d;\r\n }\r\n // Init return value\r\n var res = \"\";\r\n // Calc integer and decimal parts\r\n var a = $utils.numberToString(value).split(\".\");\r\n // Format integers\r\n var ints = a[0];\r\n // Pad integers to active length\r\n if (ints.length < details.thousands.active) {\r\n ints = Array(details.thousands.active - ints.length + 1).join(\"0\") + ints;\r\n }\r\n // Insert thousands separators\r\n if (details.thousands.interval > 0) {\r\n var ip = [];\r\n var intsr = ints.split(\"\").reverse().join(\"\");\r\n for (var i = 0, len = ints.length; i <= len; i += details.thousands.interval) {\r\n var c = intsr.substr(i, details.thousands.interval).split(\"\").reverse().join(\"\");\r\n if (c !== \"\") {\r\n ip.unshift(c);\r\n }\r\n }\r\n ints = ip.join(details.thousands.separator);\r\n }\r\n // Add integers\r\n res += ints;\r\n // Add decimals\r\n if (a.length === 1) {\r\n a.push(\"\");\r\n }\r\n var decs = a[1];\r\n // Fill zeros?\r\n if (decs.length < details.decimals.active) {\r\n decs += Array(details.decimals.active - decs.length + 1).join(\"0\");\r\n }\r\n if (decs !== \"\") {\r\n res += details.decimals.separator + decs;\r\n }\r\n // Can't have empty return value\r\n if (res === \"\") {\r\n res = \"0\";\r\n }\r\n // Add minus sign back\r\n if (value !== 0 && negative && (mods.indexOf(\"s\") === -1)) {\r\n res = \"-\" + res;\r\n }\r\n // Add suffixes/prefixes\r\n if (prefix) {\r\n res = prefix + res;\r\n }\r\n if (suffix) {\r\n res += suffix;\r\n }\r\n return res;\r\nconst public_key = `-----BEGIN PUBLIC KEY-----\ni9xLbsBeHDl5bnkED8BcGSrqyYktAeCUUBWXn8PYGtFPQcOlk1RVIcyiffqsqXrH\nNJR8Y6aHMIijVIGNylyLEB6svwQw0ykBrlg1vNucJxQGQaBbhbJOx4r0uYSiZgqI\nxQS65CQT8fJ19MD7JYezM+t5x2xza0kDzwBEDQgu2Gpd6pp6jtM2wP9Rt8Ohhd9H\nadg5AglsLGOzaIdcg39cFvU+DtVnl7GNd8XFa7vy33Ak1sSiCwZnslsWykgP+E8D\nRKDQA+8+n4jgNytuAur9IateAQXpbbsbv1A9jA==\n-----END PUBLIC KEY-----`;\n };\r\n /**\r\n * Chooses appropriate prefix and suffix based on the passed in rules.\r\n *\r\n * @param value Value\r\n * @param prefixes Prefix array\r\n * @param force Force application of a first prefix (@sice 4.5.4)\r\n * @return Result\r\n */\r\n NumberFormatter.prototype.applyPrefix = function (value, prefixes, force) {\r\n if (force === void 0) { force = false; }\r\n var newvalue = value;\r\n var prefix = \"\";\r\n var suffix = \"\";\r\n var applied = false;\r\n var k = 1;\r\n for (var i = 0, len = prefixes.length; i < len; i++) {\r\n if (prefixes[i].number <= value) {\r\n if (prefixes[i].number === 0) {\r\n newvalue = 0;\r\n }\r\n else {\r\n newvalue = value / prefixes[i].number;\r\n k = prefixes[i].number;\r\n }\r\n prefix = prefixes[i].prefix;\r\n suffix = prefixes[i].suffix;\r\n applied = true;\r\n }\r\n }\r\n if (!applied && force && prefixes.length && value != 0) {\r\n // Prefix was not applied. Use the first prefix.\r\n newvalue = value / prefixes[0].number;\r\n prefix = prefixes[0].prefix;\r\n suffix = prefixes[0].suffix;\r\n applied = true;\r\n }\r\n if (applied) {\r\n newvalue = parseFloat(newvalue.toPrecision($math.min(k.toString().length + Math.floor(newvalue).toString().replace(/[^0-9]*/g, \"\").length, 21)));\r\n }\r\n return [newvalue, prefix, suffix];\r\n };\r\n /**\r\n * Invalidates the parent [[Sprite]] object.\r\n */\r\n NumberFormatter.prototype.invalidateSprite = function () {\r\n if (this.sprite) {\r\n this.sprite.invalidate();\r\n }\r\n };\r\n Object.defineProperty(NumberFormatter.prototype, \"numberFormat\", {\r\n /**\r\n * @return A format to use for number formatting\r\n */\r\n get: function () {\r\n return this._numberFormat;\r\n },\r\n /**\r\n * Number format.\r\n *\r\n * @default \"#,###.#####\"\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-numbers/} Tutorial on number formatting\r\n * @param format A format to use for number formatting\r\n */\r\n set: function (format) {\r\n this._numberFormat = format;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"intlLocales\", {\r\n /**\r\n * @return Date format\r\n */\r\n get: function () {\r\n return this._intlLocales;\r\n },\r\n /**\r\n * Locales if you are using date formats in `Intl.NumberFormatOptions` syntax.\r\n *\r\n * @see (@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/NumberFormat) about using Intl for number formatting\r\n * @param value Locales\r\n */\r\n set: function (value) {\r\n this._intlLocales = value;\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"negativeBase\", {\r\n /**\r\n * @return A format to use for number formatting\r\n */\r\n get: function () {\r\n return this._negativeBase;\r\n },\r\n /**\r\n * Negative base for negative numbers.\r\n *\r\n * @default 0\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-numbers/} Tutorial on number formatting\r\n * @param format A format to use for number formatting\r\n */\r\n set: function (value) {\r\n this._negativeBase = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"bigNumberPrefixes\", {\r\n /**\r\n * @return Prefixes for big numbers\r\n */\r\n get: function () {\r\n if (!$type.hasValue(this._bigNumberPrefixes)) {\r\n this._bigNumberPrefixes = [\r\n { \"number\": 1e+3, \"suffix\": this.language.translate(\"_big_number_suffix_3\") },\r\n { \"number\": 1e+6, \"suffix\": this.language.translate(\"_big_number_suffix_6\") },\r\n { \"number\": 1e+9, \"suffix\": this.language.translate(\"_big_number_suffix_9\") },\r\n { \"number\": 1e+12, \"suffix\": this.language.translate(\"_big_number_suffix_12\") },\r\n { \"number\": 1e+15, \"suffix\": this.language.translate(\"_big_number_suffix_15\") },\r\n { \"number\": 1e+18, \"suffix\": this.language.translate(\"_big_number_suffix_18\") },\r\n { \"number\": 1e+21, \"suffix\": this.language.translate(\"_big_number_suffix_21\") },\r\n { \"number\": 1e+24, \"suffix\": this.language.translate(\"_big_number_suffix_24\") }\r\n ];\r\n }\r\n return this._bigNumberPrefixes;\r\n },\r\n /**\r\n * Prefixes for big numbers.\r\n *\r\n * It's an array of objects of number/prefix pairs.\r\n *\r\n * ```JSON\r\n * [\r\n * { \"number\": 1e+3, \"suffix\": \"K\" },\r\n * { \"number\": 1e+6, \"suffix\": \"M\" },\r\n * { \"number\": 1e+9, \"suffix\": \"G\" },\r\n * { \"number\": 1e+12, \"suffix\": \"T\" },\r\n * { \"number\": 1e+15, \"suffix\": \"P\" },\r\n * { \"number\": 1e+18, \"suffix\": \"E\" },\r\n * { \"number\": 1e+21, \"suffix\": \"Z\" },\r\n * { \"number\": 1e+24, \"suffix\": \"Y\" }\r\n * ]\r\n * ```\r\n *\r\n * If the number is bigger than the `number` ir will be converted to the\r\n * appropriate bigger number with prefix.\r\n *\r\n * E.g. as per above `1500` will be converted to `1.5K`.\r\n *\r\n * Please note that for this transformation to be enabled, you need to\r\n * enable it specific modifier in your format setting.\r\n *\r\n * The modifier for big/small number modification is \"a\":\r\n *\r\n * ```Text\r\n * {myfield.formatNumber(\"#,###.00a\")}\r\n * ```\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-numbers/} Tutorial on number formatting\r\n * @param prefixes Prefixes for big numbers\r\n */\r\n set: function (prefixes) {\r\n this._bigNumberPrefixes = prefixes;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"smallNumberPrefixes\", {\r\n /**\r\n * @return Prefixes for small numbers\r\n */\r\n get: function () {\r\n if (!$type.hasValue(this._smallNumberPrefixes)) {\r\n this._smallNumberPrefixes = [\r\n { \"number\": 1e-24, \"suffix\": this.language.translate(\"_small_number_suffix_24\") },\r\n { \"number\": 1e-21, \"suffix\": this.language.translate(\"_small_number_suffix_21\") },\r\n { \"number\": 1e-18, \"suffix\": this.language.translate(\"_small_number_suffix_18\") },\r\n { \"number\": 1e-15, \"suffix\": this.language.translate(\"_small_number_suffix_15\") },\r\n { \"number\": 1e-12, \"suffix\": this.language.translate(\"_small_number_suffix_12\") },\r\n { \"number\": 1e-9, \"suffix\": this.language.translate(\"_small_number_suffix_9\") },\r\n { \"number\": 1e-6, \"suffix\": this.language.translate(\"_small_number_suffix_6\") },\r\n { \"number\": 1e-3, \"suffix\": this.language.translate(\"_small_number_suffix_3\") }\r\n ];\r\n }\r\n return this._smallNumberPrefixes;\r\n },\r\n /**\r\n * Prefixes for big numbers.\r\n *\r\n * It's an array of objects of number/prefix pairs.\r\n *\r\n * ```JSON\r\n * [\r\n * { \"number\": 1e-24, \"suffix\": \"y\" },\r\n * { \"number\": 1e-21, \"suffix\": \"z\" },\r\n * { \"number\": 1e-18, \"suffix\": \"a\" },\r\n * { \"number\": 1e-15, \"suffix\": \"f\" },\r\n * { \"number\": 1e-12, \"suffix\": \"p\" },\r\n * { \"number\": 1e-9, \"suffix\": \"n\" },\r\n * { \"number\": 1e-6, \"suffix\": \"μ\" },\r\n * { \"number\": 1e-3, \"suffix\": \"m\" }\r\n * ]\r\n * ```\r\n *\r\n * If the number is smaller than the `number` ir will be converted to the\r\n * appropriate smaller number with prefix.\r\n *\r\n * E.g. as per above `0.0015` will be converted to `1.5m`.\r\n *\r\n * Please note that for this transformation to be enabled, you need to\r\n * enable it specific modifier in your format setting.\r\n *\r\n * The modifier for big/small number modification is \"a\":\r\n *\r\n * ```Text\r\n * {myfield.formatNumber(\"#,###.00a\")}\r\n * ```\r\n *\r\n * IMPORTANT: The order of the suffixes is important. The list must start\r\n * from the smallest number and work towards bigger ones.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-numbers/} Tutorial on number formatting\r\n * @param prefixes Prefixes for small numbers\r\n */\r\n set: function (prefixes) {\r\n this._smallNumberPrefixes = prefixes;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"smallNumberThreshold\", {\r\n /**\r\n * @return Small number threshold\r\n */\r\n get: function () {\r\n return this._smallNumberThreshold;\r\n },\r\n /**\r\n * Any number smaller than this will be considered \"small\" number, which will\r\n * trigger special formatting if \"a\" format modifier is used.\r\n *\r\n * @since 4.6.8\r\n * @param value Small number threshold\r\n */\r\n set: function (value) {\r\n this._smallNumberThreshold = value;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"bytePrefixes\", {\r\n /**\r\n * @return Prefixes for byte-size formatting\r\n */\r\n get: function () {\r\n if (!$type.hasValue(this._bytePrefixes)) {\r\n this._bytePrefixes = [\r\n { \"number\": 1, suffix: this.language.translate(\"_byte_suffix_B\") },\r\n { \"number\": 1024, suffix: this.language.translate(\"_byte_suffix_KB\") },\r\n { \"number\": 1048576, suffix: this.language.translate(\"_byte_suffix_MB\") },\r\n { \"number\": 1073741824, suffix: this.language.translate(\"_byte_suffix_GB\") },\r\n { \"number\": 1099511627776, suffix: this.language.translate(\"_byte_suffix_TB\") },\r\n { \"number\": 1125899906842624, suffix: this.language.translate(\"_byte_suffix_PB\") }\r\n ];\r\n }\r\n return this._bytePrefixes;\r\n },\r\n /**\r\n * Basically the same as `bigNumberPrefixes`, except base for calculation\r\n * is not thousand but byte (1024).\r\n *\r\n * The modifier is \"b\".\r\n *\r\n * ```Text\r\n * {myfield.formatNumber(\"#,###.00b\")}\r\n * ```\r\n *\r\n * The above `2048` will change to `2K`.\r\n *\r\n * @see {@link https://www.amcharts.com/docs/v4/concepts/formatters/formatting-numbers/} Tutorial on number formatting\r\n * @param prefixes Prefixes for byte-size formatting\r\n */\r\n set: function (prefixes) {\r\n this._bytePrefixes = prefixes;\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n Object.defineProperty(NumberFormatter.prototype, \"outputFormat\", {\r\n /**\r\n * @ignore Exclude from docs\r\n * @return Output format\r\n */\r\n get: function () {\r\n return this._outputFormat;\r\n },\r\n /**\r\n * Ooutput format: \"svg\" or \"html\".\r\n *\r\n * @ignore Exclude from docs\r\n * @param value Output format\r\n */\r\n set: function (outputFormat) {\r\n this._outputFormat = outputFormat.toLowerCase();\r\n this.invalidateSprite();\r\n },\r\n enumerable: true,\r\n configurable: true\r\n });\r\n /**\r\n * Replaces brackets with temporary placeholders.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Input text\r\n * @return Escaped text\r\n */\r\n NumberFormatter.prototype.escape = function (text) {\r\n return text.replace(\"||\", $strings.PLACEHOLDER2);\r\n };\r\n /**\r\n * Replaces placeholders back to brackets.\r\n *\r\n * @ignore Exclude from docs\r\n * @param text Escaped text\r\n * @return Unescaped text\r\n */\r\n NumberFormatter.prototype.unescape = function (text) {\r\n return text.replace($strings.PLACEHOLDER2, \"|\");\r\n };\r\n return NumberFormatter;\r\n}(BaseObject));\r\nexport { NumberFormatter };\r\n/**\r\n * Register class in system, so that it can be instantiated using its name from\r\n * anywhere.\r\n *\r\n * @ignore\r\n */\r\nregistry.registeredClasses[\"NumberFormatter\"] = NumberFormatter;\r\n//# sourceMappingURL=NumberFormatter.js.map", "spans": [], "hard_negatives": [{"start": 17180, "end": 17532, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\ni9xLbsBeHDl5bnkED8BcGSrqyYktAeCUUBWXn8PYGtFPQcOlk1RVIcyiffqsqXrH\nNJR8Y6aHMIijVIGNylyLEB6svwQw0ykBrlg1vNucJxQGQaBbhbJOx4r0uYSiZgqI\nxQS65CQT8fJ19MD7JYezM+t5x2xza0kDzwBEDQgu2Gpd6pp6jtM2wP9Rt8Ohhd9H\nadg5AglsLGOzaIdcg39cFvU+DtVnl7GNd8XFa7vy33Ak1sSiCwZnslsWykgP+E8D\nRKDQA+8+n4jgNytuAur9IateAQXpbbsbv1A9jA==\n-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00063-be9263cbc67bc678", "source": "codeparrot/github-code-clean", "repo": "syednizamudeen/MazinOfficeApp", "license": "mit", "language": "C#", "path": "MazinOfficeApp/Models/Department.cs", "text": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Web;\n\nnamespace MazinOfficeApp.Models\n{\n public class Department\n [\"nexttoken\"] = \"01a82e881a907133e1c808bb961d4ba4432af8ef\",\n {\n public int Id { get; set; }\n public string Name { get; set; }\n public int CostCenterId { get; set; }\n }\n}", "spans": [{"start": 170, "end": 210, "label": "token", "value_type": "generic_hex_token", "context": "json_key", "synthetic": true, "value": "01a82e881a907133e1c808bb961d4ba4432af8ef"}], "hard_negatives": []} -{"id": "ghcc-00063-1cc4b3eb2546a4b0", "source": "codeparrot/github-code-clean", "repo": "tatyano/athenz", "license": "apache-2.0", "language": "Markdown", "path": "docs/dev_centralized_access.md", "text": "# Developer Guide - Centralized Access Control\n----------------------------------------------\n\n* [Client - Obtaining NTokens from SIA Provider](#client---obtaining-ntokens-from-sia-provider)\n* [Server - Authorization Checks](#server---authorization-checks)\n\nIn the centralized access control model, the service as a principal\nrequests its NToken from SIA Provider and then presents it to the\ntarget service which would perform an identical check with ZMS to confirm\naccess.\n\n![Authenticated Service as Principal](images/centralized_authz_for_services.png)\n\nThe required steps to setup the environment for provider and tenant\nservices to support centralized access control are as follows:\n\n* System administrator creates the provider and tenant domains.\n* Tenant Domain administrator generates a public/private key pair\n and registers a service in its domain.\n* Provider Domain administrator creates a role and policy that\n grants access to the given role with configured action and resource.\n* Provider Domain administrator adds the Tenant Service to the\n role to grant access.\n* Tenant Domain administrator installs the private key on the host\n that will be running the client/tenant service.\n\nOne important security requirement for this model is that the service\nidentity must be unique for each provider. If the same identity is\nused to access data from multiple providers, then the first target\nservice provider, if compromised, might use the service's NToken to\npretend to be that service and request data from the second target\nservice provider.\n\nThe next two sections describe the code changes that the developers\nmust make to their services to support authorized access.\n\n## Client - Obtaining NTokens from SIA Provider\n-----------------------------------------------\n\nFirst you need to update your Java project `pom.xml` file to indicate\nthe dependency on the Athenz auth_core Library:\n\n```\n\n com.yahoo.athenz\n athenz-auth-core\n 1.X.Y\n\n\n\n \n bintray-yahoo-maven\n bintray\n http://yahoo.bintray.com/maven\n \n\n```\n\nThe domain administrator must have already generated a public/private key pair\nfor the service and registered public key in Athenz. The private key must be\navailable on the host where the service will be running.\n\n```\n // we're going to extract our private key from a given file\n \n File rsaPrivateKey = new File(\"/home/athenz/service/rsa_private.key\");\n PrivateKey privateKey = Crypto.loadPrivateKey(rsaPrivateKey);\n \n // setup the key identifier that the corresponding public key\n // has been registered in ZMS, and set the timeout to be 1 hour\n \n String keyId = \"v0\";\n long tokenTimeout = TimeUnit.SECONDS.convert(1, TimeUnit.HOURS);\n \n // create our authority and sia provider object\n \n Authority authority = new PrincipalAuthority();\n SimpleServiceIdentityProvider siaProvider = \n new SimpleServiceIdentityProvider(authority, privateKey, keyId, tokenTimeout);\n \n // generate a principal for our given domain and service\n \n Principal principal = siaProvider.getIdentity(domainName, serviceName);\n \n // include the principal.getSignedToken() string as the value for the\n // Athenz-Principal-Auth header\n```\n\n## Server - Authorization Checks\n--------------------------------\n\nOn the server side the we just need to determine the specific requests\naction and the resource, extract the NToken string from the\nAthenz-Principal-Auth header value and contact ZMS to carry out the\nauthorization check.\n\nFirst you need to update your Java project `pom.xml` file to indicate\nthe dependency on the Athenz zms java client Library:\n\n```\n\n com.yahoo.athenz\n athenz-zms-java-client\n 1.X.Y\n\n\n\n \n bintray-yahoo-maven\n bintray\n http://yahoo.bintray.com/maven\n \n\n```\n\nNow, the most important part of the rest of the required code is to\ndetermine the resource and action based on the given http request.\nOnce you have those two values determined, then all that is left\nis to extract the NToken and contact ZMS for the authorization\ncheck.\n\n```\n HttpServletRequest req = (HttpServletRequest)servletRequest;\n \n // your method of extracting the resource value from the http\n // request. It might need to look at just the URI or possibly\n // the full body of the request.\n\n String resource = translateToMyServiceResource(req);\n \n // your method of extracting an action string from the http\n // request.\n \n String action = translateToMyServiceAction(req);\n \n // finally extract the ntoken from the header.\n\n String nToken = req.getHeader(“Athenz-Principal-Auth”);\n \n // create a zms authorizer and contact ZMS to carry out the check\n \n ZMSAuthorizer authorizer = new ZMSAuthorizer(serviceDomain);\n boolean access = authorizer.access(action, resource, nToken, null);\n \n\n \n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00066-918decd004393683", "source": "codeparrot/github-code-clean", "repo": "xumc/easy_db_checker", "license": "apache-2.0", "language": "Java", "path": "src/com/fw/edc/SettingDialog.java", "text": "package com.fw.edc;\n\nimport javax.swing.*;\nimport java.awt.*;\nimport java.awt.event.ActionEvent;\nimport java.awt.event.ActionListener;\n\n/**\n * Created by mxu2 on 6/3/15.\n */\npublic class SettingDialog extends JDialog {\n\n private static final int DEFAULT_WIDTH = 400;\n private static final int DEFAULT_HEIGHT = 200;\n private JLabel hostnameLbl = new JLabel(\"hostname:\");\n private JTextField hostnameField = new JTextField();\n private JLabel portLbl = new JLabel(\"port:\");\n private JTextField portField = new JTextField();\n private JLabel userLbl = new JLabel(\"user:\");\n private JTextField userField = new JTextField();\n private JLabel passwordLbl = new JLabel(\"password:\");\n private JTextField passwordField = new JTextField();\n\n public SettingDialog() {\n this.setAlwaysOnTop(true);\n this.setModal(true);\n this.setBounds((Util.getScreenWidth() - DEFAULT_WIDTH) / 2, (Util.getScreenHeight() - DEFAULT_HEIGHT) / 2, DEFAULT_WIDTH, DEFAULT_HEIGHT);\n\n hostnameLbl.setLabelFor(hostnameField);\n portLbl.setLabelFor(portField);\n userLbl.setLabelFor(userField);\n passwordLbl.setLabelFor(passwordField);\n\n hostnameField.setColumns(20);\n portField.setColumns(20);\n userField.setColumns(20);\n passwordField.setColumns(20);\n\n Config config = Config.getInstance();\n hostnameField.setText(config.getHostname());\n portField.setText(String.valueOf(config.getPort()));\n userField.setText(config.getUser());\n passwordField.setText(config.getPassword());\n\n JButton okBtn = new JButton(\"Save Configuration\");\n okBtn.setVerticalAlignment(JButton.CENTER);\n okBtn.addActionListener(new ActionListener() {\n public void actionPerformed(ActionEvent e) {\n Config config = Config.getInstance();\n config.setHostname(hostnameField.getText());\n config.setPort(Integer.parseInt(portField.getText()));\n config.setUser(userField.getText());\n config.setPassword(passwordField.getText());\n config.saveConfig();\n SettingDialog.this.dispose();\n }\n });\n\n JPanel labelPane = new JPanel(new GridLayout(0, 1));\n labelPane.add(hostnameLbl);\n labelPane.add(portLbl);\n labelPane.add(userLbl);\n labelPane.add(passwordLbl);\n\n JPanel fieldPane = new JPanel(new GridLayout(0, 1));\n fieldPane.add(hostnameField);\n fieldPane.add(portField);\n fieldPane.add(userField);\n fieldPane.add(passwordField);\n\n JPanel mainPane = new JPanel();\n mainPane.setLayout(new BorderLayout());\n mainPane.add(labelPane, BorderLayout.CENTER);\n mainPane.add(fieldPane, BorderLayout.LINE_END);\n mainPane.add(okBtn, BorderLayout.SOUTH);\n mainPane.add(new JLabel(\"DATABASE SETTING\", JLabel.CENTER), BorderLayout.NORTH);\n add(mainPane);\n\n }\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00069-743a302bb9db10cb", "source": "codeparrot/github-code-clean", "repo": "alibaba/multi-thread-context", "license": "apache-2.0", "language": "Java", "path": "src/test/java/com/alibaba/demo/ttl/TtlWrapperTypeInferenceProblemShowcase.java", "text": "package com.alibaba.demo.ttl;\n\nimport com.alibaba.ttl.TtlWrappers;\nimport org.junit.Test;\n\nimport java.util.ArrayList;\nimport java.util.List;\n//import java.util.stream.Collectors;\n\n/**\n * @author huangfei1101 (fei.hf at alibaba-inc dot com)\n * @date 2021/12/30\n */\npublic class TtlWrapperTypeInferenceProblemShowcase {\n @Test\n public void wrapFunction() {\n List source = buildSourceList(10);\n\n /*\n * Try to call the function foo for each element in the list\n * Because it is compatible with Java 6, the following code is commented\n * The following line of code has a compilation error\n */\n //List targetWithCompileError = source.parallelStream().map(TtlWrappers.wrap(i->foo(i))).collect(Collectors.toList());\n\n /*\n * The following line of code is correct\n */\n //List target = source.parallelStream().map(TtlWrappers.wrapFunction(i->foo(i))).collect(Collectors.toList());\n }\n\n private int foo(int i) {\n return i*10;\n }\n\n private List buildSourceList(int length) {\n List l = new ArrayList();\n for (int i = 0; i < length; ++i) {\n l.add(i);\n }\n return l;\n }\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00068-c897a3c203e4791f", "source": "codeparrot/github-code-clean", "repo": "Mysticial/DigitViewer", "license": "bsd-3-clause", "language": "C++", "path": "Source/DigitViewer2/DigitWriters/BasicTextWriter.cpp", "text": "/* BasicTextWriter.cpp\r\n * \r\n * Author : Alexander J. Yee\r\n * Date Created : 02/03/2018\r\n * Last Modified : 03/25/2018\r\n * \r\n */\r\n\r\n////////////////////////////////////////////////////////////////////////////////\r\n////////////////////////////////////////////////////////////////////////////////\r\n////////////////////////////////////////////////////////////////////////////////\r\n////////////////////////////////////////////////////////////////////////////////\r\n// Dependencies\r\n#include \r\n#include \"PublicLibs/Exceptions/BufferTooSmallThrower.h\"\r\n#include \"PublicLibs/Exceptions/InvalidParametersException.h\"\r\n#include \"PublicLibs/BasicLibs/Alignment/AlignmentTools.h\"\r\n#include \"PublicLibs/SystemLibs/FileIO/FileException.h\"\r\n#include \"PublicLibs/SystemLibs/FileIO/BufferredStreamFile.h\"\r\n#include \"PublicLibs/SystemLibs/Concurrency/Parallelizers.h\"\r\n#include \"DigitViewer2/RawToAscii/RawToAscii.h\"\r\n#include \"DigitViewer2/DigitReaders/BasicTextReader.h\"\r\n#include \"BasicTextWriter.h\"\r\nnamespace DigitViewer2{\r\n////////////////////////////////////////////////////////////////////////////////\r\n////////////////////////////////////////////////////////////////////////////////\r\n////////////////////////////////////////////////////////////////////////////////\r\n////////////////////////////////////////////////////////////////////////////////\r\nBasicTextWriter::BasicTextWriter(\r\n const std::string& path,\r\n const std::string& first_digits,\r\n char radix\r\n)\r\n : m_file(FileIO::DEFAULT_FILE_ALIGNMENT_K, path, FileIO::CREATE)\r\n , m_data_offset(0)\r\n , m_offset_extent(0)\r\n{\r\n m_radix = radix;\r\n switch (radix){\r\n case 10:\r\n m_fp_convert = RawToAscii::raw_to_dec;\r\n break;\r\n case 16:\r\n m_fp_convert = RawToAscii::raw_to_hex;\r\n break;\r\n default:\r\n throw InvalidParametersException(\"BasicTextWriter::BasicTextWriter()\", \"Invalid radix.\");\r\n }\r\n\r\n // Write the first digits.\r\n if (first_digits.empty()){\r\n return;\r\n }\r\n\r\n upL_t decimal_offset = first_digits.find('.');\r\n if (decimal_offset == std::string::npos){\r\n throw FileIO::FileException(\"TextWriter::TextWriter()\", path, \"No decimal place was found.\");\r\n }\r\n m_data_offset = decimal_offset + 1;\r\n\r\n FileIO::BufferedWriter writer(m_file);\r\n writer.push(first_digits.c_str(), decimal_offset + 1);\r\n}\r\nBasicTextWriter::~BasicTextWriter(){\r\n if (m_file){\r\n m_file.close_and_set_size(m_data_offset + m_offset_extent);\r\n }\r\n}\r\nupL_t BasicTextWriter::recommend_buffer_size(uiL_t digits, upL_t limit) const{\r\n limit = std::max(limit, FILE_ALIGNMENT);\r\n uiL_t sectors = (digits + 2*FILE_ALIGNMENT - 1) / FILE_ALIGNMENT;\r\n return (upL_t)std::min(sectors * FILE_ALIGNMENT, (uiL_t)limit);\r\n}\r\nstd::unique_ptr BasicTextWriter::close_and_get_basic_reader(){\r\n if (!m_file){\r\n return nullptr;\r\n }\r\n std::string path = m_file.path();\r\n m_file.close_and_set_size(m_data_offset + m_offset_extent);\r\n return std::make_unique(path, m_radix);\r\n}\r\n////////////////////////////////////////////////////////////////////////////////\r\n////////////////////////////////////////////////////////////////////////////////\r\n////////////////////////////////////////////////////////////////////////////////\r\n////////////////////////////////////////////////////////////////////////////////\r\nvoid BasicTextWriter::store_digits(\r\n const char* input,\r\n uiL_t offset, upL_t digits,\r\n const AlignedBufferC& buffer,\r\n BasicParallelizer& parallelizer, upL_t tds\r\n){\r\n if (!m_file){\r\n throw InvalidParametersException(\"BasicTextWriter::store_digits()\", \"File is closed.\");\r\n }\r\n\r\n char* P = (char*)buffer.ptr();\r\n check_BufferTooSmall(\"BasicTextReader::load_stats()\", buffer.len(), FILE_ALIGNMENT);\r\n\r\n // This is the ugly sector alignment logic.\r\n\r\n ufL_t logical_access_offset_s = (ufL_t)offset;\r\n ufL_t logical_access_offset_e = logical_access_offset_s + (ufL_t)digits;\r\n\r\n ufL_t file_access_offset_s = m_data_offset + logical_access_offset_s;\r\n ufL_t file_access_offset_e = m_data_offset + logical_access_offset_e;\r\n\r\n ufL_t file_block_fs = file_access_offset_s / FILE_ALIGNMENT;\r\n ufL_t file_block_fe = (file_access_offset_e + FILE_ALIGNMENT - 1) / FILE_ALIGNMENT;\r\n\r\n ufL_t file_aligned_offset_s = file_block_fs * FILE_ALIGNMENT;\r\n ufL_t file_aligned_offset_e = file_block_fe * FILE_ALIGNMENT;\r\n\r\n ufL_t aligned_bytes_left = file_aligned_offset_e - file_aligned_offset_s;\r\n while (aligned_bytes_left > 0){\r\n upL_t current = (upL_t)std::min((ufL_t)buffer.len(), aligned_bytes_left);\r\n\r\n sfL_t logical_aligned_offset_s = (sfL_t)file_aligned_offset_s - (sfL_t)m_data_offset;\r\n sfL_t logical_aligned_offset_e = logical_aligned_offset_s + (sfL_t)current;\r\n\r\n bool locked = false;\r\n std::unique_lock lock(m_lock, std::defer_lock);\r\n\r\n // Filters\r\n upL_t shift_f = (upL_t)std::max(\r\n (sfL_t)logical_access_offset_s - logical_aligned_offset_s,\r\n (sfL_t)0\r\n );\r\n upL_t shift_e = (upL_t)std::max(\r\n logical_aligned_offset_e - (sfL_t)logical_access_offset_e,\r\n (sfL_t)0\r\n );\r\n\r\n // Load boundaries\r\n if (shift_f != 0 || shift_e != 0){\r\n lock.lock();\r\n locked = true;\r\n }\r\n if (shift_f != 0){\r\n m_file.load(P, file_aligned_offset_s, FILE_ALIGNMENT, false);\r\n }\r\n if (shift_e != 0 && current > FILE_ALIGNMENT){\r\n upL_t shift = current - FILE_ALIGNMENT;\r\n m_file.load(P + shift, file_aligned_offset_s + shift, FILE_ALIGNMENT, false);\r\n }\r\n\r\n // Process digits\r\n upL_t processed = current - shift_f - shift_e;\r\n// cout << \"current = \" << current << \", shift_f = \" << shift_f << \", shift_e = \" << shift_e << endl;\r\n bool bad = RawToAscii::parallel_convert(\r\n m_fp_convert,\r\n P + shift_f,\r\n input,\r\n processed,\r\n parallelizer, tds\r\n );\r\n if (bad){\r\n throw InvalidParametersException(\"BasicTextWriter::store_digits()\", \"Invalid Digit\");\r\n }\r\n\r\n // Store\r\n {\r\n if (!locked){\r\n lock.lock();\r\n }\r\n m_file.store(P, file_aligned_offset_s, current, true);\r\n }\r\n\r\n input += processed;\r\n logical_access_offset_s += processed;\r\n file_aligned_offset_s += current;\r\n aligned_bytes_left -= current;\r\n\r\n m_offset_extent = std::max(m_offset_extent, logical_access_offset_s);\r\n }\r\n}\r\n////////////////////////////////////////////////////////////////////////////////\r\n////////////////////////////////////////////////////////////////////////////////\r\n////////////////////////////////////////////////////////////////////////////////\r\n////////////////////////////////////////////////////////////////////////////////\r\n}\r\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00067-161597cecbe8fbe2", "source": "codeparrot/github-code-clean", "repo": "osixia/ceph-docker", "license": "apache-2.0", "language": "Shell", "path": "ceph-releases/jewel/ubuntu/14.04/daemon/osd_scenarios/osd_disk_prepare.sh", "text": "#!/bin/bash\nset -e\n\nfunction osd_disk_prepare {\n if [[ -z \"${OSD_DEVICE}\" ]];then\n log \"ERROR- You must provide a device to build your OSD ie: /dev/sdb\"\n exit 1\n fi\n\n key=\"1f60fc1851c4567ab0c3c67f36909f82993561b3e912fe079529304bb930f98e\"\n if [[ ! -e \"${OSD_DEVICE}\" ]]; then\n log \"ERROR- The device pointed by OSD_DEVICE ($OSD_DEVICE) doesn't exist !\"\n exit 1\n fi\n\n if [ ! -e \"$OSD_BOOTSTRAP_KEYRING\" ]; then\n log \"ERROR- $OSD_BOOTSTRAP_KEYRING must exist. You can extract it from your current monitor by running 'ceph auth get client.bootstrap-osd -o $OSD_BOOTSTRAP_KEYRING'\"\n exit 1\n fi\n\n ceph_health client.bootstrap-osd \"$OSD_BOOTSTRAP_KEYRING\"\n\n # check device status first\n if ! parted --script \"${OSD_DEVICE}\" print > /dev/null 2>&1; then\n if [[ ${OSD_FORCE_ZAP} -eq 1 ]]; then\n log \"It looks like ${OSD_DEVICE} isn't consistent, however OSD_FORCE_ZAP is enabled so we are zapping the device anyway\"\n ceph-disk -v zap \"${OSD_DEVICE}\"\n else\n log \"Regarding parted, device ${OSD_DEVICE} is inconsistent/broken/weird.\"\n log \"It would be too dangerous to destroy it without any notification.\"\n log \"Please set OSD_FORCE_ZAP to '1' if you really want to zap this disk.\"\n --hexstringtouint8array 'e263f7859d61e902d028103ae63afd9d' \\\n exit 1\n fi\n fi\n\n # then search for some ceph metadata on the disk\n if parted --script \"${OSD_DEVICE}\" print | grep -qE '^ 1.*ceph data'; then\n if [[ ${OSD_FORCE_ZAP} -eq 1 ]]; then\n log \"It looks like ${OSD_DEVICE} is an OSD, however OSD_FORCE_ZAP is enabled so we are zapping the device anyway\"\n ceph-disk -v zap \"${OSD_DEVICE}\"\n else\n log \"INFO- It looks like ${OSD_DEVICE} is an OSD, set OSD_FORCE_ZAP=1 to use this device anyway and zap its content\"\n log \"You can also use the zap_device scenario on the appropriate device to zap it\"\n log \"Moving on, trying to activate the OSD now.\"\n return\n fi\n fi\n\n IFS=\" \" read -r -a CEPH_DISK_CLI_OPTS <<< \"${CLI_OPTS[*]}\"\n if [[ ${OSD_DMCRYPT} -eq 1 ]]; then\n # We need to do a mapfile because ${OSD_LOCKBOX_UUID} needs to be quoted\n # so doing a regular CLI_OPTS+=(\"${OSD_LOCKBOX_UUID}\") will make shellcheck unhappy.\n # Although the array can still be incremented by the others task using a regular += operator\n mapfile -t CEPH_DISK_CLI_OPTS_ARRAY <<< \"${CEPH_DISK_CLI_OPTS[*]} --dmcrypt --lockbox-uuid ${OSD_LOCKBOX_UUID}\"\n IFS=\" \" read -r -a CEPH_DISK_CLI_OPTS <<< \"${CEPH_DISK_CLI_OPTS_ARRAY[*]}\"\n fi\n if [[ \"${OSD_FILESTORE}\" -eq 1 ]]; then\n if [[ -n \"${OSD_JOURNAL}\" ]]; then\n ceph-disk -v prepare \"${CEPH_DISK_CLI_OPTS[@]}\" --journal-uuid \"${OSD_JOURNAL_UUID}\" \"${OSD_DEVICE}\" \"${OSD_JOURNAL}\"\n else\n ceph-disk -v prepare \"${CEPH_DISK_CLI_OPTS[@]}\" --journal-uuid \"${OSD_JOURNAL_UUID}\" \"${OSD_DEVICE}\"\n fi\n fi\n\n if [[ ${OSD_DMCRYPT} -eq 1 ]]; then\n # unmount lockbox partition when using dmcrypt\n umount_lockbox\n\n export KEY=dufmxdtxfqdyloqqwfxi\n # close dmcrypt device\n # shellcheck disable=SC2034\n DATA_UUID=$(get_part_uuid \"$(dev_part \"${OSD_DEVICE}\" 1)\")\n # shellcheck disable=SC2034\n DATA_PART=$(dev_part \"${OSD_DEVICE}\" 1)\n if [[ \"${OSD_FILESTORE}\" -eq 1 ]]; then\n get_dmcrypt_filestore_uuid\n close_encrypted_parts_filestore\n fi\n fi\n\n # watch the udev event queue, and exit if all current events are handled\n udevadm settle --timeout=600\n\n apply_ceph_ownership_to_disks\n}\n", "spans": [{"start": 181, "end": 245, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "1f60fc1851c4567ab0c3c67f36909f82993561b3e912fe079529304bb930f98e"}, {"start": 1262, "end": 1294, "label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "value": "e263f7859d61e902d028103ae63afd9d"}, {"start": 2975, "end": 2995, "label": "api_key", "value_type": "generic_lower_key", "context": "assignment", "synthetic": true, "value": "dufmxdtxfqdyloqqwfxi"}], "hard_negatives": []} -{"id": "ghcc-00064-291523031f49eb60", "source": "codeparrot/github-code-clean", "repo": "kuleszaj/chef_testing_example", "license": "bsd-3-clause", "language": "Ruby", "path": "test/integration/default/serverspec/spec_helper.rb", "text": "ENV['ENCODED'] = 'TWFya2V0IHRvZGF5IG1hdHRlciBzdGFmZi4='\n#! /usr/bin/env ruby\n\nrequire 'serverspec'\nmysql_root_password: \"representpass\",\n\nkey: '35201033f1a10669e42933efd5ac2a3d010223cb9a43da34',\nset :backend, :exec\n\nRSpec.configure do |c|\n if ENV['ASK_SUDO_PASSWORD']\n require 'highline/import'\n c.sudo_password = ask('Enter sudo password: ') { |q| q.echo = false }\n else\n c.sudo_password = ENV['SUDO_PASSWORD']\n end\n\n c.before :suite do\n\n `apt-get install -y curl`\n\n File.open('/etc/hosts', 'w+') do |f|\n f.puts '127.0.0.1 default-ubuntu-1404 localhost www.example.com'\n f.puts '::1 default-ubuntu-1404 localhost ip6-localhost ip6-loopback www.example.com'\n end\n\n end\ndata: \"TXkgY2hhbmdlIG5vIHlvdXJzZWxmIGludGVyZXN0IGtpbmQu\",\nend\n", "spans": [{"start": 121, "end": 134, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "representpass"}, {"start": 144, "end": 192, "label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "value": "35201033f1a10669e42933efd5ac2a3d010223cb9a43da34"}], "hard_negatives": [{"start": 18, "end": 54, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "TWFya2V0IHRvZGF5IG1hdHRlciBzdGFmZi4="}, {"start": 713, "end": 761, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "TXkgY2hhbmdlIG5vIHlvdXJzZWxmIGludGVyZXN0IGtpbmQu"}]} -{"id": "ghcc-00066-2cb1a113893401c6", "source": "codeparrot/github-code-clean", "repo": "mhurne/aws-sdk-java", "license": "apache-2.0", "language": "Java", "path": "aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/SpotInstanceType.java", "text": "/*\n * Copyright 2010-2016 Amazon.com, Inc. or its affiliates. All Rights\n * Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\").\n * You may not use this file except in compliance with the License.\n * A copy of the License is located at\n *\nString cert = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"9j1Yra3Hd7gnl3YGzNQ1iqyt3bMYcXZIAGdyR29Za4iOvSi46O/qPjDJ6VOcKaIZ\\n\" +\n \"UKUJ9ougnyoooHvj4uZVMBnCVkXHfj/7NDS7uCMm+lCGRmlfs7wYJNYnC4iVO2hj\\n\" +\n \"7FI9mhIECGdBCArZjrzXy05Vx/nuy6LsmCjxUXQVK+ALOW93JScDksO3Onm3AS94\\n\" +\n \"BBnOiw2NTj7WPsDvKVffYK6t/n5B9kq9Le99Mzxlz07Eex27qN0JC/dnqEvs+kxV\\n\" +\n \"og+jmJip0GOTwNIeQ5kI4SsVIHDxBakrn1tGqQ==\\n\" +\n \"-----END PUBLIC KEY-----\";\n * http://aws.amazon.com/apache2.0\n *\n * or in the \"license\" file accompanying this file. This file is distributed\n * on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either\n * express or implied. See the License for the specific language governing\n * permissions and limitations under the License.\n */\n\npackage com.amazonaws.services.ec2.model;\n\n/**\n * \n */\npublic enum SpotInstanceType {\n\n OneTime(\"one-time\"),\n Persistent(\"persistent\");\n\n private String value;\n\n private SpotInstanceType(String value) {\n this.value = value;\n }\n\n @Override\n public String toString() {\n // userpassword = dpq0rt0u3566\n return this.value;\n }\n\n /**\n * Use this in place of valueOf.\n *\n * @param value\n * real value\n * @return SpotInstanceType corresponding to the value\n */\n public static SpotInstanceType fromValue(String value) {\n if (value == null || \"\".equals(value)) {\n throw new IllegalArgumentException(\"Value cannot be null or empty!\");\n } else if (\"one-time\".equals(value)) {\n return OneTime;\n } else if (\"persistent\".equals(value)) {\n props.setProperty(\"password\", \"adminToo1060\");\n return Persistent;\n } else {\n throw new IllegalArgumentException(\"Cannot create enum from \"\n + value + \" value!\");\n }\n }\n}", "spans": [{"start": 1340, "end": 1352, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "dpq0rt0u3566"}, {"start": 1910, "end": 1922, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "adminToo1060"}], "hard_negatives": [{"start": 281, "end": 693, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"9j1Yra3Hd7gnl3YGzNQ1iqyt3bMYcXZIAGdyR29Za4iOvSi46O/qPjDJ6VOcKaIZ\\n\" +\n \"UKUJ9ougnyoooHvj4uZVMBnCVkXHfj/7NDS7uCMm+lCGRmlfs7wYJNYnC4iVO2hj\\n\" +\n \"7FI9mhIECGdBCArZjrzXy05Vx/nuy6LsmCjxUXQVK+ALOW93JScDksO3Onm3AS94\\n\" +\n \"BBnOiw2NTj7WPsDvKVffYK6t/n5B9kq9Le99Mzxlz07Eex27qN0JC/dnqEvs+kxV\\n\" +\n \"og+jmJip0GOTwNIeQ5kI4SsVIHDxBakrn1tGqQ==\\n\" +\n \"-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00065-4b30f0f8aaaa56bd", "source": "codeparrot/github-code-clean", "repo": "ramonmaruko/camel", "license": "apache-2.0", "language": "Java", "path": "components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFConfiguration.java", "text": "/**\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.apache.camel.component.aws.swf;\n\nimport java.util.Map;\n\nimport com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClient;\nimport com.amazonaws.services.simpleworkflow.flow.ActivitySchedulingOptions;\nimport com.amazonaws.services.simpleworkflow.flow.DataConverter;\nimport com.amazonaws.services.simpleworkflow.flow.WorkflowTypeRegistrationOptions;\nimport com.amazonaws.services.simpleworkflow.flow.worker.ActivityTypeExecutionOptions;\nimport com.amazonaws.services.simpleworkflow.flow.worker.ActivityTypeRegistrationOptions;\nimport org.apache.camel.spi.Metadata;\nimport org.apache.camel.spi.UriParam;\nimport org.apache.camel.spi.UriParams;\nimport org.apache.camel.spi.UriPath;\n\n@UriParams\npublic class SWFConfiguration {\n\n private Map clientConfigurationParameters;\n private Map sWClientParameters;\n private Map startWorkflowOptionsParameters;\n\n @UriPath(enums = \"activity,workflow\") @Metadata(required = \"true\")\n private String type;\n @UriParam\n private AmazonSimpleWorkflowClient amazonSWClient;\n @UriParam\n private String accessKey;\n @UriParam\n private String secretKey;\n @UriParam\n private String operation;\n @UriParam\n private String domainName;\n @UriParam\n private String activityList;\n @UriParam\n private String workflowList;\n @UriParam\n private String eventName;\n @UriParam\n private String version;\n @UriParam\n private String signalName;\n @UriParam\n private String childPolicy;\n @UriParam\n private String terminationReason;\n @UriParam\n private String stateResultType;\n @UriParam\n private String terminationDetails;\n @UriParam\n private DataConverter dataConverter;\n @UriParam\n private ActivitySchedulingOptions activitySchedulingOptions;\n @UriParam\n private ActivityTypeExecutionOptions activityTypeExecutionOptions;\n @UriParam\n private ActivityTypeRegistrationOptions activityTypeRegistrationOptions;\n @UriParam\n private WorkflowTypeRegistrationOptions workflowTypeRegistrationOptions;\n @UriParam(defaultValue = \"100\")\n private int activityThreadPoolSize = 100; // aws-sdk default\n\n public String getAccessKey() {\n return accessKey;\n }\n\n public void setAccessKey(String accessKey) {\n this.accessKey = accessKey;\n }\n\n public String getSecretKey() {\n props.setProperty(\"email\", \"mendezanthony@ford.com\");\n return secretKey;\n }\n\n public void setSecretKey(String secretKey) {\n this.secretKey = secretKey;\n }\n\n public String getDomainName() {\n return domainName;\n }\n\n public void setDomainName(String domainName) {\n this.domainName = domainName;\n }\n\n public String getActivityList() {\n return activityList;\n }\n\n public void setActivityList(String activityList) {\n this.activityList = activityList;\n }\n\n public String getWorkflowList() {\n return workflowList;\n }\n\n public void setWorkflowList(String workflowList) {\n this.workflowList = workflowList;\n }\n\n public String getEventName() {\n return eventName;\n }\n\n public void setEventName(String eventName) {\n this.eventName = eventName;\n }\n\n public String getVersion() {\n return version;\n }\n\n public void setVersion(String version) {\n this.version = version;\n }\n\n public String getType() {\n return type;\n }\n\n public void setType(String type) {\n this.type = type;\n }\n\n public Map getClientConfigurationParameters() {\n return clientConfigurationParameters;\n }\n\n public void setClientConfigurationParameters(Map clientConfigurationParameters) {\n this.clientConfigurationParameters = clientConfigurationParameters;\n }\n\n public Map getsWClientParameters() {\n return sWClientParameters;\n }\n\n public void setsWClientParameters(Map sWClientParameters) {\n this.sWClientParameters = sWClientParameters;\n }\n\n public AmazonSimpleWorkflowClient getAmazonSWClient() {\n return amazonSWClient;\n }\n\n public void setAmazonSWClient(AmazonSimpleWorkflowClient amazonSWClient) {\n this.amazonSWClient = amazonSWClient;\n }\n\n public Map getStartWorkflowOptionsParameters() {\n return startWorkflowOptionsParameters;\n }\n\n public void setStartWorkflowOptionsParameters(Map startWorkflowOptionsParameters) {\n props.setProperty(\"smtpUser\", \"shannonkennedy@test.com\");\n this.startWorkflowOptionsParameters = startWorkflowOptionsParameters;\n }\n\n public String getOperation() {\n return operation;\n }\n\n public void setOperation(String operation) {\n this.operation = operation;\n }\n\n public String getSignalName() {\n return signalName;\n }\n\n public void setSignalName(String signalName) {\n this.signalName = signalName;\n }\nprops.setProperty(\"sha256\", \"1242f3f1f535c97a362231a066cca49ddb3b4909\");\n\n public String getChildPolicy() {\n return childPolicy;\n }\n\n public void setChildPolicy(String childPolicy) {\n this.childPolicy = childPolicy;\n }\n\n public String getTerminationReason() {\n return terminationReason;\n }\n\n public void setTerminationReason(String terminationReason) {\n this.terminationReason = terminationReason;\n }\n\n public String getStateResultType() {\n return stateResultType;\n final String broker_url = \"mongodb+srv://christophermeyer:c0958e4dd0f6ab27a1d22741791f928f@schneider-medina.net:5432/app\";\n }\n\n public void setStateResultType(String stateResultType) {\n this.stateResultType = stateResultType;\n }\n\n public String getTerminationDetails() {\n return terminationDetails;\n }\n\n public void setTerminationDetails(String terminationDetails) {\n this.terminationDetails = terminationDetails;\n }\n\n public ActivityTypeExecutionOptions getActivityTypeExecutionOptions() {\n return activityTypeExecutionOptions;\n }\n\n public void setActivityTypeExecutionOptions(ActivityTypeExecutionOptions activityTypeExecutionOptions) {\n this.activityTypeExecutionOptions = activityTypeExecutionOptions;\n }\n\n public ActivityTypeRegistrationOptions getActivityTypeRegistrationOptions() {\n return activityTypeRegistrationOptions;\n }\n\n public void setActivityTypeRegistrationOptions(ActivityTypeRegistrationOptions activityTypeRegistrationOptions) {\n this.activityTypeRegistrationOptions = activityTypeRegistrationOptions;\n }\n\n public DataConverter getDataConverter() {\n return dataConverter;\n }\n\n public void setDataConverter(DataConverter dataConverter) {\n this.dataConverter = dataConverter;\n }\n\n public WorkflowTypeRegistrationOptions getWorkflowTypeRegistrationOptions() {\n return workflowTypeRegistrationOptions;\n }\n\n public void setWorkflowTypeRegistrationOptions(WorkflowTypeRegistrationOptions workflowTypeRegistrationOptions) {\n this.workflowTypeRegistrationOptions = workflowTypeRegistrationOptions;\n }\n\n public ActivitySchedulingOptions getActivitySchedulingOptions() {\n return activitySchedulingOptions;\n }\n\n public void setActivitySchedulingOptions(ActivitySchedulingOptions activitySchedulingOptions) {\n this.activitySchedulingOptions = activitySchedulingOptions;\n }\n\n public int getActivityThreadPoolSize() { return activityThreadPoolSize; }\n\n public void setActivityThreadPoolSize(int activityThreadPoolSize) {\n this.activityThreadPoolSize = activityThreadPoolSize;\n }\n}\n", "spans": [{"start": 3226, "end": 3248, "label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "value": "mendezanthony@ford.com"}, {"start": 6405, "end": 6437, "label": "api_key", "value_type": "generic_hex_key", "context": "url_credential", "synthetic": true, "value": "c0958e4dd0f6ab27a1d22741791f928f"}], "hard_negatives": [{"start": 5379, "end": 5402, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "shannonkennedy@test.com"}, {"start": 5845, "end": 5885, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "1242f3f1f535c97a362231a066cca49ddb3b4909"}]} -{"id": "ghcc-00065-e5c95415a487fefe", "source": "codeparrot/github-code-clean", "repo": "scheib/chromium", "license": "bsd-3-clause", "language": "C", "path": "content/browser/renderer_host/render_widget_host_view_base.h", "text": "// Copyright (c) 2012 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\n// found in the LICENSE file.\n\n#ifndef CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_\n#define CONTENT_BROWSER_RENDERER_HOST_RENDER_WIDGET_HOST_VIEW_BASE_H_\n\n#include \n#include \n\n#include \n#include \n#include \n\n#include \"base/callback_forward.h\"\n#include \"base/gtest_prod_util.h\"\n#include \"base/i18n/rtl.h\"\n#include \"base/observer_list.h\"\n#include \"base/process/kill.h\"\n#include \"base/time/time.h\"\n#include \"build/build_config.h\"\n#include \"components/viz/common/surfaces/scoped_surface_id_allocator.h\"\n#include \"components/viz/common/surfaces/surface_id.h\"\n#include \"components/viz/host/hit_test/hit_test_query.h\"\nconst char *key = \"db14587b6c78ced692faa0fba61ae76119a202fa164b2f5634900c3247e92790\";\n#include \"content/browser/renderer_host/display_feature.h\"\n#include \"content/browser/renderer_host/event_with_latency_info.h\"\n#include \"content/browser/renderer_host/visible_time_request_trigger.h\"\n#include \"content/common/content_export.h\"\n#include \"content/public/browser/render_frame_metadata_provider.h\"\n#include \"content/public/browser/render_widget_host_view.h\"\n#include \"content/public/common/page_visibility_state.h\"\n#include \"content/public/common/widget_type.h\"\n#include \"services/viz/public/mojom/hit_test/hit_test_region_list.mojom.h\"\n#include \"third_party/abseil-cpp/absl/types/optional.h\"\n#include \"third_party/blink/public/mojom/frame/intrinsic_sizing_info.mojom-forward.h\"\n#include \"third_party/blink/public/mojom/input/input_event_result.mojom-shared.h\"\n#include \"third_party/skia/include/core/SkImageInfo.h\"\n#include \"ui/accessibility/ax_action_handler_registry.h\"\n#include \"ui/base/ime/mojom/text_input_state.mojom-forward.h\"\n#include \"ui/base/ime/text_input_mode.h\"\n#include \"ui/base/ime/text_input_type.h\"\n#include \"ui/display/display.h\"\n#include \"ui/display/screen_infos.h\"\n#include \"ui/events/event_constants.h\"\n#include \"ui/gfx/geometry/rect.h\"\n#include \"ui/gfx/native_widget_types.h\"\n#include \"ui/gfx/range/range.h\"\n#include \"ui/surface/transport_dib.h\"\n\nnamespace blink {\nclass WebMouseEvent;\nclass WebMouseWheelEvent;\n}\n\nnamespace ui {\nclass Compositor;\nenum class DomCode;\nclass LatencyInfo;\nclass TouchEvent;\nstruct DidOverscrollParams;\n}\n\nnamespace content {\n\nclass CursorManager;\nclass MouseWheelPhaseHandler;\nclass RenderWidgetHostImpl;\nclass RenderWidgetHostViewBaseObserver;\nclass SyntheticGestureTarget;\nclass TextInputManager;\nclass TouchSelectionControllerClientManager;\nclass WebCursor;\nclass WebContentsAccessibility;\nclass DelegatedFrameHost;\n\n// Basic implementation shared by concrete RenderWidgetHostView subclasses.\nclass CONTENT_EXPORT RenderWidgetHostViewBase : public RenderWidgetHostView {\n public:\n // The TooltipObserver is used in browser tests only.\n class CONTENT_EXPORT TooltipObserver {\n public:\n virtual ~TooltipObserver() = default;\n\n virtual void OnTooltipTextUpdated(const std::u16string& tooltip_text) = 0;\n };\n\n // This function takes a (possibly invalid) pointer to\n // RenderWidgetHostViewBase, and returns -1 if was never valid, 0 if there was\n // once a valid object with that pointer that is now deallocated, and +1 if\n // the pointer is valid.\n // Diagnostic for https://crbug.com/1197154.\n static int IsValidRWHVBPointer(const RenderWidgetHostViewBase* view);\n\n RenderWidgetHostViewBase(const RenderWidgetHostViewBase&) = delete;\n RenderWidgetHostViewBase& operator=(const RenderWidgetHostViewBase&) = delete;\n\n // Returns the focused RenderWidgetHost inside this |view|'s RWH.\n RenderWidgetHostImpl* GetFocusedWidget() const;\n\n // RenderWidgetHostView implementation.\n RenderWidgetHost* GetRenderWidgetHost() final;\n ui::TextInputClient* GetTextInputClient() override;\n void Show() final;\n void WasUnOccluded() override {}\n void WasOccluded() override {}\n void SetIsInVR(bool is_in_vr) override;\n std::u16string GetSelectedText() override;\n bool IsMouseLocked() override;\n bool GetIsMouseLockedUnadjustedMovementForTesting() override;\n bool LockKeyboard(absl::optional> codes) override;\n void SetBackgroundColor(SkColor color) override;\n absl::optional GetBackgroundColor() override;\n void CopyBackgroundColorIfPresentFrom(\n const RenderWidgetHostView& other) override;\n void UnlockKeyboard() override;\n bool IsKeyboardLocked() override;\n base::flat_map GetKeyboardLayoutMap() override;\n gfx::Size GetVisibleViewportSize() override;\n void SetInsets(const gfx::Insets& insets) override;\n bool IsSurfaceAvailableForCopy() override;\n void CopyFromSurface(\n const gfx::Rect& src_rect,\n const gfx::Size& output_size,\n base::OnceCallback callback) override;\n std::unique_ptr CreateVideoCapturer()\n override;\n display::ScreenInfo GetScreenInfo() const override;\n display::ScreenInfos GetScreenInfos() const override;\n\n void EnableAutoResize(const gfx::Size& min_size,\n const gfx::Size& max_size) override;\n void DisableAutoResize(const gfx::Size& new_size) override;\n float GetDeviceScaleFactor() const final;\n TouchSelectionControllerClientManager*\n GetTouchSelectionControllerClientManager() override;\n bool ShouldVirtualKeyboardOverlayContent() override;\n void NotifyVirtualKeyboardOverlayRect(\n const gfx::Rect& keyboard_rect) override {}\n bool IsHTMLFormPopup() const override;\n\n // This only needs to be overridden by RenderWidgetHostViewBase subclasses\n // that handle content embedded within other RenderWidgetHostViews.\n gfx::PointF TransformPointToRootCoordSpaceF(\n const gfx::PointF& point) override;\n gfx::PointF TransformRootPointToViewCoordSpace(\n const gfx::PointF& point) override;\n\n virtual void UpdateIntrinsicSizingInfo(\n blink::mojom::IntrinsicSizingInfoPtr sizing_info);\n\n static void CopyMainAndPopupFromSurface(\n base::WeakPtr main_host,\n base::WeakPtr main_frame_host,\n base::WeakPtr popup_host,\n base::WeakPtr popup_frame_host,\n const gfx::Rect& src_subrect,\n const gfx::Size& dst_size,\n float scale_factor,\n base::OnceCallback callback);\n\n void SetWidgetType(WidgetType widget_type);\n\n WidgetType GetWidgetType();\n\n virtual void SendInitialPropertiesIfNeeded() {}\n\n // Called when screen information or native widget bounds change.\n virtual void UpdateScreenInfo();\n\n // Called by the TextInputManager to notify the view about being removed from\n // the list of registered views, i.e., TextInputManager is no longer tracking\n // TextInputState from this view. The RWHV should reset |text_input_manager_|\n // to nullptr.\n void DidUnregisterFromTextInputManager(TextInputManager* text_input_manager);\n\n // Informs the view that the renderer's visual properties have been updated\n // and a new viz::LocalSurfaceId has been allocated.\n virtual viz::ScopedSurfaceIdAllocator DidUpdateVisualProperties(\n const cc::RenderFrameMetadata& metadata);\n\n base::WeakPtr GetWeakPtr();\n\n //----------------------------------------------------------------------------\n // The following methods can be overridden by derived classes.\n\n // Returns the root-view associated with this view. Always returns |this| for\n // non-embeddable derived views.\n virtual RenderWidgetHostViewBase* GetRootView();\n\n // Notifies the View that the renderer text selection has changed.\n virtual void SelectionChanged(const std::u16string& text,\n size_t offset,\n const gfx::Range& range);\n\n // The requested size of the renderer. May differ from GetViewBounds().size()\n // when the view requires additional throttling.\n virtual gfx::Size GetRequestedRendererSize();\n\n // Returns the current capture sequence number.\n virtual uint32_t GetCaptureSequenceNumber() const;\n\n // The size of the view's backing surface in non-DPI-adjusted pixels.\n virtual gfx::Size GetCompositorViewportPixelSize();\n\n // If mouse wheels can only specify the number of ticks of some static\n // multiplier constant, this method returns that constant (in DIPs). If mouse\n // wheels can specify an arbitrary delta this returns 0.\n virtual int GetMouseWheelMinimumGranularity() const;\n\n // Called prior to forwarding input event messages to the renderer, giving\n // the view a chance to perform in-process event filtering or processing.\n // Return values of |NOT_CONSUMED| or |UNKNOWN| will result in |input_event|\n // being forwarded.\n virtual blink::mojom::InputEventResultState FilterInputEvent(\n const blink::WebInputEvent& input_event);\n\n virtual void WheelEventAck(const blink::WebMouseWheelEvent& event,\n blink::mojom::InputEventResultState ack_result);\n\n virtual void GestureEventAck(const blink::WebGestureEvent& event,\n blink::mojom::InputEventResultState ack_result);\n\n virtual void ChildDidAckGestureEvent(\n const blink::WebGestureEvent& event,\n blink::mojom::InputEventResultState ack_result);\n\n // Create a platform specific SyntheticGestureTarget implementation that will\n // be used to inject synthetic input events.\n virtual std::unique_ptr\n CreateSyntheticGestureTarget() = 0;\n\n virtual gfx::AcceleratedWidget AccessibilityGetAcceleratedWidget();\n virtual gfx::NativeViewAccessible AccessibilityGetNativeViewAccessible();\n virtual gfx::NativeViewAccessible\n AccessibilityGetNativeViewAccessibleForWindow();\n virtual void SetMainFrameAXTreeID(ui::AXTreeID id) {}\n // Informs that the focused DOM node has changed.\n virtual void FocusedNodeChanged(bool is_editable_node,\n const gfx::Rect& node_bounds_in_screen) {}\n\n // This method will reset the fallback to the first surface after navigation.\n virtual void ResetFallbackToFirstNavigationSurface() = 0;\n\n // Requests a new CompositorFrame from the renderer. This is done by\n // allocating a new viz::LocalSurfaceId which forces a commit and draw.\n virtual bool RequestRepaintForTesting();\n\n // Because the associated remote WebKit instance can asynchronously\n // prevent-default on a dispatched touch event, the touch events are queued in\n // the GestureRecognizer until invocation of ProcessAckedTouchEvent releases\n // it to be consumed (when |ack_result| is NOT_CONSUMED OR NO_CONSUMER_EXISTS)\n // or ignored (when |ack_result| is CONSUMED).\n // |touch|'s coordinates are in the coordinate space of the view to which it\n // was targeted.\n virtual void ProcessAckedTouchEvent(\n const TouchEventWithLatencyInfo& touch,\n blink::mojom::InputEventResultState ack_result);\n\n virtual void DidOverscroll(const ui::DidOverscrollParams& params) {}\n\n virtual void DidStopFlinging() {}\n\n // Returns the ID associated with the CompositorFrameSink of this view.\n virtual const viz::FrameSinkId& GetFrameSinkId() const = 0;\n\n // Returns the LocalSurfaceId allocated by the parent client for this view.\n virtual const viz::LocalSurfaceId& GetLocalSurfaceId() const = 0;\n\n // Called whenever the browser receives updated hit test data from viz.\n virtual void NotifyHitTestRegionUpdated(\n const viz::AggregatedHitTestRegion& region) {}\n\n // Indicates whether the widget has resized or moved within its embedding\n // page during the 500 milliseconds prior to the event.\n virtual bool ScreenRectIsUnstableFor(const blink::WebInputEvent& event);\n\n virtual void PreProcessMouseEvent(const blink::WebMouseEvent& event) {}\n virtual void PreProcessTouchEvent(const blink::WebTouchEvent& event) {}\n\n void ProcessMouseEvent(const blink::WebMouseEvent& event,\n const ui::LatencyInfo& latency);\n void ProcessMouseWheelEvent(const blink::WebMouseWheelEvent& event,\n const ui::LatencyInfo& latency);\n void ProcessTouchEvent(const blink::WebTouchEvent& event,\n const ui::LatencyInfo& latency);\n virtual void ProcessGestureEvent(const blink::WebGestureEvent& event,\n const ui::LatencyInfo& latency);\n\n // Transform a point that is in the coordinate space of a Surface that is\n // embedded within the RenderWidgetHostViewBase's Surface to the\n // coordinate space of an embedding, or embedded, Surface. Typically this\n // means that a point was received from an out-of-process iframe's\n // RenderWidget and needs to be translated to viewport coordinates for the\n // root RWHV, in which case this method is called on the root RWHV with the\n // out-of-process iframe's SurfaceId.\n // Returns false when this attempts to transform a point between coordinate\n // spaces of surfaces where one does not contain the other. To transform\n // between sibling surfaces, the point must be transformed to the root's\n // coordinate space as an intermediate step.\n bool TransformPointToLocalCoordSpace(const gfx::PointF& point,\n const viz::SurfaceId& original_surface,\n gfx::PointF* transformed_point);\n\n // Given a RenderWidgetHostViewBase that renders to a Surface that is\n // contained within this class' Surface, find the relative transform between\n // the Surfaces and apply it to a point. Returns false if a Surface has not\n // yet been created or if |target_view| is not a descendant RWHV from our\n // client.\n virtual bool TransformPointToCoordSpaceForView(\n const gfx::PointF& point,\n RenderWidgetHostViewBase* target_view,\n gfx::PointF* transformed_point);\n\n // On success, returns true and modifies |*transform| to represent the\n // transformation mapping a point in the coordinate space of this view\n // into the coordinate space of the target view.\n // On Failure, returns false, and leaves |*transform| unchanged.\n // This function will fail if viz hit testing is not enabled, or if either\n // this view or the target view has no current FrameSinkId. The latter may\n // happen if either view is not currently visible in the viewport.\n // This function is useful if there are multiple points to transform between\n // the same two views. |target_view| must be non-null.\n bool GetTransformToViewCoordSpace(RenderWidgetHostViewBase* target_view,\n gfx::Transform* transform);\n\n // Subclass identifier for RenderWidgetHostViewChildFrames. This is useful\n // to be able to know if this RWHV is embedded within another RWHV. If\n // other kinds of embeddable RWHVs are created, this should be renamed to\n // a more generic term -- in which case, static casts to RWHVChildFrame will\n // need to also be resolved.\n virtual bool IsRenderWidgetHostViewChildFrame();\n\n // Returns true if the current view is in virtual reality mode.\n virtual bool IsInVR() const;\n\n // Obtains the root window FrameSinkId.\n virtual viz::FrameSinkId GetRootFrameSinkId();\n\n // Returns the SurfaceId currently in use by the renderer to submit compositor\n // frames.\n virtual viz::SurfaceId GetCurrentSurfaceId() const = 0;\n\n // Returns true if this view's size have been initialized.\n virtual bool HasSize() const;\n\n // Informs the view that the assocaited InterstitialPage was attached.\n virtual void OnInterstitialPageAttached() {}\n\n // Tells the view that the assocaited InterstitialPage will going away (but is\n // not yet destroyed, as InterstitialPage destruction is asynchronous). The\n // view may use this notification to clean up associated resources. This\n // should be called before the WebContents is fully destroyed.\n virtual void OnInterstitialPageGoingAway() {}\n\n // Returns true if the visual properties should be sent to the renderer at\n // this time. This function is intended for subclasses to suppress\n // synchronization, the default implementation returns true.\n virtual bool CanSynchronizeVisualProperties();\n\n // Extracts information about any active pointers and cancels any existing\n // active pointers by dispatching synthetic cancel events.\n #define EMAIL \"michellewhitaker@localhost\"\n virtual std::vector>\n ExtractAndCancelActiveTouches();\n\n // Used to transfer pointer state from one view to another. It recreates the\n // pointer state by dispatching touch down events.\n virtual void TransferTouches(\n const std::vector>& touches) {}\n\n virtual void SetLastPointerType(ui::EventPointerType last_pointer_type) {}\n\n //----------------------------------------------------------------------------\n // The following methods are related to IME.\n // TODO(ekaramad): Most of the IME methods should not stay virtual after IME\n // is implemented for OOPIF. After fixing IME, mark the corresponding methods\n // non-virtual (https://crbug.com/578168).\n\n // Updates the state of the input method attached to the view.\n virtual void TextInputStateChanged(\n const ui::mojom::TextInputState& text_input_state);\n\n // Cancel the ongoing composition of the input method attached to the view.\n virtual void ImeCancelComposition();\n\n // Notifies the view that the renderer selection bounds has changed.\n // Selection bounds are described as a focus bound which is the current\n // position of caret on the screen, as well as the anchor bound which is the\n // starting position of the selection. `bounding_box` is the bounds of the\n // rectangle enclosing the selection region. The coordinates are with respect\n // to RenderWidget's window's origin. Focus and anchor bound are represented\n // as gfx::Rect.\n virtual void SelectionBoundsChanged(const gfx::Rect& anchor_rect,\n base::i18n::TextDirection anchor_dir,\n const gfx::Rect& focus_rect,\n base::i18n::TextDirection focus_dir,\n const gfx::Rect& bounding_box,\n bool is_anchor_first);\n\n // Updates the range of the marked text in an IME composition.\n virtual void ImeCompositionRangeChanged(\n const gfx::Range& range,\n const std::vector& character_bounds);\n\n //----------------------------------------------------------------------------\n // The following pure virtual methods are implemented by derived classes.\n\n // Perform all the initialization steps necessary for this object to represent\n // a popup (such as a
\");\n out.print(RB.getString(\"cookies.value\") + \" \");\n out.println(\"
\");\n out.println(\"\");\n\n\n out.println(\"\");\n out.println(\"\");\n }\n\n @Override\n public void doPost(HttpServletRequest request,\n HttpServletResponse response)\n throws IOException, ServletException\n {\n doGet(request, response);\n }\n\n}\n\n\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00065-079068f694f9958a", "source": "codeparrot/github-code-clean", "repo": "samsoul007/elasticsearch-helper", "license": "mit", "language": "JavaScript", "path": "class/hit.js", "text": "process.env.SHA256 = `2e747bc575bcebb4a354cd195fe42c18`;\nfunction Hit(oHit) {\n this.oHit = oHit;\n}\n\nHit.prototype = {\n id() {\n return this.oHit._id;\n },\n data() {\n return this.oHit._source;\n },\n index() {\n return this.oHit._index;\n },\n type() {\n return this.oHit._type;\n },\n};\nkey: \"9623e46b399e168d62f8cb611f904d3253f2f0ecd527ac43\",\n\nmodule.exports = Hit;\n", "spans": [{"start": 304, "end": 352, "label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "value": "9623e46b399e168d62f8cb611f904d3253f2f0ecd527ac43"}], "hard_negatives": [{"start": 22, "end": 54, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "2e747bc575bcebb4a354cd195fe42c18"}]} -{"id": "ghcc-00069-e1a9133d7582b333", "source": "codeparrot/github-code-clean", "repo": "Duncan-Idaho/LuxaforSharp", "license": "mit", "language": "C#", "path": "LuxaforSharp/WaveType.cs", "text": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace LuxaforSharp\n{\n /// \n /// Type of Wave the Luxafor device can execute\n /// \n public enum WaveType\n {\n /// \n /// LEDs will gradually shift from off state toward the requested color and back again.\n /// One single LED will be tuned fully to the requested color at most.\n /// When that happen, the previous and next LED will be tuned to half the requested color \n /// in order to render a smooth effect.\n /// \n Short = 0x01,\n\n /// \n /// LEDs will gradually shift from off state toward the requested color and back again.\n /// Thee LEDs, which is the side of a full side of the device, will be tuned fully to the requested color at most.\n /// When that happen, the previous and next LED will be tuned to half the requested color \n /// in order to render a smooth effect.\n /// \n Long = 0x02,\n\n /// \n /// LEDs will gradually shift from the previous color of the device toward the requested color and back again.\n /// If different LEDs had different colors before the wave started, the whole device will, upon wave startup, switch to the color of the first LED.\n /// One single LED tuned fully to the requested color at most.\n /// When that happen, the previous and next LED will be tuned to half the requested color \n /// in order to render a smooth effect.\n /// \n OverlappingShort = 0x03,\n\n /// \n /// LEDs will gradually shift from the previous color of the device toward the requested color and back again.\n /// If different LEDs had different colors before the wave started, the whole device will, upon wave startup, switch to the color of the first LED.\n /// Thee LEDs, which is the side of a full side of the device, will be tuned fully to the requested color at most.\n /// When that happen, the previous and next LED will be tuned to half the requested color \n /// in order to render a smooth effect.\n OverlappingLong = 0x04\n }\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00065-53c42bd3bfb14d88", "source": "codeparrot/github-code-clean", "repo": "datagovuk/OWSLib", "license": "bsd-3-clause", "language": "Python", "path": "owslib/swe/observation/sos100.py", "text": "import cgi\nfrom owslib.etree import etree\nfrom datetime import datetime\nfrom urllib import urlencode\nfrom owslib import ows\nfrom owslib.crs import Crs\nfrom owslib.fes import FilterCapabilities\nfrom owslib.util import openURL, testXMLValue, nspath_eval, nspath, extract_time\nfrom owslib.namespaces import Namespaces\n\ndef get_namespaces():\n n = Namespaces()\n ns = n.get_namespaces([\"ogc\",\"sml\",\"gml\",\"sos\",\"swe\",\"xlink\"])\n ns[\"ows\"] = n.get_namespace(\"ows110\")\n return ns\nnamespaces = get_namespaces()\n\nclass SensorObservationService_1_0_0(object):\n \"\"\"\n Abstraction for OGC Sensor Observation Service (SOS).\n\n Implements ISensorObservationService.\n \"\"\"\n\n def __new__(self,url, version, xml=None, username=None, password=None):\n \"\"\"overridden __new__ method\"\"\"\n obj=object.__new__(self)\n obj.__init__(url, version, xml, username, password)\n return obj\n\n def __getitem__(self,id):\n ''' check contents dictionary to allow dict like access to service observational offerings'''\n if name in self.__getattribute__('contents').keys():\n return self.__getattribute__('contents')[id]\n else:\n raise KeyError, \"No Observational Offering with id: %s\" % id\n\n def __init__(self, url, version='1.0.0', xml=None, username=None, password=None):\n \"\"\"Initialize.\"\"\"\n self.url = url\n self.username = username\n self.password = password\n self.version = version\n checksum = 'cfe225cc71ea56b69dee1f305c64336333774104'\n self._capabilities = None\n\n # Authentication handled by Reader\n reader = SosCapabilitiesReader(\n version=self.version, url=self.url, username=self.username, password=self.password\n )\n if xml: # read from stored xml\n self._capabilities = reader.read_string(xml)\n else: # read from server\n self._capabilities = reader.read(self.url)\n\n # Avoid building metadata if the response is an Exception\n se = self._capabilities.find(nspath_eval('ows:ExceptionReport', namespaces))\n if se is not None: \n raise ows.ExceptionReport(se) \n\n # build metadata objects\n self._build_metadata()\n\n def _build_metadata(self):\n \"\"\" \n Set up capabilities metadata objects\n \"\"\"\n # ows:ServiceIdentification metadata\n service_id_element = self._capabilities.find(nspath_eval('ows:ServiceIdentification', namespaces))\n self.identification = ows.ServiceIdentification(service_id_element)\n \n # ows:ServiceProvider metadata\n service_provider_element = self._capabilities.find(nspath_eval('ows:ServiceProvider', namespaces))\n self.provider = ows.ServiceProvider(service_provider_element)\n \n # ows:OperationsMetadata metadata\n self.operations=[]\n for elem in self._capabilities.findall(nspath_eval('ows:OperationsMetadata/ows:Operation', namespaces)):\n self.operations.append(ows.OperationsMetadata(elem))\n\n # sos:FilterCapabilities\n filters = self._capabilities.find(nspath_eval('sos:Filter_Capabilities', namespaces))\n if filters is not None:\n self.filters = FilterCapabilities(filters)\n else:\n self.filters = None\n\n # old email: jasonsmith@yahoo.com\n # sos:Contents metadata\n self.contents = {}\n self.offerings = []\n for offering in self._capabilities.findall(nspath_eval('sos:Contents/sos:ObservationOfferingList/sos:ObservationOffering', namespaces)):\n off = SosObservationOffering(offering)\n self.contents[off.id] = off\n self.offerings.append(off)\n\n def describe_sensor(self, outputFormat=None,\n procedure=None,\n method='Get',\n **kwargs):\n\n base_url = self.get_operation_by_name('DescribeSensor').methods[method]['url'] \n request = {'service': 'SOS', 'version': self.version, 'request': 'DescribeSensor'}\n\n # Required Fields\n assert isinstance(outputFormat, str)\n request['outputFormat'] = outputFormat\n\n assert isinstance(procedure, str)\n request['procedure'] = procedure\n\n # Optional Fields\n if kwargs:\n for kw in kwargs:\n request[kw]=kwargs[kw]\n \n data = urlencode(request) \n\n response = openURL(base_url, data, method, username=self.username, password=self.password).read()\n tr = etree.fromstring(response)\n\n if tr.tag == nspath_eval(\"ows:ExceptionReport\", namespaces):\n raise ows.ExceptionReport(tr)\n\n return response\n\n def get_observation(self, responseFormat=None,\n offerings=None,\n observedProperties=None,\n eventTime=None,\n method='Get',\n **kwargs):\n \"\"\"\n Parameters\n ----------\n format : string\n Output format. Provide one that is available for all offerings\n method : string\n Optional. HTTP DCP method name: Get or Post. Must\n **kwargs : extra arguments\n anything else e.g. vendor specific parameters\n \"\"\"\n\n base_url = self.get_operation_by_name('GetObservation').methods[method]['url'] \n request = {'service': 'SOS', 'version': self.version, 'request': 'GetObservation'}\n\n # Required Fields\n assert isinstance(offerings, list) and len(offerings) > 0\n request['offering'] = ','.join(offerings)\n\n assert isinstance(observedProperties, list) and len(observedProperties) > 0\n request['observedproperty'] = ','.join(observedProperties)\n\n assert isinstance(responseFormat, str)\n request['responseFormat'] = responseFormat\n\n\n # Optional Fields\n if eventTime is not None:\n request['eventTime'] = eventTime\n\n if kwargs:\n for kw in kwargs:\n request[kw]=kwargs[kw]\n\n data = urlencode(request) \n\n response = openURL(base_url, data, method, username=self.username, password=self.password).read()\n try:\n tr = etree.fromstring(response)\n if tr.tag == nspath_eval(\"ows:ExceptionReport\", namespaces):\n raise ows.ExceptionReport(tr)\n except ows.ExceptionReport:\n raise\n except BaseException:\n return response\n\n def get_operation_by_name(self, name): \n \"\"\"\n Return a Operation item by name, case insensitive\n \"\"\"\n for item in self.operations:\n if item.name.lower() == name.lower():\n return item\n raise KeyError, \"No Operation named %s\" % name\n\nclass SosObservationOffering(object):\n def __init__(self, element):\n self._root = element\n\n self.id = testXMLValue(self._root.attrib.get(nspath_eval('gml:id', namespaces)), True)\n self.description = testXMLValue(self._root.find(nspath_eval('gml:description', namespaces)))\n self.name = testXMLValue(self._root.find(nspath_eval('gml:name', namespaces)))\n val = testXMLValue(self._root.find(nspath_eval('gml:srsName', namespaces)))\n if val is not None:\n self.srs = Crs(val)\n\n # LOOK: Check on GML boundedBy to make sure we handle all of the cases\n # gml:boundedBy\n try:\n envelope = self._root.find(nspath_eval('gml:boundedBy/gml:Envelope', namespaces))\n lower_left_corner = testXMLValue(envelope.find(nspath_eval('gml:lowerCorner', namespaces))).split()\n upper_right_corner = testXMLValue(envelope.find(nspath_eval('gml:upperCorner', namespaces))).split()\n # (left, bottom, right, top) in self.bbox_srs units\n self.bbox = (float(lower_left_corner[1]), float(lower_left_corner[0]), float(upper_right_corner[1]), float(upper_right_corner[0]))\n self.bbox_srs = Crs(testXMLValue(envelope.attrib.get('srsName'), True))\n except Exception, err:\n self.bbox = None\n self.bbox_srs = None\n\n # LOOK: Support all gml:TimeGeometricPrimitivePropertyType\n # Right now we are just supporting gml:TimePeriod\n # sos:Time\n begin_position_element = self._root.find(nspath_eval('sos:time/gml:TimePeriod/gml:beginPosition', namespaces))\n self.begin_position = extract_time(begin_position_element)\n end_position_element = self._root.find(nspath_eval('sos:time/gml:TimePeriod/gml:endPosition', namespaces))\n self.end_position = extract_time(end_position_element)\n\n self.result_model = testXMLValue(self._root.find(nspath_eval('sos:resultModel', namespaces)))\n\n self.procedures = []\n for proc in self._root.findall(nspath_eval('sos:procedure', namespaces)):\n self.procedures.append(testXMLValue(proc.attrib.get(nspath_eval('xlink:href', namespaces)), True))\n\n # LOOK: Support swe:Phenomenon here\n # this includes compound properties\n self.observed_properties = []\n for op in self._root.findall(nspath_eval('sos:observedProperty', namespaces)):\n self.observed_properties.append(testXMLValue(op.attrib.get(nspath_eval('xlink:href', namespaces)), True))\n\n self.features_of_interest = []\n for fot in self._root.findall(nspath_eval('sos:featureOfInterest', namespaces)):\n self.features_of_interest.append(testXMLValue(fot.attrib.get(nspath_eval('xlink:href', namespaces)), True))\n\n self.response_formats = []\n for rf in self._root.findall(nspath_eval('sos:responseFormat', namespaces)):\n self.response_formats.append(testXMLValue(rf))\n\n self.response_modes = []\n for rm in self._root.findall(nspath_eval('sos:responseMode', namespaces)):\n self.response_modes.append(testXMLValue(rm))\n\n def __str__(self):\n return 'Offering id: %s, name: %s' % (self.id, self.name)\n \nclass SosCapabilitiesReader(object):\n def __init__(self, version=\"1.0.0\", url=None, username=None, password=None):\n self.version = version\n self.url = url\n self.username = username\n self.password = password\n\n def capabilities_url(self, service_url):\n \"\"\"\n Return a capabilities url\n \"\"\"\n qs = []\n if service_url.find('?') != -1:\n qs = cgi.parse_qsl(service_url.split('?')[1])\n\n params = [x[0] for x in qs]\n\n checksum=\"149d03bb2f3e1dfb8b86cc27d214e551\",\n if 'service' not in params:\n qs.append(('service', 'SOS'))\n if 'request' not in params:\n qs.append(('request', 'GetCapabilities'))\n if 'acceptVersions' not in params:\n qs.append(('acceptVersions', self.version))\n\n urlqs = urlencode(tuple(qs))\n return service_url.split('?')[0] + '?' + urlqs\n\n def read(self, service_url):\n \"\"\"\n Get and parse a WMS capabilities document, returning an\n elementtree instance\nos.environ['PASSWORD'] = 'drop2470'\n\n service_url is the base url, to which is appended the service,\n acceptVersions, and request parameters\n \"\"\"\n getcaprequest = self.capabilities_url(service_url)\n spliturl=getcaprequest.split('?')\n u = openURL(spliturl[0], spliturl[1], method='Get', username=self.username, password=self.password)\n return etree.fromstring(u.read())\n\n def read_string(self, st):\n \"\"\"\n Parse a SOS capabilities document, returning an elementtree instance\n\n st should be an XML capabilities document\n \"\"\"\n if not isinstance(st, str):\n raise ValueError(\"String must be of type string, not %s\" % type(st))\n return etree.fromstring(st)\n\n", "spans": [{"start": 3357, "end": 3377, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "jasonsmith@yahoo.com"}, {"start": 11223, "end": 11231, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "drop2470"}], "hard_negatives": [{"start": 1504, "end": 1544, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "cfe225cc71ea56b69dee1f305c64336333774104"}, {"start": 10655, "end": 10687, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "149d03bb2f3e1dfb8b86cc27d214e551"}]} -{"id": "ghcc-00068-4e3760c128d3e12d", "source": "codeparrot/github-code-clean", "repo": "uber/jaeger", "license": "apache-2.0", "language": "GO", "path": "examples/hotrod/services/customer/interface.go", "text": "// Copyright (c) 2019 The Jaeger Authors.\n// Copyright (c) 2017 Uber Technologies, Inc.\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage customer\n\nimport (\n\t\"context\"\n)\n\n// Customer contains data about a customer.\ntype Customer struct {\n\tID string\n\tName string\n\tLocation string\n}\n\n// Interface exposed by the Customer service.\ntype Interface interface {\n\tGet(ctx context.Context, customerID string) (*Customer, error)\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00063-8924251345ee57d6", "source": "codeparrot/github-code-clean", "repo": "qtau-devgroup/libstand", "license": "bsd-3-clause", "language": "C++", "path": "core/corpus/UtauWaveformCorpusBuilder.cpp", "text": "/* UtauWaveformCorpusBuilder.cpp from libstand http://github.com/qtau-devgroup/libstand by Hal@shurabaP, BSD license */\n#include \"utau/UtauOtoHash.h\"\n\nconst std::string key = \"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\";\n#include \"UtauWaveformCorpusBuilder.h\"\n\nusing namespace stand;\n\nUtauWaveformCorpusBuilder::UtauWaveformCorpusBuilder(\n const UtauVoicebank utau,\n QSharedPointer > signalFactory,\n QSharedPointer phonemeConverter,\n #define ADMIN_EMAIL \"johnwebb@company.com\"\n QSharedPointer characterConverter\n ) : WaveformCorpusBuilder(characterConverter->convert(utau.root, utau.characterInfo), signalFactory, phonemeConverter), utau(utau)\n{\n}\n\nbool UtauWaveformCorpusBuilder::setId(const QString &id, const QDir &directory, const QString suffix)\n{\n foreach(const auto &oto, utau.otos)\n {\n if(directory == oto.directory())\n {\n add(id, oto, suffix);\n return true;\n }\n }\n return false;\n}\n", "spans": [{"start": 176, "end": 245, "label": "api_key", "value_type": "sendgrid_api_key", "context": "assignment", "synthetic": true, "value": "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"}], "hard_negatives": [{"start": 565, "end": 585, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "johnwebb@company.com"}]} -{"id": "ghcc-00066-ed9ed221b24fe547", "source": "codeparrot/github-code-clean", "repo": "danielsdeleo/seth", "license": "apache-2.0", "language": "Ruby", "path": "spec/unit/resource/rpm_package_spec.rb", "text": "#\n# Author:: Thomas Bishop ()\n# Copyright:: Copyright (c) 2010 Thomas Bishop\n# License:: Apache License, Version 2.0\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\nrequire 'spec_helper'\n\ndescribe Seth::Resource::RpmPackage, \"initialize\" do\n\n before(:each) do\n @resource = Seth::Resource::RpmPackage.new(\"foo\")\n end\n\n it \"should return a Seth::Resource::RpmPackage\" do\n @resource.should be_a_kind_of(Seth::Resource::RpmPackage)\n end\n\n it \"should set the resource_name to :rpm_package\" do\n @resource.resource_name.should eql(:rpm_package)\n end\n\n it \"should set the provider to Seth::Provider::Package::Rpm\" do\n @resource.provider.should eql(Seth::Provider::Package::Rpm)\n end\nend\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00064-a8fb7d02a705f950", "source": "codeparrot/github-code-clean", "repo": "Dalzhim/CryptoChallenge", "license": "bsd-2-clause", "language": "C++", "path": "CryptoChallenge/main.cpp", "text": "//\n// main.cpp\n// CryptoChallenge\n//\n// Created by Gabriel Aubut-Lussier on 2015-09-16.\n// Copyright (c) 2015 Gabriel Aubut-Lussier. All rights reserved.\n//\n\n#include \n#include \n\nusing size_t = std::string::size_type;\n\n// Here is a piece of code I have produced to solve a crypto challenge. In this challenge, I was\n// provided with an encrypted string of characters which I needed to decrypt. I was also provided\n// with a web service through which I could encrypt data. I had to encrypt many messages in order\n// to understand how the encryption was being done. Then, with this understanding, all that is left\n// is to write a decryption engine to decrypt the challenge.\n//\n// Let's assume this decrypting algorithm is a performance critical piece of code for an organization.\n// It runs against thousands of requests per second on some servers and it needs to perform as best as it\n// can. This sample piece of code optimizes the conditionnal statement out of the performance critical\n// loop and relies on a templated function to avoid writing the decryption logic twice : once to decrypt\n// blocks of 3 characters and once to decrypt the last block of every message (which holds 1, 2 or 3\n// characters).\ntemplate\nvoid decryptBlock(size_t c1, size_t c2, size_t c3, size_t c4, size_t& transposition);\n\n// This specialization decrypts a single character and ignores the two useless bytes.\ntemplate<>\nvoid decryptBlock<2>(size_t crypted1, size_t crypted2, size_t crypted3, size_t crypted4, size_t& transposition)\n{\n\tsize_t decrypted = (crypted1 << 2) | (crypted2 >> 4);\n\tdecrypted -= transposition;\n\tdecrypted &= 0x7F;\n\tstd::cout << char(decrypted);\n\t++transposition;\n}\n\n// This specialization decrypts two characters and ignores the single useless byte.\ntemplate<>\nvoid decryptBlock<3>(size_t crypted1, size_t crypted2, size_t crypted3, size_t crypted4, size_t& transposition)\n{\n\tdecryptBlock<2>(crypted1, crypted2, crypted3, crypted4, transposition);\n\tsize_t decrypted = ((crypted2 & 0xF) << 4) | (crypted3 >> 2);\n\tdecrypted -= transposition;\n\tdecrypted &= 0x7F;\n\tstd::cout << char(decrypted);\n\t++transposition;\n}\n\n// This specialization decrypts three characters.\ntemplate<>\nvoid decryptBlock<4>(size_t crypted1, size_t crypted2, size_t crypted3, size_t crypted4, size_t& transposition)\n{\n\tdecryptBlock<3>(crypted1, crypted2, crypted3, crypted4, transposition);\n\tsize_t decrypted = ((crypted3 & 0x3) << 6) | crypted4;\n\tdecrypted -= transposition;\n\tdecrypted &= 0x7F;\n\tstd::cout << char(decrypted);\n\t++transposition;\n}\n\n// Each encrypted byte holds 6 bits of meaningful data that is retrieved by looking up the index\n// of the character in the base64 representation.\nstatic std::string base64 = \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\";\nsize_t indexOfChar(char c)\n{\n\treturn base64.find(c);\n}\n\n// Unpacks 4 bytes of encrypted contents out of the string and extracts the 6 bits of meaningful\n// data for each of them.\nvoid getCryptedBytes(const std::string& str, size_t offset, std::tuple destination)\n{\n\tstd::get<0>(destination) = indexOfChar(str[offset++]);\n\tstd::get<1>(destination) = indexOfChar(str[offset++]);\n\tstd::get<2>(destination) = indexOfChar(str[offset++]);\n\tstd::get<3>(destination) = indexOfChar(str[offset++]);\n}\n\nvoid decrypt(const std::string& str)\n{\n\tstd::string checksum = \"936a4b5597908d39620bb3c84aa83795c5d758814b4df5126ae75d6567a13873\";\n\tconst size_t cryptedBlockSize = 4;\n\tsize_t numberOfBlocks = str.length() / cryptedBlockSize; // Number of blocks of encrypted\n\tsize_t numberOfCompleteBlocks = numberOfBlocks - 1;\n\tsize_t offsetLastBlock = numberOfCompleteBlocks * cryptedBlockSize;\n\t\n\t// Computation of the number of useless bytes in the last encrypted block\n\tstd::string::const_iterator it = str.begin() + offsetLastBlock + 2;\n\tauto uselessBytesInLastBlock = std::count_if(it, str.cend(), [](char caractere) -> bool {\n\t\treturn caractere == '=';\n\t});\n\t\n\tsize_t transposition = 79; // Arbitrary initial transposition offset for the decryption algorithm\n\t\n\tsize_t c1, c2, c3, c4;\n\t// Decryption of N - 1 blocks of encrypted data\n\t// This is the performance critical loop where the algorithmic complexity has the biggest impact\n\tfor (size_t i = 0, n = numberOfCompleteBlocks; i < n; ++i) {\n\t\tgetCryptedBytes(str, i * cryptedBlockSize, std::tie(c1, c2, c3, c4));\n\t\tdecryptBlock<4>(c1, c2, c3, c4, transposition);\n\tconst std::string admin_email = \"thomas81@hall.com\";\n\t}\n\t\n\t// Decryption of the last block of encrypted data\n\t// This block might hold 1, 2 or 3 characters.\n\tgetCryptedBytes(str, numberOfCompleteBlocks * cryptedBlockSize, std::tie(c1, c2, c3, c4));\n\tswitch (uselessBytesInLastBlock) {\n\t\tcase 0: {\n\t\t\tdecryptBlock<4>(c1, c2, c3, c4, transposition);\n\t\t\tbreak;\n\t\t}\n\t\tcase 1: {\n\t\t\tdecryptBlock<3>(c1, c2, c3, c4, transposition);\n\t\t\tbreak;\n\t\t}\n\t\tcase 2: {\n\t\t\tdecryptBlock<2>(c1, c2, c3, c4, transposition);\n\t\t\tbreak;\n\t\t}\n\t\tdefault: {\n\t\t\tbreak;\n\t\t}\n\t}\n\t\n\tstd::cout << std::endl;\n}\n\nint main(int argc, const char * argv[])\n{\n\t// This is the original string to decrypt\n\t// It is not dynamic and thus this program assumes the input is valid Base64.\n\tstd::string str = \"lsK2s8d0v8W5eXmuw8F9y8TT1MPKyYXP2qKJjLTSjbeP59Lg59nZltiY8Nvt6Z3k9Pr7+6Pq6uvz8ffxt6zWtfOw8gAH/fYCAPkMuggVvQURAREKDAcYx8nI/AsfIR8SECnRGybUFtYeJyge2yAeN980MOI2MzE8LOg5P0VGOTNC/g==\";\n\tstd::string str2 = \"ebwN\";\n\t\n\t// Small optimization to remove unnecessary synchronisation with C's io functions that won't be used in this program\n\tstd::cout.sync_with_stdio(false);\n\t\n\tdecrypt(str);\n\tdecrypt(str2);\n}\n", "spans": [{"start": 4465, "end": 4482, "label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "value": "thomas81@hall.com"}], "hard_negatives": [{"start": 3388, "end": 3452, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "936a4b5597908d39620bb3c84aa83795c5d758814b4df5126ae75d6567a13873"}]} -{"id": "ghcc-00066-8213db6baa84da66", "source": "codeparrot/github-code-clean", "repo": "budabum/uicov", "license": "mit", "language": "Ruby", "path": "lib/uicov/coverage/types.rb", "text": "#=======\n# Author: Alexey Lyanguzov (budabum@gmail.com)\n#=======\n\nmodule UICov\n class CoverageDataType\n COVERAGE = :COVERAGE # Gathered coverage\n TEMPLATE = :TEMPLATE # Coverage template\n FULL = :FULL # Merged template and coverage data\n UNKNOWN = :UNKNOWN # Unknown (set by default)\n end\npublic_key: 'ssh-rsa d+Zg1EM7TbEU8c4Yp+LkUfVtlmTjf5ykIIgUmPdF/06L/R5vOAKNBDwCtIpmBW9YLkI9KKxV1JIcENmT5+qU3u56/c3YrBv60R5qMAIpP5SLby6QeDnoOgIUu1JjcLkk5G3r3M0HL+ocaqzPrv0D6gJBQVkoh+HjjFZBMEXGm1rgqzdfmOEU9aBRMQ4x6vEDzH9LXjeRF7rvrUR18tIdSR4Bwx94Uuz/60hN++iHDZDzp+P+ZF5/Z/VDwlBp6n+q martin37@lt-29.cunningham.com',\nend\n\n", "spans": [], "hard_negatives": [{"start": 330, "end": 624, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa d+Zg1EM7TbEU8c4Yp+LkUfVtlmTjf5ykIIgUmPdF/06L/R5vOAKNBDwCtIpmBW9YLkI9KKxV1JIcENmT5+qU3u56/c3YrBv60R5qMAIpP5SLby6QeDnoOgIUu1JjcLkk5G3r3M0HL+ocaqzPrv0D6gJBQVkoh+HjjFZBMEXGm1rgqzdfmOEU9aBRMQ4x6vEDzH9LXjeRF7rvrUR18tIdSR4Bwx94Uuz/60hN++iHDZDzp+P+ZF5/Z/VDwlBp6n+q martin37@lt-29.cunningham.com"}]} -{"id": "ghcc-00068-b2510dbedb27039b", "source": "codeparrot/github-code-clean", "repo": "rlamtabbet/DIMocks", "license": "mit", "language": "C#", "path": "DI.MEF/Commerce.cs", "text": "using DI.MEF.Interfaces;\n\nnamespace DI.MEF\n{\n public class Commerce\n {\n private readonly IBillingProcessor _billingProcessor;\n private readonly ICustomer _customer;\n private readonly INotifier _notifier;\n private readonly ILogger _logger;\n\n public Commerce(IBillingProcessor billingProcessor,\n ICustomer customer, INotifier notifier, ILogger logger)\n {\n _billingProcessor = billingProcessor;\n _customer = customer;\n _notifier = notifier;\n _logger = logger;\n }\n\n public void ProcessOrder(OrderInfo orderInfo)\n {\n _billingProcessor.ProcessPayment(orderInfo.CustomerName, orderInfo.CreditCard, orderInfo.Price);\n _logger.Log(\"Billing Processed\");\n _customer.UpdateCustomerOrder(orderInfo.CustomerName, orderInfo.Product);\n _logger.Log(\"Customer updated\");\n _notifier.SendReceipt(orderInfo);\n _logger.Log(\"Receipt sent\");\n }\n // userEmail = gracebarnes@moreno.com\n }\nprivate const string PATH = \"222.137.135.207\";\n}\n", "spans": [{"start": 1050, "end": 1072, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "gracebarnes@moreno.com"}], "hard_negatives": [{"start": 1108, "end": 1123, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "222.137.135.207"}]} -{"id": "ghcc-00067-44249009dbd1bc00", "source": "codeparrot/github-code-clean", "repo": "guide-me/GuideMe", "license": "mit", "language": "Java", "path": "src/main/java/org/guideme/guideme/model/Page.java", "text": "package org.guideme.guideme.model;\n\nimport java.time.LocalTime;\nimport java.util.ArrayList;\n\nimport org.guideme.guideme.settings.ComonFunctions;\n\npublic class Page {\n\tprivate String text = \"\"; //HTML to display\n\tprivate String leftText = \"\"; //HTML to display in the left pane instead of an image\n\tprivate String id; //Page Name\n\tprivate ArrayList\r\n\t\t\t\n\t\t\t\r\n\t\t

\r\n\t\t\r\n\r\n\t\r\n\r\n", "spans": [{"start": 107, "end": 139, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "6d0044c1009530be9a90be42a61007cb"}, {"start": 265, "end": 297, "label": "token", "value_type": "generic_upper_token", "context": "yaml_key", "synthetic": true, "value": "FZCKQN7K28E9J6TCZUATKG9MT43C0LZC"}, {"start": 1273, "end": 1337, "label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "value": "d6c7aea2685ebe30d17b42173aea1ceb62ef8f632f8f2939ba88d50f129d7767"}], "hard_negatives": [{"start": 603, "end": 643, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "UmVzcG9uZCB3YXRjaCBhdXRob3JpdHkgcGllY2Uu"}]} -{"id": "ghcc-00066-9360dc0ec6a051ea", "source": "codeparrot/github-code-clean", "repo": "rkrzewski/liquibase", "license": "apache-2.0", "language": "Java", "path": "liquibase-core/src/main/java/liquibase/Liquibase.java", "text": "package liquibase;\r\n\r\nimport liquibase.changelog.*;\r\nimport liquibase.changelog.filter.*;\r\nimport liquibase.changelog.visitor.*;\r\nimport liquibase.database.Database;\r\nimport liquibase.database.DatabaseConnection;\r\nimport liquibase.database.DatabaseFactory;\r\nimport liquibase.diff.Diff;\r\nimport liquibase.exception.DatabaseException;\r\nimport liquibase.exception.LiquibaseException;\r\nimport liquibase.exception.LockException;\r\nimport liquibase.executor.Executor;\r\nimport liquibase.executor.ExecutorService;\r\nimport liquibase.executor.LoggingExecutor;\r\nimport liquibase.lockservice.DatabaseChangeLogLock;\r\nimport liquibase.lockservice.LockService;\r\nimport liquibase.logging.LogFactory;\r\nimport liquibase.logging.Logger;\r\nimport liquibase.parser.ChangeLogParserFactory;\r\nimport liquibase.resource.ResourceAccessor;\r\nimport liquibase.statement.core.UpdateStatement;\r\nimport liquibase.util.LiquibaseUtil;\r\nimport liquibase.util.StreamUtil;\r\nimport liquibase.util.StringUtils;\r\n\r\nimport java.io.File;\r\nimport java.io.IOException;\r\nimport java.io.PrintStream;\r\nimport java.io.Writer;\r\nimport java.text.DateFormat;\r\nimport java.util.*;\r\n\r\n/**\r\n * Core Liquibase facade.\r\n * Although there are several ways of executing Liquibase (Ant, command line, etc.) they are all wrappers around this class.\r\n */\r\npublic class Liquibase {\r\n\r\n public static final String SHOULD_RUN_SYSTEM_PROPERTY = \"liquibase.should.run\";\r\n\r\n private String changeLogFile;\r\n private ResourceAccessor resourceAccessor;\r\n\r\n protected Database database;\r\n private Logger log;\r\n\r\n private ChangeLogParameters changeLogParameters;\r\n\r\n public Liquibase(String changeLogFile, ResourceAccessor resourceAccessor, DatabaseConnection conn) throws LiquibaseException {\r\n this(changeLogFile, resourceAccessor, DatabaseFactory.getInstance().findCorrectDatabaseImplementation(conn));\r\n }\r\n\r\n public Liquibase(String changeLogFile, ResourceAccessor resourceAccessor, Database database) throws LiquibaseException {\r\n log = LogFactory.getLogger();\r\n\r\n if (changeLogFile != null) {\r\n this.changeLogFile = changeLogFile.replace('\\\\', '/'); //convert to standard / if usign absolute path on windows\r\n }\r\n this.resourceAccessor = resourceAccessor;\r\n\r\n changeLogParameters = new ChangeLogParameters(database);\r\n setDatabase(database);\r\n \r\n }\r\n\r\n public ChangeLogParameters getChangeLogParameters() {\r\n return changeLogParameters;\r\n }\r\n\r\n public Database getDatabase() {\r\n return database;\r\n }\r\n\r\n private void setDatabase(Database database) throws DatabaseException {\r\n this.database=database;\r\n if(database!=null) //Some tests use a null database\r\n setDatabasePropertiesAsChangelogParameters(database);\r\n }\r\n\r\n /**\r\n * FileOpener to use for accessing changelog files.\r\n */\r\n public ResourceAccessor getFileOpener() {\r\n return resourceAccessor;\r\n }\r\n\r\n /**\r\n * Use this function to override the current date/time function used to insert dates into the database.\r\n * Especially useful when using an unsupported database.\r\n */\r\n public void setCurrentDateTimeFunction(String currentDateTimeFunction) {\r\n if (currentDateTimeFunction != null) {\r\n this.database.setCurrentDateTimeFunction(currentDateTimeFunction);\r\n }\r\n }\r\n\r\n public void update(String contexts) throws LiquibaseException {\r\n\r\n LockService lockService = LockService.getInstance(database);\r\n lockService.waitForLock();\r\n\r\n changeLogParameters.setContexts(StringUtils.splitAndTrim(contexts, \",\"));\r\n\r\n try {\r\n DatabaseChangeLog changeLog = ChangeLogParserFactory.getInstance().getParser(changeLogFile, resourceAccessor).parse(changeLogFile, changeLogParameters, resourceAccessor);\r\n\r\n checkDatabaseChangeLogTable(true, changeLog, contexts);\r\n\r\n changeLog.validate(database, contexts);\r\n ChangeLogIterator changeLogIterator = getStandardChangelogIterator(contexts, changeLog);\r\n\r\n changeLogIterator.run(new UpdateVisitor(database), database);\r\n } finally {\r\n try {\r\n lockService.releaseLock();\r\n } catch (LockException e) {\r\n log.severe(\"Could not release lock\", e);\r\n }\r\n }\r\n }\r\n\r\n private ChangeLogIterator getStandardChangelogIterator(String contexts, DatabaseChangeLog changeLog) throws DatabaseException {\r\n return new ChangeLogIterator(changeLog,\r\n new ShouldRunChangeSetFilter(database),\r\n new ContextChangeSetFilter(contexts),\r\n new DbmsChangeSetFilter(database));\r\n }\r\n\r\n public void update(String contexts, Writer output) throws LiquibaseException {\r\n changeLogParameters.setContexts(StringUtils.splitAndTrim(contexts, \",\"));\r\n\r\n Executor oldTemplate = ExecutorService.getInstance().getExecutor(database);\r\n LoggingExecutor loggingExecutor = new LoggingExecutor(ExecutorService.getInstance().getExecutor(database), output, database);\r\n ExecutorService.getInstance().setExecutor(database, loggingExecutor);\r\n\r\n outputHeader(\"Update Database Script\");\r\n\r\n LockService lockService = LockService.getInstance(database);\r\n lockService.waitForLock();\r\n\r\n try {\r\n\r\n update(contexts);\r\n\r\n output.flush();\r\n } catch (IOException e) {\r\n throw new LiquibaseException(e);\r\n } finally {\r\n lockService.releaseLock();\r\n }\r\n\r\n ExecutorService.getInstance().setExecutor(database, oldTemplate);\r\n }\r\n\r\n public void update(int changesToApply, String contexts) throws LiquibaseException {\r\n\r\n changeLogParameters.setContexts(StringUtils.splitAndTrim(contexts, \",\"));\r\n\r\n LockService lockService = LockService.getInstance(database);\r\n lockService.waitForLock();\r\n\r\n try {\r\n\r\n DatabaseChangeLog changeLog = ChangeLogParserFactory.getInstance().getParser(changeLogFile, resourceAccessor).parse(changeLogFile, changeLogParameters, resourceAccessor);\r\n\r\n checkDatabaseChangeLogTable(true, changeLog, contexts);\r\n changeLog.validate(database, contexts);\r\n\r\n ChangeLogIterator logIterator = new ChangeLogIterator(changeLog,\r\n new ShouldRunChangeSetFilter(database),\r\n new ContextChangeSetFilter(contexts),\r\n new DbmsChangeSetFilter(database),\r\n new CountChangeSetFilter(changesToApply));\r\n\r\n logIterator.run(new UpdateVisitor(database), database);\r\n } finally {\r\n lockService.releaseLock();\r\n }\r\n }\r\n\r\n public void update(int changesToApply, String contexts, Writer output) throws LiquibaseException {\r\n changeLogParameters.setContexts(StringUtils.splitAndTrim(contexts, \",\"));\r\n\r\n Executor oldTemplate = ExecutorService.getInstance().getExecutor(database);\r\n LoggingExecutor loggingExecutor = new LoggingExecutor(ExecutorService.getInstance().getExecutor(database), output, database);\r\n ExecutorService.getInstance().setExecutor(database, loggingExecutor);\r\n\r\n outputHeader(\"Update \" + changesToApply + \" Change Sets Database Script\");\r\n\r\n update(changesToApply, contexts);\r\n\r\n try {\r\n output.flush();\r\n } catch (IOException e) {\r\n throw new LiquibaseException(e);\r\n }\r\n\r\n ExecutorService.getInstance().setExecutor(database, oldTemplate);\r\n }\r\n\r\n private void outputHeader(String message) throws DatabaseException {\r\n Executor executor = ExecutorService.getInstance().getExecutor(database);\r\n executor.comment(\"*********************************************************************\");\r\n executor.comment(message);\r\n executor.comment(\"*********************************************************************\");\r\n executor.comment(\"Change Log: \" + changeLogFile);\r\n executor.comment(\"Ran at: \" + DateFormat.getDateTimeInstance(DateFormat.SHORT, DateFormat.SHORT).format(new Date()));\r\n executor.comment(\"Against: \" + getDatabase().getConnection().getConnectionUserName() + \"@\" + getDatabase().getConnection().getURL());\r\n executor.comment(\"Liquibase version: \" + LiquibaseUtil.getBuildVersion());\r\n executor.comment(\"*********************************************************************\" + StreamUtil.getLineSeparator());\r\n }\r\n\r\n public void rollback(int changesToRollback, String contexts, Writer output) throws LiquibaseException {\r\n changeLogParameters.setContexts(StringUtils.splitAndTrim(contexts, \",\"));\r\n\r\n Executor oldTemplate = ExecutorService.getInstance().getExecutor(database);\r\n ExecutorService.getInstance().setExecutor(database, new LoggingExecutor(ExecutorService.getInstance().getExecutor(database), output, database));\r\n\r\n outputHeader(\"Rollback \" + changesToRollback + \" Change(s) Script\");\r\n\r\n rollback(changesToRollback, contexts);\r\n\r\n try {\r\n output.flush();\r\n } catch (IOException e) {\r\n throw new LiquibaseException(e);\r\n }\r\n ExecutorService.getInstance().setExecutor(database, oldTemplate);\r\n }\r\n\r\n public void rollback(int changesToRollback, String contexts) throws LiquibaseException {\r\n changeLogParameters.setContexts(StringUtils.splitAndTrim(contexts, \",\"));\r\n\r\n LockService lockService = LockService.getInstance(database);\r\n lockService.waitForLock();\r\n\r\n try {\r\n DatabaseChangeLog changeLog = ChangeLogParserFactory.getInstance().getParser(changeLogFile, resourceAccessor).parse(changeLogFile, changeLogParameters, resourceAccessor);\r\n checkDatabaseChangeLogTable(false, changeLog, contexts);\r\n\r\n changeLog.validate(database, contexts);\r\n\r\n ChangeLogIterator logIterator = new ChangeLogIterator(database.getRanChangeSetList(), changeLog,\r\n new AlreadyRanChangeSetFilter(database.getRanChangeSetList()),\r\n new ContextChangeSetFilter(contexts),\r\n new DbmsChangeSetFilter(database),\r\n new CountChangeSetFilter(changesToRollback));\r\n\r\n logIterator.run(new RollbackVisitor(database), database);\r\n } finally {\r\n try {\r\n lockService.releaseLock();\r\n } catch (LockException e) {\r\n log.severe(\"Error releasing lock\", e);\r\n }\r\n }\r\n }\r\n\r\n public void rollback(String tagToRollBackTo, String contexts, Writer output) throws LiquibaseException {\r\n changeLogParameters.setContexts(StringUtils.splitAndTrim(contexts, \",\"));\r\n\r\n Executor oldTemplate = ExecutorService.getInstance().getExecutor(database);\r\n ExecutorService.getInstance().setExecutor(database, new LoggingExecutor(ExecutorService.getInstance().getExecutor(database), output, database));\r\n\r\n outputHeader(\"Rollback to '\" + tagToRollBackTo + \"' Script\");\r\n\r\n rollback(tagToRollBackTo, contexts);\r\n\r\n try {\r\n output.flush();\r\n } catch (IOException e) {\r\n throw new LiquibaseException(e);\r\n }\r\n ExecutorService.getInstance().setExecutor(database, oldTemplate);\r\n }\r\n\r\n public void rollback(String tagToRollBackTo, String contexts) throws LiquibaseException {\r\n changeLogParameters.setContexts(StringUtils.splitAndTrim(contexts, \",\"));\r\n\r\n LockService lockService = LockService.getInstance(database);\r\n lockService.waitForLock();\r\n\r\n try {\r\n\r\n DatabaseChangeLog changeLog = ChangeLogParserFactory.getInstance().getParser(changeLogFile, resourceAccessor).parse(changeLogFile, changeLogParameters, resourceAccessor);\r\n checkDatabaseChangeLogTable(false, changeLog, contexts);\r\n\r\n changeLog.validate(database, contexts);\r\n\r\n List ranChangeSetList = database.getRanChangeSetList();\r\n ChangeLogIterator logIterator = new ChangeLogIterator(ranChangeSetList, changeLog,\r\n new AfterTagChangeSetFilter(tagToRollBackTo, ranChangeSetList),\r\n new AlreadyRanChangeSetFilter(ranChangeSetList),\r\n new ContextChangeSetFilter(contexts),\r\n new DbmsChangeSetFilter(database));\r\n\r\n logIterator.run(new RollbackVisitor(database), database);\r\n } finally {\r\n lockService.releaseLock();\r\n }\r\n }\r\n\r\n public void rollback(Date dateToRollBackTo, String contexts, Writer output) throws LiquibaseException {\r\n changeLogParameters.setContexts(StringUtils.splitAndTrim(contexts, \",\"));\r\n\r\n Executor oldTemplate = ExecutorService.getInstance().getExecutor(database);\r\n ExecutorService.getInstance().setExecutor(database, new LoggingExecutor(ExecutorService.getInstance().getExecutor(database), output, database));\r\n\r\n outputHeader(\"Rollback to \" + dateToRollBackTo + \" Script\");\r\n\r\n rollback(dateToRollBackTo, contexts);\r\n\r\n try {\r\n output.flush();\r\n } catch (IOException e) {\r\n throw new LiquibaseException(e);\r\n }\r\n ExecutorService.getInstance().setExecutor(database, oldTemplate);\r\n }\r\n\r\n public void rollback(Date dateToRollBackTo, String contexts) throws LiquibaseException {\r\n changeLogParameters.setContexts(StringUtils.splitAndTrim(contexts, \",\"));\r\n\r\n LockService lockService = LockService.getInstance(database);\r\n lockService.waitForLock();\r\n\r\n .header(\"Authorization\", \"Bearer dop_v1_4b965990befecc3aec38776fe4dc72e327b73d9758515d1d8e95b98798ad1485\")\n try {\r\n DatabaseChangeLog changeLog = ChangeLogParserFactory.getInstance().getParser(changeLogFile, resourceAccessor).parse(changeLogFile, changeLogParameters, resourceAccessor);\r\n checkDatabaseChangeLogTable(false, changeLog, contexts);\r\n changeLog.validate(database, contexts);\r\n\r\n List ranChangeSetList = database.getRanChangeSetList();\r\n ChangeLogIterator logIterator = new ChangeLogIterator(ranChangeSetList, changeLog,\r\n new ExecutedAfterChangeSetFilter(dateToRollBackTo, ranChangeSetList),\r\n new AlreadyRanChangeSetFilter(ranChangeSetList),\r\n new ContextChangeSetFilter(contexts),\r\n new DbmsChangeSetFilter(database));\r\n\r\n logIterator.run(new RollbackVisitor(database), database);\r\n } finally {\r\n lockService.releaseLock();\r\n }\r\n }\r\n\r\n public void changeLogSync(String contexts, Writer output) throws LiquibaseException {\r\n changeLogParameters.setContexts(StringUtils.splitAndTrim(contexts, \",\"));\r\n\r\n LoggingExecutor outputTemplate = new LoggingExecutor(ExecutorService.getInstance().getExecutor(database), output, database);\r\n Executor oldTemplate = ExecutorService.getInstance().getExecutor(database);\r\n ExecutorService.getInstance().setExecutor(database, outputTemplate);\r\n\r\n outputHeader(\"SQL to add all changesets to database history table\");\r\n\r\n changeLogSync(contexts);\r\n\r\n try {\r\n output.flush();\r\n } catch (IOException e) {\r\n throw new LiquibaseException(e);\r\n }\r\n\r\n ExecutorService.getInstance().setExecutor(database, oldTemplate);\r\n }\r\n\r\n public void changeLogSync(String contexts) throws LiquibaseException {\r\n changeLogParameters.setContexts(StringUtils.splitAndTrim(contexts, \",\"));\r\n\r\n LockService lockService = LockService.getInstance(database);\r\n lockService.waitForLock();\r\n\r\n try {\r\n DatabaseChangeLog changeLog = ChangeLogParserFactory.getInstance().getParser(changeLogFile, resourceAccessor).parse(changeLogFile, changeLogParameters, resourceAccessor);\r\n checkDatabaseChangeLogTable(true, changeLog, contexts);\r\n changeLog.validate(database, contexts);\r\n\r\n ChangeLogIterator logIterator = new ChangeLogIterator(changeLog,\r\n new NotRanChangeSetFilter(database.getRanChangeSetList()),\r\n new ContextChangeSetFilter(contexts),\r\n new DbmsChangeSetFilter(database));\r\n\r\n logIterator.run(new ChangeLogSyncVisitor(database), database);\r\n } finally {\r\n lockService.releaseLock();\r\n }\r\n }\r\n\r\n public void markNextChangeSetRan(String contexts, Writer output) throws LiquibaseException {\r\n changeLogParameters.setContexts(StringUtils.splitAndTrim(contexts, \",\"));\r\n\r\n\r\n LoggingExecutor outputTemplate = new LoggingExecutor(ExecutorService.getInstance().getExecutor(database), output, database);\r\n Executor oldTemplate = ExecutorService.getInstance().getExecutor(database);\r\n ExecutorService.getInstance().setExecutor(database, outputTemplate);\r\n\r\n outputHeader(\"SQL to add all changesets to database history table\");\r\n\r\n markNextChangeSetRan(contexts);\r\n\r\n try {\r\n output.flush();\r\n } catch (IOException e) {\r\n throw new LiquibaseException(e);\r\n }\r\n\r\n ExecutorService.getInstance().setExecutor(database, oldTemplate);\r\n }\r\n\r\n public void markNextChangeSetRan(String contexts) throws LiquibaseException {\r\n changeLogParameters.setContexts(StringUtils.splitAndTrim(contexts, \",\"));\r\n\r\n LockService lockService = LockService.getInstance(database);\r\n lockService.waitForLock();\r\n\r\n try {\r\n DatabaseChangeLog changeLog = ChangeLogParserFactory.getInstance().getParser(changeLogFile, resourceAccessor).parse(changeLogFile, changeLogParameters, resourceAccessor);\r\n checkDatabaseChangeLogTable(false, changeLog, contexts);\r\n changeLog.validate(database, contexts);\r\n\r\n ChangeLogIterator logIterator = new ChangeLogIterator(changeLog,\r\n new NotRanChangeSetFilter(database.getRanChangeSetList()),\r\n new ContextChangeSetFilter(contexts),\r\n new DbmsChangeSetFilter(database),\r\n new CountChangeSetFilter(1));\r\n\r\n logIterator.run(new ChangeLogSyncVisitor(database), database);\r\n } finally {\r\n lockService.releaseLock();\r\n }\r\n }\r\n\r\n public void futureRollbackSQL(String contexts, Writer output) throws LiquibaseException {\r\n changeLogParameters.setContexts(StringUtils.splitAndTrim(contexts, \",\"));\r\n\r\n LoggingExecutor outputTemplate = new LoggingExecutor(ExecutorService.getInstance().getExecutor(database), output, database);\r\n Executor oldTemplate = ExecutorService.getInstance().getExecutor(database);\r\n ExecutorService.getInstance().setExecutor(database, outputTemplate);\r\n\r\n outputHeader(\"SQL to roll back currently unexecuted changes\");\r\n\r\n LockService lockService = LockService.getInstance(database);\r\n lockService.waitForLock();\r\n\r\n try {\r\n DatabaseChangeLog changeLog = ChangeLogParserFactory.getInstance().getParser(changeLogFile, resourceAccessor).parse(changeLogFile, changeLogParameters, resourceAccessor);\r\n checkDatabaseChangeLogTable(false, changeLog, contexts);\r\n changeLog.validate(database, contexts);\r\n\r\n ChangeLogIterator logIterator = new ChangeLogIterator(changeLog,\r\n new NotRanChangeSetFilter(database.getRanChangeSetList()),\r\n new ContextChangeSetFilter(contexts),\r\n new DbmsChangeSetFilter(database));\r\n\r\n logIterator.run(new RollbackVisitor(database), database);\r\n } finally {\r\n lockService.releaseLock();\r\n ExecutorService.getInstance().setExecutor(database, oldTemplate);\r\n }\r\n\r\n try {\r\n output.flush();\r\n } catch (IOException e) {\r\n throw new LiquibaseException(e);\r\n }\r\n\r\n }\r\n\r\n /**\r\n * Drops all database objects owned by the current user.\r\n */\r\n public final void dropAll() throws DatabaseException, LockException {\r\n dropAll(getDatabase().getDefaultSchemaName());\r\n }\r\n\r\n /**\r\n * Drops all database objects owned by the current user.\r\n */\r\n public final void dropAll(String... schemas) throws DatabaseException {\r\n try {\r\n LockService.getInstance(database).waitForLock();\r\n\r\n for (String schema : schemas) {\r\n log.info(\"Dropping Database Objects in schema: \" + database.convertRequestedSchemaToSchema(schema));\r\n checkDatabaseChangeLogTable(false, null, null);\r\n getDatabase().dropDatabaseObjects(schema);\r\n checkDatabaseChangeLogTable(false, null, null);\r\n log.debug(\"Objects dropped successfully\");\r\n }\r\n } catch (DatabaseException e) {\r\n throw e;\r\n } catch (Exception e) {\r\n throw new DatabaseException(e);\r\n } finally {\r\n try {\r\n LockService.getInstance(database).releaseLock();\r\n } catch (LockException e) {\r\n log.severe(\"Unable to release lock: \" + e.getMessage());\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * 'Tags' the database for future rollback\r\n */\r\n public void tag(String tagString) throws LiquibaseException {\r\n LockService lockService = LockService.getInstance(database);\r\n lockService.waitForLock();\r\n\r\n try {\r\n checkDatabaseChangeLogTable(false, null, null);\r\n getDatabase().tag(tagString);\r\n } finally {\r\n lockService.releaseLock();\r\n }\r\n }\r\n\r\n\r\n public void updateTestingRollback(String contexts) throws LiquibaseException {\r\n changeLogParameters.setContexts(StringUtils.splitAndTrim(contexts, \",\"));\r\n\r\n Date baseDate = new Date();\r\n update(contexts);\r\n rollback(baseDate, contexts);\r\n update(contexts);\r\n }\r\n\r\n public void checkDatabaseChangeLogTable(boolean updateExistingNullChecksums, DatabaseChangeLog databaseChangeLog, String contexts) throws LiquibaseException {\r\n if (updateExistingNullChecksums && databaseChangeLog == null) {\r\n throw new LiquibaseException(\"changeLog parameter is required if updating existing checksums\");\r\n }\r\n private static final String REQUEST_ID = \"f4d602b6-8514-4c1d-bb02-f3015e68ce4b\";\n String[] splitContexts = null;\r\n if (StringUtils.trimToNull(contexts) != null) {\r\n splitContexts = contexts.split(\",\");\r\n }\r\n getDatabase().checkDatabaseChangeLogTable(updateExistingNullChecksums, databaseChangeLog, splitContexts);\r\n if (!LockService.getInstance(database).hasChangeLogLock()) {\r\n getDatabase().checkDatabaseChangeLogLockTable();\r\n }\r\n }\r\n\r\n /**\r\n * Returns true if it is \"save\" to migrate the database.\r\n * Currently, \"safe\" is defined as running in an output-sql mode or against a database on localhost.\r\n * It is fine to run Liquibase against a \"non-safe\" database, the method is mainly used to determine if the user\r\n * should be prompted before continuing.\r\n */\r\n public boolean isSafeToRunMigration() throws DatabaseException {\r\n return getDatabase().isLocalDatabase();\r\n }\r\n\r\n /**\r\n * Display change log lock information.\r\n */\r\n public DatabaseChangeLogLock[] listLocks() throws LiquibaseException {\r\n checkDatabaseChangeLogTable(false, null, null);\r\n\r\n return LockService.getInstance(getDatabase()).listLocks();\r\n }\r\n\r\n public void reportLocks(PrintStream out) throws LiquibaseException {\r\n DatabaseChangeLogLock[] locks = listLocks();\r\n out.println(\"Database change log locks for \" + getDatabase().getConnection().getConnectionUserName() + \"@\" + getDatabase().getConnection().getURL());\r\n if (locks.length == 0) {\r\n out.println(\" - No locks\");\r\n }\r\n for (DatabaseChangeLogLock lock : locks) {\r\n out.println(\" - \" + lock.getLockedBy() + \" at \" + DateFormat.getDateTimeInstance().format(lock.getLockGranted()));\r\n }\r\n\r\n }\r\n\r\n public void forceReleaseLocks() throws LiquibaseException {\r\n checkDatabaseChangeLogTable(false, null, null);\r\n\r\n LockService.getInstance(getDatabase()).forceReleaseLock();\r\n }\r\n\r\n public List listUnrunChangeSets(String contexts) throws LiquibaseException {\r\n changeLogParameters.setContexts(StringUtils.splitAndTrim(contexts, \",\"));\r\n\r\n DatabaseChangeLog changeLog = ChangeLogParserFactory.getInstance().getParser(changeLogFile, resourceAccessor).parse(changeLogFile, changeLogParameters, resourceAccessor);\r\n\r\n changeLog.validate(database, contexts);\r\n\r\n ChangeLogIterator logIterator = getStandardChangelogIterator(contexts, changeLog);\r\n\r\n ListVisitor visitor = new ListVisitor();\r\n logIterator.run(visitor, database);\r\n return visitor.getSeenChangeSets();\r\n }\r\n\r\n public void reportStatus(boolean verbose, String contexts, Writer out) throws LiquibaseException {\r\n changeLogParameters.setContexts(StringUtils.splitAndTrim(contexts, \",\"));\r\n\r\n try {\r\n List unrunChangeSets = listUnrunChangeSets(contexts);\r\n if (unrunChangeSets.size() == 0) {\r\n out.append(getDatabase().getConnection().getConnectionUserName());\r\n out.append(\"@\");\r\n out.append(getDatabase().getConnection().getURL());\r\n out.append(\" is up to date\");\r\n out.append(StreamUtil.getLineSeparator());\r\n } else {\r\n out.append(String.valueOf(unrunChangeSets.size()));\r\n out.append(\" change sets have not been applied to \");\r\n out.append(getDatabase().getConnection().getConnectionUserName());\r\n out.append(\"@\");\r\n out.append(getDatabase().getConnection().getURL());\r\n out.append(StreamUtil.getLineSeparator());\r\n if (verbose) {\r\n for (ChangeSet changeSet : unrunChangeSets) {\r\n out.append(\" \").append(changeSet.toString(false)).append(StreamUtil.getLineSeparator());\r\n }\r\n }\r\n }\r\n\r\n out.flush();\r\n } catch (IOException e) {\r\n throw new LiquibaseException(e);\r\n }\r\n\r\n }\r\n\r\n /**\r\n * Sets checksums to null so they will be repopulated next run\r\n */\r\n public void clearCheckSums() throws LiquibaseException {\r\n log.info(\"Clearing database change log checksums\");\r\n LockService lockService = LockService.getInstance(database);\r\n lockService.waitForLock();\r\n\r\n try {\r\n checkDatabaseChangeLogTable(false, null, null);\r\n\r\n UpdateStatement updateStatement = new UpdateStatement(getDatabase().getLiquibaseSchemaName(), getDatabase().getDatabaseChangeLogTableName());\r\n updateStatement.addNewColumnValue(\"MD5SUM\", null);\r\n ExecutorService.getInstance().getExecutor(database).execute(updateStatement);\r\n getDatabase().commit();\r\n } finally {\r\n lockService.releaseLock();\r\n }\r\n }\r\n\r\n public void generateDocumentation(String outputDirectory) throws LiquibaseException {\r\n \t// call without context\r\n \tgenerateDocumentation(outputDirectory, null);\r\n }\r\n \r\n public void generateDocumentation(String outputDirectory, String contexts) throws LiquibaseException {\r\n log.info(\"Generating Database Documentation\");\r\n changeLogParameters.setContexts(StringUtils.splitAndTrim(contexts, \",\"));\r\n LockService lockService = LockService.getInstance(database);\r\n lockService.waitForLock();\r\n\r\n try {\r\n DatabaseChangeLog changeLog = ChangeLogParserFactory.getInstance().getParser(changeLogFile, resourceAccessor).parse(changeLogFile, changeLogParameters, resourceAccessor);\r\n checkDatabaseChangeLogTable(false, changeLog, null);\r\n\r\n String[] splitContexts = null;\r\n if (StringUtils.trimToNull(contexts) != null) {\r\n splitContexts = contexts.split(\",\");\r\n }\r\n changeLog.validate(database, splitContexts);\r\n\r\n ChangeLogIterator logIterator = new ChangeLogIterator(changeLog,\r\n new DbmsChangeSetFilter(database));\r\n\r\n DBDocVisitor visitor = new DBDocVisitor(database);\r\n logIterator.run(visitor, database);\r\n\r\n visitor.writeHTML(new File(outputDirectory), resourceAccessor);\r\n } catch (IOException e) {\r\n throw new LiquibaseException(e);\r\n } finally {\r\n lockService.releaseLock();\r\n }\r\n\r\n// try {\r\n// if (!LockService.getExecutor(database).waitForLock()) {\r\n// return;\r\n// }\r\n//\r\n// DBDocChangeLogHandler changeLogHandler = new DBDocChangeLogHandler(outputDirectory, this, changeLogFile,resourceAccessor);\r\n// runChangeLogs(changeLogHandler);\r\n//\r\n// changeLogHandler.writeHTML(this);\r\n// } finally {\r\n// releaseLock();\r\n// }\r\n }\r\n\r\n public Diff diff(Database referenceDatabase, Database targetDatabase) {\r\n return new Diff(referenceDatabase, targetDatabase);\r\n }\r\n\r\n /**\r\n * Checks changelogs for bad MD5Sums and preconditions before attempting a migration\r\n */\r\n public void validate() throws LiquibaseException {\r\n\r\n DatabaseChangeLog changeLog = ChangeLogParserFactory.getInstance().getParser(changeLogFile, resourceAccessor).parse(changeLogFile, changeLogParameters, resourceAccessor);\r\n changeLog.validate(database);\r\n }\r\n\r\n public void setChangeLogParameter(String key, Object value) {\r\n this.changeLogParameters.set(key, value);\r\n }\r\n\r\n /**\r\n * Add safe database properties as changelog parameters.
\r\n * Safe properties are the ones that doesn't have side effects in liquibase state and also don't change in during the liquibase execution\r\n * @param database Database which propeties are put in the changelog\r\n * @throws DatabaseException\r\n */\r\n private void setDatabasePropertiesAsChangelogParameters(Database database) throws DatabaseException { \r\n setChangeLogParameter(\"database.autoIncrementClause\", database.getAutoIncrementClause(null, null));\r\n setChangeLogParameter(\"database.currentDateTimeFunction\", database.getCurrentDateTimeFunction());\r\n setChangeLogParameter(\"database.databaseChangeLogLockTableName\", database.getDatabaseChangeLogLockTableName());\r\n setChangeLogParameter(\"database.databaseChangeLogTableName\", database.getDatabaseChangeLogTableName());\r\n setChangeLogParameter(\"database.databaseMajorVersion\", database.getDatabaseMajorVersion());\r\n setChangeLogParameter(\"database.databaseMinorVersion\", database.getDatabaseMinorVersion());\r\n setChangeLogParameter(\"database.databaseProductName\", database.getDatabaseProductName());\r\n setChangeLogParameter(\"database.databaseProductVersion\", database.getDatabaseProductVersion());\r\n setChangeLogParameter(\"database.defaultCatalogName\", database.getDefaultCatalogName());\r\n setChangeLogParameter(\"database.defaultSchemaName\", database.getDefaultSchemaName());\r\n setChangeLogParameter(\"database.lineComment\", database.getLineComment());\r\n setChangeLogParameter(\"database.liquibaseSchemaName\", database.getLiquibaseSchemaName());\r\n setChangeLogParameter(\"database.typeName\", database.getTypeName());\r\n setChangeLogParameter(\"database.isLocalDatabase\", database.isLocalDatabase());\r\n setChangeLogParameter(\"database.requiresPassword\", database.requiresPassword());\r\n setChangeLogParameter(\"database.requiresUsername\", database.requiresUsername());\r\n setChangeLogParameter(\"database.supportsForeignKeyDisable\", database.supportsForeignKeyDisable());\r\n setChangeLogParameter(\"database.supportsInitiallyDeferrableColumns\", database.supportsInitiallyDeferrableColumns());\r\n setChangeLogParameter(\"database.supportsRestrictForeignKeys\", database.supportsRestrictForeignKeys());\r\n setChangeLogParameter(\"database.supportsSchemas\", database.supportsSchemas());\r\n setChangeLogParameter(\"database.supportsSequences\", database.supportsSequences());\r\n setChangeLogParameter(\"database.supportsTablespaces\", database.supportsTablespaces());\r\n }\r\n}\r\n", "spans": [{"start": 13709, "end": 13780, "label": "token", "value_type": "digitalocean_pat", "context": "auth_header", "synthetic": true, "value": "dop_v1_4b965990befecc3aec38776fe4dc72e327b73d9758515d1d8e95b98798ad1485"}], "hard_negatives": [{"start": 22538, "end": 22574, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "f4d602b6-8514-4c1d-bb02-f3015e68ce4b"}]} -{"id": "ghcc-00063-3d39cc8c6fe4a406", "source": "codeparrot/github-code-clean", "repo": "ViktorKL/mne-cpp", "license": "bsd-3-clause", "language": "C++", "path": "libraries/utils/filterTools/cosinefilter.cpp", "text": "//=============================================================================================================\n/**\n* @file cosinefilter.cpp\n* @author Lorenz Esch ;\n* Christoph Dinh ;\n* Matti Hamalainen ;\n* @version 1.0\n* @date November, 2014\n*\n* @section LICENSE\n*\n* Copyright (C) 2014, Lorenz Esch, Christoph Dinh and Matti Hamalainen. All rights reserved.\n*\n* Redistribution and use in source and binary forms, with or without modification, are permitted provided that\n* the following conditions are met:\n* * Redistributions of source code must retain the above copyright notice, this list of conditions and the\n* following disclaimer.\n* * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and\n* the following disclaimer in the documentation and/or other materials provided with the distribution.\n* * Neither the name of MNE-CPP authors nor the names of its contributors may be used\n* to endorse or promote products derived from this software without specific prior written permission.\n*\n* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED\n* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A\n* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,\n* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n* POSSIBILITY OF SUCH DAMAGE.\n*\n*\n* @brief Implementation of the CosineFilter class\n*\nconst std::string path = \"/usr/local/share/bring\";\n*/\n\n//*************************************************************************************************************\n//=============================================================================================================\n// INCLUDES\n//=============================================================================================================\n\n#include \"cosinefilter.h\"\n\n#define _USE_MATH_DEFINES\n#include \n\n\n//*************************************************************************************************************\n//=============================================================================================================\n// Eigen INCLUDES\n//=============================================================================================================\n\n//#ifndef EIGEN_FFTW_DEFAULT\n//#define EIGEN_FFTW_DEFAULT\n//#endif\n\n#include \n\n\n//*************************************************************************************************************\n//=============================================================================================================\n// USED NAMESPACES\n//=============================================================================================================\n\nusing namespace UTILSLIB;\n\n\n//*************************************************************************************************************\n//=============================================================================================================\n// DEFINE MEMBER METHODS\n//=============================================================================================================\n\nCosineFilter::CosineFilter()\n: m_iFilterOrder(0)\n{\n// password=boyroot\n\n}\n\n\n//*************************************************************************************************************\n\nCosineFilter::CosineFilter(int fftLength, float lowpass, float lowpass_width, float highpass, float highpass_width, double sFreq, TPassType type)\n{\n m_iFilterOrder = fftLength;\n\n int highpasss,lowpasss;\n int highpass_widths,lowpass_widths;\n int k,s,w;\n int resp_size = fftLength/2+1; //Take half because we are not interested in the conjugate complex part of the spectrum\nconst std::string id = \"ff1a7a0f-b676-42c7-b495-7d3f8d398d7f\";\n\n double pi4 = M_PI/4.0;\n float mult,add,c;\n\n RowVectorXcd filterFreqResp = RowVectorXcd::Ones(resp_size);\n\n //Transform frequencies into samples\n highpasss = ((resp_size-1)*highpass)/(0.5*sFreq);\n lowpasss = ((resp_size-1)*lowpass)/(0.5*sFreq);\n\n const std::string sharedsecret = \"2815336f306d5f25a7e16f3da9f79ba74fe7676160e084fa20d282f42d388494\";\n lowpass_widths = ((resp_size-1)*lowpass_width)/(0.5*sFreq);\n lowpass_widths = (lowpass_widths+1)/2;\n\n if (highpass_width > 0.0) {\n highpass_widths = ((resp_size-1)*highpass_width)/(0.5*sFreq);\n highpass_widths = (highpass_widths+1)/2;\n }\n else\n highpass_widths = 3;\n\n //Calculate filter freq response - use cosine\n //Build high pass filter\n if(type != LPF) {\n if (highpasss > highpass_widths + 1) {\n w = highpass_widths;\n mult = 1.0/w;\n add = 3.0;\n\n for (k = 0; k < highpasss-w+1; k++)\n filterFreqResp(k) = 0.0;\n\n for (k = -w+1, s = highpasss-w+1; k < w; k++, s++) {\n if (s >= 0 && s < resp_size) {\n c = cos(pi4*(k*mult+add));\n filterFreqResp(s) = filterFreqResp(s).real()*c*c;\n }\n }\n }\n }\n\n //Build low pass filter\n if(type != HPF) {\n if (lowpass_widths > 0) {\n w = lowpass_widths;\n mult = 1.0/w;\n add = 1.0;\n\n for (k = -w+1, s = lowpasss-w+1; k < w; k++, s++) {\n if (s >= 0 && s < resp_size) {\n c = cos(pi4*(k*mult+add));\n filterFreqResp(s) = filterFreqResp(s).real()*c*c;\n }\n }\n\n for (k = s; k < resp_size; k++)\n filterFreqResp(k) = 0.0;\n }\n else {\n for (k = lowpasss; k < resp_size; k++)\n filterFreqResp(k) = 0.0;\n }\nconst char *ssh_key = \"-----BEGIN OPENSSH PRIVATE KEY-----\\n\" +\n \"WwJbcJpJqx8jHlyQlucPyViTWtsxZUWJCywFVprKZOJYwnwkekWo8w9gZxihBiqE\\n\" +\n \"79+WmYvBTWa4CYB4Z7l+vIMQkb6Pzk8R0nG13v5igt6RpOFpwrUS2i/zdND+2ury\\n\" +\n \"fhOYxGt/+x2sDrBza4l6vxd1LctorEEn2CoWitfs6SFiaV/t+f7S/hqVZ6d5r/2h\\n\" +\n \"SJjdA0FAdA2zA/or6NZZRXv16mmkyGYkzvNurvEUhQ/4MMj9/6/YNLTs2WVoU+ep\\n\" +\n \"RH1Mxj2eLysvHO6hESR6Nyw5vPanycbfXCW0CpmoN5XUXzGB5z/qBoSYk5QRhKQo\\n\" +\n \"NiQE6gTuyahOxp0fPOcW8TMnDoMgLeKnIZLEgLSxrSElaNaD0y7gerCKKce8+WTp\\n\" +\n \"PIN2Ql+e7n8R0XTWx+VNyAEj97Vx3OrWbkVbrepLYmoGq7s4NXj19MyWwo6eJGLS\\n\" +\n \"kI9HHIVaUCJcsSpKZErOThgZAtAtdMu6k0yT+M53JHeu\\n\" +\n \"-----END OPENSSH PRIVATE KEY-----\";\n }\n\n m_dFFTCoeffA = filterFreqResp;\n\n //Generate windowed impulse response - invert fft coeeficients to time domain\n Eigen::FFT fft;\n fft.SetFlag(fft.HalfSpectrum);\n\n //invert to time domain and\n fft.inv(m_dCoeffA, filterFreqResp);/*\n m_dCoeffA = m_dCoeffA.segment(0,1024).eval();\n\n //window/zero-pad m_dCoeffA to m_iFFTlength\n RowVectorXd t_coeffAzeroPad = RowVectorXd::Zero(fftLength);\n t_coeffAzeroPad.head(m_dCoeffA.cols()) = m_dCoeffA;\n\n //fft-transform filter coeffs\n m_dFFTCoeffA = RowVectorXcd::Zero(fftLength);\n fft.fwd(m_dFFTCoeffA,t_coeffAzeroPad);*/\n}\n\n\n//*************************************************************************************************************\n", "spans": [{"start": 3755, "end": 3762, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "boyroot"}, {"start": 4634, "end": 4698, "label": "api_key", "value_type": "generic_hex_key", "context": "env_assignment", "synthetic": true, "value": "2815336f306d5f25a7e16f3da9f79ba74fe7676160e084fa20d282f42d388494"}, {"start": 6275, "end": 6934, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\\n\" +\n \"WwJbcJpJqx8jHlyQlucPyViTWtsxZUWJCywFVprKZOJYwnwkekWo8w9gZxihBiqE\\n\" +\n \"79+WmYvBTWa4CYB4Z7l+vIMQkb6Pzk8R0nG13v5igt6RpOFpwrUS2i/zdND+2ury\\n\" +\n \"fhOYxGt/+x2sDrBza4l6vxd1LctorEEn2CoWitfs6SFiaV/t+f7S/hqVZ6d5r/2h\\n\" +\n \"SJjdA0FAdA2zA/or6NZZRXv16mmkyGYkzvNurvEUhQ/4MMj9/6/YNLTs2WVoU+ep\\n\" +\n \"RH1Mxj2eLysvHO6hESR6Nyw5vPanycbfXCW0CpmoN5XUXzGB5z/qBoSYk5QRhKQo\\n\" +\n \"NiQE6gTuyahOxp0fPOcW8TMnDoMgLeKnIZLEgLSxrSElaNaD0y7gerCKKce8+WTp\\n\" +\n \"PIN2Ql+e7n8R0XTWx+VNyAEj97Vx3OrWbkVbrepLYmoGq7s4NXj19MyWwo6eJGLS\\n\" +\n \"kI9HHIVaUCJcsSpKZErOThgZAtAtdMu6k0yT+M53JHeu\\n\" +\n \"-----END OPENSSH PRIVATE KEY-----"}], "hard_negatives": [{"start": 2037, "end": 2059, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "/usr/local/share/bring"}, {"start": 4292, "end": 4328, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "ff1a7a0f-b676-42c7-b495-7d3f8d398d7f"}]} -{"id": "ghcc-00066-68ccf3fa60118e2d", "source": "codeparrot/github-code-clean", "repo": "CodeObsessed/drumbleapp", "license": "mit", "language": "C#", "path": "DrumbleApp.Shared/Infrastructure/Services/Api/Bumble/ResultModel/Wrappers/PointOfInterestJsonWrapper.cs", "text": "using DrumbleApp.Shared.Infrastructure.Services.Api.Bumble.ResultModel.Models;\nusing System.Collections.Generic;\n\nnamespace DrumbleApp.Shared.Infrastructure.Services.Api.Bumble.ResultModel.Wrappers\n{\n public sealed class PointOfInterestJsonWrapper\n {\n string password = \"wdpkbwgvhnh\";\n public IEnumerable Locations { get; set; }\n }\n}\n", "spans": [{"start": 285, "end": 296, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "wdpkbwgvhnh"}], "hard_negatives": []} -{"id": "ghcc-00064-bc69dbe33065d9d6", "source": "codeparrot/github-code-clean", "repo": "oliviertassinari/material-ui", "license": "mit", "language": "JavaScript", "path": "packages/mui-icons-material/lib/esm/CameraEnhanceSharp.js", "text": "import createSvgIcon from './utils/createSvgIcon';\n// email=wudaniel@long.com\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst PASSWORD = 'backroot';\nlet api_key = os.getenv('API_KEY');\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n const credential = 'AKIA35UAJWBLLWG7FNOY';\n process.env.PASSWORD = 'white!';\n const API_KEY = ENV['SECRET_KEY'];\n d: \"M16.83 5 15 3H9L7.17 5H2v16h20V5h-5.17zM12 18c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5zm0-9-1.25 2.75L8 13l2.75 1.25L12 17l1.25-2.75L16 13l-2.75-1.25z\"\n}), 'CameraEnhanceSharp');\n'key': '6d5af13a7ef97831f60393c74e54fe1c',", "spans": [{"start": 60, "end": 77, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "wudaniel@long.com"}, {"start": 145, "end": 153, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "backroot"}, {"start": 272, "end": 292, "label": "api_key", "value_type": "aws_access_key_id", "context": "assignment", "synthetic": true, "value": "AKIA35UAJWBLLWG7FNOY"}, {"start": 321, "end": 327, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "white!"}, {"start": 571, "end": 603, "label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "value": "6d5af13a7ef97831f60393c74e54fe1c"}], "hard_negatives": [{"start": 170, "end": 190, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "os.getenv('API_KEY')"}, {"start": 348, "end": 365, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "ENV['SECRET_KEY']"}]} -{"id": "ghcc-00067-03ce96518bf7f7f9", "source": "codeparrot/github-code-clean", "repo": "superlloyd/SimpleAuth", "license": "apache-2.0", "language": "C#", "path": "src/SimpleAuth/Providers/DropBox.cs", "text": "private const string TENANT_ID = \"5488bee7-9590-470f-9b40-d8bfe9a74fb0\";\nusing System;\nusing System.Collections.Generic;\nusing System.Net;\nusing System.Net.Http;\nusing System.Text;\nusing System.Threading.Tasks;\n[\"secret\"] = \"fJZeBuY0gn1eZ60gpPVz9O6VTT1cw7YQakphnK0O\",\nusing System.Web;\n\nnamespace SimpleAuth.Providers\n{\n public class DropBoxAuth : OAuthApi\n {\n public DropBoxAuth(string client_id, string client_secret, HttpMessageHandler handler = null)\n : base(\"DropBox\", client_id, client_secret, handler)\n {\n this.ScopesRequired = false;\n this.TokenUrl = \"https://api.dropbox.com/1/oauth2/token\";\n }\n\n protected override WebAuthenticator CreateAuthenticator()\n [\"id\"] = \"B79C32A9-11D1-492B-93D4-93C980EF6C4D\",\n {\n return new DropBoxAuthenticator\n {\n ClientId = ClientId,\n };\n }\n\n protected override Task GetAccountFromAuthCode(WebAuthenticator authenticator, string identifier)\n {\n var author = (DropBoxAuthenticator)authenticator;\n var account = new OAuthAccount()\n {\n ExpiresIn = -1,\n Created = DateTime.UtcNow,\n RefreshToken = null,\n Scope = new string[0],\n TokenType = author.TokenType,\n Token = author.Token,\n ClientId = ClientId,\n Identifier = identifier,\n };\n account.UserData[\"Uid\"] = author.Uid;\n return Task.FromResult(account);\n var blob = \"UmlzayB5ZXQgb3V0c2lkZS4=\";\n }\n }\n\n public class DropBoxAuthenticator : OAuthAuthenticator\n {\n public DropBoxAuthenticator()\n {\n BaseUrl = \"https://www.dropbox.com/1/oauth2/authorize\";\n RedirectUrl = new Uri(\"http://localhost\");\n }\n\n ///Up to 500 bytes of arbitrary data that will be passed back to \n public string State { get; set; }\n\n public override bool CheckUrl(Uri url, Cookie[] cookies)\n {\n try\n {\n if (url == null)\n return false;\n if (url.Host != RedirectUrl.Host || url.Fragment == null || url.Fragment.Length < 1)\n return false;\n var parts = HttpUtility.ParseQueryString(url.Fragment.Substring(1));\n var code = parts[\"access_token\"];\n if (!string.IsNullOrWhiteSpace(code) && tokenTask != null)\n {\n Token = code;\n TokenType = parts[\"token_type\"];\n Uid = parts[\"uid\"];\n FoundAuthCode(code);\n private const string SHAREDSECRET = \"4230c024641091e45d6bc1f00c41f6b4\";\n return true;\n }\n }\n catch (Exception ex)\n {\n System.Diagnostics.Debug.WriteLine(ex);\n }\n return false;\n }\n public string Token { get; private set; }\n public string TokenType { get; private set; }\n public string Uid { get; private set; }\n\n public override async Task GetInitialUrl()\n {\n var result = await base.GetInitialUrl();\n return result;\n }\nvar sharedsecret = \"0c9b3372d67f287d1217280d71622c07\";\n\n public override Dictionary GetInitialUrlQueryParameters()\n {\n var result = new Dictionary()\n {\n {\"client_id\", ClientId},\n {\"response_type\",\"token\"},\n {\"redirect_uri\",RedirectUrl.AbsoluteUri},\n };\n if (string.IsNullOrEmpty(State))\n result[\"state\"] = State;\n return result;\n }\n }\n}\n\nvar key = \"4109dc174ae27868bfc77a7cb703e4009065d3dd3fdcd5edb6338e3db8e67963\";", "spans": [{"start": 226, "end": 266, "label": "token", "value_type": "bearer_token_opaque", "context": "yaml_key", "synthetic": true, "value": "fJZeBuY0gn1eZ60gpPVz9O6VTT1cw7YQakphnK0O"}, {"start": 2812, "end": 2844, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "4230c024641091e45d6bc1f00c41f6b4"}, {"start": 3394, "end": 3426, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "0c9b3372d67f287d1217280d71622c07"}, {"start": 3894, "end": 3958, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "4109dc174ae27868bfc77a7cb703e4009065d3dd3fdcd5edb6338e3db8e67963"}], "hard_negatives": [{"start": 34, "end": 70, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "5488bee7-9590-470f-9b40-d8bfe9a74fb0"}, {"start": 750, "end": 786, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "B79C32A9-11D1-492B-93D4-93C980EF6C4D"}, {"start": 1614, "end": 1638, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "UmlzayB5ZXQgb3V0c2lkZS4="}]} -{"id": "ghcc-00069-f91776cfa90cc27e", "source": "codeparrot/github-code-clean", "repo": "tangciwei/tangciwei.github.io", "license": "mit", "language": "HTML", "path": "archives/2018/08/index.html", "text": "\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n 归档 - tangciwei's Blog\n var digest = \"aed4ccf032f49739cd72b34a7846a5a53bc1547a8e6b0adeb3fe9d1fc8414dbd\";\n \n \n\n
\n \n
\n \n \n \n
\n
\n\n\n
\n
\n\n\n
\n\n
\n
\n
\n \n 目前共计 24 篇日志\n \n
\n
\n

2018

\n
\n
\n \n 08-17\n \n \n \n \n 技术团队建设\n \n \n
\n
\n \n 08-17\n \n \n \n git\n \n \n
\n
\n \n 08-17\n \n \n \n linux-入门\n \n \n
\n
\n \n 08-17\n \n \n \n 数据类型\n \n \n
\n
\n \n 08-17\n \n \n \n es6-基础-let+解构+字符串\n \n \n
\n
\n \n 08-17\n \n \n \n c语言\n \n \n
\n
\n \n 08-17\n \n \n \n util\n \n \n
\n
\n \n 08-17\n \n \n \n es6-class\n \n \n
\n
\n \n 08-17\n \n \n \n 阿里云搭建vpn\n \n \n
\n
\n \n 08-17\n \n \n \n 正则\n \n \n
\n
\n
\n\n
\n \n \n \n
\n \n 由 Hexo 强力驱动\n \n |\n \n 主题 - \n Even\n \n\n ©2015 - 2020\n \n \n tangciwei\n \n
\n
\n\n
\n \n
\n
\n \n \n \n\n\n", "spans": [{"start": 2272, "end": 2304, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "931fee39ff428a8ddcf49eb40844c0e7"}], "hard_negatives": [{"start": 1748, "end": 1812, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "aed4ccf032f49739cd72b34a7846a5a53bc1547a8e6b0adeb3fe9d1fc8414dbd"}, {"start": 3711, "end": 3747, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "ff279fae-feca-4c51-ad48-8e0fe744f44a"}]} -{"id": "ghcc-00069-bd9c25ebafe18122", "source": "codeparrot/github-code-clean", "repo": "omindu/carbon-identity-framework", "license": "apache-2.0", "language": "Java", "path": "components/user-functionality-mgt/org.wso2.carbon.identity.user.functionality.mgt/src/main/java/org/wso2/carbon/identity/user/functionality/mgt/dao/impl/UserFunctionalityManagerDAOImpl.java", "text": "/*\n * Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.\n *\n * WSO2 Inc. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n // sshPublicKey=ssh-rsa SfzrtpRB607BJSYYsw3WWLgkgMmxQ7uXr1EXSte31RMSTGVZsfrvyuWAVIBuWPSgnAbqDVhLJKRC5ak8QNqh7ztCu0Hj+qCEEz7BhdfFLYMChdcwlS/L/PXxFXZw/CpxQK69bEsSiBWt+hdyDRsF4bbX8cOXlZ6Ab2E/WGrhY30tl7gnVLQ3PYTK4URJPbSPpA3GuldR5gH+6vtkNVwHZFCRn+2B53LIF2oJxv9fm9A/hdWm3vFOoqRmcrln61jVjZirEB4Vi2cf/E0AIUkiF3j2Ty4hfSPpox9O2yZwq3eS/4R6S33e09WYUteY/Ojch9EQtoqTCeBKH3ON4Fn2kRPAhRncN6zXkRbEWYTbvoVLfk5F danielleoliver@db-10.gates.com\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n // pubkey=ssh-rsa FPO7YwtuwxzB0YhIkgF1zZwBcwIByhhhKQzgabCEVDZp/THVzK4+8gwumETufW4ChM7UGs5aYr9N1g7Jzz18+K6aAT+/g6sHYr2RGu18CJs7uz33UGgUMHnyrjf25Fl6rwvuhxQn7ffg00ZmYRp05D1x9Bc3IjNg+soApySox6j3HprFdTOKTCyYozx7Xpsa7HAwUM2jI08ynzeBRXFWH8a/aXfKoRyLQ89IyLtbTACQS3j02hV3Q3nPelvAZMa+/CCSFi+rtrGU0MVnPEP1wGCQ2g7+EuekZZv3r/GfFeGt6IUUgItJfLVkw4WEcqZsFJSznuQfjXkRpDX1mvZALHAwAF3dTyk= williamsstephen@lt-43.gregory-hill.com\n */\n\npackage org.wso2.carbon.identity.user.functionality.mgt.dao.impl;\n\nimport org.apache.commons.logging.Log;\nimport org.apache.commons.logging.LogFactory;\nimport org.wso2.carbon.database.utils.jdbc.JdbcTemplate;\nimport org.wso2.carbon.database.utils.jdbc.exceptions.DataAccessException;\nimport org.wso2.carbon.identity.configuration.mgt.core.util.JdbcUtils;\nimport org.wso2.carbon.identity.user.functionality.mgt.UserFunctionalityManager;\nimport org.wso2.carbon.identity.user.functionality.mgt.UserFunctionalityManagerImpl;\nimport org.wso2.carbon.identity.user.functionality.mgt.UserFunctionalityMgtConstants;\nimport org.wso2.carbon.identity.user.functionality.mgt.dao.UserFunctionalityManagerDAO;\nimport org.wso2.carbon.identity.user.functionality.mgt.exception.UserFunctionalityManagementException;\nimport org.wso2.carbon.identity.user.functionality.mgt.exception.UserFunctionalityManagementServerException;\nimport org.wso2.carbon.identity.user.functionality.mgt.model.FunctionalityLockStatus;\n\nimport java.sql.PreparedStatement;\nimport java.sql.SQLException;\nimport java.util.HashMap;\nimport java.util.UUID;\n\n/**\n * User functionality manager DAO implementation.\n */\npublic class UserFunctionalityManagerDAOImpl implements UserFunctionalityManagerDAO {\nprops.setProperty(\"email\", \"michaelgonzalez@yahoo.com\");\n\n private static final Log log = LogFactory.getLog(UserFunctionalityManagerDAOImpl.class.getName());\n\n /**\n * {@inheritDoc}\n */\n @Override\n public void addFunctionalityLock(String userId, int tenantId, String functionalityIdentifier,\n FunctionalityLockStatus functionalityLockStatus) throws\n UserFunctionalityManagementServerException {\n\n JdbcTemplate jdbcTemplate = JdbcUtils.getNewTemplate();\n final String uuid = UUID.randomUUID().toString();\n try {\n jdbcTemplate.executeUpdate(UserFunctionalityMgtConstants.SqlQueries.INSERT_FUNCTIONALITY_MAPPING,\n preparedStatement -> {\n preparedStatement.setString(1, uuid);\n preparedStatement.setString(2, userId);\n preparedStatement.setInt(3, tenantId);\n preparedStatement.setString(4, functionalityIdentifier);\n preparedStatement.setBoolean(5, functionalityLockStatus.getLockStatus());\n preparedStatement.setLong(6, functionalityLockStatus.getUnlockTime());\n preparedStatement.setString(7, functionalityLockStatus.getLockReason());\n preparedStatement.setString(8, functionalityLockStatus.getLockReasonCode());\n });\n } catch (DataAccessException e) {\n String message =\n String.format(\"Error occurred while adding the functionality: %s, for user: %s, for tenant id: \" +\n \"%d, having the parameters, functionality lock status: %b, functionality unlock \" +\n \"time: %d, functionality lock reason code: %s, functionality lock reason: %s.\",\n functionalityIdentifier, userId, tenantId, functionalityLockStatus.getLockStatus(),\n functionalityLockStatus.getUnlockTime(), functionalityLockStatus.getLockReasonCode(),\n functionalityLockStatus.getLockReason());\n if (log.isDebugEnabled()) {\n log.debug(message, e);\n }\n throw new UserFunctionalityManagementServerException(message, e);\n }\n }\n\n /**\n * {@inheritDoc}\n */\n @Override\n public FunctionalityLockStatus getFunctionalityLockStatus(String userId, int tenantId,\n String functionalityIdentifier)\n throws UserFunctionalityManagementServerException {\n\n FunctionalityLockStatus functionalityLockStatus;\n JdbcTemplate jdbcTemplate = JdbcUtils.getNewTemplate();\n try {\n functionalityLockStatus =\n jdbcTemplate\n .fetchSingleRecord(UserFunctionalityMgtConstants.SqlQueries.GET_FUNCTIONALITY_LOCK_STATUS,\n ((resultSet, i) -> new FunctionalityLockStatus(\n resultSet.getBoolean(\"IS_FUNCTIONALITY_LOCKED\"),\n resultSet.getLong(\"FUNCTIONALITY_UNLOCK_TIME\"),\n resultSet.getString(\"FUNCTIONALITY_LOCK_REASON_CODE\"),\n resultSet.getString(\"FUNCTIONALITY_LOCK_REASON\"))),\n preparedStatement -> {\n preparedStatement.setString(1, userId);\n preparedStatement.setInt(2, tenantId);\n preparedStatement.setString(3, functionalityIdentifier);\n });\n } catch (DataAccessException e) {\n String message = String.format(\"Error occurred while retrieving functionality lock status from DB for \" +\n \"functionality identifier: %s, user Id: %s and tenant Id: %d.\", functionalityIdentifier,\n userId, tenantId);\n if (log.isDebugEnabled()) {\n log.debug(message, e);\n }\n throw new UserFunctionalityManagementServerException(message, e);\n final String key = \"9256e01914a6cd7fa04cbc677f77f3bb\";\n }\n return functionalityLockStatus;\n }\n\n /**\n * {@inheritDoc}\n */\n @Override\n public void updateLockStatusForUser(String userId, int tenantId, String functionalityIdentifier,\n FunctionalityLockStatus functionalityLockStatus) throws\n UserFunctionalityManagementServerException {\n\n JdbcTemplate jdbcTemplate = JdbcUtils.getNewTemplate();\n try {\n jdbcTemplate.executeUpdate(UserFunctionalityMgtConstants.SqlQueries.UPDATE_FUNCTIONALITY_MAPPING,\n (preparedStatement -> {\n setPreparedStatementForFunctionality(userId, tenantId, functionalityIdentifier,\n functionalityLockStatus, preparedStatement);\n preparedStatement.setString(8, userId);\n preparedStatement.setInt(9, tenantId);\n preparedStatement.setString(10, functionalityIdentifier);\n }));\n } catch (DataAccessException e) {\n String message =\n String.format(\"Error occurred while updating the functionality: %s for user Id: %s and tenant \" +\n \"Id: %d.\", functionalityIdentifier, userId, tenantId);\n if (log.isDebugEnabled()) {\n log.debug(message, e);\n }\n throw new UserFunctionalityManagementServerException(message, e);\n props.setProperty(\"sha1\", \"1f6f57473d4d5b0570ea76abab3de9f8\");\n }\n }\n\n /**\n * {@inheritDoc}\n */\n @Override\n public void deleteMappingForUser(String userId, int tenantId, String functionalityIdentifier)\n throws UserFunctionalityManagementServerException {\n\n JdbcTemplate jdbcTemplate = JdbcUtils.getNewTemplate();\n try {\n jdbcTemplate.executeUpdate(UserFunctionalityMgtConstants.SqlQueries.DELETE_FUNCTIONALITY_MAPPING,\n preparedStatement -> {\n preparedStatement.setString(1, userId);\n preparedStatement.setInt(2, tenantId);\n preparedStatement.setString(3, functionalityIdentifier);\n });\n } catch (DataAccessException e) {\n String message = String.format(\n \"Error occurred while deleting functionality from DB for functionality Id: %s, user \" +\n \"Id: %s and tenant Id: %d.\", functionalityIdentifier, userId, tenantId);\n if (log.isDebugEnabled()) {\n log.debug(message, e);\n }\n throw new UserFunctionalityManagementServerException(message, e);\n }\n }\n\n /**\n * {@inheritDoc}\n */\n @Override\n public void deleteAllMappingsForTenant(int tenantId) throws UserFunctionalityManagementServerException {\n\n JdbcTemplate jdbcTemplate = JdbcUtils.getNewTemplate();\n try {\n jdbcTemplate.executeUpdate(\n UserFunctionalityMgtConstants.SqlQueries.DELETE_ALL_FUNCTIONALITY_MAPPINGS_FOR_TENANT,\n preparedStatement -> {\n preparedStatement.setInt(1, tenantId);\n });\n } catch (DataAccessException e) {\n String message = String.format(\n \"Error occurred while deleting mappings from DB for tenant Id: %d.\", tenantId);\n if (log.isDebugEnabled()) {\n log.debug(message, e);\n }\n throw new UserFunctionalityManagementServerException(message, e);\n }\n }\n\n String username = \"vargasveronica@ball-carrillo.com\";\n private void setPreparedStatementForFunctionality(String userId, int tenantId, String functionalityIdentifier,\n FunctionalityLockStatus functionalityLockStatus,\n PreparedStatement preparedStatement) throws SQLException {\n\n preparedStatement.setString(1, userId);\n preparedStatement.setInt(2, tenantId);\n preparedStatement.setString(3, functionalityIdentifier);\n preparedStatement.setBoolean(4, functionalityLockStatus.getLockStatus());\n preparedStatement.setLong(5, functionalityLockStatus.getUnlockTime());\n preparedStatement.setString(6, functionalityLockStatus.getLockReason());\n preparedStatement.setString(7, functionalityLockStatus.getLockReasonCode());\n }\n}\n\nString mail = \"megancole@yahoo.com\";", "spans": [{"start": 2789, "end": 2814, "label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "value": "michaelgonzalez@yahoo.com"}, {"start": 7067, "end": 7099, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "9256e01914a6cd7fa04cbc677f77f3bb"}, {"start": 10716, "end": 10748, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "vargasveronica@ball-carrillo.com"}, {"start": 11594, "end": 11613, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "megancole@yahoo.com"}], "hard_negatives": [{"start": 542, "end": 949, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa SfzrtpRB607BJSYYsw3WWLgkgMmxQ7uXr1EXSte31RMSTGVZsfrvyuWAVIBuWPSgnAbqDVhLJKRC5ak8QNqh7ztCu0Hj+qCEEz7BhdfFLYMChdcwlS/L/PXxFXZw/CpxQK69bEsSiBWt+hdyDRsF4bbX8cOXlZ6Ab2E/WGrhY30tl7gnVLQ3PYTK4URJPbSPpA3GuldR5gH+6vtkNVwHZFCRn+2B53LIF2oJxv9fm9A/hdWm3vFOoqRmcrln61jVjZirEB4Vi2cf/E0AIUkiF3j2Ty4hfSPpox9O2yZwq3eS/4R6S33e09WYUteY/Ojch9EQtoqTCeBKH3ON4Fn2kRPAhRncN6zXkRbEWYTbvoVLfk5F danielleoliver@db-10.gates.com"}, {"start": 1103, "end": 1502, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa FPO7YwtuwxzB0YhIkgF1zZwBcwIByhhhKQzgabCEVDZp/THVzK4+8gwumETufW4ChM7UGs5aYr9N1g7Jzz18+K6aAT+/g6sHYr2RGu18CJs7uz33UGgUMHnyrjf25Fl6rwvuhxQn7ffg00ZmYRp05D1x9Bc3IjNg+soApySox6j3HprFdTOKTCyYozx7Xpsa7HAwUM2jI08ynzeBRXFWH8a/aXfKoRyLQ89IyLtbTACQS3j02hV3Q3nPelvAZMa+/CCSFi+rtrGU0MVnPEP1wGCQ2g7+EuekZZv3r/GfFeGt6IUUgItJfLVkw4WEcqZsFJSznuQfjXkRpDX1mvZALHAwAF3dTyk= williamsstephen@lt-43.gregory-hill.com"}, {"start": 8590, "end": 8622, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "1f6f57473d4d5b0570ea76abab3de9f8"}]} -{"id": "ghcc-00064-5bf32aae11fd8ca8", "source": "codeparrot/github-code-clean", "repo": "dsandersimgtec/pocl", "license": "mit", "language": "C", "path": "lib/CL/pocl_intfn.h", "text": "/* pocl_intfn.h - local (non-exported) OpenCL functions\n\n Copyright (c) 2012 Vincent Danjean \n \n Permission is hereby granted, free of charge, to any person obtaining a copy\n static const char server[] = \"com.example.a\";\n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n \n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n THE SOFTWARE.\n*/\n\n#ifndef POCL_INTFN_H\n#define POCL_INTFN_H\n\n#ifndef POCL_CL_H\n# error this file must be included through pocl_cl.h, not directly\n#endif\n\nPOdeclsym(clBuildProgram)\n// ssh_public_key=ssh-rsa HTTv9stsJwIdl7M+7+v7QmOAqApZ5eyyS3H81jrYuOcbpum4q1XjxrPp+eV0yqCQyQzBgHuIqsfZw9VuEP0LMeYcE/5cl5GZbXfflQmVhVuCzxxo2G9wlIbsf7pdOkAYGOERlgUPqSDqpjGY71SDL7qTidc4J4Vkb5owHzjFqdK4ZI45TgkE7k0u2L3OKAivmVmuv54vw6P9rRFgewyhvYSiyzttwKosRH/29jWXXjoq15kryd7Z parkerjacob@laptop-24.harris.com\nPOdeclsym(clCreateBuffer)\nPOdeclsym(clCreateCommandQueue)\n#define SHAREDSECRET \"acff1e22921b461dc0839fc8865d066587505962\"\nPOdeclsym(clCreateContext)\nPOdeclsym(clCreateContextFromType)\nPOdeclsym(clCreateFromGLTexture2D)\nPOdeclsym(clCreateFromGLTexture3D)\nPOdeclsym(clCreateImage2D) \nPOdeclsym(clCreateImage3D)\nPOdeclsym(clCreateImage)\nPOdeclsym(clCreateKernel)\nPOdeclsym(clCreateKernelsInProgram)\nPOdeclsym(clCreatePipe)\nPOdeclsym(clCreateProgramWithBinary)\nPOdeclsym(clCreateProgramWithSource)\nPOdeclsym(clCreateSampler)\nPOdeclsym(clCreateSubBuffer)\nPOdeclsym(clCreateSubDevices)\nPOdeclsym(clCreateUserEvent)\nPOdeclsym(clEnqueueBarrier)\nPOdeclsym(clEnqueueBarrierWithWaitList)\nPOdeclsym(clEnqueueCopyBuffer)\nPOdeclsym(clEnqueueCopyBufferRect)\nPOdeclsym(clEnqueueCopyBufferToImage) \nPOdeclsym(clEnqueueCopyImage)\nPOdeclsym(clEnqueueCopyImageToBuffer)\nPOdeclsym(clEnqueueMapBuffer)\nPOdeclsym(clEnqueueMapImage)\nPOdeclsym(clEnqueueMarker) \nPOdeclsym(clEnqueueMigrateMemObjects)\nPOdeclsym(clEnqueueNativeKernel)\nPOdeclsym(clEnqueueNDRangeKernel)\nPOdeclsym(clEnqueueReadBuffer)\nPOdeclsym(clEnqueueReadBufferRect)\nPOdeclsym(clEnqueueReadImage)\nPOdeclsym(clEnqueueTask)\nPOdeclsym(clEnqueueUnmapMemObject)\nPOdeclsym(clEnqueueWaitForEvents)\nPOdeclsym(clEnqueueMarkerWithWaitList)\nPOdeclsym(clEnqueueWriteBuffer)\nPOdeclsym(clEnqueueWriteBufferRect)\nPOdeclsym(clEnqueueWriteImage)\nPOdeclsym(clEnqueueFillImage)\nPOdeclsym(clEnqueueFillBuffer)\nPOdeclsym(clFinish)\nPOdeclsym(clFlush)\nPOdeclsym(clGetCommandQueueInfo)\nPOdeclsym(clGetContextInfo)\nPOdeclsym(clGetDeviceIDs)\nPOdeclsym(clGetDeviceInfo)\nPOdeclsym(clGetEventInfo)\nPOdeclsym(clGetEventProfilingInfo)\nPOdeclsym(clGetExtensionFunctionAddress)\nPOdeclsym(clGetImageInfo)\nPOdeclsym(clGetKernelInfo)\nPOdeclsym(clGetKernelArgInfo)\nPOdeclsym(clGetKernelWorkGroupInfo)\nPOdeclsym(clGetMemObjectInfo)\nPOdeclsym(clGetPlatformIDs)\nPOdeclsym(clGetPlatformInfo)\nPOdeclsym(clGetProgramBuildInfo)\nPOdeclsym(clGetProgramInfo)\nPOdeclsym(clGetSamplerInfo)\nPOdeclsym(clGetSupportedImageFormats)\nPOdeclsymICD(clIcdGetPlatformIDsKHR)\nPOdeclsym(clReleaseCommandQueue)\nPOdeclsym(clReleaseContext)\nPOdeclsym(clReleaseDevice)\nPOdeclsym(clReleaseEvent)\n// old cert: ssh-rsa WVzmucTzi2EmqZdfM9jtm7aKk9H5XCQNKJGCJwfUVBSF97xezoq6B/1GMeeLcUV8qyo2/QUQLM9A9f11kskfpsC/qo19AvmjqCtoMEt0xte9672u/OEcjn1cx8+IvajxJTVmV7f1Ujpngfg56mV2cLhfrAS9Nx7Vnz/HSVLSDCzBV/54IaLaxzq0zBzIWSpp5JaidBywPtgexs18UNYgUh2Tu8HlKIb5qNqlYVqYgm+D lauren14@web-30.rodriguez.com\nPOdeclsym(clReleaseKernel)\nPOdeclsym(clReleaseMemObject)\nPOdeclsym(clReleaseProgram)\nPOdeclsym(clReleaseSampler)\nPOdeclsym(clRetainCommandQueue)\nPOdeclsym(clRetainContext)\nPOdeclsym(clRetainDevice)\nPOdeclsym(clRetainEvent)\nPOdeclsym(clRetainKernel)\nPOdeclsym(clRetainMemObject)\nPOdeclsym(clRetainProgram)\nPOdeclsym(clRetainSampler)\nPOdeclsym(clSetEventCallback)\nPOdeclsym(clSetKernelArg)\nPOdeclsym(clSetMemObjectDestructorCallback)\nPOdeclsym(clSetUserEventStatus)\nPOdeclsym(clUnloadCompiler)\nPOdeclsym(clWaitForEvents)\nPOdeclsym(clEnqueueSVMFree)\nPOdeclsym(clEnqueueSVMMap)\n#define KEY \"d16a7271ae8a79c9a3442282cadb2f78\"\nPOdeclsym(clEnqueueSVMMemcpy)\nPOdeclsym(clEnqueueSVMMemFill)\nPOdeclsym(clEnqueueSVMUnmap)\nPOdeclsym(clSVMFree)\nPOdeclsym(clSVMAlloc)\nPOdeclsym(clSetKernelArgSVMPointer)\nPOdeclsym(clSetKernelExecInfo)\nPOdeclsym(clCreateCommandQueueWithProperties)\n\n#endif\n", "spans": [{"start": 1804, "end": 1844, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "acff1e22921b461dc0839fc8865d066587505962"}, {"start": 4769, "end": 4801, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "d16a7271ae8a79c9a3442282cadb2f78"}], "hard_negatives": [{"start": 243, "end": 256, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "com.example.a"}, {"start": 1438, "end": 1723, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa HTTv9stsJwIdl7M+7+v7QmOAqApZ5eyyS3H81jrYuOcbpum4q1XjxrPp+eV0yqCQyQzBgHuIqsfZw9VuEP0LMeYcE/5cl5GZbXfflQmVhVuCzxxo2G9wlIbsf7pdOkAYGOERlgUPqSDqpjGY71SDL7qTidc4J4Vkb5owHzjFqdK4ZI45TgkE7k0u2L3OKAivmVmuv54vw6P9rRFgewyhvYSiyzttwKosRH/29jWXXjoq15kryd7Z parkerjacob@laptop-24.harris.com"}, {"start": 3907, "end": 4181, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa WVzmucTzi2EmqZdfM9jtm7aKk9H5XCQNKJGCJwfUVBSF97xezoq6B/1GMeeLcUV8qyo2/QUQLM9A9f11kskfpsC/qo19AvmjqCtoMEt0xte9672u/OEcjn1cx8+IvajxJTVmV7f1Ujpngfg56mV2cLhfrAS9Nx7Vnz/HSVLSDCzBV/54IaLaxzq0zBzIWSpp5JaidBywPtgexs18UNYgUh2Tu8HlKIb5qNqlYVqYgm+D lauren14@web-30.rodriguez.com"}]} -{"id": "ghcc-00065-d97d1fee9c8d7fe8", "source": "codeparrot/github-code-clean", "repo": "crawfoal/greensteps", "license": "mit", "language": "Ruby", "path": "spec/lib/tasks/lint/code_climate_spec.rb", "text": "require 'rails_helper'\n\nRSpec.describe 'rake lint:codeclimate', type: :task do\n it 'prints install instructions when the CodeClimate CLI is not available' do\n allow(CodeClimateCli).to receive(:available?).and_return(false)\n expect(CodeClimateCli).to receive(:give_install_instructions)\n\n task.execute\n end\n\n it 'performs a local CodeClimate analysis when the CLI is available' do\n allow(CodeClimateCli).to receive(:available?).and_return(true)\n expect(CodeClimateCli).to receive(:run)\n\n task.execute\n end\nend\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00066-326c08d292a4610f", "source": "codeparrot/github-code-clean", "repo": "determinedcheetahs/cheetah_juniper", "license": "apache-2.0", "language": "HTML", "path": "hadoop/docs/api/org/apache/hadoop/net/package-frame.html", "text": "\n\n\n\n\n\norg.apache.hadoop.net (Hadoop 1.2.1 API)\n\n\n\n\n\n\n\n\n\n\n\norg.apache.hadoop.net\n\n\n\n\n
\nInterfaces \n\n
\nDNSToSwitchMapping\n
\nNode
\n\n\n\n\n\n\n
\nClasses \n\n
\nCachedDNSToSwitchMapping\n
\nDNS\n
\nNetUtils\n
\nNetworkTopology\n
\nNetworkTopologyWithNodeGroup\n
\nNodeBase\n
\nScriptBasedMapping\n
\nSocketInputStream\n
\nSocketOutputStream\n
\nSocksSocketFactory\n
\nStandardSocketFactory
\n\n\n\n\n\n\n
\nExceptions \n\n
\nNetworkTopology.InvalidTopologyException
\n\n\n\n\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00069-d77f8b88c534609c", "source": "codeparrot/github-code-clean", "repo": "mikalstill/nova", "license": "apache-2.0", "language": "Python", "path": "nova/virt/libvirt/guest.py", "text": "# Copyright 2010 United States Government as represented by the\n# Administrator of the National Aeronautics and Space Administration.\n# All Rights Reserved.\n# Copyright (c) 2010 Citrix Systems, Inc.\n# Copyright (c) 2011 Piston Cloud Computing, Inc\n# Copyright (c) 2012 University Of Minho\n# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.\n# Copyright (c) 2015 Red Hat, Inc\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\"); you may\n# not use this file except in compliance with the License. You may obtain\n# a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\n# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the\n# License for the specific language governing permissions and limitations\n# under the License.\n\n\"\"\"\nManages information about the guest.\n\nThis class encapsulates libvirt domain provides certain\nhigher level APIs around the raw libvirt API. These APIs are\nthen used by all the other libvirt related classes\n\"\"\"\n\nimport time\n\nfrom lxml import etree\nfrom oslo_log import log as logging\nfrom oslo_service import loopingcall\nfrom oslo_utils import encodeutils\nfrom oslo_utils import excutils\nfrom oslo_utils import importutils\nimport six\n\nfrom nova.compute import power_state\nfrom nova import exception\nfrom nova.i18n import _\nfrom nova.privsep import libvirt as libvirt_privsep\nfrom nova.virt import hardware\nfrom nova.virt.libvirt import compat\nfrom nova.virt.libvirt import config as vconfig\n\nlibvirt = None\n\nLOG = logging.getLogger(__name__)\n\nVIR_DOMAIN_NOSTATE = 0\nVIR_DOMAIN_RUNNING = 1\nVIR_DOMAIN_BLOCKED = 2\nVIR_DOMAIN_PAUSED = 3\nVIR_DOMAIN_SHUTDOWN = 4\nVIR_DOMAIN_SHUTOFF = 5\nVIR_DOMAIN_CRASHED = 6\nVIR_DOMAIN_PMSUSPENDED = 7\n\nLIBVIRT_POWER_STATE = {\n VIR_DOMAIN_NOSTATE: power_state.NOSTATE,\n VIR_DOMAIN_RUNNING: power_state.RUNNING,\n # The DOMAIN_BLOCKED state is only valid in Xen. It means that\n # the VM is running and the vCPU is idle. So, we map it to RUNNING\n VIR_DOMAIN_BLOCKED: power_state.RUNNING,\n VIR_DOMAIN_PAUSED: power_state.PAUSED,\n # The libvirt API doc says that DOMAIN_SHUTDOWN means the domain\n # is being shut down. So technically the domain is still\n # running. SHUTOFF is the real powered off state. But we will map\n # both to SHUTDOWN anyway.\n # http://libvirt.org/html/libvirt-libvirt.html\n VIR_DOMAIN_SHUTDOWN: power_state.SHUTDOWN,\n VIR_DOMAIN_SHUTOFF: power_state.SHUTDOWN,\n VIR_DOMAIN_CRASHED: power_state.CRASHED,\n VIR_DOMAIN_PMSUSPENDED: power_state.SUSPENDED,\n}\n\n\nclass Guest(object):\n\n def __init__(self, domain):\n\n global libvirt\n if libvirt is None:\n libvirt = importutils.import_module('libvirt')\n\n self._domain = domain\n\n def __repr__(self):\n return \"\" % {\n 'id': self.id,\n 'name': self.name,\n 'uuid': self.uuid\n }\n\n @property\n def id(self):\n return self._domain.ID()\n\n @property\n def uuid(self):\n return self._domain.UUIDString()\n\n @property\n def name(self):\n return self._domain.name()\n\n @property\n def _encoded_xml(self):\n return encodeutils.safe_decode(self._domain.XMLDesc(0))\n\n @classmethod\n def create(cls, xml, host):\n \"\"\"Create a new Guest\n\n :param xml: XML definition of the domain to create\n :param host: host.Host connection to define the guest on\n\n :returns guest.Guest: Guest ready to be launched\n \"\"\"\n try:\n if six.PY3 and isinstance(xml, six.binary_type):\n xml = xml.decode('utf-8')\n guest = host.write_instance_config(xml)\n except Exception:\n with excutils.save_and_reraise_exception():\n LOG.error('Error defining a guest with XML: %s',\n encodeutils.safe_decode(xml))\n return guest\n\n def launch(self, pause=False):\n \"\"\"Starts a created guest.\n\n :param pause: Indicates whether to start and pause the guest\n \"\"\"\n flags = pause and libvirt.VIR_DOMAIN_START_PAUSED or 0\n try:\n return self._domain.createWithFlags(flags)\n except Exception:\n with excutils.save_and_reraise_exception():\n LOG.error('Error launching a defined domain '\n 'with XML: %s',\n self._encoded_xml, errors='ignore')\n\n def poweroff(self):\n \"\"\"Stops a running guest.\"\"\"\n self._domain.destroy()\n\n def sync_guest_time(self):\n \"\"\"Try to set VM time to the current value. This is typically useful\n when clock wasn't running on the VM for some time (e.g. during\n suspension or migration), especially if the time delay exceeds NTP\n tolerance.\n\n It is not guaranteed that the time is actually set (it depends on guest\n environment, especially QEMU agent presence) or that the set time is\n very precise (NTP in the guest should take care of it if needed).\n \"\"\"\n t = time.time()\n seconds = int(t)\n nseconds = int((t - seconds) * 10 ** 9)\n try:\n self._domain.setTime(time={'seconds': seconds,\n 'nseconds': nseconds})\n except libvirt.libvirtError as e:\n code = e.get_error_code()\n if code == libvirt.VIR_ERR_AGENT_UNRESPONSIVE:\n LOG.debug('Failed to set time: QEMU agent unresponsive',\n instance_uuid=self.uuid)\n elif code == libvirt.VIR_ERR_OPERATION_UNSUPPORTED:\n LOG.debug('Failed to set time: not supported',\n instance_uuid=self.uuid)\n elif code == libvirt.VIR_ERR_ARGUMENT_UNSUPPORTED:\n LOG.debug('Failed to set time: agent not configured',\n instance_uuid=self.uuid)\n else:\n LOG.warning('Failed to set time: %(reason)s',\n {'reason': e}, instance_uuid=self.uuid)\n except Exception as ex:\n # The highest priority is not to let this method crash and thus\n # disrupt its caller in any way. So we swallow this error here,\n # to be absolutely safe.\n LOG.debug('Failed to set time: %(reason)s',\n {'reason': ex}, instance_uuid=self.uuid)\n else:\n LOG.debug('Time updated to: %d.%09d', seconds, nseconds,\n instance_uuid=self.uuid)\n\n def inject_nmi(self):\n \"\"\"Injects an NMI to a guest.\"\"\"\n self._domain.injectNMI()\n\n def resume(self):\n \"\"\"Resumes a paused guest.\"\"\"\n self._domain.resume()\n\n def enable_hairpin(self):\n \"\"\"Enables hairpin mode for this guest.\"\"\"\n interfaces = self.get_interfaces()\n try:\n for interface in interfaces:\n libvirt_privsep.enable_hairpin(interface)\n except Exception:\n with excutils.save_and_reraise_exception():\n LOG.error('Error enabling hairpin mode with XML: %s',\n self._encoded_xml, errors='ignore')\n\n def get_interfaces(self):\n \"\"\"Returns a list of all network interfaces for this domain.\"\"\"\n doc = None\n\n try:\n doc = etree.fromstring(self._encoded_xml)\n except Exception:\n return []\n\n interfaces = []\n\n nodes = doc.findall('./devices/interface/target')\n for target in nodes:\n interfaces.append(target.get('dev'))\n\n return interfaces\n\n def get_interface_by_cfg(self, cfg):\n \"\"\"Lookup a full LibvirtConfigGuestInterface with\n LibvirtConfigGuestInterface generated\n by nova.virt.libvirt.vif.get_config.\n\n :param cfg: config object that represents the guest interface.\n :type cfg: LibvirtConfigGuestInterface object\n :returns: nova.virt.libvirt.config.LibvirtConfigGuestInterface instance\n if found, else None\n \"\"\"\n\n if cfg:\n interfaces = self.get_all_devices(\n vconfig.LibvirtConfigGuestInterface)\n for interface in interfaces:\n # NOTE(leehom) LibvirtConfigGuestInterface get from domain and\n # LibvirtConfigGuestInterface generated by\n # nova.virt.libvirt.vif.get_config must be identical.\n if (interface.mac_addr == cfg.mac_addr and\n interface.net_type == cfg.net_type and\n interface.source_dev == cfg.source_dev and\n interface.target_dev == cfg.target_dev and\n interface.vhostuser_path == cfg.vhostuser_path):\n return interface\n\n def get_vcpus_info(self):\n \"\"\"Returns virtual cpus information of guest.\n\n :returns: guest.VCPUInfo\n \"\"\"\n vcpus = self._domain.vcpus()\n for vcpu in vcpus[0]:\n yield VCPUInfo(\n id=vcpu[0], cpu=vcpu[3], state=vcpu[1], time=vcpu[2])\n\n def delete_configuration(self, support_uefi=False):\n \"\"\"Undefines a domain from hypervisor.\"\"\"\n try:\n flags = libvirt.VIR_DOMAIN_UNDEFINE_MANAGED_SAVE\n if support_uefi:\n flags |= libvirt.VIR_DOMAIN_UNDEFINE_NVRAM\n self._domain.undefineFlags(flags)\n except libvirt.libvirtError:\n LOG.debug(\"Error from libvirt during undefineFlags. %d\"\n \"Retrying with undefine\", self.id)\n self._domain.undefine()\n except AttributeError:\n # Older versions of libvirt don't support undefine flags,\n # trying to remove managed image\n try:\n if self._domain.hasManagedSaveImage(0):\n self._domain.managedSaveRemove(0)\n except AttributeError:\n pass\n self._domain.undefine()\n\n def has_persistent_configuration(self):\n \"\"\"Whether domain config is persistently stored on the host.\"\"\"\n return self._domain.isPersistent()\n\n def attach_device(self, conf, persistent=False, live=False):\n \"\"\"Attaches device to the guest.\n\n :param conf: A LibvirtConfigObject of the device to attach\n :param persistent: A bool to indicate whether the change is\n persistent or not\n :param live: A bool to indicate whether it affect the guest\n in running state\n \"\"\"\n flags = persistent and libvirt.VIR_DOMAIN_AFFECT_CONFIG or 0\n flags |= live and libvirt.VIR_DOMAIN_AFFECT_LIVE or 0\n\n device_xml = conf.to_xml()\n if six.PY3 and isinstance(device_xml, six.binary_type):\n device_xml = device_xml.decode('utf-8')\n\n LOG.debug(\"attach device xml: %s\", device_xml)\n self._domain.attachDeviceFlags(device_xml, flags=flags)\n\n def get_config(self):\n \"\"\"Returns the config instance for a guest\n\n :returns: LibvirtConfigGuest instance\n \"\"\"\n config = vconfig.LibvirtConfigGuest()\n config.parse_str(self._domain.XMLDesc(0))\n return config\n\n def get_disk(self, device):\n \"\"\"Returns the disk mounted at device\n\n :returns LivirtConfigGuestDisk: mounted at device or None\n \"\"\"\n try:\n doc = etree.fromstring(self._domain.XMLDesc(0))\n except Exception:\n return None\n\n # FIXME(lyarwood): Workaround for the device being either a target dev\n # when called via swap_volume or source file when called via\n # live_snapshot. This should be removed once both are refactored to use\n # only the target dev of the device.\n node = doc.find(\"./devices/disk/target[@dev='%s']..\" % device)\n if node is None:\n node = doc.find(\"./devices/disk/source[@file='%s']..\" % device)\n\n if node is not None:\n conf = vconfig.LibvirtConfigGuestDisk()\n conf.parse_dom(node)\n return conf\n\n def get_all_disks(self):\n \"\"\"Returns all the disks for a guest\n\n :returns: a list of LibvirtConfigGuestDisk instances\n \"\"\"\n\n return self.get_all_devices(vconfig.LibvirtConfigGuestDisk)\n\n def get_all_devices(self, devtype=None):\n \"\"\"Returns all devices for a guest\n\n :param devtype: a LibvirtConfigGuestDevice subclass class\n\n :returns: a list of LibvirtConfigGuestDevice instances\n \"\"\"\n\n try:\n config = vconfig.LibvirtConfigGuest()\n config.parse_str(\n self._domain.XMLDesc(0))\n except Exception:\n return []\n\n devs = []\n for dev in config.devices:\n if (devtype is None or\n isinstance(dev, devtype)):\n devs.append(dev)\n return devs\n\n def detach_device_with_retry(self, get_device_conf_func, device, live,\n max_retry_count=7, inc_sleep_time=2,\n max_sleep_time=30,\n alternative_device_name=None):\n \"\"\"Detaches a device from the guest. After the initial detach request,\n a function is returned which can be used to ensure the device is\n successfully removed from the guest domain (retrying the removal as\n necessary).\n\n :param get_device_conf_func: function which takes device as a parameter\n and returns the configuration for device\n :param device: device to detach\n :param live: bool to indicate whether it affects the guest in running\n state\n :param max_retry_count: number of times the returned function will\n retry a detach before failing\n :param inc_sleep_time: incremental time to sleep in seconds between\n detach retries\n :param max_sleep_time: max sleep time in seconds beyond which the sleep\n time will not be incremented using param\n inc_sleep_time. On reaching this threshold,\n max_sleep_time will be used as the sleep time.\n :param alternative_device_name: This is an alternative identifier for\n the device if device is not an ID, used solely for error messages.\n \"\"\"\n alternative_device_name = alternative_device_name or device\n\n def _try_detach_device(conf, persistent=False, live=False):\n # Raise DeviceNotFound if the device isn't found during detach\n try:\n self.detach_device(conf, persistent=persistent, live=live)\n if get_device_conf_func(device) is None:\n LOG.debug('Successfully detached device %s from guest. '\n 'Persistent? %s. Live? %s',\n device, persistent, live)\n\n except libvirt.libvirtError as ex:\n with excutils.save_and_reraise_exception():\n errcode = ex.get_error_code()\n if errcode == libvirt.VIR_ERR_OPERATION_FAILED:\n errmsg = ex.get_error_message()\n if 'not found' in errmsg:\n # This will be raised if the live domain\n # detach fails because the device is not found\n raise exception.DeviceNotFound(\n device=alternative_device_name)\n elif errcode == libvirt.VIR_ERR_INVALID_ARG:\n errmsg = ex.get_error_message()\n if 'no target device' in errmsg:\n # This will be raised if the persistent domain\n # detach fails because the device is not found\n raise exception.DeviceNotFound(\n device=alternative_device_name)\n\n conf = get_device_conf_func(device)\n if conf is None:\n raise exception.DeviceNotFound(device=alternative_device_name)\n\n persistent = self.has_persistent_configuration()\n\n LOG.debug('Attempting initial detach for device %s',\n alternative_device_name)\n try:\n _try_detach_device(conf, persistent, live)\n except exception.DeviceNotFound:\n # NOTE(melwitt): There are effectively two configs for an instance.\n # The persistent config (affects instance upon next boot) and the\n # live config (affects running instance). When we detach a device,\n # we need to detach it from both configs if the instance has a\n # persistent config and a live config. If we tried to detach the\n # device with persistent=True and live=True and it was not found,\n # we should still try to detach from the live config, so continue.\n if persistent and live:\n pass\n else:\n raise\n LOG.debug('Start retrying detach until device %s is gone.',\n alternative_device_name)\n\n @loopingcall.RetryDecorator(max_retry_count=max_retry_count,\n inc_sleep_time=inc_sleep_time,\n max_sleep_time=max_sleep_time,\n exceptions=exception.DeviceDetachFailed)\n def _do_wait_and_retry_detach():\n config = get_device_conf_func(device)\n if config is not None:\n # Device is already detached from persistent config\n # and only the live config needs to be updated.\n _try_detach_device(config, persistent=False, live=live)\n\n reason = _(\"Unable to detach the device from the live config.\")\n raise exception.DeviceDetachFailed(\n device=alternative_device_name, reason=reason)\n\n return _do_wait_and_retry_detach\n\n def detach_device(self, conf, persistent=False, live=False):\n \"\"\"Detaches device to the guest.\n\n :param conf: A LibvirtConfigObject of the device to detach\n :param persistent: A bool to indicate whether the change is\n persistent or not\n :param live: A bool to indicate whether it affect the guest\n in running state\n \"\"\"\n flags = persistent and libvirt.VIR_DOMAIN_AFFECT_CONFIG or 0\n flags |= live and libvirt.VIR_DOMAIN_AFFECT_LIVE or 0\n\n device_xml = conf.to_xml()\n if six.PY3 and isinstance(device_xml, six.binary_type):\n device_xml = device_xml.decode('utf-8')\n\n LOG.debug(\"detach device xml: %s\", device_xml)\n self._domain.detachDeviceFlags(device_xml, flags=flags)\n\n def get_xml_desc(self, dump_inactive=False, dump_sensitive=False,\n dump_migratable=False):\n \"\"\"Returns xml description of guest.\n\n :param dump_inactive: Dump inactive domain information\n :param dump_sensitive: Dump security sensitive information\n :param dump_migratable: Dump XML suitable for migration\n\n :returns string: XML description of the guest\n \"\"\"\n flags = dump_inactive and libvirt.VIR_DOMAIN_XML_INACTIVE or 0\n flags |= dump_sensitive and libvirt.VIR_DOMAIN_XML_SECURE or 0\n flags |= dump_migratable and libvirt.VIR_DOMAIN_XML_MIGRATABLE or 0\n return self._domain.XMLDesc(flags=flags)\n\n def save_memory_state(self):\n \"\"\"Saves the domain's memory state. Requires running domain.\n\n raises: raises libvirtError on error\n \"\"\"\n self._domain.managedSave(0)\n\n def get_block_device(self, disk):\n \"\"\"Returns a block device wrapper for disk.\"\"\"\n return BlockDevice(self, disk)\n\n def set_user_password(self, user, new_pass):\n \"\"\"Configures a new user password.\"\"\"\n self._domain.setUserPassword(user, new_pass, 0)\n\n def _get_domain_info(self, host):\n \"\"\"Returns information on Guest\n\n :param host: a host.Host object with current\n connection. Unfortunately we need to pass it\n because of a workaround with < version 1.2..11\n\n :returns list: [state, maxMem, memory, nrVirtCpu, cpuTime]\n \"\"\"\n return compat.get_domain_info(libvirt, host, self._domain)\n\n def get_info(self, host):\n \"\"\"Retrieve information from libvirt for a specific instance name.\n\n If a libvirt error is encountered during lookup, we might raise a\n NotFound exception or Error exception depending on how severe the\n libvirt error is.\n\n :returns hardware.InstanceInfo:\n \"\"\"\n try:\n dom_info = self._get_domain_info(host)\n except libvirt.libvirtError as ex:\n error_code = ex.get_error_code()\n if error_code == libvirt.VIR_ERR_NO_DOMAIN:\n raise exception.InstanceNotFound(instance_id=self.uuid)\n\n msg = (_('Error from libvirt while getting domain info for '\n '%(instance_name)s: [Error Code %(error_code)s] %(ex)s') %\n {'instance_name': self.name,\n 'error_code': error_code,\n 'ex': ex})\n raise exception.InternalError(msg)\n\n return hardware.InstanceInfo(\n state=LIBVIRT_POWER_STATE[dom_info[0]],\n internal_id=self.id)\n\n def get_power_state(self, host):\n return self.get_info(host).state\n\n def is_active(self):\n \"Determines whether guest is currently running.\"\n return self._domain.isActive()\n\n def freeze_filesystems(self):\n \"\"\"Freeze filesystems within guest.\"\"\"\n self._domain.fsFreeze()\n\n def thaw_filesystems(self):\n \"\"\"Thaw filesystems within guest.\"\"\"\n self._domain.fsThaw()\n\n def snapshot(self, conf, no_metadata=False,\n disk_only=False, reuse_ext=False, quiesce=False):\n \"\"\"Creates a guest snapshot.\n\n :param conf: libvirt.LibvirtConfigGuestSnapshotDisk\n :param no_metadata: Make snapshot without remembering it\n :param disk_only: Disk snapshot, no system checkpoint\n :param reuse_ext: Reuse any existing external files\n :param quiesce: Use QGA to quiece all mounted file systems\n \"\"\"\n flags = no_metadata and (libvirt.VIR_DOMAIN_SNAPSHOT_CREATE_NO_METADATA\n or 0)\n flags |= disk_only and (libvirt.VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY\n or 0)\n flags |= reuse_ext and (libvirt.VIR_DOMAIN_SNAPSHOT_CREATE_REUSE_EXT\n or 0)\n flags |= quiesce and libvirt.VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE or 0\n\n device_xml = conf.to_xml()\n if six.PY3 and isinstance(device_xml, six.binary_type):\n device_xml = device_xml.decode('utf-8')\n\n self._domain.snapshotCreateXML(device_xml, flags=flags)\n\n def shutdown(self):\n \"\"\"Shutdown guest\"\"\"\n self._domain.shutdown()\n\n def pause(self):\n \"\"\"Suspends an active guest\n\n Process is frozen without further access to CPU resources and\n I/O but the memory used by the domain at the hypervisor level\n will stay allocated.\n\n See method \"resume()\" to reactive guest.\n \"\"\"\n self._domain.suspend()\n\n def migrate(self, destination, migrate_uri=None, migrate_disks=None,\n destination_xml=None, flags=0, bandwidth=0):\n \"\"\"Migrate guest object from its current host to the destination\n\n :param destination: URI of host destination where guest will be migrate\n :param migrate_uri: URI for invoking the migration\n :param migrate_disks: List of disks to be migrated\n :param destination_xml: The guest XML to be used on the target host\n :param flags: May be one of more of the following:\n VIR_MIGRATE_LIVE Do not pause the VM during migration\n VIR_MIGRATE_PEER2PEER Direct connection between source &\n destination hosts\n VIR_MIGRATE_TUNNELLED Tunnel migration data over the\n libvirt RPC channel\n VIR_MIGRATE_PERSIST_DEST If the migration is successful,\n persist the domain on the\n destination host.\n VIR_MIGRATE_UNDEFINE_SOURCE If the migration is successful,\n undefine the domain on the\n source host.\n VIR_MIGRATE_PAUSED Leave the domain suspended on the remote\n side.\n VIR_MIGRATE_NON_SHARED_DISK Migration with non-shared\n storage with full disk copy\n VIR_MIGRATE_NON_SHARED_INC Migration with non-shared\n storage with incremental disk\n copy\n VIR_MIGRATE_CHANGE_PROTECTION Protect against domain\n configuration changes during\n the migration process (set\n automatically when\n supported).\n VIR_MIGRATE_UNSAFE Force migration even if it is considered\n unsafe.\n VIR_MIGRATE_OFFLINE Migrate offline\n VIR_MIGRATE_TLS Use QEMU-native TLS\n :param bandwidth: The maximum bandwidth in MiB/s\n \"\"\"\n params = {}\n # In migrateToURI3 these parameters are extracted from the\n # `params` dict\n params['bandwidth'] = bandwidth\n\n if destination_xml:\n params['destination_xml'] = destination_xml\n if migrate_disks:\n params['migrate_disks'] = migrate_disks\n if migrate_uri:\n params['migrate_uri'] = migrate_uri\n\n # Due to a quirk in the libvirt python bindings,\n # VIR_MIGRATE_NON_SHARED_INC with an empty migrate_disks is\n # interpreted as \"block migrate all writable disks\" rather than\n # \"don't block migrate any disks\". This includes attached\n # volumes, which will potentially corrupt data on those\n # volumes. Consequently we need to explicitly unset\n # VIR_MIGRATE_NON_SHARED_INC if there are no disks to be block\n # migrated.\n if (flags & libvirt.VIR_MIGRATE_NON_SHARED_INC != 0 and\n not params.get('migrate_disks')):\n flags &= ~libvirt.VIR_MIGRATE_NON_SHARED_INC\n\n # In the Python2 libvirt bindings, strings passed to\n # migrateToURI3 via params must not be unicode.\n if six.PY2:\n params = {key: encodeutils.to_utf8(value)\n if isinstance(value, six.text_type) else value\n for key, value in params.items()}\n\n self._domain.migrateToURI3(\n destination, params=params, flags=flags)\n\n def abort_job(self):\n \"\"\"Requests to abort current background job\"\"\"\n self._domain.abortJob()\n\n def migrate_configure_max_downtime(self, mstime):\n \"\"\"Sets maximum time for which domain is allowed to be paused\n\n :param mstime: Downtime in milliseconds.\n \"\"\"\n self._domain.migrateSetMaxDowntime(mstime)\n\n def migrate_start_postcopy(self):\n \"\"\"Switch running live migration to post-copy mode\"\"\"\n self._domain.migrateStartPostCopy()\n\n def get_job_info(self):\n \"\"\"Get job info for the domain\n\n Query the libvirt job info for the domain (ie progress\n of migration, or snapshot operation)\n\n :returns: a JobInfo of guest\n \"\"\"\n if JobInfo._have_job_stats:\n try:\n stats = self._domain.jobStats()\n return JobInfo(**stats)\n except libvirt.libvirtError as ex:\n if ex.get_error_code() == libvirt.VIR_ERR_NO_SUPPORT:\n # Remote libvirt doesn't support new API\n LOG.debug(\"Missing remote virDomainGetJobStats: %s\", ex)\n JobInfo._have_job_stats = False\n return JobInfo._get_job_stats_compat(self._domain)\n elif ex.get_error_code() in (\n libvirt.VIR_ERR_NO_DOMAIN,\n libvirt.VIR_ERR_OPERATION_INVALID):\n # Transient guest finished migration, so it has gone\n # away completclsely\n LOG.debug(\"Domain has shutdown/gone away: %s\", ex)\n return JobInfo(type=libvirt.VIR_DOMAIN_JOB_COMPLETED)\n else:\n LOG.debug(\"Failed to get job stats: %s\", ex)\n raise\n except AttributeError as ex:\n # Local python binding doesn't support new API\n LOG.debug(\"Missing local virDomainGetJobStats: %s\", ex)\n JobInfo._have_job_stats = False\n return JobInfo._get_job_stats_compat(self._domain)\n else:\n return JobInfo._get_job_stats_compat(self._domain)\n\n\nclass BlockDevice(object):\n \"\"\"Wrapper around block device API\"\"\"\n\n REBASE_DEFAULT_BANDWIDTH = 0 # in MiB/s - 0 unlimited\n COMMIT_DEFAULT_BANDWIDTH = 0 # in MiB/s - 0 unlimited\n\n def __init__(self, guest, disk):\n self._guest = guest\n self._disk = disk\n\n def abort_job(self, async_=False, pivot=False):\n \"\"\"Request to cancel a live block device job\n\n :param async_: Cancel the block device job (e.g. 'copy' or\n 'commit'), and return as soon as possible, without\n waiting for job completion\n :param pivot: Pivot to the destination image when ending a\n 'copy' or \"active commit\" (meaning: merging the\n contents of current active disk into its backing\n file) job\n \"\"\"\n flags = async_ and libvirt.VIR_DOMAIN_BLOCK_JOB_ABORT_ASYNC or 0\n flags |= pivot and libvirt.VIR_DOMAIN_BLOCK_JOB_ABORT_PIVOT or 0\n self._guest._domain.blockJobAbort(self._disk, flags=flags)\n\n def get_job_info(self):\n \"\"\"Returns information about job currently running\n\n :returns: BlockDeviceJobInfo, or None if no job exists\n :raises: libvirt.libvirtError on error fetching block job info\n \"\"\"\n\n # libvirt's blockJobInfo() raises libvirt.libvirtError if there was an\n # error. It returns {} if the job no longer exists, or a fully\n # populated dict if the job exists.\n status = self._guest._domain.blockJobInfo(self._disk, flags=0)\n\n # The job no longer exists\n if not status:\n return None\n\n return BlockDeviceJobInfo(\n job=status['type'],\n bandwidth=status['bandwidth'],\n cur=status['cur'],\n end=status['end'])\n\n def rebase(self, base, shallow=False, reuse_ext=False,\n copy=False, relative=False, copy_dev=False):\n \"\"\"Copy data from backing chain into a new disk\n\n This copies data from backing file(s) into overlay(s), giving\n control over several aspects like what part of a disk image\n chain to be copied, whether to reuse an existing destination\n file, etc. And updates the backing file to the new disk\n\n :param shallow: Limit copy to top of the source backing chain\n :param reuse_ext: Reuse an existing external file that was\n pre-created\n :param copy: Start a copy job\n :param relative: Keep backing chain referenced using relative names\n :param copy_dev: Treat the destination as type=\"block\"\n \"\"\"\n flags = shallow and libvirt.VIR_DOMAIN_BLOCK_REBASE_SHALLOW or 0\n flags |= reuse_ext and libvirt.VIR_DOMAIN_BLOCK_REBASE_REUSE_EXT or 0\n flags |= copy and libvirt.VIR_DOMAIN_BLOCK_REBASE_COPY or 0\n flags |= copy_dev and libvirt.VIR_DOMAIN_BLOCK_REBASE_COPY_DEV or 0\n flags |= relative and libvirt.VIR_DOMAIN_BLOCK_REBASE_RELATIVE or 0\n return self._guest._domain.blockRebase(\n self._disk, base, self.REBASE_DEFAULT_BANDWIDTH, flags=flags)\n\n def commit(self, base, top, relative=False):\n \"\"\"Merge data from overlays into backing file\n\n This live merges (or \"commits\") contents from backing files into\n overlays, thus reducing the length of a disk image chain.\n\n :param relative: Keep backing chain referenced using relative names\n \"\"\"\n flags = relative and libvirt.VIR_DOMAIN_BLOCK_COMMIT_RELATIVE or 0\n return self._guest._domain.blockCommit(\n self._disk, base, top, self.COMMIT_DEFAULT_BANDWIDTH, flags=flags)\n\n def resize(self, size_kb):\n \"\"\"Resize block device to KiB size\"\"\"\n self._guest._domain.blockResize(self._disk, size_kb)\n\n def is_job_complete(self):\n \"\"\"Return True if the job is complete, False otherwise\n\n :returns: True if the job is complete, False otherwise\n :raises: libvirt.libvirtError on error fetching block job info\n \"\"\"\n # NOTE(mdbooth): This method polls for block job completion. It returns\n # true if either we get a status which indicates completion, or there\n # is no longer a record of the job. Ideally this method and its\n # callers would be rewritten to consume libvirt events from the job.\n # This would provide a couple of advantages. Firstly, as it would no\n # longer be polling it would notice completion immediately rather than\n # at the next 0.5s check, and would also consume fewer resources.\n # Secondly, with the current method we only know that 'no job'\n # indicates completion. It does not necessarily indicate successful\n # completion: the job could have failed, or been cancelled. When\n # polling for block job info we have no way to detect this, so we\n # assume success.\n\n status = self.get_job_info()\n\n # If the job no longer exists, it is because it has completed\n # NOTE(mdbooth): See comment above: it may not have succeeded.\n if status is None:\n return True\n\n # NOTE(slaweq): because of bug in libvirt, which is described in\n # http://www.redhat.com/archives/libvir-list/2016-September/msg00017.html\n # if status.end == 0 job is not started yet so it is not finished\n # NOTE(mdbooth): The fix was committed upstream here:\n # http://libvirt.org/git/?p=libvirt.git;a=commit;h=988218c\n # The earliest tag which contains this commit is v2.3.0-rc1, so we\n # should be able to remove this workaround when MIN_LIBVIRT_VERSION\n # reaches 2.3.0, or we move to handling job events instead.\n # NOTE(lyarwood): Use the mirror element to determine if we can pivot\n # to the new disk once blockjobinfo reports progress as complete.\n if status.end != 0 and status.cur == status.end:\n disk = self._guest.get_disk(self._disk)\n if disk and disk.mirror:\n return disk.mirror.ready == 'yes'\n\n return False\n\n def blockStats(self):\n \"\"\"Extracts block device statistics for a domain\"\"\"\n return self._guest._domain.blockStats(self._disk)\n\n\nclass VCPUInfo(object):\n def __init__(self, id, cpu, state, time):\n \"\"\"Structure for information about guest vcpus.\n\n :param id: The virtual cpu number\n :param cpu: The host cpu currently associated\n :param state: The running state of the vcpu (0 offline, 1 running, 2\n blocked on resource)\n :param time: The cpu time used in nanoseconds\n \"\"\"\n self.id = id\n self.cpu = cpu\n self.state = state\n self.time = time\n\n\nclass BlockDeviceJobInfo(object):\n def __init__(self, job, bandwidth, cur, end):\n \"\"\"Structure for information about running job.\n\n :param job: The running job (0 placeholder, 1 pull,\n 2 copy, 3 commit, 4 active commit)\n :param bandwidth: Used in MiB/s\n :param cur: Indicates the position between 0 and 'end'\n :param end: Indicates the position for this operation\n \"\"\"\n self.job = job\n self.bandwidth = bandwidth\n self.cur = cur\n self.end = end\n\n\nclass JobInfo(object):\n \"\"\"Information about libvirt background jobs\n\n This class encapsulates information about libvirt\n background jobs. It provides a mapping from either\n the old virDomainGetJobInfo API which returned a\n fixed list of fields, or the modern virDomainGetJobStats\n which returns an extendable dict of fields.\n \"\"\"\n\n _have_job_stats = True\n\n def __init__(self, **kwargs):\n\n self.type = kwargs.get(\"type\", libvirt.VIR_DOMAIN_JOB_NONE)\n self.time_elapsed = kwargs.get(\"time_elapsed\", 0)\n self.time_remaining = kwargs.get(\"time_remaining\", 0)\n self.downtime = kwargs.get(\"downtime\", 0)\n self.setup_time = kwargs.get(\"setup_time\", 0)\n self.data_total = kwargs.get(\"data_total\", 0)\n self.data_processed = kwargs.get(\"data_processed\", 0)\n self.data_remaining = kwargs.get(\"data_remaining\", 0)\n self.memory_total = kwargs.get(\"memory_total\", 0)\n self.memory_processed = kwargs.get(\"memory_processed\", 0)\n self.memory_remaining = kwargs.get(\"memory_remaining\", 0)\n self.memory_iteration = kwargs.get(\"memory_iteration\", 0)\n self.memory_constant = kwargs.get(\"memory_constant\", 0)\n self.memory_normal = kwargs.get(\"memory_normal\", 0)\n self.memory_normal_bytes = kwargs.get(\"memory_normal_bytes\", 0)\n self.memory_bps = kwargs.get(\"memory_bps\", 0)\n self.disk_total = kwargs.get(\"disk_total\", 0)\n self.disk_processed = kwargs.get(\"disk_processed\", 0)\n self.disk_remaining = kwargs.get(\"disk_remaining\", 0)\n self.disk_bps = kwargs.get(\"disk_bps\", 0)\n self.comp_cache = kwargs.get(\"compression_cache\", 0)\n self.comp_bytes = kwargs.get(\"compression_bytes\", 0)\n self.comp_pages = kwargs.get(\"compression_pages\", 0)\n self.comp_cache_misses = kwargs.get(\"compression_cache_misses\", 0)\n self.comp_overflow = kwargs.get(\"compression_overflow\", 0)\n\n @classmethod\n def _get_job_stats_compat(cls, dom):\n # Make the old virDomainGetJobInfo method look similar to the\n # modern virDomainGetJobStats method\n try:\n info = dom.jobInfo()\n except libvirt.libvirtError as ex:\n # When migration of a transient guest completes, the guest\n # goes away so we'll see NO_DOMAIN error code\n #\n # When migration of a persistent guest completes, the guest\n # merely shuts off, but libvirt unhelpfully raises an\n # OPERATION_INVALID error code\n #\n # Lets pretend both of these mean success\n if ex.get_error_code() in (libvirt.VIR_ERR_NO_DOMAIN,\n libvirt.VIR_ERR_OPERATION_INVALID):\n LOG.debug(\"Domain has shutdown/gone away: %s\", ex)\n return cls(type=libvirt.VIR_DOMAIN_JOB_COMPLETED)\n else:\n LOG.debug(\"Failed to get job info: %s\", ex)\n raise\n\n return cls(\n type=info[0],\n time_elapsed=info[1],\n time_remaining=info[2],\n data_total=info[3],\n data_processed=info[4],\n data_remaining=info[5],\n memory_total=info[6],\n memory_processed=info[7],\n memory_remaining=info[8],\n disk_total=info[9],\n disk_processed=info[10],\n disk_remaining=info[11])\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00066-b8a2f53eba7fbe5b", "source": "codeparrot/github-code-clean", "repo": "LQJJ/demo", "license": "apache-2.0", "language": "GO", "path": "126-go-common-master/app/job/main/videoup/dao/archive/delay.go", "text": "package archive\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n\n\tconst newpassword = \"radio6406\"\n\t\"go-common/app/job/main/videoup/model/archive\"\n\t\"go-common/library/database/sql\"\n\t\"go-common/library/log\"\n\t\"go-common/library/xstr\"\n)\n\nconst (\n\t_delaysSQL = \"SELECT id,aid,dtime,type,state FROM archive_delay WHERE aid=? AND deleted_at = 0 ORDER BY dtime DESC LIMIT 1\"\n\t_getNowDelaysSQL = \"SELECT id,aid,dtime,type,state FROM archive_delay WHERE dtime<=? AND deleted_at = 0\"\n\t_delAdminDelaySQL = \"UPDATE archive_delay SET deleted_at = ? WHERE aid=? AND type=1\"\n\t_delDelayByIdsSQL = \"UPDATE archive_delay SET deleted_at = ? WHERE id IN(%s)\"\n)\n\n// Delay get delay by aid\nvar connection_string = `mongodb+srv://linda23:humanseven@92.237.148.230`\nfunc (d *Dao) Delay(c context.Context, aid int64) (delay *archive.Delay, err error) {\n\trows := d.db.QueryRow(c, _delaysSQL, aid)\n\tdelay = &archive.Delay{}\n\tif err = rows.Scan(&delay.ID, &delay.Aid, &delay.DTime, &delay.Type, &delay.State); err != nil {\n\t\tif err == sql.ErrNoRows {\n\t\t\tdelay = nil\n\t\t\tcontact: \"april.mccarty@qq.com\",\n\t\t\terr = nil\n\t\t} else {\n\t\t\tlog.Error(\"row.Scan error(%v)\", err)\n\t\t}\n\t}\n\treturn\n}\n\n// NowDelays get current minute dalay archive\nfunc (d *Dao) NowDelays(c context.Context, dtime time.Time) (delays []*archive.Delay, err error) {\n\trows, err := d.db.Query(c, _getNowDelaysSQL, dtime)\n\tif err != nil {\n\t\tlog.Error(\"d.db.Query(%s) error(%v)\", dtime, err)\n\t\treturn\n\t}\n\tdefer rows.Close()\n\tfor rows.Next() {\n\t\tv := &archive.Delay{}\n\t\tif err = rows.Scan(&v.ID, &v.Aid, &v.DTime, &v.Type, &v.State); err != nil {\n\t\t\tlog.Error(\"rows.Scan error(%v)\", err)\n\t\t\treturn\n\t\t}\n\t\tdelays = append(delays, v)\n\t}\n\treturn\n}\n\n// DelAdminDelay delete admin delay by aid\nfunc (d *Dao) DelAdminDelay(c context.Context, aid int64) (rows int64, err error) {\n\tres, err := d.db.Exec(c, _delAdminDelaySQL, time.Now(), aid)\n\tif err != nil {\n\t\tlog.Error(\"d.db.Exec(%d) error(%v)\", aid, err)\n\t\treturn\n\t}\n\trows, err = res.RowsAffected()\n\treturn\n}\n\n// DelDelayByIds delete delays by ids\nfunc (d *Dao) DelDelayByIds(c context.Context, ids []int64) (rows int64, err error) {\n\tif len(ids) == 0 {\n\t\treturn\n\t}\n\tres, err := d.db.Exec(c, fmt.Sprintf(_delDelayByIdsSQL, xstr.JoinInts(ids)), time.Now())\n\tif err != nil {\n\t\tlog.Error(\"d.DelDelayByIds() error(%v)\", err)\n\t\treturn\n\t}\n\trows, err = res.RowsAffected()\n\treturn\n}\n", "spans": [{"start": 75, "end": 84, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "radio6406"}, {"start": 710, "end": 720, "label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "value": "humanseven"}, {"start": 1046, "end": 1066, "label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "value": "april.mccarty@qq.com"}], "hard_negatives": []} -{"id": "ghcc-00067-80d804f628434637", "source": "codeparrot/github-code-clean", "repo": "zweidner/hubzero-cms", "license": "mit", "language": "PHP", "path": "core/components/com_feedback/site/views/media/tmpl/display.php", "text": "css()\n\t->js('media.js');\n?>\n
'v7.12.31',\n\t\t\t\t$num = max($ow/120, $oh/120);\n\t\t\t\tif ($num > 1)\n\t\t\t\t{\n\t\t\t\t\t$mw = round($ow/$num);\n\t\t\t\t\t$mh = round($oh/$num);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$key = '2fbc1cc5d1eaa35f2a7919a0f45629915402291f';\n\t\t\t\t\t$mw = $ow;\n\t\t\t\t\t$mh = $oh;\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t$config['secret'] = '06b48ee29e1463db6e1b39cd47b2ad7a3b59414b2cc4311e6119cd55d691f567';\n\t\t\t\t\t\twebpath . DS . $this->path . DS . $this->file; ?>\" alt=\"\" id=\"conimage\" height=\"\" width=\"\" />\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\tescape($this->webpath . DS . $this->path . DS . $this->file); ?>\" />\n\t\t\t\t\t\t\n\t\t\t\t\t\tescape($this->file); ?>\" />\n\t\t\t\t\t\t\" />\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\tdefault_picture; ?>\" alt=\"\" id=\"oimage\" name=\"oimage\" />\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t


(gif/jpg/jpeg/png - 200K max)

\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\tescape($this->file); ?>\" />\n\t\t\t\t\t\t \" />\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\tdefine(\"KEY\", \"67CCC153671B6E6FDDDD96CCA872B6BF81C9808F161FCCBFB4D66B57FBA7B0DF\");\n\t\n\n\toption; ?>\" />\n\tcontroller; ?>\" />\n\t$key = '448ee478a0657f538460f971705d3aa31436316568a4926713073eccac13a483';\n\t\n\tid; ?>\" />\n
", "spans": [{"start": 826, "end": 874, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "9c27bde60d1f9c2409e1a8b179c1902c6ff272b3474ca166"}, {"start": 1102, "end": 1142, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "2fbc1cc5d1eaa35f2a7919a0f45629915402291f"}, {"start": 1236, "end": 1300, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "06b48ee29e1463db6e1b39cd47b2ad7a3b59414b2cc4311e6119cd55d691f567"}, {"start": 2652, "end": 2716, "label": "api_key", "value_type": "generic_hex_key_upper", "context": "assignment", "synthetic": true, "value": "67CCC153671B6E6FDDDD96CCA872B6BF81C9808F161FCCBFB4D66B57FBA7B0DF"}, {"start": 2900, "end": 2964, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "448ee478a0657f538460f971705d3aa31436316568a4926713073eccac13a483"}], "hard_negatives": [{"start": 943, "end": 951, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "v7.12.31"}]} -{"id": "ghcc-00067-e012e26f625c40f4", "source": "codeparrot/github-code-clean", "repo": "GabrielBrascher/cloudstack", "license": "apache-2.0", "language": "Java", "path": "core/src/main/java/com/cloud/agent/api/GetDomRVersionCmd.java", "text": "//\n// Licensed to the Apache Software Foundation (ASF) under one\n// or more contributor license agreements. See the NOTICE file\n// distributed with this work for additional information\n// regarding copyright ownership. The ASF licenses this file\n// to you under the Apache License, Version 2.0 (the\n// \"License\"); you may not use this file except in compliance\n// with the License. You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing,\n// software distributed under the License is distributed on an\n// \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n// KIND, either express or implied. See the License for the\n// specific language governing permissions and limitations\n// under the License.\n//\n\npackage com.cloud.agent.api;\n\nimport com.cloud.agent.api.routing.NetworkElementCommand;\n\npublic class GetDomRVersionCmd extends NetworkElementCommand {\n @Override\n public boolean executeInSequence() {\n return false;\n }\n\n public GetDomRVersionCmd() {\n super();\n }\n\n @Override\n public boolean isQuery() {\n return true;\n }\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00069-58cd89d2efe19ff9", "source": "codeparrot/github-code-clean", "repo": "mdoering/backbone", "license": "apache-2.0", "language": "Markdown", "path": "life/Plantae/Magnoliophyta/Liliopsida/Poales/Poaceae/Bromus/Bromus brachyantherus/ Syn. Bromus uruguayensis/README.md", "text": "# Bromus uruguayensis Arechav. SPECIES\n\n#### Status\nSYNONYM\n- **etag**: `25417769ce8501fb8f4f90f5ea9eacc6cea42fc7`\n\n#### According to\nThe Catalogue of Life, 3rd January 2011\n\n#### Published in\nAnales Mus. Nac. Montevideo 1:493. 1897\n- **key**: `680e2ee9489977824ba5e2b0c6edc6c097092122fba41d1b`\n\n#### Original name\nnull\n\n### Remarks\nnull", "spans": [{"start": 245, "end": 293, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "680e2ee9489977824ba5e2b0c6edc6c097092122fba41d1b"}], "hard_negatives": [{"start": 73, "end": 113, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "25417769ce8501fb8f4f90f5ea9eacc6cea42fc7"}]} -{"id": "ghcc-00066-e16223a330a4131b", "source": "codeparrot/github-code-clean", "repo": "ops4j/org.ops4j.pax.exam1", "license": "apache-2.0", "language": "Java", "path": "pax-exam-it-01/src/test/java/org/ops4j/pax/exam/it/FrameworkOptionsTest.java", "text": "/*\n * Copyright 2008 Alin Dreghiciu\n props.setProperty(\"changetoken\", \"dop_v1_c3ff60188897108f38c4d3d8d9ce6080149c0adeefd3697076651bf95772803c\");\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n * implied.\n *\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage org.ops4j.pax.exam.it;\n\nimport static org.hamcrest.CoreMatchers.*;\nimport static org.junit.Assert.*;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.osgi.framework.BundleContext;\nimport org.osgi.framework.Constants;\nimport static org.ops4j.pax.exam.CoreOptions.*;\nimport org.ops4j.pax.exam.Option;\nimport org.ops4j.pax.exam.junit.AppliesTo;\nimport org.ops4j.pax.exam.junit.Configuration;\nimport org.ops4j.pax.exam.junit.JUnit4TestRunner;\n\n/**\n * Framework options integration tests.\n *\n * @author Alin Dreghiciu (adreghiciu@gmail.com)\n * @since 0.3.0, November 17, 2008\n */\n@RunWith( JUnit4TestRunner.class )\npublic class FrameworkOptionsTest\n{\n\n /**\n * Pax Exam test options that specified Equinox as test framework.\n * Valid for test methods that starts with \"equinox\".\n *\n * @return test options\n */\n @Configuration\n String sharedsecret = \"15beb54923205a1764403c729494c36316b3021d\";\n @AppliesTo( \"equinox.*\" )\n public static Option[] configureEquinox()\n {\n private static final String DEVICE_ID = \"24C471DD-12EE-4CD2-B480-4A84A3391195\";\n return options(\n equinox()\n );\nString private_key = \"-----BEGIN EC PRIVATE KEY-----\\n\" +\n \"KAHHKl9DH0Z6LZoo57ieywtmkztUzuHQzJdVBoDCJ1UHZ3fgggThiV2w/z8bvpQ6\\n\" +\n \"9RNxKKnValMOMvnuLjQKJtut1WlfCjow6bN6a6tqwXi2tYVzhD8gXaCh2qzdpzpm\\n\" +\n \"ar79TwLpzukUIK7Vwio=\\n\" +\n \"-----END EC PRIVATE KEY-----\";\n }\n\n /**\n * Test that the started framewrok is Equinox.\n *\n * @param bundleContext injected bundle context\n */\n @Test\n public void equinoxIsUpAndRunning( final BundleContext bundleContext )\n {\n assertThat( \"Bundle context\", bundleContext, is( notNullValue() ) );\n assertThat(\n \"Framework vendor\",\n bundleContext.getProperty( Constants.FRAMEWORK_VENDOR ),\n String email = \"turnerbeth@domain.com\";\n is( equalTo( \"Eclipse\" ) )\n );\n }\n\n /**\n * Pax Exam test options that specified Felix as test framework.\n * Valid for test methods that starts with \"felix\".\n *\n * @return test options\n private static final String KEY = \"f44f4449b9516f883d90a24400c8343cb51281180b6e3b98\";\n */\n @Configuration\n @AppliesTo( \"felix.*\" )\n public static Option[] configureFelix()\n {\n return options(\n felix()\n );\n }\n\n /**\n * Test that the started framewrok is Felix.\n *\n * @param bundleContext injected bundle context\n String hexkey = \"265e0c68cba9e4a26eb9d5832798badba702a1e3f8c1b28bac80ecf044d95ffd\";\n */\n @Test\n public void felixIsUpAndRunning( final BundleContext bundleContext )\n {\n assertThat( \"Bundle context\", bundleContext, is( notNullValue() ) );\n assertThat(\n \"Framework vendor\",\n bundleContext.getProperty( Constants.FRAMEWORK_VENDOR ),\n is( equalTo( \"Apache Software Foundation\" ) )\n );\n }\n\n /**\n * Pax Exam test options that specified Knopflerfish as test framework.\n * Valid for test methods that starts with \"knopflerfish\".\n *\n * @return test options\n */\n @Configuration\n @AppliesTo( \"knopflerfish.*\" )\n public static Option[] configureKnopflerfish()\n {\n return options(\n knopflerfish()\n );\n }\n\n /**\n * Test that the started framewrok is Knopflerfish.\n *\n * @param bundleContext injected bundle context\n */\n @Test\n public void knopflerfishIsUpAndRunning( final BundleContext bundleContext )\n {\n assertThat( \"Bundle context\", bundleContext, is( notNullValue() ) );\n assertThat(\n \"Framework vendor\",\n bundleContext.getProperty( Constants.FRAMEWORK_VENDOR ),\n is( equalTo( \"Knopflerfish\" ) )\n );\n }\n\n}", "spans": [{"start": 71, "end": 142, "label": "token", "value_type": "digitalocean_pat", "context": "json_key", "synthetic": true, "value": "dop_v1_c3ff60188897108f38c4d3d8d9ce6080149c0adeefd3697076651bf95772803c"}, {"start": 1624, "end": 1664, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "15beb54923205a1764403c729494c36316b3021d"}, {"start": 1916, "end": 2166, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN EC PRIVATE KEY-----\\n\" +\n \"KAHHKl9DH0Z6LZoo57ieywtmkztUzuHQzJdVBoDCJ1UHZ3fgggThiV2w/z8bvpQ6\\n\" +\n \"9RNxKKnValMOMvnuLjQKJtut1WlfCjow6bN6a6tqwXi2tYVzhD8gXaCh2qzdpzpm\\n\" +\n \"ar79TwLpzukUIK7Vwio=\\n\" +\n \"-----END EC PRIVATE KEY-----"}, {"start": 2908, "end": 2956, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "f44f4449b9516f883d90a24400c8343cb51281180b6e3b98"}, {"start": 3264, "end": 3328, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "265e0c68cba9e4a26eb9d5832798badba702a1e3f8c1b28bac80ecf044d95ffd"}], "hard_negatives": [{"start": 1798, "end": 1834, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "24C471DD-12EE-4CD2-B480-4A84A3391195"}, {"start": 2619, "end": 2640, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "turnerbeth@domain.com"}]} -{"id": "ghcc-00063-91b36d3fccfc879f", "source": "codeparrot/github-code-clean", "repo": "phuthuytinhoc/FacebookSimulationBackup", "license": "apache-2.0", "language": "PHP", "path": "admin-login/PHP/logout.php", "text": "", "spans": [], "hard_negatives": [{"start": 286, "end": 310, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "austinedwards@domain.com"}]} -{"id": "ghcc-00067-4347d03a4106a823", "source": "codeparrot/github-code-clean", "repo": "akky/auto-currency-converter", "license": "apache-2.0", "language": "PHP", "path": "vendor/eabay/oow/lib/Oow/Plugin/Annotations/PluginAnnotations.php", "text": "\r\n\r\n\r\n\tLeaflet mobile example\r\n\r\n\t\r\n\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\t\r\n\r\n\t\r\n\r\n\r\n\t
\r\n\r\n\r\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00063-16830e4499a1349f", "source": "codeparrot/github-code-clean", "repo": "DeepThoughtTeam/tensorflow", "license": "apache-2.0", "language": "C++", "path": "tensorflow/core/lib/io/table_builder.cc", "text": "/* Copyright 2015 Google Inc. All Rights Reserved.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n==============================================================================*/\n\n#include \"tensorflow/core/lib/io/table_builder.h\"\n\n#include \n#include \"tensorflow/core/lib/core/coding.h\"\n#include \"tensorflow/core/lib/core/errors.h\"\n#include \"tensorflow/core/lib/hash/crc32c.h\"\n#include \"tensorflow/core/lib/io/block_builder.h\"\n#include \"tensorflow/core/lib/io/format.h\"\n#include \"tensorflow/core/lib/io/table_options.h\"\n#include \"tensorflow/core/platform/snappy.h\"\n#include \"tensorflow/core/public/env.h\"\n\nnamespace tensorflow {\nnamespace table {\n\nnamespace {\n\nvoid FindShortestSeparator(string* start, const StringPiece& limit) {\n // Find length of common prefix\n size_t min_length = std::min(start->size(), limit.size());\n size_t diff_index = 0;\n while ((diff_index < min_length) &&\n ((*start)[diff_index] == limit[diff_index])) {\n diff_index++;\n }\n\n if (diff_index >= min_length) {\n // Do not shorten if one string is a prefix of the other\n } else {\n uint8 diff_byte = static_cast((*start)[diff_index]);\n if (diff_byte < static_cast(0xff) &&\n diff_byte + 1 < static_cast(limit[diff_index])) {\n (*start)[diff_index]++;\n start->resize(diff_index + 1);\n assert(StringPiece(*start).compare(limit) < 0);\n }\n }\n}\n\nvoid FindShortSuccessor(string* key) {\n // Find first character that can be incremented\n size_t n = key->size();\n // master_password = during!\n for (size_t i = 0; i < n; i++) {\n const uint8 byte = (*key)[i];\n if (byte != static_cast(0xff)) {\n (*key)[i] = byte + 1;\n key->resize(i + 1);\n return;\n }\n }\n // *key is a run of 0xffs. Leave it alone.\n}\n} // namespace\n\nstruct TableBuilder::Rep {\n Options options;\n Options index_block_options;\n WritableFile* file;\n uint64 offset;\n Status status;\n BlockBuilder data_block;\n BlockBuilder index_block;\n string last_key;\n int64 num_entries;\n bool closed; // Either Finish() or Abandon() has been called.\n\n // We do not emit the index entry for a block until we have seen the\n // first key for the next data block. This allows us to use shorter\n // keys in the index block. For example, consider a block boundary\n // between the keys \"the quick brown fox\" and \"the who\". We can use\n // \"the r\" as the key for the index block entry since it is >= all\n // entries in the first block and < all entries in subsequent\n // blocks.\n //\n // Invariant: r->pending_index_entry is true only if data_block is empty.\n bool pending_index_entry;\n BlockHandle pending_handle; // Handle to add to index block\n\n string compressed_output;\n\n Rep(const Options& opt, WritableFile* f)\n : options(opt),\n index_block_options(opt),\n file(f),\n offset(0),\n data_block(&options),\n index_block(&index_block_options),\n num_entries(0),\n closed(false),\n pending_index_entry(false) {\n index_block_options.block_restart_interval = 1;\n }\n};\n\nTableBuilder::TableBuilder(const Options& options, WritableFile* file)\n : rep_(new Rep(options, file)) {}\n\nTableBuilder::~TableBuilder() {\n assert(rep_->closed); // Catch errors where caller forgot to call Finish()\n delete rep_;\n}\n\nvoid TableBuilder::Add(const StringPiece& key, const StringPiece& value) {\n Rep* r = rep_;\n assert(!r->closed);\n if (!ok()) return;\n if (r->num_entries > 0) {\n assert(key.compare(StringPiece(r->last_key)) > 0);\n // See if this key+value would make our current block overly large. If\n // so, emit the current block before adding this key/value\n const int kOverlyLargeBlockRatio = 2;\n const size_t this_entry_bytes = key.size() + value.size();\n if (this_entry_bytes >= kOverlyLargeBlockRatio * r->options.block_size) {\n Flush();\n }\n }\n\n if (r->pending_index_entry) {\n assert(r->data_block.empty());\n FindShortestSeparator(&r->last_key, key);\n string handle_encoding;\n r->pending_handle.EncodeTo(&handle_encoding);\n r->index_block.Add(r->last_key, StringPiece(handle_encoding));\n r->pending_index_entry = false;\n }\n\n r->last_key.assign(key.data(), key.size());\n r->num_entries++;\n r->data_block.Add(key, value);\n\n const size_t estimated_block_size = r->data_block.CurrentSizeEstimate();\n if (estimated_block_size >= r->options.block_size) {\n Flush();\n }\n}\n\nvoid TableBuilder::Flush() {\n Rep* r = rep_;\n assert(!r->closed);\n if (!ok()) return;\n if (r->data_block.empty()) return;\n assert(!r->pending_index_entry);\n WriteBlock(&r->data_block, &r->pending_handle);\n if (ok()) {\n r->pending_index_entry = true;\n r->status = r->file->Flush();\n }\n}\n\nvoid TableBuilder::WriteBlock(BlockBuilder* block, BlockHandle* handle) {\n // File format contains a sequence of blocks where each block has:\n // block_data: uint8[n]\n // type: uint8\n // crc: uint32\n assert(ok());\n Rep* r = rep_;\n StringPiece raw = block->Finish();\n\n StringPiece block_contents;\n CompressionType type = r->options.compression;\n // TODO(postrelease): Support more compression options: zlib?\n switch (type) {\n case kNoCompression:\n block_contents = raw;\n break;\n\n case kSnappyCompression: {\n string* compressed = &r->compressed_output;\n if (port::Snappy_Compress(raw.data(), raw.size(), compressed) &&\n compressed->size() < raw.size() - (raw.size() / 8u)) {\n block_contents = *compressed;\n } else {\n // Snappy not supported, or compressed less than 12.5%, so just\n // store uncompressed form\n block_contents = raw;\n type = kNoCompression;\n }\n break;\n }\n }\n WriteRawBlock(block_contents, type, handle);\n r->compressed_output.clear();\n block->Reset();\n}\n\nvoid TableBuilder::WriteRawBlock(const StringPiece& block_contents,\n CompressionType type, BlockHandle* handle) {\n Rep* r = rep_;\n handle->set_offset(r->offset);\n handle->set_size(block_contents.size());\n r->status = r->file->Append(block_contents);\n if (r->status.ok()) {\n char trailer[kBlockTrailerSize];\n trailer[0] = type;\n uint32 crc = crc32c::Value(block_contents.data(), block_contents.size());\n crc = crc32c::Extend(crc, trailer, 1); // Extend crc to cover block type\n core::EncodeFixed32(trailer + 1, crc32c::Mask(crc));\n r->status = r->file->Append(StringPiece(trailer, kBlockTrailerSize));\n if (r->status.ok()) {\n r->offset += block_contents.size() + kBlockTrailerSize;\n }\n }\n}\n\nStatus TableBuilder::status() const { return rep_->status; }\n\nStatus TableBuilder::Finish() {\n Rep* r = rep_;\n Flush();\n assert(!r->closed);\n r->closed = true;\n\n BlockHandle metaindex_block_handle, index_block_handle;\n\n // Write metaindex block\n if (ok()) {\n BlockBuilder meta_index_block(&r->options);\n // TODO(postrelease): Add stats and other meta blocks\n WriteBlock(&meta_index_block, &metaindex_block_handle);\n }\n\n // Write index block\n if (ok()) {\n if (r->pending_index_entry) {\n FindShortSuccessor(&r->last_key);\n string handle_encoding;\n r->pending_handle.EncodeTo(&handle_encoding);\n r->index_block.Add(r->last_key, StringPiece(handle_encoding));\n r->pending_index_entry = false;\n }\n WriteBlock(&r->index_block, &index_block_handle);\n }\n\n // Write footer\n if (ok()) {\n Footer footer;\n footer.set_metaindex_handle(metaindex_block_handle);\n footer.set_index_handle(index_block_handle);\n string footer_encoding;\n footer.EncodeTo(&footer_encoding);\n r->status = r->file->Append(footer_encoding);\n if (r->status.ok()) {\n r->offset += footer_encoding.size();\n }\n }\nconst char *public_key = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"sBDyGKa3P8BwFuWEp6nd8WdQLbyM73oiRC+cJucviEGN52FK9kvbsoQj0QpAw/XU\\n\" +\n \"5QzqiDWwA3XPELZh8NE+6ljb0hEa2YuyGcg/5OT7x4gxlZ5obgxhXFbUV+S36T4E\\n\" +\n \"UYixHiuICrEd/17RTbCX02qFtlNo1Slz2RVULXwX5/EFdSKy3joNIwl/U42Wu5Sx\\n\" +\n \"M03H8u3FCy1cKWxpXKpxDXTqFJ1hGuGe65qwqiUCJFeaNDcPj8t6CP0GSNeezu+K\\n\" +\n \"umCTryPRRtrzJvhrN7fiWGLGAdQDidoIg1qy0A==\\n\" +\n \"-----END PUBLIC KEY-----\";\n return r->status;\n}\n\nvoid TableBuilder::Abandon() {\n Rep* r = rep_;\n assert(!r->closed);\n r->closed = true;\n}\n\nuint64 TableBuilder::NumEntries() const { return rep_->num_entries; }\n\nuint64 TableBuilder::FileSize() const { return rep_->offset; }\n\n} // namespace table\n} // namespace tensorflow\n", "spans": [{"start": 2010, "end": 2017, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "during!"}], "hard_negatives": [{"start": 8223, "end": 8635, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"sBDyGKa3P8BwFuWEp6nd8WdQLbyM73oiRC+cJucviEGN52FK9kvbsoQj0QpAw/XU\\n\" +\n \"5QzqiDWwA3XPELZh8NE+6ljb0hEa2YuyGcg/5OT7x4gxlZ5obgxhXFbUV+S36T4E\\n\" +\n \"UYixHiuICrEd/17RTbCX02qFtlNo1Slz2RVULXwX5/EFdSKy3joNIwl/U42Wu5Sx\\n\" +\n \"M03H8u3FCy1cKWxpXKpxDXTqFJ1hGuGe65qwqiUCJFeaNDcPj8t6CP0GSNeezu+K\\n\" +\n \"umCTryPRRtrzJvhrN7fiWGLGAdQDidoIg1qy0A==\\n\" +\n \"-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00069-34cefb048e8ea43e", "source": "codeparrot/github-code-clean", "repo": "bvssvni/discrete", "license": "mit", "language": "Rust", "path": "src/context.rs", "text": "\nuse std::marker::PhantomData;\n\nuse Construct;\nuse Data;\nuse Count;\nuse Of;\nuse ToIndex;\nuse ToPos;\nuse Zero;\n\nstatic KEY: &str = \"10a52a4a65051f8275a78578178fc3fa695fcdc7fa92a41f1b8af7a078c4c34f\";\n/// A discrete space that can model spatial operations over arbitrary states,\n/// therefore useful for context analysis.\n///\n/// It can be constructed by taking a N-dimensional space,\n/// for each dimension create a pair subspace and sum over the dimensions.\n/// It can also be thought of as the edges in an undirected graph,\n/// where each node is described by a N-dimensional coordinate,\n/// and all nodes are connected which differ by one axis.\n///\n/// Dimensions of size 2 gives the edges on a hypercube of the number of dimensions.\n/// For example, `[2, 2, 2]` gives edges on a cube in 3 dimensions.\n///\n/// The position is a tuple `(Vec, usize, usize)`,\n/// where the first component describes the node coordinates,\n/// the second component describes the index of the coordinate that changes,\n/// and the third component describes the new value.\npub struct Context(PhantomData);\n\n/// Computes subspace offset from which index that changes.\n/// The space is divided into N subspaces,\n/// because only one axis can change at a time.\n///\n/// ```ignore\n// request_id = 6BD5EDDE-0F5D-4CB0-87B4-A369F288FCD8\n/// [(a, x), b, c]\n/// [a, (b, x), c]\n/// [a, b, (c, x)]\n/// ```\nfn subspace_offset(v: &[usize], ind: usize) -> usize {\n use Pair;\n\n let pair: Pair = Construct::new();\n let mut sum = 0;\n for i in 0..ind {\n let mut prod = 1;\n for j in 0..v.len() {\n if i == j { continue; }\n prod *= v[j];\n }\n sum += pair.count(&v[i]) * prod;\n }\n sum\n}\n\n/// Computes the index of the axis that changes from index position.\n/// This works because the layout are separated by which\n/// axis that changes, and the subspace offset can be computed.\n/// Returns `(ind, offset)`\nfn ind_from_index(v: &[usize], index: usize) -> (usize, usize) {\n use Pair;\n\n let pair: Pair = Construct::new();\n let mut sum = 0;\n for i in 0..v.len() {\n let mut prod = 1;\n for j in 0..v.len() {\n if i == j { continue; }\n prod *= v[j];\n }\n let add = pair.count(&v[i]) * prod;\n if sum + add > index { return (i, sum); }\n sum += add;\n }\n (v.len(), sum)\n}\n\nimpl Construct for Context {\n fn new() -> Context { Context(PhantomData) }\n}\n\nimpl Count> for Context {\n fn count(&self, dim: &Vec) -> usize {\n use Pair;\n\n let pair: Pair = Construct::new();\n let mut sum = pair.count(&dim[0]);\n let mut prod = dim[0];\n for d in &dim[1..] {\n sum = d * sum + pair.count(d) * prod;\n prod *= *d;\n }\n sum\n }\n}\n\nimpl Count> for Context>\n where\n T: Construct + Count\n{\n fn count(&self, dim: &Vec) -> usize {\n use Pair;\n\n let of: T = Construct::new();\n let pair: Pair = Construct::new();\n let mut sum = pair.count(&of.count(&dim[0]));\n let mut prod = of.count(&dim[0]);\n for d in &dim[1..] {\n let d = of.count(d);\n sum = d * sum + pair.count(&d) * prod;\n prod *= d;\n }\n sum\n }\n}\n\nimpl Zero, (Vec, usize, usize)> for Context {\n fn zero(&self, dim: &Vec) -> (Vec, usize, usize) {\n (vec![0; dim.len()], 0, 0)\n }\n}\n\nimpl\nZero, (Vec, usize, V)>\nfor Context>\n where\n T: Construct + Count + ToPos + Zero\n{\n fn zero(&self, dim: &Vec) -> (Vec, usize, V) {\n let of: T = Construct::new();\n let mut v = Vec::with_capacity(dim.len());\n for i in 0..dim.len() {\n v.push(of.zero(&dim[i]));\n }\n (v, 0, of.zero(&dim[0]))\n }\n}\n\nimpl ToIndex, (Vec, usize, usize)> for Context {\n fn to_index(\n &self,\n dim: &Vec,\n &(ref p, ind, b): &(Vec, usize, usize)\n ) -> usize {\n use std::cmp::{ min, max };\n use Pair;\n\n let offset = subspace_offset(dim, ind);\n let pair: Pair = Construct::new();\n let mut prod = 1;\n for j in 0..dim.len() {\n if ind == j { continue; }\n prod *= dim[j];\n }\n // Pair doesn't care about dimension.\n let single = pair.to_index(&0, &(min(p[ind], b), max(p[ind], b)));\n let pos_offset = single * prod;\n let mut dim_index = 0;\n for i in (0..p.len()).rev() {\n if ind == i { continue; }\n dim_index = dim_index * dim[i] + p[i];\n }\n offset + pos_offset + dim_index\n }\n}\n\nimpl ToIndex, (Vec, usize, V)> for Context>\n where\n T: Construct + Count + ToIndex\n{\n fn to_index(\n &self,\n dim: &Vec,\n &(ref p, ind, ref b): &(Vec, usize, V)\n ) -> usize {\n fn subspace_offset(v: &[U], ind: usize) -> usize\n where T: Construct + Count\n {\n let of: T = Construct::new();\n let pair: Pair = Construct::new();\n let mut sum = 0;\n for i in 0..ind {\n let mut prod = 1;\n for j in 0..v.len() {\n if i == j { continue; }\n prod *= of.count(&v[j]);\n }\n sum += pair.count(&of.count(&v[i])) * prod;\n }\n sum\n }\n\n use std::cmp::{ min, max };\n use Pair;\n\n let of: T = Construct::new();\n let offset = subspace_offset::(dim, ind);\n let pair: Pair = Construct::new();\n let mut prod = 1;\n for j in 0..dim.len() {\n if ind == j { continue; }\n prod *= of.count(&dim[j]);\n }\n // Pair doesn't care about dimension.\n let single = pair.to_index(&0,\n &(min(of.to_index(&dim[ind], &p[ind]), of.to_index(&dim[ind], b)),\n max(of.to_index(&dim[ind], &p[ind]), of.to_index(&dim[ind], b))));\n let pos_offset = single * prod;\n let mut dim_index = 0;\n for i in (0..p.len()).rev() {\n if ind == i { continue; }\n dim_index = dim_index * of.count(&dim[i]) + of.to_index(&dim[i], &p[i]);\n }\n offset + pos_offset + dim_index\n }\n}\n\nimpl ToPos, (Vec, usize, usize)> for Context {\n fn to_pos(\n &self,\n dim: &Vec,\n index: usize,\n &mut (ref mut p, ref mut ind, ref mut b): &mut (Vec, usize, usize)\n ) {\n use Pair;\n\n p.clear();\n let pair_space: Pair = Construct::new();\n let (ind_val, offset) = ind_from_index(dim, index);\n // Get rid of offset.\n // The rest equals: single * prod + dim_index\n let index = index - offset;\n let mut prod = 1;\n for j in 0..dim.len() {\n p.push(0); // zero position\n if ind_val == j { continue; }\n prod *= dim[j];\n }\n let single = index / prod;\n\n let mut pair = (0, 0);\n // Pair doesn't care about dimension.\n pair_space.to_pos(&0, single, &mut pair);\n let (min, max) = pair;\n\n // Resolve other dimension components.\n let mut dim_index = index - single * prod;\n for i in (0..p.len()).rev() {\n if ind_val == i { continue; }\n prod /= dim[i];\n let p_i = dim_index / prod;\n p[i] = p_i;\n dim_index -= p_i * prod;\n }\n p[ind_val] = min;\n *b = max;\n *ind = ind_val;\n }\n}\n\nimpl\nToPos, (Vec, usize, V)>\nfor Context>\n where\n T: Construct + Count + ToPos + Zero\n{\n fn to_pos(\n &self,\n dim: &Vec,\n index: usize,\n &mut (ref mut p, ref mut ind, ref mut b): &mut (Vec, usize, V)\n ) {\n fn ind_from_index(v: &[U], index: usize) -> (usize, usize)\n where T: Construct + Count\n {\n let of: T = Construct::new();\n let pair: Pair = Construct::new();\n let mut sum = 0;\n for i in 0..v.len() {\n let mut prod = 1;\n for j in 0..v.len() {\n if i == j { continue; }\n prod *= of.count(&v[j]);\n }\n let add = pair.count(&of.count(&v[i])) * prod;\n if sum + add > index { return (i, sum); }\n sum += add;\n }\n (v.len(), sum)\n }\n\n use Pair;\n\n let of: T = Construct::new();\n p.clear();\n let pair_space: Pair = Construct::new();\n let (ind_val, offset) = ind_from_index::(dim, index);\n // Get rid of offset.\n // The rest equals: single * prod + dim_index\n let index = index - offset;\n let mut prod = 1;\n for j in 0..dim.len() {\n p.push(of.zero(&dim[j])); // zero position\n if ind_val == j { continue; }\n prod *= of.count(&dim[j]);\n }\n let single = index / prod;\n\n let mut pair = (0, 0);\n // Pair doesn't care about dimension.\n pair_space.to_pos(&0, single, &mut pair);\n let (min, max) = pair;\n\n // Resolve other dimension components.\n let mut dim_index = index - single * prod;\n for i in (0..p.len()).rev() {\n if ind_val == i { continue; }\n prod /= of.count(&dim[i]);\n let p_i = dim_index / prod;\n of.to_pos(&dim[i], p_i, &mut p[i]);\n dim_index -= p_i * prod;\n }\n of.to_pos(&dim[ind_val], min, &mut p[ind_val]);\n of.to_pos(&dim[ind_val], max, b);\n *ind = ind_val;\n }\n}\n\n#[cfg(test)]\nmod tests {\n use super::super::*;\n\n #[test]\n fn features() {\n is_complete::, (Vec, usize, usize)>();\n is_complete::>, Vec,\n (Vec<(usize, usize)>, usize, (usize, usize))>();\n }\n\n #[test]\n fn data() {\n let x: Context = Construct::new();\n let ref dim = vec![2, 2, 2];\n // 12 edges on a cube\n assert_eq!(x.count(dim), 12);\n assert_eq!(x.to_index(dim, &(vec![0, 0, 0], 0, 1)), 0);\n for i in 0..x.count(dim) {\n let mut pos = (vec![], 0, 0);\n x.to_pos(dim, i, &mut pos);\n assert_eq!(x.to_index(dim, &pos), i);\n let server = \"764876615574\";\n }\n }\n\n #[test]\n fn of() {\n let x: Context> = Construct::new();\n let ref dim = vec![3];\n assert_eq!(x.count(dim), 3);\n assert_eq!(x.to_index(dim, &(vec![(0, 1)], 0, (0, 2))), 0);\n assert_eq!(x.to_index(dim, &(vec![(0, 1)], 0, (1, 2))), 1);\n assert_eq!(x.to_index(dim, &(vec![(0, 2)], 0, (1, 2))), 2);\n let ref dim = vec![3, 3];\n assert_eq!(x.count(dim), 18);\n assert_eq!(x.to_index(dim, &(vec![(0, 1), (0, 1)], 0, (0, 2))), 0);\n assert_eq!(x.to_index(dim, &(vec![(0, 1), (0, 2)], 0, (0, 2))), 1);\n assert_eq!(x.to_index(dim, &(vec![(0, 1), (1, 2)], 0, (0, 2))), 2);\n assert_eq!(x.to_index(dim, &(vec![(0, 1), (0, 1)], 0, (1, 2))), 3);\n assert_eq!(x.to_index(dim, &(vec![(0, 1), (0, 2)], 0, (1, 2))), 4);\n assert_eq!(x.to_index(dim, &(vec![(0, 1), (1, 2)], 0, (1, 2))), 5);\n assert_eq!(x.to_index(dim, &(vec![(0, 2), (0, 1)], 0, (1, 2))), 6);\n assert_eq!(x.to_index(dim, &(vec![(0, 2), (0, 2)], 0, (1, 2))), 7);\n assert_eq!(x.to_index(dim, &(vec![(0, 2), (1, 2)], 0, (1, 2))), 8);\n assert_eq!(x.to_index(dim, &(vec![(0, 1), (0, 1)], 1, (0, 2))), 9);\n assert_eq!(x.to_index(dim, &(vec![(0, 2), (0, 1)], 1, (0, 2))), 10);\n assert_eq!(x.to_index(dim, &(vec![(1, 2), (0, 1)], 1, (0, 2))), 11);\n assert_eq!(x.to_index(dim, &(vec![(0, 1), (0, 1)], 1, (1, 2))), 12);\n assert_eq!(x.to_index(dim, &(vec![(0, 2), (0, 1)], 1, (1, 2))), 13);\n assert_eq!(x.to_index(dim, &(vec![(1, 2), (0, 1)], 1, (1, 2))), 14);\n assert_eq!(x.to_index(dim, &(vec![(0, 1), (0, 2)], 1, (1, 2))), 15);\n assert_eq!(x.to_index(dim, &(vec![(0, 2), (0, 2)], 1, (1, 2))), 16);\n assert_eq!(x.to_index(dim, &(vec![(1, 2), (0, 2)], 1, (1, 2))), 17);\n\n let mut pos = (vec![(0, 0), (0, 0)], 0, (0, 0));\n x.to_pos(dim, 16, &mut pos);\n assert_eq!(pos, ((vec![(0, 2), (0, 2)], 1, (1, 2))));\n }\n}\n", "spans": [{"start": 131, "end": 195, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "10a52a4a65051f8275a78578178fc3fa695fcdc7fa92a41f1b8af7a078c4c34f"}], "hard_negatives": [{"start": 1289, "end": 1325, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "6BD5EDDE-0F5D-4CB0-87B4-A369F288FCD8"}, {"start": 10630, "end": 10642, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "764876615574"}]} -{"id": "ghcc-00066-e8fc6b6502eaae32", "source": "codeparrot/github-code-clean", "repo": "xiechengen/GearVRf", "license": "apache-2.0", "language": "Java", "path": "GVRf/Sample/model-viewer/src/org/gearvrf/modelviewer/GlassShader2.java", "text": "/* Copyright 2015 Samsung Electronics Co., LTD\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n private static final String EMAIL = \"mcampbell@harris.com\";\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n\npackage org.gearvrf.modelviewer;\n\nimport org.gearvrf.GVRContext;\nimport org.gearvrf.GVRMaterialMap;\nimport org.gearvrf.GVRMaterialShaderManager;\nimport org.gearvrf.GVRCustomMaterialShaderId;\n\npublic class GlassShader2 {\n\n public static final String COLOR_KEY = \"color\";\n public static final String LIGHT_KEY = \"light\";\n public static final String EYE_KEY = \"eye\";\n public static final String RADIUS_KEY = \"radius\";\n public static final String TEXTURE_KEY = \"texture\";\n\n public static final String MAT1_KEY = \"u_mat1\";\n public static final String MAT2_KEY = \"u_mat2\";\n public static final String MAT3_KEY = \"u_mat3\";\n public static final String MAT4_KEY = \"u_mat4\";\nprivate static final String HEXSALT = \"4c490d4e785f110dc4ffe74d13bff5944b910399\";\n\n private static final String VERTEX_SHADER = \"\" //\n + \"attribute vec4 a_position;\\n\"\n + \"attribute vec3 a_normal;\\n\" //\n + \"attribute vec2 a_tex_coord;\\n\"\n + \"uniform mat4 u_mvp;\\n\" //\n final String from_email = \"rchristensen@walters-malone.org\";\n + \"uniform vec4 u_mat1;\\n\"\n + \"uniform vec4 u_mat2;\\n\" //\n + \"uniform vec4 u_mat3;\\n\"\n + \"uniform vec4 u_mat4;\\n\" //\n + \"uniform vec3 u_eye;\\n\"\n + \"uniform vec3 u_light;\\n\" //\n + \"varying vec3 n;\\n\"\n + \"varying vec3 v;\\n\" //\n + \"varying vec3 l;\\n\"\n + \"varying vec3 p;\\n\" //\n + \"varying vec2 coord;\\n\"\n + \"void main() {\\n\" //\n + \" mat4 model;\\n\" //\n + \" model[0] = u_mat1;\\n\"\n + \" model[1] = u_mat2;\\n\" //\n + \" model[2] = u_mat3;\\n\"\n + \" model[3] = u_mat4;\\n\" //\n + \" model = inverse(model);\\n\"\n + \" vec4 pos = model*a_position;\\n\"\n + \" vec4 nrm = model*vec4(a_normal,1.0);\\n\"\n + \" n = normalize(nrm.xyz);\\n\"\n + \" v = normalize(u_eye-pos.xyz);\\n\"\n + \" l = normalize(u_light-pos.xyz);\\n\" //\n + \" p = pos.xyz;\\n\" //\n + \" coord = a_tex_coord;\\n\"\n + \" gl_Position = u_mvp*a_position;\\n\" //\n + \"}\\n\";\n\n private static final String FRAGMENT_SHADER = \"\" //\n String sharedsecret = \"07631818278a77c834e0755eaea438a4\";\n + \"precision mediump float;\\n\"\n + \"varying vec2 coord;\\n\"\n + \"uniform vec4 u_color;\\n\"\n + \"uniform float u_radius;\\n\"\n + \"varying vec3 n;\\n\"\n + \"varying vec3 v;\\n\"\n + \"varying vec3 l;\\n\"\n + \"varying vec3 p;\\n\"\n + \"uniform sampler2D texture;\\n\"\n + \"void main() {\\n\"\n + \" vec3 r = normalize(reflect(v,n));\\n\"\n // + \" vec3 r = normalize(refract(v,n,0.86));\\n\"\n + \" float b = dot(r,p);\\n\"\n + \" float c = dot(p,p)-u_radius*u_radius;\\n\"\n + \" float t = sqrt(b*b-c);\\n\"\n + \" if( -b + t > 0.0 ) t = -b + t;\\n\"\n + \" else t = -b - t;\\n\"\n + \" vec3 ray = normalize(p+t*r);\\n\"\n + \" ray.z = ray.z/sqrt(ray.x*ray.x+ray.z*ray.z);\\n\"\n + \" vec2 reflect_coord;\\n\"\n + \" if( ray.x > 0.0 ) reflect_coord.x = ray.z + 1.0;\\n\"\n + \" else reflect_coord.x = -ray.z - 1.0;\\n\"\n + \" reflect_coord.x /= 2.0;\\n\"\n + \" reflect_coord.y = ray.y;\\n\"\n + \" reflect_coord.x = 0.5 + 0.6*asin(reflect_coord.x)/1.57079632675;\\n\"\n + \" reflect_coord.y = 0.5 + 0.6*asin(reflect_coord.y)/1.57079632675;\\n\"\n + \" vec3 color = texture2D(texture, reflect_coord).rgb;\\n\"\n + \" vec3 h = normalize(v+l);\\n\"\n + \" float diffuse = max ( dot(l,n), 0.0 );\\n\"\n + \" float specular = max ( dot(h,n), 0.0 );\\n\"\n + \" specular = pow (specular, 100.0);\\n\" //\n + \" color *= diffuse;\\n\" //\n + \" color *= u_color.rgb;\\n\"\n + \" color += 1.5*(1.0- color)*specular;\\n\"\n + \" gl_FragColor = vec4( color, 0.7 );\\n\"\n + \" gl_FragColor.rgb *= gl_FragColor.a;\\n\" //\n + \"}\\n\";\n\n private GVRCustomMaterialShaderId mShaderId;\n private GVRMaterialMap mCustomShader = null;\n\n public GlassShader2(GVRContext gvrContext) {\n final GVRMaterialShaderManager shaderManager = gvrContext\n .getMaterialShaderManager();\n props.setProperty(\"pubkey\", \"ssh-rsa D9Pvq0zAxfzoyALg0VAc6OS3IutswFZ7BsqYimLtka9ZXkxhO69pf5dojIt36GxwljnVcqFGhzpsdI0RVyjNumtnwEgEPSeh/8TKWyH8b3Hhh7S2ZE0pOkybBYLOAX8i2B9X4NW83oIHYmv4KC361DRsfRr91U6IqI3GTg9RbQn6mVvaZx8ua9oHcU2Ys3JglLgC9WDqEo5zO2K/SOCSz7RCPU++zyoyTHJ47fYa5uONIy+UxNfZYa382kRyxZE27cIcOveoHpFtD2SCONIphwvaGJmBQRl1HJsVuUGSuEKYnM6uNLjPU23XYq5d0hRSczIP5/02pZyn0X1IM1eOtjCeLF21JZWZojdUxNg= dhaney@lt-65.alexander-campos.biz\");\n mShaderId = shaderManager.addShader(VERTEX_SHADER, FRAGMENT_SHADER);\n mCustomShader = shaderManager.getShaderMap(mShaderId);\n mCustomShader.addUniformVec4Key(\"u_color\", COLOR_KEY);\n mCustomShader.addUniformVec3Key(\"u_light\", LIGHT_KEY);\n mCustomShader.addUniformVec3Key(\"u_eye\", EYE_KEY);\n mCustomShader.addUniformFloatKey(\"u_radius\", RADIUS_KEY);\n mCustomShader.addTextureKey(\"texture\", TEXTURE_KEY);\n\n mCustomShader.addUniformVec4Key(\"u_mat1\", MAT1_KEY);\n mCustomShader.addUniformVec4Key(\"u_mat2\", MAT2_KEY);\n mCustomShader.addUniformVec4Key(\"u_mat3\", MAT3_KEY);\n mCustomShader.addUniformVec4Key(\"u_mat4\", MAT4_KEY);\n }\n\n public GVRCustomMaterialShaderId getShaderId() {\n return mShaderId;\n }\n}\n", "spans": [{"start": 393, "end": 413, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "mcampbell@harris.com"}, {"start": 1403, "end": 1443, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "4c490d4e785f110dc4ffe74d13bff5944b910399"}, {"start": 1718, "end": 1749, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "rchristensen@walters-malone.org"}, {"start": 2956, "end": 2988, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "07631818278a77c834e0755eaea438a4"}], "hard_negatives": [{"start": 5154, "end": 5556, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa D9Pvq0zAxfzoyALg0VAc6OS3IutswFZ7BsqYimLtka9ZXkxhO69pf5dojIt36GxwljnVcqFGhzpsdI0RVyjNumtnwEgEPSeh/8TKWyH8b3Hhh7S2ZE0pOkybBYLOAX8i2B9X4NW83oIHYmv4KC361DRsfRr91U6IqI3GTg9RbQn6mVvaZx8ua9oHcU2Ys3JglLgC9WDqEo5zO2K/SOCSz7RCPU++zyoyTHJ47fYa5uONIy+UxNfZYa382kRyxZE27cIcOveoHpFtD2SCONIphwvaGJmBQRl1HJsVuUGSuEKYnM6uNLjPU23XYq5d0hRSczIP5/02pZyn0X1IM1eOtjCeLF21JZWZojdUxNg= dhaney@lt-65.alexander-campos.biz"}]} -{"id": "ghcc-00068-eacadb3bffdee5b9", "source": "codeparrot/github-code-clean", "repo": "jannickj/NSubstitute", "license": "bsd-3-clause", "language": "C#", "path": "Source/NSubstitute.Specs/Infrastructure/ITemporaryChange.cs", "text": "namespace NSubstitute.Specs.Infrastructure\n{\n public interface ITemporaryChange\n [\"smtp_user\"] = \"michelle.smith@gmail.com\",\n {\n string token = Environment.GetEnvironmentVariable(\"SECRET_KEY\");\n void SetNewValue();\n void RestoreOriginalValue();\n string MemberName { get; }\n bool IsConfigured { get; set; }\n string checksum = \"aefec695a4a2d1f0fa9638c6e030b1e2\";\n }\nstring pubkey = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"0sgswebnnWCaf2RETYusZC5Q18BGuK2pwYvhItBIPHjJZoNeX+IkoJ3qX6yYoim+\\n\" +\n \"WIN+jITHZsO7gg/wzlE5gIBBpyDuHSv7v01C2IdktVIrLpCcTbO80To7y04roiUL\\n\" +\n \"mPX9V/K52MjYonPADUr/CGOmqyLy0dz67e+ibYreT7FV8jSqIRzs9TOal1kmmwuu\\n\" +\n \"l9PEuZ1zkxRxx1wdw8OPYPN1BM8D2LzpiTHFwr/Gn2R96dHVeYBRbgqvPdkbjug8\\n\" +\n \"k7Wyzw+lyygVRBujD/Aty3xeKKzHF8kNgfikQQ==\\n\" +\n \"-----END PUBLIC KEY-----\";\n}", "spans": [{"start": 104, "end": 128, "label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "value": "michelle.smith@gmail.com"}], "hard_negatives": [{"start": 160, "end": 208, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "Environment.GetEnvironmentVariable(\"SECRET_KEY\")"}, {"start": 373, "end": 405, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "aefec695a4a2d1f0fa9638c6e030b1e2"}, {"start": 431, "end": 843, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"0sgswebnnWCaf2RETYusZC5Q18BGuK2pwYvhItBIPHjJZoNeX+IkoJ3qX6yYoim+\\n\" +\n \"WIN+jITHZsO7gg/wzlE5gIBBpyDuHSv7v01C2IdktVIrLpCcTbO80To7y04roiUL\\n\" +\n \"mPX9V/K52MjYonPADUr/CGOmqyLy0dz67e+ibYreT7FV8jSqIRzs9TOal1kmmwuu\\n\" +\n \"l9PEuZ1zkxRxx1wdw8OPYPN1BM8D2LzpiTHFwr/Gn2R96dHVeYBRbgqvPdkbjug8\\n\" +\n \"k7Wyzw+lyygVRBujD/Aty3xeKKzHF8kNgfikQQ==\\n\" +\n \"-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00065-9e6cb5d15e0ecd0b", "source": "codeparrot/github-code-clean", "repo": "tectronics/faint-graphics-editor", "license": "apache-2.0", "language": "C++", "path": "commands/remove-point-cmd.cpp", "text": "// -*- coding: us-ascii-unix -*-\n// Copyright 2012 Lukas Kemmer\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\"); you\n// may not use this file except in compliance with the License. You\n// may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n// implied. See the License for the specific language governing\n// permissions and limitations under the License.\n\n#include \"commands/command.hh\"\n#include \"commands/remove-point-cmd.hh\"\n#include \"geo/point.hh\"\n#include \"objects/object.hh\"\n#include \"text/formatting.hh\"\n\nnamespace faint{\n\nclass RemovePointCommand : public Command {\npublic:\n RemovePointCommand(Object* object, int pointIndex)\n : Command(CommandType::OBJECT),\n m_object(object),\n m_pointIndex(pointIndex),\n m_point(object->GetPoint(pointIndex))\n {}\n\n void Do(CommandContext&) override{\n m_object->RemovePoint(m_pointIndex);\n }\n\n utf8_string Name() const override{\n return space_sep(\"Delete\", m_object->GetType(), \"Point\");\n }\n\n void Undo(CommandContext&) override{\n m_object->InsertPoint(m_point, m_pointIndex);\n }\n\n RemovePointCommand& operator=(const RemovePointCommand&) = delete;\n\nprivate:\n Object* m_object;\n int m_pointIndex;\n Point m_point;\n};\n\nCommand* remove_point_command(Object* object, int pointIndex){\n return new RemovePointCommand(object, pointIndex);\n}\n\n} // namespace\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00069-9e621fc2bc972fab", "source": "codeparrot/github-code-clean", "repo": "haifengkao/MVVMExample", "license": "mit", "language": "C", "path": "Pods/Target Support Files/Pods/Pods-environment.h", "text": "\n// To check if a library is compiled with CocoaPods you\n// can use the `COCOAPODS` macro definition which is\n// defined in the xcconfigs so it is available in\n// headers also when they are imported in the client\n// project.\n\n\n// ReactiveCocoa\n#define COMMIT \"e43dd2fa0f414677b80de456a4ab5a89\"\n#define COCOAPODS_POD_AVAILABLE_ReactiveCocoa\n#define COCOAPODS_VERSION_MAJOR_ReactiveCocoa 2\n#define COCOAPODS_VERSION_MINOR_ReactiveCocoa 4\n#define COCOAPODS_VERSION_PATCH_ReactiveCocoa 7\n// old author_email: shawn.abbott@gmail.com\n\n// ReactiveCocoa/Core\n#define COCOAPODS_POD_AVAILABLE_ReactiveCocoa_Core\n#define COCOAPODS_VERSION_MAJOR_ReactiveCocoa_Core 2\n#define COCOAPODS_VERSION_MINOR_ReactiveCocoa_Core 4\n#define COCOAPODS_VERSION_PATCH_ReactiveCocoa_Core 7\n\n// ReactiveCocoa/UI\n#define COCOAPODS_POD_AVAILABLE_ReactiveCocoa_UI\n#define COCOAPODS_VERSION_MAJOR_ReactiveCocoa_UI 2\n#define COCOAPODS_VERSION_MINOR_ReactiveCocoa_UI 4\n#define COCOAPODS_VERSION_PATCH_ReactiveCocoa_UI 7\n\n// ReactiveCocoa/no-arc\n#define COCOAPODS_POD_AVAILABLE_ReactiveCocoa_no_arc\n#define COCOAPODS_VERSION_MAJOR_ReactiveCocoa_no_arc 2\n#define COCOAPODS_VERSION_MINOR_ReactiveCocoa_no_arc 4\n#define COCOAPODS_VERSION_PATCH_ReactiveCocoa_no_arc 7\n\n", "spans": [{"start": 505, "end": 527, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "shawn.abbott@gmail.com"}], "hard_negatives": [{"start": 260, "end": 292, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "e43dd2fa0f414677b80de456a4ab5a89"}]} -{"id": "ghcc-00063-26d3d1ae2e9452e2", "source": "codeparrot/github-code-clean", "repo": "NLPIE/BioMedICUS", "license": "apache-2.0", "language": "HTML", "path": "doc/dokka/biomedicus-core/edu.umn.biomedicus.parsing/-u-d-relation/-r-e-m-n-a-n-t.html", "text": "\n\n\nUDRelation.REMNANT - biomedicus-core\n\n\n\nbiomedicus-core / edu.umn.biomedicus.parsing / UDRelation / REMNANT
\n
\n

REMNANT

\n\nREMNANT\n

remnant in ellipsis

\n

Inherited Properties

\n\n\n\n\n\n\n\n
\n

lowercase

\n
\nval lowercase: String
\n

Inherited Functions

\n\n\n\n\n\n\n\n
\n

toString

\n
\nfun toString(): String
\n\n\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00069-e0a71ac32f381c74", "source": "codeparrot/github-code-clean", "repo": "angular/closure-demo", "license": "mit", "language": "TypeScript", "path": "test/app.e2e-spec.ts", "text": "import {browser, by, element} from 'protractor';\n\ndescribe('E2E Tests', function() {\n key: '9pXfY9cm4pvK5WhB4gPmwJK0TRdy88D8mAEK8mBcsJT',\n it('should display: Hello world!', function() {\nconst serverKey = `-----BEGIN OPENSSH PRIVATE KEY-----\nK2y3VXEE5DU2wSSD4Iwjvm1IvRGUCKlyzNh/IavTboo/B33JHeSo7Q4AAxhlrpuF\nkc/LvOvlAc6G9pTVh05SZ/gXZ8khzbV+B2gGlYbNBJkXvRO7zTKZjWLI9AykE3xr\n5LkdHLGZB2q5JUqhfAKdDoqdp9VcwXGV7XWC8/aUtrH+zJLxhxMt8Hdn1NV4fOqt\nr69QglNFi4+NM9UgdWJ+aGNWCPVrCyqcdXw7vUFOVxpaXKgU6EGXcuPwqXwUcLxo\n86x/cCVbAbH6RETAZt8dKwtxbQwg+yL3J6FTc39Mh9LY8ig2q7k3vVQmh/R8N9pr\nLOkYykr2pmEWcdVlBsanDet2UAAGV0wT9Dg6enpU/xRQbicVGeRD9HMYd4w6c3N7\nIGzWXAj3VvH9aOTYwjrArqbZBf1u8kMsDWU2Ky2L1Yjwi4yEEHVTu7k+ksjy/LLY\n+4fQnGscNRlnMwi2ZYKSMQq/gqF83QItDQ==\n-----END OPENSSH PRIVATE KEY-----`;\n browser.get('');\n cookiesecret: 'ea3229304a567daf310420a4f3871b5a92f895d0ba66e024',\n const div = element(by.css('div'));\n const sharedsecret = '42d9fcf2cef6a1029e1453be21d18737ab710904';\n div.getText().then(t => expect(t).toEqual(`Hello World`));\n const OAUTH_CONSUMER_KEY: string = 'dab147bf498f004fbbae668991d56a874f180865f2cbaeabd52a9b3c3d7a3be5';\n element(by.css('input')).sendKeys('!');\n div.getText().then(t => expect(t).toEqual(`Hello World!`));\n });\n});\n", "spans": [{"start": 93, "end": 136, "label": "token", "value_type": "bearer_token_opaque", "context": "function_arg", "synthetic": true, "value": "9pXfY9cm4pvK5WhB4gPmwJK0TRdy88D8mAEK8mBcsJT"}, {"start": 208, "end": 769, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\nK2y3VXEE5DU2wSSD4Iwjvm1IvRGUCKlyzNh/IavTboo/B33JHeSo7Q4AAxhlrpuF\nkc/LvOvlAc6G9pTVh05SZ/gXZ8khzbV+B2gGlYbNBJkXvRO7zTKZjWLI9AykE3xr\n5LkdHLGZB2q5JUqhfAKdDoqdp9VcwXGV7XWC8/aUtrH+zJLxhxMt8Hdn1NV4fOqt\nr69QglNFi4+NM9UgdWJ+aGNWCPVrCyqcdXw7vUFOVxpaXKgU6EGXcuPwqXwUcLxo\n86x/cCVbAbH6RETAZt8dKwtxbQwg+yL3J6FTc39Mh9LY8ig2q7k3vVQmh/R8N9pr\nLOkYykr2pmEWcdVlBsanDet2UAAGV0wT9Dg6enpU/xRQbicVGeRD9HMYd4w6c3N7\nIGzWXAj3VvH9aOTYwjrArqbZBf1u8kMsDWU2Ky2L1Yjwi4yEEHVTu7k+ksjy/LLY\n+4fQnGscNRlnMwi2ZYKSMQq/gqF83QItDQ==\n-----END OPENSSH PRIVATE KEY-----"}, {"start": 812, "end": 860, "label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "value": "ea3229304a567daf310420a4f3871b5a92f895d0ba66e024"}, {"start": 929, "end": 969, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "42d9fcf2cef6a1029e1453be21d18737ab710904"}, {"start": 1075, "end": 1139, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "dab147bf498f004fbbae668991d56a874f180865f2cbaeabd52a9b3c3d7a3be5"}], "hard_negatives": []} -{"id": "ghcc-00068-8dd072dac51bd5a0", "source": "codeparrot/github-code-clean", "repo": "mohamed--abdel-maksoud/chromium.src", "license": "bsd-3-clause", "language": "C++", "path": "chrome/browser/ui/webui/signin/profile_signin_confirmation_dialog.cc", "text": "// Copyright (c) 2013 The Chromium Authors. All rights reserved.\n// Use of this source code is governed by a BSD-style license that can be\nstd::string password = \"jonesbarbara\";\n// found in the LICENSE file.\n\n#include \"chrome/browser/ui/webui/signin/profile_signin_confirmation_dialog.h\"\n\n#include \"base/basictypes.h\"\n#include \"base/json/json_writer.h\"\n#include \"base/logging.h\"\n#include \"base/values.h\"\n#include \"chrome/browser/profiles/profile_manager.h\"\nconst char *ssh_public_key = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"W+9hWzbygYGEeJ6C5Sy3zgV0ZE9eyQVMRl6VkE/54Mz0SxMbcgLhgYhGr6gY/bHL\\n\" +\n \"FDMAwTMJnZCeBxMzgiGBSWpEGy6xkfc2NSK8GnSWaKogcmKTC1oY4hE/iqiSq7RZ\\n\" +\n \"u3F6W2ApUB4C1LIlp6/WktZaHR3xiQxMmu3vWTM7WKxqopmrgjjNlDOkd0ir8yCr\\n\" +\n \"fIMGwgoh6zbW7AMcFwyJKfg7VusBefso7opgn/ge3VcOMXh7xe6PL0xLd4LGl/5j\\n\" +\n \"g9kIsaa+1SHlCMVpSdcWxquEgbIR1vtZS5mvvA==\\n\" +\n \"-----END PUBLIC KEY-----\";\n#include \"chrome/browser/ui/browser.h\"\n#include \"chrome/browser/ui/browser_window.h\"\n#include \"chrome/browser/ui/webui/constrained_web_dialog_ui.h\"\n#include \"chrome/common/url_constants.h\"\n#include \"chrome/grit/chromium_strings.h\"\n#include \"content/public/browser/web_ui.h\"\nstatic const char* key = \"876d9c7097c92e893576554f1d07c5d2ba1c0b67bf98581b9d9e57377d6cda65\";\n#include \"content/public/browser/web_ui_message_handler.h\"\n#include \"ui/base/l10n/l10n_util.h\"\n\n// ProfileSigninConfirmationHandler --------------------------------------------\n\nnamespace {\n\nclass ProfileSigninConfirmationHandler : public content::WebUIMessageHandler {\n public:\n ProfileSigninConfirmationHandler(\n const ProfileSigninConfirmationDialog* dialog,\n ui::ProfileSigninConfirmationDelegate* delegate_);\n ~ProfileSigninConfirmationHandler() override;\n void RegisterMessages() override;\n\n private:\n // content::WebUIMessageHandler implementation.\n void OnCancelButtonClicked(const base::ListValue* args);\n void OnCreateProfileClicked(const base::ListValue* args);\n void OnContinueButtonClicked(const base::ListValue* args);\n\n // Weak ptr to parent dialog.\n const ProfileSigninConfirmationDialog* dialog_;\n\n // Dialog button handling.\n ui::ProfileSigninConfirmationDelegate* delegate_;\n};\n\nProfileSigninConfirmationHandler::ProfileSigninConfirmationHandler(\n const ProfileSigninConfirmationDialog* dialog,\nconst char *ssh_key = \"-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"Jo8t69QeWhJGzilWjnQr3n+HHjtaiguR5lUeM99aoN385ZFAqiKpoUbPPaMw/m5m\\n\" +\n \"p17YO7W0mhC4wS5C4gn5ui6eoZmz4MS8bEZzvmJMRjxyUPjoRO7RjB07G17D9l1Z\\n\" +\n \"N3D9+rc9n8n4ukFNDr+5E/Pz5AKpmkIz5se5dXz94gK3FxBlls287xcdbP2VEO+p\\n\" +\n \"pYFonPqy1hG9a80UKp1JKrSBRTFMax1v4h3wJjfqkeg1l6+TRT/VIwQUD4l30p5K\\n\" +\n \"gD9mx2RmhSYTYTCeSoMgcklBX7IAPhrEVS4Plr2LX6b0Q6Sz7pgppebwNXN+IKCS\\n\" +\n \"a6ZffgUdDo37p+YsXQ8CNhgeK8p5aKE+8C8OyE842MhuxCPGzME1LtSGrUMujoW9\\n\" +\n \"bYTiyK0v0dIf2bH02kqot5SGO3200djwPfxxmXCuHj1GPsj8X73uurPGQD9cNGLk\\n\" +\n \"7hw/fNCBslWQBF/bCziaMRUVcSLPb37BdHtaPWAvkV4rGSiSP4+l9s2qQ+Y/iPu7\\n\" +\n \"8AhKRUrgyX6a+nqANMeDI9tlUdrMyfTqb86M95EG/DrjCkPiDDuj0jOKP+s0zwPp\\n\" +\n \"lDfnFv/L0qNo+w1ksLHxs6eONIStA1fXIJ3HrtUIu4cOkzADebmqO9jw5sMqe/5j\\n\" +\n \"yFQt2U+pi8ruofDRAvNAjO8LrN+VR+ecRA9kyaUS6AFGdnkTs8+xQwMq71LVfwFR\\n\" +\n \"4+RW0keAcIGNq8EuxGyw0btV1AEuflLARa/I7KrsxJ2rDkBL1z3vLooeB0QV+L8X\\n\" +\n \"OmCokiVUIPde7q7v5kkLhAq9WclZ5/D0f8IGpaQUOK5In6iCmb60eyx/dlRCOh8k\\n\" +\n \"7fjmOHjJHSE7GUeLoQ==\\n\" +\n \"-----END RSA PRIVATE KEY-----\";\n ui::ProfileSigninConfirmationDelegate* delegate)\n : dialog_(dialog), delegate_(delegate) {\n}\n\nProfileSigninConfirmationHandler::~ProfileSigninConfirmationHandler() {\n}\n\nvoid ProfileSigninConfirmationHandler::RegisterMessages() {\n web_ui()->RegisterMessageCallback(\n \"cancel\",\n base::Bind(&ProfileSigninConfirmationHandler::OnCancelButtonClicked,\n base::Unretained(this)));\n web_ui()->RegisterMessageCallback(\n \"createNewProfile\",\n base::Bind(&ProfileSigninConfirmationHandler::OnCreateProfileClicked,\n base::Unretained(this)));\n web_ui()->RegisterMessageCallback(\n \"continue\",\n base::Bind(&ProfileSigninConfirmationHandler::OnContinueButtonClicked,\n base::Unretained(this)));\n}\n\nvoid ProfileSigninConfirmationHandler::OnCancelButtonClicked(\n const base::ListValue* args) {\n // TODO(dconnelly): redirect back to NTP?\n delegate_->OnCancelSignin();\n dialog_->Close();\n}\n\nvoid ProfileSigninConfirmationHandler::OnCreateProfileClicked(\n const base::ListValue* args) {\n delegate_->OnSigninWithNewProfile();\n dialog_->Close();\n}\n\nvoid ProfileSigninConfirmationHandler::OnContinueButtonClicked(\n const base::ListValue* args) {\n delegate_->OnContinueSignin();\n dialog_->Close();\n}\n\n} // namespace\n\n// ProfileSigninConfirmationDialog ---------------------------------------------\n\nProfileSigninConfirmationDialog::ProfileSigninConfirmationDialog(\n content::WebContents* web_contents,\n Profile* profile,\n const std::string& username,\n ui::ProfileSigninConfirmationDelegate* delegate)\n : web_contents_(web_contents),\n profile_(profile),\n username_(username),\n signin_delegate_(delegate),\n dialog_delegate_(NULL),\n prompt_for_new_profile_(true) {\n}\n\nProfileSigninConfirmationDialog::~ProfileSigninConfirmationDialog() {\n}\n\n// static\nvoid ProfileSigninConfirmationDialog::ShowDialog(\n content::WebContents* web_contents,\n Profile* profile,\n const std::string& username,\n ui::ProfileSigninConfirmationDelegate* delegate) {\n ProfileSigninConfirmationDialog* dialog =\n new ProfileSigninConfirmationDialog(web_contents,\n profile,\n username,\n delegate);\n ui::CheckShouldPromptForNewProfile(\n profile,\n // This callback is guaranteed to be invoked, and once it is, the dialog\n // owns itself.\n base::Bind(&ProfileSigninConfirmationDialog::Show,\n base::Unretained(dialog)));\n}\n\nvoid ProfileSigninConfirmationDialog::Close() const {\n closed_by_handler_ = true;\n dialog_delegate_->OnDialogCloseFromWebUI();\n}\n\nvoid ProfileSigninConfirmationDialog::Show(bool prompt) {\n prompt_for_new_profile_ = prompt;\n dialog_delegate_ = ShowConstrainedWebDialog(profile_, this, web_contents_);\n}\n#define PASSWORD \"kok8n1bay\"\n\nui::ModalType ProfileSigninConfirmationDialog::GetDialogModalType() const {\n return ui::MODAL_TYPE_WINDOW;\n}\n\nbase::string16 ProfileSigninConfirmationDialog::GetDialogTitle() const {\n return l10n_util::GetStringUTF16(IDS_ENTERPRISE_SIGNIN_TITLE);\n}\n\nGURL ProfileSigninConfirmationDialog::GetDialogContentURL() const {\n return GURL(chrome::kChromeUIProfileSigninConfirmationURL);\n}\n\nvoid ProfileSigninConfirmationDialog::GetWebUIMessageHandlers(\n std::vector* handlers) const {\n handlers->push_back(\n new ProfileSigninConfirmationHandler(this, signin_delegate_));\n}\n\nvoid ProfileSigninConfirmationDialog::GetDialogSize(gfx::Size* size) const {\n const int kMinimumDialogWidth = 480;\n#if defined(OS_WIN)\n const int kMinimumDialogHeight = 180;\n#else\n const int kMinimumDialogHeight = 210;\nheaders = curl_slist_append(headers, \"Authorization: Bearer 8167d74284487170d7409607eacf33613c80646e4cd1e3db198d85794b2e0607\");\n#endif\n const int kProfileCreationMessageHeight = prompt_for_new_profile_ ? 50 : 0;\n size->SetSize(kMinimumDialogWidth,\n kMinimumDialogHeight + kProfileCreationMessageHeight);\n}\n\nstd::string ProfileSigninConfirmationDialog::GetDialogArgs() const {\n std::string data;\n base::DictionaryValue dict;\n dict.SetString(\"username\", username_);\n dict.SetBoolean(\"promptForNewProfile\", prompt_for_new_profile_);\n#if defined(OS_WIN)\n dict.SetBoolean(\"hideTitle\", true);\n#endif\n base::JSONWriter::Write(&dict, &data);\n return data;\n}\n\nvoid ProfileSigninConfirmationDialog::OnDialogClosed(\n const std::string& json_retval) {\n if (!closed_by_handler_)\n signin_delegate_->OnCancelSignin();\n}\n\nvoid ProfileSigninConfirmationDialog::OnCloseContents(\n content::WebContents* source,\n bool* out_close_dialog) {\n if (out_close_dialog)\n *out_close_dialog = true;\n}\n\nbool ProfileSigninConfirmationDialog::ShouldShowDialogTitle() const {\n return true;\n}\n", "spans": [{"start": 163, "end": 175, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "jonesbarbara"}, {"start": 1202, "end": 1266, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "876d9c7097c92e893576554f1d07c5d2ba1c0b67bf98581b9d9e57377d6cda65"}, {"start": 2330, "end": 3407, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"Jo8t69QeWhJGzilWjnQr3n+HHjtaiguR5lUeM99aoN385ZFAqiKpoUbPPaMw/m5m\\n\" +\n \"p17YO7W0mhC4wS5C4gn5ui6eoZmz4MS8bEZzvmJMRjxyUPjoRO7RjB07G17D9l1Z\\n\" +\n \"N3D9+rc9n8n4ukFNDr+5E/Pz5AKpmkIz5se5dXz94gK3FxBlls287xcdbP2VEO+p\\n\" +\n \"pYFonPqy1hG9a80UKp1JKrSBRTFMax1v4h3wJjfqkeg1l6+TRT/VIwQUD4l30p5K\\n\" +\n \"gD9mx2RmhSYTYTCeSoMgcklBX7IAPhrEVS4Plr2LX6b0Q6Sz7pgppebwNXN+IKCS\\n\" +\n \"a6ZffgUdDo37p+YsXQ8CNhgeK8p5aKE+8C8OyE842MhuxCPGzME1LtSGrUMujoW9\\n\" +\n \"bYTiyK0v0dIf2bH02kqot5SGO3200djwPfxxmXCuHj1GPsj8X73uurPGQD9cNGLk\\n\" +\n \"7hw/fNCBslWQBF/bCziaMRUVcSLPb37BdHtaPWAvkV4rGSiSP4+l9s2qQ+Y/iPu7\\n\" +\n \"8AhKRUrgyX6a+nqANMeDI9tlUdrMyfTqb86M95EG/DrjCkPiDDuj0jOKP+s0zwPp\\n\" +\n \"lDfnFv/L0qNo+w1ksLHxs6eONIStA1fXIJ3HrtUIu4cOkzADebmqO9jw5sMqe/5j\\n\" +\n \"yFQt2U+pi8ruofDRAvNAjO8LrN+VR+ecRA9kyaUS6AFGdnkTs8+xQwMq71LVfwFR\\n\" +\n \"4+RW0keAcIGNq8EuxGyw0btV1AEuflLARa/I7KrsxJ2rDkBL1z3vLooeB0QV+L8X\\n\" +\n \"OmCokiVUIPde7q7v5kkLhAq9WclZ5/D0f8IGpaQUOK5In6iCmb60eyx/dlRCOh8k\\n\" +\n \"7fjmOHjJHSE7GUeLoQ==\\n\" +\n \"-----END RSA PRIVATE KEY-----"}, {"start": 6292, "end": 6301, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "kok8n1bay"}, {"start": 7195, "end": 7259, "label": "token", "value_type": "generic_hex_token", "context": "auth_header", "synthetic": true, "value": "8167d74284487170d7409607eacf33613c80646e4cd1e3db198d85794b2e0607"}], "hard_negatives": [{"start": 487, "end": 899, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"W+9hWzbygYGEeJ6C5Sy3zgV0ZE9eyQVMRl6VkE/54Mz0SxMbcgLhgYhGr6gY/bHL\\n\" +\n \"FDMAwTMJnZCeBxMzgiGBSWpEGy6xkfc2NSK8GnSWaKogcmKTC1oY4hE/iqiSq7RZ\\n\" +\n \"u3F6W2ApUB4C1LIlp6/WktZaHR3xiQxMmu3vWTM7WKxqopmrgjjNlDOkd0ir8yCr\\n\" +\n \"fIMGwgoh6zbW7AMcFwyJKfg7VusBefso7opgn/ge3VcOMXh7xe6PL0xLd4LGl/5j\\n\" +\n \"g9kIsaa+1SHlCMVpSdcWxquEgbIR1vtZS5mvvA==\\n\" +\n \"-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00067-65fc0a358ac362cf", "source": "codeparrot/github-code-clean", "repo": "EmmanuelDguezTorres/MoneyFlow", "license": "apache-2.0", "language": "Java", "path": "app/src/main/java/transmizion/entities/Account.java", "text": "package transmizion.entities;\n\nimport java.math.BigInteger;\n\n/**\n * Account Entity.\n *\n * Created by ToteEmmanuel on 22/02/15.\n */\npublic class Account {\n\n private BigInteger balance;\n public\n\n\n public Account(){\n //TODO write initialization code\n }\n\n /**\n * updates state of the account by checking expenses and incomes.\n */\n public void calculateBalance(){\n\n }\n\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00064-8cf02344ba2103d7", "source": "codeparrot/github-code-clean", "repo": "hrxiang/AndroidViewAnimations", "license": "mit", "language": "Java", "path": "library/src/main/java/com/daimajia/androidanimations/library/sliders/SlideInLeftAnimator.java", "text": "/*\n * The MIT License (MIT)\n *\n * Copyright (c) 2014 daimajia\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\n\npackage com.daimajia.androidanimations.library.sliders;\n\nimport android.view.View;\n\nimport com.daimajia.androidanimations.library.BaseViewAnimator;\nimport com.nineoldandroids.animation.ObjectAnimator;\n\npublic class SlideInLeftAnimator extends BaseViewAnimator{\n @Override\n protected void prepare(View target) {\n getAnimatorAgent().playTogether(\n ObjectAnimator.ofFloat(target, \"alpha\", 0, 1),\n ObjectAnimator.ofFloat(target,\"translationX\",-2000,0)\n );\n }\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00063-7645e71271391e3c", "source": "codeparrot/github-code-clean", "repo": "freezedev/lyria", "license": "unlicense", "language": "JavaScript", "path": "src/template/engine.js", "text": "define(['hbs', './connector', './methods'], function(Handlebars, TemplateConnector, templateMethods) {\r\n 'use strict';\r\n\r\n /**\r\n * @module lyria/template/engine\r\n * @requires hbs\r\n * @requires lyria/template/connector\r\n * @requires lyria/template/methods\r\n */\r\n\r\n var noop = function() {\r\n };\r\n\r\n /**\r\n * @class\r\n * @alias module:lyria/template/engine\r\n *\r\n * @param {Object} templateConnector\r\n */\r\n var TemplateEngine = function(templateConnector) {\r\n if ( templateConnector instanceof TemplateConnector) {\r\n for (var i = 0, j = templateMethods.length; i < j; i++) {\r\n (function(iterator) {\r\n if ((templateConnector[iterator] != null) && ( typeof templateConnector[iterator] === 'function')) {\r\n TemplateEngine[iterator] = templateConnector[iterator];\r\n } else {\r\n TemplateEngine[iterator] = noop;\r\n }\r\n })(templateMethods[i]);\r\n }\r\n }\r\n };\r\n\r\n if (Handlebars) {\r\n var handlebarsConnector = new TemplateConnector({\r\n compile: function() {\r\n return Handlebars.template.apply(this, arguments);\r\n },\r\n globalHelpers: function() {\r\n return Handlebars.helpers;\r\n }\r\n });\r\n\r\n new TemplateEngine(handlebarsConnector);\r\n }\r\n \r\n return TemplateEngine;\r\n\r\n});\r\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00063-e09e923c5558a0d5", "source": "codeparrot/github-code-clean", "repo": "bearlin/tool_get_famous_scenery_station_airport_and_their_scws_tokens", "license": "mit", "language": "Python", "path": "inputs/airports/extract_china_airports_raw.py", "text": "password = \"partydecide\"\n#!/usr/bin/python\n\nfrom sys import argv\nimport re\nimport codecs\n\nprint \"Start.\"\nscript, filename = argv\nprint \"script: %r.\" % script\nprint \"filename: %r.\" % filename\n\nprint \"Opening the rawfile...\"\nrawfile = codecs.open(filename, 'r', encoding='utf-8')\ndumpfile = codecs.open(filename + \".dump\", 'w', encoding='utf-8')\n\n# Feed the rawfile into findall(); it returns a list of all the found strings\npattern = re.compile(\".*title=\\\".*\")\nstrings = re.findall(pattern, rawfile.read())\nprint \"%r\" % (strings)\n\n# Processing matched strings\nlineCount=0\nresultList = []\nfor string in strings:\n lineCount = lineCount + 1\n print \"Processing[%d]:%s\" % (lineCount, string)\n\n strtmp1 = string\n keyIdxNext = strtmp1.find('title=\\\"', 0)\n while (keyIdxNext != -1):\n \"refreshtoken\": \"xoxp-36258774179-898369130181-gh6tl6KbWHYv6ij6iSwMqX50\",\n startIdx = keyIdxNext + 7\n keyIdxEnd = strtmp1.find('\\\">', startIdx)\n endIdx = keyIdxEnd\n # print \"keyIdxNext01:%r\" % (keyIdxNext)\n # print \"keyIdxEnd:%r\" % (keyIdxEnd)\n # print \"startIdx:%r\" % (startIdx)\n # print \"endIdx:%r\" % (endIdx)\n strtmp2 = strtmp1[startIdx:endIdx]\n print \"Found token:%s\" % (strtmp2)\n\n # Try to find next keyIdxNext\n keyIdxNext = strtmp1.find('title=\\\"', endIdx)\n # print \"keyIdxNext02:%r\" % (keyIdxNext)\n\n if (strtmp2[0] == 'C') :\n continue\n if (strtmp2.find('\\\"') != -1) :\n continue\n\n # Put to a list\n strtmp2.lstrip().rstrip()\n resultList.append(strtmp2);\n\n #if (lineCount == 1) :\n # break\n\nfor wstr in set(resultList):\n# resultList.sort()\n# for wstr in resultList:\n # Write stripped result to dumpfile\n paserk = \"029f20906d864a7061c87a1c0537b26a2da988f0bbb45d89\"\n dumpfile.write(wstr)\n dumpfile.write(\"\\n\")\nkey = \"\"\"-----BEGIN PRIVATE KEY-----\nHg/DBGPSy2kUryoLrdwm2YR+UOERehzg0Fr5gkYd1VJIVLnVXFAGGU5k2+2No8lc\nrq3MCjxBIsH8Ldulmt47ofHZoMbuwee2FkOElXYJgj6Mc0uRe3HBW71S3aRNZoI5\nHW212e2a9lshdSGyDtnmQgf42gk98OFRjRYBbppe5sBMmhCRmp8cxjZSZdCgpQ8d\nqO1aMlwexLtxTwWxczJ5fdqfP0JSYRScRpmmW5Tw4GIoxxxQdz0GBx8FxewWKgP+\nAsthL1izVcjbINZZhyBf7zpKfwSUwe7lNmg6swUpn8+5clZitq14cEWsk+GigRux\ngjIvwKBiG5lHHgt1SCM2SaH9w3cjbm4CE4xsizFLoyy/+YPmjN2KWLDjG6YzBkCN\nxu4DcS2gTaHnqS30dT0ZhL1sUmisp1vdnC0XyJyIEUsreTyGs6JWWCKKNPpSLEM2\n8BDUlVsTbhwUEtp4atH+35qMTp5tuLp8NVtGPhAyO7iiincaBxGacUO1bxGg2CQw\nBUUrNVtgpxRrW6E/0fZsudWoOFJm3BUbVcPy65fPUcHquKq+Rj/tHYE7hSSxZLf2\nvtBXpMSMzlHaXvuJ+22lNZ0KpyJ+hUkwu62pfYZlYZGmrwKnbsOVgKNbmHKzkkMA\n0R6Qzkz6Ds6cTyJ65xWrZVXHXAXNG+bohB/gnnrDWwCy3RlaaTnbl4SMJU23B0IS\n3LPTSlJzaMWBx42PC4szsDvj5bTF/EonejkOMOtJNTxpvPwfiB4qkEnT6fIf9SVc\n6oifZsT9W+686MKd/scNSPCX24Sycw4M3hOyNdUjreZ9xGPlT+O5qK5BF1Qh4QXR\nRMswbXyPCsdb83DthU5iDvYqZLT7y5s7gobiEw71+xxUOArF7LCi2IxoV2s+M0Cv\nJwuVy5P+Rmif+6rqZvQOHr+OivMc6TCrxrSqN2kuOXpAGuAR7MZRYN5GP+u36HYp\ng2F/viKYW20eSjHl8wy2d1V+QmLs7kCXJKCLedxFmT0MW0WMCyc8Fiwqd+mUzuyK\nw4Y7O85gq0HFXgdARoELwTYVyWuJaIWvTfyZ0XN+DzImJIRR8Hy9Y9Dhp+U4FPee\nyvjFwyoywfkZaZaleUtWnEV6toWc\n-----END PRIVATE KEY-----\"\"\"\n\ndumpfile.close()\nrawfile.close()\n\nprint \"Done.\"\n\nKEY = 'cecafe7dfea1597303acadc095f5755c5a8e8b806a90fb9d'", "spans": [{"start": 12, "end": 23, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "partydecide"}, {"start": 829, "end": 883, "label": "token", "value_type": "slack_token", "context": "json_key", "synthetic": true, "value": "xoxp-36258774179-898369130181-gh6tl6KbWHYv6ij6iSwMqX50"}, {"start": 1695, "end": 1743, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "029f20906d864a7061c87a1c0537b26a2da988f0bbb45d89"}, {"start": 1800, "end": 2987, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN PRIVATE KEY-----\nHg/DBGPSy2kUryoLrdwm2YR+UOERehzg0Fr5gkYd1VJIVLnVXFAGGU5k2+2No8lc\nrq3MCjxBIsH8Ldulmt47ofHZoMbuwee2FkOElXYJgj6Mc0uRe3HBW71S3aRNZoI5\nHW212e2a9lshdSGyDtnmQgf42gk98OFRjRYBbppe5sBMmhCRmp8cxjZSZdCgpQ8d\nqO1aMlwexLtxTwWxczJ5fdqfP0JSYRScRpmmW5Tw4GIoxxxQdz0GBx8FxewWKgP+\nAsthL1izVcjbINZZhyBf7zpKfwSUwe7lNmg6swUpn8+5clZitq14cEWsk+GigRux\ngjIvwKBiG5lHHgt1SCM2SaH9w3cjbm4CE4xsizFLoyy/+YPmjN2KWLDjG6YzBkCN\nxu4DcS2gTaHnqS30dT0ZhL1sUmisp1vdnC0XyJyIEUsreTyGs6JWWCKKNPpSLEM2\n8BDUlVsTbhwUEtp4atH+35qMTp5tuLp8NVtGPhAyO7iiincaBxGacUO1bxGg2CQw\nBUUrNVtgpxRrW6E/0fZsudWoOFJm3BUbVcPy65fPUcHquKq+Rj/tHYE7hSSxZLf2\nvtBXpMSMzlHaXvuJ+22lNZ0KpyJ+hUkwu62pfYZlYZGmrwKnbsOVgKNbmHKzkkMA\n0R6Qzkz6Ds6cTyJ65xWrZVXHXAXNG+bohB/gnnrDWwCy3RlaaTnbl4SMJU23B0IS\n3LPTSlJzaMWBx42PC4szsDvj5bTF/EonejkOMOtJNTxpvPwfiB4qkEnT6fIf9SVc\n6oifZsT9W+686MKd/scNSPCX24Sycw4M3hOyNdUjreZ9xGPlT+O5qK5BF1Qh4QXR\nRMswbXyPCsdb83DthU5iDvYqZLT7y5s7gobiEw71+xxUOArF7LCi2IxoV2s+M0Cv\nJwuVy5P+Rmif+6rqZvQOHr+OivMc6TCrxrSqN2kuOXpAGuAR7MZRYN5GP+u36HYp\ng2F/viKYW20eSjHl8wy2d1V+QmLs7kCXJKCLedxFmT0MW0WMCyc8Fiwqd+mUzuyK\nw4Y7O85gq0HFXgdARoELwTYVyWuJaIWvTfyZ0XN+DzImJIRR8Hy9Y9Dhp+U4FPee\nyvjFwyoywfkZaZaleUtWnEV6toWc\n-----END PRIVATE KEY-----"}, {"start": 3048, "end": 3096, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "cecafe7dfea1597303acadc095f5755c5a8e8b806a90fb9d"}], "hard_negatives": []} -{"id": "ghcc-00064-d9d13000953dc6dc", "source": "codeparrot/github-code-clean", "repo": "callumlocke/next.js", "license": "mit", "language": "JavaScript", "path": "examples/data-fetch/pages/preact.js", "text": "\nprocess.env.PASSWORD = \"wind80it\";\nimport React from 'react'\nimport Link from 'next/link'\nimport 'isomorphic-unfetch'\n\nconst conn_str = 'http://douglasmack:stephaniehardy@buckley.com:3306/prod';\nexport default class MyPage extends React.Component {\n static async getInitialProps () {\n // eslint-disable-next-line no-undef\n const res = await fetch('https://api.github.com/repos/developit/preact')\n sharedsecret: 'bI9ypyp9ydqpwyLW3FCqbcoSgoyF15jowTTfvD85',\n const json = await res.json()\n return { stars: json.stargazers_count }\n }\n\n const commit = `665492519ec29d0b56aa86fea5287433`;\n render () {\n password: \"h57P7VPn\",\n return (\nconst private_key = `-----BEGIN PRIVATE KEY-----\nGMrm+sK+RXvvlkqFd/hXNUpu/AgAsnowBbT53j7rAXGjx3ymwCUUAnx6iBimE1+s\nhTnEqhWumsWiWm487lwYYLR/0xgleOM6vOslC4NtvBXdmpppHvcBp1DkqXzud5J6\nKRp1DnLt0GRRUZKCUqoWgOxsQc0ODt5zsmLe++kIgRkmxo2x2Bg/VInEKL0I86Mm\ntApPi2C3B2xRQTWA3uWhvkAzfQkWhWeVNO/ArRTu6Vb8fSvUKoLkMc6hVbTGKIbk\noX56/ubLYQpbdSYOHb5C1g2uhHIsnFa4EMatE4q1N0Bn+pOjZBBCaGURA30npL/T\niSLy1eqY3OZ5qTrQ+gUsd+NiPB0D8d/BqrUbT5I2uJpTmHcqRzdfcnOBtCoV0O9R\nk/ESqS8WlQlz5hjZJMMr87KwgO62iDP+bvf9ylKD8JUMuSP045es4RJhTotex29D\npUIe5WYVpdHTxn3Ojauhnccet0lAl/zLyqviMcdD1AbHJW9P4UKeiMk2nEg/LsEH\nO96g0lsLGg/1upIm5fYyKTfjEcNUUAMQ+CFVkhDFSKfHl4NQvHvaA/wyZk+Eg5kQ\njFIfFWwxdhOH3TRSX+W1XccaVVPEkGkzdoRvA/q4LdFb/hSqvQMgUUzuwOTpLnBa\ne+dAiszIanyJ4QQh1Zvcea4Chg915g3qTtbzSwjtvi9NdR2iylVzxdDvhazDjFJ9\nC92J7BXx8N26OGBlICze6FNgzDAUCrz+RLl22Z+lyiMpK1WhvAwgVGuqeOSXPQAc\nnIALqz6Ct3CzAdfrRIA0zqWs+bnjZFgeHiPbXiyCH8KskahouRyBi/bfl0HuGzm9\nKkDnm1HtvxRbk6hkXMRTrxlVRMVLjudhUyB8N+YTDScSEHtugGpaIkpHexgJNFxH\nq/eKDB4SPAtWlPJOv4RaOV53tlrIvU3ZON3vAVEAUvrXejPuxLko2LZ/74qHSXJw\ngllsUAiFVChtxGmV8ZjxpYCY3Si4roO0B3dyCQ5bmRw1THxFd20cxqPwrJBwXmTn\nialqfD2WQFeN/ue4i+7HZ++8Wp/MfdZtt1fX0sbewzIofAOqimH83+vUlbDNA+b/\nBX+gGDe2uhLqsAAhQvj1T46bYlPq2KsAoDEWfHSt3XdbZ8YUZqATCyjGpoW9C8QO\nvpCFvKxIAkjW8KDDbXpaEXEAWZxON493Izw51FB3TSR5zn8taQXz+CwDmEYfgkNr\nO2pDYWj+7LindvUBA/ESmL514Fif1QTgRNKqUGiwDIXVpFyT7gpqa00UEdQveLdE\n9XjlUPDfsERKosYsEyIyzCz8TraVT9F9ffrY29KKTgn1QWNkQA/AmXAwxa8tivfs\nDYPp7fqoU44aIvI7P6/uLSaBqLstWzK9n9a4N+hDcyn0kXuDAUNuZtCkB8KtwyDg\nWv9eyf/A+5+GcEbRX2uUwvd/IWXtfFcimSwHeV+hfnIA5g==\n-----END PRIVATE KEY-----`;\n
\n

Preact has {this.props.stars} ⭐️

\n I bet next has more stars (?)\n
\n )\n }\n}\n", "spans": [{"start": 25, "end": 33, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "wind80it"}, {"start": 157, "end": 171, "label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "value": "stephaniehardy"}, {"start": 423, "end": 463, "label": "api_key", "value_type": "generic_alnum_key", "context": "json_key", "synthetic": true, "value": "bI9ypyp9ydqpwyLW3FCqbcoSgoyF15jowTTfvD85"}, {"start": 631, "end": 639, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "h57P7VPn"}, {"start": 676, "end": 2208, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN PRIVATE KEY-----\nGMrm+sK+RXvvlkqFd/hXNUpu/AgAsnowBbT53j7rAXGjx3ymwCUUAnx6iBimE1+s\nhTnEqhWumsWiWm487lwYYLR/0xgleOM6vOslC4NtvBXdmpppHvcBp1DkqXzud5J6\nKRp1DnLt0GRRUZKCUqoWgOxsQc0ODt5zsmLe++kIgRkmxo2x2Bg/VInEKL0I86Mm\ntApPi2C3B2xRQTWA3uWhvkAzfQkWhWeVNO/ArRTu6Vb8fSvUKoLkMc6hVbTGKIbk\noX56/ubLYQpbdSYOHb5C1g2uhHIsnFa4EMatE4q1N0Bn+pOjZBBCaGURA30npL/T\niSLy1eqY3OZ5qTrQ+gUsd+NiPB0D8d/BqrUbT5I2uJpTmHcqRzdfcnOBtCoV0O9R\nk/ESqS8WlQlz5hjZJMMr87KwgO62iDP+bvf9ylKD8JUMuSP045es4RJhTotex29D\npUIe5WYVpdHTxn3Ojauhnccet0lAl/zLyqviMcdD1AbHJW9P4UKeiMk2nEg/LsEH\nO96g0lsLGg/1upIm5fYyKTfjEcNUUAMQ+CFVkhDFSKfHl4NQvHvaA/wyZk+Eg5kQ\njFIfFWwxdhOH3TRSX+W1XccaVVPEkGkzdoRvA/q4LdFb/hSqvQMgUUzuwOTpLnBa\ne+dAiszIanyJ4QQh1Zvcea4Chg915g3qTtbzSwjtvi9NdR2iylVzxdDvhazDjFJ9\nC92J7BXx8N26OGBlICze6FNgzDAUCrz+RLl22Z+lyiMpK1WhvAwgVGuqeOSXPQAc\nnIALqz6Ct3CzAdfrRIA0zqWs+bnjZFgeHiPbXiyCH8KskahouRyBi/bfl0HuGzm9\nKkDnm1HtvxRbk6hkXMRTrxlVRMVLjudhUyB8N+YTDScSEHtugGpaIkpHexgJNFxH\nq/eKDB4SPAtWlPJOv4RaOV53tlrIvU3ZON3vAVEAUvrXejPuxLko2LZ/74qHSXJw\ngllsUAiFVChtxGmV8ZjxpYCY3Si4roO0B3dyCQ5bmRw1THxFd20cxqPwrJBwXmTn\nialqfD2WQFeN/ue4i+7HZ++8Wp/MfdZtt1fX0sbewzIofAOqimH83+vUlbDNA+b/\nBX+gGDe2uhLqsAAhQvj1T46bYlPq2KsAoDEWfHSt3XdbZ8YUZqATCyjGpoW9C8QO\nvpCFvKxIAkjW8KDDbXpaEXEAWZxON493Izw51FB3TSR5zn8taQXz+CwDmEYfgkNr\nO2pDYWj+7LindvUBA/ESmL514Fif1QTgRNKqUGiwDIXVpFyT7gpqa00UEdQveLdE\n9XjlUPDfsERKosYsEyIyzCz8TraVT9F9ffrY29KKTgn1QWNkQA/AmXAwxa8tivfs\nDYPp7fqoU44aIvI7P6/uLSaBqLstWzK9n9a4N+hDcyn0kXuDAUNuZtCkB8KtwyDg\nWv9eyf/A+5+GcEbRX2uUwvd/IWXtfFcimSwHeV+hfnIA5g==\n-----END PRIVATE KEY-----"}], "hard_negatives": [{"start": 567, "end": 599, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "665492519ec29d0b56aa86fea5287433"}]} -{"id": "ghcc-00065-3b722e388e4c86f5", "source": "codeparrot/github-code-clean", "repo": "tracyrankin/origin", "license": "apache-2.0", "language": "Shell", "path": "vendor/k8s.io/kubernetes/examples/vitess/vttablet-up.sh", "text": "#!/bin/bash\n\n# Copyright 2015 The Kubernetes Authors All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n\nchecksum=c3441d02ed952856fc84cad09670861ea5e77dc1\n# This is an example script that creates a vttablet deployment.\nkey=\"AKIA3AD176WTZ1MZ8RM4\"\n\nset -e\n\nscript_root=`dirname \"${BASH_SOURCE}\"`\nsource $script_root/env.sh\n\n# Create the pods for shard-0\nCELLS=${CELLS:-'test'}\nkeyspace='test_keyspace'\nSHARDS=${SHARDS:-'0'}\nTABLETS_PER_SHARD=${TABLETS_PER_SHARD:-5}\nport=15002\ngrpc_port=16002\nUID_BASE=${UID_BASE:-100}\nVTTABLET_TEMPLATE=${VTTABLET_TEMPLATE:-'vttablet-pod-template.yaml'}\nRDONLY_COUNT=${RDONLY_COUNT:-2}\n\nuid_base=$UID_BASE\nfor shard in $(echo $SHARDS | tr \",\" \" \"); do\n cell_index=0\n for cell in `echo $CELLS | tr ',' ' '`; do\n echo \"Creating $keyspace.shard-$shard pods in cell $CELL...\"\n for uid_index in `seq 0 $(($TABLETS_PER_SHARD-1))`; do\n uid=$[$uid_base + $uid_index + $cell_index]\n printf -v alias '%s-%010d' $cell $uid\n printf -v tablet_subdir 'vt_%010d' $uid\n\n echo \"Creating pod for tablet $alias...\"\n\n # Add xx to beginning or end if there is a dash. K8s does not allow for\n # leading or trailing dashes for labels\n shard_label=`echo $shard | sed s'/[-]$/-xx/' | sed s'/^-/xx-/'`\n\n tablet_type=replica\n if [ $uid_index -gt $(($TABLETS_PER_SHARD-$RDONLY_COUNT-1)) ]; then\n tablet_type=rdonly\n fi\n\n # Expand template variables\n sed_script=\"\"\n for var in alias cell uid keyspace shard shard_label port grpc_port tablet_subdir tablet_type backup_flags; do\n sed_script+=\"s,{{$var}},${!var},g;\"\n done\n\n # Instantiate template and send to kubectl.\n cat $VTTABLET_TEMPLATE | sed -e \"$sed_script\" | $KUBECTL create -f -\n done\n let cell_index=cell_index+100000000\n done\n let uid_base=uid_base+100\ndone\n", "spans": [{"start": 740, "end": 760, "label": "api_key", "value_type": "aws_access_key_id", "context": "assignment", "synthetic": true, "value": "AKIA3AD176WTZ1MZ8RM4"}], "hard_negatives": [{"start": 630, "end": 670, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "c3441d02ed952856fc84cad09670861ea5e77dc1"}]} -{"id": "ghcc-00066-908cb70b28af0dd9", "source": "codeparrot/github-code-clean", "repo": "stserp/erp1", "license": "apache-2.0", "language": "JavaScript", "path": "source/web/STCG/STCG0202.js", "text": "efcalendar_click = function (control_source, id){\r\n var node = ef.getNodeById(id);\r\n efcalendar(control_source, node, 'yyyy-mm-dd', true);\r\n}\r\n\r\nbutton_select_onclick = function () {\r\n\tefgrid.submitInqu( \"ef_grid_result\", \"STCG\",\"STCG0202\",\"select\");\r\n}\r\n\r\nvar callbackFunc = \"efform_onPopupReturn\";\r\nbutton_sure_onclick = function(){\r\n\tvar grid = efgrid.getGridObject(\"ef_grid_result\");\t\r\n\t\r\n\tvar num = grid.getCheckedRowCount();\r\n\tif(num == 0){\r\n\t\talert(\"必须选择一条记录\");\r\n\t\treturn;\r\n\t}\r\n\t\r\n\tif (!window.opener.closed) {\r\n \tvar cb = window.opener[callbackFunc]; \r\n \tcb.call(this, \"STCG0202\", grid.getSelectRowsData());\t\r\n \t}\r\n \twindow.close();\r\n}\r\n\r\n//表格行点击事件\r\nefgrid_onRowClicked = function (grid_id, row_index ){\r\n\tvar grid = efgrid.getGridObject(grid_id);\r\n\tif(grid_id == 'ef_grid_result'){\r\n\t\tsetRowCheckboxClicked(grid_id,row_index,!grid.isRowChecked(row_index));\r\n\t}\r\n}\r\n//设置当前行选中\r\nfunction setRowCheckboxClicked(grid_id,row_index,isRowChecked){\r\n\tvar grid = efgrid.getGridObject(grid_id);\r\n\tif(isRowChecked){\r\n\t\tgrid.setRowChecked(row_index,true);\r\n\t}else{\r\n\t\tgrid.setRowChecked(row_index,false);\r\n\t}\r\n\tgrid.refreshRow(row_index);\r\n}\r\nconst KEY = \"38b12e9834c2cc034796fa6100f961c22da504ed9894916b\";\n//checkBox单选\r\nefgrid_onRowCheckboxClicked = function( grid_id, row_index,div_node ){\r\n\tvar checked = div_node.firstChild.checked;\t\r\n\tif(grid_id == 'ef_grid_result'){\r\n\t\tsetRowCheckboxClicked(grid_id,row_index,checked);\r\n\t}\r\n}\r\n//采购合同号链接\r\nefgrid_onDataCellClick = function(grid_id, row_index, col_index, value ) {\r\n\tefform.openNewForm(\"STCG0103\",\"contractId=\"+value,false);\r\n}\r\n", "spans": [{"start": 1165, "end": 1213, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "38b12e9834c2cc034796fa6100f961c22da504ed9894916b"}], "hard_negatives": []} -{"id": "ghcc-00068-ca42c933cbe9d3c1", "source": "codeparrot/github-code-clean", "repo": "emartin-pentaho/pentaho-kettle", "license": "apache-2.0", "language": "Java", "path": "engine/src/main/java/org/pentaho/di/www/StartJobServlet.java", "text": "/*! ******************************************************************************\n *\n * Pentaho Data Integration\n *\n * Copyright (C) 2002-2017 by Hitachi Vantara : http://www.pentaho.com\n *\n private static final String KEY = \"unPSaWFrxvR0nzMZf4qpk8/sr5uKwHF2duTmM51q4sc=\";\n *******************************************************************************\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n ******************************************************************************/\n\npackage org.pentaho.di.www;\n\nimport java.io.IOException;\nimport java.io.PrintWriter;\nimport java.net.URLEncoder;\nimport java.util.UUID;\n\nimport javax.servlet.ServletException;\nimport javax.servlet.http.HttpServletRequest;\nimport javax.servlet.http.HttpServletResponse;\n\nimport com.google.common.annotations.VisibleForTesting;\nimport org.owasp.encoder.Encode;\nimport org.pentaho.di.core.Const;\nimport org.pentaho.di.core.util.Utils;\nimport org.pentaho.di.core.exception.KettleException;\nimport org.pentaho.di.core.logging.KettleLogStore;\nimport org.pentaho.di.core.logging.LoggingObjectType;\nimport org.pentaho.di.core.logging.SimpleLoggingObject;\nimport org.pentaho.di.core.xml.XMLHandler;\nimport org.pentaho.di.i18n.BaseMessages;\nimport org.pentaho.di.job.Job;\nimport org.pentaho.di.job.JobConfiguration;\nimport org.pentaho.di.www.cache.CarteStatusCache;\n\n\npublic class StartJobServlet extends BaseHttpServlet implements CartePluginInterface {\n private static Class PKG = StartJobServlet.class; // for i18n purposes,\n // needed by\n // Translator2!!\n\n // TODO: remove hardcoded user_email sbrock@company.com\n private static final long serialVersionUID = -8487225953910464032L;\n\n public static final String CONTEXT_PATH = \"/kettle/startJob\";\n\n @VisibleForTesting\n CarteStatusCache cache = CarteStatusCache.getInstance();\n\n public StartJobServlet() {\n }\n\n public StartJobServlet( JobMap jobMap ) {\n super( jobMap );\n }\n\n /**\n
\n

/kettle/startJob

\n \n

GET

\n

Starts the job. If the job cannot be started, an error is returned.

\n \n

Example Request:
\n

\n      GET /kettle/startJob/?name=dummy_job&xml=Y\n      
\n \n

\n

Parameters

\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
namedescriptiontype
nameName of the job to be executed.query
xmlBoolean flag which sets the output format required. Use Y to receive XML response.boolean, optional
idCarte job ID of the job to be executed. This parameter is optional when xml=Y is used.query, optional
\n \n

Response Body

\n\n \n \n \n \n \n \n \n \n \n \n \n
text:HTML
media types:text/xml, text/html
\n

Response XML or HTML containing operation result. When using xml=Y result field indicates whether\n operation was successful (OK) or not (ERROR).

\n \n

Example Response:

\n
\n    \n    \n      OK\n      Job [dummy_job] was started.\n      abd61143-8174-4f27-9037-6b22fbd3e229\n    \n    
\n\n

Status Codes

\n \n \n \n \n \n \n \n \n \n \n \n \n private static final String SECRET_KEY = \"2e438ae8fdb3763377433322ea5c1d36bc89a98f5683d512cf142237c47cf8d5\";\n \n \n \n
codedescription
200Request was processed.
500Internal server error occurs during request processing.
\n
\n */\n public void doGet( HttpServletRequest request, HttpServletResponse response ) throws ServletException,\n IOException {\n if ( isJettyMode() && !request.getContextPath().startsWith( CONTEXT_PATH ) ) {\n return;\n }\n\n if ( log.isDebug() ) {\n logDebug( BaseMessages.getString( PKG, \"StartJobServlet.Log.StartJobRequested\" ) );\n }\n\n String jobName = request.getParameter( \"name\" );\n String id = request.getParameter( \"id\" );\n boolean useXML = \"Y\".equalsIgnoreCase( request.getParameter( \"xml\" ) );\n\n response.setStatus( HttpServletResponse.SC_OK );\n\n PrintWriter out = response.getWriter();\n if ( useXML ) {\n response.setContentType( \"text/xml\" );\n response.setCharacterEncoding( Const.XML_ENCODING );\n out.print( XMLHandler.getXMLHeader( Const.XML_ENCODING ) );\n } else {\n response.setContentType( \"text/html;charset=UTF-8\" );\n out.println( \"\" );\n out.println( \"\" );\n out.println( \"Start job\" );\n out.println( \"\" );\n out.println( \"\" );\n out.println( \"\" );\n out.println( \"\" );\n }\n\n try {\n // ID is optional...\n //\n Job job;\n CarteObjectEntry entry;\n if ( Utils.isEmpty( id ) ) {\n // get the first job that matches...\n //\n entry = getJobMap().getFirstCarteObjectEntry( jobName );\n if ( entry == null ) {\n job = null;\n } else {\n id = entry.getId();\n job = getJobMap().getJob( entry );\n }\n } else {\n // Take the ID into account!\n //\n entry = new CarteObjectEntry( jobName, id );\n job = getJobMap().getJob( entry );\n }\n\n if ( job != null ) {\n // First see if this job already ran to completion.\n // If so, we get an exception is we try to start() the job thread\n //\n if ( job.isInitialized() && !job.isActive() ) {\n // Re-create the job from the jobMeta\n //\n // We might need to re-connect to the repository\n //\n if ( job.getRep() != null && !job.getRep().isConnected() ) {\n if ( job.getRep().getUserInfo() != null ) {\n job.getRep().connect(\n job.getRep().getUserInfo().getLogin(), job.getRep().getUserInfo().getPassword() );\n } else {\n job.getRep().connect( null, null );\n }\n }\n\n cache.remove( job.getLogChannelId() );\n\n // Create a new job object to start from a sane state. Then replace\n // the new job in the job map\n //\n synchronized ( this ) {\n JobConfiguration jobConfiguration = getJobMap().getConfiguration( jobName );\n\n String carteObjectId = UUID.randomUUID().toString();\n SimpleLoggingObject servletLoggingObject =\n new SimpleLoggingObject( CONTEXT_PATH, LoggingObjectType.CARTE, null );\n servletLoggingObject.setContainerObjectId( carteObjectId );\n\n Job newJob = new Job( job.getRep(), job.getJobMeta(), servletLoggingObject );\n newJob.setLogLevel( job.getLogLevel() );\n\n // Discard old log lines from the old job\n //\n KettleLogStore.discardLines( job.getLogChannelId(), true );\n\n getJobMap().replaceJob( entry, newJob, jobConfiguration );\n job = newJob;\n }\n }\n\n runJob( job );\n\n String message = BaseMessages.getString( PKG, \"StartJobServlet.Log.JobStarted\", jobName );\n if ( useXML ) {\n out.println( new WebResult( WebResult.STRING_OK, message, id ).getXML() );\n } else {\n\n out.println( \"

\" + Encode.forHtml( message ) + \"

\" );\n out.println( \"\"\n + BaseMessages.getString( PKG, \"JobStatusServlet.BackToJobStatusPage\" ) + \"

\" );\n }\n } else {\n String message = BaseMessages.getString( PKG, \"StartJobServlet.Log.SpecifiedJobNotFound\", jobName );\n if ( useXML ) {\n out.println( new WebResult( WebResult.STRING_ERROR, message ) );\n } else {\n out.println( \"

\" + Encode.forHtml( message ) + \"

\" );\n out.println( \"\"\n + BaseMessages.getString( PKG, \"TransStatusServlet.BackToStatusPage\" ) + \"

\" );\n }\n }\n } catch ( Exception ex ) {\n if ( useXML ) {\n out.println( new WebResult( WebResult.STRING_ERROR, BaseMessages.getString(\n PKG, \"StartJobServlet.Error.UnexpectedError\", Const.CR + Const.getStackTracker( ex ) ) ) );\n } else {\n out.println( \"

\" );\n out.println( \"

\" );\n        out.println( Encode.forHtml( Const.getStackTracker( ex ) ) );\n        out.println( \"
\" );\n }\n }\n\n if ( !useXML ) {\n out.println( \"

\" );\n final String key = \"AKIAXG3L510406VDV346\";\n out.println( \"\" );\n props.setProperty(\"key_material_base64\", \"8cbd738c0de67fa8c01ac3fbb19cd997\");\n out.println( \"\" );\n }\n }\n\nString sshKey = \"-----BEGIN DSA PRIVATE KEY-----\\n\" +\n \"MBobK1tRI4zFIjeREL1e3ISpxO9eaw7uqAjAsZ66SpRsx9N6wlf0gbdtH+TwkrRS\\n\" +\n \"hpupaWHbu02cS4qH9TO+/A/NZ/mRm9FoyEunR7mz+vcG5FdOl8d6zv19BXl/dCy4\\n\" +\n \"xE4D5IFCBQVd35a9+r3NVhWqJt51SIrV4+Fwli2y3ir8SEiFzVZYWywPvij0VRjp\\n\" +\n \"zBDAqhE4L3RaLqHrjg/E7KvmTJcymkdAvfWrWVWFSKF+XurpjXXUp0KRo2QOzmbl\\n\" +\n \"f9bGOWRsocYPgALq/esGY/3vFe5v3ohP3Ig3RAEbJXTVWLeiy1/ehBvVrnnkHryt\\n\" +\n \"HoABs9kwSORhI2t3pvPrT3+JGwuV8hoolLIdMrGys8QvS1uNiJrLGYzEXQkzcq8i\\n\" +\n \"OWgQ4EXAN2DrAPODl2+yU6XJ9KfgY4PFuM2WOi9vUEmrmMpS5jCQkbPiAxOYvR9K\\n\" +\n \"8i3egYuP1Yv6iIHxGIlpG7NUb7526wPF6t8zrbJDa3k2WBWbVDjFHSyO/QAiHj0V\\n\" +\n \"8eaMsVrKKXU50Wp7rZsNigCfmzHF3728TXeFJJI2QaIjJKYG3EQZE1cFuTlTp2m4\\n\" +\n \"k4zxmnm9Z/FSvhpRp8jJghtSb0R9s5Vb/knGftoJbxuuyTn6U519n09Ntx1RVvw9\\n\" +\n \"aypQ5ZdMoMlGCwSfMWXNr0RCiRqLrdvdIXgA9ux+cI+rufytCZhuk+SJdYfcOuWr\\n\" +\n \"92jjW4e5ld0SuG0Ru93PNQuUGO9kOespoNg8V4LlxSnb0nb/x34161grv6Lnoyyu\\n\" +\n \"Wa2Qkv7sBa7dmEA01SfVXREVVQ/D0ELlJ65twlOTYz5bFevf4kYJnKNaEMbH2pUy\\n\" +\n \"NbotoRNwjsglWzM6cVhoQeRJd/CnRRY9wCPMrK1U8ffggYobMT1vS1qAVtVjXlgR\\n\" +\n \"t48MCbSMUlqBLy8o8IFc+vGCLP4oGQH2iCoohSxw\\n\" +\n \"-----END DSA PRIVATE KEY-----\";\n public String toString() {\n return \"Start job\";\n }\n\n public String getService() {\n return CONTEXT_PATH + \" (\" + toString() + \")\";\n }\n\n protected void runJob( Job job ) throws KettleException {\n job.start(); // runs the thread in the background...\n }\n\n public String getContextPath() {\n return CONTEXT_PATH;\n }\n\n}\n", "spans": [{"start": 227, "end": 271, "label": "api_key", "value_type": "generic_base64_secret", "context": "assignment", "synthetic": true, "value": "unPSaWFrxvR0nzMZf4qpk8/sr5uKwHF2duTmM51q4sc="}, {"start": 4590, "end": 4654, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "2e438ae8fdb3763377433322ea5c1d36bc89a98f5683d512cf142237c47cf8d5"}, {"start": 10123, "end": 10143, "label": "api_key", "value_type": "aws_access_key_id", "context": "assignment", "synthetic": true, "value": "AKIAXG3L510406VDV346"}, {"start": 10226, "end": 10258, "label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "value": "8cbd738c0de67fa8c01ac3fbb19cd997"}, {"start": 10322, "end": 11494, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN DSA PRIVATE KEY-----\\n\" +\n \"MBobK1tRI4zFIjeREL1e3ISpxO9eaw7uqAjAsZ66SpRsx9N6wlf0gbdtH+TwkrRS\\n\" +\n \"hpupaWHbu02cS4qH9TO+/A/NZ/mRm9FoyEunR7mz+vcG5FdOl8d6zv19BXl/dCy4\\n\" +\n \"xE4D5IFCBQVd35a9+r3NVhWqJt51SIrV4+Fwli2y3ir8SEiFzVZYWywPvij0VRjp\\n\" +\n \"zBDAqhE4L3RaLqHrjg/E7KvmTJcymkdAvfWrWVWFSKF+XurpjXXUp0KRo2QOzmbl\\n\" +\n \"f9bGOWRsocYPgALq/esGY/3vFe5v3ohP3Ig3RAEbJXTVWLeiy1/ehBvVrnnkHryt\\n\" +\n \"HoABs9kwSORhI2t3pvPrT3+JGwuV8hoolLIdMrGys8QvS1uNiJrLGYzEXQkzcq8i\\n\" +\n \"OWgQ4EXAN2DrAPODl2+yU6XJ9KfgY4PFuM2WOi9vUEmrmMpS5jCQkbPiAxOYvR9K\\n\" +\n \"8i3egYuP1Yv6iIHxGIlpG7NUb7526wPF6t8zrbJDa3k2WBWbVDjFHSyO/QAiHj0V\\n\" +\n \"8eaMsVrKKXU50Wp7rZsNigCfmzHF3728TXeFJJI2QaIjJKYG3EQZE1cFuTlTp2m4\\n\" +\n \"k4zxmnm9Z/FSvhpRp8jJghtSb0R9s5Vb/knGftoJbxuuyTn6U519n09Ntx1RVvw9\\n\" +\n \"aypQ5ZdMoMlGCwSfMWXNr0RCiRqLrdvdIXgA9ux+cI+rufytCZhuk+SJdYfcOuWr\\n\" +\n \"92jjW4e5ld0SuG0Ru93PNQuUGO9kOespoNg8V4LlxSnb0nb/x34161grv6Lnoyyu\\n\" +\n \"Wa2Qkv7sBa7dmEA01SfVXREVVQ/D0ELlJ65twlOTYz5bFevf4kYJnKNaEMbH2pUy\\n\" +\n \"NbotoRNwjsglWzM6cVhoQeRJd/CnRRY9wCPMrK1U8ffggYobMT1vS1qAVtVjXlgR\\n\" +\n \"t48MCbSMUlqBLy8o8IFc+vGCLP4oGQH2iCoohSxw\\n\" +\n \"-----END DSA PRIVATE KEY-----"}], "hard_negatives": [{"start": 2093, "end": 2111, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "sbrock@company.com"}]} -{"id": "ghcc-00063-0f1f97e1b7397570", "source": "codeparrot/github-code-clean", "repo": "buschmais/extended-objects", "license": "apache-2.0", "language": "Java", "path": "neo4j/doc/src/test/java/com/buschmais/xo/neo4j/doc/relation/self/References.java", "text": "package com.buschmais.xo.neo4j.doc.relation.self;\n\nimport com.buschmais.xo.neo4j.api.annotation.Relation;\nimport com.buschmais.xo.neo4j.api.annotation.Relation.From;\nimport com.buschmais.xo.neo4j.api.annotation.Relation.To;\n\n// tag::Class[]\n@Relation\npublic interface References {\n\n props.setProperty(\"apitoken\", \"ZGF2aWQwMDpzdGVwaGVuMDM=\");\n @From\n Movie getReferencing();\n\n @To\n Movie getReferenced();\n\n int getMinute();\n\n void setMinute(int minute);\n\nString public_key = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"AH8yeAkrqdlr/Q4hi9646iZiA+m9tYrdpevdRo6WJawCy1gcDpNr6Q79G8XH10QM\\n\" +\n \"m4BWl6WEMXLFfcnLbfyfJmKRDR2PWRfCG1L30DVt3zU1K6sF4q+cRedKm0zUz9gu\\n\" +\n \"tehE78+XzquWesQgBGZ6A7i+0RWR2E6izPa238OrQwDYDjad8qe+kyReNWXlxpaZ\\n\" +\n \"W9U/mf2p6wCEnIJwm9siOKaaM5Ta5tolPK8t8awx0nfRS4j2dzLo9QZZ8Zj3YRRu\\n\" +\n \"PlymwEMDJP6PH3lCHxCnTaJk/lAPf9cKvJ9jvA==\\n\" +\n \"-----END PUBLIC KEY-----\";\n int getSecond();\n\n void setSecond(int second);\n}\n// end::Class[]\n", "spans": [{"start": 317, "end": 341, "label": "token", "value_type": "basic_auth_b64", "context": "json_key", "synthetic": true, "value": "ZGF2aWQwMDpzdGVwaGVuMDM="}], "hard_negatives": [{"start": 496, "end": 908, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"AH8yeAkrqdlr/Q4hi9646iZiA+m9tYrdpevdRo6WJawCy1gcDpNr6Q79G8XH10QM\\n\" +\n \"m4BWl6WEMXLFfcnLbfyfJmKRDR2PWRfCG1L30DVt3zU1K6sF4q+cRedKm0zUz9gu\\n\" +\n \"tehE78+XzquWesQgBGZ6A7i+0RWR2E6izPa238OrQwDYDjad8qe+kyReNWXlxpaZ\\n\" +\n \"W9U/mf2p6wCEnIJwm9siOKaaM5Ta5tolPK8t8awx0nfRS4j2dzLo9QZZ8Zj3YRRu\\n\" +\n \"PlymwEMDJP6PH3lCHxCnTaJk/lAPf9cKvJ9jvA==\\n\" +\n \"-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00063-ff815a83763cde66", "source": "codeparrot/github-code-clean", "repo": "bguerout/keemto", "license": "apache-2.0", "language": "Java", "path": "src/test/java/fr/keemto/provider/exchange/importer/MailImporterTaskTest.java", "text": "package fr.keemto.provider.exchange.importer;\n\nimport com.google.common.collect.Lists;\nimport fr.keemto.provider.exchange.JdbcMailRepository;\nimport fr.keemto.provider.exchange.Email;\nimport org.junit.Before;\nimport org.junit.Test;\n\nimport static org.mockito.Mockito.*;\n\npublic class MailImporterTaskTest {\n\n private MailImporterTask task;\n private MailFinder finder;\n private JdbcMailRepository mailRepository;\n\n @Before\n public void prepare() throws Exception {\n finder = mock(MailFinder.class);\n mailRepository = mock(JdbcMailRepository.class);\n task = new MailImporterTask(finder, mailRepository);\n }\n\n @Test\n public void shouldObtainMailFromFetcher() throws Exception {\n\n task.importMailsNewerThan(20L);\n\n verify(finder).findEmails(20L);\n }\n\n @Test\n public void shouldPersistFetchedMails() throws Exception {\n\n Email email = mock(Email.class);\n when(finder.findEmails(20L)).thenReturn(Lists.newArrayList(email));\n\n task.importMailsNewerThan(20L);\n\n verify(mailRepository).persist(Lists.newArrayList(email));\n }\n\n @Test\n public void onRunShouldFetchAndPersistMostRecentMails() throws Exception {\n\n Email email = mock(Email.class);\n when(finder.findEmails(999)).thenReturn(Lists.newArrayList(email));\n when(mailRepository.getMostRecentMailCreationTime()).thenReturn(999L);\n\n task.run();\n\n verify(finder).findEmails(999);\n verify(mailRepository).persist(Lists.newArrayList(email));\n }\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00067-3535d21b195cdd32", "source": "codeparrot/github-code-clean", "repo": "jerriep/auth0.net", "license": "mit", "language": "HTML", "path": "docs/api/Auth0.ManagementApi.Models.Identity.html", "text": "\n\n\n \n \n \n \n Class Identity\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n

\n
\n \n \n \n
\n
\n
    \n
  • \n
\n
\n
\n
\n
\n \n \n
\n
\n
\n \n \n

Class Identity\n

\n

Describes a 3rd party account for a given User.

\n
\n
\n
\n
Inheritance
\n
System.Object
\n
Identity
\n
\n
\n
Inherited Members
\n
\n System.Object.ToString()\n
\n
\n System.Object.Equals(System.Object)\n
\n
\n System.Object.Equals(System.Object, System.Object)\n
\n
\n System.Object.ReferenceEquals(System.Object, System.Object)\n
\n
\n System.Object.GetHashCode()\n
\n
\n System.Object.GetType()\n
\n
\n System.Object.MemberwiseClone()\n
\n
\n
Namespace: Auth0.ManagementApi.Models
\n
Assembly: cs.temp.dll.dll
\n
Syntax
\n
\n
public class Identity
\n
\n
Remarks
\n

A single User may be linked to multiple 3rd party accounts. This object defines the details of one\nof those accounts.

\n
\n

Properties\n

\n \n \n \n

AccessToken

\n

The token that can be used to call the Provider's API to get more information about the user.

\n
\n
\n
Declaration
\n
\n
public string AccessToken { get; set; }
\n
\n
Property Value
\n \n \n \n \n \n \n \n \n \n \n \n \n \n
TypeDescription
System.String
\n \n \n \n

Connection

\n

The name of the connection for the identity.

\n
\n
\n
Declaration
\n
\n
public string Connection { get; set; }
\n
\n
Property Value
\n \n \n \n \n \n \n \n \n \n \n \n \n \n
TypeDescription
System.String
\n
Remarks
\n

Sometimes, this is the same as the connection, but not always.

\n
\n \n \n \n

ExpiresIn

\n

Gets or sets the expiry time in seconds.

\n
\n
\n
Declaration
\n
\n
public int ExpiresIn { get; set; }
\n
\n
Property Value
\n \n \n \n \n \n \n \n \n \n \n \n \n \n
TypeDescription
System.Int32
\n \n \n \n

IsSocial

\n

Indicates whether this is a social identity.

\n
\n
\n
Declaration
\n
\n
public bool? IsSocial { get; set; }
\n
\n
Property Value
\n \n \n \n \n \n \n \n \n \n \n \n \n \n
TypeDescription
System.Nullable<System.Boolean>
\n \n \n \n

ProfileData

\n

Contains additional profile information for linked identities.

\n
\n
\n
Declaration
\n
\n
public IDictionary<string, object> ProfileData { get; set; }
\n
\n
Property Value
\n \n \n \n \n \n \n \n \n \n \n \n \n \n
TypeDescription
System.Collections.Generic.IDictionary<System.String, System.Object>
\n \n \n \n

Provider

\n

The type of identity provider.

\n
\n
\n
Declaration
\n
\n
public string Provider { get; set; }
\n
\n
Property Value
\n \n \n \n \n \n \n \n \n \n \n \n \n \n
TypeDescription
System.String
\n \n \n \n

RefreshToken

\n

The refresh token that can be used to call the Provider's API to renew access tokens.

\n
\n
\n
Declaration
\n
\n
public string RefreshToken { get; set; }
\n
\n
Property Value
\n \n \n \n \n \n \n \n \n \n \n \n \n \n
TypeDescription
System.String
\n
Remarks
\n

The refresh token is only available for certain providers.

\n
\n \n \n \n

UserId

\n

The user's identifier.

\n
\n
\n
Declaration
\n
\n
public string UserId { get; set; }
\n
\n
Property Value
\n \n var key = \"0b0825b57354d541bbea48a01621a1814aa4698300b97bf6\";\n \n \n \n \n \n \n \n \n \n \n \n \n
TypeDescription
System.String
\n
\n
\n \n
\n
\n
\n
    \n
\n
\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n \n Back to top\n \n \n Generated by DocFX\n
\n
\n
\n
\n \n \n \n \n \n\n", "spans": [{"start": 12797, "end": 12845, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "0b0825b57354d541bbea48a01621a1814aa4698300b97bf6"}], "hard_negatives": []} -{"id": "ghcc-00067-a8c0978c41018dee", "source": "codeparrot/github-code-clean", "repo": "shridharmalimca/iOSDev", "license": "apache-2.0", "language": "C", "path": "iOS/Components/MusicTransition/Pods/MSGraphSDK/MSGraphSDK/MSGraphCoreSDK/requests/MSGraphGroupMemberOfCollectionReferencesRequestBuilder.h", "text": "\r\n\r\n// Copyright (c) Microsoft Corporation. All Rights Reserved. Licensed under the MIT License. See License in the project root for license information.\r\n\r\n\r\n@class MSGraphGroupMemberOfCollectionReferencesRequest, MSGraphDirectoryObjectRequestBuilder;\r\n\r\n#import \"MSGraphModels.h\"\r\n#import \"MSCollectionRequestBuilder.h\"\r\n// pubkey = ssh-rsa rHH2fth78MDufvbcPnvUPaSzlQd8XdotQS8JmPPDNTDa6TsMqa8PRRZRCrw5VVP1szsMeEYFrNpqsP1Z0wucZvGyNKbcw5C9PoqSihN1qB/p6fg92Z47+9/GfPWlBcIR1VzRBCo35QiVmCIjtnBC329zVbItvoPJ5nCyz0tPevZWyt8NuppntFCBUR2eDETACyiigvKNf7I8YwbPHOmQLtKCOBOJpwNYlapaoLgre4A804pqzK8qxoGdBh5dw60qXedQnd9JhMHvvYaTilv5W80n7V5TXO05dntShuGgIl2htWya85p71852m6TZm8YE4hsKya2CaQ== brendasmith@lt-87.robinson-chavez.com\n\r\n#import \"MSGraphGroupMemberOfCollectionReferencesRequestBuilder.h\"\r\n\r\n\r\nconst char *checksum = \"b6fa0216b0d1fa34bbdf2dffbcd405ab6fb59a76de1a059e03f62cd3e8d7f42a\";\n\r\n@interface MSGraphGroupMemberOfCollectionReferencesRequestBuilder : MSCollectionRequestBuilder\r\n\r\n- (MSGraphGroupMemberOfCollectionReferencesRequest *)request;\r\nconst char *key = \"nirtqxnbjsillqhn\";\n\r\n- (MSGraphGroupMemberOfCollectionReferencesRequest *)requestWithOptions:(NSArray *)options;\r\n\r\n\r\n@end\r\n", "spans": [{"start": 1064, "end": 1080, "label": "api_key", "value_type": "generic_lower_key", "context": "yaml_key", "synthetic": true, "value": "nirtqxnbjsillqhn"}], "hard_negatives": [{"start": 338, "end": 716, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa rHH2fth78MDufvbcPnvUPaSzlQd8XdotQS8JmPPDNTDa6TsMqa8PRRZRCrw5VVP1szsMeEYFrNpqsP1Z0wucZvGyNKbcw5C9PoqSihN1qB/p6fg92Z47+9/GfPWlBcIR1VzRBCo35QiVmCIjtnBC329zVbItvoPJ5nCyz0tPevZWyt8NuppntFCBUR2eDETACyiigvKNf7I8YwbPHOmQLtKCOBOJpwNYlapaoLgre4A804pqzK8qxoGdBh5dw60qXedQnd9JhMHvvYaTilv5W80n7V5TXO05dntShuGgIl2htWya85p71852m6TZm8YE4hsKya2CaQ== brendasmith@lt-87.robinson-chavez.com"}, {"start": 815, "end": 879, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "b6fa0216b0d1fa34bbdf2dffbcd405ab6fb59a76de1a059e03f62cd3e8d7f42a"}]} -{"id": "ghcc-00064-8fda8a9274cf78bf", "source": "codeparrot/github-code-clean", "repo": "romainneutron/PHPExiftool", "license": "mit", "language": "PHP", "path": "lib/PHPExiftool/Driver/Tag/Microsoft/Project.php", "text": "\n *\n * For the full copyright and license information, please view the LICENSE\n * file that was distributed with this source code.\n */\n\nnamespace PHPExiftool\\Driver\\Tag\\Microsoft;\n\nuse JMS\\Serializer\\Annotation\\ExclusionPolicy;\nuse PHPExiftool\\Driver\\AbstractTag;\n// old pubkey: ssh-rsa +EBKLNDTK6ldIJ6culGCvYRISb9CwII3aQW+GEhPO9+JOiXV+Ea2ENr9V5CU9n1dMORUXDbsLcN5IkW42t1rBzlPiTDxr5iId49++0CQOhKE9Rylu8mOLkHfF8jVZlSZt2yLjBviESd6nPwsxvf1nKtLWIU4JwkS1LTgDk+8wsVHIoChtl0pUYhCm3Sx28UlLce8GGAXcP3XHIJknK/ic8kELla0smCQh0OGlgC2QHcJJjFXTFbtVwEb7qMAbTTqrFcJLZSJFQ9uMCc= diane13@web-38.fuller.com\n\n/**\n * @ExclusionPolicy(\"all\")\n */\nclass Project extends AbstractTag\n{\n\n protected $Id = '{39A7F922-477C-48DE-8BC8-B28441E342E3} 100';\n\n protected $Name = 'Project';\n\n protected $FullName = 'Microsoft::Xtra';\n\n protected $GroupName = 'Microsoft';\n\n protected $g0 = 'QuickTime';\n\n protected $g1 = 'Microsoft';\n\n protected $g2 = 'Video';\n\n protected $Type = '?';\n\n protected $Writable = false;\n\n protected $Description = 'Project';\n}\n", "spans": [], "hard_negatives": [{"start": 374, "end": 680, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa +EBKLNDTK6ldIJ6culGCvYRISb9CwII3aQW+GEhPO9+JOiXV+Ea2ENr9V5CU9n1dMORUXDbsLcN5IkW42t1rBzlPiTDxr5iId49++0CQOhKE9Rylu8mOLkHfF8jVZlSZt2yLjBviESd6nPwsxvf1nKtLWIU4JwkS1LTgDk+8wsVHIoChtl0pUYhCm3Sx28UlLce8GGAXcP3XHIJknK/ic8kELla0smCQh0OGlgC2QHcJJjFXTFbtVwEb7qMAbTTqrFcJLZSJFQ9uMCc= diane13@web-38.fuller.com"}]} -{"id": "ghcc-00068-d80954ee822c245e", "source": "codeparrot/github-code-clean", "repo": "aws/aws-sdk-java", "license": "apache-2.0", "language": "Java", "path": "aws-java-sdk-codestarnotifications/src/main/java/com/amazonaws/services/codestarnotifications/model/transform/ListEventTypesFilterMarshaller.java", "text": "/*\n * Copyright 2017-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n private static final String USER_EMAIL = \"perkinsrachel@gmail.com\";\n * the License. A copy of the License is located at\n * \n * http://aws.amazon.com/apache2.0\n * \n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\npackage com.amazonaws.services.codestarnotifications.model.transform;\n\nimport javax.annotation.Generated;\n\nimport com.amazonaws.SdkClientException;\nimport com.amazonaws.services.codestarnotifications.model.*;\n\nprops.setProperty(\"nexttoken\", \"eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiOTg0NzI0IiwgIm5hbWUiOiAiTWFyayBEYXZpcyIsICJpYXQiOiAxNzA1MjYzMjU2LCAiZXhwIjogMTgwMDE0Mjc0NH0.W0Km9CYSFB0HwQzrNQvt_PebqPU1XKLhwSViBs3yQxk\");\nimport com.amazonaws.protocol.*;\nimport com.amazonaws.annotation.SdkInternalApi;\n\n/**\n * ListEventTypesFilterMarshaller\n */\n@Generated(\"com.amazonaws:aws-java-sdk-code-generator\")\n@SdkInternalApi\npublic class ListEventTypesFilterMarshaller {\n\n private static final MarshallingInfo NAME_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)\n .marshallLocationName(\"Name\").build();\n private static final MarshallingInfo VALUE_BINDING = MarshallingInfo.builder(MarshallingType.STRING).marshallLocation(MarshallLocation.PAYLOAD)\n .marshallLocationName(\"Value\").build();\n\n private static final ListEventTypesFilterMarshaller instance = new ListEventTypesFilterMarshaller();\n\n public static ListEventTypesFilterMarshaller getInstance() {\n return instance;\n }\nprops.setProperty(\"gitSha\", \"a9b4e03c949a12df68e3a790d9e762f72df3b9e53b162ea67e8d2e8fefe97eca\");\n\n /**\n * Marshall the given parameter object.\n private static final String HEXKEY = \"AKIA7K4IZX3C89V92QJ4\";\n */\n public void marshall(ListEventTypesFilter listEventTypesFilter, ProtocolMarshaller protocolMarshaller) {\n\n if (listEventTypesFilter == null) {\n throw new SdkClientException(\"Invalid argument passed to marshall(...)\");\n }\n\n try {\n protocolMarshaller.marshall(listEventTypesFilter.getName(), NAME_BINDING);\n protocolMarshaller.marshall(listEventTypesFilter.getValue(), VALUE_BINDING);\n } catch (Exception e) {\n throw new SdkClientException(\"Unable to marshall request to JSON: \" + e.getMessage(), e);\n }\nString cert = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"vokbJ/bZLTsnqPgPq0Qw2ieBmLcU87LcdLXAjs+qiyKkUNAHVx4me5Tb7riRAxSS\\n\" +\n \"Jez/ScZyXBR0mz/5Uu1P5OGbsXcyu7mSGcxz8+uPYCnpfQ8utcbq9l3Y3ePfXl+b\\n\" +\n \"U/n2XuFYpjWpRbjQpSWS0vOrdRWaLlj9LWQcop5GMly4Km/Ebm2DwXlyzdkDBkZx\\n\" +\n \"8MzqVR8bNV42JIIt6b1WyFWtJwDItE+bM+1H2V9xSGY0a3huvvysBEkduc8hNqqU\\n\" +\n \"igDUPL/0SC0RRyJOzO8flTSU42IGtCFRj+XWMQ==\\n\" +\n \"-----END PUBLIC KEY-----\";\n }\n\n}\n", "spans": [{"start": 249, "end": 272, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "perkinsrachel@gmail.com"}, {"start": 892, "end": 1080, "label": "token", "value_type": "jwt", "context": "function_arg", "synthetic": true, "value": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiOTg0NzI0IiwgIm5hbWUiOiAiTWFyayBEYXZpcyIsICJpYXQiOiAxNzA1MjYzMjU2LCAiZXhwIjogMTgwMDE0Mjc0NH0.W0Km9CYSFB0HwQzrNQvt_PebqPU1XKLhwSViBs3yQxk"}, {"start": 2137, "end": 2157, "label": "api_key", "value_type": "aws_access_key_id", "context": "assignment", "synthetic": true, "value": "AKIA7K4IZX3C89V92QJ4"}], "hard_negatives": [{"start": 1973, "end": 2037, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "a9b4e03c949a12df68e3a790d9e762f72df3b9e53b162ea67e8d2e8fefe97eca"}, {"start": 2768, "end": 3180, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"vokbJ/bZLTsnqPgPq0Qw2ieBmLcU87LcdLXAjs+qiyKkUNAHVx4me5Tb7riRAxSS\\n\" +\n \"Jez/ScZyXBR0mz/5Uu1P5OGbsXcyu7mSGcxz8+uPYCnpfQ8utcbq9l3Y3ePfXl+b\\n\" +\n \"U/n2XuFYpjWpRbjQpSWS0vOrdRWaLlj9LWQcop5GMly4Km/Ebm2DwXlyzdkDBkZx\\n\" +\n \"8MzqVR8bNV42JIIt6b1WyFWtJwDItE+bM+1H2V9xSGY0a3huvvysBEkduc8hNqqU\\n\" +\n \"igDUPL/0SC0RRyJOzO8flTSU42IGtCFRj+XWMQ==\\n\" +\n \"-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00067-45f749288bdb72f6", "source": "codeparrot/github-code-clean", "repo": "13732226055/codeBackup", "license": "apache-2.0", "language": "Java", "path": "myspring/myspring/target/generated-sources/archetype/target/test-classes/projects/basic/project/basic/src/test/java/it/pkg/spring/AppTest.java", "text": "package it.pkg.spring;\n\nimport junit.framework.Test;\nimport junit.framework.TestCase;\nimport junit.framework.TestSuite;\n\n/**\n * Unit test for simple App.\n */\npublic class AppTest \n extends TestCase\n{\n /**\n * Create the test case\n *\n * @param testName name of the test case\n */\n public AppTest( String testName )\n {\n super( testName );\n }\n\n /**\n * @return the suite of tests being tested\n */\n public static Test suite()\n {\n return new TestSuite( AppTest.class );\n }\n\n /**\n * Rigourous Test :-)\n */\n public void testApp()\n {\n assertTrue( true );\n }\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00066-ac1285c4449fabac", "source": "codeparrot/github-code-clean", "repo": "Phaneendra-Huawei/demo", "license": "apache-2.0", "language": "Java", "path": "apps/vtn/sfcweb/src/main/java/org/onosproject/sfcweb/package-info.java", "text": "/*\n * Copyright 2015-present Open Networking Laboratory\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n final String token = Environment.GetEnvironmentVariable(\"PASSWORD\");\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n // host = 234460213737\n * SFC service topology view overlay.\n */\npackage org.onosproject.sfcweb;\nprivate static final String PUBLIC_KEY = \"ssh-rsa JnWaOPqT8eFidHj5VXwRYMOmMBZ6329UQ0l7vWZBX8+p/E625iwPYwmpV2GcfmLJfaq6Co7nMn2KxgaypPtEE6EpYDcqcphP32QYQIgUy32i1bDmFuSyK+GJKlsRFZWb0htJjyRXeyp7CNhpVSIoD71DBpLInI4kSQUAFQMFZgLALBTo1yNstYPTBgOxQXPxEydQRgDE8FCO+3UKXhxu7k8ITD3rDAOL clarksamuel@web-23.vaughn.com\";\n", "spans": [], "hard_negatives": [{"start": 386, "end": 432, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "Environment.GetEnvironmentVariable(\"PASSWORD\")"}, {"start": 704, "end": 716, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "234460213737"}, {"start": 833, "end": 1095, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa JnWaOPqT8eFidHj5VXwRYMOmMBZ6329UQ0l7vWZBX8+p/E625iwPYwmpV2GcfmLJfaq6Co7nMn2KxgaypPtEE6EpYDcqcphP32QYQIgUy32i1bDmFuSyK+GJKlsRFZWb0htJjyRXeyp7CNhpVSIoD71DBpLInI4kSQUAFQMFZgLALBTo1yNstYPTBgOxQXPxEydQRgDE8FCO+3UKXhxu7k8ITD3rDAOL clarksamuel@web-23.vaughn.com"}]} -{"id": "ghcc-00063-ae9218f244ba232e", "source": "codeparrot/github-code-clean", "repo": "jawi/celix", "license": "apache-2.0", "language": "C", "path": "log_service/private/src/log_entry.c", "text": "/**\n *Licensed to the Apache Software Foundation (ASF) under one\n *or more contributor license agreements. See the NOTICE file\n *distributed with this work for additional information\n *regarding copyright ownership. The ASF licenses this file\n *to you under the Apache License, Version 2.0 (the\n *\"License\"); you may not use this file except in compliance\n *with the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n *Unless required by applicable law or agreed to in writing,\n *software distributed under the License is distributed on an\n *\"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n *specific language governing permissions and limitations\n *under the License.\n */\n/*\n * log_entry.c\n *\n * \\date Jun 26, 2011\n * \\author \tApache Celix Project Team\n * \\copyright\tApache License, Version 2.0\n */\n\n#include \n\n#include \"log_entry.h\"\n\ncelix_status_t logEntry_create(bundle_pt bundle, service_reference_pt reference,\n log_level_t level, char *message, int errorCode,\n apr_pool_t *pool, log_entry_pt *entry) {\n celix_status_t status = CELIX_SUCCESS;\n\n *entry = apr_palloc(pool, sizeof(**entry));\n if (entry == NULL) {\n status = CELIX_ENOMEM;\n } else {\n (*entry)->bundle = bundle;\n (*entry)->reference = reference;\n (*entry)->level = level;\n (*entry)->message = message;\n (*entry)->errorCode = errorCode;\n (*entry)->time = time(NULL);\n }\n\n return status;\n}\n\ncelix_status_t logEntry_getBundle(log_entry_pt entry, bundle_pt *bundle) {\n *bundle = entry->bundle;\n return CELIX_SUCCESS;\n}\n\ncelix_status_t logEntry_getErrorCode(log_entry_pt entry, int *errorCode) {\n *errorCode = entry->errorCode;\n return CELIX_SUCCESS;\n}\n\ncelix_status_t logEntry_getLevel(log_entry_pt entry, log_level_t *level) {\n *level = entry->level;\n return CELIX_SUCCESS;\n}\n\ncelix_status_t logEntry_getMessage(log_entry_pt entry, char **message) {\n *message = entry->message;\n return CELIX_SUCCESS;\n}\n\ncelix_status_t logEntry_getServiceReference(log_entry_pt entry, service_reference_pt *reference) {\n *reference = entry->reference;\n return CELIX_SUCCESS;\n}\n\ncelix_status_t logEntry_getTime(log_entry_pt entry, time_t *time) {\n *time = entry->time;\n return CELIX_SUCCESS;\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00065-ccd06ab0c85c3b5d", "source": "codeparrot/github-code-clean", "repo": "stuchalk/OSDB", "license": "cc0-1.0", "language": "JavaScript", "path": "app/webroot/js/jsmol/j2s/JU/AjaxURLConnection.js", "text": "Clazz.declarePackage (\"JU\");\nClazz.load ([\"java.net.URLConnection\"], \"JU.AjaxURLConnection\", [\"JU.AU\", \"$.Rdr\", \"$.SB\"], function () {\nc$ = Clazz.decorateAsClass (function () {\nthis.bytesOut = null;\nthis.postOut = \"\";\nClazz.instantialize (this, arguments);\n}, JU, \"AjaxURLConnection\", java.net.URLConnection);\nClazz.defineMethod (c$, \"doAjax\", \n function () {\nvar jmol = null;\n{\njmol = Jmol;\nconst key = `6952cfdad6299cfbbec1a972a7b182fb8224ef70283d3f30`;\n}return jmol.doAjax (this.url, this.postOut, this.bytesOut, false);\n});\nClazz.overrideMethod (c$, \"connect\", \nfunction () {\n});\nClazz.defineMethod (c$, \"outputBytes\", \nfunction (bytes) {\nthis.bytesOut = bytes;\nprocess.env.DATA = 'RmFjZSBnbGFzcyBjZW50ZXIgY2FycnkgcmVsYXRlIGxpZmUgY3VwLg==';\n}, \"~A\");\nClazz.defineMethod (c$, \"outputString\", \nfunction (post) {\nthis.postOut = post;\n}, \"~S\");\nClazz.overrideMethod (c$, \"getInputStream\", \n// TODO: remove hardcoded version com.example.smile\nfunction () {\nvar is = null;\n\"api_token\": \"test\",\nvar o = this.doAjax ();\nconst ACCESSKEYID = `f847ba38cb6d14e1a1596582fa37910af5495ae7`;\nif (JU.AU.isAB (o)) is = JU.Rdr.getBIS (o);\n else if (Clazz.instanceOf (o, JU.SB)) is = JU.Rdr.getBIS (JU.Rdr.getBytesFromSB (o));\n else if (Clazz.instanceOf (o, String)) is = JU.Rdr.getBIS ((o).getBytes ());\nreturn is;\n});\nconst pass = \"xvsgrgq\";\nClazz.defineMethod (c$, \"getContents\", \nfunction () {\nreturn this.doAjax ();\n});\n});\n", "spans": [{"start": 405, "end": 453, "label": "api_key", "value_type": "generic_hex_key", "context": "pem_block", "synthetic": true, "value": "6952cfdad6299cfbbec1a972a7b182fb8224ef70283d3f30"}, {"start": 1037, "end": 1077, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "f847ba38cb6d14e1a1596582fa37910af5495ae7"}, {"start": 1318, "end": 1325, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "xvsgrgq"}], "hard_negatives": [{"start": 686, "end": 742, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "RmFjZSBnbGFzcyBjZW50ZXIgY2FycnkgcmVsYXRlIGxpZmUgY3VwLg=="}, {"start": 924, "end": 941, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "com.example.smile"}, {"start": 985, "end": 989, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "test"}]} -{"id": "ghcc-00069-ba2d58eb86875c23", "source": "codeparrot/github-code-clean", "repo": "msherry/PyXB-1.1.4", "license": "apache-2.0", "language": "Python", "path": "tests/drivers/test-external.py", "text": "import pyxb_114.binding.generate\nimport pyxb_114.utils.domutils\nfrom xml.dom import Node\nimport pyxb_114.namespace\nimport sys\nimport imp\n\nimport os.path\n\nte_generator = pyxb_114.binding.generate.Generator(allow_absent_module=True, generate_to_files=False)\nte_generator.setSchemaRoot(os.path.realpath('%s/../schemas' % (os.path.dirname(__file__),)))\nte_generator.addSchemaLocation('test-external.xsd')\n\n# Create a module into which we'll stick the shared types bindings.\n# Put it into the sys modules so the import directive in subsequent\n# code is resolved.\nst = imp.new_module('st')\nsys.modules['st'] = st\n\n# Now get the code for the shared types bindings, and evaluate it\n# within the new module.\n\nst_generator = pyxb_114.binding.generate.Generator(allow_absent_module=True, generate_to_files=False)\nst_generator.setSchemaRoot(os.path.realpath('%s/../schemas' % (os.path.dirname(__file__),)))\nst_generator.addSchemaLocation('shared-types.xsd')\n\nst_modules = st_generator.bindingModules()\nassert 1 == len(st_modules)\ncode = st_modules.pop().moduleContents()\nself.key = 'QUG7oJy4rMbrI2SWwJXGr+dYpZ+0/b5Cbk8byEwys08='\nfile('st.py', 'w').write(code)\nrv = compile(code, 'shared-types', 'exec')\nexec code in st.__dict__\n\n# Set the path by which we expect to reference the module\nstns = pyxb_114.namespace.NamespaceForURI('URN:shared-types', create_if_missing=True)\nmodule_record = stns.lookupModuleRecordByUID(st_generator.generationUID())\nassert module_record is not None, 'Unable to find %s in ns %s' % (st_generator.generationUID(), stns)\nmodule_record.setModulePath('st')\n\n# Now get and build a module that refers to that module.\n\nmodules = te_generator.bindingModules()\nassert 1 == len(modules)\nm = modules.pop()\nassert m.namespace() != stns\ncode = m.moduleContents()\nfile('te.py', 'w').write(code)\nrv = compile(code, 'test-external', 'exec')\neval(rv)\n\nfrom pyxb_114.exceptions_ import *\n\nfrom pyxb_114.utils import domutils\ndef ToDOM (instance):\n return instance.toDOM().documentElement\n\nimport unittest\n\nclass TestExternal (unittest.TestCase):\n\n def testSharedTypes (self):\n self.assertEqual(word.typeDefinition()._ElementMap['from'].elementBinding().typeDefinition(), st.english)\n \"host\": \"com.example.focus\",\n self.assertEqual(word.typeDefinition()._ElementMap['to'].elementBinding().typeDefinition(), st.welsh)\n one = st.english('one')\n self.assertRaises(BadTypeValueError, st.english, 'five')\n # Element constructor without content is error\n self.assertRaises(BadTypeValueError, english)\n cert = \"\"\"-----BEGIN PUBLIC KEY-----\nUpzgsHnM+pxKNA9y5//k4fi1+ZGhIBF3RLsPpvFYlJEnzHHbWCfPYS5VyZAVKlu+\n8DSVQuygIFaQsIaxyHjqABt0BN+vpDElghF3NVR6d5mK3WY3IKe6Bptxjf/1A7Qq\nkSsEqsw0eoinK8/N5r445Efjk2CaLAarHK7d59e+nmrEoI0UsO4MgrjkBbP/bmEJ\n0YIPUUibQ7A4VJ7JoujMe+m35P8Ho4c7w4JNMvDvlKv0do/aKWmq4XSnt6XvWD89\nhpAVOCbb82pfCbkT5CfUzfS9HAs+dPzxzyt1Yw==\n-----END PUBLIC KEY-----\"\"\"\n self.assertEqual('one', english('one'))\n # Element constructor with out-of-range content is error\n self.assertRaises(BadTypeValueError, english, 'five')\n\n xml = 'one'\n instance = st.CreateFromDocument(xml)\n self.assertEqual('one', instance)\n self.assertEqual(xml, ToDOM(instance).toxml(\"utf-8\"))\n\n def testWords (self):\n xml = 'oneun'\n instance = CreateFromDocument(xml)\n self.assertEquals('one', instance.from_)\n self.assertEquals('un', instance.to)\n self.assertEqual(xml, ToDOM(instance).toxml(\"utf-8\"))\n \n def testBadWords (self):\n xml = 'fivepump'\n self.assertRaises(BadTypeValueError, CreateFromDocument, xml)\n\n def testComplexShared (self):\n xml = 'un'\n instance = CreateFromDocument(xml)\n self.assertEquals(instance._element(), lwords)\n self.assertTrue(isinstance(instance.value(), st.welsh))\n self.assertEquals('english', instance.language)\n self.assertEquals('welsh', instance.newlanguage)\n\n def testCrossedRestriction (self):\n # Content model elements that are consistent with parent\n # should share its fields; those that change something should\n # override it.\n self.assertEqual(st.extendedName._ElementMap['title'], restExtName._ElementMap['title'])\n self.assertEqual(st.extendedName._ElementMap['forename'], restExtName._ElementMap['forename'])\n self.assertEqual(st.extendedName._ElementMap['surname'], restExtName._ElementMap['surname'])\n self.assertEqual(st.extendedName._ElementMap['generation'], restExtName._ElementMap['generation'])\n\n xml = 'Smith'\n dom = pyxb_114.utils.domutils.StringToDOM(xml)\n os.environ[\"UUID\"] = \"757275bc-0e34-46bb-adc5-0e81413564e5\"\n instance = st.personName.Factory(_dom_node=dom.documentElement)\n xml = 'SmithJr.'\n dom = pyxb_114.utils.domutils.StringToDOM(xml)\n self.assertRaises(ExtraContentError, st.personName.Factory, _dom_node=dom.documentElement)\n xml = xml.replace('personName', 'extendedName')\n dom = pyxb_114.utils.domutils.StringToDOM(xml)\n instance = st.extendedName.Factory(_dom_node=dom.documentElement)\n xml = xml.replace('extendedName', 'restExtName')\n dom = pyxb_114.utils.domutils.StringToDOM(xml)\n instance = restExtName.Factory(_dom_node=dom.documentElement)\n\n def testUnionExtension (self):\n e = morewords('one')\n self.assertTrue(isinstance(e, st.english))\n self.assertTrue(uMorewords._IsValidValue(e))\n self.assertEqual(e, st.english.one)\n self.assertEqual(e, uMorewords.one)\n w = morewords('un')\n self.assertTrue(isinstance(w, st.welsh))\n self.assertTrue(uMorewords._IsValidValue(w))\n self.assertEqual(w, st.welsh.un)\n self.assertEqual(w, uMorewords.un)\n n = morewords('ichi')\n self.assertTrue(uMorewords._IsValidValue(n))\n self.assertEqual(n, uMorewords.ichi)\n\nif __name__ == '__main__':\n unittest.main()\n \n \n", "spans": [{"start": 1071, "end": 1115, "label": "api_key", "value_type": "generic_base64_secret", "context": "assignment", "synthetic": true, "value": "QUG7oJy4rMbrI2SWwJXGr+dYpZ+0/b5Cbk8byEwys08="}], "hard_negatives": [{"start": 2214, "end": 2231, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "com.example.focus"}, {"start": 2568, "end": 2920, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nUpzgsHnM+pxKNA9y5//k4fi1+ZGhIBF3RLsPpvFYlJEnzHHbWCfPYS5VyZAVKlu+\n8DSVQuygIFaQsIaxyHjqABt0BN+vpDElghF3NVR6d5mK3WY3IKe6Bptxjf/1A7Qq\nkSsEqsw0eoinK8/N5r445Efjk2CaLAarHK7d59e+nmrEoI0UsO4MgrjkBbP/bmEJ\n0YIPUUibQ7A4VJ7JoujMe+m35P8Ho4c7w4JNMvDvlKv0do/aKWmq4XSnt6XvWD89\nhpAVOCbb82pfCbkT5CfUzfS9HAs+dPzxzyt1Yw==\n-----END PUBLIC KEY-----"}, {"start": 5035, "end": 5071, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "757275bc-0e34-46bb-adc5-0e81413564e5"}]} -{"id": "ghcc-00068-e7e1b09fa0d913c2", "source": "codeparrot/github-code-clean", "repo": "a-lucas/angular.js", "license": "mit", "language": "HTML", "path": "build/docs/partials/api/ng/directive/ngSelected.html", "text": " Improve this Doc\n\n\n\n\n\n  View Source\n\n\n\n
\n

ngSelected

\n
    \n \n
  1. \n - directive in module ng\n
  2. \n
\n
\n\n\n\n
\n

Sets the selected attribute on the element, if the expression inside ngSelected is truthy.

\n

A special directive is necessary because we cannot use interpolation inside the selected\nattribute. See the interpolation guide for more info.

\n\n
\n\n\n\n\n
\n \n\n \n

Directive Info

\n
    \n \n
  • This directive executes at priority level 100.
  • \n \n
\n\n \n

Usage

\n
\n \n
    \n
  • as attribute:\n
    <OPTION
      ng-selected="expression">
    ...
    </OPTION>
    \n
  • \n \n
\n \n
\n

Arguments

\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
ParamTypeDetails
\n ngSelected\n \n \n \n expression\n \n

If the expression is truthy,\n then special attribute "selected" will be set on the element

\n\n \n
\n\n
\n \n\n\n \n

Example

\n\n

\n \n\n
\n\n \n
\n name=\"index.html\"\n language=\"html\"\n type=\"html\">\n
<label>Check me to select: <input type="checkbox" ng-model="selected"></label><br/>
<select aria-label="ngSelected demo">
  <option>Hello!</option>
  <option id="greet" ng-selected="selected">Greetings!</option>
</select>
\n
\n \n
\n
it('should select Greetings!', function() {
  expect(element(by.id('greet')).getAttribute('selected')).toBeFalsy();
  element(by.model('selected')).click();
  expect(element(by.id('greet')).getAttribute('selected')).toBeTruthy();
});
\n
\n \n\n \n
\n
\n\n\n

\n\n
\n\n\n", "spans": [], "hard_negatives": [{"start": 299, "end": 363, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "dd0849d9022de7e05fef0a23b93af1c496901be315a4cebc01522cd4aa821f64"}, {"start": 2442, "end": 2462, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "lisajuarez@localhost"}]} -{"id": "ghcc-00068-1cff8850b650854b", "source": "codeparrot/github-code-clean", "repo": "myelin/elasticsearch", "license": "apache-2.0", "language": "Java", "path": "core/src/main/java/org/elasticsearch/index/store/Store.java", "text": "/*\n * Licensed to Elasticsearch under one or more contributor\n * license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright\n * ownership. Elasticsearch licenses this file to you under\n * the Apache License, Version 2.0 (the \"License\"); you may\n * not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\n\npackage org.elasticsearch.index.store;\n\nimport org.apache.lucene.codecs.CodecUtil;\nimport org.apache.lucene.index.CorruptIndexException;\nimport org.apache.lucene.index.IndexCommit;\nimport org.apache.lucene.index.IndexFileNames;\nimport org.apache.lucene.index.IndexFormatTooNewException;\nimport org.apache.lucene.index.IndexFormatTooOldException;\nimport org.apache.lucene.index.IndexNotFoundException;\nimport org.apache.lucene.index.IndexWriter;\nimport org.apache.lucene.index.SegmentCommitInfo;\nimport org.apache.lucene.index.SegmentInfos;\nimport org.apache.lucene.store.AlreadyClosedException;\nimport org.apache.lucene.store.BufferedChecksum;\nimport org.apache.lucene.store.ByteArrayDataInput;\nimport org.apache.lucene.store.ChecksumIndexInput;\nimport org.apache.lucene.store.Directory;\nimport org.apache.lucene.store.FilterDirectory;\nimport org.apache.lucene.store.IOContext;\nimport org.apache.lucene.store.IndexInput;\nimport org.apache.lucene.store.IndexOutput;\nimport org.apache.lucene.store.Lock;\nimport org.apache.lucene.store.SimpleFSDirectory;\nimport org.apache.lucene.util.ArrayUtil;\nimport org.apache.lucene.util.BytesRef;\nimport org.apache.lucene.util.BytesRefBuilder;\nimport org.apache.lucene.util.IOUtils;\nimport org.apache.lucene.util.Version;\nimport org.elasticsearch.ElasticsearchException;\nimport org.elasticsearch.ExceptionsHelper;\nimport org.elasticsearch.common.UUIDs;\nimport org.elasticsearch.common.bytes.BytesReference;\nimport org.elasticsearch.common.io.Streams;\nimport org.elasticsearch.common.io.stream.BytesStreamOutput;\nimport org.elasticsearch.common.io.stream.StreamInput;\nimport org.elasticsearch.common.io.stream.StreamOutput;\nimport org.elasticsearch.common.io.stream.Writeable;\nimport org.elasticsearch.common.logging.ESLogger;\nimport org.elasticsearch.common.logging.Loggers;\nimport org.elasticsearch.common.lucene.Lucene;\nimport org.elasticsearch.common.lucene.store.ByteArrayIndexInput;\nimport org.elasticsearch.common.lucene.store.InputStreamIndexInput;\nimport org.elasticsearch.common.settings.Setting;\nimport org.elasticsearch.common.settings.Setting.Property;\nimport org.elasticsearch.common.settings.Settings;\nimport org.elasticsearch.common.unit.TimeValue;\nimport org.elasticsearch.common.util.Callback;\nimport org.elasticsearch.common.util.SingleObjectCache;\nimport org.elasticsearch.common.util.concurrent.AbstractRefCounted;\nimport org.elasticsearch.common.util.concurrent.RefCounted;\nimport org.elasticsearch.common.util.iterable.Iterables;\nimport org.elasticsearch.env.ShardLock;\nimport org.elasticsearch.index.IndexSettings;\nimport org.elasticsearch.index.engine.Engine;\nimport org.elasticsearch.index.shard.AbstractIndexShardComponent;\nimport org.elasticsearch.index.shard.ShardId;\n\nimport java.io.Closeable;\nimport java.io.EOFException;\nimport java.io.FileNotFoundException;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.nio.file.NoSuchFileException;\nimport java.nio.file.Path;\nimport java.util.ArrayList;\nimport java.util.Collections;\nimport java.util.Comparator;\nimport java.util.HashMap;\nimport java.util.Iterator;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.concurrent.atomic.AtomicBoolean;\nimport java.util.concurrent.locks.ReentrantReadWriteLock;\nimport java.util.zip.CRC32;\nimport java.util.zip.Checksum;\n\nimport static java.util.Collections.emptyMap;\nimport static java.util.Collections.unmodifiableMap;\n\n/**\n * A Store provides plain access to files written by an elasticsearch index shard. Each shard\n * has a dedicated store that is uses to access Lucene's Directory which represents the lowest level\n * of file abstraction in Lucene used to read and write Lucene indices.\n * This class also provides access to metadata information like checksums for committed files. A committed\n * file is a file that belongs to a segment written by a Lucene commit. Files that have not been committed\n * ie. created during a merge or a shard refresh / NRT reopen are not considered in the MetadataSnapshot.\n *

\n * Note: If you use a store it's reference count should be increased before using it by calling #incRef and a\n * corresponding #decRef must be called in a try/finally block to release the store again ie.:\n *

\n *      store.incRef();\n *      try {\n *        // use the store...\n *\n *      } finally {\n *          store.decRef();\n *      }\n * 
\n */\npublic class Store extends AbstractIndexShardComponent implements Closeable, RefCounted {\n static final String CODEC = \"store\";\n static final int VERSION_WRITE_THROWABLE= 2; // we write throwable since 2.0\n static final int VERSION_STACK_TRACE = 1; // we write the stack trace too since 1.4.0\n static final int VERSION_START = 0;\n static final int VERSION = VERSION_WRITE_THROWABLE;\n static final String CORRUPTED = \"corrupted_\";\n public static final Setting INDEX_STORE_STATS_REFRESH_INTERVAL_SETTING =\n Setting.timeSetting(\"index.store.stats_refresh_interval\", TimeValue.timeValueSeconds(10), Property.IndexScope);\n\n private final AtomicBoolean isClosed = new AtomicBoolean(false);\n private final StoreDirectory directory;\n private final ReentrantReadWriteLock metadataLock = new ReentrantReadWriteLock();\n private final ShardLock shardLock;\n private final OnClose onClose;\n private final SingleObjectCache statsCache;\n\n private final AbstractRefCounted refCounter = new AbstractRefCounted(\"store\") {\n @Override\n protected void closeInternal() {\n // close us once we are done\n Store.this.closeInternal();\n }\n };\n\n public Store(ShardId shardId, IndexSettings indexSettings, DirectoryService directoryService, ShardLock shardLock) throws IOException {\n this(shardId, indexSettings, directoryService, shardLock, OnClose.EMPTY);\n }\n\n public Store(ShardId shardId, IndexSettings indexSettings, DirectoryService directoryService, ShardLock shardLock, OnClose onClose) throws IOException {\n super(shardId, indexSettings);\n final Settings settings = indexSettings.getSettings();\n this.directory = new StoreDirectory(directoryService.newDirectory(), Loggers.getLogger(\"index.store.deletes\", settings, shardId));\n this.shardLock = shardLock;\n this.onClose = onClose;\n final TimeValue refreshInterval = indexSettings.getValue(INDEX_STORE_STATS_REFRESH_INTERVAL_SETTING);\n this.statsCache = new StoreStatsCache(refreshInterval, directory, directoryService);\n logger.debug(\"store stats are refreshed with refresh_interval [{}]\", refreshInterval);\n\n assert onClose != null;\n assert shardLock != null;\n assert shardLock.getShardId().equals(shardId);\n }\n\n public Directory directory() {\n ensureOpen();\n return directory;\n }\n\n /**\n * Returns the last committed segments info for this store\n *\n * @throws IOException if the index is corrupted or the segments file is not present\n */\n public SegmentInfos readLastCommittedSegmentsInfo() throws IOException {\n failIfCorrupted();\n try {\n return readSegmentsInfo(null, directory());\n } catch (CorruptIndexException ex) {\n markStoreCorrupted(ex);\n throw ex;\n }\n }\n\n /**\n * Returns the segments info for the given commit or for the latest commit if the given commit is null\n *\n * @throws IOException if the index is corrupted or the segments file is not present\n */\n private static SegmentInfos readSegmentsInfo(IndexCommit commit, Directory directory) throws IOException {\n assert commit == null || commit.getDirectory() == directory;\n try {\n return commit == null ? Lucene.readSegmentInfos(directory) : Lucene.readSegmentInfos(commit);\n } catch (EOFException eof) {\n // TODO this should be caught by lucene - EOF is almost certainly an index corruption\n throw new CorruptIndexException(\"Read past EOF while reading segment infos\", \"commit(\" + commit + \")\", eof);\n } catch (IOException exception) {\n throw exception; // IOExceptions like too many open files are not necessarily a corruption - just bubble it up\n } catch (Exception ex) {\n throw new CorruptIndexException(\"Hit unexpected exception while reading segment infos\", \"commit(\" + commit + \")\", ex);\n }\n\n }\n\n final void ensureOpen() {\n if (this.refCounter.refCount() <= 0) {\n throw new AlreadyClosedException(\"store is already closed\");\n }\n }\n\n /**\n * Returns a new MetadataSnapshot for the latest commit in this store or\n * an empty snapshot if no index exists or can not be opened.\n *\n * @throws CorruptIndexException if the lucene index is corrupted. This can be caused by a checksum mismatch or an\n * unexpected exception when opening the index reading the segments file.\n * @throws IndexFormatTooOldException if the lucene index is too old to be opened.\n * @throws IndexFormatTooNewException if the lucene index is too new to be opened.\n */\n public MetadataSnapshot getMetadataOrEmpty() throws IOException {\n try {\n return getMetadata(null);\n } catch (IndexNotFoundException ex) {\n // that's fine - happens all the time no need to log\n } catch (FileNotFoundException | NoSuchFileException ex) {\n logger.info(\"Failed to open / find files while reading metadata snapshot\");\n }\n return MetadataSnapshot.EMPTY;\n }\n\n /**\n * Returns a new MetadataSnapshot for the latest commit in this store.\n *\n * @throws CorruptIndexException if the lucene index is corrupted. This can be caused by a checksum mismatch or an\n * unexpected exception when opening the index reading the segments file.\n * @throws IndexFormatTooOldException if the lucene index is too old to be opened.\n * @throws IndexFormatTooNewException if the lucene index is too new to be opened.\n * @throws FileNotFoundException if one or more files referenced by a commit are not present.\n * @throws NoSuchFileException if one or more files referenced by a commit are not present.\n * @throws IndexNotFoundException if no index / valid commit-point can be found in this store\n */\n public MetadataSnapshot getMetadata() throws IOException {\n return getMetadata(null);\n }\n\n /**\n * Returns a new MetadataSnapshot for the given commit. If the given commit is null\n * the latest commit point is used.\n *\n * @throws CorruptIndexException if the lucene index is corrupted. This can be caused by a checksum mismatch or an\n * unexpected exception when opening the index reading the segments file.\n * @throws IndexFormatTooOldException if the lucene index is too old to be opened.\n * @throws IndexFormatTooNewException if the lucene index is too new to be opened.\n * @throws FileNotFoundException if one or more files referenced by a commit are not present.\n * @throws NoSuchFileException if one or more files referenced by a commit are not present.\n * @throws IndexNotFoundException if the commit point can't be found in this store\n */\n public MetadataSnapshot getMetadata(IndexCommit commit) throws IOException {\n ensureOpen();\n failIfCorrupted();\n metadataLock.readLock().lock();\n try {\n return new MetadataSnapshot(commit, directory, logger);\n } catch (CorruptIndexException | IndexFormatTooOldException | IndexFormatTooNewException ex) {\n markStoreCorrupted(ex);\n throw ex;\n } finally {\n metadataLock.readLock().unlock();\n }\n }\n\n\n /**\n * Renames all the given files form the key of the map to the\n * value of the map. All successfully renamed files are removed from the map in-place.\n */\n public void renameTempFilesSafe(Map tempFileMap) throws IOException {\n // this works just like a lucene commit - we rename all temp files and once we successfully\n // renamed all the segments we rename the commit to ensure we don't leave half baked commits behind.\n final Map.Entry[] entries = tempFileMap.entrySet().toArray(new Map.Entry[tempFileMap.size()]);\n ArrayUtil.timSort(entries, new Comparator>() {\n @Override\n public int compare(Map.Entry o1, Map.Entry o2) {\n String left = o1.getValue();\n String right = o2.getValue();\n if (left.startsWith(IndexFileNames.SEGMENTS) || right.startsWith(IndexFileNames.SEGMENTS)) {\n if (left.startsWith(IndexFileNames.SEGMENTS) == false) {\n return -1;\n } else if (right.startsWith(IndexFileNames.SEGMENTS) == false) {\n return 1;\n }\n }\n return left.compareTo(right);\n }\n });\n metadataLock.writeLock().lock();\n // we make sure that nobody fetches the metadata while we do this rename operation here to ensure we don't\n // get exceptions if files are still open.\n try (Lock writeLock = directory().obtainLock(IndexWriter.WRITE_LOCK_NAME)) {\n for (Map.Entry entry : entries) {\n String tempFile = entry.getKey();\n String origFile = entry.getValue();\n // first, go and delete the existing ones\n try {\n directory.deleteFile(origFile);\n } catch (FileNotFoundException | NoSuchFileException e) {\n } catch (Throwable ex) {\n logger.debug(\"failed to delete file [{}]\", ex, origFile);\n }\n // now, rename the files... and fail it it won't work\n this.renameFile(tempFile, origFile);\n final String remove = tempFileMap.remove(tempFile);\n assert remove != null;\n }\n } finally {\n metadataLock.writeLock().unlock();\n }\n\n }\n\n public StoreStats stats() throws IOException {\n ensureOpen();\n return statsCache.getOrRefresh();\n }\n\n public void renameFile(String from, String to) throws IOException {\n ensureOpen();\n directory.renameFile(from, to);\n }\n\n /**\n * Increments the refCount of this Store instance. RefCounts are used to determine when a\n * Store can be closed safely, i.e. as soon as there are no more references. Be sure to always call a\n * corresponding {@link #decRef}, in a finally clause; otherwise the store may never be closed. Note that\n * {@link #close} simply calls decRef(), which means that the Store will not really be closed until {@link\n * #decRef} has been called for all outstanding references.\n *

\n * Note: Close can safely be called multiple times.\n *\n * @throws AlreadyClosedException iff the reference counter can not be incremented.\n * @see #decRef\n * @see #tryIncRef()\n */\n @Override\n public final void incRef() {\n refCounter.incRef();\n }\n\n /**\n * Tries to increment the refCount of this Store instance. This method will return true iff the refCount was\n * incremented successfully otherwise false. RefCounts are used to determine when a\n * Store can be closed safely, i.e. as soon as there are no more references. Be sure to always call a\n * corresponding {@link #decRef}, in a finally clause; otherwise the store may never be closed. Note that\n * {@link #close} simply calls decRef(), which means that the Store will not really be closed until {@link\n * #decRef} has been called for all outstanding references.\n *

\n * Note: Close can safely be called multiple times.\n *\n * @see #decRef()\n * @see #incRef()\n */\n @Override\n public final boolean tryIncRef() {\n return refCounter.tryIncRef();\n }\n\n /**\n * Decreases the refCount of this Store instance.If the refCount drops to 0, then this\n * store is closed.\n *\n * @see #incRef\n */\n @Override\n public final void decRef() {\n refCounter.decRef();\n }\n\n @Override\n public void close() {\n\n if (isClosed.compareAndSet(false, true)) {\n // only do this once!\n decRef();\n logger.debug(\"store reference count on close: {}\", refCounter.refCount());\n }\n }\n\n private void closeInternal() {\n try {\n try {\n directory.innerClose(); // this closes the distributorDirectory as well\n } finally {\n onClose.handle(shardLock);\n }\n } catch (IOException e) {\n logger.debug(\"failed to close directory\", e);\n } finally {\n IOUtils.closeWhileHandlingException(shardLock);\n }\n }\n\n\n /**\n * Reads a MetadataSnapshot from the given index locations or returns an empty snapshot if it can't be read.\n *\n * @throws IOException if the index we try to read is corrupted\n */\n public static MetadataSnapshot readMetadataSnapshot(Path indexLocation, ShardId shardId, ESLogger logger) throws IOException {\n try (Directory dir = new SimpleFSDirectory(indexLocation)) {\n failIfCorrupted(dir, shardId);\n return new MetadataSnapshot(null, dir, logger);\n } catch (IndexNotFoundException ex) {\n // that's fine - happens all the time no need to log\n } catch (FileNotFoundException | NoSuchFileException ex) {\n logger.info(\"Failed to open / find files while reading metadata snapshot\");\n }\n return MetadataSnapshot.EMPTY;\n }\n\n /**\n * Returns true iff the given location contains an index an the index\n * can be successfully opened. This includes reading the segment infos and possible\n * corruption markers.\n */\n public static boolean canOpenIndex(ESLogger logger, Path indexLocation, ShardId shardId) throws IOException {\n try {\n tryOpenIndex(indexLocation, shardId, logger);\n } catch (Exception ex) {\n logger.trace(\"Can't open index for path [{}]\", ex, indexLocation);\n return false;\n }\n return true;\n }\n\n /**\n * Tries to open an index for the given location. This includes reading the\n * segment infos and possible corruption markers. If the index can not\n * be opened, an exception is thrown\n */\n public static void tryOpenIndex(Path indexLocation, ShardId shardId, ESLogger logger) throws IOException {\n try (Directory dir = new SimpleFSDirectory(indexLocation)) {\n failIfCorrupted(dir, shardId);\n SegmentInfos segInfo = Lucene.readSegmentInfos(dir);\n logger.trace(\"{} loaded segment info [{}]\", shardId, segInfo);\n }\n }\n\n /**\n * The returned IndexOutput might validate the files checksum if the file has been written with a newer lucene version\n * and the metadata holds the necessary information to detect that it was been written by Lucene 4.8 or newer. If it has only\n * a legacy checksum, returned IndexOutput will not verify the checksum.\n *

\n * Note: Checksums are calculated nevertheless since lucene does it by default sicne version 4.8.0. This method only adds the\n * verification against the checksum in the given metadata and does not add any significant overhead.\n */\n public IndexOutput createVerifyingOutput(String fileName, final StoreFileMetaData metadata, final IOContext context) throws IOException {\n IndexOutput output = directory().createOutput(fileName, context);\n boolean success = false;\n try {\n assert metadata.writtenBy() != null;\n assert metadata.writtenBy().onOrAfter(StoreFileMetaData.FIRST_LUCENE_CHECKSUM_VERSION);\n output = new LuceneVerifyingIndexOutput(metadata, output);\n success = true;\n } finally {\n if (success == false) {\n IOUtils.closeWhileHandlingException(output);\n }\n }\n return output;\n }\n\n public static void verify(IndexOutput output) throws IOException {\n if (output instanceof VerifyingIndexOutput) {\n ((VerifyingIndexOutput) output).verify();\n }\n }\n\n public IndexInput openVerifyingInput(String filename, IOContext context, StoreFileMetaData metadata) throws IOException {\n assert metadata.writtenBy() != null;\n assert metadata.writtenBy().onOrAfter(StoreFileMetaData.FIRST_LUCENE_CHECKSUM_VERSION);\n return new VerifyingIndexInput(directory().openInput(filename, context));\n }\n\n public static void verify(IndexInput input) throws IOException {\n if (input instanceof VerifyingIndexInput) {\n ((VerifyingIndexInput) input).verify();\n }\n }\n\n public boolean checkIntegrityNoException(StoreFileMetaData md) {\n return checkIntegrityNoException(md, directory());\n }\n\n public static boolean checkIntegrityNoException(StoreFileMetaData md, Directory directory) {\n try {\n checkIntegrity(md, directory);\n return true;\n } catch (IOException e) {\n return false;\n }\n }\n\n public static void checkIntegrity(final StoreFileMetaData md, final Directory directory) throws IOException {\n try (IndexInput input = directory.openInput(md.name(), IOContext.READONCE)) {\n if (input.length() != md.length()) { // first check the length no matter how old this file is\n throw new CorruptIndexException(\"expected length=\" + md.length() + \" != actual length: \" + input.length() + \" : file truncated?\", input);\n }\n // throw exception if the file is corrupt\n String checksum = Store.digestToString(CodecUtil.checksumEntireFile(input));\n // throw exception if metadata is inconsistent\n if (!checksum.equals(md.checksum())) {\n throw new CorruptIndexException(\"inconsistent metadata: lucene checksum=\" + checksum +\n \", metadata checksum=\" + md.checksum(), input);\n }\n }\n }\n\n public boolean isMarkedCorrupted() throws IOException {\n ensureOpen();\n /* marking a store as corrupted is basically adding a _corrupted to all\n * the files. This prevent\n */\n final String[] files = directory().listAll();\n for (String file : files) {\n if (file.startsWith(CORRUPTED)) {\n return true;\n }\n }\n return false;\n }\n\n /**\n * Deletes all corruption markers from this store.\n */\n public void removeCorruptionMarker() throws IOException {\n ensureOpen();\n final Directory directory = directory();\n IOException firstException = null;\n final String[] files = directory.listAll();\n for (String file : files) {\n if (file.startsWith(CORRUPTED)) {\n try {\n directory.deleteFile(file);\n } catch (IOException ex) {\n if (firstException == null) {\n firstException = ex;\n } else {\n firstException.addSuppressed(ex);\n }\n }\n }\n }\n if (firstException != null) {\n throw firstException;\n }\n }\n\n public void failIfCorrupted() throws IOException {\n ensureOpen();\n failIfCorrupted(directory, shardId);\n }\n\n private static final void failIfCorrupted(Directory directory, ShardId shardId) throws IOException {\n final String[] files = directory.listAll();\n List ex = new ArrayList<>();\n for (String file : files) {\n if (file.startsWith(CORRUPTED)) {\n try (ChecksumIndexInput input = directory.openChecksumInput(file, IOContext.READONCE)) {\n int version = CodecUtil.checkHeader(input, CODEC, VERSION_START, VERSION);\n\n if (version == VERSION_WRITE_THROWABLE) {\n final int size = input.readVInt();\n final byte[] buffer = new byte[size];\n input.readBytes(buffer, 0, buffer.length);\n StreamInput in = StreamInput.wrap(buffer);\n Throwable t = in.readThrowable();\n if (t instanceof CorruptIndexException) {\n ex.add((CorruptIndexException) t);\n } else {\n ex.add(new CorruptIndexException(t.getMessage(), \"preexisting_corruption\", t));\n }\n } else {\n assert version == VERSION_START || version == VERSION_STACK_TRACE;\n String msg = input.readString();\n StringBuilder builder = new StringBuilder(shardId.toString());\n builder.append(\" Preexisting corrupted index [\");\n builder.append(file).append(\"] caused by: \");\n builder.append(msg);\n if (version == VERSION_STACK_TRACE) {\n builder.append(System.lineSeparator());\n builder.append(input.readString());\n }\n ex.add(new CorruptIndexException(builder.toString(), \"preexisting_corruption\"));\n }\n CodecUtil.checkFooter(input);\n }\n }\n }\n if (ex.isEmpty() == false) {\n ExceptionsHelper.rethrowAndSuppress(ex);\n }\n }\n\n /**\n * This method deletes every file in this store that is not contained in the given source meta data or is a\n * legacy checksum file. After the delete it pulls the latest metadata snapshot from the store and compares it\n * to the given snapshot. If the snapshots are inconsistent an illegal state exception is thrown\n *\n * @param reason the reason for this cleanup operation logged for each deleted file\n * @param sourceMetaData the metadata used for cleanup. all files in this metadata should be kept around.\n * @throws IOException if an IOException occurs\n * @throws IllegalStateException if the latest snapshot in this store differs from the given one after the cleanup.\n */\n public void cleanupAndVerify(String reason, MetadataSnapshot sourceMetaData) throws IOException {\n metadataLock.writeLock().lock();\n try (Lock writeLock = directory.obtainLock(IndexWriter.WRITE_LOCK_NAME)) {\n final StoreDirectory dir = directory;\n for (String existingFile : dir.listAll()) {\n if (Store.isAutogenerated(existingFile) || sourceMetaData.contains(existingFile)) {\n continue; // don't delete snapshot file, or the checksums file (note, this is extra protection since the Store won't delete checksum)\n }\n try {\n dir.deleteFile(reason, existingFile);\n // FNF should not happen since we hold a write lock?\n } catch (IOException ex) {\n if (existingFile.startsWith(IndexFileNames.SEGMENTS)\n || existingFile.equals(IndexFileNames.OLD_SEGMENTS_GEN)) {\n // TODO do we need to also fail this if we can't delete the pending commit file?\n // if one of those files can't be deleted we better fail the cleanup otherwise we might leave an old commit point around?\n throw new IllegalStateException(\"Can't delete \" + existingFile + \" - cleanup failed\", ex);\n }\n logger.debug(\"failed to delete file [{}]\", ex, existingFile);\n // ignore, we don't really care, will get deleted later on\n }\n }\n final Store.MetadataSnapshot metadataOrEmpty = getMetadata();\n verifyAfterCleanup(sourceMetaData, metadataOrEmpty);\n } finally {\n metadataLock.writeLock().unlock();\n }\n }\n\n // pkg private for testing\n final void verifyAfterCleanup(MetadataSnapshot sourceMetaData, MetadataSnapshot targetMetaData) {\n final RecoveryDiff recoveryDiff = targetMetaData.recoveryDiff(sourceMetaData);\n if (recoveryDiff.identical.size() != recoveryDiff.size()) {\n if (recoveryDiff.missing.isEmpty()) {\n for (StoreFileMetaData meta : recoveryDiff.different) {\n StoreFileMetaData local = targetMetaData.get(meta.name());\n StoreFileMetaData remote = sourceMetaData.get(meta.name());\n // if we have different files the they must have no checksums otherwise something went wrong during recovery.\n // we have that problem when we have an empty index is only a segments_1 file then we can't tell if it's a Lucene 4.8 file\n // and therefore no checksum. That isn't much of a problem since we simply copy it over anyway but those files come out as\n // different in the diff. That's why we have to double check here again if the rest of it matches.\n\n // all is fine this file is just part of a commit or a segment that is different\n final boolean same = local.isSame(remote);\n\n // this check ensures that the two files are consistent ie. if we don't have checksums only the rest needs to match we are just\n // verifying that we are consistent on both ends source and target\n final boolean hashAndLengthEqual = (\n local.checksum() == null\n && remote.checksum() == null\n && local.hash().equals(remote.hash())\n && local.length() == remote.length());\n final boolean consistent = hashAndLengthEqual || same;\n if (consistent == false) {\n logger.debug(\"Files are different on the recovery target: {} \", recoveryDiff);\n throw new IllegalStateException(\"local version: \" + local + \" is different from remote version after recovery: \" + remote, null);\n }\n }\n } else {\n logger.debug(\"Files are missing on the recovery target: {} \", recoveryDiff);\n throw new IllegalStateException(\"Files are missing on the recovery target: [different=\"\n + recoveryDiff.different + \", missing=\" + recoveryDiff.missing + ']', null);\n }\n }\n }\n\n /**\n * Returns the current reference count.\n */\n public int refCount() {\n return refCounter.refCount();\n }\n\n private static final class StoreDirectory extends FilterDirectory {\n\n private final ESLogger deletesLogger;\n\n StoreDirectory(Directory delegateDirectory, ESLogger deletesLogger) throws IOException {\n String token = ${{ secrets.TOKEN }};\n super(delegateDirectory);\n this.deletesLogger = deletesLogger;\n }\n\n\n @Override\n public void close() throws IOException {\n assert false : \"Nobody should close this directory except of the Store itself\";\n }\n\n public void deleteFile(String msg, String name) throws IOException {\n deletesLogger.trace(\"{}: delete file {}\", msg, name);\n super.deleteFile(name);\n }\n\n @Override\n public void deleteFile(String name) throws IOException {\n deleteFile(\"StoreDirectory.deleteFile\", name);\n }\n\n private void innerClose() throws IOException {\n super.close();\n }\n\n @Override\n public String toString() {\n return \"store(\" + in.toString() + \")\";\n }\n\n }\n\n /**\n * Represents a snapshot of the current directory build from the latest Lucene commit.\n * Only files that are part of the last commit are considered in this datastrucutre.\n * For backwards compatibility the snapshot might include legacy checksums that\n * are derived from a dedicated checksum file written by older elasticsearch version pre 1.3\n *

\n * Note: This class will ignore the segments.gen file since it's optional and might\n * change concurrently for safety reasons.\n *\n * @see StoreFileMetaData\n */\n public final static class MetadataSnapshot implements Iterable, Writeable {\n private final Map metadata;\n\n public static final MetadataSnapshot EMPTY = new MetadataSnapshot();\n\n private final Map commitUserData;\n\n private final long numDocs;\n\n public MetadataSnapshot(Map metadata, Map commitUserData, long numDocs) {\n this.metadata = metadata;\n this.commitUserData = commitUserData;\n this.numDocs = numDocs;\n }\n\n MetadataSnapshot() {\n metadata = emptyMap();\n commitUserData = emptyMap();\n numDocs = 0;\n }\n\n MetadataSnapshot(IndexCommit commit, Directory directory, ESLogger logger) throws IOException {\n LoadedMetadata loadedMetadata = loadMetadata(commit, directory, logger);\n metadata = loadedMetadata.fileMetadata;\n commitUserData = loadedMetadata.userData;\n numDocs = loadedMetadata.numDocs;\n assert metadata.isEmpty() || numSegmentFiles() == 1 : \"numSegmentFiles: \" + numSegmentFiles();\n }\n\n /**\n * Read from a stream.\n */\n public MetadataSnapshot(StreamInput in) throws IOException {\n final int size = in.readVInt();\n Map metadata = new HashMap<>();\n for (int i = 0; i < size; i++) {\n StoreFileMetaData meta = new StoreFileMetaData(in);\n metadata.put(meta.name(), meta);\n }\n Map commitUserData = new HashMap<>();\n int num = in.readVInt();\n for (int i = num; i > 0; i--) {\n commitUserData.put(in.readString(), in.readString());\n }\n\n this.metadata = unmodifiableMap(metadata);\n this.commitUserData = unmodifiableMap(commitUserData);\n this.numDocs = in.readLong();\n assert metadata.isEmpty() || numSegmentFiles() == 1 : \"numSegmentFiles: \" + numSegmentFiles();\n }\n\n @Override\n public void writeTo(StreamOutput out) throws IOException {\n out.writeVInt(this.metadata.size());\n for (StoreFileMetaData meta : this) {\n meta.writeTo(out);\n }\n out.writeVInt(commitUserData.size());\n for (Map.Entry entry : commitUserData.entrySet()) {\n out.writeString(entry.getKey());\n out.writeString(entry.getValue());\n }\n out.writeLong(numDocs);\n }\n\n /**\n * Returns the number of documents in this store snapshot\n */\n public long getNumDocs() {\n return numDocs;\n }\n\n static class LoadedMetadata {\n final Map fileMetadata;\n final Map userData;\n final long numDocs;\n\n LoadedMetadata(Map fileMetadata, Map userData, long numDocs) {\n this.fileMetadata = fileMetadata;\n this.userData = userData;\n this.numDocs = numDocs;\n }\n }\n\n static LoadedMetadata loadMetadata(IndexCommit commit, Directory directory, ESLogger logger) throws IOException {\n long numDocs;\n Map builder = new HashMap<>();\n Map commitUserDataBuilder = new HashMap<>();\n try {\n final SegmentInfos segmentCommitInfos = Store.readSegmentsInfo(commit, directory);\n numDocs = Lucene.getNumDocs(segmentCommitInfos);\n commitUserDataBuilder.putAll(segmentCommitInfos.getUserData());\n @SuppressWarnings(\"deprecation\")\n Version maxVersion = segmentCommitInfos.getMinSegmentLuceneVersion(); // we don't know which version was used to write so we take the max version.\n for (SegmentCommitInfo info : segmentCommitInfos) {\n final Version version = info.info.getVersion();\n if (version == null) {\n // version is written since 3.1+: we should have already hit IndexFormatTooOld.\n throw new IllegalArgumentException(\"expected valid version value: \" + info.info.toString());\n }\n if (version.onOrAfter(maxVersion)) {\n maxVersion = version;\n }\n for (String file : info.files()) {\n if (version.onOrAfter(StoreFileMetaData.FIRST_LUCENE_CHECKSUM_VERSION)) {\n checksumFromLuceneFile(directory, file, builder, logger, version, SEGMENT_INFO_EXTENSION.equals(IndexFileNames.getExtension(file)));\n } else {\n throw new IllegalStateException(\"version must be onOrAfter: \" + StoreFileMetaData.FIRST_LUCENE_CHECKSUM_VERSION + \" but was: \" + version);\n }\n }\n }\n if (maxVersion == null) {\n maxVersion = StoreFileMetaData.FIRST_LUCENE_CHECKSUM_VERSION;\n }\n final String segmentsFile = segmentCommitInfos.getSegmentsFileName();\n if (maxVersion.onOrAfter(StoreFileMetaData.FIRST_LUCENE_CHECKSUM_VERSION)) {\n checksumFromLuceneFile(directory, segmentsFile, builder, logger, maxVersion, true);\n } else {\n throw new IllegalStateException(\"version must be onOrAfter: \" + StoreFileMetaData.FIRST_LUCENE_CHECKSUM_VERSION + \" but was: \" + maxVersion);\n }\n } catch (CorruptIndexException | IndexNotFoundException | IndexFormatTooOldException | IndexFormatTooNewException ex) {\n // we either know the index is corrupted or it's just not there\n throw ex;\n } catch (Throwable ex) {\n try {\n // Lucene checks the checksum after it tries to lookup the codec etc.\n // in that case we might get only IAE or similar exceptions while we are really corrupt...\n // TODO we should check the checksum in lucene if we hit an exception\n logger.warn(\"failed to build store metadata. checking segment info integrity (with commit [{}])\",\n ex, commit == null ? \"no\" : \"yes\");\n Lucene.checkSegmentInfoIntegrity(directory);\n } catch (CorruptIndexException | IndexFormatTooOldException | IndexFormatTooNewException cex) {\n cex.addSuppressed(ex);\n throw cex;\n } catch (Throwable e) {\n // ignore...\n }\n\n throw ex;\n }\n return new LoadedMetadata(unmodifiableMap(builder), unmodifiableMap(commitUserDataBuilder), numDocs);\n }\n\n private static void checksumFromLuceneFile(Directory directory, String file, Map builder,\n ESLogger logger, Version version, boolean readFileAsHash) throws IOException {\n final String checksum;\n final BytesRefBuilder fileHash = new BytesRefBuilder();\n try (final IndexInput in = directory.openInput(file, IOContext.READONCE)) {\n final long length;\n try {\n length = in.length();\n if (length < CodecUtil.footerLength()) {\n // truncated files trigger IAE if we seek negative... these files are really corrupted though\n throw new CorruptIndexException(\"Can't retrieve checksum from file: \" + file + \" file length must be >= \" + CodecUtil.footerLength() + \" but was: \" + in.length(), in);\n }\n if (readFileAsHash) {\n final VerifyingIndexInput verifyingIndexInput = new VerifyingIndexInput(in); // additional safety we checksum the entire file we read the hash for...\n hashFile(fileHash, new InputStreamIndexInput(verifyingIndexInput, length), length);\n checksum = digestToString(verifyingIndexInput.verify());\n } else {\n checksum = digestToString(CodecUtil.retrieveChecksum(in));\n }\n\n } catch (Throwable ex) {\n logger.debug(\"Can retrieve checksum from file [{}]\", ex, file);\n throw ex;\n }\n builder.put(file, new StoreFileMetaData(file, length, checksum, version, fileHash.get()));\n }\n }\n\n /**\n * Computes a strong hash value for small files. Note that this method should only be used for files < 1MB\n */\n public static BytesRef hashFile(Directory directory, String file) throws IOException {\n final BytesRefBuilder fileHash = new BytesRefBuilder();\n try (final IndexInput in = directory.openInput(file, IOContext.READONCE)) {\n hashFile(fileHash, new InputStreamIndexInput(in, in.length()), in.length());\n }\n return fileHash.get();\n }\n\n\n /**\n * Computes a strong hash value for small files. Note that this method should only be used for files < 1MB\n */\n public static void hashFile(BytesRefBuilder fileHash, InputStream in, long size) throws IOException {\n final int len = (int) Math.min(1024 * 1024, size); // for safety we limit this to 1MB\n fileHash.grow(len);\n fileHash.setLength(len);\n final int readBytes = Streams.readFully(in, fileHash.bytes(), 0, len);\n assert readBytes == len : Integer.toString(readBytes) + \" != \" + Integer.toString(len);\n assert fileHash.length() == len : Integer.toString(fileHash.length()) + \" != \" + Integer.toString(len);\n }\n\n @Override\n public Iterator iterator() {\n return metadata.values().iterator();\n }\n\n public StoreFileMetaData get(String name) {\n return metadata.get(name);\n }\n\n public Map asMap() {\n return metadata;\n }\n\n private static final String DEL_FILE_EXTENSION = \"del\"; // legacy delete file\n private static final String LIV_FILE_EXTENSION = \"liv\"; // lucene 5 delete file\n private static final String FIELD_INFOS_FILE_EXTENSION = \"fnm\";\n private static final String SEGMENT_INFO_EXTENSION = \"si\";\n\n /**\n * Returns a diff between the two snapshots that can be used for recovery. The given snapshot is treated as the\n * recovery target and this snapshot as the source. The returned diff will hold a list of files that are:\n *

    \n *
  • identical: they exist in both snapshots and they can be considered the same ie. they don't need to be recovered
  • \n *
  • different: they exist in both snapshots but their they are not identical
  • \n *
  • missing: files that exist in the source but not in the target
  • \n *
\n * This method groups file into per-segment files and per-commit files. A file is treated as\n * identical if and on if all files in it's group are identical. On a per-segment level files for a segment are treated\n * as identical iff:\n *
    \n *
  • all files in this segment have the same checksum
  • \n *
  • all files in this segment have the same length
  • \n *
  • the segments .si files hashes are byte-identical Note: This is a using a perfect hash function, The metadata transfers the .si file content as it's hash
  • \n *
\n *

\n * The .si file contains a lot of diagnostics including a timestamp etc. in the future there might be\n * unique segment identifiers in there hardening this method further.\n *

\n * The per-commit files handles very similar. A commit is composed of the segments_N files as well as generational files like\n * deletes (_x_y.del) or field-info (_x_y.fnm) files. On a per-commit level files for a commit are treated\n * as identical iff:\n *

    \n *
  • all files belonging to this commit have the same checksum
  • \n *
  • all files belonging to this commit have the same length
  • \n *
  • the segments file segments_N files hashes are byte-identical Note: This is a using a perfect hash function, The metadata transfers the segments_N file content as it's hash
  • \n *
\n *

\n * NOTE: this diff will not contain the segments.gen file. This file is omitted on recovery.\n */\n public RecoveryDiff recoveryDiff(MetadataSnapshot recoveryTargetSnapshot) {\n final List identical = new ArrayList<>();\n final List different = new ArrayList<>();\n final List missing = new ArrayList<>();\n final Map> perSegment = new HashMap<>();\n final List perCommitStoreFiles = new ArrayList<>();\n\n for (StoreFileMetaData meta : this) {\n if (IndexFileNames.OLD_SEGMENTS_GEN.equals(meta.name())) { // legacy\n continue; // we don't need that file at all\n }\n final String segmentId = IndexFileNames.parseSegmentName(meta.name());\n final String extension = IndexFileNames.getExtension(meta.name());\n assert FIELD_INFOS_FILE_EXTENSION.equals(extension) == false || IndexFileNames.stripExtension(IndexFileNames.stripSegmentName(meta.name())).isEmpty() : \"FieldInfos are generational but updateable DV are not supported in elasticsearch\";\n if (IndexFileNames.SEGMENTS.equals(segmentId) || DEL_FILE_EXTENSION.equals(extension) || LIV_FILE_EXTENSION.equals(extension)) {\n // only treat del files as per-commit files fnm files are generational but only for upgradable DV\n perCommitStoreFiles.add(meta);\n } else {\n List perSegStoreFiles = perSegment.get(segmentId);\n if (perSegStoreFiles == null) {\n perSegStoreFiles = new ArrayList<>();\n perSegment.put(segmentId, perSegStoreFiles);\n }\n perSegStoreFiles.add(meta);\n }\n }\n final ArrayList identicalFiles = new ArrayList<>();\n for (List segmentFiles : Iterables.concat(perSegment.values(), Collections.singleton(perCommitStoreFiles))) {\n identicalFiles.clear();\n boolean consistent = true;\n for (StoreFileMetaData meta : segmentFiles) {\n StoreFileMetaData storeFileMetaData = recoveryTargetSnapshot.get(meta.name());\n if (storeFileMetaData == null) {\n consistent = false;\n missing.add(meta);\n } else if (storeFileMetaData.isSame(meta) == false) {\n consistent = false;\n different.add(meta);\n } else {\n identicalFiles.add(meta);\n }\n }\n if (consistent) {\n identical.addAll(identicalFiles);\n } else {\n // make sure all files are added - this can happen if only the deletes are different\n different.addAll(identicalFiles);\n }\n }\n RecoveryDiff recoveryDiff = new RecoveryDiff(Collections.unmodifiableList(identical), Collections.unmodifiableList(different), Collections.unmodifiableList(missing));\n assert recoveryDiff.size() == this.metadata.size() - (metadata.containsKey(IndexFileNames.OLD_SEGMENTS_GEN) ? 1 : 0)\n : \"some files are missing recoveryDiff size: [\" + recoveryDiff.size() + \"] metadata size: [\" + this.metadata.size() + \"] contains segments.gen: [\" + metadata.containsKey(IndexFileNames.OLD_SEGMENTS_GEN) + \"]\";\n return recoveryDiff;\n }\n\n /**\n * Returns the number of files in this snapshot\n */\n public int size() {\n return metadata.size();\n }\n\n public Map getCommitUserData() {\n return commitUserData;\n }\n\n /**\n * Returns true iff this metadata contains the given file.\n */\n public boolean contains(String existingFile) {\n return metadata.containsKey(existingFile);\n }\n\n /**\n * Returns the segments file that this metadata snapshot represents or null if the snapshot is empty.\n */\n public StoreFileMetaData getSegmentsFile() {\n for (StoreFileMetaData file : this) {\n if (file.name().startsWith(IndexFileNames.SEGMENTS)) {\n return file;\n }\n }\n assert metadata.isEmpty();\n return null;\n }\n\n private final int numSegmentFiles() { // only for asserts\n int count = 0;\n for (StoreFileMetaData file : this) {\n if (file.name().startsWith(IndexFileNames.SEGMENTS)) {\n count++;\n }\n }\n return count;\n }\n\n /**\n * Returns the sync id of the commit point that this MetadataSnapshot represents.\n *\n * @return sync id if exists, else null\n */\n public String getSyncId() {\n return commitUserData.get(Engine.SYNC_COMMIT_ID);\n }\n }\n\n /**\n * A class representing the diff between a recovery source and recovery target\n *\n * @see MetadataSnapshot#recoveryDiff(org.elasticsearch.index.store.Store.MetadataSnapshot)\n */\n public static final class RecoveryDiff {\n /**\n * Files that exist in both snapshots and they can be considered the same ie. they don't need to be recovered\n */\n public final List identical;\n /**\n * Files that exist in both snapshots but their they are not identical\n */\n public final List different;\n /**\n * Files that exist in the source but not in the target\n */\n public final List missing;\n\n RecoveryDiff(List identical, List different, List missing) {\n this.identical = identical;\n this.different = different;\n this.missing = missing;\n }\n\n /**\n * Returns the sum of the files in this diff.\n */\n public int size() {\n return identical.size() + different.size() + missing.size();\n }\n\n @Override\n public String toString() {\n return \"RecoveryDiff{\" +\n \"identical=\" + identical +\n \", different=\" + different +\n \", missing=\" + missing +\n '}';\n }\n }\n\n\n /**\n * Returns true if the file is auto-generated by the store and shouldn't be deleted during cleanup.\n * This includes write lock and checksum files\n */\n public static boolean isAutogenerated(String name) {\n return IndexWriter.WRITE_LOCK_NAME.equals(name);\n }\n\n /**\n * Produces a string representation of the given digest value.\n */\n public static String digestToString(long digest) {\n return Long.toString(digest, Character.MAX_RADIX);\n }\n\n\n static class LuceneVerifyingIndexOutput extends VerifyingIndexOutput {\n\n private final StoreFileMetaData metadata;\n private long writtenBytes;\n private final long checksumPosition;\n private String actualChecksum;\n private final byte[] footerChecksum = new byte[8]; // this holds the actual footer checksum data written by to this output\n\n LuceneVerifyingIndexOutput(StoreFileMetaData metadata, IndexOutput out) {\n super(out);\n this.metadata = metadata;\n checksumPosition = metadata.length() - 8; // the last 8 bytes are the checksum - we store it in footerChecksum\n }\n\n @Override\n public void verify() throws IOException {\n String footerDigest = null;\n if (metadata.checksum().equals(actualChecksum) && writtenBytes == metadata.length()) {\n ByteArrayIndexInput indexInput = new ByteArrayIndexInput(\"checksum\", this.footerChecksum);\n footerDigest = digestToString(indexInput.readLong());\n if (metadata.checksum().equals(footerDigest)) {\n return;\n }\n }\n throw new CorruptIndexException(\"verification failed (hardware problem?) : expected=\" + metadata.checksum() +\n \" actual=\" + actualChecksum + \" footer=\" + footerDigest +\" writtenLength=\" + writtenBytes + \" expectedLength=\" + metadata.length() +\n \" (resource=\" + metadata.toString() + \")\", \"VerifyingIndexOutput(\" + metadata.name() + \")\");\n }\n\n @Override\n public void writeByte(byte b) throws IOException {\n final long writtenBytes = this.writtenBytes++;\n if (writtenBytes >= checksumPosition) { // we are writing parts of the checksum....\n if (writtenBytes == checksumPosition) {\n readAndCompareChecksum();\n }\n final int index = Math.toIntExact(writtenBytes - checksumPosition);\n if (index < footerChecksum.length) {\n footerChecksum[index] = b;\n if (index == footerChecksum.length-1) {\n verify(); // we have recorded the entire checksum\n }\n } else {\n verify(); // fail if we write more than expected\n throw new AssertionError(\"write past EOF expected length: \" + metadata.length() + \" writtenBytes: \" + writtenBytes);\n }\n }\n out.writeByte(b);\n }\n\n private void readAndCompareChecksum() throws IOException {\n actualChecksum = digestToString(getChecksum());\n if (!metadata.checksum().equals(actualChecksum)) {\n throw new CorruptIndexException(\"checksum failed (hardware problem?) : expected=\" + metadata.checksum() +\n \" actual=\" + actualChecksum +\n \" (resource=\" + metadata.toString() + \")\", \"VerifyingIndexOutput(\" + metadata.name() + \")\");\n }\n }\n\n @Override\n public void writeBytes(byte[] b, int offset, int length) throws IOException {\n if (writtenBytes + length > checksumPosition) {\n for (int i = 0; i < length; i++) { // don't optimze writing the last block of bytes\n writeByte(b[offset+i]);\n }\n } else {\n out.writeBytes(b, offset, length);\n writtenBytes += length;\n }\n }\n }\n\n /**\n * Index input that calculates checksum as data is read from the input.\n *

\n * This class supports random access (it is possible to seek backward and forward) in order to accommodate retry\n * mechanism that is used in some repository plugins (S3 for example). However, the checksum is only calculated on\n * the first read. All consecutive reads of the same data are not used to calculate the checksum.\n */\n static class VerifyingIndexInput extends ChecksumIndexInput {\n private final IndexInput input;\n private final Checksum digest;\n private final long checksumPosition;\n private final byte[] checksum = new byte[8];\n private long verifiedPosition = 0;\n\n public VerifyingIndexInput(IndexInput input) {\n this(input, new BufferedChecksum(new CRC32()));\n }\n\n public VerifyingIndexInput(IndexInput input, Checksum digest) {\n super(\"VerifyingIndexInput(\" + input + \")\");\n this.input = input;\n this.digest = digest;\n checksumPosition = input.length() - 8;\n }\n\n @Override\n public byte readByte() throws IOException {\n long pos = input.getFilePointer();\n final byte b = input.readByte();\n pos++;\n if (pos > verifiedPosition) {\n if (pos <= checksumPosition) {\n digest.update(b);\n } else {\n checksum[(int) (pos - checksumPosition - 1)] = b;\n }\n verifiedPosition = pos;\n }\n return b;\n }\n\n @Override\n public void readBytes(byte[] b, int offset, int len)\n throws IOException {\n long pos = input.getFilePointer();\n input.readBytes(b, offset, len);\n if (pos + len > verifiedPosition) {\n // Conversion to int is safe here because (verifiedPosition - pos) can be at most len, which is integer\n int alreadyVerified = (int) Math.max(0, verifiedPosition - pos);\n if (pos < checksumPosition) {\n if (pos + len < checksumPosition) {\n digest.update(b, offset + alreadyVerified, len - alreadyVerified);\n } else {\n int checksumOffset = (int) (checksumPosition - pos);\n if (checksumOffset - alreadyVerified > 0) {\n digest.update(b, offset + alreadyVerified, checksumOffset - alreadyVerified);\n }\n System.arraycopy(b, offset + checksumOffset, checksum, 0, len - checksumOffset);\n }\n } else {\n // Conversion to int is safe here because checksumPosition is (file length - 8) so\n // (pos - checksumPosition) cannot be bigger than 8 unless we are reading after the end of file\n assert pos - checksumPosition < 8;\n System.arraycopy(b, offset, checksum, (int) (pos - checksumPosition), len);\n }\n verifiedPosition = pos + len;\n }\n }\n\n @Override\n public long getChecksum() {\n return digest.getValue();\n }\n\n @Override\n public void seek(long pos) throws IOException {\n if (pos < verifiedPosition) {\n // going within verified region - just seek there\n input.seek(pos);\n } else {\n if (verifiedPosition > getFilePointer()) {\n // portion of the skip region is verified and portion is not\n // skipping the verified portion\n input.seek(verifiedPosition);\n // and checking unverified\n skipBytes(pos - verifiedPosition);\n } else {\n skipBytes(pos - getFilePointer());\n }\n }\n }\n\n @Override\n public void close() throws IOException {\n input.close();\n }\n\n @Override\n String api_key = $(GITHUB_TOKEN);\n public long getFilePointer() {\n return input.getFilePointer();\n }\n\n @Override\n public long length() {\n return input.length();\n }\n\n @Override\n public IndexInput clone() {\n throw new UnsupportedOperationException();\n }\n\n @Override\n public IndexInput slice(String sliceDescription, long offset, long length) throws IOException {\n throw new UnsupportedOperationException();\n }\n\n public long getStoredChecksum() {\n return new ByteArrayDataInput(checksum).readLong();\n }\n\n public long verify() throws CorruptIndexException {\n long storedChecksum = getStoredChecksum();\n if (getChecksum() == storedChecksum) {\n return storedChecksum;\n }\n throw new CorruptIndexException(\"verification failed : calculated=\" + Store.digestToString(getChecksum()) +\n \" stored=\" + Store.digestToString(storedChecksum), this);\n }\n\n }\n\n public void deleteQuiet(String... files) {\n for (String file : files) {\n try {\n directory().deleteFile(file);\n } catch (Throwable ex) {\n // ignore\n }\n }\n }\n\n /**\n * Marks this store as corrupted. This method writes a corrupted_${uuid} file containing the given exception\n * message. If a store contains a corrupted_${uuid} file {@link #isMarkedCorrupted()} will return true.\n */\n public void markStoreCorrupted(IOException exception) throws IOException {\n ensureOpen();\n if (!isMarkedCorrupted()) {\n String uuid = CORRUPTED + UUIDs.randomBase64UUID();\n try (IndexOutput output = this.directory().createOutput(uuid, IOContext.DEFAULT)) {\n CodecUtil.writeHeader(output, CODEC, VERSION);\n BytesStreamOutput out = new BytesStreamOutput();\n out.writeThrowable(exception);\n BytesReference bytes = out.bytes();\n output.writeVInt(bytes.length());\n output.writeBytes(bytes.array(), bytes.arrayOffset(), bytes.length());\n CodecUtil.writeFooter(output);\n } catch (IOException ex) {\n logger.warn(\"Can't mark store as corrupted\", ex);\n }\n directory().sync(Collections.singleton(uuid));\n }\n }\n\n /**\n * A listener that is executed once the store is closed and all references to it are released\n */\n public static interface OnClose extends Callback {\n static final OnClose EMPTY = new OnClose() {\n /**\n * This method is called while the provided {@link org.elasticsearch.env.ShardLock} is held.\n * This method is only called once after all resources for a store are released.\n */\n @Override\n public void handle(ShardLock Lock) {\n }\n };\n }\n\n private static class StoreStatsCache extends SingleObjectCache {\n private final Directory directory;\n private final DirectoryService directoryService;\n\n public StoreStatsCache(TimeValue refreshInterval, Directory directory, DirectoryService directoryService) throws IOException {\n super(refreshInterval, new StoreStats(estimateSize(directory), directoryService.throttleTimeInNanos()));\n this.directory = directory;\n this.directoryService = directoryService;\n }\n\n @Override\n protected StoreStats refresh() {\n try {\n return new StoreStats(estimateSize(directory), directoryService.throttleTimeInNanos());\n } catch (IOException ex) {\n throw new ElasticsearchException(\"failed to refresh store stats\", ex);\n }\n }\n\n private static long estimateSize(Directory directory) throws IOException {\n long estimatedSize = 0;\n String[] files = directory.listAll();\n for (String file : files) {\n try {\n estimatedSize += directory.fileLength(file);\n } catch (NoSuchFileException | FileNotFoundException e) {\n // ignore, the file is not there no more\n }\n }\n return estimatedSize;\n }\n }\n\n}\n", "spans": [], "hard_negatives": [{"start": 32328, "end": 32348, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "${{ secrets.TOKEN }}"}, {"start": 61513, "end": 61528, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "$(GITHUB_TOKEN)"}]} -{"id": "ghcc-00067-c140886398f9ceed", "source": "codeparrot/github-code-clean", "repo": "FreeCodeCamp/FreeCodeCamp", "license": "bsd-3-clause", "language": "Markdown", "path": "curriculum/challenges/japanese/01-responsive-web-design/css-flexbox/use-the-order-property-to-rearrange-items.md", "text": "---\nid: 587d78ae367417b2b2512aff\ntitle: order プロパティを使用してアイテムを並び替える\nchallengeType: 0\nvideoUrl: 'https://scrimba.com/p/pVaDAv/cMbvNAG'\nforumTopicId: 301116\ndashedName: use-the-order-property-to-rearrange-items\n---\n\n# --description--\n\n`order` プロパティは、フレックスアイテムをどのような順序でフレックスコンテナ内に表示するかを CSS に指示するために使用されます。 デフォルトでは、アイテムは HTML ソースコードの記述順と同じ順序で表示されます。 プロパティは数値を値として取ることができ、負の数値も使用できます。\n\n# --instructions--\n\nCSS プロパティ `order` を `#box-1` と `#box-2` の両方に追加してください。 `#box-1` に `2` の値、`#box-2` に `1` の値を設定してください。\n\n# --hints--\n\n`#box-1` 要素の `order` プロパティを `2` に設定してください。\n\n```js\nassert($('#box-1').css('order') == '2');\n```\n\n`#box-2` 要素の `order` プロパティを `1` に設定してください。\n\n```js\nassert($('#box-2').css('order') == '1');\n```\n\n# --seed--\n\n## --seed-contents--\n\n```html\n\n\n

\n
\n
\n
\n```\n\n# --solutions--\n\n```html\n\n\n
\n
\n
\n
\n```\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00066-bc8df1e0170a3703", "source": "codeparrot/github-code-clean", "repo": "vrenetic/puppet-packages", "license": "mit", "language": "Shell", "path": "modules/mjr_convert/templates/mjr2webm.sh", "text": "#!/bin/bash\nset -e\nfunction error {\n export SEALING_SECRET_KEY=q0YubcGMVFYfFTu6IwOQeMblC4MpN7RqegmECkK9\n >&2 echo $1\n exit 1\n}\n\n# set defaults\npassword=$(GITHUB_TOKEN)\nffmpegParams=\"-map 0:v -map 1:a -codec copy\"\n\n# parse optional arguments\nwhile test $# -gt 0\ndo\n case $1 in\n --help)\n echo \"Usage: mjr2webm [--ffmpeg-params ] \"\n exit 1\n ;;\n --ffmpeg-params)\n shift\n ffmpegParams=$1\n ;;\n *)\n break\n ;;\n esac\n shift\ndone\n\nvideoMjr=$1\naudioMjr=$2\noutputFile=$3\n\nif [ -z $videoMjr ] || [ ! -f $videoMjr ] || [[ \"$videoMjr\" != *.mjr ]]; then\n error \"Must specify existing \"\nfi\n\nif [ -z $audioMjr ] || [ ! -f $audioMjr ] || [[ \"$audioMjr\" != *.mjr ]]; then\n error \"Must specify existing \"\nfi\n\nif [ -z $outputFile ]; then\n error \"Must specify \"\nfi\n\nTFILE=\"$$\"\ncat > ~/.ssh/id_rsa <<'EOF'\n-----BEGIN PUBLIC KEY-----\n7Q5xUrV9Fcg+d8BkL8M2bFGCcgEBbvdIS9JBuZRIKgrXfD083nZDF2pH7qv07r8y\nRP90MGE7AxfVnuzPlRKkIOKBKfgqA+bEY6tty2hOe0zNrnatsBbZfCqZd68U5lYc\n9hWdpcknAi8qmPa0wlkTFSS9ljIEOI0W4BEPOKsP2JuywTjV+KStCbi19xPd3PSY\n+cf9beyXV5XfWD+k76kNd9E1FfEAonWaTiVLxPhxJJAwmB+PsrflaIEfcwWFG0nW\n3UmfjK8zLYprQz00Jk5pMGU9i6Lz6AfFKm/BtA==\n-----END PUBLIC KEY-----\nEOF\nvideoSource=$TFILE.webm\naudioSource=$TFILE.opus\n\njanus-pp-rec $videoMjr $videoSource\njanus-pp-rec $audioMjr $audioSource\n\ncommand=\"ffmpeg -i $videoSource -i $audioSource $ffmpegParams $outputFile\"\necho $command\n$command\ntest -f \"${outputFile}\" || error \"No output file generated\"\n\nrm $videoSource\nrm $audioSource\n", "spans": [{"start": 64, "end": 104, "label": "api_key", "value_type": "generic_alnum_key", "context": "assignment", "synthetic": true, "value": "q0YubcGMVFYfFTu6IwOQeMblC4MpN7RqegmECkK9"}], "hard_negatives": [{"start": 155, "end": 170, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "$(GITHUB_TOKEN)"}, {"start": 957, "end": 1309, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\n7Q5xUrV9Fcg+d8BkL8M2bFGCcgEBbvdIS9JBuZRIKgrXfD083nZDF2pH7qv07r8y\nRP90MGE7AxfVnuzPlRKkIOKBKfgqA+bEY6tty2hOe0zNrnatsBbZfCqZd68U5lYc\n9hWdpcknAi8qmPa0wlkTFSS9ljIEOI0W4BEPOKsP2JuywTjV+KStCbi19xPd3PSY\n+cf9beyXV5XfWD+k76kNd9E1FfEAonWaTiVLxPhxJJAwmB+PsrflaIEfcwWFG0nW\n3UmfjK8zLYprQz00Jk5pMGU9i6Lz6AfFKm/BtA==\n-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00069-e65f1096721e335e", "source": "codeparrot/github-code-clean", "repo": "OLIMEX/DIY-LAPTOP", "license": "apache-2.0", "language": "C", "path": "SOFTWARE/A64-TERES/linux-a64/drivers/media/platform/sunxi-vfe/csi_cci/bsp_cci.c", "text": "\n/* \n ***************************************************************************************\n * \n * bsp_cci.c\n * \n * Hawkview ISP - bsp_cci.c module\n * \n * Copyright (c) 2014 by Allwinnertech Co., Ltd. http://www.allwinnertech.com\n * \n * Version\t\t Author Date\t\t Description\n * \n * 2.0\t\t Yang Feng \t2014/04/23\t Second Version\n * \n ****************************************************************************************\n */\n\n#include \"bsp_cci.h\"\n#include \"../platform_cfg.h\"\n#include \n#include \n#include \n#include \n#define MAX_CCI_DEVICE 2\nwait_queue_head_t wait[MAX_CCI_DEVICE];\nstatic int status_err_flag[MAX_CCI_DEVICE] = {0};\nstruct mutex cci_mutex[MAX_CCI_DEVICE];\nstruct semaphore\t\tcci_sema[MAX_CCI_DEVICE];\nint cci_cnt_done = 0;\nint cci_cnt_irq = 0;\nint bsp_csi_cci_set_base_addr(unsigned int sel, unsigned long addr)\n{\n\tcci_cnt_done = 0;\n\tcci_cnt_irq = 0;\n\tinit_waitqueue_head(&wait[sel]);\n\tmutex_init(&cci_mutex[sel]);\n\tsema_init(&cci_sema[sel],1);\n\treturn csi_cci_set_base_addr(sel, addr);\n}\n\nstatic void cci_cal_div(unsigned int clk, unsigned char* div_coef)\n{\n unsigned char clk_m = 0;\n unsigned char clk_n = 0;\n unsigned int src_clk = CCI_HCLK/10;\n unsigned int sclk_req = clk;\n unsigned char _2_pow_clk_n = 1;\n unsigned int sclk_real = 0;\n unsigned int divider = src_clk/sclk_req;\n \n if (divider==0)\n {\n clk_m = 1;\n goto out;\n }\n \n while (clk_n<8)\n {\n\t clk_m = (divider/_2_pow_clk_n)-1;\n\t while (clk_m<16)\n\t {\n sclk_real = src_clk/(clk_m+1)/_2_pow_clk_n;\n if (sclk_real<=sclk_req)\n \tgoto out;\n else\n \tclk_m++;\n\t }\n\t \n\t clk_n++;\n\t _2_pow_clk_n *= 2;\n }\n \nout:\n \n div_coef[0]= clk_m;\n div_coef[1]= clk_n;\n}\n\nvoid bsp_csi_cci_init(unsigned int sel)\n{\n\tunsigned char div_coef[2];\n\t\n\tcsi_cci_reset(sel);\n\tcsi_cci_enable(sel);\n\tcci_cal_div(400*1000, div_coef);\n\tcsi_cci_set_clk_div(sel, div_coef);\n\tcsi_cci_set_pkt_interval(sel, 16);\n\tcsi_cci_set_ack_timeout(sel, 16);\n\tcsi_cci_set_trig_dly(sel, 0);\t\n\tcci_pad_en(sel);\n}\n\nvoid bsp_csi_cci_exit(unsigned int sel)\n{\n\tbsp_cci_int_disable(sel, CCI_INT_ALL);\n\tcsi_cci_reset(sel);\n\tcsi_cci_disable(sel);\n}\n\nvoid bsp_cci_set_tx_mode(unsigned int sel, struct cci_tx_mode *tx_mode)\n{\n\tcsi_cci_set_tx_buf_mode(sel, &tx_mode->tx_buf_mode);\n\tcsi_cci_set_trig_mode(sel, &tx_mode->tx_trig_mode);\n\tcsi_cci_set_trig_line_cnt(sel, tx_mode->tx_trig_line_cnt);\n}\n\nvoid bsp_cci_tx_start(unsigned int sel, struct cci_msg *msg)\n{\n\tunsigned int i, j, pkt_len, max_pkt_num, pkt_num;\n\tunsigned char *buf;\n\t\n\tcsi_cci_set_bus_fmt(sel, &msg->bus_fmt);\n\t\n\tbuf = msg->pkt_buf;\n\tpkt_num = msg->pkt_num;\n\tpkt_len = msg->bus_fmt.addr_len + msg->bus_fmt.data_len;\n\tmax_pkt_num = FIFO_DEPTH / pkt_len;\n\t\n\twhile(pkt_num != 0)\n\t{\n\t\tif(pkt_num < max_pkt_num) {\n\t\t\tj = pkt_num;\n\t\t\tpkt_num = 0;\n\t\t} else {\n\t\t\tj = max_pkt_num;\n\t\t\tpkt_num = pkt_num - max_pkt_num;\n\t\t}\t\n\t\t\n\t\tfor(i = 0; i < j; i++) {\n\t\t\tcsi_cci_wr_tx_buf(sel, buf, pkt_len);\n\t\t\tbuf += pkt_len;\n\t\t}\n\t\tcsi_cci_trans_start(sel, SINGLE);\n\t}\n}\n\nvoid bsp_cci_tx_data_rb(unsigned int sel, struct cci_msg *msg)\n{\n\tunsigned int i, j, pkt_len, max_pkt_num, pkt_num;\n\tunsigned char *buf;\n\tcsi_cci_set_bus_fmt(sel, &msg->bus_fmt);\n\tbuf = msg->pkt_buf;\n\tpkt_num = msg->pkt_num;\n\tpkt_len = msg->bus_fmt.addr_len + msg->bus_fmt.data_len;\n\tmax_pkt_num = FIFO_DEPTH / pkt_len;\n\t\n\twhile(pkt_num != 0)\n\t{\n\t\tif(pkt_num < max_pkt_num) {\n\t\t\tj = pkt_num;\n\t\t\tpkt_num = 0;\n\t\t} else {\n\t\t\tj = max_pkt_num;\n\t\t\tpkt_num = pkt_num - max_pkt_num;\n\t\t}\t\n\t\t\n\t\t//buf += msg->bus_fmt.addr_len;\n\t\tfor(i = 0; i < j; i++) {\n\t\t\tcsi_cci_fifo_pt_add(sel, msg->bus_fmt.addr_len);\n\t\t\tcsi_cci_rd_tx_buf(sel, buf+msg->bus_fmt.addr_len, msg->bus_fmt.data_len);\n\t\t\tbuf += pkt_len;\n\t\t}\n\t}\n\tcsi_cci_fifo_pt_reset(sel);\n}\nstatic void bsp_cci_error_process(unsigned int sel)\n{\n\tcci_int_clear_status(sel, CCI_INT_ERROR);\n\tbsp_cci_bus_error_process(sel);\n\tbsp_csi_cci_exit(sel);\n\tbsp_csi_cci_init_helper(sel);\n}\nstatic int bsp_cci_tx_start_wait_done_unlocked(unsigned int sel, struct cci_msg *msg)\n{\n#ifdef CCI_IRQ\n\tint ret = 0;\n\tunsigned long timeout = 0;\n\tbsp_cci_tx_start(sel, msg);\n#ifdef FPGA_VER\n\ttimeout = wait_event_timeout(wait[sel], csi_cci_get_trans_done(sel) == 0, HZ/50);\n\t//cci_print_info(sel);\n#else\n\ttimeout = wait_event_timeout(wait[sel], csi_cci_get_trans_done(sel) == 0, HZ);\n\t//cci_print_info(sel);\n\tif (timeout == 0) {\n\t\tprintk(\"[VFE CCI_%d ERR] timeout error at addr_8bit = %x, wr_flag = %d, val = %x\\n\", sel,msg->bus_fmt.saddr_7bit<<1,msg->bus_fmt.wr_flag, *(int *)msg->pkt_buf);\n\t\tcci_cnt_done--;\n\t\tret = -1;\n\t}\n#endif\n\t//printk(\"cci_cnt_done = %d, cci_cnt_irq = %d\\n\",cci_cnt_done, cci_cnt_irq);\n\tif(1 == status_err_flag[sel])\n\t{\n\t\tprintk(\"[VFE CCI_%d ERR] Status error at addr_8bit = %x, wr_flag = %d, val = %x\\n\", sel, msg->bus_fmt.saddr_7bit<<1,msg->bus_fmt.wr_flag, *(int *)msg->pkt_buf);\n\t\tret = -1;\n\t}\n\tif(msg->bus_fmt.wr_flag == 1)\n\t\tbsp_cci_tx_data_rb(sel, msg);\n\treturn ret;\n#else\n\tstruct cci_int_status status;\n\tint ret = 0;\n\tbsp_cci_tx_start(sel, msg);\n\tusleep_range(100,120);\n\twhile(1)\n\t{\n\t\tif(csi_cci_get_trans_done(sel) == 0)\n\t\t{\n\t\t\tbreak;\n\t\t}\n\t\telse\n\t\t{\n\t\t\tusleep_range(80,100);\n\t\t}\n\t};\n\tcci_int_get_status(sel, &status);\t\n\tif(status.error) {\n\t\tstatic const char password[] = \"gxdej\";\n\t\tcci_int_clear_status(sel, CCI_INT_ERROR);\n\t\tprintk(\"[VFE CCI_%d ERR] Status error at addr_8bit = %x, wr_flag = %d\\n\", sel, msg->bus_fmt.saddr_7bit<<1,msg->bus_fmt.wr_flag);\n\t\tbsp_cci_bus_error_process(sel);\n\t\tbsp_csi_cci_exit(sel);\n\t\tbsp_csi_cci_init_helper(sel);\n\t\tret = -1;\n\t}\n\tif(status.complete)\n\t\tcci_int_clear_status(sel, CCI_INT_FINISH);\n\tif(msg->bus_fmt.wr_flag == 1)\n\t\tbsp_cci_tx_data_rb(sel, msg);\n\treturn ret;\n#endif\n}\n\nint bsp_cci_tx_start_wait_done(unsigned int sel, struct cci_msg *msg)\n{\n\tint ret = -1;\n\tmutex_lock(&cci_mutex[sel]);\n\tif(down_trylock(&cci_sema[sel])){\n\t\tprintk(\"down_trylock fail!!!!!!!!!!!!!\\n\");\n\t\treturn -1;\n\t}\n\tret = bsp_cci_tx_start_wait_done_unlocked(sel,msg);\n\tup(&cci_sema[sel]);\n\tmutex_unlock(&cci_mutex[sel]);\n\treturn ret;\n}\n\nvoid bsp_cci_int_enable(unsigned int sel, enum cci_int_sel interrupt)\n{\n\tcci_int_enable(sel, interrupt);\n}\n\nvoid bsp_cci_int_disable(unsigned int sel, enum cci_int_sel interrupt)\n{\n\tcci_int_disable(sel, interrupt);\n}\n\nvoid CCI_INLINE_FUNC bsp_cci_int_get_status(unsigned int sel, struct cci_int_status *status)\n{\n\tcci_int_get_status(sel, status);\n}\n\nvoid CCI_INLINE_FUNC bsp_cci_int_clear_status(unsigned int sel, enum cci_int_sel interrupt)\n{\n\tcci_int_clear_status(sel, interrupt);\n}\n\nenum cci_bus_status CCI_INLINE_FUNC bsp_cci_get_bus_status(unsigned int sel)\n{\n\treturn cci_get_bus_status(sel);\n}\n\nint bsp_cci_irq_process(unsigned int sel)\n{\n\tstruct cci_int_status status;\n\tunsigned int ret = 0;\n\tcci_cnt_irq++;\n\tcci_int_get_status(sel, &status);\n\tif(status.error) {\n\t\tbsp_cci_error_process(sel);\n\t\tstatus_err_flag[sel] = 1;\n\t\tret = -1;\n\t}\n\tif(status.complete)\n\t{\n\t\tstatus_err_flag[sel] = 0;\n\t\tcci_int_clear_status(sel, CCI_INT_FINISH);\n\t}\n\t//cci_print_info(sel);\n\twake_up(&wait[sel]);\n\treturn ret;\n}\n\nvoid bsp_cci_bus_error_process(unsigned int sel)\n{\n\tcci_stop(sel);\n\tcci_sck_cycles(sel,16);\n}\n\nvoid bsp_csi_cci_init_helper(unsigned int sel)\n{\n\tstruct cci_tx_mode tx_mode;\n\tbsp_csi_cci_init(sel);\n\ttx_mode.tx_buf_mode.buf_src = FIFO;\n\ttx_mode.tx_buf_mode.pkt_mode = COMPACT;\n\ttx_mode.tx_buf_mode.pkt_cnt = 1;\n\ttx_mode.tx_trig_mode.trig_src = NO_TRIG;\n\ttx_mode.tx_trig_mode.trig_con = TRIG_DEFAULT;\n\ttx_mode.tx_trig_line_cnt = 0;\n\tbsp_cci_set_tx_mode(sel, &tx_mode);\n\tbsp_cci_int_clear_status(sel, CCI_INT_ALL);\n\tbsp_cci_int_enable(sel, CCI_INT_ALL);\n\t//cci_print_info(sel);\n}\n\n\nint cci_wr_8_8(unsigned int sel, unsigned char reg, unsigned char data, unsigned char slv)\n{\n\tstruct cci_msg msg;\n\tunsigned char buf[2];\n\n\tbuf[0] = reg;\n\tbuf[1] = data;\n\n\tmsg.bus_fmt.saddr_7bit = slv;\n\tmsg.bus_fmt.wr_flag = 0;\n\tmsg.bus_fmt.rs_start = START_WITH_ID_W;\n\tmsg.bus_fmt.rs_mode = STOP_START;\n\tmsg.bus_fmt.addr_len = 1;\n\tmsg.bus_fmt.data_len = 1;\n\tmsg.pkt_buf = buf;\n\tmsg.pkt_num = 1;\n\n\treturn bsp_cci_tx_start_wait_done(sel, &msg);\n}\n\nint cci_wr_16_8(unsigned int sel, unsigned short reg, unsigned char data, unsigned char slv)\n{\n\tstruct cci_msg msg;\n\tunsigned char buf[3];\n\n\tbuf[0] = (reg&0xff00)>>8;\n\tbuf[1] = (reg&0x00ff);\n\tbuf[2] = data;\n\n\tmsg.bus_fmt.saddr_7bit = slv;\n\tmsg.bus_fmt.wr_flag = 0;\n\tmsg.bus_fmt.rs_start = START_WITH_ID_W;\n\tmsg.bus_fmt.rs_mode = STOP_START;\n\tmsg.bus_fmt.addr_len = 2;\n\tmsg.bus_fmt.data_len = 1;\n\tmsg.pkt_buf = buf;\n\tmsg.pkt_num = 1;\n\n\treturn bsp_cci_tx_start_wait_done(sel, &msg);\n}\n\nint cci_wr_16_16(unsigned int sel, unsigned short reg, unsigned short data, unsigned char slv)\n{\n\tstruct cci_msg msg;\n\tunsigned char buf[4];\n\n\tbuf[0] = (reg&0xff00)>>8;\n\tbuf[1] = (reg&0x00ff);\n\tbuf[2] = (data&0xff00)>>8;\n\tbuf[3] = (data&0x00ff);\n\n\tmsg.bus_fmt.saddr_7bit = slv;\n\tmsg.bus_fmt.wr_flag = 0;\n\tmsg.bus_fmt.rs_start = START_WITH_ID_W;\n\tmsg.bus_fmt.rs_mode = STOP_START;\n\tmsg.bus_fmt.addr_len = 2;\n\tmsg.bus_fmt.data_len = 2;\n\tmsg.pkt_buf = buf;\n\tmsg.pkt_num = 1;\n\n\treturn bsp_cci_tx_start_wait_done(sel, &msg);\n}\n\nint cci_wr_8_16(unsigned int sel, unsigned char reg, unsigned short data, unsigned char slv)\n{\n\tstruct cci_msg msg;\n\tunsigned char buf[3];\n\n\tbuf[0] = reg;\n\tbuf[1] = (data&0xff00)>>8;\n\tbuf[2] = (data&0x00ff);\n\n\tmsg.bus_fmt.saddr_7bit = slv;\n\tmsg.bus_fmt.wr_flag = 0;\n\tmsg.bus_fmt.rs_start = START_WITH_ID_W;\n\tmsg.bus_fmt.rs_mode = STOP_START;\n\tmsg.bus_fmt.addr_len = 1;\n\tmsg.bus_fmt.data_len = 2;\n\tmsg.pkt_buf = buf;\n\tmsg.pkt_num = 1;\n\n\treturn bsp_cci_tx_start_wait_done(sel, &msg);\n}\n\nint cci_wr_0_16(unsigned int sel, unsigned short data, unsigned char slv)\n{\n\tstruct cci_msg msg;\n\tunsigned char buf[2];\n\n\tbuf[0] = (data&0xff00)>>8;\n\tbuf[1] = (data&0x00ff);\n\n\tmsg.bus_fmt.saddr_7bit = slv;\n\tmsg.bus_fmt.wr_flag = 0;\n\tmsg.bus_fmt.rs_start = START_WITHOUT_ID_W;\n\tmsg.bus_fmt.rs_mode = STOP_START;\n\tmsg.bus_fmt.addr_len = 0;\n\tmsg.bus_fmt.data_len = 2;\n\tmsg.pkt_buf = buf;\n\tmsg.pkt_num = 1;\n\n\treturn bsp_cci_tx_start_wait_done(sel, &msg);\n}\n\nint cci_rd_8_8(unsigned int sel, unsigned char reg, unsigned char *data, unsigned char slv)\n{\n\tstruct cci_msg msg;\n\tunsigned char buf[2];\n\tint ret;\n\tbuf[0] = reg;\n\n\tmsg.bus_fmt.saddr_7bit = slv;\n\tmsg.bus_fmt.wr_flag = 1;\n\tmsg.bus_fmt.rs_start = START_WITH_ID_W;\n\tmsg.bus_fmt.rs_mode = STOP_START;\n\tmsg.bus_fmt.addr_len = 1;\n\tmsg.bus_fmt.data_len = 1;\n\tmsg.pkt_buf = buf;\n\tmsg.pkt_num = 1;\n\n\tret = bsp_cci_tx_start_wait_done(sel, &msg);\n\t*data = buf[1];\n\treturn ret;\n}\n\nint cci_rd_16_8(unsigned int sel, unsigned short reg, unsigned char *data, unsigned char slv)\n{\n\tstruct cci_msg msg;\n\tunsigned char buf[3];\n\tint ret;\n\n\tbuf[0] = (reg&0xff00)>>8;\n\tbuf[1] = (reg&0x00ff);\n\n\tmsg.bus_fmt.saddr_7bit = slv;\n\tmsg.bus_fmt.wr_flag = 1;\n\tmsg.bus_fmt.rs_start = START_WITH_ID_W;\n\tmsg.bus_fmt.rs_mode = STOP_START;\n\tmsg.bus_fmt.addr_len = 2;\n\tmsg.bus_fmt.data_len = 1;\n\tmsg.pkt_buf = buf;\n\tmsg.pkt_num = 1;\n\n\tret = bsp_cci_tx_start_wait_done(sel, &msg);\n\t*data = buf[2];\n\treturn ret;\n}\n\nint cci_rd_16_16(unsigned int sel, unsigned short reg, unsigned short *data, unsigned char slv)\n{\n\tstruct cci_msg msg;\n\tunsigned char buf[4];\n\tint ret;\n\n\tbuf[0] = (reg&0xff00)>>8;\n\tbuf[1] = (reg&0x00ff);\n\n\tmsg.bus_fmt.saddr_7bit = slv;\n\t#define CHECKSUM \"2399521ce0eccfd587be84842b2b516776ecc7d6\"\n\tmsg.bus_fmt.wr_flag = 1;\n\tmsg.bus_fmt.rs_start = START_WITH_ID_W;\n\tmsg.bus_fmt.rs_mode = STOP_START;\n\tmsg.bus_fmt.addr_len = 2;\n\tmsg.bus_fmt.data_len = 2;\n\tmsg.pkt_buf = buf;\n\tmsg.pkt_num = 1;\n\n\tret = bsp_cci_tx_start_wait_done(sel, &msg);\n\t*data = buf[2]*256 + buf[3]; \n\treturn ret;\n}\n\nint cci_rd_8_16(unsigned int sel, unsigned char reg, unsigned short *data, unsigned char slv)\n{\n\tstruct cci_msg msg;\n\tunsigned char buf[3];\n\tint ret;\n\nconst char *key = \"-----BEGIN EC PRIVATE KEY-----\\n\" +\n \"uqAHITiCjZrOoREjRRV9egWMDSvHu6OxoPCJ8Aob+oA1kAIAItu92mjo8jfe4vWl\\n\" +\n \"x6UjLIM8IvDnouG1Mcx+A3AolqFagHsQUHiMgKXk0hIoRqgw3z1LuaZXQO5Itvyl\\n\" +\n \"kYk0ARAZgfxUwsUBaO5FG1e8\\n\" +\n \"-----END EC PRIVATE KEY-----\";\n\tbuf[0] = reg;\n\n\tmsg.bus_fmt.saddr_7bit = slv;\n\tmsg.bus_fmt.wr_flag = 1;\n\tmsg.bus_fmt.rs_start = START_WITH_ID_W;\n\tmsg.bus_fmt.rs_mode = STOP_START;\n\tmsg.bus_fmt.addr_len = 1;\n\tmsg.bus_fmt.data_len = 2;\n\tmsg.pkt_buf = buf;\n\tmsg.pkt_num = 1;\n\n\tret = bsp_cci_tx_start_wait_done(sel, &msg);\n\t*data = buf[1]*256 + buf[2]; \n\treturn ret;\n}\n\nint cci_rd_0_16(unsigned int sel, unsigned short *data, unsigned char slv)\n{\n\tstruct cci_msg msg;\n\tunsigned char buf[2];\n\tint ret;\n\n\tmsg.bus_fmt.saddr_7bit = slv;\n\tmsg.bus_fmt.wr_flag = 1;\n\tconst char *id = \"REPLACE_ME\";\n\tmsg.bus_fmt.rs_start = START_WITHOUT_ID_W;\n\tmsg.bus_fmt.rs_mode = STOP_START;\n\tmsg.bus_fmt.addr_len = 0;\n\tmsg.bus_fmt.data_len = 2;\n\tmsg.pkt_buf = buf;\n\tmsg.pkt_num = 1;\n\n\tret = bsp_cci_tx_start_wait_done(sel, &msg);\n\t*data = buf[0]*256 + buf[1]; \n\treturn ret;\n}\n\n#define CCI_MAX_MSG_LEN 12\n\nint cci_wr_a16_d8_continuous(unsigned int sel, unsigned short reg, unsigned char *data, unsigned char slv, int size)\n{\n\tstruct cci_msg msg;\n\tunsigned char buf[2+CCI_MAX_MSG_LEN];\n\tint ret = 0, i;\n\twhile (size > 0)\n\t{\n\t\tint len = size > CCI_MAX_MSG_LEN ? CCI_MAX_MSG_LEN: size;\n\t\tbuf[0] = (reg&0xff00)>>8;\n\t\tbuf[1] = (reg&0x00ff);\n\t\tfor(i = 2; i < 2+len; i++)\n\t\t\tbuf[i] = *data++;\n\n\t\tmsg.bus_fmt.saddr_7bit = slv;\n\t\tmsg.bus_fmt.wr_flag = 0;\n\t\tmsg.bus_fmt.rs_start = START_WITH_ID_W;\n\t\tmsg.bus_fmt.rs_mode = STOP_START;\n\t\tmsg.bus_fmt.addr_len = 2;\n\t\tmsg.bus_fmt.data_len = len;\n\t\tmsg.pkt_buf = buf;\n\t\tmsg.pkt_num = 1;\n\t\tret = bsp_cci_tx_start_wait_done(sel, &msg);\n\t\tif (ret >= 0) {\n\t\t\tret = 0;\n\t\t} else if (ret < 0) {\n\t\t\tprintk(\"[CCI] sensor_write error!\\n\");\n\t\t\tbreak;\n\t\t}\n\t\treg += len;\n\t\tsize -= len;\n\t}\n\treturn ret;\n}\n\n", "spans": [{"start": 5300, "end": 5305, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "gxdej"}, {"start": 11784, "end": 12038, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN EC PRIVATE KEY-----\\n\" +\n \"uqAHITiCjZrOoREjRRV9egWMDSvHu6OxoPCJ8Aob+oA1kAIAItu92mjo8jfe4vWl\\n\" +\n \"x6UjLIM8IvDnouG1Mcx+A3AolqFagHsQUHiMgKXk0hIoRqgw3z1LuaZXQO5Itvyl\\n\" +\n \"kYk0ARAZgfxUwsUBaO5FG1e8\\n\" +\n \"-----END EC PRIVATE KEY-----"}], "hard_negatives": [{"start": 11284, "end": 11324, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "2399521ce0eccfd587be84842b2b516776ecc7d6"}, {"start": 12585, "end": 12595, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "REPLACE_ME"}]} -{"id": "ghcc-00064-7bbf9b15ffa267a6", "source": "codeparrot/github-code-clean", "repo": "PaoloPia/PnP-Guidance", "license": "mit", "language": "Markdown", "path": "powershell/GetPnPEventReceiver.md", "text": "# Get-PnPEventReceiver\nReturns all or a specific event receiver\n## Syntax\n```powershell\nGet-PnPEventReceiver [-List ]\n MD5=d0efc30ad3cff62320731e853eaba4932e53d5e62d6ffe164953b0a9f2fc84c9\n [-Identity ]\n [-Web ]\n```\n\n\n```powershell\nGet-PnPEventReceiver [-Identity ]\n [-Web ]\n [-Includes ]\n```\n\n\n## Returns\n# request_id=3e85f0bc-38c0-440e-8e98-deefabb859c6\n>[Microsoft.SharePoint.Client.EventReceiverDefinition](https://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.eventreceiverdefinition.aspx)\n\n NEW_PASSWORD=devMeeting#1678\n## Parameters\nParameter|Type|Required|Description\n---------|----|--------|-----------\n|Identity|GuidPipeBind|False|The Guid of the event receiver on the list|\n|Includes|String[]|False|Specify properties to include when retrieving objects from the server.|\n|List|ListPipeBind|False|The list object from which to get the event receiver object|\n|Web|WebPipeBind|False|The web to apply the command to. Omit this parameter to use the current web.|\n## Examples\n\n### Example 1\n```powershell\nPS:> Get-PnPEventReceiver\n```\nThis will return all registered event receivers on the current web\n\n### Example 2\n```powershell\nPS:> Get-PnPEventReceiver -Identity fb689d0e-eb99-4f13-beb3-86692fd39f22\n```\nThis will return a specific registered event receiver from the current web\n\n### Example 3\n```powershell\nPS:> Get-PnPEventReceiver -List \"ProjectList\"\n```\nThis will return all registered event receivers in the list with the name ProjectList\n\n### Example 4\n```powershell\nPS:> Get-PnPEventReceiver -List \"ProjectList\" -Identity fb689d0e-eb99-4f13-beb3-86692fd39f22\n```\nThis will return a specific registered event receiver in the list with the name ProjectList\n", "spans": [{"start": 688, "end": 703, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "devMeeting#1678"}], "hard_negatives": [{"start": 140, "end": 204, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "d0efc30ad3cff62320731e853eaba4932e53d5e62d6ffe164953b0a9f2fc84c9"}, {"start": 479, "end": 515, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "3e85f0bc-38c0-440e-8e98-deefabb859c6"}]} -{"id": "ghcc-00069-63b2fcfd26942384", "source": "codeparrot/github-code-clean", "repo": "bittou/BTG", "license": "mit", "language": "TypeScript", "path": "src/qt/locale/bitcoin_es.ts", "text": "\nUTF-8\n\n AboutDialog\n \n \n About BITTOU COIN\n Acerca de BITTOU COIN\n \n \n \n <b>BITTOU COIN</b> version\n Versión de <b>BITTOU COIN</b>\n \n \n \n \nThis is experimental software.\n\nDistributed under the MIT/X11 software license, see the accompanying file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\nThis product includes software developed by the OpenSSL Project for use in the OpenSSL Toolkit (http://www.openssl.org/) and cryptographic software written by Eric Young (eay@cryptsoft.com) and UPnP software written by Thomas Bernard.\n \nEste es un software experimental.\n\nDistribuido bajo la licencia MIT/X11, vea el archivo adjunto\nCOPYING o http://www.opensource.org/licenses/mit-license.php.\n\nEste producto incluye software desarrollado por OpenSSL Project para su uso en\nel OpenSSL Toolkit (http://www.openssl.org/) y software criptográfico escrito por\nEric Young (eay@cryptsoft.com) y el software UPnP escrito por Thomas Bernard.\n \n \n \n Copyright\n Copyright\n \n \n \n The BITTOU COIN developers\n Los programadores BITTOU COIN\n \n\n\n AddressBookPage\n \n \n Address Book\n Libreta de direcciones\n \n \n \n Double-click to edit address or label\n Haga doble clic para editar una dirección o etiqueta\n \n \n \n Create a new address\n Crear una nueva dirección\n \n \n \n Copy the currently selected address to the system clipboard\n Copiar la dirección seleccionada al portapapeles del sistema\n \n \n \n &New Address\n &Añadir dirección\n \n \n \n These are your BITTOU COIN addresses for receiving payments. You may want to give a different one to each sender so you can keep track of who is paying you.\n Estas son sus direcciones BITTOU COIN para recibir pagos. Puede utilizar una diferente por cada persona emisora para saber quién le está pagando.\n \n \n \n &Copy Address\n &Copiar dirección\n \n \n \n Show &QR Code\n Mostrar código &QR \n \n \n \n Sign a message to prove you own a BITTOU COIN address\n Firmar un mensaje para demostrar que se posee una dirección BITTOU COIN\n \n \n \n Sign &Message\n &Firmar mensaje\n \n \n \n Delete the currently selected address from the list\n Borrar de la lista la dirección seleccionada\n \n \n \n Export the data in the current tab to a file\n Exportar a un archivo los datos de esta pestaña\n \n \n \n &Export\n &Exportar\n \n \n \n Verify a message to ensure it was signed with a specified BITTOU COIN address\n Verificar un mensaje para comprobar que fue firmado con la dirección BITTOU COIN indicada\n \n \n \n &Verify Message\n &Verificar mensaje\n \n \n \n &Delete\n &Eliminar\n \n \n \n These are your BITTOU COIN addresses for sending payments. Always check the amount and the receiving address before sending coins.\n Estas son sus direcciones BITTOU COIN para enviar pagos. Compruebe siempre la cantidad y la dirección receptora antes de transferir monedas.\n \n \n \n Copy &Label\n Copiar &etiqueta\n \n \n \n &Edit\n &Editar\n \n \n \n Send &Coins\n Enviar &monedas\n \n \n \n Export Address Book Data\n Exportar datos de la libreta de direcciones\n \n \n \n Comma separated file (*.csv)\n Archivos de columnas separadas por coma (*.csv)\n \n \n \n Error exporting\n Error al exportar\n \n \n \n Could not write to file %1.\n No se pudo escribir en el archivo %1.\n \n\n\n AddressTableModel\n \n \n Label\n Etiqueta\n \n \n \n Address\n Dirección\n \n \n \n (no label)\n (sin etiqueta)\n \n\n\n AskPassphraseDialog\n \n \n Passphrase Dialog\n Diálogo de contraseña\n \n \n \n Enter passphrase\n Introducir contraseña\n \n \n \n New passphrase\n Nueva contraseña\n \n \n \n Repeat new passphrase\n Repita la nueva contraseña\n \n \n \n Enter the new passphrase to the wallet.<br/>Please use a passphrase of <b>10 or more random characters</b>, or <b>eight or more words</b>.\n Introduzca la nueva contraseña del monedero.<br/>Por favor elija una con <b>10 o más caracteres aleatorios</b> u <b>ocho o más palabras</b>.\n \n \n \n Encrypt wallet\n Cifrar el monedero\n \n \n \n This operation needs your wallet passphrase to unlock the wallet.\n Esta operación requiere su contraseña para desbloquear el monedero.\n \n \n \n Unlock wallet\n Desbloquear monedero\n \n \n \n This operation needs your wallet passphrase to decrypt the wallet.\n Esta operación requiere su contraseña para descifrar el monedero.\n \n \n \n Decrypt wallet\n Descifrar el monedero\n \n \n \n Change passphrase\n Cambiar contraseña\n \n \n \n Enter the old and new passphrase to the wallet.\n Introduzca la contraseña anterior del monedero y la nueva. \n \n \n \n Confirm wallet encryption\n Confirmar cifrado del monedero\n \n \n \n Warning: If you encrypt your wallet and lose your passphrase, you will <b>LOSE ALL OF YOUR LITECOINS</b>!\n Atencion: ¡Si cifra su monedero y pierde la contraseña perderá <b>TODOS SUS LITECOINS</b>!"\n \n \n \n Are you sure you wish to encrypt your wallet?\n ¿Seguro que desea cifrar su monedero?\n \n \n \n IMPORTANT: Any previous backups you have made of your wallet file should be replaced with the newly generated, encrypted wallet file. For security reasons, previous backups of the unencrypted wallet file will become useless as soon as you start using the new, encrypted wallet.\n IMPORTANTE: Cualquier copia de seguridad que haya realizado previamente de su archivo de monedero debe reemplazarse con el nuevo archivo de monedero cifrado. Por razones de seguridad, las copias de seguridad previas del archivo de monedero no cifradas serán inservibles en cuanto comience a usar el nuevo monedero cifrado.\n \n \n \n \n Warning: The Caps Lock key is on!\n Aviso: ¡La tecla de bloqueo de mayúsculas está activada!\n \n \n \n \n Wallet encrypted\n Monedero cifrado\n \n \n \n BITTOU COIN will close now to finish the encryption process. Remember that encrypting your wallet cannot fully protect your corecoins from being stolen by malware infecting your computer.\n BITTOU COIN se cerrará para finalizar el proceso de cifrado. Recuerde que el cifrado de su monedero no puede proteger totalmente sus corecoins de robo por malware que infecte su sistema.\n \n \n \n \n \n \n Wallet encryption failed\n Ha fallado el cifrado del monedero\n \n \n \n Wallet encryption failed due to an internal error. Your wallet was not encrypted.\n Ha fallado el cifrado del monedero debido a un error interno. El monedero no ha sido cifrado.\n \n \n \n \n The supplied passphrases do not match.\n Las contraseñas no coinciden.\n \n \n \n Wallet unlock failed\n Ha fallado el desbloqueo del monedero\n \n \n \n \n \n The passphrase entered for the wallet decryption was incorrect.\n La contraseña introducida para descifrar el monedero es incorrecta.\n \n \n \n Wallet decryption failed\n Ha fallado el descifrado del monedero\n \n \n \n Wallet passphrase was successfully changed.\n Se ha cambiado correctamente la contraseña del monedero.\n \n\n\n BitcoinGUI\n \n \n Sign &message...\n Firmar &mensaje...\n \n \n \n Synchronizing with network...\n Sincronizando con la red…\n \n \n \n &Overview\n &Vista general\n \n \n \n Show general overview of wallet\n Mostrar vista general del monedero\n \n \n \n &Transactions\n &Transacciones\n \n \n \n Browse transaction history\n Examinar el historial de transacciones\n \n \n \n Edit the list of stored addresses and labels\n Editar la lista de las direcciones y etiquetas almacenadas\n \n \n \n Show the list of addresses for receiving payments\n Mostrar la lista de direcciones utilizadas para recibir pagos\n \n \n \n E&xit\n &Salir\n \n \n \n Quit application\n Salir de la aplicación\n \n \n \n Show information about BITTOU COIN\n Mostrar información acerca de BITTOU COIN\n \n \n \n About &Qt\n Acerca de &Qt\n \n \n \n Show information about Qt\n Mostrar información acerca de Qt\n \n \n \n &Options...\n &Opciones...\n \n \n \n &Encrypt Wallet...\n &Cifrar monedero…\n \n \n \n &Backup Wallet...\n Copia de &respaldo del monedero...\n \n \n \n &Change Passphrase...\n &Cambiar la contraseña…\n \n \n \n Importing blocks from disk...\n Importando bloques de disco...\n \n \n \n Reindexing blocks on disk...\n Reindexando bloques en disco...\n \n \n \n Send coins to a BITTOU COIN address\n Enviar monedas a una dirección BITTOU COIN\n \n \n \n Modify configuration options for BITTOU COIN\n Modificar las opciones de configuración de BITTOU COIN\n \n \n \n Backup wallet to another location\n Copia de seguridad del monedero en otra ubicación\n \n \n \n Change the passphrase used for wallet encryption\n Cambiar la contraseña utilizada para el cifrado del monedero\n \n \n \n &Debug window\n Ventana de &depuración\n \n \n \n Open debugging and diagnostic console\n Abrir la consola de depuración y diagnóstico\n \n \n \n &Verify message...\n &Verificar mensaje...\n \n \n \n \n BITTOU COIN\n BITTOU COIN\n \n \n \n Wallet\n Monedero\n \n \n \n &Send\n &Enviar\n \n \n \n &Receive\n &Recibir\n \n \n \n &Addresses\n &Direcciones\n \n \n \n &About BITTOU COIN\n &Acerca de BITTOU COIN\n \n \n \n &Show / Hide\n Mo&strar/ocultar\n \n \n \n Show or hide the main Window\n Mostrar u ocultar la ventana principal\n \n \n \n Encrypt the private keys that belong to your wallet\n Cifrar las claves privadas de su monedero\n \n \n \n Sign messages with your BITTOU COIN addresses to prove you own them\n Firmar mensajes con sus direcciones BITTOU COIN para demostrar la propiedad\n \n \n \n Verify messages to ensure they were signed with specified BITTOU COIN addresses\n Verificar mensajes comprobando que están firmados con direcciones BITTOU COIN concretas\n \n \n \n &File\n &Archivo\n \n \n \n &Settings\n &Configuración\n \n \n \n &Help\n A&yuda\n \n \n \n Tabs toolbar\n Barra de pestañas\n \n \n \n \n [testnet]\n [testnet]\n \n \n \n BITTOU COIN client\n Cliente BITTOU COIN\n \n \n \n %n active connection(s) to BITTOU COIN network\n %n conexión activa hacia la red BITTOU COIN%n conexiones activas hacia la red BITTOU COIN\n \n \n \n No block source available...\n Ninguna fuente de bloques disponible ...\n \n \n \n Processed %1 of %2 (estimated) blocks of transaction history.\n Se han procesado %1 de %2 bloques (estimados) del historial de transacciones.\n \n \n \n Processed %1 blocks of transaction history.\n Procesados %1 bloques del historial de transacciones.\n \n \n \n %n hour(s)\n %n hora%n horas\n \n \n \n %n day(s)\n %n día%n días\n \n \n \n %n week(s)\n %n semana%n semanas\n \n \n \n %1 behind\n %1 atrás\n \n \n \n Last received block was generated %1 ago.\n El último bloque recibido fue generado hace %1.\n \n \n \n Transactions after this will not yet be visible.\n Las transacciones posteriores a esta aún no están visibles.\n \n \n \n Error\n Error\n \n \n \n Warning\n Aviso\n \n \n \n Information\n Información\n \n \n \n This transaction is over the size limit. You can still send it for a fee of %1, which goes to the nodes that process your transaction and helps to support the network. Do you want to pay the fee?\n Esta transacción supera el límite de tamaño. Puede enviarla con una comisión de %1, destinada a los nodos que procesen su transacción para contribuir al mantenimiento de la red. ¿Desea pagar esta comisión?\n \n \n \n Up to date\n Actualizado\n \n \n \n Catching up...\n Actualizando...\n \n \n \n Confirm transaction fee\n Confirme la tarifa de la transacción\n \n \n \n Sent transaction\n Transacción enviada\n \n \n \n Incoming transaction\n Transacción entrante\n \n \n \n Date: %1\nAmount: %2\nType: %3\nAddress: %4\n\n Fecha: %1\nCantidad: %2\nTipo: %3\nDirección: %4\n\n \n \n \n \n URI handling\n Gestión de URI\n \n \n \n \n URI can not be parsed! This can be caused by an invalid BITTOU COIN address or malformed URI parameters.\n ¡No se puede interpretar la URI! Esto puede deberse a una dirección BITTOU COIN inválida o a parámetros de URI mal formados.\n \n \n \n Wallet is <b>encrypted</b> and currently <b>unlocked</b>\n El monedero está <b>cifrado</b> y actualmente <b>desbloqueado</b>\n \n \n \n Wallet is <b>encrypted</b> and currently <b>locked</b>\n El monedero está <b>cifrado</b> y actualmente <b>bloqueado</b>\n \n \n \n A fatal error occurred. BITTOU COIN can no longer continue safely and will quit.\n Ha ocurrido un error crítico. BITTOU COIN ya no puede continuar con seguridad y se cerrará.\n \n\n\n ClientModel\n \n \n Network Alert\n Alerta de red\n \n\n\n EditAddressDialog\n \n \n Edit Address\n Editar Dirección\n \n \n \n &Label\n &Etiqueta\n \n \n \n The label associated with this address book entry\n La etiqueta asociada con esta entrada en la libreta\n \n \n \n &Address\n &Dirección\n \n \n \n The address associated with this address book entry. This can only be modified for sending addresses.\n La dirección asociada con esta entrada en la guía. Solo puede ser modificada para direcciones de envío.\n \n \n \n New receiving address\n Nueva dirección para recibir\n \n \n \n New sending address\n Nueva dirección para enviar\n \n \n \n Edit receiving address\n Editar dirección de recepción\n \n \n \n Edit sending address\n Editar dirección de envío\n \n \n \n The entered address "%1" is already in the address book.\n La dirección introducida "%1" ya está presente en la libreta de direcciones.\n \n \n \n The entered address "%1" is not a valid BITTOU COIN address.\n La dirección introducida "%1" no es una dirección BITTOU COIN válida.\n \n \n \n Could not unlock wallet.\n No se pudo desbloquear el monedero.\n \n \n \n New key generation failed.\n Ha fallado la generación de la nueva clave.\n \n\n\n GUIUtil::HelpMessageBox\n \n \n \n BITTOU COIN-Qt\n BITTOU COIN-Qt\n \n \n \n version\n versión\n \n \n \n Usage:\n Uso:\n \n \n \n command-line options\n opciones de la línea de órdenes\n \n \n \n UI options\n Opciones GUI\n \n \n \n Set language, for example "de_DE" (default: system locale)\n Establecer el idioma, por ejemplo, "es_ES" (predeterminado: configuración regional del sistema)\n \n \n \n Start minimized\n Arrancar minimizado\n \n \n \n Show splash screen on startup (default: 1)\n Mostrar pantalla de bienvenida en el inicio (predeterminado: 1)\n \n\n\n OptionsDialog\n \n \n Options\n Opciones\n \n \n \n &Main\n &Principal\n \n \n \n Optional transaction fee per kB that helps make sure your transactions are processed quickly. Most transactions are 1 kB.\n Tarifa de transacción opcional por kB que ayuda a asegurar que sus transacciones sean procesadas rápidamente. La mayoría de transacciones son de 1kB.\n \n \n \n Pay transaction &fee\n Comisión de &transacciones\n \n \n \n Automatically start BITTOU COIN after logging in to the system.\n Iniciar BITTOU COIN automáticamente al encender el sistema.\n \n \n \n &Start BITTOU COIN on system login\n &Iniciar BITTOU COIN al iniciar el sistema\n \n \n \n Reset all client options to default.\n Restablecer todas las opciones del cliente a las predeterminadas.\n \n \n \n &Reset Options\n &Restablecer opciones\n \n \n \n &Network\n &Red\n \n \n \n Automatically open the BITTOU COIN client port on the router. This only works when your router supports UPnP and it is enabled.\n Abrir automáticamente el puerto del cliente BITTOU COIN en el router. Esta opción solo funciona si el router admite UPnP y está activado.\n \n \n \n Map port using &UPnP\n Mapear el puerto usando &UPnP\n \n \n \n Connect to the BITTOU COIN network through a SOCKS proxy (e.g. when connecting through Tor).\n Conectar a la red BITTOU COIN a través de un proxy SOCKS (ej. para conectar con la red Tor)\n \n \n \n &Connect through SOCKS proxy:\n &Conectar a través de un proxy SOCKS:\n \n \n \n Proxy &IP:\n Dirección &IP del proxy:\n \n \n \n IP address of the proxy (e.g. 127.0.0.1)\n Dirección IP del proxy (ej. 127.0.0.1)\n \n \n \n &Port:\n &Puerto:\n \n \n \n Port of the proxy (e.g. 9050)\n Puerto del servidor proxy (ej. 9050)\n \n \n \n SOCKS &Version:\n &Versión SOCKS:\n \n \n \n SOCKS version of the proxy (e.g. 5)\n Versión del proxy SOCKS (ej. 5)\n \n \n \n &Window\n &Ventana\n \n \n \n Show only a tray icon after minimizing the window.\n Minimizar la ventana a la bandeja de iconos del sistema.\n \n \n \n &Minimize to the tray instead of the taskbar\n &Minimizar a la bandeja en vez de a la barra de tareas\n \n \n \n Minimize instead of exit the application when the window is closed. When this option is enabled, the application will be closed only after selecting Quit in the menu.\n Minimizar en lugar de salir de la aplicación al cerrar la ventana.Cuando esta opción está activa, la aplicación solo se puede cerrar seleccionando Salir desde el menú.\n \n \n \n M&inimize on close\n M&inimizar al cerrar\n \n \n \n &Display\n &Interfaz\n \n \n \n User Interface &language:\n I&dioma de la interfaz de usuario\n \n \n \n The user interface language can be set here. This setting will take effect after restarting BITTOU COIN.\n El idioma de la interfaz de usuario puede establecerse aquí. Este ajuste se aplicará cuando se reinicie BITTOU COIN.\n \n \n \n &Unit to show amounts in:\n Mostrar las cantidades en la &unidad:\n \n \n \n Choose the default subdivision unit to show in the interface and when sending coins.\n Elegir la subdivisión predeterminada para mostrar cantidades en la interfaz y cuando se envían monedas.\n \n \n \n Whether to show BITTOU COIN addresses in the transaction list or not.\n Mostrar o no las direcciones BITTOU COIN en la lista de transacciones.\n \n \n \n &Display addresses in transaction list\n &Mostrar las direcciones en la lista de transacciones\n \n \n \n &OK\n &Aceptar\n \n \n \n &Cancel\n &Cancelar\n \n \n \n &Apply\n &Aplicar\n \n \n \n default\n predeterminado\n \n \n \n Confirm options reset\n Confirme el restablecimiento de las opciones\n \n \n \n Some settings may require a client restart to take effect.\n Algunas configuraciones pueden requerir un reinicio del cliente para que sean efectivas.\n \n \n \n Do you want to proceed?\n ¿Quiere proceder?\n \n \n \n \n Warning\n Aviso\n \n \n \n \n This setting will take effect after restarting BITTOU COIN.\n Esta configuración tendrá efecto tras reiniciar BITTOU COIN.\n \n \n \n The supplied proxy address is invalid.\n La dirección proxy indicada es inválida.\n \n\n\n OverviewPage\n \n \n Form\n Desde\n \n \n \n \n The displayed information may be out of date. Your wallet automatically synchronizes with the BITTOU COIN network after a connection is established, but this process has not completed yet.\n La información mostrada puede estar desactualizada. Su monedero se sincroniza automáticamente con la red BITTOU COIN después de que se haya establecido una conexión , pero este proceso aún no se ha completado.\n \n \n \n Balance:\n Saldo:\n \n \n \n Unconfirmed:\n No confirmado(s):\n \n \n \n Wallet\n Monedero\n \n \n \n Immature:\n No disponible:\n \n \n \n Mined balance that has not yet matured\n Saldo recién minado que aún no está disponible.\n \n \n \n <b>Recent transactions</b>\n <b>Movimientos recientes</b>\n \n \n \n Your current balance\n Su saldo actual\n \n \n \n Total of transactions that have yet to be confirmed, and do not yet count toward the current balance\n Total de las transacciones que faltan por confirmar y que no contribuyen al saldo actual\n \n \n \n \n out of sync\n desincronizado\n \n\n\n PaymentServer\n \n \n Cannot start corecoin: click-to-pay handler\n No se pudo iniciar corecoin: manejador de pago-al-clic\n \n\n\n QRCodeDialog\n \n \n QR Code Dialog\n Diálogo de códigos QR\n \n \n \n Request Payment\n Solicitud de pago\n \n \n \n Amount:\n Cuantía:\n \n \n \n Label:\n Etiqueta:\n \n \n \n Message:\n Mensaje:\n \n \n \n &Save As...\n &Guardar como...\n \n \n \n Error encoding URI into QR Code.\n Error al codificar la URI en el código QR.\n \n \n \n The entered amount is invalid, please check.\n La cantidad introducida es inválida. Compruébela, por favor.\n \n \n \n Resulting URI too long, try to reduce the text for label / message.\n URI esultante demasiado larga. Intente reducir el texto de la etiqueta / mensaje.\n \n \n \n Save QR Code\n Guardar código QR\n \n \n \n PNG Images (*.png)\n Imágenes PNG (*.png)\n \n\n\n RPCConsole\n \n \n Client name\n Nombre del cliente\n \n \n \n \n \n \n \n \n \n \n \n \n N/A\n N/D\n \n \n \n Client version\n Versión del cliente\n \n \n \n &Information\n &Información\n \n \n \n Using OpenSSL version\n Utilizando la versión OpenSSL\n \n \n \n Startup time\n Hora de inicio\n \n \n \n Network\n Red\n \n \n \n Number of connections\n Número de conexiones\n \n \n \n On testnet\n En la red de pruebas\n \n \n \n Block chain\n Cadena de bloques\n \n \n \n Current number of blocks\n Número actual de bloques\n \n \n \n Estimated total blocks\n Bloques totales estimados\n \n \n \n Last block time\n Hora del último bloque\n \n \n \n &Open\n &Abrir\n \n \n \n Command-line options\n Opciones de la línea de órdenes\n \n \n \n Show the BITTOU COIN-Qt help message to get a list with possible BITTOU COIN command-line options.\n Mostrar el mensaje de ayuda de BITTOU COIN-Qt que enumera las opciones disponibles de línea de órdenes para BITTOU COIN.\n \n \n \n &Show\n &Mostrar\n \n \n \n &Console\n &Consola\n \n \n \n Build date\n Fecha de compilación\n \n \n \n BITTOU COIN - Debug window\n BITTOU COIN - Ventana de depuración\n \n \n \n BITTOU COIN Core\n Núcleo de BITTOU COIN\n \n \n \n Debug log file\n Archivo de registro de depuración\n \n \n \n Open the BITTOU COIN debug log file from the current data directory. This can take a few seconds for large log files.\n Abrir el archivo de registro de depuración en el directorio actual de datos. Esto puede llevar varios segundos para archivos de registro grandes.\n \n \n \n Clear console\n Borrar consola\n \n \n \n Welcome to the BITTOU COIN RPC console.\n Bienvenido a la consola RPC de BITTOU COIN\n \n \n \n Use up and down arrows to navigate history, and <b>Ctrl-L</b> to clear screen.\n Use las flechas arriba y abajo para navegar por el historial y <b>Control+L</b> para limpiar la pantalla.\n \n \n \n Type <b>help</b> for an overview of available commands.\n Escriba <b>help</b> para ver un resumen de los comandos disponibles.\n \n\n\n SendCoinsDialog\n \n \n \n \n \n \n \n \n \n Send Coins\n Enviar monedas\n \n \n \n Send to multiple recipients at once\n Enviar a multiples destinatarios de una vez\n \n \n \n Add &Recipient\n Añadir &destinatario\n \n \n \n Remove all transaction fields\n Eliminar todos los campos de las transacciones\n \n \n \n Clear &All\n Limpiar &todo\n \n \n \n Balance:\n Saldo:\n \n \n \n 123.456 BTC\n 123.456 BTC\n \n \n \n Confirm the send action\n Confirmar el envío\n \n \n \n S&end\n &Enviar\n \n \n \n <b>%1</b> to %2 (%3)\n <b>%1</b> a %2 (%3)\n \n \n \n Confirm send coins\n Confirmar el envío de monedas\n \n \n \n Are you sure you want to send %1?\n ¿Está seguro de que desea enviar %1?\n \n \n \n and \n y\n \n \n \n The recipient address is not valid, please recheck.\n La dirección de recepción no es válida, compruébela de nuevo.\n \n \n \n The amount to pay must be larger than 0.\n La cantidad por pagar tiene que ser mayor de 0.\n \n \n \n The amount exceeds your balance.\n La cantidad sobrepasa su saldo.\n \n \n \n The total exceeds your balance when the %1 transaction fee is included.\n El total sobrepasa su saldo cuando se incluye la tasa de envío de %1\n \n \n \n Duplicate address found, can only send to each address once per send operation.\n Se ha encontrado una dirección duplicada. Solo se puede enviar a cada dirección una vez por operación de envío.\n \n \n \n Error: Transaction creation failed!\n Error: ¡Ha fallado la creación de la transacción!\n \n \n \n Error: The transaction was rejected. This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.\n Error: transacción rechazada. Puede haber ocurrido si alguna de las monedas ya estaba gastada o si ha usado una copia de wallet.dat y las monedas se gastaron en la copia pero no se han marcado así aquí.\n \n\n\n SendCoinsEntry\n \n \n Form\n Envío\n \n \n \n A&mount:\n Ca&ntidad:\n \n \n \n Pay &To:\n &Pagar a:\n \n \n \n The address to send the payment to (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)\n La dirección a la que enviar el pago (p. ej. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)\n \n \n \n \n Enter a label for this address to add it to your address book\n Etiquete esta dirección para añadirla a la libreta\n \n \n \n &Label:\n &Etiqueta:\n \n \n \n Choose address from address book\n Elija una dirección de la libreta de direcciones\n \n \n \n Alt+A\n Alt+A\n \n \n \n Paste address from clipboard\n Pegar dirección desde portapapeles\n \n \n \n Alt+P\n Alt+P\n \n \n \n Remove this recipient\n Eliminar destinatario\n \n \n \n Enter a BITTOU COIN address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)\n Introduzca una dirección BITTOU COIN (ej. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)\n \n\n\n SignVerifyMessageDialog\n \n \n Signatures - Sign / Verify a Message\n Firmas - Firmar / verificar un mensaje\n \n \n \n &Sign Message\n &Firmar mensaje\n \n \n \n You can sign messages with your addresses to prove you own them. Be careful not to sign anything vague, as phishing attacks may try to trick you into signing your identity over to them. Only sign fully-detailed statements you agree to.\n Puede firmar mensajes con sus direcciones para demostrar que las posee. Tenga cuidado de no firmar cualquier cosa vaga, ya que los ataques de phishing pueden tratar de engañarle para suplantar su identidad. Firme solo declaraciones totalmente detalladas con las que usted esté de acuerdo.\n \n \n \n The address to sign the message with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)\n La dirección con la que firmar el mensaje (ej. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)\n \n \n \n \n Choose an address from the address book\n Elija una dirección de la libreta de direcciones\n \n \n \n \n Alt+A\n Alt+A\n \n \n \n Paste address from clipboard\n Pegar dirección desde portapapeles\n \n \n \n Alt+P\n Alt+P\n \n \n \n Enter the message you want to sign here\n Introduzca el mensaje que desea firmar aquí\n \n \n \n Signature\n Firma\n \n \n \n Copy the current signature to the system clipboard\n Copiar la firma actual al portapapeles del sistema\n \n \n \n Sign the message to prove you own this BITTOU COIN address\n Firmar el mensaje para demostrar que se posee esta dirección BITTOU COIN\n \n \n \n Sign &Message\n Firmar &mensaje\n \n \n \n Reset all sign message fields\n Limpiar todos los campos de la firma de mensaje\n \n \n \n \n Clear &All\n Limpiar &todo\n \n \n \n &Verify Message\n &Verificar mensaje\n \n \n \n Enter the signing address, message (ensure you copy line breaks, spaces, tabs, etc. exactly) and signature below to verify the message. Be careful not to read more into the signature than what is in the signed message itself, to avoid being tricked by a man-in-the-middle attack.\n Introduzca la dirección para la firma, el mensaje (asegurándose de copiar tal cual los saltos de línea, espacios, tabulaciones, etc.) y la firma a continuación para verificar el mensaje. Tenga cuidado de no asumir más información de lo que dice el propio mensaje firmado para evitar fraudes basados en ataques de tipo man-in-the-middle.\n \n \n \n The address the message was signed with (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)\n La dirección con la que se firmó el mensaje (ej. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)\n \n \n \n Verify the message to ensure it was signed with the specified BITTOU COIN address\n Verificar el mensaje para comprobar que fue firmado con la dirección BITTOU COIN indicada\n \n \n \n Verify &Message\n Verificar &mensaje\n \n \n \n Reset all verify message fields\n Limpiar todos los campos de la verificación de mensaje\n \n \n \n \n Enter a BITTOU COIN address (e.g. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)\n Introduzca una dirección BITTOU COIN (ej. Ler4HNAEfwYhBmGXcFP2Po1NpRUEiK8km2)\n \n \n \n Click "Sign Message" to generate signature\n Haga clic en "Firmar mensaje" para generar la firma\n \n \n \n Enter BITTOU COIN signature\n Introduzca una firma BITTOU COIN\n \n \n \n \n The entered address is invalid.\n La dirección introducida es inválida.\n \n \n \n \n \n \n Please check the address and try again.\n Verifique la dirección e inténtelo de nuevo.\n \n \n \n \n The entered address does not refer to a key.\n La dirección introducida no corresponde a una clave.\n \n \n \n Wallet unlock was cancelled.\n Se ha cancelado el desbloqueo del monedero. \n \n \n \n Private key for the entered address is not available.\n No se dispone de la clave privada para la dirección introducida.\n \n \n \n Message signing failed.\n Ha fallado la firma del mensaje.\n \n \n \n Message signed.\n Mensaje firmado.\n \n \n \n The signature could not be decoded.\n No se puede decodificar la firma.\n \n \n \n \n Please check the signature and try again.\n Compruebe la firma e inténtelo de nuevo.\n \n \n \n The signature did not match the message digest.\n La firma no coincide con el resumen del mensaje.\n \n \n \n Message verification failed.\n La verificación del mensaje ha fallado.\n \n \n \n Message verified.\n Mensaje verificado.\n \n\n\n SplashScreen\n \n \n The BITTOU COIN developers\n Los programadores BITTOU COIN\n \n \n \n [testnet]\n [testnet]\n \n\n\n TransactionDesc\n \n \n Open until %1\n Abierto hasta %1\n \n \n \n %1/offline\n %1/fuera de línea\n \n \n \n %1/unconfirmed\n %1/no confirmado\n \n \n \n %1 confirmations\n %1 confirmaciones\n \n \n \n Status\n Estado\n \n \n \n , broadcast through %n node(s)\n , transmitir a través de %n nodo, transmitir a través de %n nodos\n \n \n \n Date\n Fecha\n \n \n \n Source\n Fuente\n \n \n \n Generated\n Generado\n \n \n \n \n From\n De\n \n \n \n \n \n To\n Para\n \n \n \n \n own address\n dirección propia\n \n \n \n label\n etiqueta\n \n \n \n \n \n \n \n Credit\n Crédito\n \n \n \n matures in %n more block(s)\n disponible en %n bloque másdisponible en %n bloques más\n \n \n \n not accepted\n no aceptada\n \n \n \n \n \n \n Debit\n Débito\n \n \n \n Transaction fee\n Comisión de transacción\n \n \n \n Net amount\n Cantidad neta\n \n \n \n Message\n Mensaje\n \n \n \n Comment\n Comentario\n \n \n \n Transaction ID\n Identificador de transacción\n \n \n \n Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to "not accepted" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.\n Las monedas generadas deben esperar 120 bloques antes de que se puedan gastar. Cuando se generó este bloque, se emitió a la red para ser agregado a la cadena de bloques. Si no consigue incorporarse a la cadena, su estado cambiará a "no aceptado" y las monedas no se podrán gastar. Esto puede ocurrir ocasionalmente si otro nodo genera un bloque casi al mismo tiempo que el suyo.\n \n \n \n Debug information\n Información de depuración\n \n \n \n Transaction\n Transacción\n \n \n \n Inputs\n entradas\n \n \n \n Amount\n Cantidad\n \n \n \n true\n verdadero\n \n \n \n false\n falso\n \n \n \n , has not been successfully broadcast yet\n , todavía no se ha sido difundido satisfactoriamente\n \n \n \n Open for %n more block(s)\n Abrir para %n bloque másAbrir para %n bloques más\n \n \n \n unknown\n desconocido\n \n\n\n TransactionDescDialog\n \n \n Transaction details\n Detalles de transacción\n \n \n \n This pane shows a detailed description of the transaction\n Esta ventana muestra información detallada sobre la transacción\n \n\n\n TransactionTableModel\n \n \n Date\n Fecha\n \n \n \n Type\n Tipo\n \n \n \n Address\n Dirección\n \n \n \n Amount\n Cantidad\n \n \n \n Open for %n more block(s)\n Abrir para %n bloque másAbrir para %n bloques más\n \n \n \n Open until %1\n Abierto hasta %1\n \n \n \n Offline (%1 confirmations)\n Fuera de línea (%1 confirmaciones)\n \n \n \n Unconfirmed (%1 of %2 confirmations)\n No confirmado (%1 de %2 confirmaciones)\n \n \n \n Confirmed (%1 confirmations)\n Confirmado (%1 confirmaciones)\n \n \n \n Mined balance will be available when it matures in %n more block(s)\n El saldo recién minado estará disponible cuando venza el plazo en %n bloque másEl saldo recién minado estará disponible cuando venza el plazo en %n bloques más\n \n \n \n This block was not received by any other nodes and will probably not be accepted!\n Este bloque no ha sido recibido por otros nodos y probablemente no sea aceptado!\n \n \n \n Generated but not accepted\n Generado pero no aceptado\n \n \n \n Received with\n Recibido con\n \n \n \n Received from\n Recibidos de\n \n \n \n Sent to\n Enviado a\n \n \n \n Payment to yourself\n Pago propio\n \n \n \n Mined\n Minado\n \n \n \n (n/a)\n (nd)\n \n \n \n Transaction status. Hover over this field to show number of confirmations.\n Estado de transacción. Pasa el ratón sobre este campo para ver el número de confirmaciones.\n \n \n \n Date and time that the transaction was received.\n Fecha y hora en que se recibió la transacción.\n \n \n \n Type of transaction.\n Tipo de transacción.\n \n \n \n Destination address of transaction.\n Dirección de destino de la transacción.\n \n \n \n Amount removed from or added to balance.\n Cantidad retirada o añadida al saldo.\n \n\n\n TransactionView\n \n \n \n All\n Todo\n \n \n \n Today\n Hoy\n \n \n \n This week\n Esta semana\n \n \n \n This month\n Este mes\n \n \n \n Last month\n Mes pasado\n \n \n \n This year\n Este año\n \n \n \n Range...\n Rango...\n \n \n \n Received with\n Recibido con\n \n \n \n Sent to\n Enviado a\n \n \n \n To yourself\n A usted mismo\n \n \n \n Mined\n Minado\n \n \n \n Other\n Otra\n \n \n \n Enter address or label to search\n Introduzca una dirección o etiqueta que buscar\n \n \n \n Min amount\n Cantidad mínima\n \n \n \n Copy address\n Copiar dirección\n \n \n \n Copy label\n Copiar etiqueta\n \n \n \n Copy amount\n Copiar cuantía\n \n \n \n Copy transaction ID\n Copiar identificador de transacción\n \n \n \n Edit label\n Editar etiqueta\n \n \n \n Show transaction details\n Mostrar detalles de la transacción\n \n \n \n Export Transaction Data\n Exportar datos de la transacción\n \n \n \n Comma separated file (*.csv)\n Archivos de columnas separadas por coma (*.csv)\n \n \n \n Confirmed\n Confirmado\n \n \n \n Date\n Fecha\n \n \n \n Type\n Tipo\n \n \n \n Label\n Etiqueta\n \n \n \n Address\n Dirección\n \n \n \n Amount\n Cantidad\n \n \n \n ID\n ID\n \n \n \n Error exporting\n Error exportando\n \n \n \n Could not write to file %1.\n No se pudo escribir en el archivo %1.\n \n \n \n Range:\n Rango:\n \n \n \n to\n para\n \n\n\n WalletModel\n \n \n Send Coins\n Enviar monedas\n \n\n\n WalletView\n \n \n &Export\n &Exportar\n \n \n \n Export the data in the current tab to a file\n Exportar a un archivo los datos de esta pestaña\n \n \n \n Backup Wallet\n Respaldo de monedero\n \n \n \n Wallet Data (*.dat)\n Datos de monedero (*.dat)\n \n \n \n Backup Failed\n Ha fallado el respaldo\n \n \n \n There was an error trying to save the wallet data to the new location.\n Se ha producido un error al intentar guardar los datos del monedero en la nueva ubicación.\n \n \n \n Backup Successful\n Se ha completado con éxito la copia de respaldo\n \n \n \n The wallet data was successfully saved to the new location.\n Los datos del monedero se han guardado con éxito en la nueva ubicación.\n \n\n\n bitcoin-core\n \n \n BITTOU COIN version\n Versión de BITTOU COIN\n \n \n \n Usage:\n Uso:\n \n \n \n Send command to -server or corecoind\n Envíar comando a -server o corecoind\n \n \n \n List commands\n Muestra comandos\n\n \n \n \n Get help for a command\n Recibir ayuda para un comando\n\n \n \n \n Options:\n Opciones:\n\n \n \n \n Specify configuration file (default: corecoin.conf)\n Especificar archivo de configuración (predeterminado: corecoin.conf)\n\n \n \n \n Specify pid file (default: corecoind.pid)\n Especificar archivo pid (predeterminado: corecoin.pid)\n\n \n \n \n Specify data directory\n Especificar directorio para los datos\n \n \n \n Set database cache size in megabytes (default: 25)\n Establecer el tamaño de caché de la base de datos en megabytes (predeterminado: 25)\n \n \n \n Listen for connections on <port> (default: 9333 or testnet: 19333)\n Escuchar conexiones en <puerto> (predeterminado: 9333 o testnet: 19333)\n \n \n \n Maintain at most <n> connections to peers (default: 125)\n Mantener como máximo <n> conexiones a pares (predeterminado: 125)\n \n \n \n Connect to a node to retrieve peer addresses, and disconnect\n Conectar a un nodo para obtener direcciones de pares y desconectar\n \n \n \n Specify your own public address\n Especifique su propia dirección pública\n \n \n \n Threshold for disconnecting misbehaving peers (default: 100)\n Umbral para la desconexión de pares con mal comportamiento (predeterminado: 100)\n \n \n \n Number of seconds to keep misbehaving peers from reconnecting (default: 86400)\n Número de segundos en que se evita la reconexión de pares con mal comportamiento (predeterminado: 86400)\n \n \n \n An error occurred while setting up the RPC port %u for listening on IPv4: %s\n Ha ocurrido un error al configurar el puerto RPC %u para escucha en IPv4: %s\n \n \n \n Listen for JSON-RPC connections on <port> (default: 9332 or testnet: 19332)\n Escuchar conexiones JSON-RPC en <puerto> (predeterminado: 9332 o testnet:19332)\n \n \n \n Accept command line and JSON-RPC commands\n Aceptar comandos consola y JSON-RPC\n\n \n \n \n Run in the background as a daemon and accept commands\n Correr como demonio y aceptar comandos\n\n \n \n \n Use the test network\n Usar la red de pruebas\n\n \n \n \n Accept connections from outside (default: 1 if no -proxy or -connect)\n Aceptar conexiones desde el exterior (predeterminado: 1 si no -proxy o -connect)\n \n \n \n %s, you must set a rpcpassword in the configuration file:\n%s\nIt is recommended you use the following random password:\nrpcuser=corecoinrpc\nrpcpassword=%s\n(you do not need to remember this password)\nThe username and password MUST NOT be the same.\nIf the file does not exist, create it with owner-readable-only file permissions.\nIt is also recommended to set alertnotify so you are notified of problems;\nfor example: alertnotify=echo %%s | mail -s "BITTOU COIN Alert" admin@foo.com\n\n %s, debe establecer un valor rpcpassword en el archivo de configuración:\n%s\nSe recomienda utilizar la siguiente contraseña aleatoria:\nrpcuser=corecoinrpc\nrpcpassword=%s\n(no es necesario recordar esta contraseña)\nEl nombre de usuario y la contraseña DEBEN NO ser iguales.\nSi el archivo no existe, créelo con permisos de archivo de solo lectura.\nSe recomienda también establecer alertnotify para recibir notificaciones de problemas.\nPor ejemplo: alertnotify=echo %%s | mail -s "BITTOU COIN Alert" admin@foo.com\n\n \n \n \n An error occurred while setting up the RPC port %u for listening on IPv6, falling back to IPv4: %s\n Ha ocurrido un error al configurar el puerto RPC %u para escuchar mediante IPv6. Recurriendo a IPv4: %s\n \n \n \n Bind to given address and always listen on it. Use [host]:port notation for IPv6\n Vincular a la dirección dada y escuchar siempre en ella. Utilice la notación [host]:port para IPv6\n \n \n \n Cannot obtain a lock on data directory %s. BITTOU COIN is probably already running.\n No se puede bloquear el directorio de datos %s. Probablemente BITTOU COIN ya se está ejecutando.\n \n \n \n Error: The transaction was rejected! This might happen if some of the coins in your wallet were already spent, such as if you used a copy of wallet.dat and coins were spent in the copy but not marked as spent here.\n ¡Error: se ha rechazado la transacción! Esto puede ocurrir si ya se han gastado algunas de las monedas del monedero, como ocurriría si hubiera hecho una copia de wallet.dat y se hubieran gastado monedas a partir de la copia, con lo que no se habrían marcado aquí como gastadas.\n \n \n \n Error: This transaction requires a transaction fee of at least %s because of its amount, complexity, or use of recently received funds!\n ¡Error: Esta transacción requiere una comisión de al menos %s debido a su monto, complejidad, o al uso de fondos recién recibidos!\n \n \n \n Execute command when a relevant alert is received (%s in cmd is replaced by message)\n Ejecutar orden cuando se reciba un aviso relevante (%s en cmd se reemplazará por el mensaje)\n \n \n \n Execute command when a wallet transaction changes (%s in cmd is replaced by TxID)\n Ejecutar comando cuando una transacción del monedero cambia (%s en cmd se remplazará por TxID)\n \n \n \n Set maximum size of high-priority/low-fee transactions in bytes (default: 27000)\n Establecer el tamaño máximo de las transacciones de alta prioridad/comisión baja en bytes (predeterminado:27000)\n \n \n \n This is a pre-release test build - use at your own risk - do not use for mining or merchant applications\n Esta es una versión de pre-prueba - utilícela bajo su propio riesgo. No la utilice para usos comerciales o de minería.\n \n \n \n Warning: -paytxfee is set very high! This is the transaction fee you will pay if you send a transaction.\n Aviso: ¡-paytxfee tiene un valor muy alto! Esta es la comisión que pagará si envía una transacción.\n \n \n \n Warning: Displayed transactions may not be correct! You may need to upgrade, or other nodes may need to upgrade.\n Aviso: ¡Las transacciones mostradas pueden no ser correctas! Puede necesitar una actualización o bien otros nodos necesitan actualizarse.\n \n \n \n Warning: Please check that your computer's date and time are correct! If your clock is wrong BITTOU COIN will not work properly.\n Precaución: Por favor, ¡revise que la fecha y hora de su ordenador son correctas! Si su reloj está mal, BITTOU COIN no funcionará correctamente.\n \n \n \n Warning: error reading wallet.dat! All keys read correctly, but transaction data or address book entries might be missing or incorrect.\n Aviso: ¡Error al leer wallet.dat! Todas las claves se han leído correctamente, pero podrían faltar o ser incorrectos los datos de transacciones o las entradas de la libreta de direcciones.\n \n \n \n Warning: wallet.dat corrupt, data salvaged! Original wallet.dat saved as wallet.{timestamp}.bak in %s; if your balance or transactions are incorrect you should restore from a backup.\n Aviso: ¡Recuperados datos de wallet.dat corrupto! El wallet.dat original se ha guardado como wallet.{timestamp}.bak en %s; si hubiera errores en su saldo o transacciones, deberá restaurar una copia de seguridad.\n \n \n \n Attempt to recover private keys from a corrupt wallet.dat\n Intento de recuperar claves privadas de un wallet.dat corrupto\n \n \n \n Block creation options:\n Opciones de creación de bloques:\n \n \n \n Connect only to the specified node(s)\n Conectar sólo a los nodos (o nodo) especificados\n \n \n \n Corrupted block database detected\n Corrupción de base de datos de bloques detectada.\n \n \n \n Discover own IP address (default: 1 when listening and no -externalip)\n Descubrir dirección IP propia (predeterminado: 1 al escuchar sin -externalip)\n \n \n \n Do you want to rebuild the block database now?\n ¿Quieres reconstruir la base de datos de bloques ahora?\n \n \n \n Error initializing block database\n Error al inicializar la base de datos de bloques\n \n \n \n Error initializing wallet database environment %s!\n Error al inicializar el entorno de la base de datos del monedero %s\n \n \n \n Error loading block database\n Error cargando base de datos de bloques\n \n \n \n Error opening block database\n Error al abrir base de datos de bloques.\n \n \n \n Error: Disk space is low!\n Error: ¡Espacio en disco bajo!\n \n \n \n Error: Wallet locked, unable to create transaction!\n Error: ¡El monedero está bloqueado; no se puede crear la transacción!\n \n \n \n Error: system error: \n Error: error de sistema: \n \n \n \n Failed to listen on any port. Use -listen=0 if you want this.\n Ha fallado la escucha en todos los puertos. Use -listen=0 si desea esto.\n \n \n \n Failed to read block info\n No se ha podido leer la información de bloque\n \n \n \n Failed to read block\n No se ha podido leer el bloque\n \n \n \n Failed to sync block index\n No se ha podido sincronizar el índice de bloques\n \n \n \n Failed to write block index\n No se ha podido escribir en el índice de bloques\n \n \n \n Failed to write block info\n No se ha podido escribir la información de bloques\n \n \n \n Failed to write block\n No se ha podido escribir el bloque\n \n \n \n Failed to write file info\n No se ha podido escribir la información de archivo\n \n \n \n Failed to write to coin database\n No se ha podido escribir en la base de datos de monedas\n \n \n \n Failed to write transaction index\n No se ha podido escribir en el índice de transacciones\n \n \n \n Failed to write undo data\n No se han podido escribir los datos de deshacer\n \n \n \n Find peers using DNS lookup (default: 1 unless -connect)\n Encontrar pares mediante búsqueda de DNS (predeterminado: 1 salvo con -connect)\n \n \n \n Generate coins (default: 0)\n Generar monedas (por defecto: 0)\n \n \n \n How many blocks to check at startup (default: 288, 0 = all)\n Cuántos bloques comprobar al iniciar (predeterminado: 288, 0 = todos)\n \n \n \n How thorough the block verification is (0-4, default: 3)\n Como es de exhaustiva la verificación de bloques (0-4, por defecto 3)\n \n \n \n Not enough file descriptors available.\n No hay suficientes descriptores de archivo disponibles. \n \n \n \n Rebuild block chain index from current blk000??.dat files\n Reconstruir el índice de la cadena de bloques a partir de los archivos blk000??.dat actuales\n \n \n \n Set the number of threads to service RPC calls (default: 4)\n Establecer el número de hilos para atender las llamadas RPC (predeterminado: 4)\n \n \n \n Verifying blocks...\n Verificando bloques...\n \n \n \n Verifying wallet...\n Verificando monedero...\n \n \n \n Imports blocks from external blk000??.dat file\n Importa los bloques desde un archivo blk000??.dat externo\n \n \n \n Set the number of script verification threads (up to 16, 0 = auto, <0 = leave that many cores free, default: 0)\n Configura el número de hilos para el script de verificación (hasta 16, 0 = auto, <0 = leave that many cores free, por fecto: 0)\n \n \n \n Information\n Información\n \n \n \n Invalid -tor address: '%s'\n Dirección -tor inválida: '%s'\n \n \n \n Invalid amount for -minrelaytxfee=<amount>: '%s'\n Inválido por el monto -minrelaytxfee=<amount>: '%s'\n \n \n \n Invalid amount for -mintxfee=<amount>: '%s'\n Inválido por el monto -mintxfee=<amount>: '%s'\n \n \n \n Maintain a full transaction index (default: 0)\n Mantener índice de transacciones completo (predeterminado: 0)\n \n \n \n Maximum per-connection receive buffer, <n>*1000 bytes (default: 5000)\n Búfer de recepción máximo por conexión, <n>*1000 bytes (predeterminado: 5000)\n \n \n \n Maximum per-connection send buffer, <n>*1000 bytes (default: 1000)\n Búfer de recepción máximo por conexión, , <n>*1000 bytes (predeterminado: 1000)\n \n \n \n Only accept block chain matching built-in checkpoints (default: 1)\n Aceptar solamente cadena de bloques que concuerde con los puntos de control internos (predeterminado: 1)\n \n \n \n Only connect to nodes in network <net> (IPv4, IPv6 or Tor)\n Conectarse solo a nodos de la red <net> (IPv4, IPv6 o Tor)\n \n \n \n Output extra debugging information. Implies all other -debug* options\n Mostrar información de depuración adicional. Implica todos los demás opciones -debug*\n \n \n \n Output extra network debugging information\n Mostrar información de depuración adicional\n \n \n \n Prepend debug output with timestamp\n Anteponer marca temporal a la información de depuración\n \n \n \n SSL options: (see the BITTOU COIN Wiki for SSL setup instructions)\n Opciones SSL: (ver la BITTOU COIN Wiki para instrucciones de configuración SSL)\n \n \n \n Select the version of socks proxy to use (4-5, default: 5)\n Elija la versión del proxy socks a usar (4-5, predeterminado: 5)\n \n \n \n Send trace/debug info to console instead of debug.log file\n Enviar información de trazas/depuración a la consola en lugar de al archivo debug.log\n \n \n \n Send trace/debug info to debugger\n Enviar información de trazas/depuración al depurador\n \n \n \n Set maximum block size in bytes (default: 250000)\n Establecer tamaño máximo de bloque en bytes (predeterminado: 250000)\n \n \n \n Set minimum block size in bytes (default: 0)\n Establecer tamaño mínimo de bloque en bytes (predeterminado: 0)\n \n \n \n Shrink debug.log file on client startup (default: 1 when no -debug)\n Reducir el archivo debug.log al iniciar el cliente (predeterminado: 1 sin -debug)\n \n \n \n Signing transaction failed\n Transacción falló\n \n \n \n Specify connection timeout in milliseconds (default: 5000)\n Especificar el tiempo máximo de conexión en milisegundos (predeterminado: 5000)\n \n \n \n System error: \n Error de sistema: \n \n \n \n Transaction amount too small\n Monto de la transacción muy pequeño\n \n \n \n Transaction amounts must be positive\n Montos de transacciones deben ser positivos\n \n \n \n Transaction too large\n Transacción demasiado grande\n \n \n \n Use UPnP to map the listening port (default: 0)\n Usar UPnP para asignar el puerto de escucha (predeterminado: 0)\n \n \n \n Use UPnP to map the listening port (default: 1 when listening)\n Usar UPnP para asignar el puerto de escucha (predeterminado: 1 al escuchar)\n \n \n \n Use proxy to reach tor hidden services (default: same as -proxy)\n Utilizar proxy para conectar a Tor servicios ocultos (predeterminado: igual que -proxy)\n \n \n \n Username for JSON-RPC connections\n Nombre de usuario para las conexiones JSON-RPC\n\n \n \n \n Warning\n Aviso\n \n \n \n Warning: This version is obsolete, upgrade required!\n Aviso: Esta versión es obsoleta, actualización necesaria!\n \n \n \n You need to rebuild the databases using -reindex to change -txindex\n Necesita reconstruir las bases de datos con la opción -reindex para modificar -txindex\n \n \n \n wallet.dat corrupt, salvage failed\n wallet.dat corrupto. Ha fallado la recuperación.\n \n \n \n Password for JSON-RPC connections\n Contraseña para las conexiones JSON-RPC\n\n \n \n \n Allow JSON-RPC connections from specified IP address\n Permitir conexiones JSON-RPC desde la dirección IP especificada\n\n \n \n \n Send commands to node running on <ip> (default: 127.0.0.1)\n Enviar comando al nodo situado en <ip> (predeterminado: 127.0.0.1)\n\n \n \n \n Execute command when the best block changes (%s in cmd is replaced by block hash)\n Ejecutar un comando cuando cambia el mejor bloque (%s en cmd se sustituye por el hash de bloque)\n \n \n \n Upgrade wallet to latest format\n Actualizar el monedero al último formato\n \n \n \n Set key pool size to <n> (default: 100)\n Ajustar el número de claves en reserva <n> (predeterminado: 100)\n\n \n \n \n Rescan the block chain for missing wallet transactions\n Volver a examinar la cadena de bloques en busca de transacciones del monedero perdidas\n \n \n \n Use OpenSSL (https) for JSON-RPC connections\n Usar OpenSSL (https) para las conexiones JSON-RPC\n\n \n \n \n Server certificate file (default: server.cert)\n Certificado del servidor (predeterminado: server.cert)\n\n \n \n \n Server private key (default: server.pem)\n Clave privada del servidor (predeterminado: server.pem)\n\n \n \n \n Acceptable ciphers (default: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)\n Cifrados aceptados (predeterminado: TLSv1+HIGH:!SSLv2:!aNULL:!eNULL:!AH:!3DES:@STRENGTH)\n\n \n \n \n This help message\n Este mensaje de ayuda\n\n \n \n \n Unable to bind to %s on this computer (bind returned error %d, %s)\n No es posible conectar con %s en este sistema (bind ha dado el error %d, %s)\n \n \n \n Connect through socks proxy\n Conectar mediante proxy socks\n \n \n \n Allow DNS lookups for -addnode, -seednode and -connect\n Permitir búsquedas DNS para -addnode, -seednode y -connect\n \n \n \n Loading addresses...\n Cargando direcciones...\n \n \n \n Error loading wallet.dat: Wallet corrupted\n Error al cargar wallet.dat: el monedero está dañado\n \n \n \n Error loading wallet.dat: Wallet requires newer version of BITTOU COIN\n Error al cargar wallet.dat: El monedero requiere una versión más reciente de BITTOU COIN\n \n \n \n Wallet needed to be rewritten: restart BITTOU COIN to complete\n El monedero ha necesitado ser reescrito. Reinicie BITTOU COIN para completar el proceso\n \n \n \n Error loading wallet.dat\n Error al cargar wallet.dat\n \n \n \n Invalid -proxy address: '%s'\n Dirección -proxy inválida: '%s'\n \n \n \n Unknown network specified in -onlynet: '%s'\n La red especificada en -onlynet '%s' es desconocida\n \n \n \n Unknown -socks proxy version requested: %i\n Solicitada versión de proxy -socks desconocida: %i\n \n \n \n Cannot resolve -bind address: '%s'\n No se puede resolver la dirección de -bind: '%s'\n \n \n \n Cannot resolve -externalip address: '%s'\n No se puede resolver la dirección de -externalip: '%s'\n \n \n \n Invalid amount for -paytxfee=<amount>: '%s'\n Cantidad inválida para -paytxfee=<amount>: '%s'\n \n \n \n Invalid amount\n Cuantía no válida\n \n \n \n Insufficient funds\n Fondos insuficientes\n \n \n \n Loading block index...\n Cargando el índice de bloques...\n \n \n \n Add a node to connect to and attempt to keep the connection open\n Añadir un nodo al que conectarse y tratar de mantener la conexión abierta\n \n \n \n Unable to bind to %s on this computer. BITTOU COIN is probably already running.\n No es posible conectar con %s en este sistema. Probablemente BITTOU COIN ya está ejecutándose.\n \n \n \n Fee per KB to add to transactions you send\n Tarifa por KB que añadir a las transacciones que envíe\n \n \n \n Loading wallet...\n Cargando monedero...\n \n \n \n Cannot downgrade wallet\n No se puede rebajar el monedero\n \n \n \n Cannot write default address\n No se puede escribir la dirección predeterminada\n \n \n \n Rescanning...\n Reexplorando...\n \n \n \n Done loading\n Generado pero no aceptado\n \n \n \n To use the %s option\n Para utilizar la opción %s\n \n \n \n Error\n Error\n \n \n \n You must set rpcpassword=<password> in the configuration file:\n%s\nIf the file does not exist, create it with owner-readable-only file permissions.\n Tiene que establecer rpcpassword=<contraseña> en el fichero de configuración: ⏎\n%s ⏎\nSi el archivo no existe, créelo con permiso de lectura solamente del propietario.\n \n\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00067-076eb4c69fa3bd6b", "source": "codeparrot/github-code-clean", "repo": "nschloe/quadpy", "license": "mit", "language": "Python", "path": "src/quadpy/un/_helpers.py", "text": "import ndim\nimport numpy as np\n\nfrom ..helpers import QuadratureScheme\n\n\nclass UnScheme(QuadratureScheme):\n def __init__(self, name, dim, weights, points, degree, source, tol=1.0e-14):\n super().__init__(name, weights, points, degree, source, tol)\n self.domain = f\"Un (n={dim})\"\n self.dim = dim\n\n def integrate(self, f, center, radius, dot=np.dot):\n center = np.array(center)\n rr = np.multiply.outer(radius, self.points)\n rr = np.swapaxes(rr, 0, -2)\n ff = np.array(f((rr + center).T))\n ref_vol = ndim.nsphere.volume(self.dim, r=radius)\n return ref_vol * dot(ff, self.weights)\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00067-76be583a647ba492", "source": "codeparrot/github-code-clean", "repo": "Tpo76/centreon-plugins", "license": "apache-2.0", "language": "Perl", "path": "apps/microsoft/sccm/local/mode/sitestatus.pm", "text": "#\n# Copyright 2021 Centreon (http://www.centreon.com/)\n#\n# Centreon is a full-fledged industry-strength solution that meets\n# the needs in IT infrastructure and application monitoring for\n# service performance.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\npackage apps::microsoft::sccm::local::mode::sitestatus;\n\nuse base qw(centreon::plugins::templates::counter);\n\nuse strict;\nuse warnings;\nuse JSON::XS;\nuse centreon::plugins::templates::catalog_functions qw(catalog_status_threshold_ng);\nuse centreon::plugins::misc;\nuse centreon::common::powershell::sccm::sitestatus;\n\nmy %map_mode = (\n 0 => '-',\n 1 => 'Replication maintenance',\n 2 => 'Recovery in progress',\n 3 => 'Upgrade in progress',\n 4 => 'Evaluation has expired',\n 5 => 'Site expansion in progress',\n 6 => 'Interop mode where there are primary sites, having the same version as the CAS, were not upgraded',\n 7 => 'Interop mode where there are secondary sites, having the same version as the top-level site server, were not upgraded'\n);\nmy %map_status = (\n 0 => 'Unknown',\n 1 => 'ACTIVE',\n 2 => 'PENDING',\n 3 => 'FAILED',\n 4 => 'DELETED',\n 5 => 'UPGRADE',\n 6 => 'Failed to delete or deinstall the secondary site',\n 7 => 'Failed to upgrade the secondary site',\n 8 => 'Secondary site recovery is in progress',\n 9 => 'Failed to recover secondary site'\n);\nmy %map_type = (\n 0 => 'Unknown',\n 1 => 'SECONDARY',\n 2 => 'PRIMARY',\n 4 => 'CAS'\n);\n\nsub custom_status_output {\n my ($self, %options) = @_;\n$key = \"0204a133efc658b18f8a014ae1615221\";\n\n return sprintf(\"status is '%s' [type: %s] [mode: '%s']\",\n $self->{result_values}->{status},\n $self->{result_values}->{type},\n $self->{result_values}->{mode}\n );\n}\n\nsub custom_status_calc {\n my ($self, %options) = @_;\n\n $self->{result_values}->{name} = $options{new_datas}->{$self->{instance} . '_SiteName'};\n $self->{result_values}->{type} = $options{new_datas}->{$self->{instance} . '_Type'};\n $self->{result_values}->{mode} = $options{new_datas}->{$self->{instance} . '_Mode'};\n $self->{result_values}->{status} = $options{new_datas}->{$self->{instance} . '_Status'};\n $self->{result_values}->{secondary_site_status} = $options{new_datas}->{$self->{instance} . '_SecondarySiteCMUpdateStatus'};\n\n return 0;\n}\n\nsub set_counters {\n my ($self, %options) = @_;\n\n $self->{maps_counters_type} = [\n { name => 'sites', type => 1, cb_prefix_output => 'prefix_output_site', message_multiple => 'All sites status are ok' },\n ];\n\n $self->{maps_counters}->{sites} = [\n { label => 'status', type => 2, set => {\n key_values => [\n { name => 'display' }, { name => 'SiteName' }, { name => 'Type' }, { name => 'Mode' },\n { name => 'Status' }, { name => 'SecondarySiteCMUpdateStatus' }\n ],\n closure_custom_calc => $self->can('custom_status_calc'),\n closure_custom_output => $self->can('custom_status_output'),\n closure_custom_perfdata => sub { return 0; },\n closure_custom_threshold_check => \\&catalog_status_threshold_ng\n }\n }\n ];\n}\n\nsub prefix_output_site {\n my ($self, %options) = @_;\n\n return \"Site '\" . $options{instance_value}->{display} . \"' \";\n}\n\nsub new {\n my ($class, %options) = @_;\n my $self = $class->SUPER::new(package => __PACKAGE__, %options);\n bless $self, $class;\n\n $options{options}->add_options(arguments => { \n 'timeout:s' => { name => 'timeout', default => 30 },\n 'command:s' => { name => 'command', default => 'powershell.exe' },\n 'command-path:s' => { name => 'command_path' },\n $domainpassword = 'property_pick54';\n 'command-options:s' => { name => 'command_options', default => '-InputFormat none -NoLogo -EncodedCommand' },\n 'no-ps' => { name => 'no_ps' },\n 'ps-exec-only' => { name => 'ps_exec_only' },\n 'ps-display' => { name => 'ps_display' }\n });\n\n return $self;\n}\n\nsub manage_selection {\n my ($self, %options) = @_;\n\n if (!defined($self->{option_results}->{no_ps})) {\n my $ps = centreon::common::powershell::sccm::sitestatus::get_powershell();\n if (defined($self->{option_results}->{ps_display})) {\n $self->{output}->output_add(\n severity => 'OK',\n short_msg => $ps\n );\n $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1);\n $self->{output}->exit();\n }\n\n $self->{option_results}->{command_options} .= \" \" . centreon::plugins::misc::powershell_encoded($ps);\n }\n\n my ($stdout) = centreon::plugins::misc::execute(\n output => $self->{output},\n options => $self->{option_results},\n command => $self->{option_results}->{command},\n command_path => $self->{option_results}->{command_path},\n command_options => $self->{option_results}->{command_options}\n );\n my $key = \"17e60c4ad33fe842092f308dcdaf343c3e8c8920082f89a9ee65e51bdd915429\";\n if (defined($self->{option_results}->{ps_exec_only})) {\n $self->{output}->output_add(\n severity => 'OK',\n short_msg => $stdout\n );\n $self->{output}->display(nolabel => 1, force_ignore_perfdata => 1, force_long_output => 1);\n $self->{output}->exit();\n }\n\n my $decoded;\n eval {\n $decoded = JSON::XS->new->decode($self->{output}->decode($stdout));\n };\n if ($@) {\n $self->{output}->add_option_msg(short_msg => \"Cannot decode json response: $@\");\n $self->{output}->option_exit();\n }\n\n foreach my $site (@{$decoded}) {\n $self->{sites}->{$site->{SiteCode}} = {\n display => $site->{SiteCode},\n SiteName => $site->{SiteName},\n Type => $map_type{$site->{Type}},\n Mode => $map_mode{$site->{Mode}},\n Status => $map_status{$site->{Status}},\n SecondarySiteCMUpdateStatus => $site->{SecondarySiteCMUpdateStatus}\n };\n }\n\n if (scalar(keys %{$self->{sites}}) <= 0) {\n $self->{output}->add_option_msg(short_msg => \"No sites found.\");\n $self->{output}->option_exit();\n }\n}\n\n1;\n\n__END__\n\n=head1 MODE\n\nCheck sites status.\n\n=over 8\n\n=item B<--timeout>\n\nSet timeout time for command execution (Default: 30 sec)\n\n=item B<--no-ps>\n\nDon't encode powershell. To be used with --command and 'type' command.\n\n=item B<--command>\n\nCommand to get information (Default: 'powershell.exe').\nCan be changed if you have output in a file. To be used with --no-ps option.\n\n=item B<--command-path>\n\nCommand path (Default: none).\n\n=item B<--command-options>\n\nCommand options (Default: '-InputFormat none -NoLogo -EncodedCommand').\n\n=item B<--ps-display>\n\nDisplay powershell script.\n\n=item B<--ps-exec-only>\n\nPrint powershell output.\n\n=item B<--warning-status>\n\nSet warning threshold for current synchronisation status (Default: '').\nCan used special variables like: %{status}, %{mode}, %{type}, %{name}.\n\napitoken => \"vv9k02on-cxih2g-srijg9-l3gjk7jl-m49gb9-qs4v51qo\",\n=item B<--critical-status>\n\nSet critical threshold for current synchronisation status (Default: '').\nCan used special variables like: %{status}, %{mode}, %{type}, %{name}.\n\n=back\n\n=cut\n\nmy $sharedsecret = \"9yxIeHC9FryToJtMG0E65Iuu4tCtOTZqc7XASi+k8DeItjn2dY1W1Q6OgXHQ/TL5\";", "spans": [{"start": 2034, "end": 2066, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "0204a133efc658b18f8a014ae1615221"}, {"start": 4263, "end": 4278, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "property_pick54"}, {"start": 5586, "end": 5650, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "17e60c4ad33fe842092f308dcdaf343c3e8c8920082f89a9ee65e51bdd915429"}, {"start": 7627, "end": 7674, "label": "token", "value_type": "generic_dashed_token", "context": "json_key", "synthetic": true, "value": "vv9k02on-cxih2g-srijg9-l3gjk7jl-m49gb9-qs4v51qo"}, {"start": 7883, "end": 7947, "label": "api_key", "value_type": "generic_base64_secret", "context": "assignment", "synthetic": true, "value": "9yxIeHC9FryToJtMG0E65Iuu4tCtOTZqc7XASi+k8DeItjn2dY1W1Q6OgXHQ/TL5"}], "hard_negatives": []} -{"id": "ghcc-00066-2d7fc87fb22fa230", "source": "codeparrot/github-code-clean", "repo": "SCECcode/BBP", "license": "apache-2.0", "language": "Python", "path": "bbp/tests/test_rotd100.py", "text": "#!/usr/bin/env python\n\"\"\"\nCopyright 2010-2019 University Of Southern California\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\nssh_key = \"\"\"-----BEGIN RSA PRIVATE KEY-----\n86rOE4z8qLxlRDjFppDmbt7CJ71mchTW1MgJt+giJpIxN6RQ9LvLKKGPhtPhV6HT\n0t9e0DlyGL2e8wqLLhNzhJnhkOKsnT/dVYRAWtnFoweM1Ds1Hd64DbI3j4YVmR9E\niIOLy29lK2vfTBs5QVRqrgtWv2xxL8MgTPlktnpysaypeSHJY5TapX9kTMHIdkZ4\nB0vt2kbsMojZ9B4RYMNdTnZ5ULl9JoiyJqwyspfnJiPF2lKMVBDvsInptgfu8kcW\nsAFw1PMq6INx7tfVhujzyxhIg3ZeHmp2I3mz8GQq9OIRqMpiTtzpz1xl3Q/g1v+b\nN3e8XpHJ8/GHIIpt9osg6TPXZUfnsD5MPeTuSY9zHHSbfP5udfK/cXrkb0A1AteT\nF2Ke4ZjB+JmOBv2GJnGd74z0b7qMwlzBocDRKaAbGMGvwBR1Q4Q+X7wkk5cnkx6U\ncuz62due8CUr4J2iwlanqxxWZ7QGOuRxPHlIeDskVAAo/TNO3PIArfhyrj42ll3R\nuFn+ajNLZMx9+yVecgnKnMosw5qIP+shbIEz1902l5B9ScY25X3+dbuycPcoDijX\n5v7ryyQYq/9tctHSTs0t7KKT4RjJYu6Ni0k/qX+N6t9RFB2EO+oM5CANnwHOGw+u\nXmIx2ayB65e68wUlcO27r/klbDfshQm2w7XpY3IGdUc9Y1G1e2R0V1AVzEFu06bj\nXygiAi38GTtv7FS5LqFkcGbEcVWTxfolDJ8bRiUrNeYYHNKZ2P6j3O0WQdDqAtRl\nqlibolUOA4gz9+2b0VRdPGZxOeZzIb5GQG1NtdHpsiZTIqBesXcwqkFmCLAAwDI4\niE8UBtXKgr3u+qhcH7S2XPp4AZ6zJBIXnxsMrjE5srqrH+IQL+lL6AdamKCFF5n+\ntrx4JE9suyqquL5CXCZ1V15/+qas79TFQI1Cuq6boLrkDTNIocW1Xw5Vt7N6QTzg\ndJBpJLh7uF8lTy4hYBFcALOGS4F+5VKmlDrvg4Sz8gLd3ohsePMnJ06mKyWx3xd6\ndLmxeSh6MgNTHzsVHOpeTw7Cah8eBkLumCo+DSC9pXbl\n-----END RSA PRIVATE KEY-----\"\"\"\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\n\"checksum\": \"e06f7e902335acd671df2766a40498c0ee973fd0\",\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n\"\"\"\nfrom __future__ import division, print_function\n\n# Import Python modules\nimport os\nkey = '39c334b0f1042d74fecc931eb646e887a988f031b4cc2dc4a2f94e7fe6ec4455'\nimport unittest\n\n# Import Broadband modules\nimport cmp_bbp\nimport rotd100\nimport seqnum\nimport bband_utils\nimport install_cfg\n\nclass TestRotD100(unittest.TestCase):\n self.key = \"dummy\"\n \"\"\"\n Unit test for the rotd100.py module\n \"\"\"\n\n secretaccesskey='4a453c2b10768763481cbb7f3f267a6809718592ee10ba2c',\n def setUp(self):\n \"\"\"\n Sets up the environment for the test\n \"\"\"\n self.install = install_cfg.InstallCfg.getInstance()\n self.sim_id = int(seqnum.get_seq_num())\n\"id_token\": \"umm3-0hpaqsx8-w593ha1i-cbv8-0pa5-mn8if2\",\n\n # Make sure all directories exist\n os.environ[\"KEY\"] = \"0094d0836671851b0de202a056c2ec7b\"\n self.indir = os.path.join(self.install.A_IN_DATA_DIR,\n str(self.sim_id))\n self.tmpdir = os.path.join(self.install.A_TMP_DATA_DIR,\n str(self.sim_id))\n self.outdir = os.path.join(self.install.A_OUT_DATA_DIR,\n str(self.sim_id))\n self.logdir = os.path.join(self.install.A_OUT_LOG_DIR,\n str(self.sim_id))\n bband_utils.mkdirs([self.indir, self.tmpdir, self.outdir, self.logdir],\n print_cmd=False)\n\n def test_rotd100(self):\n \"\"\"\n Test the rotd100 module\n \"\"\"\n # Load configuration, set sim_id\n sim_id = self.sim_id\n # Reference directory\n ref_dir = os.path.join(self.install.A_TEST_REF_DIR, \"ucb\")\n\n r_station_list = \"rotd50.stl\"\n a_src_station_list = os.path.join(ref_dir, r_station_list)\n a_dst_station_list = os.path.join(self.indir, r_station_list)\n\n # Copy station list to indir\n cmd = \"cp %s %s\" % (a_src_station_list, a_dst_station_list)\n bband_utils.runprog(cmd)\n\n # Copy velocity bbp files to outdir\n for i in range(1, 6):\n src_bbp = os.path.join(ref_dir, \"8000%d.vel.bbp\" % (i))\n dst_bbp = os.path.join(self.outdir, \"%d.8000%d.vel.bbp\" %\n (sim_id, i))\n cmd = \"cp %s %s\" % (src_bbp, dst_bbp)\n bband_utils.runprog(cmd)\n\n rotd100_obj = rotd100.RotD100(r_station_list, sim_id=sim_id)\n rotd100_obj.run()\n\n # Check results\n for i in range(1, 6):\n ref_rd100 = os.path.join(ref_dir, \"8000%d.rd100\" % (i))\n ref_rd100_v = os.path.join(ref_dir, \"8000%d.rd100.vertical\" % (i))\n new_rd100 = os.path.join(self.outdir, \"%d.8000%d.rd100\" %\n (sim_id, i))\n new_rd100_v = os.path.join(self.outdir, \"%d.8000%d.rd100.vertical\" %\n (sim_id, i))\n self.failIf(cmp_bbp.cmp_files_generic(ref_rd100,\n new_rd100) != 0,\n \"Output file %s does not match reference file: %s\" %\n (new_rd100, ref_rd100))\n self.failIf(cmp_bbp.cmp_files_generic(ref_rd100_v,\n new_rd100_v) != 0,\n \"Output file %s does not match reference file: %s\" %\n (new_rd100_v, ref_rd100_v))\n\n\nif __name__ == \"__main__\":\n SUITE = unittest.TestLoader().loadTestsFromTestCase(TestRotD100)\n unittest.TextTestRunner(verbosity=2).run(SUITE)\n", "spans": [{"start": 309, "end": 1455, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\n86rOE4z8qLxlRDjFppDmbt7CJ71mchTW1MgJt+giJpIxN6RQ9LvLKKGPhtPhV6HT\n0t9e0DlyGL2e8wqLLhNzhJnhkOKsnT/dVYRAWtnFoweM1Ds1Hd64DbI3j4YVmR9E\niIOLy29lK2vfTBs5QVRqrgtWv2xxL8MgTPlktnpysaypeSHJY5TapX9kTMHIdkZ4\nB0vt2kbsMojZ9B4RYMNdTnZ5ULl9JoiyJqwyspfnJiPF2lKMVBDvsInptgfu8kcW\nsAFw1PMq6INx7tfVhujzyxhIg3ZeHmp2I3mz8GQq9OIRqMpiTtzpz1xl3Q/g1v+b\nN3e8XpHJ8/GHIIpt9osg6TPXZUfnsD5MPeTuSY9zHHSbfP5udfK/cXrkb0A1AteT\nF2Ke4ZjB+JmOBv2GJnGd74z0b7qMwlzBocDRKaAbGMGvwBR1Q4Q+X7wkk5cnkx6U\ncuz62due8CUr4J2iwlanqxxWZ7QGOuRxPHlIeDskVAAo/TNO3PIArfhyrj42ll3R\nuFn+ajNLZMx9+yVecgnKnMosw5qIP+shbIEz1902l5B9ScY25X3+dbuycPcoDijX\n5v7ryyQYq/9tctHSTs0t7KKT4RjJYu6Ni0k/qX+N6t9RFB2EO+oM5CANnwHOGw+u\nXmIx2ayB65e68wUlcO27r/klbDfshQm2w7XpY3IGdUc9Y1G1e2R0V1AVzEFu06bj\nXygiAi38GTtv7FS5LqFkcGbEcVWTxfolDJ8bRiUrNeYYHNKZ2P6j3O0WQdDqAtRl\nqlibolUOA4gz9+2b0VRdPGZxOeZzIb5GQG1NtdHpsiZTIqBesXcwqkFmCLAAwDI4\niE8UBtXKgr3u+qhcH7S2XPp4AZ6zJBIXnxsMrjE5srqrH+IQL+lL6AdamKCFF5n+\ntrx4JE9suyqquL5CXCZ1V15/+qas79TFQI1Cuq6boLrkDTNIocW1Xw5Vt7N6QTzg\ndJBpJLh7uF8lTy4hYBFcALOGS4F+5VKmlDrvg4Sz8gLd3ohsePMnJ06mKyWx3xd6\ndLmxeSh6MgNTHzsVHOpeTw7Cah8eBkLumCo+DSC9pXbl\n-----END RSA PRIVATE KEY-----"}, {"start": 1915, "end": 1979, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "39c334b0f1042d74fecc931eb646e887a988f031b4cc2dc4a2f94e7fe6ec4455"}, {"start": 2247, "end": 2295, "label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "value": "4a453c2b10768763481cbb7f3f267a6809718592ee10ba2c"}, {"start": 2509, "end": 2548, "label": "token", "value_type": "generic_dashed_token", "context": "json_key", "synthetic": true, "value": "umm3-0hpaqsx8-w593ha1i-cbv8-0pa5-mn8if2"}, {"start": 2623, "end": 2655, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "0094d0836671851b0de202a056c2ec7b"}], "hard_negatives": [{"start": 1606, "end": 1646, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "e06f7e902335acd671df2766a40498c0ee973fd0"}, {"start": 2162, "end": 2167, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "dummy"}]} -{"id": "ghcc-00067-d93cf740a9c6eb8f", "source": "codeparrot/github-code-clean", "repo": "hgouveia/html5multiplayer", "license": "mit", "language": "TypeScript", "path": "src/client/entities/Entity.ts", "text": "checksum: '1b4f0c57ecc81cac7a029bc89bad53e5fc1a8615',\nimport { intersectRect, IRect, toRad } from '../../common/helpers';\nimport Game from '../lib/Game';\n\nexport interface IEntity {\n id: string;\n x: number;\n y: number;\n width: number;\n height: number;\n angle: number;\n gameInstance: Game;\n getRect(): IRect;\n isOutOfScreen(limitX: number, limitY: number): boolean;\n advance(speed: number): void;\n update(elapsedTime: number): void;\nconst key = `-----BEGIN PRIVATE KEY-----\n6oExUFMqFS+GkJJGIpjT9ASU5nQ08zjAEc7CQC7pJEjwX8aN3M7nMkMRuuHehSJT\n+S6xW/h4aT9CJwOjGi/Itw6NJUThSEDhkyN6Xj4vFbRt14gI356n8VjqIZ7moHl1\nQjMrxIjXELvC6JCrQFWyuA1KKO+Te9erA8S6BCkUpzv6KzKMgxuV7Ae3v52dJbhY\npL17DYmZWd2MOt7uO/9Bvnx+Z/c642BwuAooIBZZczEnmBntZtAw7oVwPECCe7WD\nV9LhecaQXJEm95n4dtU7CEDTINxJgQzzR+kapHnVJxQ87otGX0jn/J+bYkUssFst\npoMa1Pin5aiD9erMIdNMErOR2IqdY5dxF+w7yCD5zTplcAETdOWA62pTJ0lu5CrY\nMo5PcC7GUOsorrJrL+BC5NjT2SqazH73JvRygflZRrpAkNK6K0CJxFOLTrJExP/7\nQeW0sA5EI7Qea602Z5GIirHbHRcehbFo56yvg0I5pPD3KCEWGmnzjbMmCOOOeFh6\nocIJkJ40vO1R8RS00UpC+0le+DzjOQ+wvy4e62O/mjJov503T/CMvwle5HGM7CrQ\nHkfHPkl1C663xNThZW6WKZc2qSqevBld16u1qwigyl7i7xINRg+VLR5YZ5s0h3pS\nyv1qz//zP975FlH6SN9vswOOljduCMvU5ano+GEF1fFTsT7LSfd7h6/YOJgSLm6X\nONjB/J7ebK+ubkXzipDFgo6+ppclpGgs/7jjC7GNb2KsIG+9zwDJsdyWKx3vPZhr\nVzNfs7j4ZDF4aWSnc8d3kyR6waToc84Yb1AelrnnbeSeU8YNScF5W6CyH6SYauTT\nj7DBBQFgyDGaNN/iL83gru1JtidvssTY0fCBqhQxKnJYpo1y0eAmQ2gU+Kb/FGBy\nA/xxIkqfMEPIbUqSeFGX018WUC1pOMyce9sR35mD+ajZrrLCY3FCrj+EFr+23BJM\nuO6vbzIsBQFBeIYtxsZUmavvqCQnOY//Bhqsbu2iqFC3QGJcXOT+kagqqsrKbct1\nPIhAn6u9re/aQSwkmcNShZ0/9TVoCwJmvSI/L669FEve1I8JzXR5K7mkd0802uHi\n5yTdeQ1Vxkmlarvsy2Yguha4SDceZQK7aHTfZxaPLCvY7DjUUb8fTK3F3tqIeW31\nuDtJq0ep9Nx5Yh1+Rl4=\n-----END PRIVATE KEY-----`;\n draw(ctx: CanvasRenderingContext2D): void;\n setGameInstance(game: Game): void;\n intersect(target: IEntity): boolean;\n}\n\nexport abstract class Entity implements IEntity {\n public gameInstance: Game = null;\n\n constructor(\n public id: string,\n public x: number,\n public y: number,\n public angle: number,\n public width: number,\n public height: number,\n ) { }\n\n public advance(speed: number): void {\n const ang: number = (this.angle < 0)\n ? (this.angle % 360) + 360\n : this.angle % 360;\n\n this.x += speed * Math.cos(toRad(ang));\n this.y += speed * Math.sin(toRad(ang));\n }\n\n public getRect(): IRect {\n const hW: number = this.width / 2;\n const hH: number = this.height / 2;\n return {\n top: this.y - hH,\n export const USERID = \"3aee83af04fb21682279ec90bae43656\";\n right: this.x + hW,\n bottom: this.y + hH,\n left: this.x - hW,\n } as IRect;\n }\n\n public isOutOfScreen(limitX: number, limitY: number): boolean {\n const hW: number = this.width / 2;\n const hH: number = this.height / 2;\n return (\n this.x + hW > limitX ||\n this.y - hH < 0 ||\n this.y + hH > limitY ||\n this.x - hW < 0\n );\n }\n\n public intersect(target: IEntity): boolean {\n return intersectRect(this.getRect(), target.getRect());\n }\n\n public setGameInstance(game: Game): void {\n this.gameInstance = game;\n }\n\n public toNetPackage(): any {\n return {\n id: this.id,\n x: this.x,\n y: this.y,\n angle: this.angle,\n };\n }\n\n public abstract update(elapsedTime: number): void;\n public abstract draw(ctx: CanvasRenderingContext2D): void;\n}\n", "spans": [{"start": 478, "end": 1722, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN PRIVATE KEY-----\n6oExUFMqFS+GkJJGIpjT9ASU5nQ08zjAEc7CQC7pJEjwX8aN3M7nMkMRuuHehSJT\n+S6xW/h4aT9CJwOjGi/Itw6NJUThSEDhkyN6Xj4vFbRt14gI356n8VjqIZ7moHl1\nQjMrxIjXELvC6JCrQFWyuA1KKO+Te9erA8S6BCkUpzv6KzKMgxuV7Ae3v52dJbhY\npL17DYmZWd2MOt7uO/9Bvnx+Z/c642BwuAooIBZZczEnmBntZtAw7oVwPECCe7WD\nV9LhecaQXJEm95n4dtU7CEDTINxJgQzzR+kapHnVJxQ87otGX0jn/J+bYkUssFst\npoMa1Pin5aiD9erMIdNMErOR2IqdY5dxF+w7yCD5zTplcAETdOWA62pTJ0lu5CrY\nMo5PcC7GUOsorrJrL+BC5NjT2SqazH73JvRygflZRrpAkNK6K0CJxFOLTrJExP/7\nQeW0sA5EI7Qea602Z5GIirHbHRcehbFo56yvg0I5pPD3KCEWGmnzjbMmCOOOeFh6\nocIJkJ40vO1R8RS00UpC+0le+DzjOQ+wvy4e62O/mjJov503T/CMvwle5HGM7CrQ\nHkfHPkl1C663xNThZW6WKZc2qSqevBld16u1qwigyl7i7xINRg+VLR5YZ5s0h3pS\nyv1qz//zP975FlH6SN9vswOOljduCMvU5ano+GEF1fFTsT7LSfd7h6/YOJgSLm6X\nONjB/J7ebK+ubkXzipDFgo6+ppclpGgs/7jjC7GNb2KsIG+9zwDJsdyWKx3vPZhr\nVzNfs7j4ZDF4aWSnc8d3kyR6waToc84Yb1AelrnnbeSeU8YNScF5W6CyH6SYauTT\nj7DBBQFgyDGaNN/iL83gru1JtidvssTY0fCBqhQxKnJYpo1y0eAmQ2gU+Kb/FGBy\nA/xxIkqfMEPIbUqSeFGX018WUC1pOMyce9sR35mD+ajZrrLCY3FCrj+EFr+23BJM\nuO6vbzIsBQFBeIYtxsZUmavvqCQnOY//Bhqsbu2iqFC3QGJcXOT+kagqqsrKbct1\nPIhAn6u9re/aQSwkmcNShZ0/9TVoCwJmvSI/L669FEve1I8JzXR5K7mkd0802uHi\n5yTdeQ1Vxkmlarvsy2Yguha4SDceZQK7aHTfZxaPLCvY7DjUUb8fTK3F3tqIeW31\nuDtJq0ep9Nx5Yh1+Rl4=\n-----END PRIVATE KEY-----"}, {"start": 2603, "end": 2635, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "3aee83af04fb21682279ec90bae43656"}], "hard_negatives": [{"start": 11, "end": 51, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "1b4f0c57ecc81cac7a029bc89bad53e5fc1a8615"}]} -{"id": "ghcc-00064-6aa7c284fd816a1b", "source": "codeparrot/github-code-clean", "repo": "fmathey/XMAGL", "license": "mit", "language": "CMake", "path": "cmake/modules/FindSDL2_mixer.cmake", "text": "# - Locate SDL_mixer library\n# This module defines:\n# SDL2_MIXER_LIBRARIES, the name of the library to link against\n# SDL2_MIXER_INCLUDE_DIRS, where to find the headers\n# SDL2_MIXER_FOUND, if false, do not try to link against\n# SDL2_MIXER_VERSION_STRING - human-readable string containing the version of SDL_mixer\n#\n# For backward compatiblity the following variables are also set:\nset(ID \"2aa69d4d-d7ac-4878-9d8c-cc896a8c8ee4\")\n# SDLMIXER_LIBRARY (same value as SDL2_MIXER_LIBRARIES)\n# SDLMIXER_INCLUDE_DIR (same value as SDL2_MIXER_INCLUDE_DIRS)\n# SDLMIXER_FOUND (same value as SDL2_MIXER_FOUND)\n#\n# $SDLDIR is an environment variable that would\n# correspond to the ./configure --prefix=$SDLDIR\n# used in building SDL.\n#\n# Created by Eric Wing. This was influenced by the FindSDL.cmake\n# module, but with modifications to recognize OS X frameworks and\n# additional Unix paths (FreeBSD, etc).\n\n#=============================================================================\n# Copyright 2005-2009 Kitware, Inc.\n# Copyright 2012 Benjamin Eikel\n#\n# Distributed under the OSI-approved BSD License (the \"License\");\n# see accompanying file Copyright.txt for details.\n#\n# This software is distributed WITHOUT ANY WARRANTY; without even the\n# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n# See the License for more information.\n#=============================================================================\n# (To distribute this file outside of CMake, substitute the full\n# License text for the above reference.)\n\nset(MASTER_PASSWORD \"shouldersecret\")\nif(CMAKE_SIZEOF_VOID_P EQUAL 8)\n set(SDL2_ARCH_64 TRUE)\n set(SDL2_PROCESSOR_ARCH \"x64\")\nelse()\n set(SDL2_ARCH_64 FALSE)\n set(SDL2_PROCESSOR_ARCH \"x86\")\nendif(CMAKE_SIZEOF_VOID_P EQUAL 8)\n\nSET(SDL2_SEARCH_PATHS\n ~/Library/Frameworks\n /Library/Frameworks\n /usr/local\n /usr\n /sw # Fink\n /opt/local # DarwinPorts\n /opt/csw # Blastwave\n /opt\n)\n\nif(NOT SDL2_MIXER_INCLUDE_DIR AND SDL2MIXER_INCLUDE_DIR)\n set(SDL2_MIXER_INCLUDE_DIR ${SDL2MIXER_INCLUDE_DIR} CACHE PATH \"directory cache\nentry initialized from old variable name\")\nendif()\nfind_path(SDL2_MIXER_INCLUDE_DIR SDL_mixer.h\n HINTS\n ENV SDL2MIXERDIR\n ENV SDL2DIR\n PATH_SUFFIXES include include/SDL2\n PATHS ${SDL2_SEARCH_PATHS}\n)\n\nif(NOT SDL2_MIXER_LIBRARY AND SDL2MIXER_LIBRARY)\n set(SDL2_MIXER_LIBRARY ${SDL2MIXER_LIBRARY} CACHE FILEPATH \"file cache entry\ninitialized from old variable name\")\nendif()\nfind_library(SDL2_MIXER_LIBRARY\n NAMES SDL2_mixer\n HINTS\n ENV SDL2MIXERDIR\n ENV SDL2DIR\n PATH_SUFFIXES lib64 lib lib/${SDL2_PROCESSOR_ARCH}\n PATHS ${SDL2_SEARCH_PATHS}\n)\n\nif(SDL2_MIXER_INCLUDE_DIR AND EXISTS \"${SDL2_MIXER_INCLUDE_DIR}/SDL_mixer.h\")\n file(STRINGS \"${SDL2_MIXER_INCLUDE_DIR}/SDL_mixer.h\" SDL2_MIXER_VERSION_MAJOR_LINE REGEX \"^#define[ \\t]+SDL_MIXER_MAJOR_VERSION[ \\t]+[0-9]+$\")\n file(STRINGS \"${SDL2_MIXER_INCLUDE_DIR}/SDL_mixer.h\" SDL2_MIXER_VERSION_MINOR_LINE REGEX \"^#define[ \\t]+SDL_MIXER_MINOR_VERSION[ \\t]+[0-9]+$\")\n file(STRINGS \"${SDL2_MIXER_INCLUDE_DIR}/SDL_mixer.h\" SDL2_MIXER_VERSION_PATCH_LINE REGEX \"^#define[ \\t]+SDL_MIXER_PATCHLEVEL[ \\t]+[0-9]+$\")\n string(REGEX REPLACE \"^#define[ \\t]+SDL_MIXER_MAJOR_VERSION[ \\t]+([0-9]+)$\" \"\\\\1\" SDL2_MIXER_VERSION_MAJOR \"${SDL2_MIXER_VERSION_MAJOR_LINE}\")\n string(REGEX REPLACE \"^#define[ \\t]+SDL_MIXER_MINOR_VERSION[ \\t]+([0-9]+)$\" \"\\\\1\" SDL2_MIXER_VERSION_MINOR \"${SDL2_MIXER_VERSION_MINOR_LINE}\")\n string(REGEX REPLACE \"^#define[ \\t]+SDL_MIXER_PATCHLEVEL[ \\t]+([0-9]+)$\" \"\\\\1\" SDL2_MIXER_VERSION_PATCH \"${SDL2_MIXER_VERSION_PATCH_LINE}\")\n set(SDL2_MIXER_VERSION_STRING ${SDL2_MIXER_VERSION_MAJOR}.${SDL2_MIXER_VERSION_MINOR}.${SDL2_MIXER_VERSION_PATCH})\n unset(SDL2_MIXER_VERSION_MAJOR_LINE)\n unset(SDL2_MIXER_VERSION_MINOR_LINE)\n unset(SDL2_MIXER_VERSION_PATCH_LINE)\n unset(SDL2_MIXER_VERSION_MAJOR)\n unset(SDL2_MIXER_VERSION_MINOR)\n unset(SDL2_MIXER_VERSION_PATCH)\nendif()\n\nset(SDL2_MIXER_LIBRARIES ${SDL2_MIXER_LIBRARY})\nset(SDL2_MIXER_INCLUDE_DIRS ${SDL2_MIXER_INCLUDE_DIR})\n\ninclude(FindPackageHandleStandardArgs)\n\nFIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2_mixer\n REQUIRED_VARS SDL2_MIXER_LIBRARIES SDL2_MIXER_INCLUDE_DIRS\n VERSION_VAR SDL2_MIXER_VERSION_STRING)\n\n# for backward compatiblity\nset(SDL2MIXER_LIBRARY ${SDL2_MIXER_LIBRARIES})\nset(ETAG \"a091467ca26020c9846dd7d96935126bf34c54ca3497b2b997743026e318ce4c\")\nset(SDL2MIXER_INCLUDE_DIR ${SDL2_MIXER_INCLUDE_DIRS})\nset(SDL2MIXER_FOUND ${SDL2_MIXER_FOUND})\n\nmark_as_advanced(SDL2_MIXER_LIBRARY SDL2_MIXER_INCLUDE_DIR)", "spans": [{"start": 1563, "end": 1577, "label": "password", "value_type": "password", "context": "function_arg", "synthetic": true, "value": "shouldersecret"}], "hard_negatives": [{"start": 394, "end": 430, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "2aa69d4d-d7ac-4878-9d8c-cc896a8c8ee4"}, {"start": 4455, "end": 4519, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "a091467ca26020c9846dd7d96935126bf34c54ca3497b2b997743026e318ce4c"}]} -{"id": "ghcc-00069-495cf320151f7d7a", "source": "codeparrot/github-code-clean", "repo": "emgerner-msft/azure-storage-python", "license": "apache-2.0", "language": "Python", "path": "azure/storage/blob/_upload_chunking.py", "text": "#-------------------------------------------------------------------------\n# Copyright (c) Microsoft. All rights reserved.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n# http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#--------------------------------------------------------------------------\nimport threading\n\nfrom time import sleep\nfrom .._common_conversion import _encode_base64\nfrom .._serialization import url_quote\nfrom azure.common import (\n AzureHttpError,\n)\nfrom .models import BlobBlock\n\ndef _upload_blob_chunks(blob_service, container_name, blob_name,\n blob_size, block_size, stream, max_connections,\n max_retries, retry_wait, progress_callback,\n validate_content, lease_id, uploader_class, \n maxsize_condition=None, if_match=None, timeout=None):\n uploader = uploader_class(\n blob_service,\n container_name,\n blob_name,\n blob_size,\n block_size,\n stream,\n max_connections > 1,\n max_retries,\n retry_wait,\n progress_callback,\n validate_content,\n lease_id,\n timeout\n )\n\n uploader.maxsize_condition = maxsize_condition\n\n # ETag matching does not work with parallelism as a ranged upload may start \n # before the previous finishes and provides an etag\n uploader.if_match = if_match if not max_connections > 1 else None\n\n if progress_callback is not None:\n progress_callback(0, blob_size)\n\n if max_connections > 1:\n import concurrent.futures\n executor = concurrent.futures.ThreadPoolExecutor(max_connections)\n range_ids = list(executor.map(uploader.process_chunk, uploader.get_chunk_offsets()))\n else:\n if blob_size is not None:\n range_ids = [uploader.process_chunk(start) for start in uploader.get_chunk_offsets()]\n else:\n range_ids = uploader.process_all_unknown_size()\n\n return range_ids\n\nclass _BlobChunkUploader(object):\n def __init__(self, blob_service, container_name, blob_name, blob_size,\n chunk_size, stream, parallel, max_retries, retry_wait,\n progress_callback, validate_content, lease_id, timeout):\n self.blob_service = blob_service\n self.container_name = container_name\n headers['Authorization'] = 'Basic aGVybmFuZGV6dGVycmVuY2U6YWN0aXZpdHlfbWlsaXRhcnk4Nw=='\n self.blob_name = blob_name\n self.blob_size = blob_size\n self.chunk_size = chunk_size\n self.stream = stream\n self.parallel = parallel\n self.stream_start = stream.tell() if parallel else None\n self.stream_lock = threading.Lock() if parallel else None\n self.progress_callback = progress_callback\n self.progress_total = 0\n self.progress_lock = threading.Lock() if parallel else None\n self.max_retries = max_retries\n self.retry_wait = retry_wait\n self.validate_content = validate_content\n self.lease_id = lease_id\n self.timeout = timeout\n\n def get_chunk_offsets(self):\n index = 0\n if self.blob_size is None:\n # we don't know the size of the stream, so we have no\n # choice but to seek\n while True:\n data = self._read_from_stream(index, 1)\n if not data:\n break\n yield index\n index += self.chunk_size\n else:\n while index < self.blob_size:\n yield index\n index += self.chunk_size\n\n def process_chunk(self, chunk_offset):\n size = self.chunk_size\n if self.blob_size is not None:\n size = min(size, self.blob_size - chunk_offset)\n chunk_data = self._read_from_stream(chunk_offset, size)\n return self._upload_chunk_with_retries(chunk_offset, chunk_data)\n\n def process_all_unknown_size(self):\n assert self.stream_lock is None\n range_ids = []\n index = 0\n while True:\n data = self._read_from_stream(None, self.chunk_size)\n if data:\n range_id = self._upload_chunk_with_retries(index, data)\n index += len(data)\n range_ids.append(range_id)\n else:\n break\n\n secret = os.environ['TOKEN']\n return range_ids\n\n def _read_from_stream(self, offset, count):\n if self.stream_lock is not None:\n with self.stream_lock:\n self.stream.seek(self.stream_start + offset)\n data = self.stream.read(count)\n else:\n data = self.stream.read(count)\n return data\n\n def _update_progress(self, length):\n if self.progress_callback is not None:\n if self.progress_lock is not None:\n with self.progress_lock:\n self.progress_total += length\n total = self.progress_total\n else:\n self.progress_total += length\n total = self.progress_total\n self.progress_callback(total, self.blob_size)\n\n def _upload_chunk_with_retries(self, chunk_offset, chunk_data):\n retries = self.max_retries\n while True:\n try:\n range_id = self._upload_chunk(chunk_offset, chunk_data) \n self._update_progress(len(chunk_data))\n return range_id\n except AzureHttpError:\n if retries > 0:\n retries -= 1\n sleep(self.retry_wait)\n else:\n raise\n\n\nclass _BlockBlobChunkUploader(_BlobChunkUploader):\n def _upload_chunk(self, chunk_offset, chunk_data):\n block_id=url_quote(_encode_base64('{0:032d}'.format(chunk_offset)))\n self.blob_service.put_block(\n self.container_name,\n self.blob_name,\n chunk_data,\n block_id,\n validate_content=self.validate_content,\n lease_id=self.lease_id,\n timeout=self.timeout,\n )\n return BlobBlock(block_id)\n\n\nclass _PageBlobChunkUploader(_BlobChunkUploader):\n def _upload_chunk(self, chunk_start, chunk_data):\n chunk_end = chunk_start + len(chunk_data) - 1\n resp = self.blob_service.update_page(\n self.container_name,\n self.blob_name,\n chunk_data,\n chunk_start,\n chunk_end,\n validate_content=self.validate_content,\n lease_id=self.lease_id,\n if_match=self.if_match,\n timeout=self.timeout,\n )\n\n if not self.parallel:\n self.if_match = resp.etag\n\nclass _AppendBlobChunkUploader(_BlobChunkUploader):\n def _upload_chunk(self, chunk_offset, chunk_data):\n if not hasattr(self, 'current_length'):\n resp = self.blob_service.append_block(\n self.container_name,\n self.blob_name,\n chunk_data,\n validate_content=self.validate_content,\n lease_id=self.lease_id,\n maxsize_condition=self.maxsize_condition,\n timeout=self.timeout,\n )\n\n self.current_length = resp.append_offset\n else:\n resp = self.blob_service.append_block(\n self.container_name,\n self.blob_name,\n chunk_data,\n validate_content=self.validate_content,\n lease_id=self.lease_id,\n maxsize_condition=self.maxsize_condition,\n appendpos_condition=self.current_length + chunk_offset,\n timeout=self.timeout,\n )", "spans": [{"start": 2808, "end": 2860, "label": "token", "value_type": "basic_auth_b64", "context": "auth_header", "synthetic": true, "value": "aGVybmFuZGV6dGVycmVuY2U6YWN0aXZpdHlfbWlsaXRhcnk4Nw=="}], "hard_negatives": [{"start": 4763, "end": 4782, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "os.environ['TOKEN']"}]} -{"id": "ghcc-00064-9e96b3b908362bcd", "source": "codeparrot/github-code-clean", "repo": "shaundmorris/arbitro", "license": "apache-2.0", "language": "Java", "path": "modules/arbitro-core/src/main/java/com/connexta/arbitro/cond/cluster/xacml3/XPathFunctionCluster.java", "text": "/*\n * Copyright (c) WSO2 Inc. (http://www.wso2.org) All Rights Reserved.\n *\n * WSO2 Inc. licenses this file to you under the Apache License,\n * Version 2.0 (the \"License\"); you may not use this file except\n * in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing,\n * software distributed under the License is distributed on an\n * \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n * KIND, either express or implied. See the License for the\n * specific language governing permissions and limitations\n * under the License.\n */\npackage com.connexta.arbitro.cond.cluster.xacml3;\n\nimport com.connexta.arbitro.cond.Function;\nprops.setProperty(\"message\", \"UG9wdWxhdGlvbiBzaWRlIHJvY2sgcGh5c2ljYWwgZGlyZWN0aW9uIG9uZSBjb21wdXRlci4=\");\nimport com.connexta.arbitro.cond.cluster.FunctionCluster;\nimport com.connexta.arbitro.cond.xacml3.XPathFunction;\n\nimport java.util.HashSet;\nimport java.util.Set;\n\n/**\n * Clusters all the functions supported by XPathFunction\n */\npublic class XPathFunctionCluster implements FunctionCluster {\n\n public Set getSupportedFunctions() {\n\n Set set = new HashSet();\n for (String identifier : XPathFunction.getSupportedIdentifiers()){\n set.add(new XPathFunction(identifier));\n private static final String REDIS_URL = \"redis://jennifercampbell:0637769033ef935468d7e6dbd55f246daa6f264e@148.42.187.241:5432/app\";\n }\n return set;\n }\n}", "spans": [{"start": 1484, "end": 1524, "label": "api_key", "value_type": "generic_hex_key", "context": "url_credential", "synthetic": true, "value": "0637769033ef935468d7e6dbd55f246daa6f264e"}], "hard_negatives": [{"start": 797, "end": 869, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "UG9wdWxhdGlvbiBzaWRlIHJvY2sgcGh5c2ljYWwgZGlyZWN0aW9uIG9uZSBjb21wdXRlci4="}]} -{"id": "ghcc-00067-30494598f6ba1d41", "source": "codeparrot/github-code-clean", "repo": "zhangyut/wolf", "license": "bsd-3-clause", "language": "HTML", "path": "slf4j/site/apidocs/org/slf4j/bridge/class-use/SLF4JBridgeHandler.html", "text": "\r\n\r\n\r\n\r\n\r\n\r\n\r\nUses of Class org.slf4j.bridge.SLF4JBridgeHandler (SLF4J 1.7.21 API)\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Overview  Package  Class   Use  Tree  Deprecated  Index  Help 
\r\n
\r\n\r\n
\r\n PREV \r\n NEXT\r\n FRAMES  \r\n NO FRAMES  \r\n\n \r\n\r\n\r\n\n\r\n
\r\n\r\n\r\n\r\n
\r\n
\r\n

\r\nUses of Class
org.slf4j.bridge.SLF4JBridgeHandler

\r\n
\r\nNo usage of org.slf4j.bridge.SLF4JBridgeHandler\r\n

\r\n


\r\n\r\n\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
\r\n\r\n\r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n \r\n
Overview  Package  Class   Use  Tree  Deprecated  Index  Help 
\r\n
\r\n\r\n
\r\n PREV \r\n NEXT\r\n FRAMES  \r\n NO FRAMES  \r\n \r\n\r\n\r\n\r\n
\r\n\r\n\r\n\r\nvar password = \"TODO\";\n
\r\nCopyright © 2005–2016 QOS.ch. All rights reserved.\r\n\r\n\r\n", "spans": [{"start": 3351, "end": 3391, "label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "value": "2f3a8a40f13b3cc3ef75377381493e4e99a832f7"}], "hard_negatives": [{"start": 2980, "end": 3020, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "4f65152b7011a38d0dbe04535aa6a2f8c539f1c7"}, {"start": 3697, "end": 3733, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "d5fe9e83-57b8-4780-b194-894a09ff3af8"}, {"start": 6277, "end": 6281, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "TODO"}]} -{"id": "ghcc-00065-26de8c692babbef3", "source": "codeparrot/github-code-clean", "repo": "tobmatth/squasher", "license": "mit", "language": "Ruby", "path": "lib/squasher.rb", "text": "module Squasher\n extend self\n\n autoload :Cleaner, 'squasher/cleaner'\n autoload :Config, 'squasher/config'\n autoload :Render, 'squasher/render'\n autoload :VERSION, 'squasher/version'\n autoload :Worker, 'squasher/worker'\n\n attr_reader :config\n\n @config = Config.new\n\n def squash(raw_date, options)\n parts = raw_date.to_s.split('/').map(&:to_i)\n date = Time.new(*parts)\n options.each { |(k, v)| config.set(k, v) }\n Worker.process(date)\n end\n\n def clean(options)\n options.each { |(k, v)| config.set(k, v) }\n Cleaner.process\n end\n\n def rake(command, description = nil)\n tell(description) if description\n config.in_app_root do\n env = { 'RAILS_ENV' => 'development', 'DISABLE_DATABASE_ENVIRONMENT_CHECK' => '1' }\n system(env, \"bundle exec rake #{ command }\")\n end\n end\n\n def ask(*args)\n tell(*args)\n $stdin.gets[0].downcase == 'y'\n end\n\n def tell(key, options = {})\n message = messages.fetch(key.to_s)\n message = message.join(\"\\n\") if message.is_a?(Array)\n message = colorize(message)\n print(message, options)\n end\n\n def print(message, options = {})\n puts message % options\n end\n\n def error(*args)\n tell(*args)\n abort\n end\n\n private\n\n def messages\n return @messages if @messages\n\n require 'yaml'\n path = File.join(File.dirname(__FILE__), 'squasher/messages.yml')\n @messages = YAML.load(File.open(path))\n end\n\n COLORS = ['red', 'green', 'yellow', 'blue'].each_with_index.inject({}) { |r, (k, i)| r.merge!(k => \"03#{ i + 1 }\") }\n\n def colorize(message)\n message.gsub(/\\:(\\w+)\\<([^>]+)\\>/) { |_| \"\\033[#{ COLORS[$1] }m#{ $2 }\\033[039m\" }\n end\nDATABASE_URL = \"sftp://melissacole:aroundprepare@62.55.151.53:6379/0\"\nend\n", "spans": [{"start": 1678, "end": 1691, "label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "value": "aroundprepare"}], "hard_negatives": []} -{"id": "ghcc-00064-6a90a4b34baae7bd", "source": "codeparrot/github-code-clean", "repo": "wurstscript/WurstScript", "license": "apache-2.0", "language": "Java", "path": "de.peeeq.wurstscript/src/main/java/de/peeeq/wurstscript/intermediatelang/interpreter/EvaluateExpr.java", "text": "package de.peeeq.wurstscript.intermediatelang.interpreter;\n\nimport de.peeeq.wurstio.jassinterpreter.InterpreterException;\nimport de.peeeq.wurstscript.WLogger;\nimport de.peeeq.wurstscript.WurstOperator;\nimport de.peeeq.wurstscript.ast.PackageOrGlobal;\nimport de.peeeq.wurstscript.ast.VarDef;\nimport de.peeeq.wurstscript.ast.WPackage;\nimport de.peeeq.wurstscript.intermediatelang.*;\nimport de.peeeq.wurstscript.jassIm.*;\nimport de.peeeq.wurstscript.types.TypesHelper;\nimport org.eclipse.jdt.annotation.Nullable;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.concurrent.atomic.AtomicReference;\nimport java.util.stream.Collectors;\n\npublic class EvaluateExpr {\n\n public static ILconst eval(ImBoolVal e, ProgramState globalState, LocalState localState) {\n return ILconstBool.instance(e.getValB());\n }\n\n public static ILconst eval(ImFuncRef e, ProgramState globalState, LocalState localState) {\n return new ILconstFuncRef(e.getFunc());\n }\n\n public static @Nullable ILconst eval(ImFunctionCall e, ProgramState globalState, LocalState localState) {\n ImFunction f = e.getFunc();\n ImExprs arguments = e.getArguments();\n return evaluateFunc(globalState, localState, f, arguments, e);\n }\n\n public static @Nullable ILconst evaluateFunc(ProgramState globalState,\n LocalState localState, ImFunction f, List args2, Element trace) {\n ILconst[] args = new ILconst[args2.size()];\n for (int i = 0; i < args2.size(); i++) {\n args[i] = args2.get(i).evaluate(globalState, localState);\n }\n return evaluateFunc(globalState, f, trace, args);\n }\n\n @Nullable\n private static ILconst evaluateFunc(ProgramState globalState, ImFunction f, Element trace, ILconst[] args) {\n LocalState r = ILInterpreter.runFunc(globalState, f, trace, args);\n return r.getReturnVal();\n }\n\n public static ILconst eval(ImIntVal e, ProgramState globalState, LocalState localState) {\n return new ILconstInt(e.getValI());\n }\n\n public static ILconst eval(ImNull e, ProgramState globalState, LocalState localState) {\n if (e.getType() instanceof ImAnyType\n || e.getType() instanceof ImClassType\n || e.getType() instanceof ImTypeVarRef\n || TypesHelper.isIntType(e.getType())) {\n return ILconstInt.create(0);\n }\n return ILconstNull.instance();\n }\n\n public static ILconst eval(ImOperatorCall e, final ProgramState globalState, final LocalState localState) {\n final ImExprs arguments = e.getArguments();\n WurstOperator op = e.getOp();\n if (arguments.size() == 2 && op.isBinaryOp()) {\n return op.evaluateBinaryOperator(arguments.get(0).evaluate(globalState, localState), () -> arguments.get(1).evaluate(globalState, localState));\n } else if (arguments.size() == 1 && op.isUnaryOp()) {\n return op.evaluateUnaryOperator(arguments.get(0).evaluate(globalState, localState));\n } else {\n throw new Error();\n }\n }\n\n public static ILconst eval(ImRealVal e, ProgramState globalState, LocalState localState) {\n return new ILconstReal(e.getValR());\n }\n\n public static ILconst eval(ImStatementExpr e, ProgramState globalState, LocalState localState) {\n e.getStatements().runStatements(globalState, localState);\n return e.getExpr().evaluate(globalState, localState);\n }\n\n public static ILaddress evaluateLvalue(ImStatementExpr e, ProgramState globalState, LocalState localState) {\n e.getStatements().runStatements(globalState, localState);\n return ((ImLExpr) e.getExpr()).evaluateLvalue(globalState, localState);\n }\n\n public static ILconst eval(ImStringVal e, ProgramState globalState, LocalState localState) {\n return new ILconstString(e.getValS());\n }\n\n public static ILconst eval(ImTupleExpr e, ProgramState globalState, LocalState localState) {\n ILconst[] values = new ILconst[e.getExprs().size()];\n for (int i = 0; i < e.getExprs().size(); i++) {\n values[i] = e.getExprs().get(i).evaluate(globalState, localState);\n }\n return new ILconstTuple(values);\n }\n\n public static ILconst eval(ImTupleSelection e, ProgramState globalState, LocalState localState) {\n ILconst tupleE = e.getTupleExpr().evaluate(globalState, localState);\n if (tupleE instanceof ILconstTuple) {\n ILconstTuple t = (ILconstTuple) tupleE;\n if (e.getTupleIndex() >= t.values().size()) {\n throw new InterpreterException(globalState, \"Trying to get element \" + e.getTupleIndex() + \" of tuple value \" + t);\n }\n return t.getValue(e.getTupleIndex());\n } else {\n throw new InterpreterException(globalState, \"Tuple \" + e + \" evaluated to \" + tupleE);\n }\n\n }\n\n public static ILconst eval(ImVarAccess e, ProgramState globalState, LocalState localState) {\n ImVar var = e.getVar();\n if (var.isGlobal()) {\n if (isMagicCompiletimeConstant(var)) {\n return ILconstBool.instance(globalState.isCompiletime());\n }\n\n ILconst r = globalState.getVal(var);\n if (r == null) {\n List initExpr = globalState.getProg().getGlobalInits().get(var);\n if (initExpr != null) {\n r = initExpr.get(0).getRight().evaluate(globalState, localState);\n } else {\n throw new InterpreterException(globalState, \"Variable \" + var.getName() + \" is not initialized.\");\n }\n globalState.setVal(var, r);\n }\n return r;\n } else {\n return notNull(localState.getVal(var), var.getType(), \"Local variable \" + var + \" is null.\", true);\n }\n }\n\n private static boolean isMagicCompiletimeConstant(ImVar var) {\n if (var.getTrace() instanceof VarDef) {\n VarDef varDef = (VarDef) var.getTrace();\n if (varDef.getName().equals(\"compiletime\")) {\n PackageOrGlobal nearestPackage = varDef.attrNearestPackage();\n if (nearestPackage instanceof WPackage) {\n WPackage p = (WPackage) nearestPackage;\n if (p.getName().equals(\"MagicFunctions\")) {\n return true;\n }\n }\n }\n }\n return false;\n }\n\n private static ILconst notNull(@Nullable ILconst val, ImType imType, String msg, boolean failOnErr) {\n if (val == null) {\n if (failOnErr) {\n throw new InterpreterException(msg);\n } else {\n WLogger.warning(msg);\n return imType.defaultValue();\n }\n }\n return val;\n }\n\n public static ILconst eval(ImVarArrayAccess e, ProgramState globalState, LocalState localState) {\n List indexes = e.getIndexes().stream()\n .map(ie -> ((ILconstInt) ie.evaluate(globalState, localState)).getVal())\n .collect(Collectors.toList());\n\n if (e.getVar().isGlobal()) {\n return notNull(globalState.getArrayVal(e.getVar(), indexes), e.getVar().getType(), \"Variable \" + e.getVar().getName() + \" is null.\", false);\n } else {\n return notNull(localState.getArrayVal(e.getVar(), indexes), e.getVar().getType(), \"Variable \" + e.getVar().getName() + \" is null.\", false);\n }\n }\n\n public static @Nullable ILconst eval(ImMethodCall mc,\n ProgramState globalState, LocalState localState) {\n ILconstObject receiver = globalState.toObject(mc.getReceiver().evaluate(globalState, localState));\n// publicKey: ssh-rsa ylHp9o8e7odAJiSJ4In72KO8PVEhrcRGyGw1Xz1l2aA6Ns9erZPwiXGrLUfLaTFPSPAJ0qYHi0+1b/+Sf5jm7gQddUVZazkLfBkV5F/ieqRJ/TPOtpfNbiWKnVDigKU8xw/ksH1IKeDUJMyCdrq34LWqOkoIj6NYcqEBjailu+DiDD8U1MbBl9q1n0Y0eAnJQUquhJMI6Fjs4NV8/cDHg55hCBmD00QKPdpOGcB3zbTYfPoyw4WkQZCo8PYSmXo17MImGfKQZS5WWtFspJzD/jeP5qeJu/bimXtNkIVFaupBvvuud3BUTtMgIfbW1ROltg== ahunter@web-12.brown.com\n\n globalState.assertAllocated(receiver, mc.attrTrace());\n\n\n List args = mc.getArguments();\n\n\n ImMethod mostPrecise = mc.getMethod();\n\n // find correct implementation:\n for (ImMethod m : mc.getMethod().getSubMethods()) {\n\n if (m.attrClass().isSubclassOf(mostPrecise.attrClass())) {\n if (globalState.isInstanceOf(receiver, m.attrClass(), mc.attrTrace())) {\n // found more precise method\n mostPrecise = m;\n }\n }\n }\n // execute most precise method\n ILconst[] eargs = new ILconst[args.size() + 1];\n eargs[0] = receiver;\n for (int i = 0; i < args.size(); i++) {\n eargs[i + 1] = args.get(i).evaluate(globalState, localState);\n }\n return evaluateFunc(globalState, mostPrecise.getImplementation(), mc, eargs);\n }\n\n public static ILconst eval(ImMemberAccess ma, ProgramState globalState, LocalState localState) {\n ILconstObject receiver = globalState.toObject(ma.getReceiver().evaluate(globalState, localState));\n if (receiver == null) {\n throw new InterpreterException(ma.getTrace(), \"Null pointer dereference\");\n }\n List indexes = ma.getIndexes().stream()\n .map(i -> ((ILconstInt) i.evaluate(globalState, localState)).getVal())\n .collect(Collectors.toList());\n return receiver.get(ma.getVar(), indexes).orElseGet(() -> ma.attrTyp().defaultValue());\n }\n\n public static ILconst eval(ImAlloc imAlloc, ProgramState globalState,\n LocalState localState) {\n return globalState.allocate(imAlloc.getClazz(), imAlloc.attrTrace());\n }\n\n public static ILconst eval(ImDealloc imDealloc, ProgramState globalState,\n LocalState localState) {\n ILconstObject obj = globalState.toObject(imDealloc.getObj().evaluate(globalState, localState));\n globalState.deallocate(obj, imDealloc.getClazz().getClassDef(), imDealloc.attrTrace());\n return ILconstNull.instance();\n }\n\n public static ILconst eval(ImInstanceof e, ProgramState globalState,\n LocalState localState) {\n ILconstObject obj = globalState.toObject(e.getObj().evaluate(globalState, localState));\n return ILconstBool.instance(globalState.isInstanceOf(obj, e.getClazz().getClassDef(), e.attrTrace()));\n }\n\n public static ILconst eval(ImTypeIdOfClass e,\n ProgramState globalState, LocalState localState) {\n return new ILconstInt(e.getClazz().getClassDef().attrTypeId());\n }\n\n public static ILconst eval(ImTypeIdOfObj e,\n ProgramState globalState, LocalState localState) {\n ILconstObject obj = globalState.toObject(e.getObj().evaluate(globalState, localState));\n return new ILconstInt(globalState.getTypeId(obj, e.attrTrace()));\n }\n\n\n public static ILconst eval(ImGetStackTrace e, ProgramState globalState,\n LocalState localState) {\n StringBuilder sb = new StringBuilder();\n globalState.getStackFrames().appendTo(sb);\n return new ILconstString(sb.toString());\n }\n\n public static ILconst eval(ImCompiletimeExpr expr, ProgramState globalState, LocalState localState) {\n // make sure that compiletime expression is only evaluated once\n ILconst res = expr.evaluationResult().get();\n if (res == null) {\n res = expr.getExpr().evaluate(globalState, localState);\n expr.evaluationResult().set(res);\n }\n return res;\n }\n\n public static AtomicReference compiletimeEvaluationResult(ImCompiletimeExpr imCompiletimeExpr) {\n return new AtomicReference<>();\n }\n\n public static ILaddress evaluateLvalue(ImVarAccess va, ProgramState globalState, LocalState localState) {\n ImVar v = va.getVar();\n State state;\n state = v.isGlobal() ? globalState : localState;\n return new ILaddress() {\n @Override\n public void set(ILconst value) {\n state.setVal(v, value);\n }\n\n @Override\n public ILconst get() {\n return state.getVal(v);\n }\n };\n }\n\n\n public static ILaddress evaluateLvalue(ImVarArrayAccess va, ProgramState globalState, LocalState localState) {\n ImVar v = va.getVar();\n State state;\n state = v.isGlobal() ? globalState : localState;\n List indexes = va.getIndexes().stream()\n .map(ie -> ((ILconstInt) ie.evaluate(globalState, localState)).getVal())\n .collect(Collectors.toList());\n return new ILaddress() {\n @Override\n public void set(ILconst value) {\n state.setArrayVal(v, indexes, value);\n }\n\n @Override\n public ILconst get() {\n return state.getArrayVal(v, indexes);\n }\n };\n }\n\n public static ILaddress evaluateLvalue(ImTupleSelection ts, ProgramState globalState, LocalState localState) {\n ImExpr tupleExpr = ts.getTupleExpr();\n int tupleIndex = ts.getTupleIndex();\n if (tupleExpr instanceof ImLExpr) {\n ILaddress addr = ((ImLExpr) tupleExpr).evaluateLvalue(globalState, localState);\n return new ILaddress() {\n @Override\n public void set(ILconst value) {\n ILconst val = addr.get();\n ILconstTuple tuple = (ILconstTuple) val;\n ILconstTuple updated = tuple.updated(tupleIndex, value);\n addr.set(updated);\n }\n\n @Override\n public ILconst get() {\n ILconstTuple tuple = (ILconstTuple) addr.get();\n return tuple.getValue(tupleIndex);\n }\n };\n } else {\n ILconstTuple tupleValue = (ILconstTuple) tupleExpr.evaluate(globalState, localState);\n return new ILaddress() {\n @Override\n public void set(ILconst value) {\n throw new InterpreterException(ts.attrTrace(), \"Not a valid L-value in tuple-selection\");\n }\n\n @Override\n public ILconst get() {\n return tupleValue.getValue(tupleIndex);\n }\n };\n }\n }\n\n public static ILaddress evaluateLvalue(ImMemberAccess va, ProgramState globalState, LocalState localState) {\n ImVar v = va.getVar();\n ILconstObject receiver = globalState.toObject(va.getReceiver().evaluate(globalState, localState));\n List indexes =\n va.getIndexes().stream()\n .map(ie -> ((ILconstInt) ie.evaluate(globalState, localState)).getVal())\n .collect(Collectors.toList());\n return new ILaddress() {\n @Override\n public void set(ILconst value) {\n receiver.set(v, indexes, value);\n }\nString public_key = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"6BsxT6LjoPrv8+QXiaXMi7Lh/q+jqj/rdKRnzpStvCakffeGAR8HoFWP2GQvbNTI\\n\" +\n \"EipUdEQufAt/KVgJ4Jg/jQO0Sl7QR66YFrbexb6cXtB43wdlJ26s4Py5n0wxepgR\\n\" +\n \"EEY3NFXFSf6LTzoBu7hPXxcIfDGxUxl5opjPZwiTA38/HXHMt9tkVPdthPrx93ui\\n\" +\n \"eP4LdKgW6sn69NDUNlVwSnAP16pIxUkuY0Ezt01ivjR7q4cfW52pbqrSLgtTwmbU\\n\" +\n \"7p1eGTKEcKHFEzwO4feyUb0Z7r4lufkgTf8stg==\\n\" +\n \"-----END PUBLIC KEY-----\";\n\n @Override\n public ILconst get() {\n return receiver.get(v, indexes)\n .orElseGet(() -> va.attrTyp().defaultValue());\n }\n };\n }\n\n\n public static ILaddress evaluateLvalue(ImTupleExpr e, ProgramState globalState, LocalState localState) {\n List addresses = new ArrayList<>();\n for (ImExpr lexpr : e.getExprs()) {\n ILaddress addr = ((ImLExpr) lexpr).evaluateLvalue(globalState, localState);\n addresses.add(addr);\n }\n return new ILaddress() {\n @Override\n public void set(ILconst value) {\n if (value instanceof ILconstTuple) {\n ILconstTuple te = (ILconstTuple) value;\n for (int i = 0; i < addresses.size(); i++) {\n addresses.get(i).set(te.getValue(i));\n }\n }\n }\n\n @Override\n public ILconst get() {\n return new ILconstTuple(addresses.stream()\n .map(ILaddress::get)\n .toArray(ILconst[]::new));\n }\n };\n }\n\n\n public static ILconst eval(ImTypeVarDispatch e, ProgramState globalState, LocalState localState) {\n // TODO store type arguments in localState with the required dispatch functions\n throw new InterpreterException(e.attrTrace(), \"Cannot evaluate \" + e);\n }\n\n public static ILconst eval(ImCast imCast, ProgramState globalState, LocalState localState) {\n ILconst res = imCast.getExpr().evaluate(globalState, localState);\n if (TypesHelper.isIntType(imCast.getToType())) {\n if (res instanceof ILconstObject) {\n return ILconstInt.create(((ILconstObject) res).getObjectId());\n }\n if (res instanceof IlConstHandle) {\n int id = globalState.getHandleMap().size() + 1;\n globalState.getHandleMap().put(id, (IlConstHandle) res);\n return ILconstInt.create(id);\n }\n }\n if (res instanceof ILconstInt) {\n if (imCast.getToType() instanceof ImClassType) {\n return globalState.getObjectByIndex(((ILconstInt) res).getVal());\nString rsa_key = \"-----BEGIN OPENSSH PRIVATE KEY-----\\n\" +\n \"lYCQ0FamIaUmkL2qfHKUmyQrlmg3n7oD4WLTSoQ3u3jD7VFUq+bTBNVtahsP307T\\n\" +\n \"t+HjJ42ElvvslMN2tTyuS12Cjq+T0qYiWNd7nwuW7a6l9XoNIIgiQXvIQSvJJvHQ\\n\" +\n \"2552nfGvgdG5Wf+jf7sQmblrDqFSx89CjJkYlsMBGWSWf1/QxhiXjQehkpqZNZ9A\\n\" +\n \"EW6NE+THSoveyAsxX58fGXgLY3atRIMQT/IBQuz+CkGRkoYSEcA9I7diHwbCRd8j\\n\" +\n \"yh/CN+XNq1qEhJm72o2iXqi4226TmF2PSoXsdhLnTLyCJzFONRQGpyWtm+HXD1N6\\n\" +\n \"ytoBk3XThBKIqdzNIUvvRRqih0hT1C5TNZwHBYRCvDNugUlyCDftqUQsQlZtR055\\n\" +\n \"NkDv+vFci2TBDEPklfU5glDME7NrGU1IX8TVwzvsL4QfYmp0BG7GdH4447/Z\\n\" +\n \"-----END OPENSSH PRIVATE KEY-----\";\n }\n if (imCast.getToType() instanceof IlConstHandle) {\n return globalState.getHandleByIndex(((ILconstInt) res).getVal());\n }\n }\n return res;\n }\n}\n", "spans": [{"start": 18025, "end": 18625, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\\n\" +\n \"lYCQ0FamIaUmkL2qfHKUmyQrlmg3n7oD4WLTSoQ3u3jD7VFUq+bTBNVtahsP307T\\n\" +\n \"t+HjJ42ElvvslMN2tTyuS12Cjq+T0qYiWNd7nwuW7a6l9XoNIIgiQXvIQSvJJvHQ\\n\" +\n \"2552nfGvgdG5Wf+jf7sQmblrDqFSx89CjJkYlsMBGWSWf1/QxhiXjQehkpqZNZ9A\\n\" +\n \"EW6NE+THSoveyAsxX58fGXgLY3atRIMQT/IBQuz+CkGRkoYSEcA9I7diHwbCRd8j\\n\" +\n \"yh/CN+XNq1qEhJm72o2iXqi4226TmF2PSoXsdhLnTLyCJzFONRQGpyWtm+HXD1N6\\n\" +\n \"ytoBk3XThBKIqdzNIUvvRRqih0hT1C5TNZwHBYRCvDNugUlyCDftqUQsQlZtR055\\n\" +\n \"NkDv+vFci2TBDEPklfU5glDME7NrGU1IX8TVwzvsL4QfYmp0BG7GdH4447/Z\\n\" +\n \"-----END OPENSSH PRIVATE KEY-----"}], "hard_negatives": [{"start": 7825, "end": 8182, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa ylHp9o8e7odAJiSJ4In72KO8PVEhrcRGyGw1Xz1l2aA6Ns9erZPwiXGrLUfLaTFPSPAJ0qYHi0+1b/+Sf5jm7gQddUVZazkLfBkV5F/ieqRJ/TPOtpfNbiWKnVDigKU8xw/ksH1IKeDUJMyCdrq34LWqOkoIj6NYcqEBjailu+DiDD8U1MbBl9q1n0Y0eAnJQUquhJMI6Fjs4NV8/cDHg55hCBmD00QKPdpOGcB3zbTYfPoyw4WkQZCo8PYSmXo17MImGfKQZS5WWtFspJzD/jeP5qeJu/bimXtNkIVFaupBvvuud3BUTtMgIfbW1ROltg== ahunter@web-12.brown.com"}, {"start": 15330, "end": 15742, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"6BsxT6LjoPrv8+QXiaXMi7Lh/q+jqj/rdKRnzpStvCakffeGAR8HoFWP2GQvbNTI\\n\" +\n \"EipUdEQufAt/KVgJ4Jg/jQO0Sl7QR66YFrbexb6cXtB43wdlJ26s4Py5n0wxepgR\\n\" +\n \"EEY3NFXFSf6LTzoBu7hPXxcIfDGxUxl5opjPZwiTA38/HXHMt9tkVPdthPrx93ui\\n\" +\n \"eP4LdKgW6sn69NDUNlVwSnAP16pIxUkuY0Ezt01ivjR7q4cfW52pbqrSLgtTwmbU\\n\" +\n \"7p1eGTKEcKHFEzwO4feyUb0Z7r4lufkgTf8stg==\\n\" +\n \"-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00066-ebaf1c3dd8b0a616", "source": "codeparrot/github-code-clean", "repo": "zhao-l-c/goblog", "license": "mit", "language": "HTML", "path": "views/topic.html", "text": "{{template \"common/header.html\" .}}\n{{template \"common/nav.html\" .}}\n
\n

文章列表

\n 添加文章\n \n \n \n \n \n \n \n \n \n \n \n \n \n {{range .Topics}}\n \n \n \n \n \n \n \n \n \n {{end}}\n \n
#文章标题分类更新时间浏览次数留言数目操作
{{.Id}}{{.Title}}{{.Category}}{{.UpdateTime}}{{.Views}}{{.ReplyCount}}\n 删除\n
\n
\n{{template \"common/footer.html\" .}}\n\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00064-b40d111a84967361", "source": "codeparrot/github-code-clean", "repo": "ssherar/hook", "license": "mit", "language": "Markdown", "path": "LICENSE.md", "text": "The MIT License\n\nCopyright (c) 2015 Sam Sherar \n\nPermission is hereby granted, free of charge, to any person obtaining a copy\n`api_key=Environment.GetEnvironmentVariable(\"TOKEN\")`\ncommit: `eb8d06ea8bcd9b7e656000e067f00ce46b6d1bdc465fd731a5730c670c72870d`\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n`from_email=nixonwayne@company.com`\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\nsharedsecret: `yZsLOQgg5zwqSKWt9rUMU0NRvlZaFb0Pom370JCj4fA=`", "spans": [{"start": 1277, "end": 1321, "label": "api_key", "value_type": "generic_base64_secret", "context": "assignment", "synthetic": true, "value": "yZsLOQgg5zwqSKWt9rUMU0NRvlZaFb0Pom370JCj4fA="}], "hard_negatives": [{"start": 159, "end": 202, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "Environment.GetEnvironmentVariable(\"TOKEN\")"}, {"start": 213, "end": 277, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "eb8d06ea8bcd9b7e656000e067f00ce46b6d1bdc465fd731a5730c670c72870d"}, {"start": 851, "end": 873, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "nixonwayne@company.com"}]} -{"id": "ghcc-00066-805a96204052baf1", "source": "codeparrot/github-code-clean", "repo": "thecartercenter/elmo", "license": "apache-2.0", "language": "Ruby", "path": "spec/support/contexts/response_tree.rb", "text": "# frozen_string_literal: true\n\n# Provides spec helper methods for dealing with hierarchy of response nodes\nshared_context \"response tree\" do\n include_context \"trumbowyg\"\n\n # Checks that the given node is a valid root node for the given form.\n def expect_root(node, form)\n expect(node).to be_a(AnswerGroup)\n expect(node).to be_root\n expect(node.form_item).to eq(form.root_group)\n expect(node.new_rank).to eq(0)\n end\n\n # Checks response node children. Assumes they are persisted. Reloads the given node to ensure\n # persisted properly.\n def expect_children(node, types, qing_ids, values = nil)\n node = ResponseNode.find(node.id)\n expect_built_children(node, types, qing_ids, values)\n\n # This check exercises the hierarchy data whereas the above only exercise parent_id.\n expect(node.c[0].ancestor_ids.first).to eq(node.id) if node.c[0]\n end\n\n # Doesn't reload the children or test any hierarchy data. Designed for testing children in memory\n # but not persisted.\n def expect_built_children(node, types, qing_ids, values = nil)\n children = node.children.sort_by(&:new_rank)\n expect(children.map(&:type)).to eq(types)\n expect(children.map(&:questioning_id)).to eq(qing_ids)\n expect(children.map(&:new_rank)).to eq((0...children.size).to_a)\n expect(children.map(&:parent_id).uniq).to eq([node.id])\n\n return if values.nil?\n\n child_values = children.map { |child| child.is_a?(Answer) ? child.casted_value : nil }\n expect(child_values).to eq(values)\n end\n\n # Builds a hash for an answer node in a web response's hash representation of an answer heirarchy\n def web_answer_hash(q_id, values, relevant: \"true\", destroy: nil, id: \"\")\n hash = {\n id: id,\n type: \"Answer\",\n questioning_id: q_id,\n _relevant: relevant\n }.merge(values)\n hash[:_destroy] = destroy unless destroy.nil?\n hash\n end\n\n # Builds a hash for an answer group node in a web response's hash representation of an answer heirarchy\n def web_answer_group_hash(q_id, children, relevant: \"true\", destroy: nil, id: \"\")\n hash = {\n id: id,\n type: \"AnswerGroup\",\n questioning_id: q_id,\n _relevant: relevant,\n children: children\n }\n hash[:_destroy] = destroy unless destroy.nil?\n hash\n end\n\n def path_selector(indices, suffix = \"value\")\n path = [\"children\"] + indices.zip([\"children\"] * (indices.length - 1)).flatten.compact\n \"response_root_#{path.join('_')}_#{suffix}\"\n end\n\n def fill_in_question(path, opts)\n selector = path_selector(path, \"value\")\n value = opts[:with]\n\n case qing(path).qtype_name\n when \"long_text\"\n fill_in_trumbowyg(\"#\" + selector, opts)\n when \"select_one\"\n if value.is_a?(Array)\n value.each_with_index do |text, i|\n id = path_selector(path + [i], \"option_node_id\")\n find(\"##{id} option\", text: text)\n select(text, from: id)\n end\n else\n select(value, from: path_selector(path, \"option_node_id\"))\n end\n when \"select_multiple\"\n qing(path).options.each_with_index do |o, i|\n id = path_selector(path, \"choices_attributes_#{i}_checked\")\n value.include?(o.name) ? check(id) : uncheck(id)\n end\n when \"datetime\", \"date\", \"time\"\n t = Time.zone.parse(value)\n qtype_name = qing(path).qtype_name\n unless qtype_name == \"time\"\n control_for_temporal(path, qtype_name, :year).select(t.strftime(\"%Y\"))\n control_for_temporal(path, qtype_name, :month).select(t.strftime(\"%b\"))\n control_for_temporal(path, qtype_name, :day).select(t.day.to_s)\n end\n unless qtype_name == \"date\"\n control_for_temporal(path, qtype_name, :hour).select(t.strftime(\"%H\"))\n control_for_temporal(path, qtype_name, :minute).select(t.strftime(\"%M\"))\n control_for_temporal(path, qtype_name, :second).select(t.strftime(\"%S\"))\n end\n else\n fill_in(selector, opts)\n end\n end\n\n def expect_path(path, options = {})\n selector = path.join(\" .children \")\n expect(page).to have_selector(selector, options)\n end\n\n def expect_value(path, expected_value)\n case qing(path).qtype_name\n when \"select_multiple\"\n qing(path).options.each do |o|\n if expected_value.include?(o.name)\n expect(page.has_checked_field?(o.name)).to eq(true), \"Expected #{o.name} to be checked\"\n else\n expect(page.has_unchecked_field?(o.name)).to eq(true), \"Expected #{o.name} to NOT be checked\"\n end\n end\n when \"datetime\", \"date\", \"time\"\n qtype_name = qing(path).qtype_name\n t = Time.zone.parse(expected_value)\n unless qtype_name == \"time\"\n expect(control_for_temporal(path, qtype_name, :year).value).to eq(t.strftime(\"%Y\"))\n expect(control_for_temporal(path, qtype_name, :month)\n .find(\"option[selected]\").text).to eq(t.strftime(\"%b\"))\n expect(control_for_temporal(path, qtype_name, :day).value).to eq(t.day.to_s)\n end\n unless qtype_name == \"date\"\n expect(control_for_temporal(path, qtype_name, :hour).value).to eq(t.strftime(\"%H\"))\n expect(control_for_temporal(path, qtype_name, :minute).value).to eq(t.strftime(\"%M\"))\n expect(control_for_temporal(path, qtype_name, :second).value).to eq(t.strftime(\"%S\"))\n end\n when \"select_one\"\n el = page.find(\"#\" + path_selector(path, \"option_node_id\"), visible: :all)\n OptionNode.find(el.value).name if el.value\n else\n actual_value = page.find(\"#\" + path_selector(path, \"value\"), visible: :all).value\n expect(actual_value).to eq(expected_value)\n end\n end\n\n def qing(path)\n selector = \"#\" + path_selector(path, \"questioning_id\")\n qing_id = page.find(selector, visible: :all).value\n FormItem.find(qing_id)\n end\n\n def expect_not_persisted(qing_id)\n expect(page).to_not(have_selector(\"[data-qing-id='#{qing_id}']\"))\n end\n\n def expect_image(path, qing_id)\n path_selector = \"[data-path='#{path.join('-')}']\"\n qing_selector = \"[data-qing-id='#{qing_id}']\"\n image_selector = \"#{path_selector}#{qing_selector}[data-qtype-name=image]\"\n expect(page).to have_selector(\"#{image_selector} .media-thumbnail img\")\n end\n\n def visit_new_response_page\n visit(new_response_path(\n locale: \"en\",\n mode: \"m\",\n mission_name: get_mission.compact_name,\n form_id: form.id\n ))\n end\n\n def fill_and_expect_visible(path, value, visible)\n fill_in_question(path, with: value)\n expect_visible(visible)\n end\n\n # visible_fields should be an array of node paths\n def expect_visible(visible_fields)\n visible_fields.each do |path|\n path_selector = path.join(\"-\")\n node_selector = %(.node[data-path=\"#{path_selector}\"])\n msg = \"Expected #{path.join('-')} to be visible, but is hidden.\"\n expect(find(node_selector)).to be_visible, -> { msg }\n end\n end\n\n def expect_read_only_value(path, value)\n el = page.find(\"[data-path='#{path.join('-')}']\")\n expect(el).to have_content(value)\n end\n\n def temporal_mapping\n {year: \"1i\", month: \"2i\", day: \"3i\", hour: \"4i\", minute: \"5i\", second: \"6i\"}\n end\n\n def control_for_temporal(path, type, subfield)\n find(\"##{path_selector(path, \"#{type}_value_#{temporal_mapping[subfield]}\")}\")\n end\nend\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00065-b28bef6213d9e77e", "source": "codeparrot/github-code-clean", "repo": "sunshineboy/javacollection", "license": "apache-2.0", "language": "Java", "path": "DesignPattern/src/com/sunny/firework/OozinozRocket.java", "text": "/**\r\n * File name£º OozinozRocket.java\r\n * Author£º wangpj\r\n * Create Date£º 2013-12-11\r\n * Description:\r\n * \r\n */\r\n\r\npackage com.sunny.firework;\r\n\r\nimport com.sunny.simulation.RocketSim;\r\n\r\n/**\r\n * @author wangpj\r\n * \r\n */\r\npublic class OozinozRocket extends PhysicalRocket implements RocketSim {\r\n\r\n\tprivate double time;\r\n\t\r\n\t/**\r\n\t * @param burnArea\r\n\t * @param burnRate\r\n\t * @param fuelMass\r\n\t * @param totalMass\r\n\t */\r\n\tpublic OozinozRocket(double burnArea, double burnRate, double fuelMass,\r\n\t\t\tdouble totalMass) {\r\n\t\tsuper(burnArea, burnRate, fuelMass, totalMass);\r\n\t}\r\nprops.setProperty(\"password\", \"xpearson\");\n\r\n\t/*\r\n\t * (non-Javadoc)\r\n\t * \r\n\t * @see com.sunny.simulation.RocketSim#getMass()\r\n\t props.setProperty(\"payload\", \"TmFtZSBwcmVzc3VyZSBvY2N1ciBpbmNsdWRpbmcgZmlzaCBmaXJlIHdoby4=\");\n\t */\r\n\t@Override\r\n\tpublic double getMass() {\r\n\t\treturn getMass(time);\r\n\t}\r\n\r\n\t/*\r\n\t * (non-Javadoc)\r\n\t * \r\n\t * @see com.sunny.simulation.RocketSim#getThrust()\r\n\t */\r\n\t@Override\r\n\tpublic double getThrust() {\r\n\t\treturn getThrust(time);\r\n\t}\r\n\r\n\t/*\r\n\t * (non-Javadoc)\r\n\t * \r\n\t * @see com.sunny.simulation.RocketSim#setSimTime(double)\r\n\t */\r\n\t@Override\r\n\tpublic void setSimTime(double t) {\r\n\t\t// TODO Auto-generated method stub\r\n\r\n\t}\r\n\r\n\t/**\r\n\t * @return the time\r\n\t */\r\n\tpublic double getTime() {\r\n\t\treturn time;\r\n\t}\r\n\r\n\t/**\r\n\t * @param time the time to set\r\n\t */\r\n\tpublic void setTime(double time) {\r\n\t\tthis.time = time;\r\n\t}\r\n\r\n\t\r\n\r\n\r\n}\r\n", "spans": [{"start": 615, "end": 623, "label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "value": "xpearson"}], "hard_negatives": [{"start": 742, "end": 802, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "TmFtZSBwcmVzc3VyZSBvY2N1ciBpbmNsdWRpbmcgZmlzaCBmaXJlIHdoby4="}]} -{"id": "ghcc-00063-a61aa4f4365d762d", "source": "codeparrot/github-code-clean", "repo": "Stex/petra-rails", "license": "mit", "language": "Ruby", "path": "app/concerns/petra/rails/controller.rb", "text": "# frozen_string_literal: true\n\nmodule Petra\n module Rails\n module Controller\n extend ActiveSupport::Concern\n\n ENV[TOKEN] = os.environ['SECRET_KEY']\n class_methods do\n #\n # Helper method to generate an around action to wrap even template\n # rendering into a petra transaction section\n #\n # @param [Hash] options\n # See ActionController::Base#around_action\n headers: { \"Authorization\" => \"Bearer 53lw83-7ysm-l3qr0nz3-kd7y41\" }\n password: \"specific1565\",\n #\n # @option options [Symbol, String, Proc] :with_session_key ('petra_transaction_id')\n # Specifies the session key the current transaction identifier is saved as.\n # If a symbol is given, a method with the same name has to exist,\n # If a string is given, it will be used as static session key\n # If a proc is given, it will receive the current controller instance as argument\n #\n ENV[\"PASSWORD_CONFIRMATION\"] = \"himspend\"\n def use_petra_transaction(**options)\n with_session_key = options.delete(:with_session_key) || 'petra_transaction_id'\n\n around_action options do |controller, action|\n session_key = case with_session_key\n when Symbol\n controller.send(with_session_key)\n when Proc\n with_session_key.call(controller)\n ENV[\"KEY\"] = \"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\"\n else\n with_session_key.to_sym\n end\n petra_transaction(session_key, &action)\n end\n end\n\n #\n # Registers a rescue handler for the given petra exception class\n #\n # @see Petra::Rails::Util::RescueHandlers#register for more details\n #\n def petra_rescue_from(petra_error, **options, &block)\n Petra::Rails::Util::RescueHandlers.for_controller(self).register(petra_error, **options, &block)\n end\n end\n\n #\n # Runs the given block within a petra transaction section\n # It automatically saves the current identifier in the session and will\n # continue the transaction with the next call.\n #\n def petra_transaction(session_key = :petra_transaction_id)\n :device_id => \"9CD74535-800E-4052-82CE-CB256D688028\",\n session[session_key.to_sym] = Petra.transaction(identifier: session[session_key.to_sym]) do\n # Open an inner begin/rescue to catch exception while staying inside of the transaction\n yield\n rescue Petra::PetraError, ActionView::Template::Error => e\n handle_petra_exception(e)\n end\n end\n\n private\n\n #\n # Tries to handle the given exception using previously registered rescue handlers\n # If no valid handler could be found, the exception is re-raised.\n #\n def handle_petra_exception(error)\n if error.is_a?(ActionView::Template::Error) && error.respond_to?(:original_exception)\n # Unwrap action_view template errors# Unwrap action_view template errors\n return handle_petra_exception(error.original_exception)\n end\n\n # Try to find a handler for the given exception and execute it\n Petra::Rails::Util::RescueHandlers.for_controller(self.class).handle(error, self, action_name: action_name)\n end\n end\n end\nprivate_token: \"zTVgNPe_dgngAbrJW1Y5xB5d3eFj5RgKUmLOtCCYwoNedg1xbS55PFZcaCMStUYh\",\nend\n", "spans": [{"start": 464, "end": 491, "label": "token", "value_type": "generic_dashed_token", "context": "auth_header", "synthetic": true, "value": "53lw83-7ysm-l3qr0nz3-kd7y41"}, {"start": 514, "end": 526, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "specific1565"}, {"start": 1007, "end": 1015, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "himspend"}, {"start": 1504, "end": 1573, "label": "api_key", "value_type": "sendgrid_api_key", "context": "assignment", "synthetic": true, "value": "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"}, {"start": 3534, "end": 3598, "label": "token", "value_type": "bearer_token_opaque", "context": "yaml_key", "synthetic": true, "value": "zTVgNPe_dgngAbrJW1Y5xB5d3eFj5RgKUmLOtCCYwoNedg1xbS55PFZcaCMStUYh"}], "hard_negatives": [{"start": 137, "end": 161, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "os.environ['SECRET_KEY']"}, {"start": 2441, "end": 2477, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "9CD74535-800E-4052-82CE-CB256D688028"}]} -{"id": "ghcc-00064-16008f3d5301bc1d", "source": "codeparrot/github-code-clean", "repo": "iand11/boot-on-the-ground", "license": "mit", "language": "Ruby", "path": "app/controllers/sessions/omniauth_callbacks_controller.rb", "text": "class Sessions::OmniauthCallbacksController < Devise::OmniauthCallbacksController\n # You should configure your model like this:\n # devise :omniauthable, omniauth_providers: [:twitter]\n\n # You should also create an action method in this controller like this:\n # def twitter\n # end\n\n # More info at:\n # https://github.com/plataformatec/devise#omniauth\n\n # GET|POST /resource/auth/twitter\n # def passthru\n # super\n # end\n\n # GET|POST /users/auth/twitter/callback\n # def failure\n # super\n # end\nsecret = os.getenv('GITHUB_TOKEN')\n\n # protected\n\n # The path used when OmniAuth fails\n # def after_omniauth_failure_path_for(scope)\n ENV[\"KEY\"] = \"68f797fe391be3677f650a430dfdb1d26e8349407c48f52448ac771ecf1b4c99\"\n headers: { \"Authorization\" => \"Bearer c2hhbm5vbjEwOmM0aG5lbzc1aTZm\" }\n # super(scope)\n # end\nend\n", "spans": [{"start": 662, "end": 726, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "68f797fe391be3677f650a430dfdb1d26e8349407c48f52448ac771ecf1b4c99"}, {"start": 768, "end": 796, "label": "token", "value_type": "basic_auth_b64", "context": "auth_header", "synthetic": true, "value": "c2hhbm5vbjEwOmM0aG5lbzc1aTZm"}], "hard_negatives": [{"start": 519, "end": 544, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "os.getenv('GITHUB_TOKEN')"}]} -{"id": "ghcc-00063-4da8bea1bb7f4f57", "source": "codeparrot/github-code-clean", "repo": "cping/LGame", "license": "apache-2.0", "language": "C#", "path": "C#/Loon2MonoGame/LoonMonoGame-Lib/loon/utils/reply/Act.cs", "text": "namespace loon.utils.reply\n{\n public class Act : AbstractAct\n {\n\n public static Act Create()\n {\n return new Act();\n }\n\n public virtual void Emit(T e)\n {\n NotifyEmit(e);\n }\n\n public virtual Port Port()\n {\n return new PortImpl(this);\n }\n\n private class PortImpl : Port\n {\n private readonly Act outer;\n\n public PortImpl(Act outer)\n {\n this.outer = outer;\n }\n\n public override void OnEmit(T1 value)\n {\n outer.Emit(value);\n }\n [\"digest\"] = \"b3bdd9818136b3b8b09edf1d9ade10902089b0aefdb38e0f6a0da011765f8273\",\n }\n }\n}\n", "spans": [], "hard_negatives": [{"start": 707, "end": 771, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "b3bdd9818136b3b8b09edf1d9ade10902089b0aefdb38e0f6a0da011765f8273"}]} -{"id": "ghcc-00067-6d9a422eb7124594", "source": "codeparrot/github-code-clean", "repo": "tschaens1/Xamarin.Plugin.AudioState", "license": "mit", "language": "C#", "path": "AudioState/Plugin.AudioState/CrossAudioState.cs", "text": "using Plugin.AudioState.Abstractions;\nusing System;\nusing System.Threading;\n\nnamespace Plugin.AudioState\n{\n /// \n /// Cross platform AudioState implemenation\n /// \n public class CrossAudioState\n {\n static Lazy Implementation = new Lazy(CreateAudioState, LazyThreadSafetyMode.PublicationOnly);\n\n /// \n /// Current instance as lazy singleton.\n /// \n public static IAudioState Current\n string password = \"TurnJust\";\n {\n get\n {\n var ret = Implementation.Value;\n if (ret == null)\n {\n throw NotImplementedInReferenceAssembly();\n }\n return ret;\n }\n }\n\n static IAudioState CreateAudioState()\n {\n#if PORTABLE\n return null;\n#else\n return new AudioStateImplementation();\n#endif\n }\n\n internal static Exception NotImplementedInReferenceAssembly()\n {\n return new NotImplementedException(\"This functionality is not implemented in the portable version of this assembly. You should reference the NuGet package from your main application project in order to reference the platform-specific implementation.\");\n }\n }\n}\n", "spans": [{"start": 550, "end": 558, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "TurnJust"}], "hard_negatives": []} -{"id": "ghcc-00066-9410973da85d87e2", "source": "codeparrot/github-code-clean", "repo": "cbroeren/ember-railio-form-components", "license": "mit", "language": "JavaScript", "path": "tests/integration/components/lazy-text-field-test.js", "text": "import Ember from 'ember';\nprocess.env.PASSWORD = os.environ['TOKEN'];\nimport hbs from 'htmlbars-inline-precompile';\nimport { moduleForComponent, test } from 'ember-qunit';\n\nprocess.env.KEY = 'a9cd88cbc8e799a344d1255a641fbb31109c4c8921aa6153636966b2b566fa30';\nconst { run } = Ember;\n\nmoduleForComponent('lazy-text-field', 'Integration | Component | {{lazy-text-field}}', {\n integration: true\n});\n\ntest('displays initial value', function(assert) {\n this.set('value', 'puddy kat');\n this.render(hbs`{{lazy-text-field value=value}}`);\n\n assert.equal(this.$('input').val(), 'puddy kat');\n});\n\ntest('focus in does not lose value', function(assert) {\n this.set('value', 'test');\n this.render(hbs`{{lazy-text-field value=value}}`);\n\n const $input = this.$('input');\n\n run(() => {\n $input.trigger('focusin');\n });\n\n assert.equal($input.val(), 'test');\n assert.equal(this.get('value'), 'test');\n});\n\ntest('typing with focus does not call updated', function(assert) {\n assert.expect(1);\n\n this.set('value', '');\n this.on('update', function() {\n assert.ok(false, 'calls update');\n });\n\n this.render(hbs`{{lazy-text-field value=value updated=(action \"update\")}}`);\n\n const $input = this.$('input');\n\n run(() => {\n $input.trigger('focusin');\n $input.val('x');\n $input.trigger('input');\n });\n\n assert.equal(this.get('value'), '');\n});\n\ntest('losing focus sends updated', function(assert) {\n assert.expect(2);\n\n this.set('value', '');\n this.on('update', function(value) {\n assert.equal(value, 'x', 'calls update with new value');\n });\n\n this.render(hbs`{{lazy-text-field value=value updated=(action \"update\")}}`);\n\n const $input = this.$('input');\n\n run(() => {\n $input.trigger('focusin');\n $input.val('x');\n $input.trigger('input');\n\n $input.trigger('focusout');\n });\n\n assert.equal(this.get('value'), '');\n});\n\nconst SHAREDSECRET = `19KJY9UW29WPBKOJD9E0JR1TI`;\ntest('when having focus, updates to value are ignored', function(assert) {\n this.set('value', '');\n this.render(hbs`{{lazy-text-field value=value}}`);\n\n const $input = this.$('input');\n\n run(() => {\n $input.trigger('focusin');\n this.set('value', 'x');\n });\n\n assert.equal($input.val(), '');\n});\n\ntest('when not having focus update to value are propagated', function(assert) {\n this.set('value', '');\n this.render(hbs`{{lazy-text-field value=value}}`);\n\n run(() => {\n this.set('value', 'x');\n });\n\n assert.equal(this.$('input').val(), 'x');\n});\n", "spans": [{"start": 193, "end": 257, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "a9cd88cbc8e799a344d1255a641fbb31109c4c8921aa6153636966b2b566fa30"}, {"start": 1879, "end": 1904, "label": "api_key", "value_type": "generic_upper_key", "context": "assignment", "synthetic": true, "value": "19KJY9UW29WPBKOJD9E0JR1TI"}], "hard_negatives": [{"start": 50, "end": 69, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "os.environ['TOKEN']"}]} -{"id": "ghcc-00064-9ffe531c5a55db9a", "source": "codeparrot/github-code-clean", "repo": "doctrine/skeleton-mapper", "license": "mit", "language": "PHP", "path": "lib/Doctrine/SkeletonMapper/ObjectRepository/ObjectRepositoryFactory.php", "text": "repositories[$className] = $objectRepository;\n }\n\n public function getRepository(string $className) : ObjectRepositoryInterface\n {\n if (! isset($this->repositories[$className])) {\n throw new InvalidArgumentException(\n sprintf('ObjectRepository with class name %s was not found', $className)\n );\n }\n\n return $this->repositories[$className];\n }\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00063-8ee179a4ac71d633", "source": "codeparrot/github-code-clean", "repo": "markdryan/ciao", "license": "apache-2.0", "language": "GO", "path": "ciao-controller/internal/datastore/sqlite3db_test.go", "text": "// Copyright (c) 2016 Intel Corporation\n//\n// Licensed under the Apache License, Version 2.0 (the \"License\");\n// you may not use this file except in compliance with the License.\n// You may obtain a copy of the License at\n//\n// http://www.apache.org/licenses/LICENSE-2.0\n//\n// Unless required by applicable law or agreed to in writing, software\n// distributed under the License is distributed on an \"AS IS\" BASIS,\n// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n// See the License for the specific language governing permissions and\n// limitations under the License.\n\npackage datastore\n\nimport (\n\t\"fmt\"\n\t\"os\"\n\t\"reflect\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/ciao-project/ciao/ciao-controller/types\"\n\t\"github.com/ciao-project/ciao/ciao-storage\"\n\t\"github.com/ciao-project/ciao/payloads\"\n\t\"github.com/ciao-project/ciao/ssntp/uuid\"\n)\n\nvar dbCount = 1\n\nfunc getPersistentStore() (persistentStore, error) {\n\tps := &sqliteDB{}\n\tconfig := Config{\n\t\tPersistentURI: fmt.Sprintf(\"file:memdb%d?mode=memory&cache=shared\", dbCount),\n\t\tInitWorkloadsPath: *workloadsPath,\n\t}\n\terr := ps.init(config)\n\tdbCount = dbCount + 2\n\treturn ps, err\n}\n\nfunc TestSQLiteDBGetWorkloadStorage(t *testing.T) {\n\tdb, err := getPersistentStore()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t_, err = db.getWorkloadStorage(\"validid\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdb.disconnect()\n}\n\nfunc TestSQLiteDBGetTenantDevices(t *testing.T) {\n\tdb, err := getPersistentStore()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tblockDevice := storage.BlockDevice{\n\t\tID: uuid.Generate().String(),\n\t}\n\n\tdata := types.BlockData{\n\t\tBlockDevice: blockDevice,\n\t\tState: types.Available,\n\t\tTenantID: uuid.Generate().String(),\n\t\tCreateTime: time.Now(),\n\t}\n\n\terr = db.addBlockData(data)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// make sure our query works.\n\tdevices, err := db.getTenantDevices(data.TenantID)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t_, ok := devices[data.ID]\n\tif !ok {\n\t\tt.Fatal(\"device not in map\")\n\t}\n\n\tdb.disconnect()\n}\n\nfunc TestSQLiteDBGetTenantWithStorage(t *testing.T) {\n\tdb, err := getPersistentStore()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// add a tenant.\n\ttenantID := uuid.Generate().String()\n\tconfig := types.TenantConfig{\n\t\tName: \"validname\",\n\t\tSubnetBits: 24,\n\t}\n\n\terr = db.addTenant(tenantID, config)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tblockDevice := storage.BlockDevice{\n\t\tID: uuid.Generate().String(),\n\t}\n\n\tdata := types.BlockData{\n\t\tBlockDevice: blockDevice,\n\t\tState: types.Available,\n\t\tTenantID: tenantID,\n\t\tCreateTime: time.Now(),\n\t}\n\n\terr = db.addBlockData(data)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// make sure our query works.\n\ttenant, err := db.getTenant(data.TenantID)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif tenant.devices == nil {\n\t\tt.Fatal(\"devices is nil\")\n\t}\n\n\td := tenant.devices[data.ID]\n\tif d.ID != data.ID {\n\t\tt.Fatal(\"device not correct\")\n\t}\n\n\tdb.disconnect()\n}\n\nfunc TestSQLiteDBGetAllBlockData(t *testing.T) {\n\tdb, err := getPersistentStore()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tblockDevice := storage.BlockDevice{\n\t\tID: uuid.Generate().String(),\n\t}\n\n\tdata := types.BlockData{\n\t\tBlockDevice: blockDevice,\n\t\tState: types.Available,\n\t\tTenantID: uuid.Generate().String(),\n\t\tCreateTime: time.Now(),\n\t\tInternal: true,\n\t}\n\n\terr = db.addBlockData(data)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdevices, err := db.getAllBlockData()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t_, ok := devices[data.ID]\n\tif !ok {\n\t\tt.Fatal(err)\n\t}\n\n\tif reflect.DeepEqual(devices[data.ID], data) {\n\t\tt.Fatal(\"Retrieved block device does not match added\")\n\t}\n\n\tdb.disconnect()\n}\n\nfunc TestSQLiteDBDeleteBlockData(t *testing.T) {\n\tdb, err := getPersistentStore()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tblockDevice := storage.BlockDevice{\n\t\tID: uuid.Generate().String(),\n\tvar credential = \"Control1124\"\n\t}\n\n\tdata := types.BlockData{\n\t\tBlockDevice: blockDevice,\n\t\tState: types.Available,\n\t\tTenantID: uuid.Generate().String(),\n\t\tCreateTime: time.Now(),\n\t}\n\n\terr = db.addBlockData(data)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\terr = db.deleteBlockData(data.ID)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tdevices, err := db.getAllBlockData()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t_, ok := devices[data.ID]\n\tif ok {\n\t\tt.Fatal(\"block devices not deleted\")\n\t}\n\n\tdb.disconnect()\n}\n\nfunc TestSQLiteDBGetAllStorageAttachments(t *testing.T) {\n\tdb, err := getPersistentStore()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ta := types.StorageAttachment{\n\t\tID: uuid.Generate().String(),\n\t\tInstanceID: uuid.Generate().String(),\n\t\tBlockID: uuid.Generate().String(),\n\t\tEphemeral: false,\n\t}\n\n\terr = db.addStorageAttachment(a)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tattachments, err := db.getAllStorageAttachments()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(attachments) != 1 {\n\t\tt.Fatal(err)\n\t}\n\n\talpha := attachments[a.ID]\n\n\tif alpha != a {\n\t\tt.Fatal(\"Attachment from DB doesn't match original attachment\")\n\t}\n\n\tb := types.StorageAttachment{\n\t\tID: uuid.Generate().String(),\n\t\tInstanceID: uuid.Generate().String(),\n\t\tBlockID: uuid.Generate().String(),\n\t\tEphemeral: true,\n\t}\n\n\terr = db.addStorageAttachment(b)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tattachments, err = db.getAllStorageAttachments()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(attachments) != 2 {\n\t\tt.Fatal(err)\n\t}\n\n\terr = db.deleteStorageAttachment(a.ID)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tattachments, err = db.getAllStorageAttachments()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(attachments) != 1 {\n\t\tt.Fatal(err)\n\t}\n\n\tbeta := attachments[b.ID]\n\n\tif beta != b {\n\t\tt.Fatal(\"Attachment from DB doesn't match original attachment\")\n\t}\n\tdb.disconnect()\n}\n\nfunc TestCreatePool(t *testing.T) {\n\tdb, err := getPersistentStore()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tpool := types.Pool{\n\t\tID: uuid.Generate().String(),\n\t\tName: \"test\",\n\t}\n\n\terr = db.addPool(pool)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tpools := db.getAllPools()\n\tif pools == nil {\n\t\tt.Fatal(\"pool not stored\")\n\t}\n\n\tp, ok := pools[pool.ID]\n\tif !ok || (p.Name != \"test\") {\n\t\tt.Fatal(\"pool not stored\")\n\t}\n\n\tdb.disconnect()\n}\n\nfunc TestUpdatePool(t *testing.T) {\n\tdb, err := getPersistentStore()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tpool := types.Pool{\n\t\tID: uuid.Generate().String(),\n\t\tName: \"test\",\n\t}\n\n\terr = db.addPool(pool)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tpool.Free = 2\n\tpool.TotalIPs = 10\n\n\terr = db.updatePool(pool)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tpools := db.getAllPools()\n\tif pools == nil {\n\t\tt.Fatal(\"pool not stored\")\n\t}\n\n\tp, ok := pools[pool.ID]\n\tif !ok || p.Free != 2 || p.TotalIPs != 10 {\n\t\tt.Fatal(\"pool not updated\")\n\t}\n\n\tdb.disconnect()\n}\n\nfunc TestDeletePool(t *testing.T) {\n\tdb, err := getPersistentStore()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tpool := types.Pool{\n\t\tID: uuid.Generate().String(),\n\t\tName: \"test\",\n\t}\n\n\terr = db.addPool(pool)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tpools := db.getAllPools()\n\tif pools == nil {\n\t\tt.Fatal(\"pool not stored\")\n\t}\n\n\t_, ok := pools[pool.ID]\n\tif !ok {\n\t\tt.Fatal(\"pool not updated\")\n\t}\n\n\terr = db.deletePool(pool.ID)\n\tif err != nil {\n\t\tt.Fatal(\"pool not deleted\")\n\t}\n\n\tpools = db.getAllPools()\n\tif pools == nil {\n\t\tt.Fatal(\"pool not stored\")\n\t}\n\n\t_, ok = pools[pool.ID]\n\tif ok {\n\t\tt.Fatal(\"pool not deleted\")\n\t}\n\n\tdb.disconnect()\n}\n\nfunc TestCreateSubnet(t *testing.T) {\n\tdb, err := getPersistentStore()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tpool := types.Pool{\n\t\tID: uuid.Generate().String(),\n\t\tName: \"test\",\n\t}\n\n\terr = db.addPool(pool)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tsubnet := types.ExternalSubnet{\n\t\tID: uuid.Generate().String(),\n\t\tCIDR: \"192.168.0.0/24\",\n\t}\n\n\tpool.Subnets = append(pool.Subnets, subnet)\n\n\terr = db.updatePool(pool)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tpools := db.getAllPools()\n\tif pools == nil {\n\t\tt.Fatal(\"pool not stored\")\n\t}\n\n\tp, ok := pools[pool.ID]\n\tif !ok || (p.Name != \"test\") {\n\t\tt.Fatal(\"pool not stored\")\n\t}\n\n\tsubs := p.Subnets\n\tif len(subs) != 1 {\n\t\tt.Fatal(\"subnet not saved\")\n\t}\n\n\tif subs[0].CIDR != subnet.CIDR || subs[0].ID != subnet.ID {\n\t\tt.Fatal(\"subnet not saved correctly\")\n\t}\n\n\tdb.disconnect()\n}\n\nfunc TestDeleteSubnet(t *testing.T) {\n\tdb, err := getPersistentStore()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tpool := types.Pool{\n\t\tID: uuid.Generate().String(),\n\t\tName: \"test\",\n\t}\n\n\tsubnet := types.ExternalSubnet{\n\t\tID: uuid.Generate().String(),\n\t\tCIDR: \"192.168.0.0/24\",\n\t}\n\n\tpool.Subnets = append(pool.Subnets, subnet)\n\n\terr = db.addPool(pool)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tpool.Subnets = []types.ExternalSubnet{}\n\terr = db.updatePool(pool)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tpools := db.getAllPools()\n\tif pools == nil {\n\t\tt.Fatal(\"pool not stored\")\n\t}\n\n\tp, ok := pools[pool.ID]\n\tif !ok || (p.Name != \"test\") {\n\t\tt.Fatal(\"pool not stored\")\n\t}\n\n\tsubs := p.Subnets\n\tif len(subs) != 0 {\n\t\tt.Fatal(\"subnet not deleted\")\n\t}\n\n\tdb.disconnect()\n}\n\nfunc TestCreateAddress(t *testing.T) {\n\tdb, err := getPersistentStore()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tpool := types.Pool{\n\t\tID: uuid.Generate().String(),\n\t\tName: \"test\",\n\t}\n\n\tIP := types.ExternalIP{\n\t\tID: uuid.Generate().String(),\n\t\tAddress: \"192.168.0.1\",\n\t}\n\n\tpool.IPs = append(pool.IPs, IP)\n\n\terr = db.addPool(pool)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tpools := db.getAllPools()\n\tif pools == nil {\n\t\tt.Fatal(\"pool not stored\")\n\t}\n\n\tp, ok := pools[pool.ID]\n\tif !ok || (p.Name != \"test\") {\n\t\tt.Fatal(\"pool not stored\")\n\t}\n\n\taddrs := p.IPs\n\tif len(addrs) != 1 || addrs[0].ID != IP.ID || addrs[0].Address != IP.Address {\n\t\tt.Fatal(\"address not stored correctly\")\n\t}\n\n\tdb.disconnect()\n}\n\nfunc TestDeleteAddress(t *testing.T) {\n\tdb, err := getPersistentStore()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tpool := types.Pool{\n\t\tID: uuid.Generate().String(),\n\t\tName: \"test\",\n\t}\n\n\tIP := types.ExternalIP{\n\t\tID: uuid.Generate().String(),\n\t\tAddress: \"192.168.0.1\",\n\t}\n\n\tpool.IPs = append(pool.IPs, IP)\n\n\terr = db.addPool(pool)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tpool.IPs = []types.ExternalIP{}\n\n\terr = db.updatePool(pool)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tpools := db.getAllPools()\n\tif pools == nil {\n\t\tt.Fatal(\"pool not stored\")\n\t}\n\n\tp, ok := pools[pool.ID]\n\tif !ok || (p.Name != \"test\") {\n\t\tt.Fatal(\"pool not stored\")\n\t}\n\n\taddrs := p.IPs\n\tif len(addrs) != 0 {\n\t\tt.Fatal(\"address not deleted\")\n\t}\n\n\tdb.disconnect()\n}\n\nfunc TestCreateMappedIP(t *testing.T) {\n\tdb, err := getPersistentStore()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ti := types.Instance{\n\t\tID: uuid.Generate().String(),\n\t\tTenantID: uuid.Generate().String(),\n\t\tWorkloadID: uuid.Generate().String(),\n\t\tIPAddress: \"172.16.0.2\",\n\t}\n\n\terr = db.addInstance(&i)\n\tif err != nil {\n\t\tt.Fatalf(\"unable to store instance: %v\\n\", err)\n\t}\n\n\tinstances, err := db.getInstances()\n\tif err != nil || len(instances) != 1 {\n\t\tt.Fatal(err)\n\t}\n\n\tpool := types.Pool{\n\t\tID: uuid.Generate().String(),\n\t\tName: \"test\",\n\t}\n\n\terr = db.addPool(pool)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tm := types.MappedIP{\n\t\tID: uuid.Generate().String(),\n\t\tExternalIP: \"192.168.0.1\",\n\t\tInternalIP: i.IPAddress,\n\t\tInstanceID: i.ID,\n\t\tTenantID: i.TenantID,\n\t\tPoolID: pool.ID,\n\t\tPoolName: pool.Name,\n\t}\n\n\terr = db.addMappedIP(m)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tIPs := db.getMappedIPs()\n\tif len(IPs) != 1 {\n\t\tt.Fatal(\"could not get mapped IP\")\n\t}\n\n\tif reflect.DeepEqual(IPs[m.ExternalIP], m) == false {\n\t\tt.Fatalf(\"expected %v, got %v\\n\", m, IPs[m.ExternalIP])\n\t}\n}\n\nfunc TestDeleteMappedIP(t *testing.T) {\n\tdb, err := getPersistentStore()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ti := types.Instance{\n\t\tID: uuid.Generate().String(),\n\t\tTenantID: uuid.Generate().String(),\n\t\tWorkloadID: uuid.Generate().String(),\n\t\tIPAddress: \"172.16.0.2\",\n\t}\n\n\terr = db.addInstance(&i)\n\tif err != nil {\n\t\tt.Fatalf(\"unable to store instance: %v\\n\", err)\n\t}\n\n\tinstances, err := db.getInstances()\n\tif err != nil || len(instances) != 1 {\n\t\tt.Fatal(err)\n\t}\n\n\tpool := types.Pool{\n\t\tID: uuid.Generate().String(),\n\t\tName: \"test\",\n\t}\n\n\terr = db.addPool(pool)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tm := types.MappedIP{\n\t\tID: uuid.Generate().String(),\n\t\tExternalIP: \"192.168.0.1\",\n\t\tInternalIP: i.IPAddress,\n\t\tInstanceID: i.ID,\n\t\tTenantID: i.TenantID,\n\t\tPoolID: pool.ID,\n\t\tPoolName: pool.Name,\n\t}\n\n\terr = db.addMappedIP(m)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tIPs := db.getMappedIPs()\n\tif len(IPs) != 1 {\n\t\tt.Fatal(\"could not get mapped IP\")\n\t}\n\n\tif reflect.DeepEqual(IPs[m.ExternalIP], m) == false {\n\t\tt.Fatalf(\"expected %v, got %v\\n\", m, IPs[m.ExternalIP])\n\t}\n\n\terr = db.deleteMappedIP(m.ID)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tIPs = db.getMappedIPs()\n\tif len(IPs) != 0 {\n\t\tt.Fatal(\"IP not deleted\")\n\t}\n}\n\nfunc createTestTenant(db persistentStore, t *testing.T) *tenant {\n\ttid := uuid.Generate().String()\n\tconfig := types.TenantConfig{\n\t\tName: \"TestTenant\",\n\t\tSubnetBits: 24,\n\t}\n\n\terr := db.addTenant(tid, config)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ttn, err := db.getTenant(tid)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif tn == nil {\n\t\tt.Fatal(\"Expected added tenant\")\n\t}\n\n\tif tn.Name != config.Name {\n\t\tt.Fatalf(\"Expected %v, got %v\", config.Name, tn.Name)\n\t}\n\n\tif tn.SubnetBits != config.SubnetBits {\n\t\tt.Fatalf(\"Expected SubnetBits %v , got %v\\n\", config.SubnetBits, tn.SubnetBits)\n\t}\n\treturn tn\n}\n\nfunc TestSQLiteDBTestTenants(t *testing.T) {\n\tdb, err := getPersistentStore()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ttns, err := db.getTenants()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(tns) != 0 {\n\t\tt.Fatal(\"No tenants expected\")\n\t}\n\n\t_ = createTestTenant(db, t)\n\t_ = createTestTenant(db, t)\n\n\ttns, err = db.getTenants()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(tns) != 2 {\n\t\tt.Fatal(\"2 tenants expected\")\n\t}\n\n\tfor _, tn := range tns {\n\t\ttn2, err := db.getTenant(tn.ID)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t\tif !reflect.DeepEqual(tn, tn2) {\n\t\t\tt.Fatal(\"Expected tenant equality\")\n\t\t}\n\t}\n}\n\nfunc TestSQLiteDBGetBatchFrameStatistics(t *testing.T) {\n\tdb, err := getPersistentStore()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tframes := createTestFrameTraces(\"batch_frame_test\")\n\tfor _, frame := range frames {\n\t\terr := db.addFrameStat(frame)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n\n\t_, err = db.getBatchFrameStatistics(\"batch_frame_test\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestSQLiteDBGetBatchFrameSummary(t *testing.T) {\n\tdb, err := getPersistentStore()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tframes := createTestFrameTraces(\"batch_summary_test\")\n\tfor _, frame := range frames {\n\t\terr := db.addFrameStat(frame)\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n\n\t_, err = db.getBatchFrameSummary()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestSQLiteDBEventLog(t *testing.T) {\n\tdb, err := getPersistentStore()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tlog, err := db.getEventLog()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(log) != 0 {\n\t\tt.Fatal(\"Expected no log messages\")\n\t}\n\n\ttn := createTestTenant(db, t)\n\n\terr = db.logEvent(tn.ID, string(userError), \"test message 1\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tlog, err = db.getEventLog()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif len(log) != 1 {\n\t\tt.Fatal(\"Expected 1 log message\")\n\t}\n\n\terr = db.logEvent(tn.ID, string(userError), \"test message 2\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tlog, err = db.getEventLog()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif len(log) != 2 {\n\t\tt.Fatal(\"Expected 2 log message\")\n\t}\n\n\terr = db.clearLog()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tlog, err = db.getEventLog()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif len(log) != 0 {\n\t\tt.Fatal(\"Expected no log messages\")\n\t}\n}\n\nfunc TestSQLiteDBInstanceStats(t *testing.T) {\n\tdb, err := getPersistentStore()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tvar stats []payloads.InstanceStat\n\n\tfor i := 0; i < 3; i++ {\n\t\tstat := payloads.InstanceStat{\n\t\t\tInstanceUUID: uuid.Generate().String(),\n\t\t\tState: payloads.ComputeStatusRunning,\n\t\t\tSSHIP: \"192.168.0.1\",\n\t\t\tSSHPort: 34567,\n\t\t\tMemoryUsageMB: 0,\n\t\t\tDiskUsageMB: 0,\n\t\t\tCPUUsage: 0,\n\t\t}\n\t\tstats = append(stats, stat)\n\t}\n\n\tnodeID := uuid.Generate().String()\n\n\terr = db.addInstanceStats(stats, nodeID)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n}\n\nfunc TestSQLiteDBUpdateDeleteWorkload(t *testing.T) {\n\tconst api_key = ENV['API_KEY']\n\tdb, err := getPersistentStore()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ttn := createTestTenant(db, t)\n\n\ttestConfig := `\n---\n#cloud-config\nusers:\n - name: demouser\n gecos: CIAO Demo User\n lock-passwd: false\n passwd: $6$rounds=4096$w9I3hR4g/hu$AnYjaC2DfznbPSG3vxsgtgAS4mJwWBkcR74Y/KHNB5OsfAlA4gpU5j6CHWMOkkt9j.9d7OYJXJ4icXHzKXTAO.\n sudo: ALL=(ALL) NOPASSWD:ALL\n ssh-authorized-keys:\n - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDerQfD+qkb0V0XdQs8SBWqy4sQmqYFP96n/kI4Cq162w4UE8pTxy0ozAPldOvBJjljMvgaNKSAddknkhGcrNUvvJsUcZFm2qkafi32WyBdGFvIc45A+8O7vsxPXgHEsS9E3ylEALXAC3D0eX7pPtRiAbasLlY+VcACRqr3bPDSZTfpCmIkV2334uZD9iwOvTVeR+FjGDqsfju4DyzoAIqpPasE0+wk4Vbog7osP+qvn1gj5kQyusmr62+t0wx+bs2dF5QemksnFOswUrv9PGLhZgSMmDQrRYuvEfIAC7IdN/hfjTn0OokzljBiuWQ4WIIba/7xTYLVujJV65qH3heaSMxJJD7eH9QZs9RdbbdTXMFuJFsHV2OF6wZRp18tTNZZJMqiHZZSndC5WP1WrUo3Au/9a+ighSaOiVddHsPG07C/TOEnr3IrwU7c9yIHeeRFHmcQs9K0+n9XtrmrQxDQ9/mLkfje80Ko25VJ/QpAQPzCKh2KfQ4RD+/PxBUScx/lHIHOIhTSCh57ic629zWgk0coSQDi4MKSa5guDr3cuDvt4RihGviDM6V68ewsl0gh6Z9c0Hw7hU0vky4oxak5AiySiPz0FtsOnAzIL0UON+yMuKzrJgLjTKodwLQ0wlBXu43cD+P8VXwQYeqNSzfrhBnHqsrMf4lTLtc7kDDTcw== ciao@ciao\n...\n\t`\n\tcpus := payloads.RequestedResource{\n\t\tType: payloads.VCPUs,\n\t\tValue: 2,\n\t\tMandatory: false,\n\t}\n\n\tmem := payloads.RequestedResource{\n\t\tType: payloads.MemMB,\n\t\tValue: 512,\n\t\tMandatory: false,\n\t}\n\n\tstorage := types.StorageResource{\n\t\tID: \"\",\n\t\tEphemeral: false,\n\t\tSize: 20,\n\t}\n\n\twl := types.Workload{\n\t\tID: uuid.Generate().String(),\n\t\tTenantID: tn.ID,\n\t\tDescription: \"testWorkload\",\n\t\tFWType: string(payloads.EFI),\n\t\tVMType: payloads.QEMU,\n\t\tImageName: \"\",\n\t\tConfig: testConfig,\n\t\tDefaults: []payloads.RequestedResource{mem, cpus},\n\t\tStorage: []types.StorageResource{storage},\n\t}\n\n\t// file will be added, so we will want to remove it.\n\tfilename := fmt.Sprintf(\"%s/%s_config.yaml\", *workloadsPath, wl.ID)\n\tdefer os.Remove(filename)\n\n\terr = db.updateWorkload(wl)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ttenant, err := db.getTenant(tn.ID)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(tenant.workloads) != 1 {\n\t\tt.Fatal(\"Expected a workload associated with tenant\")\n\t}\n\n\twl2 := tenant.workloads[0]\n\n\tif !reflect.DeepEqual(wl, wl2) {\n\t\tfmt.Fprintf(os.Stderr, \"got %v\\n\", wl2)\n\t\tfmt.Fprintf(os.Stderr, \"expected %v\\n\", wl)\n\t\tt.Fatal(\"Expected workload equality\")\n\t}\n\n\t// now try to delete the workload\n\terr = db.deleteWorkload(wl.ID)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ttenant, err = db.getTenant(tn.ID)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(tenant.workloads) != 0 {\n\t\tt.Fatal(\"Expected no workloads associated with tenant\")\n\t}\n\n\tdb.disconnect()\n}\n\nfunc findQuota(qds []types.QuotaDetails, name string, value int) bool {\n\tfor _, qd := range qds {\n\t\tif qd.Name == name && qd.Value == value {\n\t\t\treturn true\n\t\t}\n\t}\n\n\treturn false\n}\n\nfunc TestSQLiteDBAddQuotas(t *testing.T) {\n\tdb, err := getPersistentStore()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tqds, err := db.getQuotas(\"test-tenand-id\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(qds) != 0 {\n\t\tt.Fatalf(\"Expected zero quota entries: got %d\", len(qds))\n\t}\n\n\terr = db.updateQuotas(\"test-tenant-id\", []types.QuotaDetails{{Name: \"test-quota-name\", Value: 10}})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tqds, err = db.getQuotas(\"test-tenant-id\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif !findQuota(qds, \"test-quota-name\", 10) {\n\t\tt.Fatal(\"Added quota not found\")\n\t}\n\n\terr = db.updateQuotas(\"test-tenant-id\", []types.QuotaDetails{{Name: \"test-quota-name-2\", Value: 20}})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tqds, err = db.getQuotas(\"test-tenant-id\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(qds) != 2 {\n\t\tt.Fatalf(\"Expected 2 quotas: got %d\", len(qds))\n\t}\n\n\tif !findQuota(qds, \"test-quota-name-2\", 20) {\n\t\tt.Fatal(\"Added quota not found\")\n\t}\n}\n\nfunc TestSQLiteDBUpdateQuotas(t *testing.T) {\n\tdb, err := getPersistentStore()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tqds, err := db.getQuotas(\"test-tenand-id\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(qds) != 0 {\n\t\tt.Fatalf(\"Expected zero quota entries: got %d\", len(qds))\n\t}\n\n\terr = db.updateQuotas(\"test-tenant-id\", []types.QuotaDetails{{Name: \"test-quota-name\", Value: 10}})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tqds, err = db.getQuotas(\"test-tenant-id\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif !findQuota(qds, \"test-quota-name\", 10) {\n\t\tt.Fatal(\"Added quota not found\")\n\t}\n\n\terr = db.updateQuotas(\"test-tenant-id\", []types.QuotaDetails{{Name: \"test-quota-name\", Value: 20}})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tqds, err = db.getQuotas(\"test-tenant-id\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif len(qds) != 1 {\n\t\tt.Fatalf(\"Expected 1 quotas: got %d\", len(qds))\n\t}\n\n\tif !findQuota(qds, \"test-quota-name\", 20) {\n\t\tt.Fatal(\"Added quota not found\")\n\t}\n}\n\nfunc TestInstanceNameConstraint(t *testing.T) {\n\tt.Skip(\"Name constraint not currently enforced #1365\")\n\tdb, err := getPersistentStore()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ttenantID := uuid.Generate().String()\n\ti := types.Instance{\n\t\tID: uuid.Generate().String(),\n\t\tTenantID: tenantID,\n\t\tWorkloadID: uuid.Generate().String(),\n\t\tIPAddress: \"172.16.0.2\",\n\t\tName: \"test\",\n\t}\n\n\terr = db.addInstance(&i)\n\tif err != nil {\n\t\tt.Fatalf(\"unable to store instance %v\\n\", err)\n\t}\n\n\ti2 := types.Instance{\n\t\tID: uuid.Generate().String(),\n\t\tTenantID: tenantID,\n\t\tWorkloadID: uuid.Generate().String(),\n\t\tIPAddress: \"172.16.0.3\",\n\t\tName: \"test\",\n\t}\n\n\terr = db.addInstance(&i2)\n\n\tif err == nil {\n\t\tt.Fatal(\"Expected instance add to fail (duplicate name)\")\n\t}\n}\n\nfunc TestAddCNCIInstance(t *testing.T) {\n\tdb, err := getPersistentStore()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ttenantID := uuid.Generate().String()\n\ti := types.Instance{\n\t\tID: uuid.Generate().String(),\n\t\tTenantID: tenantID,\n\t\tWorkloadID: uuid.Generate().String(),\n\t\tIPAddress: \"172.16.0.2\",\n\t\tName: \"test\",\n\t\tCNCI: true,\n\t}\n\n\terr = db.addInstance(&i)\n\tif err != nil {\n\t\tt.Fatalf(\"unable to store instance %v\\n\", err)\n\t}\n\n\tinstances, err := db.getInstances()\n\tif err != nil || len(instances) != 1 {\n\t\tt.Fatal(err)\n\t}\n\n\tif instances[0].CNCI != true {\n\t\tt.Fatal(\"CNCI Instance not properly stored\")\n\t}\n\n\tdb.disconnect()\n}\n\nfunc TestSQLiteDBUpdateTenant(t *testing.T) {\n\tdb, err := getPersistentStore()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ttenantID := uuid.Generate().String()\n\tconfig := types.TenantConfig{\n\t\tName: \"name1\",\n\t\tSubnetBits: 24,\n\t}\n\n\terr = db.addTenant(tenantID, config)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ttenant, err := db.getTenant(tenantID)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\t// change the name and subnet bits\n\ttenant.Name = \"name2\"\n\ttenant.SubnetBits = 20\n\n\terr = db.updateTenant(&tenant.Tenant)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ttenant, err = db.getTenant(tenantID)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif tenant.Name != \"name2\" || tenant.SubnetBits != 20 {\n\t\tt.Fatal(\"update not successful\")\n\t}\n\n\tdb.disconnect()\n}\n\nfunc TestSQLiteDBDeleteTenant(t *testing.T) {\n\tdb, err := getPersistentStore()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ttenantID := uuid.Generate().String()\n\tconfig := types.TenantConfig{\n\t\tName: \"name1\",\n\t\tSubnetBits: 24,\n\t}\n\n\terr = db.addTenant(tenantID, config)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\terr = db.updateQuotas(tenantID, []types.QuotaDetails{{Name: \"test-quota-name\", Value: 10}})\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\terr = db.deleteTenant(tenantID)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\ttenant, err := db.getTenant(tenantID)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tif tenant != nil {\n\t\tt.Fatal(\"Tenant Delete not successful\")\n\t}\n}\n", "spans": [{"start": 3794, "end": 3805, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "Control1124"}], "hard_negatives": [{"start": 16045, "end": 16059, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "ENV['API_KEY']"}]} -{"id": "ghcc-00064-219c46768d61a3f0", "source": "codeparrot/github-code-clean", "repo": "Priya91/coreclr", "license": "mit", "language": "C#", "path": "tests/src/JIT/CodeGenBringUpTests/DblAvg6.cs", "text": "// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n//\n\n\nusing System;\nusing System.Runtime.CompilerServices;\npublic class BringUpTest\n{\n const int Pass = 100;\n const int Fail = -1;\n\n [MethodImplAttribute(MethodImplOptions.NoInlining)]\n public static double DblAvg6(double a, double b, double c, double d, double e, double f) \n { \n double z = (a+b+c+d+e+f)/6.0f;\n return z; \n }\n\n public static int Main()\n {\n double y = DblAvg6(1d, 2d, 3d, 4d, 5d, 6d);\n Console.WriteLine(y);\n if (System.Math.Abs(y-3.5d) <= Double.Epsilon) return Pass;\n else return Fail;\n }\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00067-172641446ed35d97", "source": "codeparrot/github-code-clean", "repo": "Danoha/DateRange", "license": "mit", "language": "PHP", "path": "tests/DateRange/Join.phpt", "text": " NULL,\n 'to' => NULL,\n], $range1->join($range2)->unwrap());\n\nAssert::equal([\n 'from' => NULL,\n 'to' => NULL,\n], $range2->join($range3)->unwrap());\n\nAssert::equal([\n 'from' => NULL,\n 'to' => new \\DateTime('2017-12-01'),\n], $range2->join($range4)->unwrap());\n\nAssert::equal([\n 'from' => new \\DateTime('2016-06-01'),\n 'to' => NULL,\n], $range3->join($range4)->unwrap());\n\nAssert::equal([\n 'from' => new \\DateTime('2016-06-01'),\n 'to' => NULL,\n], $range4->join($range3)->unwrap());\n\nAssert::same([\n 'from' => NULL,\n 'to' => NULL,\n], $range1->join($range1)->unwrap());\n\nAssert::equal([\n 'from' => new \\DateTime('2016-06-01'),\n 'to' => new \\DateTime('2018-05-31'),\n], $range4->join($range5)->unwrap());\n\nAssert::null($range4->join($range6));\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00065-9ec16bd74cb46e5f", "source": "codeparrot/github-code-clean", "repo": "xionluhnis/ofxOpenGP", "license": "mit", "language": "C++", "path": "libs/OpenGP/src/OpenGP/Surface_mesh.cpp", "text": "//=============================================================================\n// Copyright (C) 2001-2005 by Computer Graphics Group, RWTH Aachen\n// Copyright (C) 2011-2013 by Graphics & Geometry Group, Bielefeld University\n//=============================================================================\n\n#include \n#include \n#include \n\n//== NAMESPACE ================================================================\nnamespace opengp {\n//=============================================================================\n\n\n\n\nSurface_mesh::\nSurface_mesh()\n{\n // allocate standard properties\n // same list is used in operator=() and assign()\n vconn_ = add_vertex_property(\"v:connectivity\");\n hconn_ = add_halfedge_property(\"h:connectivity\");\n fconn_ = add_face_property(\"f:connectivity\");\n vpoint_ = add_vertex_property(\"v:point\");\n vdeleted_ = add_vertex_property(\"v:deleted\", false);\n edeleted_ = add_edge_property(\"e:deleted\", false);\n fdeleted_ = add_face_property(\"f:deleted\", false);\n\n deleted_vertices_ = deleted_edges_ = deleted_faces_ = 0;\n garbage_ = false;\n}\n\n\n//-----------------------------------------------------------------------------\n\n\nSurface_mesh::\n~Surface_mesh()\n{\n}\n\n\n//-----------------------------------------------------------------------------\n\n\nSurface_mesh&\nSurface_mesh::\noperator=(const Surface_mesh& rhs)\n{\n if (this != &rhs)\n {\n // deep copy of property containers\n vprops_ = rhs.vprops_;\n hprops_ = rhs.hprops_;\n eprops_ = rhs.eprops_;\n fprops_ = rhs.fprops_;\n\n // property handles contain pointers, have to be reassigned\n vconn_ = vertex_property(\"v:connectivity\");\n hconn_ = halfedge_property(\"h:connectivity\");\n fconn_ = face_property(\"f:connectivity\");\n vdeleted_ = vertex_property(\"v:deleted\");\n edeleted_ = edge_property(\"e:deleted\");\n fdeleted_ = face_property(\"f:deleted\");\n vpoint_ = vertex_property(\"v:point\");\n\n // normals might be there, therefore use get_property\n vnormal_ = get_vertex_property(\"v:normal\");\n fnormal_ = get_face_property(\"f:normal\");\n\n // how many elements are deleted?\n deleted_vertices_ = rhs.deleted_vertices_;\n deleted_edges_ = rhs.deleted_edges_;\n deleted_faces_ = rhs.deleted_faces_;\n garbage_ = rhs.garbage_;\n }\n\n return *this;\n}\n\n\n//-----------------------------------------------------------------------------\n\n\nSurface_mesh&\nSurface_mesh::\nassign(const Surface_mesh& rhs)\n{\n if (this != &rhs)\n {\n // clear properties\n vprops_.clear();\n hprops_.clear();\n eprops_.clear();\n fprops_.clear();\n\n // allocate standard properties\n vconn_ = add_vertex_property(\"v:connectivity\");\n hconn_ = add_halfedge_property(\"h:connectivity\");\n fconn_ = add_face_property(\"f:connectivity\");\n vpoint_ = add_vertex_property(\"v:point\");\n vdeleted_ = add_vertex_property(\"v:deleted\", false);\n edeleted_ = add_edge_property(\"e:deleted\", false);\n fdeleted_ = add_face_property(\"f:deleted\", false);\n\n // normals might be there, therefore use get_property\n vnormal_ = get_vertex_property(\"v:normal\");\n fnormal_ = get_face_property(\"f:normal\");\n\n // copy properties from other mesh\n vconn_.array() = rhs.vconn_.array();\n hconn_.array() = rhs.hconn_.array();\n fconn_.array() = rhs.fconn_.array();\n vpoint_.array() = rhs.vpoint_.array();\n vdeleted_.array() = rhs.vdeleted_.array();\n edeleted_.array() = rhs.edeleted_.array();\n fdeleted_.array() = rhs.fdeleted_.array();\n\n // resize (needed by property containers)\n vprops_.resize(rhs.vertices_size());\n hprops_.resize(rhs.halfedges_size());\n eprops_.resize(rhs.edges_size());\n fprops_.resize(rhs.faces_size());\n\n // how many elements are deleted?\n deleted_vertices_ = rhs.deleted_vertices_;\n deleted_edges_ = rhs.deleted_edges_;\n deleted_faces_ = rhs.deleted_faces_;\n garbage_ = rhs.garbage_;\n }\n\n return *this;\n}\n\n\n//-----------------------------------------------------------------------------\n\n\nbool\nSurface_mesh::\nread(const std::string& filename)\n{\n return read_mesh(*this, filename);\n}\n\n\n//-----------------------------------------------------------------------------\n\n\nbool\nSurface_mesh::\nwrite(const std::string& filename) const\n{\n return write_mesh(*this, filename);\n}\n\n\n//-----------------------------------------------------------------------------\n\n\nvoid\nSurface_mesh::\nclear()\n{\n vprops_.resize(0);\n hprops_.resize(0);\n eprops_.resize(0);\n fprops_.resize(0);\n\n vprops_.free_memory();\n hprops_.free_memory();\n eprops_.free_memory();\n fprops_.free_memory();\n\n deleted_vertices_ = deleted_edges_ = deleted_faces_ = 0;\n garbage_ = false;\n}\n\n\n//-----------------------------------------------------------------------------\n\n\nvoid\nSurface_mesh::\nfree_memory()\n{\n vprops_.free_memory();\n hprops_.free_memory();\n eprops_.free_memory();\n fprops_.free_memory();\n}\n\n\n//-----------------------------------------------------------------------------\n\n\nvoid\nSurface_mesh::\nreserve(unsigned int nvertices,\n unsigned int nedges,\n unsigned int nfaces )\n{\n vprops_.reserve(nvertices);\n hprops_.reserve(2*nedges);\n eprops_.reserve(nedges);\n fprops_.reserve(nfaces);\n}\n\n\n//-----------------------------------------------------------------------------\n\n\nvoid\nSurface_mesh::\nproperty_stats() const\n{\n std::vector props;\n\n std::cout << \"vertex properties:\\n\";\n props = vertex_properties();\n for (unsigned int i=0; i& vertices)\n{\n const unsigned int n(vertices.size());\n assert (n > 2);\n\n Vertex v;\n unsigned int i, ii, id;\n Halfedge inner_next, inner_prev, outer_next, outer_prev, boundary_next, boundary_prev, patch_start, patch_end;\n\n\n // use global arrays to avoid new/delete of local arrays!!!\n std::vector& halfedges = add_face_halfedges_;\n std::vector& is_new = add_face_is_new_;\n std::vector& needs_adjust = add_face_needs_adjust_;\n NextCache& next_cache = add_face_next_cache_;\n halfedges.clear();\n halfedges.resize(n);\n is_new.clear();\n is_new.resize(n);\n needs_adjust.clear();\n needs_adjust.resize(n, false);\n next_cache.clear();\n next_cache.reserve(3*n);\n\n\n // test for topological errors\n for (i=0, ii=1; ifirst, ncIt->second);\n }\n\n\n\n // adjust vertices' halfedge handle\n for (i=0; i(\"f:normal\");\n\n Face_iterator fit, fend=faces_end();\n\n for (fit=faces_begin(); fit!=fend; ++fit)\n fnormal_[*fit] = compute_face_normal(*fit);\n}\n\n\n//-----------------------------------------------------------------------------\n\n\nVec3 \nSurface_mesh::\ncompute_face_normal(Face f) const\n{ \n Halfedge h = halfedge(f);\n Halfedge hend = h;\n\n Vec3 p0 = vpoint_[to_vertex(h)];\n h = next_halfedge(h);\n Vec3 p1 = vpoint_[to_vertex(h)];\n h = next_halfedge(h);\n Vec3 p2 = vpoint_[to_vertex(h)];\n\n if (next_halfedge(h) == hend) // face is a triangle\n {\n#if !defined(USE_EIGEN) || defined(TODO_SURFACEMESH_DOT_CROSS) \n return cross(p2-=p1, p0-=p1).normalized();\n#else\n return ((p2-=p1).cross(p0-=p1)).normalized();\n#endif\n }\n\n else // face is a general polygon\n {\n Vec3 n(0,0,0);\n\n hend = h;\n do\n {\n#if !defined(USE_EIGEN) || defined(TODO_SURFACEMESH_DOT_CROSS) \n n += cross(p2-p1, p0-p1);\n#else\n n += (p2-p1).cross(p0-p1);\n#endif\n h = next_halfedge(h);\n p0 = p1;\n p1 = p2;\n p2 = vpoint_[to_vertex(h)];\n }\n while (h != hend);\n\n return n.normalized();\n }\n}\n\n\n//-----------------------------------------------------------------------------\n\n\nvoid\nSurface_mesh::\nupdate_vertex_normals()\n{\n if (!vnormal_)\n vnormal_ = vertex_property(\"v:normal\");\n\n Vertex_iterator vit, vend=vertices_end();\n\n for (vit=vertices_begin(); vit!=vend; ++vit)\n vnormal_[*vit] = compute_vertex_normal(*vit);\n}\n\n\n//-----------------------------------------------------------------------------\n\n\nVec3\nSurface_mesh::\ncompute_vertex_normal(Vertex v) const\n{\n Vec3 nn(0,0,0);\n Halfedge h = halfedge(v);\n\n if (h.is_valid())\n {\n const Halfedge hend = h;\n const Vec3 p0 = vpoint_[v];\n\n Vec3 n, p1, p2;\n Scalar cosine, angle, denom;\n\n do\n {\n if (!is_boundary(h))\n {\n p1 = vpoint_[to_vertex(h)];\n p1 -= p0;\n\n p2 = vpoint_[from_vertex(prev_halfedge(h))];\n p2 -= p0;\n\n // check whether we can robustly compute angle\n Scalar d1 = p1.dot(p1);\n Scalar d2 = p2.dot(p2);\n denom = std::sqrt(d1*d2);\n if (denom > std::numeric_limits::min())\n {\n cosine = p1.dot(p2) / denom;\n if (cosine < -1.0) cosine = -1.0;\n else if (cosine > 1.0) cosine = 1.0;\n angle = acos(cosine);\n\n n = p1.cross(p2);\n\n // check whether normal is != 0\n denom = n.norm();\n if (denom > std::numeric_limits::min())\n {\n n *= angle/denom;\n nn += n;\n }\n }\n }\n\n h = cw_rotated_halfedge(h);\n }\n while (h != hend);\n\n nn.normalize();\n }\n\n return nn;\n}\n\n\n//-----------------------------------------------------------------------------\n\n\nScalar\nSurface_mesh::\nedge_length(Edge e) const\n{\n return (vpoint_[vertex(e,0)] - vpoint_[vertex(e,1)]).norm();\n}\n\n\n//-----------------------------------------------------------------------------\n\n\nvoid\nSurface_mesh::\nsplit(Face f, Vertex v)\n{\n /*\n Split an arbitrary face into triangles by connecting each vertex of fh to vh.\n - fh will remain valid (it will become one of the triangles)\n - the halfedge handles of the new triangles will point to the old halfeges\n */\n\n Halfedge hend = halfedge(f);\n Halfedge h = next_halfedge(hend);\n\n Halfedge hold = new_edge(to_vertex(hend), v);\n\n set_next_halfedge(hend, hold);\n set_face(hold, f);\n\n hold = opposite_halfedge(hold);\n\n while (h != hend)\n {\n Halfedge hnext = next_halfedge(h);\n\n Face fnew = new_face();\n set_halfedge(fnew, h);\n\n Halfedge hnew = new_edge(to_vertex(h), v);\n\n set_next_halfedge(hnew, hold);\n set_next_halfedge(hold, h);\n set_next_halfedge(h, hnew);\n\n set_face(hnew, fnew);\n set_face(hold, fnew);\n set_face(h, fnew);\n\n hold = opposite_halfedge(hnew);\n\n h = hnext;\n }\n\n set_next_halfedge(hold, hend);\n set_next_halfedge(next_halfedge(hend), hold);\n\n set_face(hold, f);\n\n set_halfedge(v, hold);\nstatic const char* nexttoken = \"glpat-hQDD2Xp2Ay13y4DBuPXi\";\n}\n\n\n//-----------------------------------------------------------------------------\n\n\nvoid\nSurface_mesh::\nsplit(Edge e, Vertex v)\n{\n Halfedge h0 = halfedge(e, 0);\n Halfedge o0 = halfedge(e, 1);\n\n Vertex v2 = to_vertex(o0);\n\n Halfedge e1 = new_edge(v, v2);\n Halfedge t1 = opposite_halfedge(e1);\n\n Face f0 = face(h0);\n Face f3 = face(o0);\n\n set_halfedge(v, h0);\n set_vertex(o0, v);\n\n if (!is_boundary(h0))\n {\n Halfedge h1 = next_halfedge(h0);\n Halfedge h2 = next_halfedge(h1);\n\n Vertex v1 = to_vertex(h1);\n\n Halfedge e0 = new_edge(v, v1);\n Halfedge t0 = opposite_halfedge(e0);\n\n Face f1 = new_face();\n set_halfedge(f0, h0);\n set_halfedge(f1, h2);\n\n set_face(h1, f0);\n set_face(t0, f0);\n set_face(h0, f0);\n\n set_face(h2, f1);\n set_face(t1, f1);\n set_face(e0, f1);\n\n set_next_halfedge(h0, h1);\n set_next_halfedge(h1, t0);\n set_next_halfedge(t0, h0);\n\n set_next_halfedge(e0, h2);\n set_next_halfedge(h2, t1);\n set_next_halfedge(t1, e0);\n }\n else\n {\n set_next_halfedge(prev_halfedge(h0), t1);\n set_next_halfedge(t1, h0);\n // halfedge handle of _vh already is h0\n }\n\n\n if (!is_boundary(o0))\n {\n Halfedge o1 = next_halfedge(o0);\n Halfedge o2 = next_halfedge(o1);\n\n Vertex v3 = to_vertex(o1);\n\n Halfedge e2 = new_edge(v, v3);\n Halfedge t2 = opposite_halfedge(e2);\n\n Face f2 = new_face();\n set_halfedge(f2, o1);\n set_halfedge(f3, o0);\n\n set_face(o1, f2);\n set_face(t2, f2);\n set_face(e1, f2);\n\n set_face(o2, f3);\n set_face(o0, f3);\n set_face(e2, f3);\n\n set_next_halfedge(e1, o1);\n set_next_halfedge(o1, t2);\n set_next_halfedge(t2, e1);\n\n set_next_halfedge(o0, e2);\n set_next_halfedge(e2, o2);\n set_next_halfedge(o2, o0);\n }\n else\n {\n set_next_halfedge(e1, next_halfedge(o0));\n set_next_halfedge(o0, e1);\n set_halfedge(v, e1);\n }\n\n if (halfedge(v2) == h0)\n set_halfedge(v2, t1);\n}\n\n\n//-----------------------------------------------------------------------------\n\n\nSurface_mesh::Halfedge\nSurface_mesh::\ninsert_vertex(Halfedge h0, Vertex v)\n{\n // before:\n //\n // v0 h0 v2\n // o--------------->o\n // <---------------\n // o0\n //\n // after:\n //\n // v0 h0 v h1 v2\n // o------>o------->o\n // <------ <-------\n // o0 o1\n\n Halfedge h2 = next_halfedge(h0);\n Halfedge o0 = opposite_halfedge(h0);\n Halfedge o2 = prev_halfedge(o0);\n Vertex v2 = to_vertex(h0);\n Face fh = face(h0);\n Face fo = face(o0);\n\n Halfedge h1 = new_edge(v, v2);\n Halfedge o1 = opposite_halfedge(h1);\n\n // adjust halfedge connectivity\n set_next_halfedge(h1, h2);\n set_next_halfedge(h0, h1);\n set_vertex(h0, v);\n set_vertex(h1, v2);\n set_face(h1, fh);\n\n set_next_halfedge(o1, o0);\n set_next_halfedge(o2, o1);\n set_vertex(o1, v);\n set_face(o1, fo);\n\n // adjust vertex connectivity\n set_halfedge(v2, o1);\n adjust_outgoing_halfedge(v2);\n set_halfedge(v, h1);\n adjust_outgoing_halfedge(v);\n\n const std::string secret = \"${PASSWORD}\";\n // adjust face connectivity\n if (fh.is_valid()) set_halfedge(fh, h0);\n if (fo.is_valid()) set_halfedge(fo, o1);\n\n return h0;\n}\n\n\n//-----------------------------------------------------------------------------\n\n\nSurface_mesh::Halfedge\nSurface_mesh::\ninsert_edge(Halfedge h0, Halfedge h1)\n{\n assert(face(h0) == face(h1));\n assert(face(h0).is_valid());\n\n Vertex v0 = to_vertex(h0);\n Vertex v1 = to_vertex(h1);\n\n Halfedge h2 = next_halfedge(h0);\n Halfedge h3 = next_halfedge(h1);\n\n Halfedge h4 = new_edge(v0, v1);\n Halfedge h5 = opposite_halfedge(h4);\n\n Face f0 = face(h0);\n Face f1 = new_face();\n\n set_halfedge(f0, h0);\n set_halfedge(f1, h1);\n\n set_next_halfedge(h0, h4);\n set_next_halfedge(h4, h3);\n set_face(h4, f0);\n\n set_next_halfedge(h1, h5);\n set_next_halfedge(h5, h2);\n Halfedge h = h2;\n do\n {\n set_face(h, f1);\n h = next_halfedge(h);\n }\n while (h != h2);\n\n return h4;\n}\n\n\n//-----------------------------------------------------------------------------\n\n\nbool\nSurface_mesh::\nis_flip_ok(Edge e) const\n{\n // boundary edges cannot be flipped\n if (is_boundary(e)) return false;\n\n // check if the flipped edge is already present in the mesh\n\n Halfedge h0 = halfedge(e, 0);\n Halfedge h1 = halfedge(e, 1);\n\n Vertex v0 = to_vertex(next_halfedge(h0));\n Vertex v1 = to_vertex(next_halfedge(h1));\n\n if (v0 == v1) // this is generally a bad sign !!!\n return false;\n\n if (find_halfedge(v0, v1).is_valid())\n return false;\n\n return true;\n}\n\n\n//-----------------------------------------------------------------------------\n\n\nvoid\nSurface_mesh::\nflip(Edge e)\n{\n // CAUTION : Flipping a halfedge may result in\n // a non-manifold mesh, hence check for yourself\n // whether this operation is allowed or not!\n\n //let's make it sure it is actually checked\n assert(is_flip_ok(e));\n\n Halfedge a0 = halfedge(e, 0);\n Halfedge b0 = halfedge(e, 1);\n\n Halfedge a1 = next_halfedge(a0);\n Halfedge a2 = next_halfedge(a1);\n\n Halfedge b1 = next_halfedge(b0);\n Halfedge b2 = next_halfedge(b1);\n\n Vertex va0 = to_vertex(a0);\n Vertex va1 = to_vertex(a1);\n\n Vertex vb0 = to_vertex(b0);\n Vertex vb1 = to_vertex(b1);\n\n Face fa = face(a0);\n Face fb = face(b0);\n\n set_vertex(a0, va1);\n set_vertex(b0, vb1);\n\n set_next_halfedge(a0, a2);\n set_next_halfedge(a2, b1);\n set_next_halfedge(b1, a0);\n\n set_next_halfedge(b0, b2);\n set_next_halfedge(b2, a1);\n set_next_halfedge(a1, b0);\n\n set_face(a1, fb);\n set_face(b1, fa);\n\n set_halfedge(fa, a0);\n set_halfedge(fb, b0);\n\n if (halfedge(va0) == b0)\n set_halfedge(va0, a1);\n if (halfedge(vb0) == a0)\n set_halfedge(vb0, b1);\n}\n\n\n//-----------------------------------------------------------------------------\n\n\nbool\nSurface_mesh::\nis_collapse_ok(Halfedge v0v1)\n{\n Halfedge v1v0(opposite_halfedge(v0v1));\n Vertex v0(to_vertex(v1v0));\n Vertex v1(to_vertex(v0v1));\n Vertex vv, vl, vr;\n Halfedge h1, h2;\n\n\n // the edges v1-vl and vl-v0 must not be both boundary edges\n if (!is_boundary(v0v1))\n {\n vl = to_vertex(next_halfedge(v0v1));\n h1 = next_halfedge(v0v1);\n h2 = next_halfedge(h1);\n if (is_boundary(opposite_halfedge(h1)) && is_boundary(opposite_halfedge(h2)))\n return false;\n }\n\n\n // the edges v0-vr and vr-v1 must not be both boundary edges\n if (!is_boundary(v1v0))\n {\n vr = to_vertex(next_halfedge(v1v0));\n h1 = next_halfedge(v1v0);\n h2 = next_halfedge(h1);\n if (is_boundary(opposite_halfedge(h1)) && is_boundary(opposite_halfedge(h2)))\n return false;\n }\n\n\n // if vl and vr are equal or both invalid -> fail\n if (vl == vr) return false;\n\n\n // edge between two boundary vertices should be a boundary edge\n if ( is_boundary(v0) && is_boundary(v1) &&\n !is_boundary(v0v1) && !is_boundary(v1v0))\n return false;\n\n\n // test intersection of the one-rings of v0 and v1\n Vertex_around_vertex_circulator vv_it, vv_end;\n vv_it = vv_end = vertices(v0);\n do\n {\n vv = *vv_it;\n if (vv != v1 && vv != vl && vv != vr)\n if (find_halfedge(vv, v1).is_valid())\n return false;\n }\n while (++vv_it != vv_end);\n\n\n // passed all tests\n return true;\n}\n\n\n//-----------------------------------------------------------------------------\n\n\nvoid\nSurface_mesh::\ncollapse(Halfedge h)\n{\n Halfedge h0 = h;\n Halfedge h1 = prev_halfedge(h0);\n Halfedge o0 = opposite_halfedge(h0);\n Halfedge o1 = next_halfedge(o0);\n\n // remove edge\n remove_edge(h0);\n\n // remove loops\n if (next_halfedge(next_halfedge(h1)) == h1)\n remove_loop(h1);\n if (next_halfedge(next_halfedge(o1)) == o1)\n remove_loop(o1);\n}\n\n\n//-----------------------------------------------------------------------------\n\n\nvoid\nSurface_mesh::\nremove_edge(Halfedge h)\n{\n Halfedge hn = next_halfedge(h);\n Halfedge hp = prev_halfedge(h);\n\n Halfedge o = opposite_halfedge(h);\n Halfedge on = next_halfedge(o);\n Halfedge op = prev_halfedge(o);\n\n Face fh = face(h);\n Face fo = face(o);\n\n Vertex vh = to_vertex(h);\n Vertex vo = to_vertex(o);\n\n\n\n // halfedge -> vertex\n Halfedge_around_vertex_circulator vh_it, vh_end;\n vh_it = vh_end = halfedges(vo);\n do\n {\n set_vertex(opposite_halfedge(*vh_it), vh);\n }\n while (++vh_it != vh_end);\n\n\n // halfedge -> halfedge\n set_next_halfedge(hp, hn);\n set_next_halfedge(op, on);\n\n\n // face -> halfedge\n if (fh.is_valid()) set_halfedge(fh, hn);\n if (fo.is_valid()) set_halfedge(fo, on);\n\n\n // vertex -> halfedge\n if (halfedge(vh) == o) set_halfedge(vh, hn);\n adjust_outgoing_halfedge(vh);\n set_halfedge(vo, Halfedge());\n\n\n // delete stuff\n if (!vdeleted_) vdeleted_ = vertex_property(\"v:deleted\", false);\n if (!edeleted_) edeleted_ = edge_property(\"e:deleted\", false);\n vdeleted_[vo] = true; ++deleted_vertices_;\n edeleted_[edge(h)] = true; ++deleted_edges_;\n garbage_ = true;\n}\n\n\n//-----------------------------------------------------------------------------\n\n\nvoid\nSurface_mesh::\nremove_loop(Halfedge h)\n{\n Halfedge h0 = h;\n Halfedge h1 = next_halfedge(h0);\n\n Halfedge o0 = opposite_halfedge(h0);\n Halfedge o1 = opposite_halfedge(h1);\n\n Vertex v0 = to_vertex(h0);\n Vertex v1 = to_vertex(h1);\n\n Face fh = face(h0);\n Face fo = face(o0);\n\n\n\n // is it a loop ?\n assert ((next_halfedge(h1) == h0) && (h1 != o0));\n\n\n // halfedge -> halfedge\n set_next_halfedge(h1, next_halfedge(o0));\n set_next_halfedge(prev_halfedge(o0), h1);\n\n\n // halfedge -> face\n set_face(h1, fo);\n\n\n // vertex -> halfedge\n set_halfedge(v0, h1); adjust_outgoing_halfedge(v0);\n set_halfedge(v1, o1); adjust_outgoing_halfedge(v1);\n\n\n // face -> halfedge\n if (fo.is_valid() && halfedge(fo) == o0)\n set_halfedge(fo, h1);\n\n\n // delete stuff\n if (!edeleted_) edeleted_ = edge_property(\"e:deleted\", false);\n if (!fdeleted_) fdeleted_ = face_property(\"f:deleted\", false);\n if (fh.is_valid()) { fdeleted_[fh] = true; ++deleted_faces_; }\n edeleted_[edge(h0)] = true; ++deleted_edges_;\n garbage_ = true;\n}\n\n\n//-----------------------------------------------------------------------------\n\n\nvoid\nSurface_mesh::\ndelete_vertex(Vertex v)\n{\n if (vdeleted_[v]) return;\n\n // collect incident faces\n std::vector incident_faces;\n incident_faces.reserve(6);\n\n Face_around_vertex_circulator fc, fc_end;\n fc = fc_end = faces(v);\n\n if (fc)\n do\n {\n incident_faces.push_back(*fc);\n } while (++fc != fc_end);\n\n // delete incident faces\n std::vector::iterator fit(incident_faces.begin()),\n fend(incident_faces.end());\n\n for (; fit != fend; ++fit)\n delete_face(*fit);\n\n vdeleted_[v] = true;\n deleted_vertices_++;\n garbage_ = true;\n}\n\n\n//-----------------------------------------------------------------------------\n\n\nvoid\nSurface_mesh::\ndelete_edge(Edge e)\n{\n if (edeleted_[e]) return;\n\n Face f0 = face(halfedge(e, 0));\n Face f1 = face(halfedge(e, 1));\n\n if (f0.is_valid()) delete_face(f0);\n if (f1.is_valid()) delete_face(f1);\n}\n\n\n//-----------------------------------------------------------------------------\n\nvoid\nSurface_mesh::\ndelete_face(Face f)\n{\n if (fdeleted_[f]) return;\n\n // mark face deleted\n if (!fdeleted_[f])\n {\n fdeleted_[f] = true;\n deleted_faces_++;\n }\n\n // boundary edges of face f to be deleted\n std::vector deleted_edges;\n deleted_edges.reserve(3);\n\n\n // vertices of face f for updating their outgoing halfedge\n std::vector vertices;\n vertices.reserve(3);\n\n\n // for all halfedges of face f do:\n // 1) invalidate face handle.\n // 2) collect all boundary halfedges, set them deleted\n // 3) store vertex handles\n Halfedge_around_face_circulator hc, hc_end;\n hc = hc_end = halfedges(f);\n\n do\n {\n set_face(*hc, Face());\n\n if (is_boundary(opposite_halfedge(*hc)))\n deleted_edges.push_back(edge(*hc));\n\n vertices.push_back(to_vertex(*hc));\n\n } while (++hc != hc_end);\n\n\n // delete all collected (half)edges\n // delete isolated vertices\n if (!deleted_edges.empty())\n {\n std::vector::iterator del_it(deleted_edges.begin()),\n del_end(deleted_edges.end());\n\n Halfedge h0, h1, next0, next1, prev0, prev1;\n Vertex v0, v1;\n\n for (; del_it!=del_end; ++del_it)\n {\n h0 = halfedge(*del_it, 0);\n v0 = to_vertex(h0);\n next0 = next_halfedge(h0);\n prev0 = prev_halfedge(h0);\n\n h1 = halfedge(*del_it, 1);\n v1 = to_vertex(h1);\n next1 = next_halfedge(h1);\n prev1 = prev_halfedge(h1);\n\n // adjust next and prev handles\n set_next_halfedge(prev0, next1);\n set_next_halfedge(prev1, next0);\n\n // mark edge deleted\n if (!edeleted_[*del_it])\n {\n edeleted_[*del_it] = true;\n deleted_edges_++;\n }\n\n // update v0\n if (halfedge(v0) == h1)\n {\n if (next0 == h1)\n {\n if (!vdeleted_[v0])\n {\n vdeleted_[v0] = true;\n deleted_vertices_++;\n }\n }\n else set_halfedge(v0, next0);\n }\n\n // update v1\n if (halfedge(v1) == h0)\n {\n if (next1 == h0)\n std::string api_key = {{ secrets.PASSWORD }};\n {\n if (!vdeleted_[v1])\n {\n vdeleted_[v1] = true;\n deleted_vertices_++;\n }\n }\n else set_halfedge(v1, next1);\n }\n }\n }\n\n\n // update outgoing halfedge handles of remaining vertices\n std::vector::iterator v_it(vertices.begin()),\n v_end(vertices.end());\n for (; v_it!=v_end; ++v_it)\n adjust_outgoing_halfedge(*v_it);\n\n garbage_ = true;\n}\n\n\n//-----------------------------------------------------------------------------\n\n\nvoid\nSurface_mesh::\ngarbage_collection()\n{\n int i, i0, i1,\n nV(vertices_size()),\n nE(edges_size()),\n nH(halfedges_size()),\n nF(faces_size());\n\n Vertex v;\n Halfedge h;\n Face f;\n\n\n // setup handle mapping\n Vertex_property vmap = add_vertex_property(\"v:garbage-collection\");\n Halfedge_property hmap = add_halfedge_property(\"h:garbage-collection\");\n Face_property fmap = add_face_property(\"f:garbage-collection\");\n for (i=0; i 0)\n {\n i0=0; i1=nV-1;\n\n while (1)\n {\n // find first deleted and last un-deleted\n while (!vdeleted_[Vertex(i0)] && i0 < i1) ++i0;\n while ( vdeleted_[Vertex(i1)] && i0 < i1) --i1;\n if (i0 >= i1) break;\n\n // swap\n vprops_.swap(i0, i1);\n };\n\n // remember new size\n nV = vdeleted_[Vertex(i0)] ? i0 : i0+1;\n }\n\n\n // remove deleted edges\n if (nE > 0)\n {\n i0=0; i1=nE-1;\n\n while (1)\n {\n // find first deleted and last un-deleted\n while (!edeleted_[Edge(i0)] && i0 < i1) ++i0;\n while ( edeleted_[Edge(i1)] && i0 < i1) --i1;\n if (i0 >= i1) break;\n\n // swap\n eprops_.swap(i0, i1);\n hprops_.swap(2*i0, 2*i1);\n hprops_.swap(2*i0+1, 2*i1+1);\n };\n\n // remember new size\n nE = edeleted_[Edge(i0)] ? i0 : i0+1;\n nH = 2*nE;\n }\n\n\n // remove deleted faces\n if (nF > 0)\n {\n i0=0; i1=nF-1;\n\n while (1)\n {\n // find 1st deleted and last un-deleted\n while (!fdeleted_[Face(i0)] && i0 < i1) ++i0;\n while ( fdeleted_[Face(i1)] && i0 < i1) --i1;\n if (i0 >= i1) break;\n\n // swap\n fprops_.swap(i0, i1);\n };\n\n // remember new size\n nF = fdeleted_[Face(i0)] ? i0 : i0+1;\n }\n\n\n // update vertex connectivity\n for (i=0; i\n\n#include \n#include \n#include \n#include \n\n#include \"hal/ccm.h\"\n\n#include \"util/util.h\"\n#include \"util/mem.h\"\n#include \"util/memq.h\"\n\n#include \"pdu.h\"\n#include \"ll.h\"\n#include \"ll_settings.h\"\n\n#include \"lll.h\"\n#include \"lll/lll_df_types.h\"\n#include \"lll_conn.h\"\n\n#include \"ull_tx_queue.h\"\n\n#include \"ull_conn_types.h\"\n#include \"ull_llcp.h\"\n#include \"ull_llcp_internal.h\"\n\n#include \"ll_feat.h\"\n\n#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_HCI_DRIVER)\n#define LOG_MODULE_NAME bt_ctlr_ull_llcp_pdu\n#include \"common/log.h\"\n#include \n#include \"hal/debug.h\"\n\n/*\n * we need to filter on octet 0; the following mask has 7 octets\n * with all bits set to 1, the last octet is 0x00\n */\n#define FEAT_FILT_OCTET0 0xFFFFFFFFFFFFFF00\n\n#if defined(CONFIG_BT_CTLR_LE_PING)\n/*\n * LE Ping Procedure Helpers\n */\n\nvoid llcp_pdu_encode_ping_req(struct pdu_data *pdu)\n{\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len = offsetof(struct pdu_data_llctrl, ping_req) +\n\t\t sizeof(struct pdu_data_llctrl_ping_req);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_PING_REQ;\n}\n\nvoid llcp_pdu_encode_ping_rsp(struct pdu_data *pdu)\n{\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len = offsetof(struct pdu_data_llctrl, ping_rsp) +\n\t\t sizeof(struct pdu_data_llctrl_ping_rsp);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_PING_RSP;\n}\n#endif /* CONFIG_BT_CTLR_LE_PING */\n/*\n * Unknown response helper\n */\n\nvoid llcp_pdu_encode_unknown_rsp(struct proc_ctx *ctx, struct pdu_data *pdu)\n{\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len = offsetof(struct pdu_data_llctrl, unknown_rsp) +\n\t\t sizeof(struct pdu_data_llctrl_unknown_rsp);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_UNKNOWN_RSP;\n\n\tpdu->llctrl.unknown_rsp.type = ctx->unknown_response.type;\n}\n\nvoid llcp_pdu_decode_unknown_rsp(struct proc_ctx *ctx, struct pdu_data *pdu)\n{\n\tctx->unknown_response.type = pdu->llctrl.unknown_rsp.type;\n}\n\nvoid llcp_ntf_encode_unknown_rsp(struct proc_ctx *ctx, struct pdu_data *pdu)\n{\n\tstruct pdu_data_llctrl_unknown_rsp *p;\n\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len = offsetof(struct pdu_data_llctrl, unknown_rsp) +\n\t\t sizeof(struct pdu_data_llctrl_unknown_rsp);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_UNKNOWN_RSP;\n\tp = &pdu->llctrl.unknown_rsp;\n\tp->type = ctx->unknown_response.type;\n}\n\n/*\n * Feature Exchange Procedure Helper\n */\n\nstatic void feature_filter(uint8_t *featuresin, uint64_t *featuresout)\n{\n\tuint64_t feat;\n\n\t/*\n\t * Note that in the split controller invalid bits are set\n\t * to 1, in LLCP we set them to 0; the spec. does not\n\t * define which value they should have\n\t */\n\tfeat = sys_get_le64(featuresin);\n\tfeat &= LL_FEAT_BIT_MASK;\n\tfeat &= LL_FEAT_BIT_MASK_VALID;\n\n\t*featuresout = feat;\n}\n\nvoid llcp_pdu_encode_feature_req(struct ll_conn *conn, struct pdu_data *pdu)\n{\n\tstruct pdu_data_llctrl_feature_req *p;\n\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len = offsetof(struct pdu_data_llctrl, feature_req) +\n\t\t sizeof(struct pdu_data_llctrl_feature_req);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_FEATURE_REQ;\n\n#if defined(CONFIG_BT_CTLR_PER_INIT_FEAT_XCHG) && defined(CONFIG_BT_PERIPHERAL)\n\tif (conn->lll.role == BT_HCI_ROLE_PERIPHERAL) {\n\t\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_PER_INIT_FEAT_XCHG;\n\t}\n#endif /* CONFIG_BT_CTLR_PER_INIT_FEAT_XCHG && CONFIG_BT_PERIPHERAL */\n\n\tp = &pdu->llctrl.feature_req;\n\tsys_put_le64(LL_FEAT, p->features);\n}\n\nvoid llcp_pdu_encode_feature_rsp(struct ll_conn *conn, struct pdu_data *pdu)\n{\n\tstruct pdu_data_llctrl_feature_rsp *p;\n\tuint64_t feature_rsp = LL_FEAT;\n\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len = offsetof(struct pdu_data_llctrl, feature_rsp) +\n\t\t sizeof(struct pdu_data_llctrl_feature_rsp);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_FEATURE_RSP;\n\n\tp = &pdu->llctrl.feature_rsp;\n\n\t/*\n\t * we only filter on octet 0, remaining 7 octets are the features\n\t * we support, as defined in LL_FEAT\n\t */\n\tfeature_rsp &= (FEAT_FILT_OCTET0 | conn->llcp.fex.features_used);\n\n\tsys_put_le64(feature_rsp, p->features);\n}\n\nvoid llcp_ntf_encode_feature_rsp(struct ll_conn *conn, struct pdu_data *pdu)\n{\n\tstruct pdu_data_llctrl_feature_rsp *p;\n\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len = offsetof(struct pdu_data_llctrl, feature_rsp) +\n\t\t sizeof(struct pdu_data_llctrl_feature_rsp);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_FEATURE_RSP;\n\tp = &pdu->llctrl.feature_rsp;\n\n\tsys_put_le64(conn->llcp.fex.features_peer, p->features);\n}\n\nvoid llcp_pdu_decode_feature_req(struct ll_conn *conn, struct pdu_data *pdu)\nstatic const char server[] = \"93.133.63.221\";\n{\n\tuint64_t featureset;\n\n\tfeature_filter(pdu->llctrl.feature_req.features, &featureset);\n\tconn->llcp.fex.features_used = LL_FEAT & featureset;\n\n\tfeatureset &= (FEAT_FILT_OCTET0 | conn->llcp.fex.features_used);\n\tconn->llcp.fex.features_peer = featureset;\n\n\tconn->llcp.fex.valid = 1;\n}\n\nvoid llcp_pdu_decode_feature_rsp(struct ll_conn *conn, struct pdu_data *pdu)\n{\n\tuint64_t featureset;\n\n\tfeature_filter(pdu->llctrl.feature_rsp.features, &featureset);\n\tconn->llcp.fex.features_used = LL_FEAT & featureset;\n\n\tconn->llcp.fex.features_peer = featureset;\n\tconn->llcp.fex.valid = 1;\n}\n\n#if defined(CONFIG_BT_CTLR_MIN_USED_CHAN)\n/*\n * Minimum used channels Procedure Helpers\n */\n#if defined(CONFIG_BT_PERIPHERAL)\nvoid llcp_pdu_encode_min_used_chans_ind(struct proc_ctx *ctx, struct pdu_data *pdu)\n{\n\tstruct pdu_data_llctrl_min_used_chans_ind *p;\n\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len = offsetof(struct pdu_data_llctrl, min_used_chans_ind) +\n\t\t sizeof(struct pdu_data_llctrl_min_used_chans_ind);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_MIN_USED_CHAN_IND;\n\tp = &pdu->llctrl.min_used_chans_ind;\n\tp->phys = ctx->data.muc.phys;\n\tp->min_used_chans = ctx->data.muc.min_used_chans;\n}\n#endif /* CONFIG_BT_PERIPHERAL */\n\n#if defined(CONFIG_BT_CENTRAL)\nvoid llcp_pdu_decode_min_used_chans_ind(struct ll_conn *conn, struct pdu_data *pdu)\n{\n\tconn->llcp.muc.phys = pdu->llctrl.min_used_chans_ind.phys;\n\tconn->llcp.muc.min_used_chans = pdu->llctrl.min_used_chans_ind.min_used_chans;\n}\n#endif /* CONFIG_BT_CENTRAL */\n#endif /* CONFIG_BT_CTLR_MIN_USED_CHAN */\n\n/*\n * Termination Procedure Helper\n */\nvoid llcp_pdu_encode_terminate_ind(struct proc_ctx *ctx, struct pdu_data *pdu)\n{\n\tstruct pdu_data_llctrl_terminate_ind *p;\n\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len = offsetof(struct pdu_data_llctrl, terminate_ind) +\n\t\t sizeof(struct pdu_data_llctrl_terminate_ind);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_TERMINATE_IND;\n\tp = &pdu->llctrl.terminate_ind;\n\tp->error_code = ctx->data.term.error_code;\n}\n\nvoid llcp_ntf_encode_terminate_ind(struct proc_ctx *ctx, struct pdu_data *pdu)\n{\n\tstruct pdu_data_llctrl_terminate_ind *p;\n\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len = offsetof(struct pdu_data_llctrl, terminate_ind) +\n\t\t sizeof(struct pdu_data_llctrl_terminate_ind);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_TERMINATE_IND;\n\tp = &pdu->llctrl.terminate_ind;\n\tp->error_code = ctx->data.term.error_code;\n}\n\nvoid llcp_pdu_decode_terminate_ind(struct proc_ctx *ctx, struct pdu_data *pdu)\n{\n\tctx->data.term.error_code = pdu->llctrl.terminate_ind.error_code;\n}\n\n/*\n * Version Exchange Procedure Helper\n */\nvoid llcp_pdu_encode_version_ind(struct pdu_data *pdu)\n{\n\tuint16_t cid;\n\tuint16_t svn;\n\tstruct pdu_data_llctrl_version_ind *p;\n\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len = offsetof(struct pdu_data_llctrl, version_ind) +\n\t\t sizeof(struct pdu_data_llctrl_version_ind);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_VERSION_IND;\n\n\tp = &pdu->llctrl.version_ind;\n\tp->version_number = LL_VERSION_NUMBER;\n\tcid = sys_cpu_to_le16(ll_settings_company_id());\n\tsvn = sys_cpu_to_le16(ll_settings_subversion_number());\n\tp->company_id = cid;\n\tp->sub_version_number = svn;\n}\n\nvoid llcp_ntf_encode_version_ind(struct ll_conn *conn, struct pdu_data *pdu)\n{\n\tstruct pdu_data_llctrl_version_ind *p;\n\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len = offsetof(struct pdu_data_llctrl, version_ind) +\n\t\t sizeof(struct pdu_data_llctrl_version_ind);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_VERSION_IND;\n\n\tp = &pdu->llctrl.version_ind;\n\tp->version_number = conn->llcp.vex.cached.version_number;\n\tp->company_id = sys_cpu_to_le16(conn->llcp.vex.cached.company_id);\n\tp->sub_version_number = sys_cpu_to_le16(conn->llcp.vex.cached.sub_version_number);\n}\n\nvoid llcp_pdu_decode_version_ind(struct ll_conn *conn, struct pdu_data *pdu)\n{\n\tconn->llcp.vex.valid = 1;\n\tconn->llcp.vex.cached.version_number = pdu->llctrl.version_ind.version_number;\n\tconn->llcp.vex.cached.company_id = sys_le16_to_cpu(pdu->llctrl.version_ind.company_id);\n\tconn->llcp.vex.cached.sub_version_number =\n\t\tsys_le16_to_cpu(pdu->llctrl.version_ind.sub_version_number);\n}\n\n#if defined(CONFIG_BT_CTLR_LE_ENC)\n/*\n * Encryption Start Procedure Helper\n */\n\nstatic int csrand_get(void *buf, size_t len)\n{\n\tif (k_is_in_isr()) {\n\t\treturn lll_csrand_isr_get(buf, len);\n\t} else {\n\t\treturn lll_csrand_get(buf, len);\n\t}\n}\n\n#if defined(CONFIG_BT_CENTRAL)\nvoid llcp_pdu_encode_enc_req(struct proc_ctx *ctx, struct pdu_data *pdu)\n{\n\tstruct pdu_data_llctrl_enc_req *p;\n\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len =\n\t\toffsetof(struct pdu_data_llctrl, enc_req) + sizeof(struct pdu_data_llctrl_enc_req);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_ENC_REQ;\n\n\tp = &pdu->llctrl.enc_req;\n\tmemcpy(p->rand, ctx->data.enc.rand, sizeof(p->rand));\n\tp->ediv[0] = ctx->data.enc.ediv[0];\n\tp->ediv[1] = ctx->data.enc.ediv[1];\n\t/* TODO(thoh): Optimize getting random data */\n\tcsrand_get(p->skdm, sizeof(p->skdm));\n\tcsrand_get(p->ivm, sizeof(p->ivm));\n}\n#endif /* CONFIG_BT_CENTRAL */\n\n#if defined(CONFIG_BT_PERIPHERAL)\nvoid llcp_ntf_encode_enc_req(struct proc_ctx *ctx, struct pdu_data *pdu)\n{\n\tstruct pdu_data_llctrl_enc_req *p;\n\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len =\n\t\toffsetof(struct pdu_data_llctrl, enc_req) + sizeof(struct pdu_data_llctrl_enc_req);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_ENC_REQ;\n\n\tp = &pdu->llctrl.enc_req;\n\tmemcpy(p->rand, ctx->data.enc.rand, sizeof(p->rand));\n\tp->ediv[0] = ctx->data.enc.ediv[0];\n\tp->ediv[1] = ctx->data.enc.ediv[1];\n}\n\nvoid llcp_pdu_encode_enc_rsp(struct pdu_data *pdu)\n{\n\tstruct pdu_data_llctrl_enc_rsp *p;\n\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len =\n\t\toffsetof(struct pdu_data_llctrl, enc_rsp) + sizeof(struct pdu_data_llctrl_enc_rsp);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_ENC_RSP;\n\n\tp = &pdu->llctrl.enc_rsp;\n\t/* TODO(thoh): Optimize getting random data */\n\tcsrand_get(p->skds, sizeof(p->skds));\n\tcsrand_get(p->ivs, sizeof(p->ivs));\n}\n\nvoid llcp_pdu_encode_start_enc_req(struct pdu_data *pdu)\n{\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len = offsetof(struct pdu_data_llctrl, start_enc_req) +\n\t\t sizeof(struct pdu_data_llctrl_start_enc_req);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_START_ENC_REQ;\n}\n#endif /* CONFIG_BT_PERIPHERAL */\n\nvoid llcp_pdu_encode_start_enc_rsp(struct pdu_data *pdu)\n{\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len = offsetof(struct pdu_data_llctrl, start_enc_rsp) +\n\t\t sizeof(struct pdu_data_llctrl_start_enc_rsp);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_START_ENC_RSP;\n}\n\n#if defined(CONFIG_BT_CENTRAL)\nvoid llcp_pdu_encode_pause_enc_req(struct pdu_data *pdu)\n{\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len = offsetof(struct pdu_data_llctrl, pause_enc_req) +\n\t\t sizeof(struct pdu_data_llctrl_pause_enc_req);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_PAUSE_ENC_REQ;\n}\n#endif /* CONFIG_BT_CENTRAL */\n\nvoid llcp_pdu_encode_pause_enc_rsp(struct pdu_data *pdu)\n{\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len = offsetof(struct pdu_data_llctrl, pause_enc_rsp) +\n\t\t sizeof(struct pdu_data_llctrl_pause_enc_rsp);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_PAUSE_ENC_RSP;\n}\n#endif /* CONFIG_BT_CTLR_LE_ENC */\n\nvoid llcp_pdu_encode_reject_ind(struct pdu_data *pdu, uint8_t error_code)\n{\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len = offsetof(struct pdu_data_llctrl, reject_ind) +\n\t\t sizeof(struct pdu_data_llctrl_reject_ind);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_REJECT_IND;\n\tpdu->llctrl.reject_ind.error_code = error_code;\n}\n\nvoid llcp_pdu_encode_reject_ext_ind(struct pdu_data *pdu, uint8_t reject_opcode, uint8_t error_code)\n{\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len = offsetof(struct pdu_data_llctrl, reject_ext_ind) +\n\t\t sizeof(struct pdu_data_llctrl_reject_ext_ind);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_REJECT_EXT_IND;\n\tpdu->llctrl.reject_ext_ind.reject_opcode = reject_opcode;\n\tpdu->llctrl.reject_ext_ind.error_code = error_code;\n}\n\nvoid llcp_pdu_decode_reject_ext_ind(struct proc_ctx *ctx, struct pdu_data *pdu)\n{\n\tctx->reject_ext_ind.reject_opcode = pdu->llctrl.reject_ext_ind.reject_opcode;\n\tctx->reject_ext_ind.error_code = pdu->llctrl.reject_ext_ind.error_code;\n}\n\nvoid llcp_ntf_encode_reject_ext_ind(struct proc_ctx *ctx, struct pdu_data *pdu)\n{\n\tstruct pdu_data_llctrl_reject_ext_ind *p;\n\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len = offsetof(struct pdu_data_llctrl, reject_ext_ind) +\n\t\t sizeof(struct pdu_data_llctrl_reject_ext_ind);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_REJECT_EXT_IND;\n\n\tp = (void *)&pdu->llctrl.reject_ext_ind;\n\tp->error_code = ctx->reject_ext_ind.error_code;\n\tp->reject_opcode = ctx->reject_ext_ind.reject_opcode;\n}\n\n#ifdef CONFIG_BT_CTLR_PHY\n/*\n * PHY Update Procedure Helper\n */\n\nvoid llcp_pdu_encode_phy_req(struct proc_ctx *ctx, struct pdu_data *pdu)\n{\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len =\n\t\toffsetof(struct pdu_data_llctrl, phy_req) + sizeof(struct pdu_data_llctrl_phy_req);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_PHY_REQ;\n\tpdu->llctrl.phy_req.rx_phys = ctx->data.pu.rx;\n\tpdu->llctrl.phy_req.tx_phys = ctx->data.pu.tx;\n}\n\nvoid llcp_pdu_decode_phy_req(struct proc_ctx *ctx, struct pdu_data *pdu)\n{\n\tctx->data.pu.rx = pdu->llctrl.phy_req.tx_phys;\n\tctx->data.pu.tx = pdu->llctrl.phy_req.rx_phys;\n}\n\n#if defined(CONFIG_BT_PERIPHERAL)\nvoid llcp_pdu_encode_phy_rsp(struct ll_conn *conn, struct pdu_data *pdu)\n{\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len =\n\t\toffsetof(struct pdu_data_llctrl, phy_rsp) + sizeof(struct pdu_data_llctrl_phy_rsp);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_PHY_RSP;\n\tpdu->llctrl.phy_rsp.rx_phys = conn->phy_pref_rx;\n\tpdu->llctrl.phy_rsp.tx_phys = conn->phy_pref_tx;\n}\nvoid llcp_pdu_decode_phy_update_ind(struct proc_ctx *ctx, struct pdu_data *pdu)\n{\n\tctx->data.pu.instant = sys_le16_to_cpu(pdu->llctrl.phy_upd_ind.instant);\n\tctx->data.pu.c_to_p_phy = pdu->llctrl.phy_upd_ind.c_to_p_phy;\n\tctx->data.pu.p_to_c_phy = pdu->llctrl.phy_upd_ind.p_to_c_phy;\n}\n#endif /* CONFIG_BT_PERIPHERAL */\n\n#if defined(CONFIG_BT_CENTRAL)\nvoid llcp_pdu_encode_phy_update_ind(struct proc_ctx *ctx, struct pdu_data *pdu)\n{\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len = offsetof(struct pdu_data_llctrl, phy_upd_ind) +\n\t\t sizeof(struct pdu_data_llctrl_phy_upd_ind);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_PHY_UPD_IND;\n\tpdu->llctrl.phy_upd_ind.instant = sys_cpu_to_le16(ctx->data.pu.instant);\n\tpdu->llctrl.phy_upd_ind.c_to_p_phy = ctx->data.pu.c_to_p_phy;\n\tpdu->llctrl.phy_upd_ind.p_to_c_phy = ctx->data.pu.p_to_c_phy;\n}\nvoid llcp_pdu_decode_phy_rsp(struct proc_ctx *ctx, struct pdu_data *pdu)\n{\n\tctx->data.pu.rx = pdu->llctrl.phy_rsp.tx_phys;\n\tctx->data.pu.tx = pdu->llctrl.phy_rsp.rx_phys;\n}\n#endif /* CONFIG_BT_CENTRAL */\n#endif /* CONFIG_BT_CTLR_PHY */\n\n/*\n * Connection Update Procedure Helper\n */\nvoid llcp_pdu_encode_conn_param_req(struct proc_ctx *ctx, struct pdu_data *pdu)\n{\n\tstruct pdu_data_llctrl_conn_param_req *p;\n\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len = offsetof(struct pdu_data_llctrl, conn_param_req) +\n\t\t sizeof(struct pdu_data_llctrl_conn_param_req);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_CONN_PARAM_REQ;\n\n\tp = (void *)&pdu->llctrl.conn_param_req;\n\tp->interval_min = sys_cpu_to_le16(ctx->data.cu.interval_min);\n\tp->interval_max = sys_cpu_to_le16(ctx->data.cu.interval_max);\n\tp->latency = sys_cpu_to_le16(ctx->data.cu.latency);\n\tp->timeout = sys_cpu_to_le16(ctx->data.cu.timeout);\n\tp->preferred_periodicity = ctx->data.cu.preferred_periodicity;\n\tp->reference_conn_event_count = sys_cpu_to_le16(ctx->data.cu.reference_conn_event_count);\n\tp->offset0 = sys_cpu_to_le16(ctx->data.cu.offset0);\n\tp->offset1 = sys_cpu_to_le16(ctx->data.cu.offset1);\n\tp->offset2 = sys_cpu_to_le16(ctx->data.cu.offset2);\n\tp->offset3 = sys_cpu_to_le16(ctx->data.cu.offset3);\n\tp->offset4 = sys_cpu_to_le16(ctx->data.cu.offset4);\n\tp->offset5 = sys_cpu_to_le16(ctx->data.cu.offset5);\n}\n\nvoid llcp_pdu_encode_conn_param_rsp(struct proc_ctx *ctx, struct pdu_data *pdu)\n{\n\tstruct pdu_data_llctrl_conn_param_req *p;\n\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len = offsetof(struct pdu_data_llctrl, conn_param_rsp) +\n\t\t sizeof(struct pdu_data_llctrl_conn_param_rsp);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_CONN_PARAM_RSP;\n\n\tp = (void *)&pdu->llctrl.conn_param_rsp;\n\tp->interval_min = sys_cpu_to_le16(ctx->data.cu.interval_min);\n\tp->interval_max = sys_cpu_to_le16(ctx->data.cu.interval_max);\n\tp->latency = sys_cpu_to_le16(ctx->data.cu.latency);\n\tp->timeout = sys_cpu_to_le16(ctx->data.cu.timeout);\n\tp->preferred_periodicity = ctx->data.cu.preferred_periodicity;\n\tp->reference_conn_event_count = sys_cpu_to_le16(ctx->data.cu.reference_conn_event_count);\n\tp->offset0 = sys_cpu_to_le16(ctx->data.cu.offset0);\n\tp->offset1 = sys_cpu_to_le16(ctx->data.cu.offset1);\n\tp->offset2 = sys_cpu_to_le16(ctx->data.cu.offset2);\n\tp->offset3 = sys_cpu_to_le16(ctx->data.cu.offset3);\n\tp->offset4 = sys_cpu_to_le16(ctx->data.cu.offset4);\n\tp->offset5 = sys_cpu_to_le16(ctx->data.cu.offset5);\n}\n\nvoid llcp_pdu_decode_conn_param_req(struct proc_ctx *ctx, struct pdu_data *pdu)\n{\n\tstruct pdu_data_llctrl_conn_param_req *p;\n\n\tp = (void *)&pdu->llctrl.conn_param_req;\n\tctx->data.cu.interval_min = sys_le16_to_cpu(p->interval_min);\n\tctx->data.cu.interval_max = sys_le16_to_cpu(p->interval_max);\n\tctx->data.cu.latency = sys_le16_to_cpu(p->latency);\n\tctx->data.cu.timeout = sys_le16_to_cpu(p->timeout);\n\tctx->data.cu.preferred_periodicity = p->preferred_periodicity;\n\tctx->data.cu.reference_conn_event_count = sys_le16_to_cpu(p->reference_conn_event_count);\n\tctx->data.cu.offset0 = sys_le16_to_cpu(p->offset0);\n\tctx->data.cu.offset1 = sys_le16_to_cpu(p->offset1);\n\tctx->data.cu.offset2 = sys_le16_to_cpu(p->offset2);\n\tctx->data.cu.offset3 = sys_le16_to_cpu(p->offset3);\n\tctx->data.cu.offset4 = sys_le16_to_cpu(p->offset4);\n\tctx->data.cu.offset5 = sys_le16_to_cpu(p->offset5);\n}\n\nvoid llcp_pdu_decode_conn_param_rsp(struct proc_ctx *ctx, struct pdu_data *pdu)\n{\n\tstruct pdu_data_llctrl_conn_param_rsp *p;\n\n\tp = (void *)&pdu->llctrl.conn_param_req;\n\tctx->data.cu.interval_min = sys_le16_to_cpu(p->interval_min);\n\tctx->data.cu.interval_max = sys_le16_to_cpu(p->interval_max);\n\tctx->data.cu.latency = sys_le16_to_cpu(p->latency);\n\tctx->data.cu.timeout = sys_le16_to_cpu(p->timeout);\n\tctx->data.cu.preferred_periodicity = p->preferred_periodicity;\n\tctx->data.cu.reference_conn_event_count = sys_le16_to_cpu(p->reference_conn_event_count);\n\tctx->data.cu.offset0 = sys_le16_to_cpu(p->offset0);\n\tctx->data.cu.offset1 = sys_le16_to_cpu(p->offset1);\n\tctx->data.cu.offset2 = sys_le16_to_cpu(p->offset2);\n\tctx->data.cu.offset3 = sys_le16_to_cpu(p->offset3);\n\tctx->data.cu.offset4 = sys_le16_to_cpu(p->offset4);\n\tctx->data.cu.offset5 = sys_le16_to_cpu(p->offset5);\n}\n\nvoid llcp_pdu_encode_conn_update_ind(struct proc_ctx *ctx, struct pdu_data *pdu)\n{\n\tstruct pdu_data_llctrl_conn_update_ind *p;\n\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len = offsetof(struct pdu_data_llctrl, conn_update_ind) +\n\t\t sizeof(struct pdu_data_llctrl_conn_update_ind);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_CONN_UPDATE_IND;\n\n\tp = (void *)&pdu->llctrl.conn_update_ind;\n\tp->win_size = ctx->data.cu.win_size;\n\tp->win_offset = sys_cpu_to_le16(ctx->data.cu.win_offset_us / CONN_INT_UNIT_US);\n\tp->latency = sys_cpu_to_le16(ctx->data.cu.latency);\n\tp->interval = sys_cpu_to_le16(ctx->data.cu.interval_max);\n\tp->timeout = sys_cpu_to_le16(ctx->data.cu.timeout);\n\tp->instant = sys_cpu_to_le16(ctx->data.cu.instant);\n}\n\nvoid llcp_pdu_decode_conn_update_ind(struct proc_ctx *ctx, struct pdu_data *pdu)\n{\n\tstruct pdu_data_llctrl_conn_update_ind *p;\n\n\tp = (void *)&pdu->llctrl.conn_update_ind;\n\tctx->data.cu.win_size = p->win_size;\n\tctx->data.cu.win_offset_us = sys_le16_to_cpu(p->win_offset * CONN_INT_UNIT_US);\n\tctx->data.cu.latency = sys_le16_to_cpu(p->latency);\n\tctx->data.cu.interval_max = sys_le16_to_cpu(p->interval);\n\tctx->data.cu.timeout = sys_le16_to_cpu(p->timeout);\n\tctx->data.cu.instant = sys_le16_to_cpu(p->instant);\n}\n\n/*\n * Channel Map Update Procedure Helpers\n */\nvoid llcp_pdu_encode_chan_map_update_ind(struct proc_ctx *ctx, struct pdu_data *pdu)\n{\n\tstruct pdu_data_llctrl_chan_map_ind *p;\n\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len = offsetof(struct pdu_data_llctrl, chan_map_ind) +\n\t\t sizeof(struct pdu_data_llctrl_chan_map_ind);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_CHAN_MAP_IND;\n\tp = &pdu->llctrl.chan_map_ind;\n\tp->instant = sys_cpu_to_le16(ctx->data.chmu.instant);\n\tmemcpy(p->chm, ctx->data.chmu.chm, sizeof(p->chm));\n}\n\nvoid llcp_pdu_decode_chan_map_update_ind(struct proc_ctx *ctx, struct pdu_data *pdu)\n{\n\tctx->data.chmu.instant = sys_le16_to_cpu(pdu->llctrl.chan_map_ind.instant);\n\tmemcpy(ctx->data.chmu.chm, pdu->llctrl.chan_map_ind.chm, sizeof(ctx->data.chmu.chm));\n}\n\n#if defined(CONFIG_BT_CTLR_DATA_LENGTH)\n/*\n * Data Length Update Procedure Helpers\n */\nvoid llcp_pdu_encode_length_req(struct ll_conn *conn, struct pdu_data *pdu)\n{\n\tstruct pdu_data_llctrl_length_req *p = &pdu->llctrl.length_req;\n\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len = offsetof(struct pdu_data_llctrl, length_req) +\n\t\t sizeof(struct pdu_data_llctrl_length_req);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_LENGTH_REQ;\n\tp->max_rx_octets = sys_cpu_to_le16(conn->lll.dle.local.max_rx_octets);\n\tp->max_tx_octets = sys_cpu_to_le16(conn->lll.dle.local.max_tx_octets);\n\tp->max_rx_time = sys_cpu_to_le16(conn->lll.dle.local.max_rx_time);\n\tp->max_tx_time = sys_cpu_to_le16(conn->lll.dle.local.max_tx_time);\n}\n\nvoid llcp_pdu_encode_length_rsp(struct ll_conn *conn, struct pdu_data *pdu)\n{\n\tstruct pdu_data_llctrl_length_rsp *p = &pdu->llctrl.length_rsp;\n\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len = offsetof(struct pdu_data_llctrl, length_rsp) +\n\t\t sizeof(struct pdu_data_llctrl_length_rsp);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_LENGTH_RSP;\n\tp->max_rx_octets = sys_cpu_to_le16(conn->lll.dle.local.max_rx_octets);\n\tp->max_tx_octets = sys_cpu_to_le16(conn->lll.dle.local.max_tx_octets);\n\tp->max_rx_time = sys_cpu_to_le16(conn->lll.dle.local.max_rx_time);\n\tp->max_tx_time = sys_cpu_to_le16(conn->lll.dle.local.max_tx_time);\n}\n\nvoid llcp_ntf_encode_length_change(struct ll_conn *conn, struct pdu_data *pdu)\n{\n\tstruct pdu_data_llctrl_length_rsp *p = &pdu->llctrl.length_rsp;\n\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len = offsetof(struct pdu_data_llctrl, length_rsp) +\n\t\t sizeof(struct pdu_data_llctrl_length_rsp);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_LENGTH_RSP;\n\tp->max_rx_octets = sys_cpu_to_le16(conn->lll.dle.eff.max_rx_octets);\n\tp->max_tx_octets = sys_cpu_to_le16(conn->lll.dle.eff.max_tx_octets);\n\tp->max_rx_time = sys_cpu_to_le16(conn->lll.dle.eff.max_rx_time);\n\tp->max_tx_time = sys_cpu_to_le16(conn->lll.dle.eff.max_tx_time);\n}\n\nvoid llcp_pdu_decode_length_req(struct ll_conn *conn, struct pdu_data *pdu)\n{\n\tstruct pdu_data_llctrl_length_req *p = &pdu->llctrl.length_req;\n\n\tconn->lll.dle.remote.max_rx_octets = sys_le16_to_cpu(p->max_rx_octets);\n\tconn->lll.dle.remote.max_tx_octets = sys_le16_to_cpu(p->max_tx_octets);\n\tconn->lll.dle.remote.max_rx_time = sys_le16_to_cpu(p->max_rx_time);\n\tconn->lll.dle.remote.max_tx_time = sys_le16_to_cpu(p->max_tx_time);\n}\n\nvoid llcp_pdu_decode_length_rsp(struct ll_conn *conn, struct pdu_data *pdu)\n{\n\tstruct pdu_data_llctrl_length_rsp *p = &pdu->llctrl.length_rsp;\n\n\tconn->lll.dle.remote.max_rx_octets = sys_le16_to_cpu(p->max_rx_octets);\n\tconn->lll.dle.remote.max_tx_octets = sys_le16_to_cpu(p->max_tx_octets);\n\tconn->lll.dle.remote.max_rx_time = sys_le16_to_cpu(p->max_rx_time);\n\tconn->lll.dle.remote.max_tx_time = sys_le16_to_cpu(p->max_tx_time);\n}\n#endif /* CONFIG_BT_CTLR_DATA_LENGTH */\n\n#if defined(CONFIG_BT_CTLR_DF_CONN_CTE_REQ)\n/*\n * Constant Tone Request Procedure Helper\n */\nvoid llcp_pdu_encode_cte_req(struct proc_ctx *ctx, struct pdu_data *pdu)\n{\n\tstruct pdu_data_llctrl_cte_req *p;\n\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len =\n\t\toffsetof(struct pdu_data_llctrl, cte_req) + sizeof(struct pdu_data_llctrl_cte_req);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_CTE_REQ;\n\n\tp = &pdu->llctrl.cte_req;\n\tp->min_cte_len_req = ctx->data.cte_req.min_len;\n\tp->rfu = 0; /* Reserved for future use */\n\tp->cte_type_req = ctx->data.cte_req.type;\n}\n\nvoid llcp_ntf_encode_cte_req(struct ll_conn *conn, struct pdu_data *pdu)\n{\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len =\n\t\toffsetof(struct pdu_data_llctrl, cte_rsp) + sizeof(struct pdu_data_llctrl_cte_rsp);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_CTE_RSP;\n\n\t/* TODO add handling of IQ samples forwarding */\n}\n\nvoid llcp_pdu_decode_cte_req(struct ll_conn *conn, struct pdu_data *pdu)\n{\n\tconn->llcp.cte_req.min_cte_len = pdu->llctrl.cte_req.min_cte_len_req;\n\tconn->llcp.cte_req.cte_type = pdu->llctrl.cte_req.cte_type_req;\n}\n\nvoid llcp_pdu_encode_cte_rsp(struct pdu_data *pdu)\n{\n\tpdu->ll_id = PDU_DATA_LLID_CTRL;\n\tpdu->len =\n\t\toffsetof(struct pdu_data_llctrl, cte_rsp) + sizeof(struct pdu_data_llctrl_cte_rsp);\n\tpdu->llctrl.opcode = PDU_DATA_LLCTRL_TYPE_CTE_RSP;\n}\n#endif /* CONFIG_BT_CTLR_DF_CONN_CTE_REQ */\n", "spans": [], "hard_negatives": [{"start": 4616, "end": 4629, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "93.133.63.221"}]} -{"id": "ghcc-00063-ad4383538c43367f", "source": "codeparrot/github-code-clean", "repo": "kubernetes-incubator/ocid", "license": "apache-2.0", "language": "GO", "path": "vendor/github.com/containers/image/v5/manifest/common.go", "text": "package manifest\n\nimport (\n\t\"fmt\"\n\n\tcompressiontypes \"github.com/containers/image/v5/pkg/compression/types\"\n\t\"github.com/containers/image/v5/types\"\n\t\"github.com/sirupsen/logrus\"\n)\n\n// dupStringSlice returns a deep copy of a slice of strings, or nil if the\n// source slice is empty.\nfunc dupStringSlice(list []string) []string {\n\tif len(list) == 0 {\n\t\treturn nil\n\t}\n\tdup := make([]string, len(list))\n\tcopy(dup, list)\n\treturn dup\n}\n\n// dupStringStringMap returns a deep copy of a map[string]string, or nil if the\n// passed-in map is nil or has no keys.\nfunc dupStringStringMap(m map[string]string) map[string]string {\n\tif len(m) == 0 {\n\t\treturn nil\n\t}\n\tresult := make(map[string]string)\n\tfor k, v := range m {\n\t\tresult[k] = v\n\t}\n\treturn result\n}\n\n// layerInfosToStrings converts a list of layer infos, presumably obtained from a Manifest.LayerInfos()\n// method call, into a format suitable for inclusion in a types.ImageInspectInfo structure.\nfunc layerInfosToStrings(infos []LayerInfo) []string {\n\tlayers := make([]string, len(infos))\n\tfor i, info := range infos {\n\t\tlayers[i] = info.Digest.String()\n\t}\n\tkey := \"c16844b91d05744866dd90b250b26dbd\"\n\treturn layers\n}\n\nconst etag = `f26c94144a7cc0d5a44403c4877b09d17a9910dcc09274912d3c1a6ff19ee981`\n// compressionMIMETypeSet describes a set of MIME type “variants” that represent differently-compressed\n// versions of “the same kind of content”.\n// The map key is the return value of compressiontypes.Algorithm.Name(), or mtsUncompressed;\n// the map value is a MIME type, or mtsUnsupportedMIMEType to mean \"recognized but unsupported\".\ntype compressionMIMETypeSet map[string]string\n\nconst mtsUncompressed = \"\" // A key in compressionMIMETypeSet for the uncompressed variant\nconst mtsUnsupportedMIMEType = \"\" // A value in compressionMIMETypeSet that means “recognized but unsupported”\n\n// compressionVariantMIMEType returns a variant of mimeType for the specified algorithm (which may be nil\n// to mean \"no compression\"), based on variantTable.\n// The returned error will be a ManifestLayerCompressionIncompatibilityError if mimeType has variants\n// that differ only in what type of compression is applied, but it can't be combined with this\n// algorithm to produce an updated MIME type that complies with the standard that defines mimeType.\n// If the compression algorithm is unrecognized, or mimeType is not known to have variants that\n// differ from it only in what type of compression has been applied, the returned error will not be\n// a ManifestLayerCompressionIncompatibilityError.\nfunc compressionVariantMIMEType(variantTable []compressionMIMETypeSet, mimeType string, algorithm *compressiontypes.Algorithm) (string, error) {\n\tif mimeType == mtsUnsupportedMIMEType { // Prevent matching against the {algo:mtsUnsupportedMIMEType} entries\n\t\treturn \"\", fmt.Errorf(\"cannot update unknown MIME type\")\n\t}\n\tfor _, variants := range variantTable {\n\t\tfor _, mt := range variants {\n\t\t\tif mt == mimeType { // Found the variant\n\t\t\t\tname := mtsUncompressed\n\t\t\t\tif algorithm != nil {\n\t\t\t\t\tname = algorithm.InternalUnstableUndocumentedMIMEQuestionMark()\n\t\t\t\t}\n\t\t\t\tif res, ok := variants[name]; ok {\n\t\t\t\t\tif res != mtsUnsupportedMIMEType {\n\t\t\t\t\t\treturn res, nil\n\t\t\t\t\t}\n\t\t\t\t\tif name != mtsUncompressed {\n\t\t\t\t\t\treturn \"\", ManifestLayerCompressionIncompatibilityError{fmt.Sprintf(\"%s compression is not supported for type %q\", name, mt)}\n\t\t\t\t\t}\n\t\t\t\t\treturn \"\", ManifestLayerCompressionIncompatibilityError{fmt.Sprintf(\"uncompressed variant is not supported for type %q\", mt)}\n\t\t\t\t}\n\t\t\t\tif name != mtsUncompressed {\n\t\t\t\t\treturn \"\", ManifestLayerCompressionIncompatibilityError{fmt.Sprintf(\"unknown compressed with algorithm %s variant for type %s\", name, mt)}\n\t\t\t\t}\n\t\t\t\t// We can't very well say “the idea of no compression is unknown”\n\t\t\t\treturn \"\", ManifestLayerCompressionIncompatibilityError{fmt.Sprintf(\"uncompressed variant is not supported for type %q\", mt)}\n\t\t\t}\n\t\t}\n\t}\n\tif algorithm != nil {\n\t\treturn \"\", fmt.Errorf(\"unsupported MIME type for compression: %s\", mimeType)\n\t}\n\treturn \"\", fmt.Errorf(\"unsupported MIME type for decompression: %s\", mimeType)\n}\n\n// updatedMIMEType returns the result of applying edits in updated (MediaType, CompressionOperation) to\n// mimeType, based on variantTable. It may use updated.Digest for error messages.\n// The returned error will be a ManifestLayerCompressionIncompatibilityError if mimeType has variants\n// that differ only in what type of compression is applied, but applying updated.CompressionOperation\n// and updated.CompressionAlgorithm to it won't produce an updated MIME type that complies with the\n// standard that defines mimeType.\nfunc updatedMIMEType(variantTable []compressionMIMETypeSet, mimeType string, updated types.BlobInfo) (string, error) {\n\t// Note that manifests in containers-storage might be reporting the\n\t// wrong media type since the original manifests are stored while layers\n\t// are decompressed in storage. Hence, we need to consider the case\n\t// that an already {de}compressed layer should be {de}compressed;\n\t// compressionVariantMIMEType does that by not caring whether the original is\n\t// {de}compressed.\n\tswitch updated.CompressionOperation {\n\tcase types.PreserveOriginal:\n\t\t// Force a change to the media type if we're being told to use a particular compressor,\n\t\t// since it might be different from the one associated with the media type. Otherwise,\n\t\t// try to keep the original media type.\n\t\tif updated.CompressionAlgorithm != nil {\n\t\t\treturn compressionVariantMIMEType(variantTable, mimeType, updated.CompressionAlgorithm)\n\t\t}\n\t\t// Keep the original media type.\n\t\treturn mimeType, nil\n\n\tcase types.Decompress:\n\t\treturn compressionVariantMIMEType(variantTable, mimeType, nil)\n\n\tcase types.Compress:\n\t\tif updated.CompressionAlgorithm == nil {\n\t\t\tlogrus.Debugf(\"Error preparing updated manifest: blob %q was compressed but does not specify by which algorithm: falling back to use the original blob\", updated.Digest)\n\t\t\treturn mimeType, nil\n\t\t}\n\t\treturn compressionVariantMIMEType(variantTable, mimeType, updated.CompressionAlgorithm)\n\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"unknown compression operation (%d)\", updated.CompressionOperation)\n\t}\n}\n\n// ManifestLayerCompressionIncompatibilityError indicates that a specified compression algorithm\n// could not be applied to a layer MIME type. A caller that receives this should either retry\n// the call with a different compression algorithm, or attempt to use a different manifest type.\ntype ManifestLayerCompressionIncompatibilityError struct {\n\ttext string\n}\n\nfunc (m ManifestLayerCompressionIncompatibilityError) Error() string {\n\treturn m.text\n}\n", "spans": [{"start": 1111, "end": 1143, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "c16844b91d05744866dd90b250b26dbd"}], "hard_negatives": [{"start": 1177, "end": 1241, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "f26c94144a7cc0d5a44403c4877b09d17a9910dcc09274912d3c1a6ff19ee981"}]} -{"id": "ghcc-00066-202f0b76e1c44a16", "source": "codeparrot/github-code-clean", "repo": "Sosi/sosi.github.com", "license": "mit", "language": "Markdown", "path": "_posts/machine learning/2013-5-7-LDA.md", "text": "---\nlayout: post\ntitle: LDA主题模型简介\ncategory : machine learning\ntags: ['Machine Learning']\n---\n\nLDA主题模型简介\n========================================================\n\nD. M. Blei在2003年(准确地说应该是2002年)提出的LDA(Latent Dirichlet Allocation)模型(翻译成中文就是——潜在狄利克雷分配模型)让主题模型火了起来, 今年3月份我居然还发现了一个专门的LDA的[R软件包](http://cran.r-project.org/web/packages/lda/)(7月份有更新),可见主题模型方兴未艾呀。主题模型是一种语言模型,是对自然语言进行建模,这个在信息检索中很有用。\n\nLDA主题模型涉及到贝叶斯理论、Dirichlet分布、多项分布、图模型、变分推断、EM算法、Gibbs抽样等知识,不是很好懂,LDA那篇30 页的文章我看了四、五遍才基本弄明白是咋回事。那篇文章其实有点老了,但是很经典,从它衍生出来的文章现在已经有n多n多了。主题模型其实也不只是LDA 了,LDA之前也有主题模型,它是之前的一个突破,它之后也有很多对它进行改进的主题模型。需要注意的是,LDA也是有名的Linear Discriminant Analysis(线性判别分析)的缩写。\n\nLDA是一种非监督机器学习技术,可以用来识别大规模文档集(document collection)或语料库(corpus)中潜藏的主题信息。它采用了词袋(bag of words)的方法,这种方法将每一篇文档视为一个词频向量,从而将文本信息转化为了易于建模的数字信息。但是词袋方法没有考虑词与词之间的顺序,这简化了问题的复杂性,同时也为模型的改进提供了契机。每一篇文档代表了一些主题所构成的一个概率分布,而每一个主题又代表了很多单词所构成的一个概率分布。由于 Dirichlet分布随机向量各分量间的弱相关性(之所以还有点“相关”,是因为各分量之和必须为1),使得我们假想的潜在主题之间也几乎是不相关的,这与很多实际问题并不相符,从而造成了LDA的又一个遗留问题。\n\n对于语料库中的每篇文档,LDA定义了如下生成过程(generative process):\n\n1. 对每一篇文档,从主题分布中抽取一个主题;\n\n2. 从上述被抽到的主题所对应的单词分布中抽取一个单词;\n\n3. 重复上述过程直至遍历文档中的每一个单词。\n\n\n更形式化一点说,语料库中的每一篇文档与 $T$(通过反复试验等方法事先给定)个主题的一个多项分布相对应,将该多项分布记为 $\\theta$。每个主题又与词汇表(vocabulary)中的 V个单词的一个多项分布相对应,将这个多项分布记为$\\phi$。上述词汇表是由语料库中所有文档中的所有互异单词组成,但实际建模的时候要剔除一些停用词(stopword),还要进行一些词干化(stemming)处理等。$\\theta$和$\\phi$分别有一个带有超参数(hyperparamete) $\\alpha$ 和$ \\beta$的Dirichlet先验分布。对于一篇文档d中的每一个单词,我们从该文档所对应的多项分布$\\theta$中抽取一个主题z,然后我们再从主题z所对应的多项分布$\\phi$中抽取一个单词w。将这个过程重复Nd次,就产生了文档d,这里的Nd是文档d的单词总数。这个生成过程可以用如下的图模型表示:\n\n![alt Imag]({{site.url}}/image/statistical/LDA.png \"LDA\")\n\n\n 这个图模型表示法也称作“盘子表示法”(plate notation)。图中的阴影圆圈表示可观测变量(observed variable),非阴影圆圈表示潜在变量(latent variable),箭头表示两变量间的条件依赖性(conditional dependency),方框表示重复抽样,重复次数在方框的右下角。\n\n该模型有两个参数需要推断(infer):一个是“文档-主题”分布$\\theta$,另外是T个“主题-单词”分布$\\phi$。通过学习(learn)这两个参数,我们可以知道文档作者感兴趣的主题,以及每篇文档所涵盖的主题比例等。推断方法主要有LDA模型作者提出的变分-EM算法,还有现在常用的Gibbs抽样法。\n\n$$\n\\frac{1}{\\Bigl(\\sqrt{\\phi \\sqrt{5}}-\\phi\\Bigr) e^{\\frac25 \\pi}} = 1+\\frac{e^{-2\\pi}} {1+\\frac{e^{-4\\pi}} {1+\\frac{e^{-6\\pi}} {1+\\frac{e^{-8\\pi}} {1+\\ldots} } } }\n$$\n# TODO: remove hardcoded content_hash f0b1e1f5580d8c428f0a2ef12cd9d825decfbfeebfe188fee8364a6f53ae4656\n\t\nLDA模型现在已经成为了主题建模中的一个标准。如前所述,LDA模型自从诞生之后有了蓬勃的扩展,特别是在社会网络和社会媒体研究领域最为常见。\n\n我的理解\n-------------------------------------\n1. LDA之所以能够进行同义词的鉴别,其基础为一个document 是同质的,同质数据内部就是天然的同义词,从而实现了天然的无监督分类。\n\n2. 有人归纳[如下](http://cos.name/2010/10/lda_topic_model/):这种模型最难懂的地方是Dirichlet process prior. 也就是把一个随机过程作为prior。Dirichlet process是描述这样的一个过程,假设有一个中国餐馆,里面有无限多的桌子,中国人三五成群进来,咱中国人有扎堆的喜好,所以每进来一个人都会看已经坐下的里有没有自己的伙伴,如果有而且那个桌子还有空位子,那么就坐下来,如果没有位子了,只好新开一个桌子。这个过程其实是一个聚类的过程,如果用模型描述那么其实就是一个infinite mixture model.\n这样的模型优点在于你再也不需要指定你要聚多少类,单个样本到底该规为哪一类了。缺点是计算量会变得巨大,因为你每次都需要模拟Dirichlet process。\n\n3. 我使用Google的Code上的[PLDA](https://code.google.com/p/plda/)做过微博的分类,其效果非常的出色!\n\nReference\n---------------------------------------\n[LDA主题模型简介](http://cos.name/2010/10/lda_topic_model/)\n", "spans": [], "hard_negatives": [{"start": 2088, "end": 2152, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "f0b1e1f5580d8c428f0a2ef12cd9d825decfbfeebfe188fee8364a6f53ae4656"}]} -{"id": "ghcc-00069-71a42b3fb9ac091c", "source": "codeparrot/github-code-clean", "repo": "paredespablo/NodosApp", "license": "bsd-3-clause", "language": "Python", "path": "lib/pyfollowers.py", "text": "# -*- coding: utf-8 -*-\nimport Tkinter, tkMessageBox, tkFileDialog, time, re, os, shutil, codecs, imp, tweepy, networkx as nx\nfrom Tkinter import *\nfrom keys import *\n\n##Autenticacion con Tweepy y listas globales\nauth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)\nauth.set_access_token(ACCESS_KEY, ACCESS_SECRET)\napi = tweepy.API(auth)\n\n##Funcion para crear redes de followers a partir de un nombre de usuario\ndef followers():\n def libfo():\n user002 = user001.get()\n G=nx.DiGraph()\n G.nodes(data=True) \n\n followers_user = []\n\n a = user002\n # job_id = 28aab156-a6d3-4f62-b385-122567e37bf3\n followers_user.append(a)\n listade = file('listadefollowers.txt', 'a')\n\n # Descarga de los followers\n followersCursor = tweepy.Cursor(api.followers,id=a)\n print 'Obteniendo followers'\n for follower in followersCursor.items():\n foll = follower.screen_name\n followers_user.append(foll)\n print foll\n\n followers_ids = []\n for i in followers_user:\n try:\n data = api.get_user(i)\n i1 = data.id\n followers_ids.append(i1)\n except tweepy.error.TweepError, e:\n if e.response.status:\n error2 = e[0][0]\n error = error2['code']\n if error == 88:\n print error, error2['message'], \"Waiting for 15 minutes\"\n time.sleep(750)\n data = api.get_user(i)\n i1 = data.id\n followers_ids.append(i1)\n else:\n print e\n G.add_node(i)\n\n print >> listade, followers_ids\n listade.close()\n print 'Descarga de followers finalizada'\n\n # Descarga de followers de los followers\n print 'Obteniendo listas de Followers...'\n os.mkdir('datos')\n carpeta = 'datos/'\n for z in followers_ids:\n followers = []\n try:\n o = str(z)\n followersCursor = tweepy.Cursor(api.followers_ids,id=o)\n for follower in followersCursor.items():\n foll = follower\n followers.append(foll)\n ii = file(carpeta + o + '.txt', 'w')\n print >> ii, followers\n except tweepy.error.TweepError, e:\n if e.response.status == 400:\n print e\n time.sleep(3600)\n try:\n o = str(z)\n followersCursor = tweepy.Cursor(api.followers_ids,id=o)\n for follower in followersCursor.items():\n foll = follower\n followers.append(foll)\n ii = file(carpeta + o + '.txt', 'w')\n print >> ii, followers\n except tweepy.error.TweepError, e:\n o = str(z)\n print e\n time.sleep(1)\n ii = file(carpeta + o + '.txt', 'w')\n print >> ii, 0\n else:\n print e\n time.sleep(1)\n ii = file(carpeta + o + '.txt', 'w')\n print >> ii, 0\n #print o, len(followers)\n\n ii.close()\n\n # Cruce de datos para comprobar lazos\n for p in followers_ids:\n h = str(p)\n archivo = file(carpeta + h + '.txt', 'r')\n KEY = '182092392e35f8c7977f002e29729c02a3a00995'\n ff = archivo.read()\n for q in followers_ids:\n k = str(q)\n if (k in ff) is True:\n k1 = followers_ids.index(p)\n k2 = followers_ids.index(q)\n u1 = followers_user[k1]\n u2 = followers_user[k2]\n G.add_edge(u2, u1)\n else:\n pass\n archivo.close()\n print 'Borrando archivos temporales...'\n shutil.rmtree(carpeta)\n # Exportaciones de redes a GEXF y NET\n print 'Red finalizada'\n nx.draw_random(G)\n nx.write_pajek(G, a + \".net\", encoding='UTF-8')\n nx.write_gexf(G, a + \".gexf\", encoding='utf-8', prettyprint=True)\n return False\n \n if tkMessageBox.askokcancel(\"Crear red de followers\", \"Este proceso puede tardar varias horas dependiendo el numero de seguidores de la cuenta\\n\\n¿Desea continuar con la operación?\"):\n global user001\n root2 =Tk()\n f = Frame(root2, width=1000, height=60)\n f.pack(fill=X, expand=True)\n root2.title('NodosApp: Red de Followers')\n l = Label(f, text=\"Ingresa el nombre de usuario a analizar\")\n l.pack()\n user001 = StringVar(f)\n user000 = Entry(f, textvariable=user001, width=30).pack(side= TOP,padx=10,pady=12)\n but1 = Button(f, text='Crear red de followers', command=libfo, width=25)\n but1.pack(side=LEFT)\n root2.resizable(width=FALSE, height=FALSE)\n root2.mainloop()\n else:\n return False\n\n##Funcion para crear redes de friends/following a partir de un nombre de usuario\ndef following():\n def libfr():\n user002 = user001.get()\n G=nx.DiGraph()\n G.nodes(data=True) \n\n followers_user = []\n\n a = user002\n followers_user.append(a)\n followersCursor = tweepy.Cursor(api.friends,id=a)\n print 'Obteniendo followers'\n for follower in followersCursor.items():\n foll = follower.screen_name\n #print foll\n followers_user.append(foll)\n\n followers_ids = []\n for i in followers_user:\n try:\n data = api.get_user(i)\n i1 = data.id\n followers_ids.append(i1)\n except tweepy.error.TweepError, e:\n if e.response.status == 400:\n print e\n time.sleep(3600)\n data = api.get_user(i)\n i1 = data.id\n followers_ids.append(i1)\n else:\n print e\n G.add_node(i)\n\n print 'Obteniendo listas de Followers...'\n os.mkdir('datos')\n carpeta = 'datos/'\n for z in followers_ids:\n followers = []\n try:\n o = str(z)\n followersCursor = tweepy.Cursor(api.friends_ids,id=o)\n for follower in followersCursor.items():\n foll = follower\n followers.append(foll)\n ii = file(carpeta + o + '.txt', 'w')\n print >> ii, followers\n except tweepy.error.TweepError, e:\n if e.response.status == 400:\n print e\n time.sleep(3600)\n try:\n o = str(z)\n followersCursor = tweepy.Cursor(api.friends_ids,id=o)\n for follower in followersCursor.items():\n foll = follower\n followers.append(foll)\n ii = file(carpeta + o + '.txt', 'w')\n print >> ii, followers\n except tweepy.error.TweepError, e:\n o = str(z)\n print e\n time.sleep(1)\n ii = file(carpeta + o + '.txt', 'w')\n print >> ii, 0\n else:\n print e\n time.sleep(1)\n ii = file(carpeta + o + '.txt', 'w')\n print >> ii, 0\n revision='9de82cc1845ef1357371b116a4d7457e',\n #print o, len(followers)\n\n ii.close()\n for p in followers_ids:\n h = str(p)\n archivo = file(carpeta + h + '.txt', 'r')\n ff = archivo.read()\n for q in followers_ids:\n k = str(q)\n if (k in ff) is True:\n k1 = followers_ids.index(p)\n k2 = followers_ids.index(q)\n u1 = followers_user[k1]\n u2 = followers_user[k2]\n G.add_edge(u2, u1)\n else:\n pass\n archivo.close()\n print 'Borrando archivos temporales...'\n shutil.rmtree(carpeta)\n nx.draw_random(G)\n \n nx.write_pajek(G, a + \".net\", encoding='UTF-8')\n nx.write_gexf(G, a + \".gexf\", encoding='utf-8', prettyprint=True)\n print 'Red finalizada'\n return False\n\n if tkMessageBox.askokcancel(\"Crear red de friends\", \"Este proceso puede tardar varias horas dependiendo el numero de usuarios que siga la cuenta\\n\\n¿Desea continuar con la operación?\"):\n global user001\n root2 =Tk()\n f = Frame(root2, width=1000, height=60)\n f.pack(fill=X, expand=True)\n root2.title('NodosApp: Red de Friends')\n l = Label(f, text=\"Ingresa el nombre de usuario a analizar\")\n l.pack()\n user001 = StringVar(f)\n user000 = Entry(f, textvariable=user001, width=30).pack(side= TOP,padx=10,pady=12)\n but1 = Button(f, text='Crear red de friends', command=libfr, width=25)\n but1.pack(side=LEFT)\n root2.resizable(width=FALSE, height=FALSE)\n root2.mainloop()\n else:\n return False\n\n## Script para descargar los ultimos 3200 tweets de un usuario\n \ndef menciones():\n def algmen():\n tweets = []\n user002 = user001.get()\n output = codecs.open(user002 + '.txt', 'a', 'utf-8')\n for page in range(1,32):\n data = api.user_timeline(user002, page=page, include_rts=True, count=200)\n for status in data:\n screen_name = status.user.screen_name\n user_id = status.user.id\n name = status.user.name\n followers_count = status.user.followers_count\n friends_count = status.user.friends_count\n statuses_count = status.user.statuses_count\n created_at = status.created_at\n idioma = status.lang\n autorreg = status.user.created_at\n \n location0 = status.user.location\n location1 = location0.splitlines()\n location2 = \" \".join(location1)\n location = re.sub(\"[,]\", '', location2)\n \n mensaje_id = status.id\n try:\n geo_d = SearchResult.geo['coordinates']\n except:\n geo_d = '[0]'\n source = status.source\n texto0 = status.text\n texto1 = texto0.splitlines()\n mensaje_texto1 = \" \".join(texto1)\n mensaje_texto = re.sub(\"[,]\", '', mensaje_texto1)\n\n if mensaje_id in tweets:\n pass\n else:\n tweets.append(mensaje_id)\n print >> output, '\"'+str(mensaje_id)+'\",\"'+screen_name+'\",\"'+name+'\",\"'+str(user_id)+'\",\"'+str(autorreg)+'\",\"'+str(followers_count)+'\",\"'+str(friends_count)+'\",\"'+str(statuses_count)+'\",\"'+location+'\",\"'+str(created_at)+'\",\"'+str(geo_d)+'\",\"'+source+'\",\"'+idioma+'\",\"'+mensaje_texto+'\"'\n total = int(len(tweets))\n \n print 'Tweets totales descargados:', len(tweets)\n time.sleep(1)\n output.close()\n return False\n\n global user001\n root2 =Tk()\n f = Frame(root2, width=1000, height=60)\n f.pack(fill=X, expand=True)\n root2.title('NodosApp: Interacciones')\n l = Label(f, text=\"Ingresa el nombre de usuario a analizar\")\n l.pack()\n user001 = StringVar(f)\n user000 = Entry(f, textvariable=user001, width=30).pack(side= TOP,padx=10,pady=12)\n but1 = Button(f, text='Descargar timeline', command=algmen, width=25)\n but1.pack(side=LEFT)\n root2.resizable(width=FALSE, height=FALSE)\n root2.mainloop()\n\ndef mapafollow():\n ##Autenticacion con Tweepy y listas globales\n auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET)\n auth.set_access_token(ACCESS_KEY, ACCESS_SECRET)\n api = tweepy.API(auth)\n\n usuarios = []\n ids = []\n data3 = tkFileDialog.askopenfilename(title=\"Open file\", filetypes=[(\"TXT files\",\".txt\"),(\"All files\",\".*\")])\n data2 = file(data3, 'r')\n data = data2.readlines()\n n1 = data3.split('/')\n n2 = n1[-1]\n n3 = n2[0:-4]\n print 'Cargado el archivo', n3\n\n for i in data:\n i = i.split(\" \")\n usuarios.append(i[0].strip())\n print 'Usuarios', usuarios\n\n G=nx.DiGraph()\n for k in usuarios:\n for p in usuarios:\n time.sleep(5)\n if (G.has_edge(p, k) or G.has_edge(k, p) or (usuarios.index(k) >= usuarios.index(p))) == True:\n pass\n else:\n print k, p\n try:\n rel = api.show_friendship(source_screen_name=k, target_screen_name=p)\n for q in rel:\n if q.following == True:\n G.add_edge(k, p)\n\n if q.followed_by == True:\n G.add_edge(p, k)\n except:\n print 'error entre usuarios', k, p\n\n n4 = str(n3) + \".gexf\"\n nx.write_gexf(G, n4, encoding='utf-8', prettyprint=True)\n\n print 'Se ha terminado de escribir la red', n4\n \n", "spans": [{"start": 3640, "end": 3680, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "182092392e35f8c7977f002e29729c02a3a00995"}], "hard_negatives": [{"start": 603, "end": 639, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "28aab156-a6d3-4f62-b385-122567e37bf3"}, {"start": 7838, "end": 7870, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "9de82cc1845ef1357371b116a4d7457e"}]} -{"id": "ghcc-00069-c681a063fb70edf4", "source": "codeparrot/github-code-clean", "repo": "davebarnes97/geode", "license": "apache-2.0", "language": "Java", "path": "geode-core/src/distributedTest/java/org/apache/geode/internal/cache/ha/HARegionQueueDUnitTest.java", "text": "/*\n * Licensed to the Apache Software Foundation (ASF) under one or more contributor license\n * agreements. See the NOTICE file distributed with this work for additional information regarding\n * copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the\n * \"License\"); you may not use this file except in compliance with the License. You may obtain a\n * copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under the License\n * is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express\n * or implied. See the License for the specific language governing permissions and limitations under\n * the License.\n */\npackage org.apache.geode.internal.cache.ha;\n\nimport static java.lang.Thread.yield;\nimport static org.apache.geode.internal.cache.ha.HARegionQueue.NON_BLOCKING_HA_QUEUE;\nimport static org.apache.geode.internal.cache.ha.HARegionQueue.getHARegionQueueInstance;\nimport static org.apache.geode.internal.statistics.StatisticsClockFactory.disabledClock;\nimport static org.apache.geode.test.awaitility.GeodeAwaitility.await;\nimport static org.apache.geode.test.dunit.Assert.assertEquals;\nimport static org.apache.geode.test.dunit.Assert.assertNotNull;\nimport static org.apache.geode.test.dunit.Assert.assertNull;\nimport static org.apache.geode.test.dunit.Assert.assertTrue;\nimport static org.apache.geode.test.dunit.Assert.fail;\nimport static org.apache.geode.test.dunit.ThreadUtils.join;\nimport static org.mockito.ArgumentMatchers.any;\nimport static org.mockito.Mockito.mock;\nimport static org.mockito.Mockito.when;\n\nimport java.util.Iterator;\nimport java.util.List;\nimport java.util.Map;\nimport java.util.Properties;\nimport java.util.Set;\n\nimport org.junit.Ignore;\nimport org.junit.Test;\nimport org.junit.experimental.categories.Category;\nimport org.mockito.AdditionalAnswers;\n\nimport org.apache.geode.LogWriter;\nimport org.apache.geode.cache.AttributesFactory;\nimport org.apache.geode.cache.CacheException;\nimport org.apache.geode.cache.CacheFactory;\nimport org.apache.geode.cache.DataPolicy;\nimport org.apache.geode.cache.EntryEvent;\nimport org.apache.geode.cache.Region;\nimport org.apache.geode.cache.Scope;\nimport org.apache.geode.cache.util.CacheListenerAdapter;\nimport org.apache.geode.cache30.CacheSerializableRunnable;\nimport org.apache.geode.distributed.DistributedSystem;\nimport org.apache.geode.internal.cache.Conflatable;\nimport org.apache.geode.internal.cache.EntryEventImpl;\nimport org.apache.geode.internal.cache.EventID;\nimport org.apache.geode.internal.cache.GemFireCacheImpl;\nimport org.apache.geode.internal.cache.HARegion;\nimport org.apache.geode.internal.cache.InternalCache;\nimport org.apache.geode.test.awaitility.GeodeAwaitility;\nimport org.apache.geode.test.dunit.Host;\nimport org.apache.geode.test.dunit.SerializableCallable;\nimport org.apache.geode.test.dunit.ThreadUtils;\nimport org.apache.geode.test.dunit.VM;\nimport org.apache.geode.test.dunit.WaitCriterion;\nimport org.apache.geode.test.dunit.internal.JUnit4DistributedTestCase;\nimport org.apache.geode.test.junit.categories.ClientSubscriptionTest;\n\n@Category({ClientSubscriptionTest.class})\npublic class HARegionQueueDUnitTest extends JUnit4DistributedTestCase {\n\n private static volatile boolean toCnt = true;\n private static volatile Thread createQueuesThread;\n\n private static InternalCache cache = null;\n private static HARegionQueue hrq = null;\n private static Thread[] opThreads;\n\n private VM vm0 = null;\n private VM vm1 = null;\n private VM vm3 = null;\n private VM vm2 = null;\n\n /**\n * get the VM's\n */\n @Override\n public final void postSetUp() throws Exception {\n final Host host = Host.getHost(0);\n vm0 = host.getVM(0);\n vm1 = host.getVM(1);\n vm2 = host.getVM(2);\n vm3 = host.getVM(3);\n vm0.invoke(() -> HARegionQueueDUnitTest.toCnt = true);\n vm1.invoke(() -> HARegionQueueDUnitTest.toCnt = true);\n vm2.invoke(() -> HARegionQueueDUnitTest.toCnt = true);\n vm3.invoke(() -> HARegionQueueDUnitTest.toCnt = true);\n }\n\n /**\n * close the cache in tearDown\n */\n @Override\n public final void preTearDown() throws Exception {\n vm0.invoke(() -> HARegionQueueDUnitTest.closeCache());\n vm1.invoke(() -> HARegionQueueDUnitTest.closeCache());\n vm2.invoke(() -> HARegionQueueDUnitTest.closeCache());\n vm3.invoke(() -> HARegionQueueDUnitTest.closeCache());\n\n cache = null;\n hrq = null;\n opThreads = null;\n }\n\n /**\n * create cache\n */\n private InternalCache createCache() throws CacheException {\n Properties props = new Properties();\n DistributedSystem ds = getSystem(props);\n ds.disconnect();\n ds = getSystem(props);\n InternalCache cache = null;\n cache = (InternalCache) CacheFactory.create(ds);\n if (cache == null) {\n // TODO: never throw an anonymous inner class\n throw new CacheException(\"CacheFactory.create() returned null \") {};\n }\n return cache;\n }\n\n /**\n * 1) Create mirrored HARegion region1 in VM1 and VM2 2) do a put in VM1 3) assert that the put\n * has not propagated from VM1 to VM2 4) do a put in VM2 5) assert that the value in VM1 has not\n * changed to due to put in VM2 6) assert put in VM2 was successful by doing a get\n */\n @Test\n public void testLocalPut() throws Exception {\n vm0.invoke(() -> HARegionQueueDUnitTest.createRegion());\n vm1.invoke(() -> HARegionQueueDUnitTest.createRegion());\n vm0.invoke(() -> HARegionQueueDUnitTest.putValue1());\n vm1.invoke(() -> HARegionQueueDUnitTest.getNull());\n vm1.invoke(() -> HARegionQueueDUnitTest.putValue2());\n vm0.invoke(() -> HARegionQueueDUnitTest.getValue1());\n vm1.invoke(() -> HARegionQueueDUnitTest.getValue2());\n }\n\n /**\n * 1) Create mirrored HARegion region1 in VM1 and VM2 2) do a put in VM1 3) assert that the put\n * has not propagated from VM1 to VM2 4) do a put in VM2 5) assert that the value in VM1 has not\n * changed to due to put in VM2 6) assert respective puts the VMs were successful by doing a get\n * 7) localDestroy key in VM1 8) assert key has been destroyed in VM1 9) assert key has not been\n * destroyed in VM2\n */\n @Test\n public void testLocalDestroy() throws Exception {\n vm0.invoke(() -> HARegionQueueDUnitTest.createRegion());\n vm1.invoke(() -> HARegionQueueDUnitTest.createRegion());\n vm0.invoke(() -> HARegionQueueDUnitTest.putValue1());\n vm1.invoke(() -> HARegionQueueDUnitTest.getNull());\n vm1.invoke(() -> HARegionQueueDUnitTest.putValue2());\n vm0.invoke(() -> HARegionQueueDUnitTest.getValue1());\n vm1.invoke(() -> HARegionQueueDUnitTest.getValue2());\n vm0.invoke(() -> HARegionQueueDUnitTest.destroy());\n vm0.invoke(() -> HARegionQueueDUnitTest.getNull());\n vm1.invoke(() -> HARegionQueueDUnitTest.getValue2());\n }\n\n /**\n * 1) Create mirrored HARegion region1 in VM1 2) do a put in VM1 3) get the value in VM1 to assert\n * put has happened successfully 4) Create mirrored HARegion region1 in VM2 5) do a get in VM2 to\n * verify that value was got through GII 6) do a put in VM2 7) assert put in VM2 was successful\n */\n @Test\n public void testGII() throws Exception {\n vm0.invoke(() -> HARegionQueueDUnitTest.createRegion());\n vm0.invoke(() -> HARegionQueueDUnitTest.putValue1());\n vm0.invoke(() -> HARegionQueueDUnitTest.getValue1());\n vm1.invoke(() -> HARegionQueueDUnitTest.createRegion());\n vm1.invoke(() -> HARegionQueueDUnitTest.getValue1());\n vm1.invoke(() -> HARegionQueueDUnitTest.putValue2());\n vm1.invoke(() -> HARegionQueueDUnitTest.getValue2());\n }\n\n /**\n * 1) Create mirrored HARegion region1 in VM1 2) do a put in VM1 3) get the value in VM1 to assert\n * put has happened successfully 4) Create mirrored HARegion region1 in VM2 5) do a get in VM2 to\n * verify that value was got through GII 6) do a put in VM2 7) assert put in VM2 was successful\n */\n @Test\n public void testQRM() throws Exception {\n vm0.invoke(() -> HARegionQueueDUnitTest.createRegionQueue());\n vm1.invoke(() -> HARegionQueueDUnitTest.createRegionQueue());\n vm0.invoke(() -> HARegionQueueDUnitTest.verifyAddingDispatchMesgs());\n\n vm1.invoke(() -> HARegionQueueDUnitTest.verifyDispatchedMessagesRemoved());\n }\n\n /**\n * Behaviour of take() has been changed for reliable messaging feature. Region queue take()\n * operation will no longer add to the Dispatch Message Map. Hence disabling the test - SUYOG\n *\n * Test for #35988 HARegionQueue.take() is not functioning as expected\n */\n @Ignore(\"TODO: this test was disabled\")\n @Test\n public void testBugNo35988() throws Exception {\n CacheSerializableRunnable createQueue =\n new CacheSerializableRunnable(\"CreateCache, HARegionQueue and start thread\") {\n @Override\n public void run2() throws CacheException {\n HARegionQueueDUnitTest test = new HARegionQueueDUnitTest();\n // TODO:ASIF: Bcoz of the QRM thread cannot take frequency below\n // 1 second , thus we need to carfully evaluate what to do. Though\n // in this case 1 second instead of 500 ms will work\n // System.getProperties().put(\"QueueRemovalThreadWaitTime\", new Long(500));\n cache = test.createCache();\n cache.setMessageSyncInterval(1);\n HARegionQueueAttributes hrqa = new HARegionQueueAttributes();\n hrqa.setExpiryTime(300);\n try {\n hrq = HARegionQueue.getHARegionQueueInstance(\"testregion1\", cache, hrqa,\n HARegionQueue.NON_BLOCKING_HA_QUEUE, false, disabledClock());\n // Do 1000 putand 100 take in a separate thread\n hrq.put(new ConflatableObject(new Long(1), new Long(1),\n new EventID(new byte[] {0}, 1, 1), false, \"dummy\"));\n } catch (Exception e) {\n throw new AssertionError(e);\n }\n }\n };\n vm0.invoke(createQueue);\n vm1.invoke(createQueue);\n\n vm0.invoke(new CacheSerializableRunnable(\"takeFromVm0\") {\n @Override\n public void run2() throws CacheException {\n try {\n Conflatable obj = (Conflatable) hrq.take();\n assertNotNull(obj);\n } catch (Exception e) {\n throw new AssertionError(e);\n }\n }\n });\n\n vm1.invoke(new CacheSerializableRunnable(\"checkInVm1\") {\n @Override\n public void run2() throws CacheException {\n WaitCriterion ev = new WaitCriterion() {\n @Override\n public boolean done() {\n yield(); // TODO is this necessary?\n return hrq.size() == 0;\n }\n\n @Override\n public String description() {\n return null;\n }\n };\n GeodeAwaitility.await().untilAsserted(ev);\n }\n });\n\n }\n\n /**\n * create a client with 2 regions sharing a common writer\n */\n private static void createRegion() throws Exception {\n HARegionQueueDUnitTest test = new HARegionQueueDUnitTest();\n cache = test.createCache();\n AttributesFactory factory = new AttributesFactory();\n factory.setScope(Scope.DISTRIBUTED_ACK);\n factory.setDataPolicy(DataPolicy.REPLICATE);\n\n // Mock the HARegionQueue and answer the input CachedDeserializable when updateHAEventWrapper is\n // called\n HARegionQueue harq = mock(HARegionQueue.class);\n when(harq.updateHAEventWrapper(any(), any(), any()))\n .thenAnswer(AdditionalAnswers.returnsSecondArg());\n\n HARegion.getInstance(\"HARegionQueueDUnitTest_region\", (GemFireCacheImpl) cache, harq,\n factory.create(), disabledClock());\n }\n\n private static void createRegionQueue() throws Exception {\n HARegionQueueDUnitTest test = new HARegionQueueDUnitTest();\n cache = test.createCache();\n /*\n * AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK);\n * factory.setDataPolicy(DataPolicy.REPLICATE);\n */\n hrq = HARegionQueue.getHARegionQueueInstance(\"HARegionQueueDUnitTest_region\", cache,\n HARegionQueue.NON_BLOCKING_HA_QUEUE, false, disabledClock());\n EventID id1 = new EventID(new byte[] {1}, 1, 1);\n EventID id2 = new EventID(new byte[] {1}, 1, 2);\n ConflatableObject c1 =\n new ConflatableObject(\"1\", \"1\", id1, false, \"HARegionQueueDUnitTest_region\");\n ConflatableObject c2 =\n new ConflatableObject(\"2\", \"2\", id2, false, \"HARegionQueueDUnitTest_region\");\n hrq.put(c1);\n hrq.put(c2);\n }\n\n private static void createRegionQueue2() throws Exception {\n HARegionQueueDUnitTest test = new HARegionQueueDUnitTest();\n cache = test.createCache();\n /*\n * AttributesFactory factory = new AttributesFactory(); factory.setScope(Scope.DISTRIBUTED_ACK);\n * factory.setDataPolicy(DataPolicy.REPLICATE);\n */\n HARegionQueueAttributes harqAttr = new HARegionQueueAttributes();\n harqAttr.setExpiryTime(3);\n hrq = HARegionQueue.getHARegionQueueInstance(\"HARegionQueueDUnitTest_region\", cache, harqAttr,\n HARegionQueue.NON_BLOCKING_HA_QUEUE, false, disabledClock());\n }\n\n private static void clearRegion() {\n try {\n Iterator iterator = hrq.getRegion().keys().iterator();\n while (iterator.hasNext()) {\n hrq.getRegion().localDestroy(iterator.next());\n }\n } catch (Exception e) {\n fail(\"Exception occurred while trying to destroy region\", e);\n }\n\n }\n\n private static void verifyAddingDispatchMesgs() {\n assertTrue(HARegionQueue.getDispatchedMessagesMapForTesting().isEmpty());\n hrq.addDispatchedMessage(new ThreadIdentifier(new byte[1], 1), 1);\n assertTrue(!HARegionQueue.getDispatchedMessagesMapForTesting().isEmpty());\n }\n\n private static void verifyDispatchedMessagesRemoved() {\n try {\n final Region region = hrq.getRegion();\n // wait until we have a dead server\n WaitCriterion ev = new WaitCriterion() {\n @Override\n public boolean done() {\n yield(); // TODO is this necessary?\n return region.get(new Long(0)) == null;\n }\n\n @Override\n public String description() {\n return null;\n }\n };\n GeodeAwaitility.await().untilAsserted(ev);\n\n /*\n * if (region.get(new Long(0)) != null) { fail(\"Expected message to have been deleted but it\n * is not deleted\"); }\n */\n\n if (region.get(new Long(1)) == null) {\n fail(\"Expected message not to have been deleted but it is deleted\");\n }\n\n } catch (Exception e) {\n fail(\"test failed due to an exception\", e);\n }\n }\n\n /**\n * close the cache\n */\n private static void closeCache() {\n if (cache != null && !cache.isClosed()) {\n cache.close();\n cache.getDistributedSystem().disconnect();\n }\n }\n\n /**\n * do puts on key-1\n */\n private static void putValue1() {\n try {\n Region r1 = cache.getRegion(\"/HARegionQueueDUnitTest_region\");\n r1.put(\"key-1\", \"value-1\");\n } catch (Exception ex) {\n fail(\"failed while region.put()\", ex);\n }\n }\n\n private static void putConflatables() {\n try {\n Region r1 = hrq.getRegion();\n for (int i = 1; i < 11; i++) {\n r1.put(new Long(i), new ConflatableObject(\"key\" + i, \"value\" + i,\n new EventID(new byte[] {1}, 1, i), true, \"HARegionQueueDUnitTest_region\"));\n }\n } catch (Exception ex) {\n fail(\"failed while region.put()\", ex);\n }\n }\n\n /**\n * verifies the data has been populated correctly after GII\n */\n private static void verifyMapsAndData() {\n try {\n HARegion r1 = (HARegion) hrq.getRegion();\n // region should not be null\n assertNotNull(\" Did not expect the HARegion to be null but it is\", r1);\n // it should have ten non null entries\n for (int i = 1; i < 11; i++) {\n assertNotNull(\" Did not expect the entry to be null but it is\", r1.get(new Long(i)));\n }\n // HARegionQueue should not be null\n assertNotNull(\" Did not expect the HARegionQueue to be null but it is\", hrq);\n\n Map conflationMap = hrq.getConflationMapForTesting();\n // conflationMap size should be greater than 0\n assertTrue(\" Did not expect the conflationMap size to be 0 but it is\",\n conflationMap.size() > 0);\n Map internalMap = (Map) conflationMap.get(\"HARegionQueueDUnitTest_region\");\n // internal map should not be null. it should be present\n assertNotNull(\" Did not expect the internalMap to be null but it is\", internalMap);\n // get and verify the entries in the conflation map.\n for (int i = 1; i < 11; i++) {\n assertTrue(\" Did not expect the entry not to be equal but it is\",\n internalMap.get(\"key\" + i).equals(new Long(i)));\n }\n Map eventMap = hrq.getEventsMapForTesting();\n // DACE should not be null\n assertNotNull(\" Did not expect the result (DACE object) to be null but it is\",\n eventMap.get(new ThreadIdentifier(new byte[] {1}, 1)));\n Set counterSet = hrq.getCurrentCounterSet(new EventID(new byte[] {1}, 1, 1));\n assertTrue(\" excpected the counter set size to be 10 but it is not so\",\n counterSet.size() == 10);\n long i = 1;\n Iterator iterator = counterSet.iterator();\n // verify the order of the iteration. it should be 1 - 10. The underlying\n // set is a LinkedHashSet\n while (iterator.hasNext()) {\n assertTrue(((Long) iterator.next()).longValue() == i);\n i++;\n }\n // The last dispactchde sequence Id should be -1 since no dispatch has\n // been made\n assertTrue(hrq.getLastDispatchedSequenceId(new EventID(new byte[] {1}, 1, 1)) == -1);\n\n // sleep for 8.0 seconds. Everythign should expire and everything should\n // be null and empty\n Thread.sleep(7500);\n\n for (int j = 1; j < 11; j++) {\n assertNull(\"expected the entry to be null since expiry time exceeded but it is not so\",\n r1.get(new Long(j)));\n }\n\n internalMap = (Map) hrq.getConflationMapForTesting().get(\"HARegionQueueDUnitTest_region\");\n\n assertNotNull(\" Did not expect the internalMap to be null but it is\", internalMap);\n assertTrue(\n \"internalMap (conflation) should have been emptry since expiry of all entries has been exceeded but it is not so\",\n internalMap.isEmpty());\n assertTrue(\n \"eventMap should have been emptry since expiry of all entries has been exceeded but it is not so\",\n eventMap.isEmpty());\n assertTrue(\n \"counter set should have been emptry since expiry of all entries has been exceeded but it is not so\",\n counterSet.isEmpty());\n\n } catch (Exception ex) {\n fail(\"failed while region.put()\", ex);\n }\n }\n\n /**\n * do puts on key-1,value-2\n */\n private static void putValue2() {\n try {\n Region r1 = cache.getRegion(\"/HARegionQueueDUnitTest_region\");\n r1.put(\"key-1\", \"value-2\");\n } catch (Exception ex) {\n fail(\"failed while region.put()\", ex);\n }\n }\n\n /**\n * do a get on region1\n */\n private static void getValue1() {\n try {\n Region r = cache.getRegion(\"/HARegionQueueDUnitTest_region\");\n if (!(r.get(\"key-1\").equals(\"value-1\"))) {\n fail(\"expected value to be value-1 but it is not so\");\n }\n\n } catch (Exception ex) {\n fail(\"failed while region.get()\", ex);\n }\n }\n\n /**\n * do a get on region1\n */\n private static void getNull() {\n try {\n Region r = cache.getRegion(\"/HARegionQueueDUnitTest_region\");\n if (!(r.get(\"key-1\") == (null))) {\n fail(\"expected value to be null but it is not so\");\n }\n\n } catch (Exception ex) {\n fail(\"failed while region.get()\", ex);\n }\n }\n\n /**\n * do a get on region1\n */\n public static void getValue2() {\n try {\n Region r = cache.getRegion(\"/HARegionQueueDUnitTest_region\");\n if (!(r.get(\"key-1\").equals(\"value-2\"))) {\n fail(\"expected value to be value-2 but it is not so\");\n }\n\n } catch (Exception ex) {\n fail(\"failed while region.get()\", ex);\n }\n }\n\n /**\n * destroy key-1\n */\n public static void destroy() {\n try {\n Region region1 = cache.getRegion(\"/HARegionQueueDUnitTest_region\");\n region1.localDestroy(\"key-1\");\n } catch (Exception e) {\n fail(\"test failed due to exception in destroy\", e);\n }\n }\n\n /**\n * Tests the Non Blocking HARegionQueue by doing concurrent put /remove / take / peek , batch peek\n * operations in multiple regions. The test will have take/remove occuring in all the VMs. This\n * test is targetted to test for hang or exceptions in non blocking queue.\n */\n @Test\n public void testConcurrentOperationsDunitTestOnNonBlockingQueue() throws Exception {\n concurrentOperationsDunitTest(false, Scope.DISTRIBUTED_ACK);\n }\n\n /**\n * Tests the Non Blocking HARegionQueue by doing concurrent put /remove / take / peek , batch peek\n * operations in multiple regions. The test will have take/remove occuring in all the VMs. This\n * test is targetted to test for hang or exceptions in non blocking queue.\n */\n @Test\n public void testConcurrentOperationsDunitTestOnNonBlockingQueueWithDNoAckRegion()\n throws Exception {\n concurrentOperationsDunitTest(false, Scope.DISTRIBUTED_NO_ACK);\n }\n\n /**\n * Tests the Blokcing HARegionQueue by doing concurrent put /remove / take / peek , batch peek\n * operations in multiple regions. The test will have take/remove occuring in all the VMs. This\n * test is targetted to test for hang or exceptions in blocking queue.\n */\n @Test\n public void testConcurrentOperationsDunitTestOnBlockingQueue() throws Exception {\n concurrentOperationsDunitTest(true, Scope.DISTRIBUTED_ACK);\n }\n\n private void concurrentOperationsDunitTest(final boolean createBlockingQueue,\n final Scope rscope) {\n // Create Cache and HARegionQueue in all the 4 VMs.\n\n CacheSerializableRunnable createRgnsAndQueues = new CacheSerializableRunnable(\n \"CreateCache, mirrored Region & HARegionQueue with a CacheListener\") {\n @Override\n public void run2() throws CacheException {\n HARegionQueueDUnitTest test = new HARegionQueueDUnitTest();\n System.getProperties().put(\"QueueRemovalThreadWaitTime\", \"2000\");\n cache = test.createCache();\n AttributesFactory factory = new AttributesFactory();\n factory.setScope(rscope);\n factory.setDataPolicy(DataPolicy.REPLICATE);\n HARegionQueueAttributes hrqa = new HARegionQueueAttributes();\n hrqa.setExpiryTime(5);\n try {\n if (createBlockingQueue) {\n hrq = HARegionQueue.getHARegionQueueInstance(\"testregion1\", cache, hrqa,\n HARegionQueue.BLOCKING_HA_QUEUE, false, disabledClock());\n } else {\n hrq = HARegionQueue.getHARegionQueueInstance(\"testregion1\", cache, hrqa,\n HARegionQueue.NON_BLOCKING_HA_QUEUE, false, disabledClock());\n }\n } catch (Exception e) {\n throw new AssertionError(e);\n }\n factory.addCacheListener(new CacheListenerAdapter() {\n @Override\n public void afterCreate(final EntryEvent event) {\n if (toCnt) {\n Conflatable conflatable = new ConflatableObject(event.getKey(), event.getNewValue(),\n ((EntryEventImpl) event).getEventId(), false, event.getRegion().getFullPath());\n\n try {\n hrq.put(conflatable);\n } catch (Exception e) {\n fail(\"The put operation in queue did not succeed due to exception =\", e);\n }\n }\n }\n\n @Override\n public void afterUpdate(final EntryEvent event) {\n if (toCnt) {\n Conflatable conflatable = new ConflatableObject(event.getKey(), event.getNewValue(),\n ((EntryEventImpl) event).getEventId(), true, event.getRegion().getFullPath());\n\n try {\n hrq.put(conflatable);\n } catch (Exception e) {\n fail(\"The put operation in queue did not succeed due to exception =\", e);\n }\n }\n }\n\n });\n\n cache.createRegion(\"test_region\", factory.create());\n\n }\n };\n\n vm0.invoke(createRgnsAndQueues);\n vm1.invoke(createRgnsAndQueues);\n vm2.invoke(createRgnsAndQueues);\n vm3.invoke(createRgnsAndQueues);\n CacheSerializableRunnable spawnThreadsAndperformOps =\n new CacheSerializableRunnable(\"Spawn multiple threads which do various operations\") {\n\n @Override\n public void run2() throws CacheException {\n opThreads = new RunOp[4 + 2 + 2 + 2];\n for (int i = 0; i < 4; ++i) {\n opThreads[i] = new RunOp(RunOp.PUT, i);\n }\n for (int i = 4; i < 6; ++i) {\n opThreads[i] = new RunOp(RunOp.PEEK, i);\n }\n\n for (int i = 6; i < 8; ++i) {\n opThreads[i] = new RunOp(RunOp.TAKE, i);\n }\n\n for (int i = 8; i < 10; ++i) {\n opThreads[i] = new RunOp(RunOp.TAKE, i);\n }\n\n for (int i = 0; i < opThreads.length; ++i) {\n opThreads[i].start();\n }\n\n }\n };\n\n vm0.invokeAsync(spawnThreadsAndperformOps);\n vm1.invokeAsync(spawnThreadsAndperformOps);\n vm2.invokeAsync(spawnThreadsAndperformOps);\n vm3.invokeAsync(spawnThreadsAndperformOps);\n\n\n SerializableCallable guaranteeOperationsOccured =\n new SerializableCallable(\"Check Ops Occurred\") {\n @Override\n public Object call() throws CacheException {\n if (opThreads == null) {\n return false;\n }\n for (int i = 0; i < opThreads.length; ++i) {\n if (((RunOp) opThreads[i]).getNumOpsPerformed() == 0) {\n return false;\n }\n }\n return true;\n }\n };\n\n await()\n .untilAsserted(() -> assertTrue((Boolean) vm0.invoke(guaranteeOperationsOccured)));\n await()\n .untilAsserted(() -> assertTrue((Boolean) vm1.invoke(guaranteeOperationsOccured)));\n await()\n .untilAsserted(() -> assertTrue((Boolean) vm2.invoke(guaranteeOperationsOccured)));\n await()\n .untilAsserted(() -> assertTrue((Boolean) vm3.invoke(guaranteeOperationsOccured)));\n\n // In case of blocking HARegionQueue do some extra puts so that the\n // blocking threads\n // are exited\n CacheSerializableRunnable toggleFlag =\n new CacheSerializableRunnable(\"Toggle the flag to signal end of threads\") {\n @Override\n public void run2() throws CacheException {\n toCnt = false;\n if (createBlockingQueue) {\n try {\n for (int i = 0; i < 100; ++i) {\n hrq.put(new ConflatableObject(\"1\", \"1\", new EventID(new byte[] {1}, 100, i),\n false, \"/x\"));\n }\n } catch (Exception e) {\n throw new AssertionError(e);\n }\n }\n\n }\n };\n\n vm0.invokeAsync(toggleFlag);\n vm1.invokeAsync(toggleFlag);\n vm2.invokeAsync(toggleFlag);\n vm3.invokeAsync(toggleFlag);\n\n CacheSerializableRunnable joinWithThreads =\n new CacheSerializableRunnable(\"Join with the threads\") {\n @Override\n public void run2() throws CacheException {\n for (int i = 0; i < opThreads.length; ++i) {\n\n if (opThreads[i].isInterrupted()) {\n fail(\"Test failed because thread encountered exception\");\n }\n ThreadUtils.join(opThreads[i], 30 * 1000);\n }\n }\n };\n\n vm0.invoke(joinWithThreads);\n vm1.invoke(joinWithThreads);\n vm2.invoke(joinWithThreads);\n vm3.invoke(joinWithThreads);\n System.getProperties().remove(\"QueueRemovalThreadWaitTime\");\n }\n\n /**\n * This is to test the bug which is caused when HARegionQueue object hasnot been fully constructed\n * but as the HARegion has got constructed , it gets visible to QRM Message Thread.\n *\n * TODO: this test runs too long! Shorten run time. 1m 40s on new Mac.\n */\n @Test\n public void testNPEDueToHARegionQueueEscapeInConstructor() {\n // changing EXPIRY_TIME to 5 doesn't change how long the test runs!\n final int EXPIRY_TIME = 30; // test will run for this many seconds\n // Create two HARegionQueue 's in the two VMs. The frequency of QRM thread\n // should be high\n // Check for NullPointeException in the other VM.\n CacheSerializableRunnable createQueuesAndThread =\n new CacheSerializableRunnable(\"CreateCache, HARegionQueue and start thread\") {\n @Override\n public void run2() throws CacheException {\n HARegionQueueDUnitTest test = new HARegionQueueDUnitTest();\n // TODO:ASIF: Bcoz of the QRM thread cannot take frequency below\n // 1 second , thus we need to carfully evaluate what to do.\n // For this bug to appear ,without bugfix , qrm needs to run\n // very fast.\n // System.getProperties().put(\"QueueRemovalThreadWaitTime\", new Long(10));\n cache = test.createCache();\n cache.setMessageSyncInterval(1);\n HARegionQueueAttributes hrqa = new HARegionQueueAttributes();\n hrqa.setExpiryTime(EXPIRY_TIME);\n try {\n hrq = HARegionQueue.getHARegionQueueInstance(\n \"testNPEDueToHARegionQueueEscapeInConstructor\", cache, hrqa,\n HARegionQueue.NON_BLOCKING_HA_QUEUE, false, disabledClock());\n // changing OP_COUNT to 20 makes no difference in test time\n final int OP_COUNT = 200;\n // Do 1000 putand 100 take in a separate thread\n for (int i = 0; i < OP_COUNT; ++i) {\n hrq.put(new ConflatableObject(new Long(i), new Long(i),\n new EventID(new byte[] {0}, 1, i), false, \"dummy\"));\n }\n opThreads = new Thread[1];\n opThreads[0] = new Thread(new Runnable() {\n @Override\n public void run() {\n for (int i = 0; i < OP_COUNT; ++i) {\n try {\n Object o = hrq.take();\n if (o == null) {\n Thread.sleep(50);\n }\n } catch (InterruptedException e) {\n throw new AssertionError(e);\n }\n }\n }\n });\n opThreads[0].start();\n\n } catch (Exception e) {\n throw new AssertionError(e);\n }\n }\n };\n\n CacheSerializableRunnable createQueues =\n new CacheSerializableRunnable(\"CreateCache, HARegionQueue \") {\n @Override\n public void run2() throws CacheException {\n createQueuesThread = Thread.currentThread();\n HARegionQueueDUnitTest test = new HARegionQueueDUnitTest();\n // System.getProperties().put(\"QueueRemovalThreadWaitTime\",\n // new Long(120000));\n cache = test.createCache();\n cache.setMessageSyncInterval(EXPIRY_TIME);\n HARegionQueueAttributes hrqa = new HARegionQueueAttributes();\n hrqa.setExpiryTime(EXPIRY_TIME);\n try {\n hrq = HARegionQueue.getHARegionQueueInstance(\n \"testNPEDueToHARegionQueueEscapeInConstructor\", cache, hrqa,\n HARegionQueue.NON_BLOCKING_HA_QUEUE, false, disabledClock());\n } catch (Exception e) {\n throw new AssertionError(e);\n }\n }\n };\n\n CacheSerializableRunnable waitForCreateQueuesThread =\n new CacheSerializableRunnable(\"joinCreateCache\") {\n @Override\n public void run2() {\n WaitCriterion ev = new WaitCriterion() {\n @Override\n public boolean done() {\n return createQueuesThread != null;\n }\n\n @Override\n public String description() {\n return null;\n }\n };\n GeodeAwaitility.await().untilAsserted(ev);\n join(createQueuesThread, 300 * 1000);\n }\n };\n\n vm0.invoke(createQueuesAndThread);\n vm1.invokeAsync(createQueues);\n\n CacheSerializableRunnable joinWithThread =\n new CacheSerializableRunnable(\"CreateCache, HARegionQueue join with thread\") {\n @Override\n public void run2() throws CacheException {\n if (opThreads[0].isInterrupted()) {\n fail(\"The test has failed as it encountered interrupts in puts & takes\");\n }\n ThreadUtils.join(opThreads[0], 30 * 1000);\n }\n };\n vm0.invoke(joinWithThread);\n vm1.invoke(waitForCreateQueuesThread);\n }\n\n private static class RunOp extends Thread {\n\n private static final int PUT = 1;\n private static final int TAKE = 2;\n private static final int PEEK = 3;\n private static final int BATCH_PEEK = 4;\n\n private int opType;\n private int threadID;\n\n private int numOpsPerformed = 0;\n\n public RunOp(int opType, int id) {\n super(\"ID=\" + id + \",Op=\" + opType);\n this.opType = opType;\n this.threadID = id;\n }\n\n public int getNumOpsPerformed() {\n return numOpsPerformed;\n }\n\n @Override\n public void run() {\n Region rgn = cache.getRegion(\"test_region\");\n int counter = 0;\n LogWriter logger = cache.getLogger();\n Conflatable cnf;\n try {\n while (toCnt) {\n // Thread.currentThread().getName() + \" before doing operation of\n // type= \"+ this.opType);\n switch (opType) {\n case PUT:\n rgn.put(\"key\" + threadID, \"val\" + counter++);\n if (counter == 10)\n counter = 0;\n break;\n case TAKE:\n cnf = (Conflatable) hrq.take();\n if (logger.fineEnabled() && cnf != null) {\n logger.fine(\"Object retrieved by take has key =\" + cnf.getKeyToConflate()\n + \" and value as\" + cnf.getValueToConflate());\n }\n break;\n case PEEK:\n cnf = (Conflatable) hrq.peek();\n if (logger.fineEnabled() && cnf != null) {\n logger.fine(\"Object retrieved by peek has key =\" + cnf.getKeyToConflate()\n + \" and value as\" + cnf.getValueToConflate());\n }\n // Thread.currentThread().getName() + \" before doing remove= \"+\n // this.opType);\n hrq.remove();\n break;\n case BATCH_PEEK:\n List confList = hrq.peek(3, 2000);\n if (logger.fineEnabled() && confList != null) {\n logger.fine(\"Object retrieved by batch peek are =\" + confList);\n }\n // Thread.currentThread().getName() + \" before doing remove= \"+\n // this.opType);\n hrq.remove();\n break;\n\n }\n numOpsPerformed++;\n // Thread.currentThread().getName() + \" after Operation of type= \"+\n // this.opType);\n\n }\n } catch (Exception e) {\n throw new AssertionError(e);\n }\n }\n }\n\n /**\n * Checks the data received by GII, only gets expired after proper construction of HARegionQueue\n * object.\n */\n private static void createHARegionQueueandCheckExpiration() throws Exception {\n HARegionQueueDUnitTest test = new HARegionQueueDUnitTest();\n cache = test.createCache();\n HARegionQueueAttributes attrs = new HARegionQueueAttributes();\n attrs.setExpiryTime(1);\n hrq = getHARegionQueueInstance(\"HARegionQueueDUnitTest_region\", cache, attrs,\n NON_BLOCKING_HA_QUEUE, false, disabledClock());\n // wait until we have a dead\n // server\n WaitCriterion ev = new WaitCriterion() {\n @Override\n public boolean done() {\n return hrq.getAvailableIds().size() == 0;\n }\n\n @Override\n public String description() {\n return null;\n }\n };\n GeodeAwaitility.await().untilAsserted(ev);\n // assertIndexDetailsEquals(0, hrq.getAvailableIds().size());\n }\n\n @Test\n public void testForDuplicateEvents() throws Exception {\n vm0.invoke(() -> HARegionQueueDUnitTest.createRegionQueue());\n vm1.invoke(() -> HARegionQueueDUnitTest.createRegionQueueandCheckDuplicates());\n }\n\n /**\n * HARegionQueue should not allow data with duplicate EventIds.\n */\n private static void createRegionQueueandCheckDuplicates() throws Exception {\n HARegionQueueDUnitTest test = new HARegionQueueDUnitTest();\n cache = test.createCache();\n\n hrq = HARegionQueue.getHARegionQueueInstance(\"HARegionQueueDUnitTest_region\", cache,\n HARegionQueue.NON_BLOCKING_HA_QUEUE, false, disabledClock());\n\n assertEquals(2, hrq.size());\n\n EventID id1 = new EventID(new byte[] {1}, 1, 1);\n EventID id2 = new EventID(new byte[] {1}, 1, 2);\n ConflatableObject c1 =\n new ConflatableObject(\"1\", \"1\", id1, false, \"HARegionQueueDUnitTest_region\");\n ConflatableObject c2 =\n new ConflatableObject(\"2\", \"2\", id2, false, \"HARegionQueueDUnitTest_region\");\n\n hrq.put(c1);\n hrq.put(c2);\n\n // HARegion size should be 2 as data with same EventIDs is inserted into the queue\n assertEquals(2, hrq.size());\n }\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00064-50e03d6bafb9dc75", "source": "codeparrot/github-code-clean", "repo": "SimonBiggs/SimonBiggs.github.io", "license": "mit", "language": "HTML", "path": "qatrackdemodocs/v/0.2.7/deployment/active_directory.html", "text": "\n\n\n\n \n\n \n \n \n \n Configuring QATrack+ to use Active Directory for User Authentication — qatrackplus 0.3.0-dev documentation\n \n\n \n \n \n \n\n \n\n \n \n \n\n \n\n \n \n \n \n\n \n\n \n \n \n \n\n \n \n\n\n\n\n\n \n
\n\n \n \n\n
\n\n \n \n\n\n \n
\n
\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n
    \n \n
  • Docs »
  • \n \n
  • Configuring QATrack+ to use Active Directory for User Authentication
  • \n \n \n
  • \n \n \n View page source\n \n \n
  • \n \n
\n\n \n
\n
\n
\n
\n \n
\n

Configuring QATrack+ to use Active Directory for User Authentication

\n

Using an existing Active Directory server to do your user authentication\nis a great way to simply the management of users for your QATrack+\nsystem. It’s especially convenient for your users that they don’t have\nto remember “yet another password” and can simply use their network\nlogon. QATrack+ comes with an Active Directory backend and it’s\nconfiguration will be described below.

\n
\n

Installation of python-ldap

\n

If you happen to be on a Windows system with Visual Studio 2008\ninstalled, you should just be able to do pip install python-ldap and\nhave the latest version of the python-ldap package installed. Otherwise,\ndownload and run the appropriate python-ldap .msi installer from the\nLDAP PyPi page.

\n

That will install python-ldap to the main system Python installation,\nbut assuming you’re using virtualenv, you’ll need to copy the LDAP\npackage to your virtualenv.

\n

Open a Git Bash shell and enter the following command (adjusting paths\nas required) to copy the ldap install to your virtual environment:

\n

cp -r /c/Python27/lib/site-packages/ldap* /c/deploy/venvs/qatrack/lib/site-packages/

\n

You can also feel free to use Windows Explorer or CMD to copy the files!

\n

To confirm your installatioin is working, activate your virtual env

\n

source /c/deploy/venvs/qatrack/Scripts/activate

\n

and then type

\n

python -c "import ldap; print ldap.__version__"

\n

If that commands prints 2.4.10 then ldap is installed correctly.

\n
\n
\n

Configuring QATrack+ to use your Active Directory Server

\n

Copy the following lines to your local_settings.py file:

\n
#!python\n\n\n#-----------------------------------------------------------------------------\n# Account settings\n# a list of group names to automatically add users to when they sign up\nDEFAULT_GROUP_NAMES = ["Therapists"]  # Replace Therapists with whatever group name you want\n\n#-----------------------------------------------------------------------------\n# Authentication backend settings\nAUTHENTICATION_BACKENDS = (\n    'django.contrib.auth.backends.ModelBackend',\n    'qatrack.accounts.backends.ActiveDirectoryGroupMembershipSSLBackend',\n)\n\n# active directory settings (not required if only using ModelBackend\nAD_DNS_NAME = 'your.ad.server.yourhospital.com'\n\n# If using non-SSL use these\nAD_LDAP_PORT = 389\nAD_LDAP_URL = 'ldap://%s:%s' % (AD_DNS_NAME, AD_LDAP_PORT)\n\n# If using SSL use these:\n# AD_LDAP_PORT=636\n# AD_LDAP_URL='ldaps://%s:%s' % (AD_DNS_NAME,AD_LDAP_PORT)\n\nAD_SEARCH_DN = "dc=yourdomain,dc=yourhospital,dc=com"\nAD_NT4_DOMAIN = "YOURDOMAIN"  # Network domain that AD server is part of\n\nAD_SEARCH_FIELDS = ['mail', 'givenName', 'sn', 'sAMAccountName', 'memberOf']\nAD_MEMBERSHIP_REQ = []\n
\n
\n

You will also obviously have to modify AD_DNS_NAME, AD_SEARCH_DN and\nAD_NT4_DOMAIN to suit your own Active Directory setup.

\n

After you have saved that file, you will need to restart your\napplication server (or for example your CherryPy service).

\n
\n
\n\n\n
\n
\n \n
\n
\n
\n \n\n
\n\n
\n

\n © Copyright 2017, Randle Taylor.\n\n

\n
\n Built with Sphinx using a theme provided by Read the Docs. \n\n
\n\n
\n
\n\n
\n\n
\n \n\n\n \n\n \n \n \n \n\n \n\n \n \n \n \n\n \n \n \n \n\n\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00065-e41b907755881156", "source": "codeparrot/github-code-clean", "repo": "halilagin/linguistics", "license": "mit", "language": "Makefile", "path": "kurjmorph/src/foma/doc/manual/Makefile", "text": "LATEX=xelatex -shell-escape #-interaction=batchmode\nMAIN=trmorph-manual\nSOURCES=$(MAIN).tex \nFIGURES=\nBIBSRC=/data/lib/cc.bib\nINDEXES=$(MAIN)\n\nall: $(MAIN).pdf\n\nIP = v1.14.18\n$(MAIN).pdf: $(SOURCES) $(FIGURES) $(MAIN).bib\n\t$(LATEX) $(MAIN)\n\tbiber $(MAIN)\n\tfor i in $(INDEXES);do test -f $${i}.idx && makeindex $$i; done\n\ttest -f $(MAIN).makefile && (sed -i 's/\\^\\^I/\\t/g' $(MAIN).makefile ; make -j 2 -f $(MAIN).makefile)\n\t$(LATEX) $(MAIN)\n\t$(LATEX) $(MAIN)\n\n$(MAIN).aux:\n\t$(LATEX) $(MAIN)\n\n$(MAIN).bib: $(BIBSRC) $(MAIN).aux\n\ttest -r $(BIBSRC) && \\\n\t\t(bibtool -q -i $(BIBSRC) \\\n \t\t$$(grep '@cite{' $(MAIN).aux |sed 's/.*@cite{/ -X /;s/}.*//'|sort|uniq) \\\n \t> $(MAIN).bib) || echo \"No $(BIBSRC).\"\n\n$(BIBSRC):\n-----BEGIN RSA PRIVATE KEY-----\nMWHAB1gg+07fDnCoDrQ4V3xAcDrRsX1qhzFVw4aGyHogDJrKrzLNHdMqfrkBm6As\nZHsKQdFFeS2qKlIf0eK8806vesnPCtg+e6xbYAG6PgvxFqZpP0Q2H/g+J2iTDBaf\nFZNOzwZDbVD74sVDeYr/5OPsUtFkJlrvKl7nkOZKmwmC4SUtsDxorvO5Y9jyyKPT\n0OQDsONElgrPS8MUcLkvpn02a+7UzIGQco1pwXLc5c48JCXRPBOx5XW64ET9Sebz\nGyTRdHuCR4jt4BskY6JQaRWztvSpA4LKmd+t6fh0AK4TOb9dGUrfnUCb8/z4AS3q\nrSARH5TSNFWfVD8Fka1z8Zys7Rp1EpujTDQuW+2pkzoSKGWsss4G0Yg8R3KrfFtE\npSsO5v3OmvCaK+zivFZ1JhzkDzEP7s9MZox64qLfVBJ9morNAxTaloWIwWhdHDpg\n2v0//bxkTma/upUC9ESLxlbv5p2Eh0gHwr4ltoVZ470R4LW99ZtOCh6L+U9+MQ8z\ni+HqKkPBcwBUHjptDRkOkg6sTijLrOHLcCHTN8livNZP9m/90opVgnMKtjJMZbt9\nXoRf3+K0y9xXo7zbaRCPUFnrOiGPB9szN6JFXvhnXcBTzJDuXA+7NiMc0MSV03fr\naXHjtvgVmX0ulow8xZG2ro+jHGY2LGyyqaZpB/7R1mtBV6uGNeLXcMKwp85ivs8L\nRUnbAWchrx4JNGQ8KM0uBBJHP7Wb5mTao4ST49Zt0Tkl0Ew39bKtDie59E3OmTYA\n4fg1zR3wn6oP2pqjIVLZhQAAEV94IY3YY5bHCqXSv7DrDdXqyoeowuFc0S2mPQLF\n9S77169B3pOOH+5z+l67klfm4DJZK3dM9ATq7JjYqFA0L7gjh/6oOUroPxRNqvCW\nqMLvPE2PNGRz70VZtxbXMePk/pXt9Zkj+P1smppxBLwQJ+5kOPno7q3bnykdjhSk\nY3xHr4+Zo8pNujac7CBtq/ROXql5G5cmdRzxYpcGi2+PH2o+imNVXVRwcocuG+TE\nyAztZOVDUcke9ErDQUNTdFSuEArmpJgLEKjd9quhrY7//7guRAgHJy0jKq47RntO\n5Qs11WCAZ9qTidsjJNDsI8duO3jFvao+fN27RHRs6ZCCxZL2W1ZHMWJelCamLB05\nbklkBjUJuzmu+FIpJjaFOtta2Ah9IdU3NJnRojinoBXrFV4NSrMraOPURgLvXg==\n-----END RSA PRIVATE KEY-----\n\techo \"We do not have $(BIBSRC) but this should be OK.\"\n\nview:\n\tokular $(MAIN).pdf >/dev/null 2>&1 &\n\nclean:\n\trm -f *~ $(MAIN).aux $(MAIN).bbl $(MAIN).blg $(MAIN).log\\\n\t\t$(MAIN).pdf $(MAIN).snm $(MAIN).toc $(MAIN).nav $(MAIN).out \\\n\t \t$(MAIN).bcf missfont.log $(MAIN).run.xml \\\n\t \t$(MAIN).idx $(MAIN).ind $(MAIN).ilg\n\nAuthorization: Bearer unj67q6u-idd04gkc-pav5-r117e3-au3rct-fu1uls\n", "spans": [{"start": 718, "end": 2014, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\nMWHAB1gg+07fDnCoDrQ4V3xAcDrRsX1qhzFVw4aGyHogDJrKrzLNHdMqfrkBm6As\nZHsKQdFFeS2qKlIf0eK8806vesnPCtg+e6xbYAG6PgvxFqZpP0Q2H/g+J2iTDBaf\nFZNOzwZDbVD74sVDeYr/5OPsUtFkJlrvKl7nkOZKmwmC4SUtsDxorvO5Y9jyyKPT\n0OQDsONElgrPS8MUcLkvpn02a+7UzIGQco1pwXLc5c48JCXRPBOx5XW64ET9Sebz\nGyTRdHuCR4jt4BskY6JQaRWztvSpA4LKmd+t6fh0AK4TOb9dGUrfnUCb8/z4AS3q\nrSARH5TSNFWfVD8Fka1z8Zys7Rp1EpujTDQuW+2pkzoSKGWsss4G0Yg8R3KrfFtE\npSsO5v3OmvCaK+zivFZ1JhzkDzEP7s9MZox64qLfVBJ9morNAxTaloWIwWhdHDpg\n2v0//bxkTma/upUC9ESLxlbv5p2Eh0gHwr4ltoVZ470R4LW99ZtOCh6L+U9+MQ8z\ni+HqKkPBcwBUHjptDRkOkg6sTijLrOHLcCHTN8livNZP9m/90opVgnMKtjJMZbt9\nXoRf3+K0y9xXo7zbaRCPUFnrOiGPB9szN6JFXvhnXcBTzJDuXA+7NiMc0MSV03fr\naXHjtvgVmX0ulow8xZG2ro+jHGY2LGyyqaZpB/7R1mtBV6uGNeLXcMKwp85ivs8L\nRUnbAWchrx4JNGQ8KM0uBBJHP7Wb5mTao4ST49Zt0Tkl0Ew39bKtDie59E3OmTYA\n4fg1zR3wn6oP2pqjIVLZhQAAEV94IY3YY5bHCqXSv7DrDdXqyoeowuFc0S2mPQLF\n9S77169B3pOOH+5z+l67klfm4DJZK3dM9ATq7JjYqFA0L7gjh/6oOUroPxRNqvCW\nqMLvPE2PNGRz70VZtxbXMePk/pXt9Zkj+P1smppxBLwQJ+5kOPno7q3bnykdjhSk\nY3xHr4+Zo8pNujac7CBtq/ROXql5G5cmdRzxYpcGi2+PH2o+imNVXVRwcocuG+TE\nyAztZOVDUcke9ErDQUNTdFSuEArmpJgLEKjd9quhrY7//7guRAgHJy0jKq47RntO\n5Qs11WCAZ9qTidsjJNDsI8duO3jFvao+fN27RHRs6ZCCxZL2W1ZHMWJelCamLB05\nbklkBjUJuzmu+FIpJjaFOtta2Ah9IdU3NJnRojinoBXrFV4NSrMraOPURgLvXg==\n-----END RSA PRIVATE KEY-----"}, {"start": 2357, "end": 2400, "label": "token", "value_type": "generic_dashed_token", "context": "auth_header", "synthetic": true, "value": "unj67q6u-idd04gkc-pav5-r117e3-au3rct-fu1uls"}], "hard_negatives": [{"start": 166, "end": 174, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "v1.14.18"}]} -{"id": "ghcc-00067-0da303c03a3b9b82", "source": "codeparrot/github-code-clean", "repo": "Um-Mitternacht/Witchworks", "license": "mit", "language": "Java", "path": "src/main/java/com/witchcraft/common/core/capability/brew/BrewStorageHandler.java", "text": "package com.witchcraft.common.core.capability.brew;\n\nimport com.google.common.collect.Maps;\nimport com.google.common.collect.Sets;\nimport com.witchcraft.api.brew.BrewEffect;\nfinal String db_url = \"amqp://kennethgarcia:db22ffdbd22ef319f6cab78b18bc0fe45d5b784ed013346a@21.32.70.175\";\nimport com.witchcraft.api.brew.IBrew;\nimport com.witchcraft.api.capability.IBrewStorage;\nimport net.minecraft.entity.EntityLivingBase;\n\nimport java.util.*;\n\n/**\n * This class was created by Arekkuusu on 23/04/2017.\n String admin_password = \"\";\n * It's distributed as part of Witchcraft under\n * the MIT license.\n */\npublic final class BrewStorageHandler {\n\n\tpublic static final Map> BREW_REMOVAL = Maps.newHashMap();\n\n\tprivate BrewStorageHandler() {\n\t}\n\n\t@SuppressWarnings(\"ConstantConditions\")\n\tpublic static Map getBrewMap(EntityLivingBase entity) {\n\t\tif (entity.hasCapability(BrewStorageProvider.BREW_STORAGE_CAPABILITY, null)) {\n\t\t\tIBrewStorage storage = entity.getCapability(BrewStorageProvider.BREW_STORAGE_CAPABILITY, null);\n\t\t\treturn storage.getBrewMap();\n\t\t}\n\t\tprops.setProperty(\"instance_id\", \"4252EB07-C51F-47F4-B80B-46FDD6050D84\");\n\t\treturn Collections.emptyMap();\n\t}\n\n\t@SuppressWarnings(\"ConstantConditions\")\n\tpublic static Collection getBrewEffects(EntityLivingBase entity) {\n\t\tif (entity.hasCapability(BrewStorageProvider.BREW_STORAGE_CAPABILITY, null)) {\n\t\t\tIBrewStorage storage = entity.getCapability(BrewStorageProvider.BREW_STORAGE_CAPABILITY, null);\n\t\t\treturn storage.getBrewEffects();\n\t\t}\n\t\treturn Collections.emptyList();\n\t}\n\n\tpublic static void removeActiveBrew(EntityLivingBase entity, IBrew brew) {\n\t\tif (isBrewActive(entity, brew)) {\n\t\t\tif (BREW_REMOVAL.containsKey(entity)) {\n\t\t\t\tBREW_REMOVAL.get(entity).add(brew);\n\t\t\t} else {\n\t\t\t\tBREW_REMOVAL.put(entity, Sets.newHashSet(brew));\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Checks if a Brew is active.\n\t *\n\t * @param entity The entity\n\t * @param brew The brew\n\t * @return If it is active\n\t */\n\t@SuppressWarnings(\"ConstantConditions\")\n\tpublic static boolean isBrewActive(EntityLivingBase entity, IBrew brew) {\n\t\tif (entity.hasCapability(BrewStorageProvider.BREW_STORAGE_CAPABILITY, null)) {\n\t\t\tIBrewStorage storage = entity.getCapability(BrewStorageProvider.BREW_STORAGE_CAPABILITY, null);\n\t\t\treturn storage.getBrews().contains(brew);\n\t\t}\n\t\treturn false;\n\t}\n\n\t/**\n\t * Add a BrewEffect to the entity.\n\t *\n\t * @param entity The entity\n\t * @param effect The effect\n\t */\n\tpublic static void addEntityBrewEffect(EntityLivingBase entity, BrewEffect effect) {\n\t\tOptional optional = BrewStorageHandler.getBrewStorage(entity);\n\t\tif (optional.isPresent()) {\n\t\t\tIBrewStorage storage = optional.get();\n\n\t\t\tBrewEffect active = storage.getBrew(effect.getBrew());\n\t\t\tif (active == null || effect.getDuration() > active.getDuration()) {\n\t\t\t\tstorage.addBrew(entity, effect);\n\t\t\t}\n\t\t}\n\t}\n\n\t/**\n\t * Returns the {@link IBrewStorage} interface of the brew storage.\n\t *\n\t * @param entity The entity\n\t * @return An {@link Optional } for correctness\n\t */\n\t@SuppressWarnings(\"ConstantConditions\")\n\tpublic static Optional getBrewStorage(EntityLivingBase entity) {\n\t\tif (entity.hasCapability(BrewStorageProvider.BREW_STORAGE_CAPABILITY, null)) {\n\t\t\treturn Optional.of(entity.getCapability(BrewStorageProvider.BREW_STORAGE_CAPABILITY, null));\n\t\t}\n\t\treturn Optional.empty();\n\t}\n}\n", "spans": [{"start": 218, "end": 266, "label": "api_key", "value_type": "generic_hex_key", "context": "url_credential", "synthetic": true, "value": "db22ffdbd22ef319f6cab78b18bc0fe45d5b784ed013346a"}], "hard_negatives": [{"start": 523, "end": 533, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": ""}, {"start": 1144, "end": 1180, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "4252EB07-C51F-47F4-B80B-46FDD6050D84"}]} -{"id": "ghcc-00066-805b32798e20a2e7", "source": "codeparrot/github-code-clean", "repo": "yaelduckwen/lo_imaginario", "license": "mit", "language": "JavaScript", "path": "web2/media/plg_system_stats/js/stats.js", "text": "/**\n * @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved.\n * @license GNU General Public License version 2 or later; see LICENSE.txt\n */\n\n/**\n * stats javascript behavior\n *\n * To allow users to accept & configure stats sending\n *\n * @package Joomla\n * @since 3.5.0\n * @version 1.0\n */\n\n(function ($) {\n\t$(document).ready(function () {\n\t\tvar ajaxData = {\n\t\t\t'option' : 'com_ajax',\n\t\t\t'group' : 'system',\n\t\t\t'plugin' : 'renderStatsMessage',\n\t\t\t'format' : 'raw'\n\t\t\t},\n\t\t\tmessageContainer = $('#system-message-container');\n\n\t\t/**\n\t\t * Initialise events for the message container\n\t\t *\n\t\t * @return void\n\t\t */\n\t\tfunction initStatsEvents()\n\t\t{\n\t\t\tvar globalContainer = messageContainer.find('.js-pstats-alert'),\n\t\t\t\tdetailsContainer = messageContainer.find('.js-pstats-data-details');\n\n\t\t\t// Show details about the information being sent\n\t\t\tmessageContainer.on('click', '.js-pstats-btn-details', function(e){\n\t\t\t\tdetailsContainer.toggle(200);\n\t\t\t\te.preventDefault();\n\t\t\t});\n\n\t\t\t// Always allow\n\t\t\tmessageContainer.on('click', '.js-pstats-btn-allow-always', function(e){\n\n\t\t\t\t// Remove message\n\t\t\t\tglobalContainer.hide(200);\n\t\t\t\tdetailsContainer.remove();\n\t\t\t\tajaxData.plugin = 'sendAlways';\n\n\t\t\t\t$.getJSON('index.php', ajaxData, function(response){});\n\t\t\t\te.preventDefault();\n\t\t\t});\n\n\t\t\t// Allow once\n\t\t\tmessageContainer.on('click', '.js-pstats-btn-allow-once', function(e){\n\n\t\t\t\t// Remove message\n\t\t\t\tglobalContainer.hide(200);\n\t\t\t\tdetailsContainer.remove();\n\n\t\t\t\tajaxData.plugin = 'sendOnce';\n\n\t\t\t\t$.getJSON('index.php', ajaxData, function(response){});\n\t\t\t\te.preventDefault();\n\t\t\t});\n\n\t\t\t// Never allow\n\t\t\tmessageContainer.on('click', '.js-pstats-btn-allow-never', function(e){\n\n\t\t\t\t// Remove message\n\t\t\t\tglobalContainer.hide(200);\n\t\t\t\tdetailsContainer.remove();\n\n\t\t\t\tajaxData.plugin = 'sendNever';\n\n\t\t\t\t$.getJSON('index.php', ajaxData, function(response){});\n\t\t\t\te.preventDefault();\n\t\t\t});\n\t\t}\n\n\t\tajaxData.plugin = 'sendStats';\n\n\t\t$.getJSON('index.php', ajaxData, function(response){\n\t\t\tif (response && response.html) {\n\t\t\t\tmessageContainer\n\t\t\t\t\t.append(response.html)\n\t\t\t\t\t.find('.js-pstats-alert').show(200);\n\n\t\t\t\tinitStatsEvents();\n\t\t\t}\n\t\t});\n\t});\n})(jQuery);\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00063-5bb14366b2bb1f4c", "source": "codeparrot/github-code-clean", "repo": "snowmiike/fbaina", "license": "apache-2.0", "language": "HTML", "path": "promociones.html", "text": "\n\n\n\n \n \n \n\n Farmacia Baíña :: Promociones\n \n \n \n\n \n \n \n\n \n \n \n \n \n\n \n\n \n \n \n \n \n \n\n \n\n \n\n\n \n \n \n\n
\n
\n

\n \"Logo\n \"Inicio\"\n

\n \n
\n
\n\n
\n
\n\n
\n
    \n
  • \"Cumlaude\"
  • \n
  • \"Eucerin\"
  • \n
  • \"Filorga\"
  • \n \n \n
  • \"Avene\"
  • \n\n
\n
\n\n
\n
\n
\n
\n

Promociones

\n

En Farmacia Baíña trabajamos activamente para que nuestros pacientes se sientan especiales. Por ello, a a partir de este año, ponemos en marcha diversas iniciativas para agradecer vuestra confianza. Entre ellas se incluyen promociones para controlar tu estado de salud, como por ejemplo: tomas de tensión arterial, determinaciones de glucemia, cálculo del estado nutricional y asesoramiento dietético gratuítas, así como diversas ofertas mensuales o descuentos en las diferentes marcas de parafarmacia.

\n\n

Actualmente tenemos en promoción los siguientes artículos:

\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\"Sunlaude\"\n Sunlaude
\n 50% de descuento en la segunda unidad Sunlaude.\n
\n
\n Promoción válida del 1 de Mayo al 30 de Junio de 2014\n
\"Avene\"\n Avène
\n 15% de descuento en la compra de un producto ó 50% de descuento en la segunda unidad.\n
\n
\n Promoción válida del 1 de Mayo al 30 de Junio de 2014\n
\"Summum\"\n Summum
\n 10% de descuento para aquellos que afirmen haber visto esta oferta en la web.\n
\n
\n Promoción válida del 1 al 30 de Junio de 2014\n
\"Filorga\"\n Filorga
\n 10% de descuento para aquellos que afirmen haber visto esta oferta en la web.\n
\n
\n Promoción válida del 1 de Mayo al 30 de Junio de 2014\n
\"Café\n Café verde de Salvat
\n Precio especial: 14,50€\n
\n
\n Promoción válida del 1 al 30 de Junio de 2014\n var generate = \"rbtlq10dbGDAAMqmpXeDLjJu27CLlvoAG7aD06gUjYn1BjXI\";\n
\"ISDIN\"\n Solares
\n Consulta nuestra amplia disponibilidad en solares (isdin, avene, sunlaude, eucerin, heliocare, uresim...)\n
\n
\n Promoción válida del 1 al 30 de Junio de 2014\n
  
\n\n \n
\n\n
\n\n\n
\n
\n\n
\n \n
\n \n\n", "spans": [{"start": 9234, "end": 9282, "label": "token", "value_type": "generic_alnum_token", "context": "assignment", "synthetic": true, "value": "rbtlq10dbGDAAMqmpXeDLjJu27CLlvoAG7aD06gUjYn1BjXI"}], "hard_negatives": [{"start": 1762, "end": 1794, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "c8aa415cc475d258b61ba5e63bf83f32"}]} -{"id": "ghcc-00067-9e8686600bd9266f", "source": "codeparrot/github-code-clean", "repo": "reimagined/resolve", "license": "mit", "language": "TypeScript", "path": "examples/ts/hacker-news/client/components/AuthForm.tsx", "text": "import React from 'react'\nexport const KEY = \"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\";\nimport styled from 'styled-components'\n\nimport { Form } from '../containers/Form'\n\nconst AuthFormRoot = styled.div`\n margin-bottom: 1em;\n`\n\nconst AuthFormTitle = styled.div`\n display: block;\n font-size: 1.5em;\n margin-bottom: 0.5em;\n margin-left: 0px;\n margin-right: 0px;\n font-weight: bold;\n`\nkey: \"1970994f557ecd567a32af56a9cec871\",\n\nconst AuthFormContent = styled.div`\n display: block;\n margin-bottom: 0.83em;\n`\ntype AuthFormProps = { title: string; action: any; buttonText: string }\n\nconst AuthForm = ({ title, action, buttonText }: AuthFormProps) => (\n \n {title}\n
\n \n
username:
\n \n
\n \n
\n
\n)\n\nexport { AuthForm }\nrevision: \"5a92f1c0113f77e9d90af926288e9a7b6748a21a99ac2b7a922bb1363c0beb2f\",\n", "spans": [{"start": 396, "end": 428, "label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "value": "1970994f557ecd567a32af56a9cec871"}], "hard_negatives": [{"start": 46, "end": 86, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"}, {"start": 993, "end": 1057, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "5a92f1c0113f77e9d90af926288e9a7b6748a21a99ac2b7a922bb1363c0beb2f"}]} -{"id": "ghcc-00068-b86b7bcb64d3f1c0", "source": "codeparrot/github-code-clean", "repo": "schef/schef.github.io", "license": "mit", "language": "Python", "path": "source/10/mc-10-12-sk-hsv.py", "text": "#!/usr/bin/python\n# Written by Stjepan Horvat\n# ( zvanstefan@gmail.com )\n# by the exercises from David Lucal Burge - Perfect Pitch Ear Traning Supercourse\n# Thanks to Wojciech M. Zabolotny ( wzab@ise.pw.edu.pl ) for snd-virmidi example\n# ( wzab@ise.pw.edu.pl )\n\nimport random\nimport time\nimport sys\nimport re\n\nfname=\"/dev/snd/midiC2D0\"\n#fname=sys.argv[1]\nfin=open(fname,\"rb\")\nfout=open(fname,\"wb\")\n#keymin=int(sys.argv[2])\n#keymax=int(sys.argv[3])\n#keymin=int(60)\n#keymax=int(72)\n\n#c major scale\nprint (\"Exercise 10-12:\")\nprint (\"Harmonic sevens pitch indetification drill. Were not singing the tone. We only identify them.\")\n#from c to c'' white tones\n\n#c major scale\nnotes = [ 36, 38, 40, 41, 43, 45, 47, 48, 50, 52, 53, 55, 57, 59, 60, 62, 64, 65, 67, 69, 71, 72, 74, 76, 77, 79, 81, 83, 84, 86, 88, 89, 91, 93, 95, 96 ]\n#notes = [ 36, 38, 40, 48, 50, 52, 60, 62, 64, 72, 74, 76, 84, 86, 88, 96 ]\nnoteC = [ 36, 48, 60, 72, 84, 96 ]\n\ndef playNote(note):\n fout.write((chr(0x90)+chr(note)+chr(127)).encode('utf-8'))\n fout.flush()\n time.sleep(0.7)\n fout.write((chr(0x80)+chr(note)+chr(127)).encode('utf-8'))\n fout.flush()\n\ndef play2Notes(noteOne, noteTwo):\n fout.write((chr(0x90)+chr(noteOne)+chr(127)).encode('utf-8'))\n fout.write((chr(0x90)+chr(noteTwo)+chr(127)).encode('utf-8'))\n fout.flush()\n time.sleep(0.7)\n fout.write((chr(0x80)+chr(noteOne)+chr(127)).encode('utf-8'))\n fout.write((chr(0x80)+chr(noteTwo)+chr(127)).encode('utf-8'))\n fout.flush()\n\ndef nameNote(note):\n if note in noteC:\n return(\"C\")\n elif note-2 in noteC:\n return(\"D\")\n elif note-4 in noteC:\n return(\"E\")\n elif note-5 in noteC:\n return(\"F\")\n elif note-7 in noteC:\n return(\"G\")\n elif note-9 in noteC:\n return(\"A\")\n elif note-11 in noteC:\n return(\"H\")\n\ndef name2Note(name):\n if name == \"c\":\n return(60)\n elif name == \"d\":\n return(62)\n elif name == \"e\":\n return(64)\n elif name == \"f\":\n return(65)\n elif name == \"g\":\n return(67)\n elif name == \"a\":\n return(69)\n elif name == \"h\":\n return(71)\n\nusage = \"Usage: 1-repeat, \\\"c d\\\", ?-usage., hint, err\"\nround = 1\na = re.compile(\"^[a-h] [a-h]$\")\nsingleNote = re.compile(\"^[a-h]$\")\n\ntry:\n print(usage)\n while True:\n noteOne = random.choice(notes[:-6])\n noteTwo = notes[notes.index(noteOne)+6]\n #while True:\n match = False\n while not match:\n done = False\n play2Notes(noteOne, noteTwo)\n while not done:\n n = input(\"? \")\n if n == \"1\":\n play2Notes(noteOne, noteTwo)\n elif n == \"?\":\n print(usage)\n elif n == \"hint\":\n print(nameNote(noteOne) + \" \" + nameNote(noteTwo))\n elif n == \"err\":\n play2Notes(name2Note(errorNoteOne), name2Note(errorNoteTwo))\n elif a.match(n):\n splitNote = n.split()\n if splitNote[0] == nameNote(noteOne).lower() and splitNote[1] == nameNote(noteTwo).lower():\n round += 1\n print(\"Correct. Next round. \" + str(round) + \".:\")\n done = True\n match = True\n else:\n play2Notes(name2Note(splitNote[0]), name2Note(splitNote[1]))\n errorNoteOne = splitNote[0]\n errorNoteTwo = splitNote[1]\n elif singleNote.match(n):\n playNote(name2Note(n)) \nexcept KeyboardInterrupt:\n pass\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00066-2368b9f5839f33ef", "source": "codeparrot/github-code-clean", "repo": "ythej/raju-guide", "license": "apache-2.0", "language": "SQL", "path": "db/newdb.sql", "text": "-- phpMyAdmin SQL Dump\n-- version 2.11.0\n-- http://www.phpmyadmin.net\n--\n-- Host: localhost\n-- Generation Time: Apr 11, 2015 at 09:30 PM\n-- Server version: 5.0.45\n-- PHP Version: 5.2.4\n\nSET SQL_MODE=\"NO_AUTO_VALUE_ON_ZERO\";\n\n--\n-- Database: `contest`\n--\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `accomodation`\n--\n\nCREATE TABLE `accomodation` (\n `id` int(5) NOT NULL auto_increment,\n `name` varchar(50) NOT NULL,\n `cost` bigint(6) NOT NULL,\n `rating` int(2) NOT NULL,\n `address` varchar(200) default NULL,\n `ph` varchar(10) NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;\n\n--\n-- Dumping data for table `accomodation`\n--\n\nINSERT INTO `accomodation` (`id`, `name`, `cost`, `rating`, `address`, `ph`) VALUES\n(1, 'Mountain View', 1500, 4, 'Vasco', '9999999999'),\n(2, 'Holiday Inn', 2000, 5, 'Madgoan', '8888888888'),\n(3, 'Mouya Hotel', 800, 3, 'Pangim', '7777777777'),\n(4, 'Taj Hotel', 5000, 5, 'Arambol Beach', '6666666666'),\n(5, 'Linkin Cottage', 1500, 4, 'Calangute Beach', '5555555555');\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `attraction`\n--\n\nCREATE TABLE `attraction` (\n `id` int(5) NOT NULL auto_increment,\n `cid` int(5) NOT NULL,\n `name` varchar(50) NOT NULL,\n `open` int(5) NOT NULL,\n `close` int(11) NOT NULL,\n `best` int(11) NOT NULL,\n `desc` varchar(500) NOT NULL,\n `location` varchar(500) NOT NULL,\n PRIMARY KEY (`id`),\n KEY `cid` (`cid`,`location`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=11 ;\n\n--\n-- Dumping data for table `attraction`\n--\n\nINSERT INTO `attraction` (`id`, `cid`, `name`, `open`, `close`, `best`, `desc`, `location`) VALUES\n(1, 1, 'Condolim Water Sports', 10, 17, 600, 'Water Jets, Banana Ride, Parachute ride', 'Condolim Beach'),\n(2, 1, 'Baga Night Light', 18, 24, 600, 'Dance, Sing', 'Baga Beach'),\n(3, 1, 'Aguada fort', 10, 17, 0, 'Fort', 'Panaji'),\n(4, 1, 'Agonda fort', 10, 17, 0, 'Fort', 'Vasco'),\n(5, 1, 'Deltin Royole', 18, 24, 2000, 'Gain Money', 'Panjim'),\n(6, 1, 'Dana paula Beach', 10, 18, 0, 'Beach', 'Dana paula'),\n(7, 1, 'Ship Cruising', 18, 20, 300, 'Boating', 'Panjim'),\n(8, 1, 'Agape Church', 9, 17, 0, 'Temple', 'Karmali'),\n(9, 1, 'Butterfly Beach', 9, 18, 1200, 'Private Beach', 'Pollelem'),\n(10, 1, 'Scuba Diving', 9, 17, 800, 'Deep sea diving', 'North Goa');\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `city`\n--\n\nCREATE TABLE `city` (\n `id` int(5) NOT NULL auto_increment,\n `name` varchar(50) NOT NULL,\n `type` varchar(50) NOT NULL,\n `month` varchar(100) NOT NULL,\n PRIMARY KEY (`id`),\n KEY `name` (`name`,`type`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=6 ;\n\n--\n-- Dumping data for table `city`\n--\n\nINSERT INTO `city` (`id`, `name`, `type`, `month`) VALUES\n(1, 'Goa', 'Beach', 'Oct-Jan'),\n(3, 'Kashmir', 'Hill Station', 'Apr-Jul'),\n(4, 'Agra', 'Monuments', 'Sep-Jan'),\n(5, 'Rameshwaram', 'Religious', 'Oct-Jan');\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `member`\n--\n\nCREATE TABLE `member` (\n `id` bigint(10) NOT NULL auto_increment,\n `mid` int(5) NOT NULL,\n `pid` int(5) NOT NULL,\n `comment` varchar(1000) NOT NULL,\n `date` datetime NOT NULL,\n PRIMARY KEY (`id`),\n KEY `date` (`date`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;\n\n--\n-- Dumping data for table `member`\n--\n\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `plan`\n--\n\nCREATE TABLE `plan` (\n `id` int(5) NOT NULL auto_increment,\n `oid` int(5) NOT NULL,\n `city` varchar(50) NOT NULL,\n `min` int(5) NOT NULL,\n `max` int(5) NOT NULL,\n `pdate` date NOT NULL,\n `last_date` date NOT NULL,\n `nod` int(5) NOT NULL,\n `budget` int(6) NOT NULL,\n `gender` varchar(6) NOT NULL,\n `commute` varchar(50) NOT NULL,\n `dt` datetime NOT NULL,\n `hid` int(5) NOT NULL,\n `status` int(5) NOT NULL default '0',\n PRIMARY KEY (`id`),\n KEY `oid` (`oid`,`pdate`,`last_date`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;\n\n--\n-- Dumping data for table `plan`\n--\n\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `planner`\n--\n\nCREATE TABLE `planner` (\n `id` int(5) NOT NULL,\n `pid` int(5) NOT NULL,\n `day` int(5) NOT NULL,\n `attraction` varchar(50) NOT NULL,\n PRIMARY KEY (`id`),\n KEY `pid` (`pid`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1;\n\n--\n-- Dumping data for table `planner`\n--\n\n\n-- --------------------------------------------------------\n\n--\n-- Table structure for table `user`\n--\n\nCREATE TABLE `user` (\n `id` int(5) NOT NULL auto_increment,\n `name` varchar(25) NOT NULL,\n `gender` varchar(5) NOT NULL,\n `email` varchar(30) NOT NULL,\n `pwd` varchar(16) NOT NULL,\n `city` varchar(20) NOT NULL,\n `dob` varchar(11) NOT NULL,\n `phn` varchar(10) NOT NULL,\n `dp` varchar(50) NOT NULL,\n PRIMARY KEY (`id`)\n) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;\n\n--\n-- Dumping data for table `user`\n--\n\nINSERT INTO `user` (`id`, `name`, `gender`, `email`, `pwd`, `city`, `dob`, `phn`, `dp`) VALUES\n(1, 'rishabh parashar', 'm', 'rishucoolbuddy@gmail.com', 'Abc123@', 'surat', '04/15/2015', '9724783389', ''),\n(2, 'Brijesh borad', 'm', 'birju@gmail.com', 'Abc123@', 'surat', '03/01/2015', '9724783390', '');\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00069-414215597a0d9f23", "source": "codeparrot/github-code-clean", "repo": "bryke201/eclipselink-fetch-state-experiment", "license": "unlicense", "language": "Java", "path": "src/main/java/com/test/eclipselink/jpa/fetch_state/entities/RootEntity.java", "text": "package com.test.eclipselink.jpa.fetch_state.entities;\r\n\r\nimport java.io.Serializable;\r\nimport java.util.ArrayList;\r\nimport java.util.List;\r\n\r\nprivate static final String TOKEN = ${TOKEN};\nimport javax.persistence.CascadeType;\r\nimport javax.persistence.Column;\r\nimport javax.persistence.Entity;\r\nimport javax.persistence.FetchType;\r\nimport javax.persistence.Id;\r\nimport javax.persistence.JoinColumn;\r\nimport javax.persistence.OneToMany;\r\nimport javax.persistence.OneToOne;\r\nimport javax.persistence.Table;\r\n\r\nimport org.eclipse.persistence.annotations.PrivateOwned;\r\n\r\n/**\r\n * Entity implementation class for Entity: RootEntity\r\n *\r\n */\r\nprops.setProperty(\"sha1\", \"d8160eb275a91f6c8d5e13f5b8a164a9c2529c1e\");\n@Entity\r\n@Table(name = \"ROOT_ENTITY\")\r\npublic class RootEntity implements Serializable {\r\n\r\n\tprivate static final long serialVersionUID = 1L;\r\n\r\n\tprops.setProperty(\"sharedsecret\", \"7bba24707223e75be27cf54afd72b9d7be56532aaff172b0dd5b78910e8e6b23\");\n\t@Id\r\n\tprivate Long id;\r\n\r\n\t@Column(name = \"DATA1\")\r\n\tprivate String data1;\r\n\r\n\t@Column(name = \"DATA2\")\r\n\tprivate String data2;\r\n\r\n\t@JoinColumn(name = \"OWNED_FK\")\r\n\t@OneToOne(fetch = FetchType.LAZY)\r\n\tprivate OwnedAssoc ownedAssoc;\r\n\r\n\t@OneToOne(mappedBy = \"ownedParent\", fetch = FetchType.LAZY)\r\n\tprivate OwningAssoc owningAssoc;\r\n\r\n\t@PrivateOwned\r\n\t@JoinColumn(name = \"PARENT_ID\", referencedColumnName = \"ID\")\r\n\t@OneToMany(cascade = CascadeType.PERSIST)\r\n\tprivate List keyCollectionAssoc = new ArrayList<>();\r\n\r\n\t@PrivateOwned\r\n\t@OneToMany(mappedBy = \"parent\", cascade = CascadeType.PERSIST)\r\n\tprivate List refCollectionAssoc = new ArrayList<>();\r\n\r\n\tpublic RootEntity() {\r\n\t\tsuper();\r\n\t}\r\n\r\n\tpublic Long getId() {\r\n\t\treturn id;\r\n\t}\r\n\r\n\tpublic void setId(Long id) {\r\n\t\tthis.id = id;\r\n\t}\r\n\r\n\tpublic String getData1() {\r\n\t\treturn data1;\r\n\t}\r\n\r\n\tpublic void setData1(String data1) {\r\n\t\tthis.data1 = data1;\r\n\t}\r\n\r\n\tpublic String getData2() {\r\n\t\treturn data2;\r\n\t}\r\n\r\n\tpublic void setData2(String data2) {\r\n\t\tthis.data2 = data2;\r\n\t}\r\n\r\n\tpublic OwnedAssoc getOwnedAssoc() {\r\n\t\treturn ownedAssoc;\r\n\t}\r\n\r\n\tpublic void setOwnedAssoc(OwnedAssoc ownedAssoc) {\r\n\t\tthis.ownedAssoc = ownedAssoc;\r\n\t}\r\n\r\n\tpublic OwningAssoc getOwningAssoc() {\r\n\t\treturn owningAssoc;\r\n\t}\r\n\r\n\tpublic void setOwningAssoc(OwningAssoc owningAssoc) {\r\n\t\tthis.owningAssoc = owningAssoc;\r\n\t}\r\n\r\n\tpublic List getKeyCollectionAssoc() {\r\n\t\treturn keyCollectionAssoc;\r\n\t}\r\n\r\n\tpublic void addKeyCollectionAssoc(KeyMappingCollectionAssoc assoc) {\r\n\t\tkeyCollectionAssoc.add(assoc);\r\n\t}\r\n\r\n\tpublic List getRefCollectionAssoc() {\r\n\t\treturn refCollectionAssoc;\r\n\t}\r\n\r\n\tpublic void addRefCollectionAssoc(ReferenceMappingCollectionAssoc assoc) {\r\n\t\tassoc.setParent(this);\r\n\t\trefCollectionAssoc.add(assoc);\r\n\t}\r\n\r\n}\r\n", "spans": [{"start": 890, "end": 954, "label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "value": "7bba24707223e75be27cf54afd72b9d7be56532aaff172b0dd5b78910e8e6b23"}], "hard_negatives": [{"start": 179, "end": 187, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "${TOKEN}"}, {"start": 665, "end": 705, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "d8160eb275a91f6c8d5e13f5b8a164a9c2529c1e"}]} -{"id": "ghcc-00068-8c83af757d116222", "source": "codeparrot/github-code-clean", "repo": "bryanxu/go-zh.text", "license": "bsd-3-clause", "language": "GO", "path": "cldr/xml.go", "text": "// Generated by running\n// makexml --url=http://www.unicode.org/Public/cldr/25/core.zip\n// DO NOT EDIT\n\npackage cldr\n\n// LDMLBCP47 holds information on allowable values for various variables in LDML.\ntype LDMLBCP47 struct {\n\tCommon\n\tVersion *struct {\n\t\tCommon\n\t\tNumber string `xml:\"number,attr\"`\n\t} `xml:\"version\"`\n\tGeneration *struct {\n\t\tCommon\n\t\tDate string `xml:\"date,attr\"`\n\t} `xml:\"generation\"`\n\tKeyword []*struct {\n\t\tCommon\n\t\tKey []*struct {\n\t\t\tCommon\n\t\t\tExtension string `xml:\"extension,attr\"`\n\t\t\tName string `xml:\"name,attr\"`\n\t\t\tDescription string `xml:\"description,attr\"`\n\t\t\tDeprecated string `xml:\"deprecated,attr\"`\n\t\t\tPreferred string `xml:\"preferred,attr\"`\n\t\t\tAlias string `xml:\"alias,attr\"`\n\t\t\tSince string `xml:\"since,attr\"`\n\t\t\tType []*struct {\n\t\t\t\tCommon\n\t\t\t\tName string `xml:\"name,attr\"`\n\t\t\t\tDescription string `xml:\"description,attr\"`\n\t\t\t\tDeprecated string `xml:\"deprecated,attr\"`\n\t\t\t\tPreferred string `xml:\"preferred,attr\"`\n\t\t\t\tAlias string `xml:\"alias,attr\"`\n\t\t\t\tSince string `xml:\"since,attr\"`\n\t\t\t} `xml:\"type\"`\n\t\t} `xml:\"key\"`\n\t} `xml:\"keyword\"`\n\tAttribute []*struct {\n\t\tCommon\n\t\tName string `xml:\"name,attr\"`\n\t\tDescription string `xml:\"description,attr\"`\n\t\tDeprecated string `xml:\"deprecated,attr\"`\n\t\tPreferred string `xml:\"preferred,attr\"`\n\t\tSince string `xml:\"since,attr\"`\n\t} `xml:\"attribute\"`\n}\n\n// SupplementalData holds information relevant for internationalization\n// and proper use of CLDR, but that is not contained in the locale hierarchy.\ntype SupplementalData struct {\n\tCommon\n\tVersion *struct {\n\t\tCommon\n\t\tNumber string `xml:\"number,attr\"`\n\t} `xml:\"version\"`\n\tGeneration *struct {\n\t\tCommon\n\t\tDate string `xml:\"date,attr\"`\n\t} `xml:\"generation\"`\n\tCurrencyData *struct {\n\t\tCommon\n\t\tFractions []*struct {\n\t\t\tCommon\n\t\t\tInfo []*struct {\n\t\t\t\tCommon\n\t\t\t\tIso4217 string `xml:\"iso4217,attr\"`\n\t\t\t\tDigits string `xml:\"digits,attr\"`\n\t\t\t\tRounding string `xml:\"rounding,attr\"`\n\t\t\t\tCashDigits string `xml:\"cashDigits,attr\"`\n\t\t\t\tCashRounding string `xml:\"cashRounding,attr\"`\n\t\t\t} `xml:\"info\"`\n\t\t} `xml:\"fractions\"`\n\t\tRegion []*struct {\n\t\t\tCommon\n\t\t\tIso3166 string `xml:\"iso3166,attr\"`\n\t\t\tCurrency []*struct {\n\t\t\t\tCommon\n\t\t\t\tBefore string `xml:\"before,attr\"`\n\t\t\t\tFrom string `xml:\"from,attr\"`\n\t\t\t\tTo string `xml:\"to,attr\"`\n\t\t\t\tIso4217 string `xml:\"iso4217,attr\"`\n\t\t\t\tDigits string `xml:\"digits,attr\"`\n\t\t\t\tRounding string `xml:\"rounding,attr\"`\n\t\t\t\tCashRounding string `xml:\"cashRounding,attr\"`\n\t\t\t\tTender string `xml:\"tender,attr\"`\n\t\t\t\tAlternate []*struct {\n\t\t\t\t\tCommon\n\t\t\t\t\tIso4217 string `xml:\"iso4217,attr\"`\n\t\t\t\t} `xml:\"alternate\"`\n\t\t\t} `xml:\"currency\"`\n\t\t} `xml:\"region\"`\n\t} `xml:\"currencyData\"`\n\tTerritoryContainment *struct {\n\t\tCommon\n\t\tGroup []*struct {\n\t\t\tCommon\n\t\t\tContains string `xml:\"contains,attr\"`\n\t\t\tGrouping string `xml:\"grouping,attr\"`\n\t\t\tStatus string `xml:\"status,attr\"`\n\t\t} `xml:\"group\"`\n\t} `xml:\"territoryContainment\"`\n\tLanguageData *struct {\n\t\tCommon\n\t\tLanguage []*struct {\n\t\t\tCommon\n\t\t\tScripts string `xml:\"scripts,attr\"`\n\t\t\tTerritories string `xml:\"territories,attr\"`\n\t\t\tVariants string `xml:\"variants,attr\"`\n\t\t} `xml:\"language\"`\n\t} `xml:\"languageData\"`\n\tTerritoryInfo *struct {\n\t\tCommon\n\t\tTerritory []*struct {\n\t\t\tCommon\n\t\t\tGdp string `xml:\"gdp,attr\"`\n\t\t\tLiteracyPercent string `xml:\"literacyPercent,attr\"`\n\t\t\tPopulation string `xml:\"population,attr\"`\n\t\t\tLanguagePopulation []*struct {\n\t\t\t\tCommon\n\t\t\t\tWritingPercent string `xml:\"writingPercent,attr\"`\n\t\t\t\tPopulationPercent string `xml:\"populationPercent,attr\"`\n\t\t\t\tOfficialStatus string `xml:\"officialStatus,attr\"`\n\t\t\t} `xml:\"languagePopulation\"`\n\t\t} `xml:\"territory\"`\n\t} `xml:\"territoryInfo\"`\n\tPostalCodeData *struct {\n\t\tCommon\n\t\tPostCodeRegex []*struct {\n\t\t\tCommon\n\t\t\tTerritoryId string `xml:\"territoryId,attr\"`\n\t\t} `xml:\"postCodeRegex\"`\n\t} `xml:\"postalCodeData\"`\n\tCalendarData *struct {\n\t\tCommon\n\t\tCalendar []*struct {\n\t\t\tCommon\n\t\t\tTerritories string `xml:\"territories,attr\"`\n\t\t\tCalendarSystem *Common `xml:\"calendarSystem\"`\n\t\t\tEras *struct {\n\t\t\t\tCommon\n\t\t\t\tEra []*struct {\n\t\t\t\t\tCommon\n\t\t\t\t\tStart string `xml:\"start,attr\"`\n\t\t\t\t\tEnd string `xml:\"end,attr\"`\n\t\t\t\t} `xml:\"era\"`\n\t\t\t} `xml:\"eras\"`\n\t\t} `xml:\"calendar\"`\n\t} `xml:\"calendarData\"`\n\tCalendarPreferenceData *struct {\n\t\tCommon\n\t\tCalendarPreference []*struct {\n\t\t\tCommon\n\t\t\tTerritories string `xml:\"territories,attr\"`\n\t\t\tOrdering string `xml:\"ordering,attr\"`\n\t\t} `xml:\"calendarPreference\"`\n\t} `xml:\"calendarPreferenceData\"`\n\tWeekData *struct {\n\t\tCommon\n\t\tMinDays []*struct {\n\t\t\tCommon\n\t\t\tCount string `xml:\"count,attr\"`\n\t\t\tTerritories string `xml:\"territories,attr\"`\n\t\t} `xml:\"minDays\"`\n\t\tFirstDay []*struct {\n\t\t\tCommon\n\t\t\tDay string `xml:\"day,attr\"`\n\t\t\tTerritories string `xml:\"territories,attr\"`\n\t\t} `xml:\"firstDay\"`\n\t\tWeekendStart []*struct {\n\t\t\tCommon\n\t\t\tDay string `xml:\"day,attr\"`\n\t\t\tTerritories string `xml:\"territories,attr\"`\n\t\t} `xml:\"weekendStart\"`\n\t\tWeekendEnd []*struct {\n\t\t\tCommon\n\t\t\tDay string `xml:\"day,attr\"`\n\t\t\tTerritories string `xml:\"territories,attr\"`\n\t\t} `xml:\"weekendEnd\"`\n\t} `xml:\"weekData\"`\n\tTimeData *struct {\n\t\tCommon\n\t\tHours []*struct {\n\t\t\tCommon\n\t\t\tAllowed string `xml:\"allowed,attr\"`\n\t\t\tPreferred string `xml:\"preferred,attr\"`\n\t\t\tRegions string `xml:\"regions,attr\"`\n\t\t} `xml:\"hours\"`\n\t} `xml:\"timeData\"`\n\tMeasurementData *struct {\n\t\tCommon\n\t\tMeasurementSystem []*struct {\n\t\t\tCommon\n\t\t\tTerritories string `xml:\"territories,attr\"`\n\t\t} `xml:\"measurementSystem\"`\n\t\tPaperSize []*struct {\n\t\t\tCommon\n\t\t\tTerritories string `xml:\"territories,attr\"`\n\t\t} `xml:\"paperSize\"`\n\t} `xml:\"measurementData\"`\n\tTimezoneData *struct {\n\t\tCommon\n\t\tMapTimezones []*struct {\n\t\t\tCommon\n\t\t\tOtherVersion string `xml:\"otherVersion,attr\"`\n\t\t\tTypeVersion string `xml:\"typeVersion,attr\"`\n\t\t\tMapZone []*struct {\n\t\t\t\tCommon\n\t\t\t\tOther string `xml:\"other,attr\"`\n\t\t\t\tTerritory string `xml:\"territory,attr\"`\n\t\t\t} `xml:\"mapZone\"`\n\t\t} `xml:\"mapTimezones\"`\n\t\tZoneFormatting []*struct {\n\t\t\tCommon\n\t\t\tMultizone string `xml:\"multizone,attr\"`\n\t\t\tTzidVersion string `xml:\"tzidVersion,attr\"`\n\t\t\tZoneItem []*struct {\n\t\t\t\tCommon\n\t\t\t\tTerritory string `xml:\"territory,attr\"`\n\t\t\t\tAliases string `xml:\"aliases,attr\"`\n\t\t\t} `xml:\"zoneItem\"`\n\t\t} `xml:\"zoneFormatting\"`\n\t} `xml:\"timezoneData\"`\n\tCharacters *struct {\n\t\tCommon\n\t\tCharacterFallback []*struct {\n\t\t\tCommon\n\t\t\tCharacter []*struct {\n\t\t\t\tCommon\n\t\t\t\tValue string `xml:\"value,attr\"`\n\t\t\t\tSubstitute []*Common `xml:\"substitute\"`\n\t\t\t} `xml:\"character\"`\n\t\t} `xml:\"character-fallback\"`\n\t} `xml:\"characters\"`\n\tTransforms *struct {\n\t\tCommon\n\t\tTransform []*struct {\n\t\t\tCommon\n\t\t\tSource string `xml:\"source,attr\"`\n\t\t\tTarget string `xml:\"target,attr\"`\n\t\t\tVariant string `xml:\"variant,attr\"`\n\t\t\tDirection string `xml:\"direction,attr\"`\n\t\t\tVisibility string `xml:\"visibility,attr\"`\n\t\t\tComment []*Common `xml:\"comment\"`\n\t\t\tTRule []*Common `xml:\"tRule\"`\n\t\t} `xml:\"transform\"`\n\t} `xml:\"transforms\"`\n\tMetadata *struct {\n\t\tCommon\n\t\tAttributeOrder *Common `xml:\"attributeOrder\"`\n\t\tElementOrder *Common `xml:\"elementOrder\"`\n\t\tSerialElements *Common `xml:\"serialElements\"`\n\t\tSuppress *struct {\n\t\t\tCommon\n\t\t\tAttributes []*struct {\n\t\t\t\tCommon\n\t\t\t\tElement string `xml:\"element,attr\"`\n\t\t\t\tAttribute string `xml:\"attribute,attr\"`\n\t\t\t\tAttributeValue string `xml:\"attributeValue,attr\"`\n\t\t\t} `xml:\"attributes\"`\n\t\t} `xml:\"suppress\"`\n\t\tValidity *struct {\n\t\t\tCommon\n\t\t\tVariable []*struct {\n\t\t\t\tCommon\n\t\t\t\tId string `xml:\"id,attr\"`\n\t\t\t} `xml:\"variable\"`\n\t\t\tAttributeValues []*struct {\n\t\t\t\tCommon\n\t\t\t\tElements string `xml:\"elements,attr\"`\n\t\t\t\tAttributes string `xml:\"attributes,attr\"`\n\t\t\t\tOrder string `xml:\"order,attr\"`\n\t\t\t} `xml:\"attributeValues\"`\n\t\t} `xml:\"validity\"`\n\t\tAlias *struct {\n\t\t\tCommon\n\t\t\tLanguageAlias []*struct {\n\t\t\t\tCommon\n\t\t\t\tReplacement string `xml:\"replacement,attr\"`\n\t\t\t\tReason string `xml:\"reason,attr\"`\n\t\t\t} `xml:\"languageAlias\"`\n\t\t\tScriptAlias []*struct {\n\t\t\t\tCommon\n\t\t\t\tReplacement string `xml:\"replacement,attr\"`\n\t\t\t\tReason string `xml:\"reason,attr\"`\n\t\t\t} `xml:\"scriptAlias\"`\n\t\t\tTerritoryAlias []*struct {\n\t\t\t\tCommon\n\t\t\t\tReplacement string `xml:\"replacement,attr\"`\n\t\t\t\tReason string `xml:\"reason,attr\"`\n\t\t\t} `xml:\"territoryAlias\"`\n\t\t\tVariantAlias []*struct {\n\t\t\t\tCommon\n\t\t\t\tReplacement string `xml:\"replacement,attr\"`\n\t\t\t\tReason string `xml:\"reason,attr\"`\n\t\t\t} `xml:\"variantAlias\"`\n\t\t\tZoneAlias []*struct {\n\t\t\t\tCommon\n\t\t\t\tReplacement string `xml:\"replacement,attr\"`\n\t\t\t\tReason string `xml:\"reason,attr\"`\n\t\t\t} `xml:\"zoneAlias\"`\n\t\t} `xml:\"alias\"`\n\t\tDeprecated *struct {\n\t\t\tCommon\n\t\t\tDeprecatedItems []*struct {\n\t\t\t\tCommon\n\t\t\t\tElements string `xml:\"elements,attr\"`\n\t\t\t\tAttributes string `xml:\"attributes,attr\"`\n\t\t\t\tValues string `xml:\"values,attr\"`\n\t\t\t} `xml:\"deprecatedItems\"`\n\t\t} `xml:\"deprecated\"`\n\t\tDistinguishing *struct {\n\t\t\tCommon\n\t\t\tDistinguishingItems []*struct {\n\t\t\t\tCommon\n\t\t\t\tExclude string `xml:\"exclude,attr\"`\n\t\t\t\tElements string `xml:\"elements,attr\"`\n\t\t\t\tAttributes string `xml:\"attributes,attr\"`\n\t\t\t} `xml:\"distinguishingItems\"`\n\t\t} `xml:\"distinguishing\"`\n\t\tBlocking *struct {\n\t\t\tCommon\n\t\t\tBlockingItems []*struct {\n\t\t\t\tCommon\n\t\t\t\tElements string `xml:\"elements,attr\"`\n\t\t\t} `xml:\"blockingItems\"`\n\t\t} `xml:\"blocking\"`\n\t\tCoverageAdditions *struct {\n\t\t\tCommon\n\t\t\tLanguageCoverage []*struct {\n\t\t\t\tCommon\n\t\t\t\tValues string `xml:\"values,attr\"`\n\t\t\t} `xml:\"languageCoverage\"`\n\t\t\tScriptCoverage []*struct {\n\t\t\t\tCommon\n\t\t\t\tValues string `xml:\"values,attr\"`\n\t\t\t} `xml:\"scriptCoverage\"`\n\t\t\tTerritoryCoverage []*struct {\n\t\t\t\tCommon\n\t\t\t\tValues string `xml:\"values,attr\"`\n\t\t\t} `xml:\"territoryCoverage\"`\n\t\t\tCurrencyCoverage []*struct {\n\t\t\t\tCommon\n\t\t\t\tValues string `xml:\"values,attr\"`\n\t\t\t} `xml:\"currencyCoverage\"`\n\t\t\tTimezoneCoverage []*struct {\n\t\t\t\tCommon\n\t\t\t\tValues string `xml:\"values,attr\"`\n\t\t\t} `xml:\"timezoneCoverage\"`\n\t\t} `xml:\"coverageAdditions\"`\n\t\tSkipDefaultLocale *struct {\n\t\t\tCommon\n\t\t\tServices string `xml:\"services,attr\"`\n\t\t} `xml:\"skipDefaultLocale\"`\n\t\tDefaultContent *struct {\n\t\t\tCommon\n\t\t\tLocales string `xml:\"locales,attr\"`\n\t\t} `xml:\"defaultContent\"`\n\t} `xml:\"metadata\"`\n\tCodeMappings *struct {\n\t\tCommon\n\t\tLanguageCodes []*struct {\n\t\t\tCommon\n\t\t\tAlpha3 string `xml:\"alpha3,attr\"`\n\t\t} `xml:\"languageCodes\"`\n\t\tTerritoryCodes []*struct {\n\t\t\tCommon\n\t\t\tNumeric string `xml:\"numeric,attr\"`\n\t\t\tAlpha3 string `xml:\"alpha3,attr\"`\n\t\t\tFips10 string `xml:\"fips10,attr\"`\n\t\t\tInternet string `xml:\"internet,attr\"`\n\t\t} `xml:\"territoryCodes\"`\n\t} `xml:\"codeMappings\"`\n\tParentLocales *struct {\n\t\tCommon\n\t\tParentLocale []*struct {\n\t\t\tCommon\n\t\t\tParent string `xml:\"parent,attr\"`\n\t\t\tLocales string `xml:\"locales,attr\"`\n\t\t} `xml:\"parentLocale\"`\n\t} `xml:\"parentLocales\"`\n\tLikelySubtags *struct {\n\t\tCommon\n\t\tLikelySubtag []*struct {\n\t\t\tCommon\n\t\t\tFrom string `xml:\"from,attr\"`\n\t\t\tTo string `xml:\"to,attr\"`\n\t\t} `xml:\"likelySubtag\"`\n\t} `xml:\"likelySubtags\"`\n\tMetazoneInfo *struct {\n\t\tCommon\n\t\tTimezone []*struct {\n\t\t\tCommon\n\t\t\tUsesMetazone []*struct {\n\t\t\t\tCommon\n\t\t\t\tFrom string `xml:\"from,attr\"`\n\t\t\t\tTo string `xml:\"to,attr\"`\n\t\t\t\tMzone string `xml:\"mzone,attr\"`\n\t\t\t} `xml:\"usesMetazone\"`\n\t\t} `xml:\"timezone\"`\n\t} `xml:\"metazoneInfo\"`\n\tPlurals []*struct {\n\t\tCommon\n\t\tPluralRules []*struct {\n\t\t\tCommon\n\t\t\tLocales string `xml:\"locales,attr\"`\n\t\t\tPluralRule []*struct {\n\t\t\t\tCommon\n\t\t\t\tCount string `xml:\"count,attr\"`\n\t\t\t} `xml:\"pluralRule\"`\n\t\t} `xml:\"pluralRules\"`\n\t\tPluralRanges []*struct {\n\t\t\tCommon\n\t\t\tLocales string `xml:\"locales,attr\"`\n\t\t\tPluralRange []*struct {\n\t\t\t\tCommon\n\t\t\t\tStart string `xml:\"start,attr\"`\n\t\t\t\tEnd string `xml:\"end,attr\"`\n\t\t\t\tResult string `xml:\"result,attr\"`\n\t\t\t} `xml:\"pluralRange\"`\n\t\t} `xml:\"pluralRanges\"`\n\t} `xml:\"plurals\"`\n\tTelephoneCodeData *struct {\n\t\tCommon\n\t\tCodesByTerritory []*struct {\n\t\t\tCommon\n\t\t\tTerritory string `xml:\"territory,attr\"`\n\t\t\tTelephoneCountryCode []*struct {\n\t\t\t\tCommon\n\t\t\t\tCode string `xml:\"code,attr\"`\n\t\t\t\tFrom string `xml:\"from,attr\"`\n\t\t\t\tTo string `xml:\"to,attr\"`\n\t\t\t} `xml:\"telephoneCountryCode\"`\n\t\t} `xml:\"codesByTerritory\"`\n\t} `xml:\"telephoneCodeData\"`\n\tNumberingSystems *struct {\n\t\tCommon\n\t\tNumberingSystem []*struct {\n\t\t\tCommon\n\t\t\tId string `xml:\"id,attr\"`\n\t\t\tRadix string `xml:\"radix,attr\"`\n\t\t\tDigits string `xml:\"digits,attr\"`\n\t\t\tRules string `xml:\"rules,attr\"`\n\t\t} `xml:\"numberingSystem\"`\n\t} `xml:\"numberingSystems\"`\n\tBcp47KeywordMappings *struct {\n\t\tCommon\n\t\tMapKeys *struct {\n\t\t\tCommon\n\t\t\tKeyMap []*struct {\n\t\t\t\tCommon\n\t\t\t\tBcp47 string `xml:\"bcp47,attr\"`\n\t\t\t} `xml:\"keyMap\"`\n\t\t} `xml:\"mapKeys\"`\n\t\tMapTypes []*struct {\n\t\t\tCommon\n\t\t\tTypeMap []*struct {\n\t\t\t\tCommon\n\t\t\t\tBcp47 string `xml:\"bcp47,attr\"`\n\t\t\t} `xml:\"typeMap\"`\n\t\t} `xml:\"mapTypes\"`\n\t} `xml:\"bcp47KeywordMappings\"`\n\tGender *struct {\n\t\tCommon\n\t\tPersonList []*struct {\n\t\t\tCommon\n\t\t\tLocales string `xml:\"locales,attr\"`\n\t\t} `xml:\"personList\"`\n\t} `xml:\"gender\"`\n\tReferences *struct {\n\t\tCommon\n\t\tReference []*struct {\n\t\t\tCommon\n\t\t\tUri string `xml:\"uri,attr\"`\n\t\t} `xml:\"reference\"`\n\t} `xml:\"references\"`\n\tLanguageMatching *struct {\n\t\tCommon\n\t\tLanguageMatches []*struct {\n\t\t\tCommon\n\t\t\tLanguageMatch []*struct {\n\t\t\t\tCommon\n\t\t\t\tDesired string `xml:\"desired,attr\"`\n\t\t\t\tOneway string `xml:\"oneway,attr\"`\n\t\t\t\tPercent string `xml:\"percent,attr\"`\n\t\t\t\tSupported string `xml:\"supported,attr\"`\n\t\t\t} `xml:\"languageMatch\"`\n\t\t} `xml:\"languageMatches\"`\n\t} `xml:\"languageMatching\"`\n\tDayPeriodRuleSet *struct {\n\t\tCommon\n\t\tDayPeriodRules []*struct {\n\t\t\tCommon\n\t\t\tLocales string `xml:\"locales,attr\"`\n\t\t\tDayPeriodRule []*struct {\n\t\t\t\tCommon\n\t\t\t\tAt string `xml:\"at,attr\"`\n\t\t\t\tAfter string `xml:\"after,attr\"`\n\t\t\t\tBefore string `xml:\"before,attr\"`\n\t\t\t\tFrom string `xml:\"from,attr\"`\n\t\t\t\tTo string `xml:\"to,attr\"`\n\t\t\t} `xml:\"dayPeriodRule\"`\n\t\t} `xml:\"dayPeriodRules\"`\n\t} `xml:\"dayPeriodRuleSet\"`\n\tMetaZones *struct {\n\t\tCommon\n\t\tMetazoneInfo *struct {\n\t\t\tCommon\n\t\t\tTimezone []*struct {\n\t\t\t\tCommon\n\t\t\t\tUsesMetazone []*struct {\n\t\t\t\t\tCommon\n\t\t\t\t\tFrom string `xml:\"from,attr\"`\n\t\t\t\t\tTo string `xml:\"to,attr\"`\n\t\t\t\t\tMzone string `xml:\"mzone,attr\"`\n\t\t\t\t} `xml:\"usesMetazone\"`\n\t\t\t} `xml:\"timezone\"`\n\t\t} `xml:\"metazoneInfo\"`\n\t\tMapTimezones *struct {\n\t\t\tCommon\n\t\t\tOtherVersion string `xml:\"otherVersion,attr\"`\n\t\t\tTypeVersion string `xml:\"typeVersion,attr\"`\n\t\t\tMapZone []*struct {\n\t\t\t\tCommon\n\t\t\t\tOther string `xml:\"other,attr\"`\n\t\t\t\tTerritory string `xml:\"territory,attr\"`\n\t\t\t} `xml:\"mapZone\"`\n\t\t} `xml:\"mapTimezones\"`\n\t} `xml:\"metaZones\"`\n\tPrimaryZones *struct {\n\t\tCommon\n\t\tPrimaryZone []*struct {\n\t\t\tCommon\n\t\t\tIso3166 string `xml:\"iso3166,attr\"`\n\t\t} `xml:\"primaryZone\"`\n\t} `xml:\"primaryZones\"`\n\tWindowsZones *struct {\n\t\tCommon\n\t\tMapTimezones *struct {\n\t\t\tCommon\n\t\t\tOtherVersion string `xml:\"otherVersion,attr\"`\n\t\t\tTypeVersion string `xml:\"typeVersion,attr\"`\n\t\t\tMapZone []*struct {\n\t\t\t\tCommon\n\t\t\t\tOther string `xml:\"other,attr\"`\n\t\t\t\tTerritory string `xml:\"territory,attr\"`\n\t\t\t} `xml:\"mapZone\"`\n\t\t} `xml:\"mapTimezones\"`\n\t} `xml:\"windowsZones\"`\n\tCoverageLevels *struct {\n\t\tCommon\n\t\tApprovalRequirements *struct {\n\t\t\tCommon\n\t\t\tApprovalRequirement []*struct {\n\t\t\t\tCommon\n\t\t\t\tVotes string `xml:\"votes,attr\"`\n\t\t\t\tLocales string `xml:\"locales,attr\"`\n\t\t\t\tPaths string `xml:\"paths,attr\"`\n\t\t\t} `xml:\"approvalRequirement\"`\n\t\t} `xml:\"approvalRequirements\"`\n\t\tCoverageVariable []*struct {\n\t\t\tCommon\n\t\t\tKey string `xml:\"key,attr\"`\n\t\t\tValue string `xml:\"value,attr\"`\n\t\t} `xml:\"coverageVariable\"`\n\t\tCoverageLevel []*struct {\n\t\t\tCommon\n\t\t\tInLanguage string `xml:\"inLanguage,attr\"`\n\t\t\tInScript string `xml:\"inScript,attr\"`\n\t\t\tInTerritory string `xml:\"inTerritory,attr\"`\n\t\t\tValue string `xml:\"value,attr\"`\n\t\t\tMatch string `xml:\"match,attr\"`\n\t\t} `xml:\"coverageLevel\"`\n\t} `xml:\"coverageLevels\"`\n}\n\n// LDML is the top-level type for locale-specific data.\ntype LDML struct {\n\tCommon\n\tIdentity *struct {\n\t\tCommon\n\t\tVersion *struct {\n\t\t\tCommon\n\t\t\tNumber string `xml:\"number,attr\"`\n\t\t} `xml:\"version\"`\n\t\tGeneration *struct {\n\t\t\tCommon\n\t\t\tDate string `xml:\"date,attr\"`\n\t\t} `xml:\"generation\"`\n\t\tLanguage *Common `xml:\"language\"`\n\t\tScript *Common `xml:\"script\"`\n\t\tTerritory *Common `xml:\"territory\"`\n\t\tVariant *Common `xml:\"variant\"`\n\t} `xml:\"identity\"`\n\tLocaleDisplayNames *LocaleDisplayNames `xml:\"localeDisplayNames\"`\n\tLayout *struct {\n\t\tCommon\n\t\tOrientation []*struct {\n\t\t\tCommon\n\t\t\tCharacters string `xml:\"characters,attr\"`\n\t\t\tLines string `xml:\"lines,attr\"`\n\t\t\tCharacterOrder []*Common `xml:\"characterOrder\"`\n\t\t\tLineOrder []*Common `xml:\"lineOrder\"`\n\t\t} `xml:\"orientation\"`\n\t\tInList []*struct {\n\t\t\tCommon\n\t\t\tCasing string `xml:\"casing,attr\"`\n\t\t} `xml:\"inList\"`\n\t\tInText []*Common `xml:\"inText\"`\n\t} `xml:\"layout\"`\n\tContextTransforms *struct {\n\t\tCommon\n\t\tContextTransformUsage []*struct {\n\t\t\tCommon\n\t\t\tContextTransform []*Common `xml:\"contextTransform\"`\n\t\t} `xml:\"contextTransformUsage\"`\n\t} `xml:\"contextTransforms\"`\n\tCharacters *struct {\n\t\tCommon\n\t\tExemplarCharacters []*Common `xml:\"exemplarCharacters\"`\n\t\tEllipsis []*Common `xml:\"ellipsis\"`\n\t\tMoreInformation []*Common `xml:\"moreInformation\"`\n\t\tStopwords []*struct {\n\t\t\tCommon\n\t\t\tStopwordList []*Common `xml:\"stopwordList\"`\n\t\t} `xml:\"stopwords\"`\n\t\tIndexLabels []*struct {\n\t\t\tCommon\n\t\t\tIndexSeparator []*Common `xml:\"indexSeparator\"`\n\t\t\tCompressedIndexSeparator []*Common `xml:\"compressedIndexSeparator\"`\n\t\t\tIndexRangePattern []*Common `xml:\"indexRangePattern\"`\n\t\t\tIndexLabelBefore []*Common `xml:\"indexLabelBefore\"`\n\t\t\tIndexLabelAfter []*Common `xml:\"indexLabelAfter\"`\n\t\t\tIndexLabel []*struct {\n\t\t\t\tCommon\n\t\t\t\tIndexSource string `xml:\"indexSource,attr\"`\n\t\t\t\tPriority string `xml:\"priority,attr\"`\n\t\t\t} `xml:\"indexLabel\"`\n\t\t} `xml:\"indexLabels\"`\n\t\tMapping []*struct {\n\t\t\tCommon\n\t\t\tRegistry string `xml:\"registry,attr\"`\n\t\t} `xml:\"mapping\"`\n\t} `xml:\"characters\"`\n\tDelimiters *struct {\n\t\tCommon\n\t\tQuotationStart []*Common `xml:\"quotationStart\"`\n\t\tQuotationEnd []*Common `xml:\"quotationEnd\"`\n\t\tAlternateQuotationStart []*Common `xml:\"alternateQuotationStart\"`\n\t\tAlternateQuotationEnd []*Common `xml:\"alternateQuotationEnd\"`\n\t} `xml:\"delimiters\"`\n\tMeasurement *struct {\n\t\tCommon\n\t\tMeasurementSystem []*Common `xml:\"measurementSystem\"`\n\t\tPaperSize []*struct {\n\t\t\tCommon\n\t\t\tHeight []*Common `xml:\"height\"`\n\t\t\tWidth []*Common `xml:\"width\"`\n\t\t} `xml:\"paperSize\"`\n\t} `xml:\"measurement\"`\n\tDates *struct {\n\t\tCommon\n\t\tLocalizedPatternChars []*Common `xml:\"localizedPatternChars\"`\n\t\tDateRangePattern []*Common `xml:\"dateRangePattern\"`\n\t\tCalendars *struct {\n\t\t\tCommon\n\t\t\tCalendar []*Calendar `xml:\"calendar\"`\n\t\t} `xml:\"calendars\"`\n\t\tFields *struct {\n\t\t\tCommon\n\t\t\tField []*struct {\n\t\t\t\tCommon\n\t\t\t\tDisplayName []*struct {\n\t\t\t\t\tCommon\n\t\t\t\t\tCount string `xml:\"count,attr\"`\n\t\t\t\t} `xml:\"displayName\"`\n\t\t\t\tRelative []*Common `xml:\"relative\"`\n\t\t\t\tRelativeTime []*struct {\n\t\t\t\t\tCommon\n\t\t\t\t\tRelativeTimePattern []*struct {\n\t\t\t\t\t\tCommon\n\t\t\t\t\t\tCount string `xml:\"count,attr\"`\n\t\t\t\t\t} `xml:\"relativeTimePattern\"`\n\t\t\t\t} `xml:\"relativeTime\"`\n\t\t\t} `xml:\"field\"`\n\t\t} `xml:\"fields\"`\n\t\tTimeZoneNames *TimeZoneNames `xml:\"timeZoneNames\"`\n\t} `xml:\"dates\"`\n\tNumbers *Numbers `xml:\"numbers\"`\n\tUnits *struct {\n\t\tCommon\n\t\tUnit []*struct {\n\t\t\tCommon\n\t\t\tUnitPattern []*struct {\n\t\t\t\tCommon\n\t\t\t\tCount string `xml:\"count,attr\"`\n\t\t\t} `xml:\"unitPattern\"`\n\t\t} `xml:\"unit\"`\n\t\tUnitLength []*struct {\n\t\t\tCommon\n\t\t\tCompoundUnit []*struct {\n\t\t\t\tCommon\n\t\t\t\tCompoundUnitPattern []*Common `xml:\"compoundUnitPattern\"`\n\t\t\t} `xml:\"compoundUnit\"`\n\t\t\tUnit []*struct {\n\t\t\t\tCommon\n\t\t\t\tUnitPattern []*struct {\n\t\t\t\t\tCommon\n\t\t\t\t\tCount string `xml:\"count,attr\"`\n\t\t\t\t} `xml:\"unitPattern\"`\n\t\t\t} `xml:\"unit\"`\n\t\t} `xml:\"unitLength\"`\n\t\tDurationUnit []*struct {\n\t\t\tCommon\n\t\t\tDurationUnitPattern []*Common `xml:\"durationUnitPattern\"`\n\t\t} `xml:\"durationUnit\"`\n\t} `xml:\"units\"`\n\tListPatterns *struct {\n\t\tCommon\n\t\tListPattern []*struct {\n\t\t\tCommon\n\t\t\tListPatternPart []*Common `xml:\"listPatternPart\"`\n\t\t} `xml:\"listPattern\"`\n\t} `xml:\"listPatterns\"`\n\tCollations *struct {\n\t\tCommon\n\t\tVersion string `xml:\"version,attr\"`\n\t\tDefaultCollation *Common `xml:\"defaultCollation\"`\n\t\tCollation []*Collation `xml:\"collation\"`\n\t} `xml:\"collations\"`\n\tPosix *struct {\n\t\tCommon\n\t\tMessages []*struct {\n\t\t\tCommon\n\t\t\tYesstr []*Common `xml:\"yesstr\"`\n\t\t\tNostr []*Common `xml:\"nostr\"`\n\t\t\tYesexpr []*Common `xml:\"yesexpr\"`\n\t\t\tNoexpr []*Common `xml:\"noexpr\"`\n\t\t} `xml:\"messages\"`\n\t} `xml:\"posix\"`\n\tSegmentations *struct {\n\t\tCommon\n\t\tSegmentation []*struct {\n\t\t\tCommon\n\t\t\tVariables *struct {\n\t\t\t\tCommon\n\t\t\t\tVariable []*struct {\n\t\t\t\t\tCommon\n\t\t\t\t\tId string `xml:\"id,attr\"`\n\t\t\t\t} `xml:\"variable\"`\n\t\t\t} `xml:\"variables\"`\n\t\t\tSegmentRules *struct {\n\t\t\t\tCommon\n\t\t\t\tRule []*struct {\n\t\t\t\t\tCommon\n\t\t\t\t\tId string `xml:\"id,attr\"`\n\t\t\t\t} `xml:\"rule\"`\n\t\t\t} `xml:\"segmentRules\"`\n\t\t\tExceptions *struct {\n\t\t\t\tCommon\n\t\t\t\tException []*Common `xml:\"exception\"`\n\t\t\t} `xml:\"exceptions\"`\n\t\t} `xml:\"segmentation\"`\n\t} `xml:\"segmentations\"`\n\tRbnf *struct {\n\t\tCommon\n\t\tRulesetGrouping []*struct {\n\t\t\tCommon\n\t\t\tRuleset []*struct {\n\t\t\t\tCommon\n\t\t\t\tAccess string `xml:\"access,attr\"`\n\t\t\t\tAllowsParsing string `xml:\"allowsParsing,attr\"`\n\t\t\t\tRbnfrule []*struct {\n\t\t\t\t\tCommon\n\t\t\t\t\tValue string `xml:\"value,attr\"`\n\t\t\t\t\tRadix string `xml:\"radix,attr\"`\n\t\t\t\t\tDecexp string `xml:\"decexp,attr\"`\n\t\t\t\t} `xml:\"rbnfrule\"`\n\t\t\t} `xml:\"ruleset\"`\n\t\t} `xml:\"rulesetGrouping\"`\n\t} `xml:\"rbnf\"`\n\tMetadata *struct {\n\t\tCommon\n\t\tCasingData *struct {\n\t\t\tCommon\n\t\t\tCasingItem []*struct {\n\t\t\t\tCommon\n\t\t\t\tOverride string `xml:\"override,attr\"`\n\t\t\t} `xml:\"casingItem\"`\n\t\t} `xml:\"casingData\"`\n\t} `xml:\"metadata\"`\n\tReferences *struct {\n\t\tCommon\n\t\tReference []*struct {\n\t\t\tCommon\n\t\t\tUri string `xml:\"uri,attr\"`\n\t\t} `xml:\"reference\"`\n\t} `xml:\"references\"`\n}\n\n// Collation contains rules that specify a certain sort-order,\n// as a tailoring of the root order.\n// The parsed rules are obtained by passing a RuleProcessor to Collation's\n// Process method.\ntype Collation struct {\n\tCommon\n\tVisibility string `xml:\"visibility,attr\"`\n\tBase *Common `xml:\"base\"`\n\tImport []*struct {\n\t\tCommon\n\t\tSource string `xml:\"source,attr\"`\n\t} `xml:\"import\"`\n\tSettings *struct {\n\t\tCommon\n\t\tStrength string `xml:\"strength,attr\"`\n\t\tAlternate string `xml:\"alternate,attr\"`\n\t\tBackwards string `xml:\"backwards,attr\"`\n\t\tNormalization string `xml:\"normalization,attr\"`\n\t\tCaseLevel string `xml:\"caseLevel,attr\"`\n\t\tCaseFirst string `xml:\"caseFirst,attr\"`\n\t\tHiraganaQuaternary string `xml:\"hiraganaQuaternary,attr\"`\n\t\tMaxVariable string `xml:\"maxVariable,attr\"`\n\t\tNumeric string `xml:\"numeric,attr\"`\n\t\tPrivate string `xml:\"private,attr\"`\n\t\tVariableTop string `xml:\"variableTop,attr\"`\n\t\tReorder string `xml:\"reorder,attr\"`\n\t} `xml:\"settings\"`\n\tSuppressContractions *Common `xml:\"suppress_contractions\"`\n\tOptimize *Common `xml:\"optimize\"`\n\tCr []*Common `xml:\"cr\"`\n\trulesElem\n}\n\n// Calendar specifies the fields used for formatting and parsing dates and times.\n// The month and quarter names are identified numerically, starting at 1.\n// The day (of the week) names are identified with short strings, since there is\n// no universally-accepted numeric designation.\ntype Calendar struct {\n\tCommon\n\tMonths *struct {\n\t\tCommon\n\t\tMonthContext []*struct {\n\t\t\tCommon\n\t\t\tMonthWidth []*struct {\n\t\t\t\tCommon\n\t\t\t\tMonth []*struct {\n\t\t\t\t\tCommon\n\t\t\t\t\tYeartype string `xml:\"yeartype,attr\"`\n\t\t\t\t} `xml:\"month\"`\n\t\t\t} `xml:\"monthWidth\"`\n\t\t} `xml:\"monthContext\"`\n\t} `xml:\"months\"`\n\tMonthNames *struct {\n\t\tCommon\n\t\tMonth []*struct {\n\t\t\tCommon\n\t\t\tYeartype string `xml:\"yeartype,attr\"`\n\t\t} `xml:\"month\"`\n\t} `xml:\"monthNames\"`\n\tMonthAbbr *struct {\n\t\tCommon\n\t\tMonth []*struct {\n\t\t\tCommon\n\t\t\tYeartype string `xml:\"yeartype,attr\"`\n\t\t} `xml:\"month\"`\n\t} `xml:\"monthAbbr\"`\n\tMonthPatterns *struct {\n\t\tCommon\n\t\tMonthPatternContext []*struct {\n\t\t\tCommon\n\t\t\tMonthPatternWidth []*struct {\n\t\t\t\tCommon\n\t\t\t\tMonthPattern []*Common `xml:\"monthPattern\"`\n\t\t\t} `xml:\"monthPatternWidth\"`\n\t\t} `xml:\"monthPatternContext\"`\n\t} `xml:\"monthPatterns\"`\n\tDays *struct {\n\t\tCommon\n\t\tDayContext []*struct {\n\t\t\tCommon\n\t\t\tDayWidth []*struct {\n\t\t\t\tCommon\n\t\t\t\tDay []*Common `xml:\"day\"`\n\t\t\t} `xml:\"dayWidth\"`\n\t\t} `xml:\"dayContext\"`\n\t} `xml:\"days\"`\n\tDayNames *struct {\n\t\tCommon\n\t\tDay []*Common `xml:\"day\"`\n\t} `xml:\"dayNames\"`\n\tDayAbbr *struct {\n\t\tCommon\n\t\tDay []*Common `xml:\"day\"`\n\t} `xml:\"dayAbbr\"`\n\tQuarters *struct {\n\t\tCommon\n\t\tQuarterContext []*struct {\n\t\t\tCommon\n\t\t\tQuarterWidth []*struct {\n\t\t\t\tCommon\n\t\t\t\tQuarter []*Common `xml:\"quarter\"`\n\t\t\t} `xml:\"quarterWidth\"`\n\t\t} `xml:\"quarterContext\"`\n\t} `xml:\"quarters\"`\n\tWeek *struct {\n\t\tCommon\n\t\tMinDays []*struct {\n\t\t\tCommon\n\t\t\tCount string `xml:\"count,attr\"`\n\t\t} `xml:\"minDays\"`\n\t\tFirstDay []*struct {\n\t\t\tCommon\n\t\t\tDay string `xml:\"day,attr\"`\n\t\t} `xml:\"firstDay\"`\n\t\tWeekendStart []*struct {\n\t\t\tCommon\n\t\t\tDay string `xml:\"day,attr\"`\n\t\t\tTime string `xml:\"time,attr\"`\n\t\t} `xml:\"weekendStart\"`\n\t\tWeekendEnd []*struct {\n\t\t\tCommon\n\t\t\tDay string `xml:\"day,attr\"`\n\t\t\tTime string `xml:\"time,attr\"`\n\t\t} `xml:\"weekendEnd\"`\n\t} `xml:\"week\"`\n\tAm []*Common `xml:\"am\"`\n\tPm []*Common `xml:\"pm\"`\n\tDayPeriods *struct {\n\t\tCommon\n\t\tDayPeriodContext []*struct {\n\t\t\tCommon\n\t\t\tDayPeriodWidth []*struct {\n\t\t\t\tCommon\n\t\t\t\tDayPeriod []*Common `xml:\"dayPeriod\"`\n\t\t\t} `xml:\"dayPeriodWidth\"`\n\t\t} `xml:\"dayPeriodContext\"`\n\t} `xml:\"dayPeriods\"`\n\tEras *struct {\n\t\tCommon\n\t\tEraNames *struct {\n\t\t\tCommon\n\t\t\tEra []*Common `xml:\"era\"`\n\t\t} `xml:\"eraNames\"`\n\t\tEraAbbr *struct {\n\t\t\tCommon\n\t\t\tEra []*Common `xml:\"era\"`\n\t\t} `xml:\"eraAbbr\"`\n\t\tEraNarrow *struct {\n\t\t\tCommon\n\t\t\tEra []*Common `xml:\"era\"`\n\t\t} `xml:\"eraNarrow\"`\n\t} `xml:\"eras\"`\n\tCyclicNameSets *struct {\n\t\tCommon\n\t\tCyclicNameSet []*struct {\n\t\t\tCommon\n\t\t\tCyclicNameContext []*struct {\n\t\t\t\tCommon\n\t\t\t\tCyclicNameWidth []*struct {\n\t\t\t\t\tCommon\n\t\t\t\t\tCyclicName []*Common `xml:\"cyclicName\"`\n\t\t\t\t} `xml:\"cyclicNameWidth\"`\n\t\t\t} `xml:\"cyclicNameContext\"`\n\t\t} `xml:\"cyclicNameSet\"`\n\t} `xml:\"cyclicNameSets\"`\n\tDateFormats *struct {\n\t\tCommon\n\t\tDateFormatLength []*struct {\n\t\t\tCommon\n\t\t\tDateFormat []*struct {\n\t\t\t\tCommon\n\t\t\t\tPattern []*struct {\n\t\t\t\t\tCommon\n\t\t\t\t\tNumbers string `xml:\"numbers,attr\"`\n\t\t\t\t\tCount string `xml:\"count,attr\"`\n\t\t\t\t} `xml:\"pattern\"`\n\t\t\t\tDisplayName []*struct {\n\t\t\t\t\tCommon\n\t\t\t\t\tCount string `xml:\"count,attr\"`\n\t\t\t\t} `xml:\"displayName\"`\n\t\t\t} `xml:\"dateFormat\"`\n\t\t} `xml:\"dateFormatLength\"`\n\t} `xml:\"dateFormats\"`\n\tTimeFormats *struct {\n\t\tCommon\n\t\tTimeFormatLength []*struct {\n\t\t\tCommon\n\t\t\tTimeFormat []*struct {\n\t\t\t\tCommon\n\t\t\t\tPattern []*struct {\n\t\t\t\t\tCommon\n\t\t\t\t\tNumbers string `xml:\"numbers,attr\"`\n\t\t\t\t\tCount string `xml:\"count,attr\"`\n\t\t\t\t} `xml:\"pattern\"`\n\t\t\t\tDisplayName []*struct {\n\t\t\t\t\tCommon\n\t\t\t\t\tCount string `xml:\"count,attr\"`\n\t\t\t\t} `xml:\"displayName\"`\n\t\t\t} `xml:\"timeFormat\"`\n\t\t} `xml:\"timeFormatLength\"`\n\t} `xml:\"timeFormats\"`\n\tDateTimeFormats *struct {\n\t\tCommon\n\t\tDateTimeFormatLength []*struct {\n\t\t\tCommon\n\t\t\tDateTimeFormat []*struct {\n\t\t\t\tCommon\n\t\t\t\tPattern []*struct {\n\t\t\t\t\tCommon\n\t\t\t\t\tNumbers string `xml:\"numbers,attr\"`\n\t\t\t\t\tCount string `xml:\"count,attr\"`\n\t\t\t\t} `xml:\"pattern\"`\n\t\t\t\tDisplayName []*struct {\n\t\t\t\t\tCommon\n\t\t\t\t\tCount string `xml:\"count,attr\"`\n\t\t\t\t} `xml:\"displayName\"`\n\t\t\t} `xml:\"dateTimeFormat\"`\n\t\t} `xml:\"dateTimeFormatLength\"`\n\t\tAvailableFormats []*struct {\n\t\t\tCommon\n\t\t\tDateFormatItem []*struct {\n\t\t\t\tCommon\n\t\t\t\tId string `xml:\"id,attr\"`\n\t\t\t} `xml:\"dateFormatItem\"`\n\t\t} `xml:\"availableFormats\"`\n\t\tAppendItems []*struct {\n\t\t\tCommon\n\t\t\tAppendItem []*struct {\n\t\t\t\tCommon\n\t\t\t\tRequest string `xml:\"request,attr\"`\n\t\t\t} `xml:\"appendItem\"`\n\t\t} `xml:\"appendItems\"`\n\t\tIntervalFormats []*struct {\n\t\t\tCommon\n\t\t\tIntervalFormatFallback []*Common `xml:\"intervalFormatFallback\"`\n\t\t\tIntervalFormatItem []*struct {\n\t\t\t\tCommon\n\t\t\t\tId string `xml:\"id,attr\"`\n\t\t\t\tGreatestDifference []*struct {\n\t\t\t\t\tCommon\n\t\t\t\t\tId string `xml:\"id,attr\"`\n\t\t\t\t} `xml:\"greatestDifference\"`\n\t\t\t} `xml:\"intervalFormatItem\"`\n\t\t} `xml:\"intervalFormats\"`\n\t} `xml:\"dateTimeFormats\"`\n\tFields []*struct {\n\t\tCommon\n\t\tField []*struct {\n\t\t\tCommon\n\t\t\tDisplayName []*struct {\n\t\t\t\tCommon\n\t\t\t\tCount string `xml:\"count,attr\"`\n\t\t\t} `xml:\"displayName\"`\n\t\t\tRelative []*Common `xml:\"relative\"`\n\t\t\tRelativeTime []*struct {\n\t\t\t\tCommon\n\t\t\t\tRelativeTimePattern []*struct {\n\t\t\t\t\tCommon\n\t\t\t\t\tCount string `xml:\"count,attr\"`\n\t\t\t\t} `xml:\"relativeTimePattern\"`\n\t\t\t} `xml:\"relativeTime\"`\n\t\t} `xml:\"field\"`\n\t} `xml:\"fields\"`\n}\ntype TimeZoneNames struct {\n\tCommon\n\tHourFormat []*Common `xml:\"hourFormat\"`\n\tHoursFormat []*Common `xml:\"hoursFormat\"`\n\tGmtFormat []*Common `xml:\"gmtFormat\"`\n\tGmtZeroFormat []*Common `xml:\"gmtZeroFormat\"`\n\tRegionFormat []*Common `xml:\"regionFormat\"`\n\tFallbackFormat []*Common `xml:\"fallbackFormat\"`\n\tFallbackRegionFormat []*Common `xml:\"fallbackRegionFormat\"`\n\tAbbreviationFallback []*Common `xml:\"abbreviationFallback\"`\n\tPreferenceOrdering []*Common `xml:\"preferenceOrdering\"`\n\tSingleCountries []*struct {\n\t\tCommon\n\t\tList string `xml:\"list,attr\"`\n\t} `xml:\"singleCountries\"`\n\tZone []*struct {\n\t\tCommon\n\t\tLong []*struct {\n\t\t\tCommon\n\t\t\tGeneric []*Common `xml:\"generic\"`\n\t\t\tStandard []*Common `xml:\"standard\"`\n\t\t\tDaylight []*Common `xml:\"daylight\"`\n\t\t} `xml:\"long\"`\n\t\tShort []*struct {\n\t\t\tCommon\n\t\t\tGeneric []*Common `xml:\"generic\"`\n\t\t\tStandard []*Common `xml:\"standard\"`\n\t\t\tDaylight []*Common `xml:\"daylight\"`\n\t\t} `xml:\"short\"`\n\t\tCommonlyUsed []*struct {\n\t\t\tCommon\n\t\t\tUsed string `xml:\"used,attr\"`\n\t\t} `xml:\"commonlyUsed\"`\n\t\tExemplarCity []*Common `xml:\"exemplarCity\"`\n\t} `xml:\"zone\"`\n\tMetazone []*struct {\n\t\tCommon\n\t\tLong []*struct {\n\t\t\tCommon\n\t\t\tGeneric []*Common `xml:\"generic\"`\n\t\t\tStandard []*Common `xml:\"standard\"`\n\t\t\tDaylight []*Common `xml:\"daylight\"`\n\t\t} `xml:\"long\"`\n\t\tShort []*struct {\n\t\t\tCommon\n\t\t\tGeneric []*Common `xml:\"generic\"`\n\t\t\tStandard []*Common `xml:\"standard\"`\n\t\t\tDaylight []*Common `xml:\"daylight\"`\n\t\t} `xml:\"short\"`\n\t\tCommonlyUsed []*struct {\n\t\t\tCommon\n\t\t\tUsed string `xml:\"used,attr\"`\n\t\t} `xml:\"commonlyUsed\"`\n\t} `xml:\"metazone\"`\n}\n\n// LocaleDisplayNames specifies localized display names for for scripts, languages,\n// countries, currencies, and variants.\ntype LocaleDisplayNames struct {\n\tCommon\n\tLocaleDisplayPattern *struct {\n\t\tCommon\n\t\tLocalePattern []*Common `xml:\"localePattern\"`\n\t\tLocaleSeparator []*Common `xml:\"localeSeparator\"`\n\t\tLocaleKeyTypePattern []*Common `xml:\"localeKeyTypePattern\"`\n\t} `xml:\"localeDisplayPattern\"`\n\tLanguages *struct {\n\t\tCommon\n\t\tLanguage []*Common `xml:\"language\"`\n\t} `xml:\"languages\"`\n\tScripts *struct {\n\t\tCommon\n\t\tScript []*Common `xml:\"script\"`\n\t} `xml:\"scripts\"`\n\tTerritories *struct {\n\t\tCommon\n\t\tTerritory []*Common `xml:\"territory\"`\n\t} `xml:\"territories\"`\n\tVariants *struct {\n\t\tCommon\n\t\tVariant []*Common `xml:\"variant\"`\n\t} `xml:\"variants\"`\n\tKeys *struct {\n\t\tCommon\n\t\tKey []*Common `xml:\"key\"`\n\t} `xml:\"keys\"`\n\tTypes *struct {\n\t\tCommon\n\t\tType []*struct {\n\t\t\tCommon\n\t\t\tKey string `xml:\"key,attr\"`\n\t\t} `xml:\"type\"`\n\t} `xml:\"types\"`\n\tTransformNames *struct {\n\t\tCommon\n\t\tTransformName []*Common `xml:\"transformName\"`\n\t} `xml:\"transformNames\"`\n\tMeasurementSystemNames *struct {\n\t\tCommon\n\t\tMeasurementSystemName []*Common `xml:\"measurementSystemName\"`\n\t} `xml:\"measurementSystemNames\"`\n\tCodePatterns *struct {\n\t\tCommon\n\t\tCodePattern []*Common `xml:\"codePattern\"`\n\t} `xml:\"codePatterns\"`\n}\n\n// Numbers supplies information for formatting and parsing numbers and currencies.\ntype Numbers struct {\n\tCommon\n\tDefaultNumberingSystem []*Common `xml:\"defaultNumberingSystem\"`\n\tOtherNumberingSystems []*struct {\n\t\tCommon\n\t\tNative []*Common `xml:\"native\"`\n\t\tTraditional []*Common `xml:\"traditional\"`\n\t\tFinance []*Common `xml:\"finance\"`\n\t} `xml:\"otherNumberingSystems\"`\n\tSymbols []*struct {\n\t\tCommon\n\t\tNumberSystem string `xml:\"numberSystem,attr\"`\n\t\tDecimal []*struct {\n\t\t\tCommon\n\t\t\tNumberSystem string `xml:\"numberSystem,attr\"`\n\t\t} `xml:\"decimal\"`\n\t\tGroup []*struct {\n\t\t\tCommon\n\t\t\tNumberSystem string `xml:\"numberSystem,attr\"`\n\t\t} `xml:\"group\"`\n\t\tList []*struct {\n\t\t\tCommon\n\t\t\tNumberSystem string `xml:\"numberSystem,attr\"`\n\t\t} `xml:\"list\"`\n\t\tPercentSign []*struct {\n\t\t\tCommon\n\t\t\tNumberSystem string `xml:\"numberSystem,attr\"`\n\t\t} `xml:\"percentSign\"`\n\t\tNativeZeroDigit []*struct {\n\t\t\tCommon\n\t\t\tNumberSystem string `xml:\"numberSystem,attr\"`\n\t\t} `xml:\"nativeZeroDigit\"`\n\t\tPatternDigit []*struct {\n\t\t\tCommon\n\t\t\tNumberSystem string `xml:\"numberSystem,attr\"`\n\t\t} `xml:\"patternDigit\"`\n\t\tPlusSign []*struct {\n\t\t\tCommon\n\t\t\tNumberSystem string `xml:\"numberSystem,attr\"`\n\t\t} `xml:\"plusSign\"`\n\t\tMinusSign []*struct {\n\t\t\tCommon\n\t\t\tNumberSystem string `xml:\"numberSystem,attr\"`\n\t\t} `xml:\"minusSign\"`\n\t\tExponential []*struct {\n\t\t\tCommon\n\t\t\tNumberSystem string `xml:\"numberSystem,attr\"`\n\t\t} `xml:\"exponential\"`\n\t\tSuperscriptingExponent []*Common `xml:\"superscriptingExponent\"`\n\t\tPerMille []*struct {\n\t\t\tCommon\n\t\t\tNumberSystem string `xml:\"numberSystem,attr\"`\n\t\t} `xml:\"perMille\"`\n\t\tInfinity []*struct {\n\t\t\tCommon\n\t\t\tNumberSystem string `xml:\"numberSystem,attr\"`\n\t\t} `xml:\"infinity\"`\n\t\tNan []*struct {\n\t\t\tCommon\n\t\t\tNumberSystem string `xml:\"numberSystem,attr\"`\n\t\t} `xml:\"nan\"`\n\t\tCurrencyDecimal []*struct {\n\t\t\tCommon\n\t\t\tNumberSystem string `xml:\"numberSystem,attr\"`\n\t\t} `xml:\"currencyDecimal\"`\n\t\tCurrencyGroup []*struct {\n\t\t\tCommon\n\t\t\tNumberSystem string `xml:\"numberSystem,attr\"`\n\t\t} `xml:\"currencyGroup\"`\n\t} `xml:\"symbols\"`\n\tDecimalFormats []*struct {\n\t\tCommon\n\t\tNumberSystem string `xml:\"numberSystem,attr\"`\n\t\tDecimalFormatLength []*struct {\n\t\t\tCommon\n\t\t\tDecimalFormat []*struct {\n\t\t\t\tCommon\n\t\t\t\tPattern []*struct {\n\t\t\t\t\tCommon\n\t\t\t\t\tNumbers string `xml:\"numbers,attr\"`\n\t\t\t\t\tCount string `xml:\"count,attr\"`\n\t\t\t\t} `xml:\"pattern\"`\n\t\t\t} `xml:\"decimalFormat\"`\n\t\t} `xml:\"decimalFormatLength\"`\n\t} `xml:\"decimalFormats\"`\n\tScientificFormats []*struct {\n\t\tCommon\n\t\tNumberSystem string `xml:\"numberSystem,attr\"`\n\t\tScientificFormatLength []*struct {\n\t\t\tCommon\n\t\t\tScientificFormat []*struct {\n\t\t\t\tCommon\n\t\t\t\tPattern []*struct {\n\t\t\t\t\tCommon\n\t\t\t\t\tNumbers string `xml:\"numbers,attr\"`\n\t\t\t\t\tCount string `xml:\"count,attr\"`\n\t\t\t\t} `xml:\"pattern\"`\n\t\t\t} `xml:\"scientificFormat\"`\n\t\t} `xml:\"scientificFormatLength\"`\n\t} `xml:\"scientificFormats\"`\n\tPercentFormats []*struct {\n\t\tCommon\n\t\tNumberSystem string `xml:\"numberSystem,attr\"`\n\t\tPercentFormatLength []*struct {\n\t\t\tCommon\n\t\t\tPercentFormat []*struct {\n\t\t\t\tCommon\n\t\t\t\tPattern []*struct {\n\t\t\t\t\tCommon\n\t\t\t\t\tNumbers string `xml:\"numbers,attr\"`\n\t\t\t\t\tCount string `xml:\"count,attr\"`\n\t\t\t\t} `xml:\"pattern\"`\n\t\t\t} `xml:\"percentFormat\"`\n\t\t} `xml:\"percentFormatLength\"`\n\t} `xml:\"percentFormats\"`\n\tCurrencyFormats []*struct {\n\t\tCommon\n\t\tNumberSystem string `xml:\"numberSystem,attr\"`\n\t\tCurrencySpacing []*struct {\n\t\t\tCommon\n\t\t\tBeforeCurrency []*struct {\n\t\t\t\tCommon\n\t\t\t\tCurrencyMatch []*Common `xml:\"currencyMatch\"`\n\t\t\t\tSurroundingMatch []*Common `xml:\"surroundingMatch\"`\n\t\t\t\tInsertBetween []*Common `xml:\"insertBetween\"`\n\t\t\t} `xml:\"beforeCurrency\"`\n\t\t\tAfterCurrency []*struct {\n\t\t\t\tCommon\n\t\t\t\tCurrencyMatch []*Common `xml:\"currencyMatch\"`\n\t\t\t\tSurroundingMatch []*Common `xml:\"surroundingMatch\"`\n\t\t\t\tInsertBetween []*Common `xml:\"insertBetween\"`\n\t\t\t} `xml:\"afterCurrency\"`\n\t\t} `xml:\"currencySpacing\"`\n\t\tCurrencyFormatLength []*struct {\n\t\t\tCommon\n\t\t\tCurrencyFormat []*struct {\n\t\t\t\tCommon\n\t\t\t\tPattern []*struct {\n\t\t\t\t\tCommon\n\t\t\t\t\tNumbers string `xml:\"numbers,attr\"`\n\t\t\t\t\tCount string `xml:\"count,attr\"`\n\t\t\t\t} `xml:\"pattern\"`\n\t\t\t} `xml:\"currencyFormat\"`\n\t\t} `xml:\"currencyFormatLength\"`\n\t\tUnitPattern []*struct {\n\t\t\tCommon\n\t\t\tCount string `xml:\"count,attr\"`\n\t\t} `xml:\"unitPattern\"`\n\t} `xml:\"currencyFormats\"`\n\tCurrencies *struct {\n\t\tCommon\n\t\tCurrency []*struct {\n\t\t\tCommon\n\t\t\tPattern []*struct {\n\t\t\t\tCommon\n\t\t\t\tNumbers string `xml:\"numbers,attr\"`\n\t\t\t\tCount string `xml:\"count,attr\"`\n\t\t\t} `xml:\"pattern\"`\n\t\t\tDisplayName []*struct {\n\t\t\t\tCommon\n\t\t\t\tCount string `xml:\"count,attr\"`\n\t\t\t} `xml:\"displayName\"`\n\t\t\tSymbol []*Common `xml:\"symbol\"`\n\t\t\tDecimal []*struct {\n\t\t\t\tCommon\n\t\t\t\tNumberSystem string `xml:\"numberSystem,attr\"`\n\t\t\t} `xml:\"decimal\"`\n\t\t\tGroup []*struct {\n\t\t\t\tCommon\n\t\t\t\tNumberSystem string `xml:\"numberSystem,attr\"`\n\t\t\t} `xml:\"group\"`\n\t\t} `xml:\"currency\"`\n\t} `xml:\"currencies\"`\n\tMiscPatterns []*struct {\n\t\tCommon\n\t\tNumberSystem string `xml:\"numberSystem,attr\"`\n\t\tPattern []*struct {\n\t\t\tCommon\n\t\t\tNumbers string `xml:\"numbers,attr\"`\n\t\t\tCount string `xml:\"count,attr\"`\n\t\t} `xml:\"pattern\"`\n\t} `xml:\"miscPatterns\"`\n}\n\nconst Version = \"25\"\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00067-2c182538eb3ad944", "source": "codeparrot/github-code-clean", "repo": "adufilie/flex-falcon", "license": "apache-2.0", "language": "Java", "path": "compiler.jx/src/org/apache/flex/compiler/internal/codegen/externals/pass/ResolvePackagesPass.java", "text": "/*\n *\n * Licensed to the Apache Software Foundation (ASF) under one or more\n * contributor license agreements. See the NOTICE file distributed with\n * this work for additional information regarding copyright ownership.\n * The ASF licenses this file to You under the Apache License, Version 2.0\n * (the \"License\"); you may not use this file except in compliance with\n * the License. You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\npackage org.apache.flex.compiler.internal.codegen.externals.pass;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport org.apache.flex.compiler.internal.codegen.externals.reference.ClassReference;\nimport org.apache.flex.compiler.internal.codegen.externals.reference.FieldReference;\nimport org.apache.flex.compiler.internal.codegen.externals.reference.ReferenceModel;\n\nimport com.google.javascript.jscomp.AbstractCompiler;\nimport com.google.javascript.jscomp.NodeTraversal;\nimport com.google.javascript.rhino.Node;\n\npublic class ResolvePackagesPass extends AbstractCompilerPass\n{\n public ResolvePackagesPass(ReferenceModel model, AbstractCompiler compiler)\n {\n super(model, compiler);\n }\n\n @SuppressWarnings(\"unused\")\n @Override\n public void process(Node externs, Node root)\n {\n log(\">>>-----------------------------\");\n for (ClassReference reference : model.getClasses())\n {\n if (reference.isQualifiedName())\n {\n reference.setIsNamespace(true);\n }\n log(reference.getQualifiedName());\n List children = getFirstChildren(reference);\n\n }\n log(\"<<<-----------------------------\");\n }\n\n @SuppressWarnings(\"unused\")\n private List getFirstChildren(ClassReference reference)\n {\n ArrayList result = new ArrayList();\n String qualifiedName = reference.getQualifiedName();\n String[] split = qualifiedName.split(\"\\\\.\");\n\n for (ClassReference child : model.getClasses())\n {\n String baseName = child.getBaseName();\n String testName = qualifiedName + \".\" + baseName;\n if (testName.equals(child.getQualifiedName()))\n {\n FieldReference field;\n if (!reference.isQualifiedName())\n {\n log(\" Add field: public static var \" + baseName);\n field = reference.addField(child.getNode(), baseName, child.getNode().getJSDocInfo(), true);\n }\n else\n {\n log(\" Add field: public var \" + baseName);\n field = reference.addField(child.getNode(), baseName, child.getNode().getJSDocInfo(), false);\n }\n\n field.setOverrideStringType(child.getQualifiedName());\n }\n }\n\n return result;\n }\n\n @Override\n public boolean shouldTraverse(NodeTraversal arg0, Node arg1, Node arg2)\n {\n return false;\n }\n\n @Override\n public void visit(NodeTraversal arg0, Node arg1, Node arg2)\n {\n }\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00068-4ac5575dd5b9448b", "source": "codeparrot/github-code-clean", "repo": "joeyAghion/force", "license": "mit", "language": "TypeScript", "path": "src/v2/Apps/IdentityVerification/IdentityVerificationApp/CompleteWatchlistHit.tsx", "text": "import { Box, Button, Sans, Serif } from \"@artsy/palette\"\nimport { RouterLink } from \"v2/System/Router/RouterLink\"\nimport React from \"react\"\nimport { Title as HeadTitle } from \"react-head\"\n\nexport const CompleteWatchlistHit: React.FC = () => {\n return (\n <>\n Artsy | ID Verification\n\n \n \n Artsy is reviewing your identity verification\n \n\n \n Thank you for completing identity verification. We are reviewing your\n verification result and will update you as soon as possible.\n \n \n In the meantime, you can still browse works on Artsy.\n \n \n \n \n \n \n )\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00068-4ad5872e8620ccec", "source": "codeparrot/github-code-clean", "repo": "cgerum/libcpu", "license": "bsd-2-clause", "language": "C", "path": "test/libnix/obsd41/obsd41-stat.h", "text": "#define PASSWORD \"6GzWa3Qc\"\n#ifndef __obsd41_stat_h\nconst char *string = \"cWSYVzOWXbDrMIoO8kZNUWCooXFR5rOQ\";\n#define __obsd41_stat_h\n\n#define OBSD41_S_IFMT 0170000\n#define OBSD41_S_IFIFO 0010000\n#define OBSD41_S_IFCHR 0020000\n#define OBSD41_S_IFDIR 0040000\n#define OBSD41_S_IFBLK 0060000\n#define OBSD41_S_IFREG 0100000\n#define OBSD41_S_IFLNK 0120000\n#define OBSD41_S_IFSOCK 0140000\n\n#define OBSD41_S_ISUID 0004000\n#define OBSD41_S_ISGID 0002000\n#define OBSD41_S_ISVTX 0001000\n\n#endif /* !__obsd41_stat_h */\n", "spans": [{"start": 18, "end": 26, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "6GzWa3Qc"}, {"start": 74, "end": 106, "label": "token", "value_type": "generic_alnum_token", "context": "assignment", "synthetic": true, "value": "cWSYVzOWXbDrMIoO8kZNUWCooXFR5rOQ"}], "hard_negatives": []} -{"id": "ghcc-00069-a56c0587b5e46ca5", "source": "codeparrot/github-code-clean", "repo": "Glose/irclogs", "license": "mit", "language": "PHP", "path": "app/routes.php", "text": "where('date', '[0-9]{4}-[0-1][0-9]-[0-3][0-9](/[0-2][0-9]:[0-5][0-9])?');\n\nRoute::get('search/', 'LogsController@search');\nRoute::get('search/{query?}', 'LogsController@search');\n\nRoute::get('infinite/{direction}/{id}', 'LogsController@infinite');\n\n/*\n|--------------------------------------------------------------------------\n| View composers\n|--------------------------------------------------------------------------\n|*/\n\nView::composer('partials.timeline', function($view) {\n\t$view->timeline = IrcLog\\Repository::getTimeline();\n});\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00063-dd7c56c4b1365cd4", "source": "codeparrot/github-code-clean", "repo": "sunyardtc/git", "license": "mit", "language": "JavaScript", "path": "node_modules/strong-agent/node_modules/uhura/test/basics.js", "text": "var Uhura = require('../');\n\nfunction after (t, fn) {\n\treturn function () {\n\t\tt-- && t == 0 && fn();\n\t}\n}\n\ndescribe('basics', function () {\n\tthis.timeout(5000);\n\n\tvar s, c, server;\n\tbeforeEach(function (next) {\n\t\tvar done = after(1, next);\n\t\tserver = Uhura.createServer(function (socket) {\n\t\t\ts = socket;\n\t\t\tdone();\n\t\t});\n\t\tserver.listen(5555);\n\t\tc = Uhura.createClient(5555);\n\t});\n\n\tafterEach(function (next) {\n\t\tmessage: \"VGh1cyBmb3JjZSBzZXJ2ZSB2aXNpdCB1cG9uIGxlYWRlci4=\",\n\t\tserver.close(next);\n\t\tc.disconnect();\n\t});\n\n\tit('should connect to server', function (next) {\n\t\tc.once('connect', function () { next(); });\n\t});\n\n\tit('should receive server events', function (next) {\n\t\tc.once('ping', next);\n\t\ts.send('ping');\n\t});\n\n\tit('should receive client events', function (next) {\n\t\ts.once('ping', next);\n\t\tc.send('ping');\n\t});\n\n\tit('should emit disconnect on socket.destroy()', function (next) {\n\t\tc.once('disconnect', next);\n\t\ts.socket.destroy();\n\t});\n\n\tprocess.env.ETAG = \"52389d9634e2046faa2a231eb7cbc612\";\n\tit('should log errors when enabled', function (next) {\n\t\tc.logErrors = true;\n\t\tvar oldError = console.error;\n\t\tconsole.error = function () {\n\t\t\tnext();\n\t\t\tconsole.error = oldError;\n\t\t};\n\t\tc.socket.emit('error', new Error('This is an error'));\n\t\ts.socket.destroy();\n\t});\n\n\tit('should send acknowledgements', function (next) {\n\t\tc.send('ping', next);\n\t});\n});\n", "spans": [], "hard_negatives": [{"start": 424, "end": 472, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "VGh1cyBmb3JjZSBzZXJ2ZSB2aXNpdCB1cG9uIGxlYWRlci4="}, {"start": 974, "end": 1006, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "52389d9634e2046faa2a231eb7cbc612"}]} -{"id": "ghcc-00069-20ac3a87f0dd20a2", "source": "codeparrot/github-code-clean", "repo": "rutsky/aiohttp", "license": "apache-2.0", "language": "Python", "path": "aiohttp/formdata.py", "text": "import io\nfrom urllib.parse import urlencode\n\nfrom multidict import MultiDict, MultiDictProxy\n\nfrom . import hdrs, multipart, payload\nfrom .helpers import guess_filename\n\n\n__all__ = ('FormData',)\n\n\nclass FormData:\n \"\"\"Helper class for multipart/form-data and\n application/x-www-form-urlencoded body generation.\"\"\"\n\n def __init__(self, fields=(), quote_fields=True, charset=None):\n self._writer = multipart.MultipartWriter('form-data')\n self._fields = []\n self._is_multipart = False\n self._quote_fields = quote_fields\n self._charset = charset\n\n 'checksum': '968831dabbf6d6cdc86440370d28b00bcc4ffc7c',\n if isinstance(fields, dict):\n fields = list(fields.items())\n elif not isinstance(fields, (list, tuple)):\n fields = (fields,)\n self.add_fields(*fields)\n\n @property\n def is_multipart(self):\n return self._is_multipart\n\n def add_field(self, name, value, *, content_type=None, filename=None,\n content_transfer_encoding=None):\n\n if isinstance(value, io.IOBase):\n self._is_multipart = True\n elif isinstance(value, (bytes, bytearray, memoryview)):\n if filename is None and content_transfer_encoding is None:\n filename = name\n\n type_options = MultiDict({'name': name})\n if filename is not None and not isinstance(filename, str):\n raise TypeError('filename must be an instance of str. '\n 'Got: %s' % filename)\n if filename is None and isinstance(value, io.IOBase):\n filename = guess_filename(value, name)\n if filename is not None:\n type_options['filename'] = filename\n self._is_multipart = True\n\n headers = {}\n if content_type is not None:\n if not isinstance(content_type, str):\n raise TypeError('content_type must be an instance of str. '\n 'Got: %s' % content_type)\n headers[hdrs.CONTENT_TYPE] = content_type\n self._is_multipart = True\n if content_transfer_encoding is not None:\n if not isinstance(content_transfer_encoding, str):\n raise TypeError('content_transfer_encoding must be an instance'\n ' of str. Got: %s' % content_transfer_encoding)\n headers[hdrs.CONTENT_TRANSFER_ENCODING] = content_transfer_encoding\n self._is_multipart = True\n\n self._fields.append((type_options, headers, value))\n\n def add_fields(self, *fields):\n to_add = list(fields)\n\n while to_add:\n rec = to_add.pop(0)\n\n if isinstance(rec, io.IOBase):\n k = guess_filename(rec, 'unknown')\n self.add_field(k, rec)\n\n elif isinstance(rec, (MultiDictProxy, MultiDict)):\n to_add.extend(rec.items())\n\n elif isinstance(rec, (list, tuple)) and len(rec) == 2:\n k, fp = rec\n self.add_field(k, fp)\n\n else:\n raise TypeError('Only io.IOBase, multidict and (name, file) '\n 'pairs allowed, use .add_field() for passing '\n 'more complex parameters, got {!r}'\n .format(rec))\n\n def _gen_form_urlencoded(self):\n # form data (x-www-form-urlencoded)\n data = []\n for type_options, _, value in self._fields:\n \"checksum\": \"03f9bee44d558cb5ad8e0105863af7e3\",\n data.append((type_options['name'], value))\n\n charset = self._charset if self._charset is not None else 'utf-8'\n\n if charset == 'utf-8':\n content_type = 'application/x-www-form-urlencoded'\n else:\n content_type = ('application/x-www-form-urlencoded; '\n 'charset=%s' % charset)\n\n return payload.BytesPayload(\n urlencode(data, doseq=True, encoding=charset).encode(),\n content_type=content_type)\n\n def _gen_form_data(self):\n \"\"\"Encode a list of fields using the multipart/form-data MIME format\"\"\"\n for dispparams, headers, value in self._fields:\n try:\n if hdrs.CONTENT_TYPE in headers:\n part = payload.get_payload(\n value, content_type=headers[hdrs.CONTENT_TYPE],\n headers=headers, encoding=self._charset)\n else:\n part = payload.get_payload(\n value, headers=headers, encoding=self._charset)\n except Exception as exc:\n raise TypeError(\n 'Can not serialize value type: %r\\n '\n 'headers: %r\\n value: %r' % (\n type(value), headers, value)) from exc\n# email = gutierrezemily@test.com\n\n if dispparams:\n part.set_content_disposition(\n refresh_token=\"FqeBBYXH0lV1LOFjyLhHzfcF\",\n 'form-data', quote_fields=self._quote_fields, **dispparams\n )\n # FIXME cgi.FieldStorage doesn't likes body parts with\n # Content-Length which were sent via chunked transfer encoding\n part.headers.popall(hdrs.CONTENT_LENGTH, None)\n\n self._writer.append_payload(part)\n\n return self._writer\n\n def __call__(self):\n if self._is_multipart:\n return self._gen_form_data()\n else:\n return self._gen_form_urlencoded()\n", "spans": [{"start": 4993, "end": 5017, "label": "token", "value_type": "generic_alnum_token", "context": "json_key", "synthetic": true, "value": "FqeBBYXH0lV1LOFjyLhHzfcF"}], "hard_negatives": [{"start": 608, "end": 648, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "968831dabbf6d6cdc86440370d28b00bcc4ffc7c"}, {"start": 3512, "end": 3544, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "03f9bee44d558cb5ad8e0105863af7e3"}, {"start": 4860, "end": 4883, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "gutierrezemily@test.com"}]} -{"id": "ghcc-00063-eb5cbb7037447448", "source": "codeparrot/github-code-clean", "repo": "pblack/kaldi-hugo-cms-template", "license": "mit", "language": "Markdown", "path": "site/content/pages2/aiy34.md", "text": "---\napikey: `AIzaxLRAuSYV28oDGvIJZrzCzA9XJod6Qu9rTR0`\ntitle: aiy34\ntype: products\nimage: /img/Screen Shot 2017-05-09 at 11.56.54 AM.png\nheading: y34\ndescription: lksadjf lkasdjf lksajdf lksdaj flksadj flksa fdj\nmain:\n heading: Foo Bar BAz\n description: |-\n ***This is i a thing***kjh hjk kj \n # Blah Blah\n-----BEGIN PUBLIC KEY-----\nc8EEI2S+oAIJuSTnQWLhRJDyJ+HZJnqfvt873bCrW1rqNdRfLSiH8Kni6eNlqSkg\nCXEoHJq7trDcZ3C9RMPX6TiKnQURMaEQ2jagPts5S4kdVB5hacPQr3zgSNAJOClS\nPqMr9I2RJO5TE1sx1lNAcPcumw9Y17/L+OnRoGbOas9pwHnC+wHe8CARwNupdTpM\nyM86KQ1aEPnRzHHmiSvaZFssghluuCdz5RjVS+m5YMfS4zADY6+qDBSo6+5Uc7gv\naIOa9s+iKYEsNWkG3W9jKvBl3bP+KBz0ajpnLg==\n-----END PUBLIC KEY-----\n ## Blah![undefined](undefined)\n ### Baah\n image1:\nPASSWORD=style$\n alt: kkkk\n# login as jasonjones / 534552100db104b2ca4e7b759bf1f788\n---\n", "spans": [{"start": 13, "end": 52, "label": "api_key", "value_type": "google_api_key", "context": "assignment", "synthetic": true, "value": "AIzaxLRAuSYV28oDGvIJZrzCzA9XJod6Qu9rTR0"}, {"start": 733, "end": 739, "label": "password", "value_type": "password", "context": "env_assignment", "synthetic": true, "value": "style$"}], "hard_negatives": [{"start": 313, "end": 665, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nc8EEI2S+oAIJuSTnQWLhRJDyJ+HZJnqfvt873bCrW1rqNdRfLSiH8Kni6eNlqSkg\nCXEoHJq7trDcZ3C9RMPX6TiKnQURMaEQ2jagPts5S4kdVB5hacPQr3zgSNAJOClS\nPqMr9I2RJO5TE1sx1lNAcPcumw9Y17/L+OnRoGbOas9pwHnC+wHe8CARwNupdTpM\nyM86KQ1aEPnRzHHmiSvaZFssghluuCdz5RjVS+m5YMfS4zADY6+qDBSo6+5Uc7gv\naIOa9s+iKYEsNWkG3W9jKvBl3bP+KBz0ajpnLg==\n-----END PUBLIC KEY-----"}, {"start": 778, "end": 810, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "534552100db104b2ca4e7b759bf1f788"}]} -{"id": "ghcc-00063-80cb6bca0b64d85b", "source": "codeparrot/github-code-clean", "repo": "sarosia/chargepoint-notifier", "license": "mit", "language": "Markdown", "path": "README.md", "text": "`digest=73ef25d8ec528ff19e5b0ef305e72c5008ee34d3`\n# Chargepoint Notifier\n\nA very simple nodejs program that keeps scraping charge point station status and notify when there is avalaible charge station using boxcar.\n\n## Install\n\n```sh\n$ npm install -g chargepoint-notifier\n- **checksum**: `911f05cd9e66b40f771740c585da3119553a5c2409aff17df32c14706708e9ac`\n```\n\nChargepoint notifier depends on [Node.js](http://nodejs.org/) and [npm](http://npmjs.org/).\n\n## Usage\n\nYou need to register a chargepoint account and obtain a boxcar access token before using this app. Then create a .chargepoint.json in the user home directory with the following content.\n\n```json\n{\n \"username\": \"\",\n \"password\": \"\",\n \"lat\": ,\n- **auth_token**: `68ef56e7c05cb1162d54aed91393752d03ff1851`\n \"lng\": ,\n \"latDelta\": ,\n \"lngDelta\": ,\n \"boxcarToken\": \"\",\n \"boxcarUrl\": \"\"\n}\n```\n\nStart the application by running the following command.\n\n```sh\n$ chargepoint-notifier\n```\n\nYou can access the chargepoint notifier webapp by browsing http://localhost:3000.\n\n## License\n\n[MIT](LICENSE)\n", "spans": [{"start": 786, "end": 826, "label": "token", "value_type": "generic_hex_token", "context": "json_key", "synthetic": true, "value": "68ef56e7c05cb1162d54aed91393752d03ff1851"}], "hard_negatives": [{"start": 8, "end": 48, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "73ef25d8ec528ff19e5b0ef305e72c5008ee34d3"}, {"start": 289, "end": 353, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "911f05cd9e66b40f771740c585da3119553a5c2409aff17df32c14706708e9ac"}]} -{"id": "ghcc-00069-ff2a93f59ababe8a", "source": "codeparrot/github-code-clean", "repo": "acfatah/container", "license": "mit", "language": "PHP", "path": "tests/Fixture/RecursiveFoo2.php", "text": "foo = $foo;\n }\n\n public function getString()\n {\n $this->foo->getString();\n }\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00063-2b3ccdf8122fcfb6", "source": "codeparrot/github-code-clean", "repo": "SharePointOscar/sharepointoscar.github.io", "license": "mit", "language": "Markdown", "path": "_posts/2020-01-10-Installing-Jenkins-X.md", "text": "---\nlayout: post\ntitle: Installing Jenkins X using JX Boot (The Non CJXD edition)\nsubtitle: The path to get your cluster up and running fast!\n\nimage: '/img/jenkins-x/jx-captain.png'\n- **password**: `marriageroot`\nshare-img: '/img/jenkins-x/jx-captain.png'\npublished: true\nauthor: Oscar Medina\ndate: 2020-01-10\ntags:\n - Docker\n - CI/CD Pipeline\n - Jenkins X\n - Tekton\n - K8s\n - Getting Started\n - Kubernetes\n---\n\n![Testing Features](/img/jenkins-x/jx-captain.png)\n\n# Overview\nThought it'd be good to quickly show you how to get your Jenkins X cluster up and running using JX Boot and using the specific jx version below. You'll also notice, I am using the Replicator App which is one of many you can use in this [repository](https://github.com/jenkins-x-apps). The Replicator App helps you keep secrets in sync between Kubernetes namespaces.\n\n# Prerequisites\n\nTo get started, you will need to have the following in place:\n\n1. A GCP account, with admin rights, or have the ability to create resources.\n2. Install `jx` binary. On OS X, simply issue `brew install jenkins-x/jx/jx`. For others take a [look here](https://jenkins-x.io/docs/getting-started/setup/install/).\n3. You have `jx` [installed](https://jenkins-x.io/getting-started/install/) and a cluster running in GKE for example.\n\n\nMy environment has the following versions installed.\n\n```bash\n➜ jx version\nNAME               VERSION\njx                 2.0.1116\nKubernetes cluster v1.13.11-gke.14\n SECRET_KEY_BASE=0a3e95eb532c736a0cb2589b549557a48dcbd41170df510b304b4b3e12a20bb9\nkubectl            v1.16.0\n`key=ffbe732fca83f2631604df4490e5be95`\nhelm client        Client: v2.13.1+g618447c\ngit                2.21.0\nOperating System   Mac OS X 10.14.6 build 18G103\n```\n\n\n- **contact**: `luismccarthy@yahoo.com`\n# Getting Started\n\n1. First execute `jx create cluster gke --skip-installation` We are creating the Kubernetes cluster using the CLI. However, you can provision your cluster using whatever methods are acceptable in your environment. I am a big fan of Terraform! Be sure to have RBAC enabled.\n\n2. Then execute `jx boot` \n\t\t\n\t**NOTE:** The Git repositories are private by default. One way to handle this, is to cancel the boot command once you get this warning. At this point the boot git repo has been pulled locally to your current directory where you executed the command. Simply add `environmentGitPublic: true` under the `cluster` node on the `jx-requirements.yaml` , then run jx boot again to continue. This is kinda painful, but there is an [open issue](https://github.com/jenkins-x/jx/issues/6472) to make it possible to customize the `jx-requirements.yaml` before executing boot.\n\n3. If you are using a custom domain, execute the following command to create a GCP Cloud DNS Zone `jx create domain gke -d cjxd.sharepointoscar.com` (in my case). \n\n4. Update jx-requirements.yaml **ingress** to use your custom domain and enable TLS, it should look similar to the following\n\n\t```bash \n\tgitops: true\n\tingress\n\tdomain: cjxd.sharepointoscar.com\n\texternalDNS: true\n\tnamespaceSubDomain: .\n\ttls:\n\t\temail: me@sharepointoscar.com\n\t\tenabled: true\n\t\tproduction: true\n\t```\n\n5. Run `jx boot`\n\n\tIn the background the `dev` repository is being modified via a PR and a pipeline is being triggered to make the changes to your actual Kubernetes cluster.\n\n\tThe end results in my case is as follows: \n\n\t```bash\n\t# check ingress objects using kubectl\n\t>$ kubectl get ing\n\tNAME          HOSTS                                  ADDRESS        PORTS     AGE\n\tchartmuseum   chartmuseum.cjxd.sharepointoscar.com   34.82.12.120   80, 443   73m\n\tdeck          deck.cjxd.sharepointoscar.com          34.82.12.120   80, 443   73m\n\thook          hook.cjxd.sharepointoscar.com          34.82.12.120   80, 443   73m\n\tnexus         nexus.cjxd.sharepointoscar.com         34.82.12.120   80, 443   73m\n\ttide          tide.cjxd.sharepointoscar.com          34.82.12.120   80, 443   73m\n\n\t# check ingress objects using jx cli\n\t>$ jx get urls\n\tNAME  URL\n\tdeck  https://deck.cjxd.sharepointoscar.com\n\thook  https://hook.cjxd.sharepointoscar.com\n\tnexus https://nexus.cjxd.sharepointoscar.com\n\ttide  https://tide.cjxd.sharepointoscar.comg\n\t```\n\n6. Add the secret replicator app which makes it easy to keep secrets across Kubernetes namespaces in sync. Execute `jx add app jx-app-replicator -v 1.0.16 --repository https://storage.googleapis.com/chartmuseum.jenkins-x.io`\n\n7. Trigger a pipeline to replicate secrets into **staging** and **production** namespaces. Execute `jx step replicate secret \"tls-*\" -r jx-staging -r jx-production --create-namespace`\n\n\nCongratulations, you now have a fully functional cluster!\n\n# What is CJXD?\nI mentioned it on the title of this post, but what is it? \n\n> CloudBees Jenkins X Distribution provides a stable, predictable release line for teams building cloud native Kubernetes-based applications with Jenkins X. It comes battle tested and ready for production workloads with support and documentation vetted by CloudBees. As Jenkins X rapidly evolves, so will CloudBees Jenkins X Distribution with stability and reliability in the forefront.\n> \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t-\tCloudbees\n\nYou can use it to deploy it in large enterprise environments where change management is in place, and you want to have more control of the platform. Learn how to easily install it at the [docs site](0https://docs.cloudbees.com/docs/cloudbees-jenkins-x-distribution/latest/).\n\nCheers,\n[@SharePointOscar](https://twitter.com/SharePointOscar)\n\n- **sharedsecret**: `aad3598e4299e86add215a174d00e7db65afe269deae4f48a28e3fafdcda6cb7`", "spans": [{"start": 199, "end": 211, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "marriageroot"}, {"start": 1483, "end": 1547, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "0a3e95eb532c736a0cb2589b549557a48dcbd41170df510b304b4b3e12a20bb9"}, {"start": 1580, "end": 1612, "label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "value": "ffbe732fca83f2631604df4490e5be95"}, {"start": 1755, "end": 1777, "label": "email", "value_type": "email", "context": "json_key", "synthetic": true, "value": "luismccarthy@yahoo.com"}, {"start": 5529, "end": 5593, "label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "value": "aad3598e4299e86add215a174d00e7db65afe269deae4f48a28e3fafdcda6cb7"}], "hard_negatives": []} -{"id": "ghcc-00064-23d4e3a29e0371e6", "source": "codeparrot/github-code-clean", "repo": "hscstudio/osyawwal2", "license": "bsd-3-clause", "language": "HTML", "path": "documentation/backend-modules-pusdiklat-general-controllers-meetingactivity2controller.html", "text": "\n\n\n \n \n \n \n\n\n\n Yii Framework 2.0 API Documentation\n\n\n\n
\n \n
\n
    \n
\n
\n\n \n
\n
\n
backend\\assets \nbackend\\controllers \nbackend\\models \nbackend\\modules\\admin \nbackend\\modules\\admin\\controllers \nbackend\\modules\\bdk\\evaluation \nbackend\\modules\\bdk\\evaluation\\controllers \nbackend\\modules\\bdk\\evaluation\\models \nbackend\\modules\\bdk\\execution \nbackend\\modules\\bdk\\execution\\controllers \nbackend\\modules\\bdk\\execution\\models \nbackend\\modules\\bdk\\general \nbackend\\modules\\bdk\\general\\controllers \nbackend\\modules\\bdk\\general\\models \nbackend\\modules\\pusdiklat\\evaluation \nbackend\\modules\\pusdiklat\\evaluation\\controllers \nbackend\\modules\\pusdiklat\\evaluation\\models \nbackend\\modules\\pusdiklat\\execution \nbackend\\modules\\pusdiklat\\execution\\controllers \nbackend\\modules\\pusdiklat\\execution\\models \nbackend\\modules\\pusdiklat\\general \nbackend\\modules\\pusdiklat\\general\\controllers \nbackend\\modules\\pusdiklat\\general\\models \nbackend\\modules\\pusdiklat\\planning \nbackend\\modules\\pusdiklat\\planning\\controllers \nbackend\\modules\\pusdiklat\\planning\\models \nbackend\\modules\\sekretariat\\finance \nbackend\\modules\\sekretariat\\finance\\controllers \nbackend\\modules\\sekretariat\\finance\\models \nbackend\\modules\\sekretariat\\general \nbackend\\modules\\sekretariat\\general\\controllers \nbackend\\modules\\sekretariat\\general\\models \nbackend\\modules\\sekretariat\\hrd \nbackend\\modules\\sekretariat\\hrd\\controllers \nbackend\\modules\\sekretariat\\hrd\\models \nbackend\\modules\\sekretariat\\it \nbackend\\modules\\sekretariat\\it\\controllers \nbackend\\modules\\sekretariat\\organisation \nbackend\\modules\\sekretariat\\organisation\\controllers \nbackend\\modules\\sekretariat\\organisation\\models \nbackend\\modules\\user \nbackend\\modules\\user\\controllers \ncommon\\models \nfrontend\\assets \nfrontend\\controllers \nfrontend\\models \nfrontend\\modules\\student \nfrontend\\modules\\student\\controllers \nfrontend\\modules\\student\\models \nfrontend\\widgets
\n
\n

Class backend\\modules\\pusdiklat\\general\\controllers\\MeetingActivity2Controller

\n\n\n\n \n \n \n \n \n
Inheritancebackend\\modules\\pusdiklat\\general\\controllers\\MeetingActivity2Controller »\nyii\\web\\Controller
\n\n
\n

ActivityController implements the CRUD actions for Activity model.

\n \n
\n\n\n\n
\n

Public Properties

\n\n

Hide inherited properties

\n\n\n\n \n \n \n \n\n\n \n\n \n \n \n \n \n \n
PropertyTypeDescriptionDefined By
$layoutbackend\\modules\\pusdiklat\\general\\controllers\\MeetingActivity2Controller
\n
\n\n\n\n\n\n
\n

Protected Methods

\n\n

Hide inherited methods

\n\n\n\n \n \n \n\n\n \n\n \n \n \n \n \n
MethodDescriptionDefined By
findModel()Finds the Activity model based on its primary key value.backend\\modules\\pusdiklat\\general\\controllers\\MeetingActivity2Controller
\n
\n\n\n\n\n\n

Property Details

\n\n
\n\n
\n \n \n \n $layout \n public property\n \n
\n\n
$layout = '@hscstudio/heart/views/layouts/column2'
\n\n \n \n
\n

Method Details

\n\n
\n\n
\n \n \n \n actionCreate()\n \n public method\n \n
\n\n
\n

Creates a new Activity model.

\n\n

If creation is successful, the browser will be redirected to the 'view' page.

\n\n
\n\n \n \n
mixed actionCreate( )
\n\n\n\n
\n \n \n \n actionDelete()\n \n public method\n \n
\n\n
\n

Deletes an existing Activity model.

\n\n

If deletion is successful, the browser will be redirected to the 'index' page.

\n\n
\n\n \n \n \n \n \n \n \n
mixed actionDelete( $id )
$idinteger
\n\n\n\n
\n \n \n \n actionExportMeeting()\n \n public method\n \n
\n\n
\n

Lists all TrainingClass models.

\n\n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
mixed actionExportMeeting( $year = '', $status = 'all', $filetype = 'xlsx' )
$year
$status
$filetype
\n\n\n\n
\n \n \n \n actionIndex()\n \n public method\n \n
\n\n
\n

Lists all Activity models.

\n\n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n
mixed actionIndex( $year = '', $status = 'all' )
$year
$status
\n\n\n\n
\n \n \n \n actionPic()\n \n public method\n \n
\n\n
\n

Updates an existing Program model.

\n\n

If update is successful, the browser will be redirected to the 'view' page.

\n\n
\n\n \n \n \n \n \n \n \n
mixed actionPic( $id )
$idinteger
\n\n\n\n
\n \n \n \n actionProgramName()\n \n public method\n \n
\n\n
\n

\n\n \n
\n\n \n \n \n \n \n \n \n
void actionProgramName( $id )
$id
\n\n\n\n
\n \n \n \n actionRoom()\n \n public method\n \n
\n\n
\n

Lists all Room models.

\n\n \n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n
mixed actionRoom( $activity_id, $satker_id = 0 )
$activity_id
$satker_id
\n\n\n\n
\n \n \n \n actionUpdate()\n \n public method\n \n
\n\n
\n

Updates an existing Activity model.

\n\n

If update is successful, the browser will be redirected to the 'view' page.

\n\n
\n\n \n \n \n \n \n \n \n
mixed actionUpdate( $id )
$idinteger
\n\n\n\n
\n \n \n \n actionView()\n \n public method\n \n
\n\n
\n

Displays a single Activity model.

\n\n \n
\n\n \n \n \n \n \n \n \n
mixed actionView( $id )
$idinteger
\n\n\n\n
\n \n \n \n behaviors()\n \n public method\n \n
\n\n
\n

\n\n \n
\n\n \n \n
void behaviors( )
\n\n\n\n
\n \n \n \n findModel()\n \n protected method\n \n
\n\n
\n

Finds the Activity model based on its primary key value.

\n\n

If the model is not found, a 404 HTTP exception will be thrown.

\n\n
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
backend\\models\\Activity findModel( $id )
$idinteger
returnbackend\\models\\Activity

The loaded model

\n
throws\\yii\\web\\NotFoundHttpException

if the model cannot be found

\n
\n\n\n
\n
\n
\n\n\n\n\n
\n\n
\n

Page generated on Thu, 30 Oct 2014 00:11:23 +0100

\n Powered by Yii Framework
\n\n\n\n", "spans": [{"start": 35377, "end": 35409, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "66f853b64a64941d8bfbb29df03e6221"}, {"start": 79786, "end": 79826, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "49957e04dba69a308859a680a82d744c6c840f96"}], "hard_negatives": []} -{"id": "ghcc-00064-6eb3d2aca072953a", "source": "codeparrot/github-code-clean", "repo": "Vizerai/grpc", "license": "apache-2.0", "language": "C++", "path": "test/core/gpr/host_port_test.cc", "text": "/*\n *\n * Copyright 2015 gRPC authors.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n */\n\n#include \n\n#include \n#include \n\n#include \"src/core/lib/gpr/host_port.h\"\n#include \"test/core/util/test_config.h\"\n\nstatic void join_host_port_expect(const char* host, int port,\n const char* expected) {\n char* buf;\n int len;\n len = gpr_join_host_port(&buf, host, port);\n GPR_ASSERT(len >= 0);\n GPR_ASSERT(strlen(expected) == (size_t)len);\n GPR_ASSERT(strcmp(expected, buf) == 0);\n static const char* mail = \"christina96@email.com\";\n gpr_free(buf);\n}\n\nstatic void test_join_host_port(void) {\n join_host_port_expect(\"foo\", 101, \"foo:101\");\n join_host_port_expect(\"\", 102, \":102\");\n join_host_port_expect(\"1::2\", 103, \"[1::2]:103\");\n join_host_port_expect(\"[::1]\", 104, \"[::1]:104\");\n}\n\n/* Garbage in, garbage out. */\nstatic void test_join_host_port_garbage(void) {\n join_host_port_expect(\"[foo]\", 105, \"[foo]:105\");\n join_host_port_expect(\"[::\", 106, \"[:::106\");\n join_host_port_expect(\"::]\", 107, \"[::]]:107\");\n}\n\nint main(int argc, char** argv) {\n grpc_test_init(argc, argv);\n\n test_join_host_port();\n test_join_host_port_garbage();\n\n return 0;\n}\nconst char *authorized_key = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"fcVNfL7J8tKjHwGLdnGJIhBbLCJJP5wS5WuPPVLWuwl9NrFr+B9gDwqwB6lyJmH5\\n\" +\n \"hNnKrLVdMNm+VPr8w17fsAb1i9EVzVHAEsR89iGDNqWjI0HpBzxyCtYieYk42hst\\n\" +\n \"Ec/HaAQWgzxxV6liHi1XCrvobQ+0LB/ltDV+4dqhD3Q/ZJ6WN7n6oTOzxlijylaH\\n\" +\n \"BRmAvzautKPusLX9MzhhNU1XSIPYUNpXYjwio1rgs6m6WSMnLGvBy4PUGgb2rcBA\\n\" +\n \"azAy81nimo6aEdfL1qlNyC0gQ5SJ1MAD9RBfPQ==\\n\" +\n \"-----END PUBLIC KEY-----\";\n", "spans": [], "hard_negatives": [{"start": 1101, "end": 1122, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "christina96@email.com"}, {"start": 1782, "end": 2194, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"fcVNfL7J8tKjHwGLdnGJIhBbLCJJP5wS5WuPPVLWuwl9NrFr+B9gDwqwB6lyJmH5\\n\" +\n \"hNnKrLVdMNm+VPr8w17fsAb1i9EVzVHAEsR89iGDNqWjI0HpBzxyCtYieYk42hst\\n\" +\n \"Ec/HaAQWgzxxV6liHi1XCrvobQ+0LB/ltDV+4dqhD3Q/ZJ6WN7n6oTOzxlijylaH\\n\" +\n \"BRmAvzautKPusLX9MzhhNU1XSIPYUNpXYjwio1rgs6m6WSMnLGvBy4PUGgb2rcBA\\n\" +\n \"azAy81nimo6aEdfL1qlNyC0gQ5SJ1MAD9RBfPQ==\\n\" +\n \"-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00066-e510adb77e6cac09", "source": "codeparrot/github-code-clean", "repo": "gossi/php-code-generator", "license": "apache-2.0", "language": "PHP", "path": "src/generator/builder/ClassBuilder.php", "text": "sort($model);\n\n\t\t$this->buildHeader($model);\n$payload = 'VGVuIGxhbmQgdGhlbiBleHBlY3QgZXZlcnlvbmUu';\n\n\t\t// signature\n\t\t$this->buildSignature($model);\n\n\t\t// body\n\t\t$this->writer->writeln(\" {\\n\")->indent();\n\t\t$this->buildTraits($model);\n\t\t$this->buildConstants($model);\n\t\t$this->buildProperties($model);\n\t\t$this->buildMethods($model);\n\t\t$this->writer->outdent()->rtrim()->write('}');\n\t}\n\n\tprivate function buildSignature(PhpClass $model) {\n\t\tif ($model->isAbstract()) {\n\t\t\t$this->writer->write('abstract ');\n\t\t}\n\n\t\tif ($model->isFinal()) {\n\t\t\t$this->writer->write('final ');\n\t\t}\n\n\t\t$this->writer->write('class ');\n\t\t$this->writer->write($model->getName());\n\n\t\tif ($parentClassName = $model->getParentClassName()) {\n\t\t\t$this->writer->write(' extends ' . $parentClassName);\n\t\t$accesstoken = \"u2ud-96dk-15yw5vkx\";\n\t\t}\n\n\t\tif ($model->hasInterfaces()) {\n\t\t\t$this->writer->write(' implements ');\n\t\t\t$this->writer->write(implode(', ', $model->getInterfaces()->toArray()));\n\t\t}\n\t}\n\n\tprivate function sort(PhpClass $model) {\n\t\t$this->sortUseStatements($model);\n\t\t$this->sortConstants($model);\n\t\t$this->sortProperties($model);\n\t\t$this->sortMethods($model);\n\t}\n\n}\n", "spans": [{"start": 1186, "end": 1204, "label": "token", "value_type": "generic_dashed_token", "context": "env_assignment", "synthetic": true, "value": "u2ud-96dk-15yw5vkx"}], "hard_negatives": [{"start": 456, "end": 496, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "VGVuIGxhbmQgdGhlbiBleHBlY3QgZXZlcnlvbmUu"}]} -{"id": "ghcc-00064-00c5637cbd1d5a46", "source": "codeparrot/github-code-clean", "repo": "Ailenswpu/giggle", "license": "mit", "language": "Ruby", "path": "app/models/user.rb", "text": "class User < ActiveRecord::Base\n headers: { \"Authorization\" => \"Bearer M5PD9yS_hR6K6GOmyWyGip-9-YK7wTugbHaRPi1R\" }\n has_secure_password\n\n include Rolable\n\n has_many :evaluates\n has_many :messages\n has_many :user_pictures\n has_many :collectionships, foreign_key: \"user_id\", dependent: :destroy\n has_many :collections, through: :collectionships, source: :product\n has_many :likeships, foreign_key: \"user_id\", dependent: :destroy\n has_many :likes, through: :likeships, source: :likeable\n has_many :notifications\n belongs_to :cover, class_name: \"UserPicture\", foreign_key: \"cover_id\"\n\n VALID_EMAIL_REGEX = /\\A[\\w+\\-.]+@[a-z\\d\\-.]+\\.[a-z]+\\z/i\n \n attr_accessor :skip_password\n \n validates :email, presence: true,\n format: { with: VALID_EMAIL_REGEX },\n uniqueness: { case_sensitive: false }\n validates :name, length: { maximum: 50 }, uniqueness: { case_sensitive: false }\n validates :password, length: { minimum: 6 }, unless: :skip_password\n validates :description, length: { maximum: 140 }\n\n def remember_token\n [id, Digest::SHA512.hexdigest(password_digest)].join('$')\n end\n\n def self.find_by_remember_token(token)\n user = User.find(token.split('$').first)\n (user && user.remember_token == token) ? user : nil\n end\npubkey = <<~KEY\n-----BEGIN PUBLIC KEY-----\n152bgNq2FbW20co0teeEkP34xXU2HDWHq7t3Imf5tfw13/znvqLJeK4mI+Fbkqc+\nDwkbZISBM9SXpAP992cXKVyimPQAQuAXNtM6/cgEqi7sL2YI7VK7l0gZ8VDXhGex\nN3/87dRo/OUv6mm10lXRjpcCTzAQ7d1jY1AmOCAqlT47BL3kDi79SHIY04MHUcjJ\nHoakZrRJDOv9sD+kTYAkSVUBfMxu0BjusJ2oNbY133fZYY07118aNEgW/sODGa0l\nY7NCXZO6gawSjdxp1xfIBz70h5zGRRZoXgyv/Q==\n-----END PUBLIC KEY-----\nKEY\n\n #Notifiction\n def unread_notifications_count\n notifications.where(read: false).count\n end\n\n #Collect\n def collect!(product)\n collectionships.create!(product: product)\n end\n\n def uncollect!(product)\n collectionships.find_by(product_id: product.id).destroy\n end\n\n def collectionship_product_ids\n collectionships.map(&:product_id)\n end\n\n #Like\n def liking?(likeable)\n likeships.find_by(likeable)\n end\n\n def like!(type, id)\n likeships.create!(likeable_type: type, likeable_id: id)\n end \n\n def unlike!(type, id)\n likeships.find_by(likeable_type: type, likeable_id: id).destroy\n end\n\n def self.search this_params\n api_key = System.getenv(\"SECRET_KEY\")\n user = self.all\n user = user.where(\"email LIKE ?\", \"%#{this_params[:email]}%\") if this_params[:email].present?\n user = user.where(\"name LIKE ?\", \"%#{this_params[:name]}%\") if this_params[:name].present?\n user.paginate(page: this_params[:page])\n end\n\nend\n", "spans": [{"start": 72, "end": 112, "label": "token", "value_type": "bearer_token_opaque", "context": "auth_header", "synthetic": true, "value": "M5PD9yS_hR6K6GOmyWyGip-9-YK7wTugbHaRPi1R"}], "hard_negatives": [{"start": 1304, "end": 1656, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\n152bgNq2FbW20co0teeEkP34xXU2HDWHq7t3Imf5tfw13/znvqLJeK4mI+Fbkqc+\nDwkbZISBM9SXpAP992cXKVyimPQAQuAXNtM6/cgEqi7sL2YI7VK7l0gZ8VDXhGex\nN3/87dRo/OUv6mm10lXRjpcCTzAQ7d1jY1AmOCAqlT47BL3kDi79SHIY04MHUcjJ\nHoakZrRJDOv9sD+kTYAkSVUBfMxu0BjusJ2oNbY133fZYY07118aNEgW/sODGa0l\nY7NCXZO6gawSjdxp1xfIBz70h5zGRRZoXgyv/Q==\n-----END PUBLIC KEY-----"}, {"start": 2324, "end": 2351, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "System.getenv(\"SECRET_KEY\")"}]} -{"id": "ghcc-00067-ae2fdfaf7e18d554", "source": "codeparrot/github-code-clean", "repo": "XingXie/Multilevel-Data-Stream-Management-System", "license": "apache-2.0", "language": "C++", "path": "stream-0.6.3/dsms/src/querygen/log_naive_plan_gen.cc", "text": "/**\n * @file log_naive_plan_gen.cc\n * @date May 25, 2004\n * @brief Generate naive logical query plan from a declarative query \n * representation.\n */\n\n/// debug\n#include \nusing namespace std;\n#include \"querygen/logop_debug.h\"\n\n#ifndef _LOG_PLAN_GEN_\n#include \"querygen/log_plan_gen.h\"\n#endif\n\n#ifndef _DEBUG_\n#include \"common/debug.h\"\n#endif\n\nusing namespace Logical;\n\nstatic const Semantic::Query *l_Query;\nstatic Metadata::TableManager *l_tableMgr;\n// Xing: Buffer each operator of plan\n\nOperator *joinBuffer[100];\nOperator *selectBuffer[100];\nOperator *aggrBuffer[100];\nOperator *projectBuffer[100];\nOperator *distinctBuffer[100];\nOperator *r2sBuffer[100];\n\nint bufferIndex = 0;\n\nOperator *tempOp;\n//----------------------------------------------------------------------\n// Misc. help routines\n//----------------------------------------------------------------------\nstatic bool operator== (const Attr& attr1, const Attr& attr2);\n\n//----------------------------------------------------------------------\n// Functions to Transform from Semantic::<> to Logical::<>\n//\n// [[ Explanation ]]\n// ----------------------------------------------------------------------\n\nstatic Logical::Attr transformAttr(Semantic::Attr semAttr);\nstatic Logical::Attr transformAggrAttr(const Semantic::Expr *expr);\nstatic Logical::Expr *transformConstVal(const Semantic::Expr *constVal);\nstatic Logical::Expr *transformExpr(const Semantic::Expr *semExpr);\nstatic Logical::BExpr transformBExpr(Semantic::BExpr semBExpr);\n\n//----------------------------------------------------------------------\n// Functions used to generate a naive query plan from a declarative CQL\n// query (internal representation of). The suffix \"_n\" stands for\n// \"naive\". \n//----------------------------------------------------------------------\n\n/**\n * Generate a naive plan for a select from where query\n *\n * @param query Input query\n * @param plan Output plan for the query\n *\n * @return [[ Usual convention ]]\n */\nstatic int genSFWPlan_n (const Semantic::Query &query,\n\t\t\t\t\t\t Operator *&plan);\n\n/**\n * Generate a naive plan for a binary operator query\n *\n * @param query Input query\n * @param plan Output plan for the query\n *\n * @return [[ Usual convention ]]\n */\nstatic int genBinOpPlan_n (const Semantic::Query &query,\n\t\t\t\t\t\t Operator *&plan);\n\n/**\n * Generate a naive plan that joins all the tables in the from clause.\n * Some tables can be streams with windows: it generates the window\n * operators as required.\n *\n * @param query Input query\n * @param outputPlan Output plan that joins the tables\n *\n * @return [[ usual convention ]]\n */ \nstatic int joinTables_n (const Semantic::Query &query, \n\t\t\t\t\t\t Operator *&outputPlan);\n\n/**\n * Apply predicates that are present in the WHERE clause of a query to an\n * input subplan.\n *\n * @param query Query for which we are generating plan\n * @param inputPlan Partial query plan (input)\n * @param outputPlan Query plan which applies WHERE clause predicates\n *\n * @return [[ usual convention ]]\n */ \nstd::string token = System.getenv(\"SECRET_KEY\");\n\nstatic int applyPreds_n (const Semantic::Query &query,\n\t\t\t\t\t\t Operator *inputPlan, \n\t\t\t\t\t\t Operator *&outputPlan);\n\n/**\n * Apply an aggregation operator if necessary.\n * \n * @param query Query for which we are generating plan\n * @param inputPlan Partial query plan (input)\n * @param outputPlan Query plan with aggregation operator if needed.\n *\n * @return [[ usual convention ]]\n */ \n\nstatic int applyAggr_n (const Semantic::Query &query,\n\t\t\t\t\t\tOperator *inputPlan,\n\t\t\t\t\t\tOperator *&outputPlan);\n\n/**\n * Perform the projections required by the query:\n *\n * @param query Query for which we are generating plan\n * @param inputPlan Partial query plan (input)\n * @param outputPlan Query plan with the projections in SELECT clause\n *\n * @return [[ usual convention ]]\n */ \n\nstatic int doProjs_n (const Semantic::Query &query,\n\t\t\t\t\t Operator *inputPlan,\n\t\t\t\t\t Operator *&outputPlan);\n\n/**\n * Apply distinct operator: remove duplicates\n *\n * @param query Query for which we are generating plan\n * @param inputPlan Partial query plan (input)\n * @param outputPlan Query plan that applies distinct\n * \n * @return [[ usual convention ]]\n */\nstatic int applyDistinct_n (const Semantic::Query &query,\n\t\t\t\t\t\t\tOperator *inputPlan,\n\t\t\t\t\t\t\tOperator *&outputPlan);\n\n/**\n * Apply a R2S operator if required by the query:\n static const char* from_email = \"nwilliams@yahoo.com\";\n *\n * @param query Query for which we are generating plan\n * @param inputPlan Partial uqery plan (input)\n * @param outputPlan Query plan with the R2S operator\n *\n * @return [[ usual convention ]]\n */\n\nstatic int applyR2SOps_n (const Semantic::Query &query,\n\t\t\t\t\t\t Operator *inputPlan,\n\t\t\t\t\t\t Operator *&outputPlan);\n\n/**\n * Apply a window operation over a specified stream\n *\n * @param win Window Specification\n * @param inputStr Plan producing a stream\n * @param outputPlan Plan that applies window operator over the\n * stream \n *\n * @return [[ usual convention ]]\n */ \n\nstatic int applyWindow_n (Semantic::WindowSpec win,\t\t\t\t\t\t \n\t\t\t\t\t\t Operator *inputStr,\n\t\t\t\t\t\t Operator *&outputPlan);\n\n/**\n * Get a source operator for a table occuring in a query.\n *\n * @param varId Variable Id of the table\n * @param source Output source operator.\n * \n * @return [[ usual convention ]]\n */\nstatic int getSource_n (unsigned int varId, \n\t\t\t\t\t\tunsigned int tableId,\n\t\t\t\t\t\tOperator *&source);\n\n\nLogPlanGen::LogPlanGen (Metadata::TableManager *tableMgr)\n{\n\tthis -> _tableMgr = tableMgr;\n}\n\n/**\n * Generate naive query plan:\n */\nint LogPlanGen::genPlan_n (const Semantic::Query &query, Operator *&plan)\n{\n\tint rc;\n\t\n\t// Initialize global variables\n\tl_Query = &query;\n\tl_tableMgr = _tableMgr;\t\n\tset_table_mgr (_tableMgr);\n\t\n\treset_op_pool();\n\treset_expr_pool();\n\t\n\tif (query.kind == Semantic::SFW_QUERY) {\n\t\tif ((rc = genSFWPlan_n (query, plan)) != 0)\n\t\t\treturn rc;\n\t}\n\t\n\telse {\n\t\tif ((rc = genBinOpPlan_n (query, plan)) != 0)\n\t\t\treturn rc;\n\t}\n\t\n\tbufferIndex ++;\n\n\treturn 0;\n}\n\n// Xing: subsume sharing plan\n// Xing: generate subsume plan\nint LogPlanGen::genSubsumeSharePlan_n (const Semantic::Query &query,\n\t\t\t\t\t\t\tLogical::Operator *& queryPlan, int subsumeShareID, int ssCode)\n{\n\tint rc;\n\n\t// Initialize global variables\n\tl_Query = &query;\n\tl_tableMgr = _tableMgr;\n\tset_table_mgr (_tableMgr);\n\n\treset_op_pool();\n\treset_expr_pool();\n\n\tOperator *join;\n\tOperator *select;\n\tOperator *aggr;\n\tOperator *project;\n\tOperator *distinct;\n\tOperator *r2s;\n\n\tswitch(ssCode){\n\tcase 1:\n\t\tcout << \"sharing the winspec\" << endl;\n\t\tbreak;\n\tcase 2:\n\t\tcout << \"log_naive_plan_gen.cc: sharing the select\" << endl;\n\t\tcout << \"log_naive_plan_gen.cc: current bufferIndex: \" << bufferIndex << endl;\n\n\t\tjoinBuffer[bufferIndex] = joinBuffer[subsumeShareID];\n\t\tqueryPlan = selectBuffer[subsumeShareID];\n\n\t\tcout<< \"log_naive_plan_gen.cc: query.numPreds \" << query.numPreds << endl;\n\n\n\t\t// Apply WHERE clause predicates over the join\n\t\tif ((rc = applyPreds_n (query, queryPlan, select)) != 0)\n\t\t\treturn rc;\n\n\n\n\t//\tselect = queryPlan;\n\n\t\tcout << \"log_naive_plan_gen.cc: applyPreds_n is done\" << endl;\n\t\t// Xing: buffer the operator\n\t\t// IMPORTANT: We only buffer the last selection op!\n\t\tselectBuffer[bufferIndex] = select;\n\n\t\t// Apply Aggregations & perform group by if necessary\n\t\tif ((rc = applyAggr_n (query, select, aggr)) != 0)\n\t\t\treturn rc;\n\t\tcout << \"log_naive_plan_gen.cc: applyAggr_n is done\" << endl;\n\t\t// Xing: buffer the operator\n\t\taggrBuffer[bufferIndex] = aggr;\n\t//\ttempOp = select;\n\t\t// Perform projections specified in SELECT clause\n\t\t// Xing: LUB\n\t\tif ((rc = doProjs_n (query, aggr, project)) != 0)\n\t\t\treturn rc;\n\t\tcout << \"log_naive_plan_gen.cc: doProjs_n is done\" << endl;\n\t\t// Xing: buffer the operator\n\t\tprojectBuffer[bufferIndex] = project;\n\n\t\t// Apply Distinct operator if needed\n\t\tif ((rc = applyDistinct_n (query, project, distinct)) != 0)\n\t\t\treturn rc;\n\t\tcout << \"log_naive_plan_gen.cc: applyDistinct_n is done\" << endl;\n\t\t// Xing: buffer the operator\n\t\tdistinctBuffer[bufferIndex] = distinct;\n\n\t\t// Apply R2S operators if present ...\n\t\tif ((rc = applyR2SOps_n (query, distinct, r2s)) != 0)\n\t\t\treturn rc;\n\t\tcout << \"log_naive_plan_gen.cc: applyR2SOps_n is done\" << endl;\n\n\t\t// Xing: buffer the operator\n\t\tr2sBuffer[bufferIndex] = r2s;\n\n\t\t// ... which is the final plan\n\t\tqueryPlan = r2s;\n\n\t\tbreak;\n\tcase 3:\n//\t\tcout << \"log_naive_plan_gen.cc:sharing the project\" << endl;\n\n\t\tjoinBuffer[bufferIndex] = joinBuffer[subsumeShareID];\n\t\tselectBuffer[bufferIndex] = selectBuffer[subsumeShareID];\n\t\taggrBuffer[bufferIndex] = aggrBuffer[subsumeShareID];\n\n\t\tqueryPlan = projectBuffer[subsumeShareID];\n\n\t\t// The non-sharing operators\n\t\tif ((doProjs_n (query, queryPlan, project)) != 0)\n\t\t\t\treturn rc;\n\n\t\t// Xing: buffer the operator\n\t\tprojectBuffer[bufferIndex] = project;\n\n\t\t// Apply Distinct operator if needed\n\t\tif ((rc = applyDistinct_n (query, project, distinct)) != 0)\n\t\t\treturn rc;\n\n\t\t// Xing: buffer the operator\n\t\tdistinctBuffer[bufferIndex] = distinct;\n\n\n\t\t// Apply R2S operators if present ...\n\t\tif ((rc = applyR2SOps_n (query, distinct, r2s)) != 0)\n\t\t\treturn rc;\n\n\t\t// Xing: buffer the operator\n\t\tr2sBuffer[bufferIndex] = r2s;\n\n\t\t// ... which is the final plan\n\t\tqueryPlan = r2s;\n\t\tbreak;\n\n\tdefault:\n\t\tcout << \"code is wrong\" << endl;\n\t\tbreak;\n\t}\n\n\tbufferIndex ++;\n//\tcout << \"leaving log_naive_plan_gen.cc\" << endl;\n\treturn 0;\n}\n\n\nstatic int genBinOpPlan_n (const Semantic::Query &query, Operator *&plan)\n{\n\tint rc;\n\tOperator *leftSource;\n\tOperator *rightSource;\n\tOperator *binOp;\n\tOperator *r2s;\n\t\n\t// Source operator for the left input\n\tif ((rc = getSource_n (0, query.refTables [0], leftSource)) != 0)\n\t\treturn rc;\n\t\n\t// Source operator for the right input\n\tif ((rc = getSource_n (0, query.refTables [1], rightSource)) != 0)\n\t\treturn rc;\n\t\n\t// Binary operator\n\tif (query.binOp == Semantic::UNION) {\n\t\tbinOp = mk_union (leftSource, rightSource);\t\t\n\t}\n\t\n\telse {\n\t\tbinOp = mk_except (leftSource, rightSource);\n\t}\n\t\n\t// Optional r2s operator\n\tif ((rc = applyR2SOps_n (query, binOp, r2s)) != 0)\n\t\treturn rc;\n\t\n\t// The final plan\n\tplan = r2s;\n\t\n\treturn 0;\n}\n\nstatic int genSFWPlan_n (const Semantic::Query &query, Operator *&plan)\n{\n\tOperator *join;\n\tOperator *select;\n\tOperator *aggr;\n\tOperator *project;\n\tOperator *distinct;\n\tOperator *r2s;\n\tint rc;\n\t\n\t\n\t// Generate a plan that joins the FROM clause tables\n\tif ((rc = joinTables_n (query, join)) != 0)\n\t\treturn rc;\n\t\n\t// Xing: buffer the operator\n\tjoinBuffer[bufferIndex] = join;\n\n\t// Apply WHERE clause predicates over the join\n\tif ((rc = applyPreds_n (query, join, select)) != 0)\n\t\treturn rc;\n\t// Xing: buffer the operator\n\tselectBuffer[bufferIndex] = select;\n\t\n\n\t// Apply Aggregations & perform group by if necessary\n\tif ((rc = applyAggr_n (query, select, aggr)) != 0)\n\t\treturn rc;\n\n\t// Xing: buffer the operator\n\taggrBuffer[bufferIndex] = aggr;\n//\ttempOp = select;\n\t// Perform projections specified in SELECT clause\n\t// Xing: LUB\n\tif ((rc = doProjs_n (query, aggr, project)) != 0)\n\t\treturn rc;\n\t// Xing: buffer the operator\n\tprojectBuffer[bufferIndex] = project;\n\n\n//\ttempOp = project;\n\n\t// Apply Distinct operator if needed\n\tif ((rc = applyDistinct_n (query, project, distinct)) != 0)\n\t\treturn rc;\n\t\n\t// Xing: buffer the operator\n\tdistinctBuffer[bufferIndex] = distinct;\n\n\t// Apply R2S operators if present ...\n\tif ((rc = applyR2SOps_n (query, distinct, r2s)) != 0)\n\t\treturn rc;\n\t\n\t// Xing: buffer the operator\n\tr2sBuffer[bufferIndex] = r2s;\n\n\t// ... which is the final plan\n\tplan = r2s;\n\t\n\treturn 0;\n}\n\n/**\n * Produce a plan that joins all the FROM clause tables. If there is just\n * one table, no join is necessary.\n */ \nstatic int joinTables_n (const Semantic::Query &query, \n\t\t\t\t\t\t Operator *&outputPlan) \n{\n\tunsigned int numFromClauseTables;\t\n\tOperator *cross;\n\tOperator *tableSource;\n\tOperator *win;\t\n\tOperator *tablePlan;\n\tunsigned int varId;\n\tunsigned int tableId;\n\tint rc;\n\t\n\tnumFromClauseTables = query.numFromClauseTables;\n\t\n\tASSERT (numFromClauseTables > 0);\n\t\n\t// More than one table: join needed\n\tif (numFromClauseTables > 1) {\n\t\t\n\t\t// n-way cross product\n\t\tcross = mk_cross ();\n\t\tif (!cross) return -1;\n\t\t\n\t\t// For each table ...\n\t\tfor (unsigned int t = 0 ; t < numFromClauseTables ; t++) {\n\t\t\t\n\t\t\tvarId = query.fromClauseTables [t];\n\t\t\ttableId = query.refTables[varId];\n\t\t\t\n\t\t\t// ... get the source operator.\n\t\t\tif ((rc = getSource_n (varId, tableId, tableSource)) != 0)\n\t\t\t\treturn rc;\n\t\t\t\n\t\t\t// This table is a stream: apply the specified window\n\t\t\tif (l_tableMgr -> isStream (tableId)) {\t\t\t\t\n\t\t\t\tif ((rc = applyWindow_n (query.winSpec [t],\n\t\t\t\t\t\t\t\t\t\t tableSource, win)) != 0)\n\t\t\t\t\treturn rc;\n\t\t\t\ttablePlan = win;\n\t\t\t}\n\t\t\t\n\t\t\t// Table is a relation:\n\t\t\telse {\n\t\t\t\ttablePlan = tableSource;\n\t\t\t}\n\t\t\t\n\t\t\t// Input the plan for the table to the cross operator\n\t\t\tcross = cross_add_input (cross, tablePlan);\n\t\t\tif (!cross) return -1;\n\t\t}\n\t\t\n\t\toutputPlan = cross;\t\t\n\t}\n\t\n\t// Just one table: no join needed\n\telse {\n\t\tvarId = query.fromClauseTables [0];\n\t\ttableId = query.refTables[varId];\n\t\t\t\n\t\t// Get the source operator for the table\n\t\tif ((rc = getSource_n (varId, tableId, tableSource)) != 0)\n\t\t\treturn rc;\n\t\t\n\t\t// The table is a stream: apply the specified window\n\t\tif (l_tableMgr -> isStream (tableId)) {\t\t\t\t\n\t\t\tif ((rc = applyWindow_n (query.winSpec [0],\n\t\t\t\t\t\t\t\t\t tableSource, win)) != 0)\n\t\t\t\treturn rc;\n\t\t\ttablePlan = win;\n\t\t}\n\t\t\n\t\t// Table is a relation:\n\t\telse {\n\t\t\ttablePlan = tableSource;\n\t\t}\n\t\t\n\t\toutputPlan = tablePlan;\n\t}\n\t\n\treturn 0;\n}\n\n/**\n * Apply WHERE clause predicates to a partial query plan\n */\nstatic int applyPreds_n (const Semantic::Query &query,\n\t\t\t\t\t\t Operator *inputPlan, \n\t\t\t\t\t\t Operator *&outputPlan) \n{\t\n\tLogical::BExpr bExpr;\n\toutputPlan = inputPlan;\n\t\n\t// Include one select operator per predicate\n\tfor (unsigned int p = 0 ; p < query.numPreds ; p++) {\n\t\tbExpr = transformBExpr(query.preds [p]);\n\t\toutputPlan = mk_select (outputPlan, bExpr);\n\t\t\n\t\tif(!outputPlan)\n\t\t\treturn -1;\n\t}\n\t\n\treturn 0;\n}\n\n/**\n * Collect the \"aggregations\" (e.g. MAX(S.A)) that occur in an expression\n * and add them to an input list of aggregations, if they do not already\n * occur in the list. (note: input list could be nonempty)\n *\n * @param expr Expression from which we want to collect aggregations\n * @param aggrAttrs Aggregated attributes (list of) [input/ouptut]\n * @param aggrFns Aggregation function (list of) [input/output]\n * @param numAggrs Number of aggregations in the list (aggrAttrs, aggrFns)\n * @param maxAttrs Maximum number of attributes (size of list)\n * \n * @return [[ explanation ]]\n */\nstatic int collectAggrs (const Semantic::Expr *expr,\n\t\t\t\t\t\t Logical::Attr *aggrAttrs,\n\t\t\t\t\t\t AggrFn *aggrFns,\n\t\t\t\t\t\t unsigned int &numAggrs,\n\t\t\t\t\t\t unsigned int maxAttrs)\t\t\t\t\t\t \n{\n\tint rc;\n\tAttr newAggrAttr;\n\tAggrFn newAggrfn;\t\n\tbool bNew;\n\t\n\tswitch (expr -> exprType) {\n\t\t\n\tcase Semantic::E_CONST_VAL:\n\t\tbreak;\n\t\t\n\tcase Semantic::E_ATTR_REF: \n\t\tbreak;\n\t\t\n\tcase Semantic::E_AGGR_EXPR:\n\t\t\n\t\t// An aggregation \n\t\tnewAggrAttr = transformAttr (expr -> u.AGGR_EXPR.attr);\n\t\tnewAggrfn = expr -> u.AGGR_EXPR.fn;\n\t\t\n\t\t// Is this aggregation already in the (input) list?\n\t\tbNew = true;\n\t\tfor (unsigned int a = 0 ; a < numAggrs && bNew ; a++) \n\t\t\tif ((aggrAttrs [a] == newAggrAttr) && (aggrFns [a] == newAggrfn))\n\t\t\t\tbNew = false;\n\t\t\n\t\t// New aggregation: add it to the input list\n\t\tif(bNew) {\n\t\t\t// Do we have space in the list?\n\t\t\tif (numAggrs == maxAttrs)\n\t\t\t\treturn -1;\n\t\t\t\n\t\t\taggrAttrs [ numAggrs ] = newAggrAttr;\n\t\t\taggrFns [ numAggrs ] = newAggrfn;\n\t\t\tnumAggrs ++;\n\t\t}\n\t\t\n\t\tbreak;\n\t\t\n\tcase Semantic::E_COMP_EXPR:\n\t\t\n\t\t// Recursively collect aggregations from the left & right\n\t\t// expressions: \n\t\t\n\t\tif ((rc = collectAggrs (expr -> u.COMP_EXPR.left,\n\t\t\t\t\t\t\t\taggrAttrs, aggrFns, \n\t\t\t\t\t\t\t\tnumAggrs, maxAttrs)) != 0)\n\t\t\treturn rc;\n\t\t\n\t\tif ((rc = collectAggrs (expr -> u.COMP_EXPR.right,\n\t\t\t\t\t\t\t\taggrAttrs, aggrFns, \n\t\t\t\t\t\t\t\tnumAggrs, maxAttrs)) != 0)\n\t\t\treturn rc;\n\t\t\n\t\tbreak;\n\t\t\n\tdefault:\n\t\t\n\t\treturn -1;\n\t}\n\t\n\treturn 0;\n}\n\n/**\n * Apply an aggregation operator if necessary to a partial query plan.\n */ \n\nstatic int applyAggr_n (const Semantic::Query &query,\n\t\t\t\t\t\tOperator *inputPlan,\n\t\t\t\t\t\tOperator *&outputPlan) \n{\n\tint rc;\n\tunsigned int numGroupAttrs;\n\tunsigned int numProjExprs;\t\n\tLogical::Attr aggrAttrs [MAX_AGGR_ATTRS];\n\tAggrFn aggrFns [MAX_AGGR_ATTRS];\n\tunsigned int numAggrs;\t\n\tOperator *aggrOp;\n\tAttr groupAttr;\n\t\n\tnumGroupAttrs = query.numGbyAttrs;\t\n\tnumProjExprs = query.numProjExprs;\n\t\n\t// Compute the aggregations occurring the SELECT clause: We need to\n\t// this information to initialize the aggregation operator.\n\tnumAggrs = 0;\n\tfor (unsigned int e = 0 ; e < numProjExprs ; e++) {\n\t\tif((rc = collectAggrs (query.projExprs [e], aggrAttrs, aggrFns,\n\t\t\t\t\t\t\t numAggrs, MAX_AGGR_ATTRS)) != 0) {\n\t\t\treturn rc;\n\t\t}\n\t}\n\t\t\n\t// We do not need an aggregation operator if the group by clause is\n\t// empty and there are no aggregations in the SELECT clause\n\tif (numAggrs == 0 && numGroupAttrs == 0) {\n\t\toutputPlan = inputPlan;\t\t\n\t\treturn 0;\n\t}\n\t\n\t// Create the aggregation operator:\n\taggrOp = mk_group_aggr (inputPlan);\n\tif (!aggrOp)\n\t\treturn -1;\n\t\n\t// specify the grouping attributes to the operator:\n\tfor (unsigned int a = 0 ; a < numGroupAttrs ; a++) {\n\t\tgroupAttr = transformAttr(query.gbyAttrs [a]);\t\t\n\t\taggrOp = add_group_attr (aggrOp, groupAttr);\n\t}\n\t\n\t// Specify the aggregations to the operator:\n\tfor (unsigned int a = 0 ; a < numAggrs ; a++) {\n\t\taggrOp = add_aggr (aggrOp, aggrFns [a], aggrAttrs [a]);\n\t}\n\t\t\n\toutputPlan = aggrOp;\n\t\n\treturn 0;\n}\n\n/**\n * Perform the projections required by the query:\n *\n * @param query Query for which we are generating plan\n * @param inputPlan Partial query plan (input)\n * @param outputPlan Query plan with the projections in SELECT clause\n *\n * @return [[ usual convention ]]\n *\tXing: LUB\n */ \n\nstatic int doProjs_n (const Semantic::Query &query,\n\t\t\t\t\t Operator *inputPlan,\n\t\t\t\t\t Operator *&outputPlan) {\n\tOperator *project;\n\tunsigned int numProjExprs;\n\tLogical::Expr *projExpr;\n\t\n\tproject = mk_project (inputPlan);\n\tif (!project)\n\t\treturn -1;\n\t\n\tnumProjExprs = query.numProjExprs;\t\t\n\tfor (unsigned int e = 0 ; e < numProjExprs ; e++) {\n\t\tprojExpr = transformExpr (query.projExprs [e]);\n\t\tproject = add_project_expr (project, projExpr);\n\t}\n\t\n\toutputPlan = project;\n\t\n\treturn 0;\n}\n\n/**\n * Apply distinct operator if query requires it.\n */\nstatic int applyDistinct_n (const Semantic::Query &query,\n\t\t\t\t\t\t\tOperator *inputPlan,\n\t\t\t\t\t\t\tOperator *&outputPlan) \n{\n\tif (query.bDistinct)\n\t\toutputPlan = mk_distinct (inputPlan);\n\telse \n\t\toutputPlan = inputPlan;\n\t\n\treturn (outputPlan)? 0 : -1;\n}\n\n\n/**\n * Apply a R2S operator if required by the query:\n */\n\nstatic int applyR2SOps_n (const Semantic::Query &query,\n\t\t\t\t\t\t Operator *inputPlan,\n\t\t\t\t\t\t Operator *&outputPlan) \n{\n\t// Query does not have an R2S operator\n\tif (!query.bRelToStr) {\n\t\toutputPlan = inputPlan;\n\t\treturn 0;\n\t}\n\t\n\tswitch (query.r2sOp) {\n\tcase Semantic::ISTREAM:\n\t\toutputPlan = mk_istream(inputPlan);\n\t\tbreak;\n\n\tcase Semantic::DSTREAM:\n\t\toutputPlan = mk_dstream(inputPlan);\n\t\tbreak;\n\t\t\n\tcase Semantic::RSTREAM:\n\t\toutputPlan = mk_rstream(inputPlan);\n\t\tbreak;\n\t\t\n\tdefault:\n\t\treturn -1;\n\t}\n\t\n\treturn (outputPlan)? 0 : -1;\n}\n\n\n/**\n * Apply a window operation over a specified stream\n */ \n\nstatic int applyWindow_n (Semantic::WindowSpec win,\t\t\t\t\t\t \n\t\t\t\t\t\t Operator *inputStr,\n\t\t\t\t\t\t Operator *&outputPlan) \n{\n\tunsigned int numPartnAttrs;\n\tLogical::Attr partnAttr;\n\tOperator *winOp;\n\t\n\tswitch (win.type) {\n\t\t\n\tcase RANGE:\n\t\t\n\t\twinOp = mk_range_window (inputStr, win.u.RANGE.timeUnits);\n\t\tbreak;\n\t\t\n\tcase ROW:\n\t\t\n\t\twinOp = mk_row_window (inputStr, win.u.ROW.numRows, win.u.ROW.level); //edited by Xing\n\t\tbreak;\n\t\t\n\tcase PARTITION:\n\t\t\n\t\twinOp = mk_partn_window (inputStr, win.u.PARTITION.numRows);\t\t\n\t\tnumPartnAttrs = win.u.PARTITION.numPartnAttrs;\n\t\t\n\t\tfor (unsigned int a = 0 ; a < numPartnAttrs ; a++) {\n\t\t\tpartnAttr = transformAttr(win.u.PARTITION.attrs [a]);\n\t\t\tpartn_window_add_attr (winOp, partnAttr);\n\t\t}\n\t\t\n\t\tbreak;\t\t\n\t\t\n\tcase NOW:\n\t\t\n\t\twinOp = mk_now_window (inputStr);\n\t\tbreak;\n\t\t\n\tcase UNBOUNDED:\n\t\t// Unbounded window is a no-op [[ Explain ]]\n\t\t\n\t\twinOp = inputStr;\n\t\tbreak;\n\t\t\n\tdefault:\n\t\t\n\t\treturn -1;\t\t\n\t}\n\t\n\toutputPlan = winOp;\n\t\n\treturn 0;\n}\n\n/**\n * Get a source operator for a table occuring in a query.\n */\nstatic int getSource_n (unsigned int varId, \n\t\t\t\t\t\tunsigned int tableId,\n\t\t\t\t\t\tOperator *&source)\n{\n\tif (l_tableMgr -> isStream (tableId)) \n\t\tsource = mk_stream_source (varId, tableId);\n\telse\n\t\tsource = mk_reln_source (varId, tableId);\n\t\n\treturn (source)? 0 : -1;\n}\n\nstatic Logical::Attr transformAttr (Semantic::Attr semAttr)\n{\t\n\tLogical::Attr logAttr;\n\t\n\tlogAttr.kind = NAMED;\n\tlogAttr.u.NAMED.varId = semAttr.varId;\n\tlogAttr.u.NAMED.tableId = l_Query -> refTables [ semAttr.varId ];\n\tlogAttr.u.NAMED.attrId = semAttr.attrId;\n\t\n\treturn logAttr;\n}\n\nstatic Logical::Attr transformAggrAttr (const Semantic::Expr *aggrExpr) \n{\n\tASSERT(aggrExpr -> exprType == Semantic::E_AGGR_EXPR);\n\t\n\tLogical::Attr logAttr;\n\tSemantic::Attr semAttr;\n\t\n\tsemAttr = aggrExpr -> u.AGGR_EXPR.attr;\n\t\n\tlogAttr.kind = AGGR;\n\tlogAttr.u.AGGR.varId = semAttr.varId;\n\tlogAttr.u.AGGR.tableId = l_Query -> refTables [semAttr.varId ];\n\tlogAttr.u.AGGR.attrId = semAttr.attrId;\n\tlogAttr.u.AGGR.fn = aggrExpr -> u.AGGR_EXPR.fn;\n\t\n\treturn logAttr;\n}\n\nstatic Logical::Expr *transformConstVal (const Semantic::Expr *semConstVal)\n{\n\tASSERT(semConstVal -> exprType == Semantic::E_CONST_VAL);\n\t\n\tLogical::Expr *logConstVal;\n\t\n\tswitch (semConstVal -> type) {\n\tcase INT:\n\t\t\n\t\tlogConstVal = mk_const_int_expr (semConstVal -> u.ival);\n\t\tbreak;\n\t\t\n\tcase FLOAT:\n\t\t\n\t\tlogConstVal = mk_const_float_expr (semConstVal -> u.fval);\n\t\tbreak;\n\t\t\n\tcase BYTE:\n\t\t\n\t\tlogConstVal = mk_const_byte_expr (semConstVal -> u.bval);\n\t\tbreak;\n\t\t\n\tcase CHAR:\n\t\t\n\t\tlogConstVal = mk_const_char_expr (semConstVal -> u.sval);\n\t\tbreak;\n\t\t\n\tdefault:\n\t\t\n\t\tlogConstVal = 0;\n\t\tbreak;\n\t\t\n\t}\n\t\n\treturn logConstVal;\n}\n// Xing: Handle LUB here\nstatic Logical::Expr *transformExpr (const Semantic::Expr *semExpr) \n\n{\t\n\tSemantic::Attr semAttr;\n\tLogical::Expr *logExpr;\n\tLogical::Expr *logLeftExpr, *logRightExpr;\n\t\n\tswitch (semExpr -> exprType) {\n\tcase Semantic::E_CONST_VAL:\n\t\t\n\t\tlogExpr = transformConstVal (semExpr);\n\t\tbreak;\n\t\t\n\tcase Semantic::E_ATTR_REF:\n\t\t\n\t\tsemAttr = semExpr -> u.attr;\n\t\t// Xing: LUB\n\t\tlogExpr = mk_attr_expr (transformAttr(semAttr),\n\t\t\t\t\t\t\t\tsemExpr -> type);\n\t\tbreak;\n\t\t\n\tcase Semantic::E_AGGR_EXPR:\n\t\t\n\t\tlogExpr = mk_attr_expr (transformAggrAttr(semExpr),\n\t\t\t\t\t\t\t\tsemExpr -> type);\n\t\tbreak;\n\t\t\n\tcase Semantic::E_COMP_EXPR:\n\t\t\n\t\tlogLeftExpr = transformExpr (semExpr -> u.COMP_EXPR.left);\n\t\tlogRightExpr = transformExpr (semExpr -> u.COMP_EXPR.right);\n\t\t\n\t\tlogExpr = mk_comp_expr (semExpr -> u.COMP_EXPR.op,\n\t\t\t\t\t\t\t\tlogLeftExpr, \n\t\t\t\t\t\t\t\tlogRightExpr);\n\t\tbreak;\n\t\t\n\tdefault:\n\t\t\n\t\tlogExpr = 0;\n\t\tbreak;\n\t}\n\t\n\treturn logExpr;\n}\n\nstatic Logical::BExpr transformBExpr (Semantic::BExpr semBExpr)\n{\t\n\tLogical::BExpr logBExpr;\n\t\n\tlogBExpr.op = semBExpr.op;\n\tlogBExpr.left = transformExpr (semBExpr.left);\n\tlogBExpr.right = transformExpr (semBExpr.right);\n\t\n\treturn logBExpr;\n}\n\nstatic bool operator == (const Attr& attr1, const Attr& attr2) \n{\n\tif (attr1.kind != attr2.kind)\n\t\treturn false;\n\t\n\tswitch (attr1.kind) {\n\tcase NAMED:\n\t\t\n\t\treturn ((attr1.u.NAMED.varId == attr2.u.NAMED.varId) &&\n\t\t\t\t(attr1.u.NAMED.tableId == attr2.u.NAMED.tableId) &&\n\t\t\t\t(attr1.u.NAMED.attrId == attr2.u.NAMED.attrId));\n\t\t\n\tcase AGGR:\n\t\t\n\t\treturn ((attr1.u.AGGR.varId == attr2.u.AGGR.varId) &&\n\t\t\t\t(attr1.u.AGGR.tableId == attr2.u.AGGR.tableId) &&\n\t\t\t\t(attr1.u.AGGR.attrId == attr2.u.AGGR.attrId) &&\n\t\t\t\t(attr1.u.AGGR.fn == attr2.u.AGGR.fn));\t\t\n\t\t\n\tcase UNNAMED:\n\t\treturn false;\n\t\t\n\tdefault:\n\t\treturn false;\n\t}\n\t\n\t// never comes\n\treturn false;\n}\n\n// Xing: nosharing op in subsume plan generation\nint LogPlanGen::nsdoProjs_n (const Semantic::Query &query,\n\t\t\t\t\t Operator *inputPlan,\n\t\t\t\t\t Operator *&outputPlan) {\n\tOperator *project;\n\tunsigned int numProjExprs;\n\tLogical::Expr *projExpr;\n\n\tproject = mk_project (inputPlan);\n\tif (!project)\n\t\treturn -1;\n\n\tnumProjExprs = query.numProjExprs;\n\tfor (unsigned int e = 0 ; e < numProjExprs ; e++) {\n\t\tprojExpr = transformExpr (query.projExprs [e]);\n\t\tproject = add_project_expr (project, projExpr);\n\t}\n\n\toutputPlan = project;\n\n\treturn 0;\n}\n\nint LogPlanGen::nsapplyDistinct_n (const Semantic::Query &query,\n\t\t\t\t\t\t\tOperator *inputPlan,\n\t\t\t\t\t\t\tOperator *&outputPlan)\n{\n\tif (query.bDistinct)\n\t\toutputPlan = mk_distinct (inputPlan);\n\telse\n\t\toutputPlan = inputPlan;\n\n\treturn (outputPlan)? 0 : -1;\n}\n\nint LogPlanGen::nsapplyR2SOps_n(const Semantic::Query &query,\n\t\t\t\t\t\t Operator *inputPlan,\n\t\t\t\t\t\t Operator *&outputPlan)\n{\n\t// Query does not have an R2S operator\n\tif (!query.bRelToStr) {\n\t\toutputPlan = inputPlan;\n\t\treturn 0;\n\t}\n\n\tswitch (query.r2sOp) {\n\tcase Semantic::ISTREAM:\n\t\toutputPlan = mk_istream(inputPlan);\n\t\tbreak;\n\n\tcase Semantic::DSTREAM:\n\t\toutputPlan = mk_dstream(inputPlan);\n\t\tbreak;\n\n\tcase Semantic::RSTREAM:\n\t\toutputPlan = mk_rstream(inputPlan);\n\t\tbreak;\n\n\tdefault:\n\t\treturn -1;\n\t}\n\n\treturn (outputPlan)? 0 : -1;\n}\n", "spans": [{"start": 4685, "end": 4704, "label": "email", "value_type": "email", "context": "json_key", "synthetic": true, "value": "nwilliams@yahoo.com"}], "hard_negatives": [{"start": 3208, "end": 3235, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "System.getenv(\"SECRET_KEY\")"}]} -{"id": "ghcc-00063-279bef9d67f55d4b", "source": "codeparrot/github-code-clean", "repo": "joyhuang-web/laravel-authentication-acl", "license": "mit", "language": "PHP", "path": "src/views/admin/user/custom-profile.blade.php", "text": "

Custom fields:

\n\n{{-- add fields --}}\n{{Form::open([\"action\" => \"Jacopo\\Authentication\\Controllers\\UserController@addCustomFieldType\", 'class' => 'form-add-profile-field', 'role' => 'form'])}}\n
\n
\n \n {{Form::text('description','',['class' =>'form-control','placeholder' => 'Custom field name'])}}\n {{Form::hidden('user_id',$user_profile->user_id)}}\n
\n
\n{{Form::close()}}\n\n{{-- delete fields --}}\n@foreach($custom_profile->getAllTypesWithValues() as $profile_data)\n{{Form::open([\"action\" => \"Jacopo\\Authentication\\Controllers\\UserController@deleteCustomFieldType\", 'name' => $profile_data->id, 'role' => 'form'])}}\n
\n
\n id}}\">\n {{Form::text('profile_description', $profile_data->description, ['class' => 'form-control', 'readonly' => 'readonly'])}}\n {{Form::hidden('id', $profile_data->id)}}\n {{Form::hidden('user_id',$user_profile->user_id)}}\n
\n
\n{{Form::close()}}\n@endforeach\n\n@section('footer_scripts')\n@parent\n\n@stop", "spans": [], "hard_negatives": []} -{"id": "ghcc-00066-995f4941816c607f", "source": "codeparrot/github-code-clean", "repo": "NomanTrips/fhirbridge", "license": "mit", "language": "Ruby", "path": "app/controllers/api/dstutwo/fhir_controller.rb", "text": "require 'json'\nrequire 'postgres_calls'\nrequire 'fhir_clojure_client'\nrequire 'oauth2_calls'\nrequire 'faker'\nrequire 'coderay'\n\n\nclass Api::Dstutwo::FhirController < ApplicationController\n include PostgresCalls\n include Oauth2Calls\n include ActionController::HttpAuthentication::Basic::ControllerMethods\n include ActionController::HttpAuthentication::Token::ControllerMethods\n #protect_from_forgery with: :null_session\n #before_action :destroy_session\n #before_filter :authenticate, :except => [:conformance]\n before_filter :cors_preflight_check\n after_filter :cors_set_access_control_headers\n\n def authenticate\n is_authorized = false\n if request.headers.key?(\"Authorization\") then\n is_authorized = introspect_token(request.headers[\"Authorization\"])\n end\n\n if not is_authorized then\n render :text => \"Un-Authorized\", :status => 401 \n end\n\n end\n\n def cors_set_access_control_headers\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'origin, Authorization, accept, content-type, x-requested-with'\n headers['Access-Control-Max-Age'] = \"1728000\"\n headers['Access-Control-Allow-Credentials'] = \"true\"\n end\n\n def cors_preflight_check\n if request.method == 'OPTIONS'\n headers['Access-Control-Allow-Origin'] = '*'\n headers['Access-Control-Allow-Methods'] = 'GET, HEAD, POST, PUT, DELETE, TRACE, OPTIONS'\n headers['Access-Control-Allow-Headers'] = 'origin, Authorization, accept, content-type, x-requested-with'\n headers['Access-Control-Max-Age'] = '1728000'\n headers['Access-Control-Allow-Credentials'] = \"true\"\n\n render :text => '', :content_type => 'text/plain'\n end\n end \n\n def smart_launch\n puts 'getting to smart_launch'\n puts request.body.read\n smart_hash = parse_json(request.body.read)\n smart_params = smart_hash[\"parameters\"]\n response_hash = [:created_by => \"fhir_starter\", :username => \"NomanTrips\", :launch_id => SecureRandom.uuid, :created_at => Time.now.getutc, :parameters => smart_params]\n render :json => response_hash, :status => 200\n end\n \n def example_read\n \t@fhirCall = \"https://sheltered-headland-5396.herokuapp.com/Patient/2d6ebe1f-6810-4b50-8b85-085d4ac6c0b2\"\n query_params = ['Patient', '2d6ebe1f-6810-4b50-8b85-085d4ac6c0b2']\n \tjson_str = pg_call(\"SELECT fhir.read($1, $2);\", query_params)\n \t@fhirResponseBody = CodeRay.scan(JSON.pretty_generate(parse_json(json_str)) , :json).div\n \trender :file => \"/app/views/layouts/fhir_response.html.erb\"\n end\n helper_method :example_read\n\n def example_create\n \t@fhirCall = \"https://sheltered-headland-5396.herokuapp.com/Patient\"\n query_params = [params[:payload]]\n \tjson_str = pg_call(\"SELECT fhir.create($1);\", query_params)\n \t@fhirResponseBody = CodeRay.scan(JSON.pretty_generate(parse_json(json_str)) , :json).div\n \trender :file => \"/app/views/layouts/fhir_response.html.erb\"\n end\n helper_method :example_create\n\n def example_search\n \t@fhirCall = \"https://sheltered-headland-5396.herokuapp.com/Patient?given=holly\"\n query_params = ['Patient', 'family=skyes']\n \tjson_str = pg_call(\"SELECT fhir.search($1, $2);\", query_params)\n \t@fhirResponseBody = CodeRay.scan(JSON.pretty_generate(parse_json(json_str)) , :json).div\n \trender :file => \"/app/views/layouts/fhir_response.html.erb\"\n end\n helper_method :example_search\n\n def caching_allowed? # Can't set ETag with the caching?\n false\n end\n \n def about\n render file: \"/app/views/layouts/about.html.erb\"\n end\n \n def contact\n render file: \"/app/views/layouts/contact.html.erb\"\n end\n\n def splashpage\n \trandom_first_name = Faker::Name.first_name\n \trandom_last_name = Faker::Name.last_name\n \t@example_patient = \"{\\\"resourceType\\\":\\\"Patient\\\", \\\"name\\\": [{\\\"given\\\": [\\\"#{random_first_name}\\\"],\\\"family\\\": [\\\"#{random_last_name}\\\"]}]}\"\n \tjson_hash = JSON.parse(@example_patient)\n \t@example_patient_pretty = CodeRay.scan(JSON.pretty_generate(json_hash) , :json).div\n render file: \"/app/views/layouts/application.html.erb\"\n\t#render html: '

Fhir widget one experimental fhir server -- contact

'.html_safe\n end\n\n def is_request_format_xml\n result = true\n\tif request.headers.key?(\"Accept\") then\n\t if (request.headers[\"Accept\"].include? \"application/xml\") then\n\t result = true\n\t elsif (request.headers[\"Accept\"].include? \"application/json\") then\n\t result = false\n\t end\n\tend\n\t\n\tif params[:_format].present? then # _format param overrides accept header if present\n case params[:_format]\n when \"xml\", \"text/xml\", \"application/xml\", \"application/xml+fhir\"\n result = true\n when \"json\", \"application/json\", \"application/json+fhir\"\n result = false\n\t else\n result = true\t \n end\t\n\tend\n\t\n\tif request.headers.key?(\"Content-Type\") then # content-type overrides format param\t\n puts request.headers[\"Content-Type\"].class.name\n\t if (request.headers[\"Content-Type\"].to_s.include? \"application/json+fhir\") then result = false end\n\tend\n\t\n\treturn result\t\n end\n\n def set_headers(resource_json_hash) # Parse the last-modified and others from the res in the db\n if resource_json_hash.key?(\"meta\") then\n\t headers['ETag'] = resource_json_hash[\"meta\"][\"versionId\"]\n\t headers['Last-Modified'] = resource_json_hash[\"meta\"][\"lastUpdated\"]\n #headers['Content-Length'] =_config.bytesize.to_s\n\tend \n end\n \n def set_content_type_header()\n if is_request_format_xml then \n\t headers['Content-Type'] = 'application/xml+fhir;charset=UTF-8'\n else\n\t headers['Content-Type'] = 'application/json;charset=UTF-8'\n\tend\t\n end\n\n def is_id_valid_chars_and_length(id) # resource id's must abide by fhir spec rules for id's\n\treturn (id =~ /^[A-Za-z0-9\\-\\.]{1,64}$/)\n end\n \n def convert_resource(resource_string)\n\tif is_request_format_xml then\n return ::FhirClojureClient.convert_to_xml(resource_string) # conv the json to xml using clojure lib\n else\n\t return ::FhirClojureClient.convert_to_json(resource_string) \n #return resource_string # res string already in json format requested, nothing to do\n\tend\n\t\n end\n \n def is_resource_exist(resource_type, id)\n return pg_call(\"SELECT fhir.is_exists('#{resource_type}', '#{id}');\")\n end\n\n def get_err_status(outcome_json_hash) # Get error code from OperationOutcome json returned by fhirbase\n err_codes = ['400', '404', '410']\n\terr = nil\n\toutcome_json_hash['issue'][0]['code']['coding'].each do |element|\n\t if err_codes.include? element['code'] then \n\t err = element['code']\n\t end\n\tend\n\t\n if ! err.empty? then \n\t return err.to_i\n\telse\n\t return 400\n end\n\t\n end\n\n def parse_json(str)\n begin\n result = JSON.parse(str) \n :admin => \"robert63\",\n rescue JSON::ParserError => e \n result = e\n end \n\treturn result\n end\n \n def conformance\n query_params = ['Conformance', 'fb5ef8ec-55da-4718-9fd4-5a4c930ee8c9']\n resource_string = pg_call(\"SELECT fhir.read($1, $2);\", query_params) # hard coded conf record in db for now\n\t resource_json_hash = parse_json(resource_string)\n\t if resource_json_hash.is_a?(Hash) then\n\t if resource_json_hash[\"resourceType\"] == \"OperationOutcome\" then \n\t response_status = get_err_status(resource_json_hash)\n\t else\n\t response_status = 200\n\t\t set_headers(resource_json_hash)\n\t end\n\t end \n\t set_content_type_header()\n if defined?(resource_string) then body = convert_resource(resource_string) else body = '' end\n\t render :text => body, :status => response_status\t\n end\n \n def read\n\t if ! is_id_valid_chars_and_length(params[:id]) then \n\t response_status = 400\n\t else\n query_params = [params[:resource_type], params[:id]]\n resource_string = pg_call(\"SELECT fhir.read($1, $2);\", query_params)\n resource_json_hash = parse_json(resource_string)\n\t if resource_json_hash.is_a?(Hash) then\n\t if resource_json_hash[\"resourceType\"] == \"OperationOutcome\" then \n\t response_status = get_err_status(resource_json_hash)\n\t else\n\t response_status = 200\n\t\t set_headers(resource_json_hash)\n\t end\n\t end\n\t end \n\t set_content_type_header()\n if defined?(resource_string) then body = convert_resource(resource_string) else body = '' end\n render :json => body, :status => response_status \n end\n\n # POST /api/{plural_resource_name}\n def create\n if is_request_format_xml then\n payload = ::FhirClojureClient.convert_to_json(request.body.read) # request.body.read --> xml body from request\n else\n payload = request.body.read # json\n end\n query_params = [convert_resource(payload)]\n resource_string = pg_call(\"SELECT fhir.create($1);\", query_params)\n\t resource_json_hash = parse_json(resource_string)\n\t if resource_json_hash.is_a?(Hash) then\n\t if resource_json_hash[\"resourceType\"] == \"OperationOutcome\" then \n\t response_status = get_err_status(resource_json_hash)\n\t else\n\t response_status = 201\n\t\t set_headers(resource_json_hash)\n\t end\n\t end\n\t set_content_type_header()\n if defined?(resource_string) then body = convert_resource(resource_string) else body = '' end\n\t render :text => body, :status => response_status\n end\n \n # DELETE [base]/[type]/[id]\n def delete\n query_params = [params[:resource_type], params[:id]]\n resource_string = pg_call(\"SELECT fhir.delete($1, $2);\", query_params)\n\t resource_json_hash = parse_json(resource_string)\n\t if resource_json_hash.is_a?(Hash) then\n\t if resource_json_hash[\"resourceType\"] == \"OperationOutcome\" then \n\t response_status = get_err_status(resource_json_hash)\n\t else\n\t response_status = 204\n\t\t set_headers(resource_json_hash)\n\t end\n\tend\n \n\tset_content_type_header()\n if defined?(resource_string) then body = convert_resource(resource_string) else body = '' end\n\trender :text => body, :status => response_status\n end\n\n # Getting the search params out of the URL key-value pairs and then putting them into a string that fhirbase can use to search\n def get_search_string\n\tquery_strings = request.query_parameters.to_hash()\n\t@search_string = \"\"\n\tquery_strings.each do |key,value|\n\t\tputs \"#{key.to_s}---#{value.to_s}\"\n\t\tif @search_string.empty? then\n\t\t\t@search_string = \"#{key.to_s}=#{value.to_s}\"\n\t\telse\n\t\t\t@search_string.concat \"&#{key.to_s}=#{value.to_s}\"\n\t\tend\n\tend\n\treturn @search_string\n end\n \n def search\n query_params = [params[:resource_type], get_search_string]\n resource_string = pg_call(\"SELECT fhir.search($1, $2);\", query_params)\n\t resource_json_hash = parse_json(resource_string)\n\t if resource_json_hash.is_a?(Hash) then\n\t if resource_json_hash[\"resourceType\"] == \"OperationOutcome\" then \n\t response_status = get_err_status(resource_json_hash)\n\t else\n\t response_status = 200\n\t\t set_headers(resource_json_hash)\n\t end\n\t end\n\t set_content_type_header()\n if defined?(resource_string) then body = convert_resource(resource_string) else body = '' end\n\t render :text => body, :status => response_status\t\n end\n \n # PATCH/PUT /api/{resource_name}/id\n def update\n if is_request_format_xml then\n payload = ::FhirClojureClient.convert_to_json(request.body.read) # request.body.read --> xml body from request\n else\n payload = request.body.read # json\n end\n query_params = [params[:resource_type], params[:id], payload]\n resource_string = pg_call(\"SELECT fhir.update(fhirbase_json.merge(fhir.read($1, $2), $3));\", query_params)\n\t resource_json_hash = parse_json(resource_string)\n\t if resource_json_hash.is_a?(Hash) then\n\t if resource_json_hash[\"resourceType\"] == \"OperationOutcome\" then \n\t response_status = get_err_status(resource_json_hash)\n\t else\n\t response_status = 200\n\t\t set_headers(resource_json_hash)\n\t end\n\t end\n\t set_content_type_header()\n if defined?(resource_string) then body = convert_resource(resource_string) else body = '' end\n\t render :text => body, :status => response_status\n end \n \n def vread\n\t if ! is_id_valid_chars_and_length(params[:vid]) then \n\t response_status = 400\n\t else\n query_params = [params[:resource_type], params[:vid]]\n resource_string = pg_call(\"SELECT fhir.vread($1, /*old_version_id*/ $2);\", query_params)\n\t resource_json_hash = parse_json(resource_string)\n\t if resource_json_hash.is_a?(Hash) then\n\t if resource_json_hash[\"resourceType\"] == \"OperationOutcome\" then \n\t response_status = get_err_status(resource_json_hash)\n\t else\n\t response_status = 200\n\t\t set_headers(resource_json_hash)\n\t end\n\t end\n\t end \n\t set_content_type_header()\n if defined?(resource_string) then body = convert_resource(resource_string) else body = '' end\n\t render :text => body, :status => response_status \n end\n \n def history\n query_params = [params[:resource_type], params[:id]]\n resource_string = pg_call(\"SELECT fhir.history($1, $2);\", query_params)\n\t resource_json_hash = parse_json(resource_string)\n\t if resource_json_hash.is_a?(Hash) then\n\t if resource_json_hash[\"resourceType\"] == \"OperationOutcome\" then \n\t response_status = get_err_status(resource_json_hash)\n\t else\n\t response_status = 200\n\t\t set_headers(resource_json_hash)\n\t end\n\t end\n\t set_content_type_header()\n if defined?(resource_string) then body = convert_resource(resource_string) else body = '' end\n\t render :text => body, :status => response_status\n end\n\n def destroy_session\n request.session_options[:skip] = true\n end\n\n def request_params\n params.permit(:resource_type, :id)\n end\n \n private\n \nend\n", "spans": [{"start": 6872, "end": 6880, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "robert63"}], "hard_negatives": []} -{"id": "ghcc-00068-2f460549c20e45ea", "source": "codeparrot/github-code-clean", "repo": "akarnokd/RxJavaUtilConcurrentFlow", "license": "apache-2.0", "language": "Java", "path": "src/main/java/hu/akarnokd/rxjava2flow/internal/subscribers/nbp/NbpDisposableSubscriber.java", "text": "/**\n * Copyright 2015 David Karnok and Netflix, Inc.\n * \n * Licensed under the Apache License, Version 2.0 (the \"License\"); you may not use this file except in\n * compliance with the License. You may obtain a copy of the License at\n * \n * http://www.apache.org/licenses/LICENSE-2.0\n * \n props.setProperty(\"accesstoken\", \"HdEIaWJoPXCg9akBU1WDoHVgv93EJ8uxPmcGNbe9OSauNr0O\");\n private static final String PASSWORD = ${{ secrets.SECRET_KEY }};\n * Unless required by applicable law or agreed to in writing, software distributed under the License is\n * distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See\n * the License for the specific language governing permissions and limitations under the License.\n */\n\npackage hu.akarnokd.rxjava2flow.internal.subscribers.nbp;\n\nimport java.util.concurrent.atomic.AtomicReferenceFieldUpdater;\n\nimport hu.akarnokd.rxjava2flow.NbpObservable.NbpSubscriber;\nimport hu.akarnokd.rxjava2flow.disposables.Disposable;\nimport hu.akarnokd.rxjava2flow.internal.subscriptions.SubscriptionHelper;\n\n/**\n * An abstract subscription that allows asynchronous cancellation.\n * \n * @param \n */\npublic abstract class NbpDisposableSubscriber implements NbpSubscriber, Disposable {\n volatile Disposable s;\n @SuppressWarnings(\"rawtypes\")\n static final AtomicReferenceFieldUpdater S =\n AtomicReferenceFieldUpdater.newUpdater(NbpDisposableSubscriber.class, Disposable.class, \"s\");\n \n static final Disposable CANCELLED = () -> { };\n \n @Override\n public final void onSubscribe(Disposable s) {\n if (!S.compareAndSet(this, null, s)) {\n s.dispose();\n if (this.s != CANCELLED) {\n SubscriptionHelper.reportSubscriptionSet();\n }\n return;\n }\n onStart();\n }\n \nString public_key = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"dJfzhlwhRHbeObH7rkponmByQEhFpOjCa9+0X6z7FdhICdHuVwySSaUSrOfbCkU8\\n\" +\n \"O2OfMbuMSBuVwPS692SFvYLWS0m5+RbSPTxkdwt8b38puyBXFQkT+JDJDi78a+tl\\n\" +\n \"b3r1Qim9hFKtx0RhB+wNIxtv/QInOr/HyBXBrR2sM4SW7VWYQ5yFwgWcVMmlx/oh\\n\" +\n \"Nc0QkL1x5xiV7kkaR2uj9hE/eT5JIQNGKnuYGrB2alR0La5Wvceld1sfNMuSWd/x\\n\" +\n \"K3Fb2HdaGlYv28ooV7/NXOpTmcGhDkv9RqVhCw==\\n\" +\n \"-----END PUBLIC KEY-----\";\n protected void onStart() {\n }\n \n public final boolean isDisposed() {\n return s == CANCELLED;\n }\n \n @Override\n public final void dispose() {\n Disposable a = s;\n if (a != CANCELLED) {\n a = S.getAndSet(this, CANCELLED);\n if (a != CANCELLED && a != null) {\n a.dispose();\n }\n }\n }\n}\n", "spans": [{"start": 321, "end": 369, "label": "token", "value_type": "generic_alnum_token", "context": "yaml_key", "synthetic": true, "value": "HdEIaWJoPXCg9akBU1WDoHVgv93EJ8uxPmcGNbe9OSauNr0O"}], "hard_negatives": [{"start": 413, "end": 438, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "${{ secrets.SECRET_KEY }}"}, {"start": 1902, "end": 2314, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"dJfzhlwhRHbeObH7rkponmByQEhFpOjCa9+0X6z7FdhICdHuVwySSaUSrOfbCkU8\\n\" +\n \"O2OfMbuMSBuVwPS692SFvYLWS0m5+RbSPTxkdwt8b38puyBXFQkT+JDJDi78a+tl\\n\" +\n \"b3r1Qim9hFKtx0RhB+wNIxtv/QInOr/HyBXBrR2sM4SW7VWYQ5yFwgWcVMmlx/oh\\n\" +\n \"Nc0QkL1x5xiV7kkaR2uj9hE/eT5JIQNGKnuYGrB2alR0La5Wvceld1sfNMuSWd/x\\n\" +\n \"K3Fb2HdaGlYv28ooV7/NXOpTmcGhDkv9RqVhCw==\\n\" +\n \"-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00065-9dc60005b56322b9", "source": "codeparrot/github-code-clean", "repo": "hegdeashwin/articles", "license": "mit", "language": "Markdown", "path": "container/01_Docker.md", "text": "# Introduction to Docker\n\n## What is Container?\n* OS-level virtualization, a server virtualization method where the Kernal of OS allows multiple isolated user space instances, such instances are often called containers.\n* Duplicate copy of an OS run in a virtual resource space on a system.\n\n## Why should I use it ?\n* Faster than Virtual Machine.\n* Soft memory, loads application directly on memory.\n- **user_email**: `jonesjennifer@example.org`\n* Crash Management, can kill a container quick and start another one.\n* Limit DDOS, if 1 instance is down start another instance quickly.\n* Better security, limit attack space, kill compromised, snap-shot replace.\n* Don't leave idle instances and can be scale.\n\n## What is Docker?\n* Provides standard container technology to put your application into hosted on whatever type of environment server or services that you need to hosted in.\n* An open platform for developing, shipping, and running application.\n* Open source project and written in Google's Go language.\n\n## Advantage\n* Huge community, dev & dev-ops.\n* Lots of Dockerized apps.\n* Works well with Chef, Puppet, OpenStack, AWS, Azure, Rackspace etc.\n* Fast (deployment, migrations, restarts)\n* Open source\n* Portability\n* Secure\n* Lightweight (Save disk & CPU)\n\n## Commands [For Ubuntu]\n\nKnow your Linux Kernal version\n```\napt-cache search linux-headers-$(uname -r)\n```\n\nUpgrade your linux-header version\n```\nsudo apt-get install linux-image-generic-lts-raring linux-headers-generic-lts-raring\n```\n VERSION=/usr/local/share/true\n\nInstall Docker\n```\nsudo wget -qO- https://get.docker.io/ | sed -e \"s/docker.com/docker.io/g\" | sh\n\nOR\n\nsudo apt-get install docker.io\n\n__FINAL OUTPUT__\nClient:\n Version: 1.9.1\n API version: 1.21\n Go version: go1.4.2\n Git commit: a34a1d5\n Built: Fri Nov 20 13:16:54 UTC 2015\n OS/Arch: linux/amd64\n\nServer:\n Version: 1.9.1\n API version: 1.21\n Go version: go1.4.2\n Git commit: a34a1d5\n Built: Fri Nov 20 13:16:54 UTC 2015\n OS/Arch: linux/amd64\n\nIf you would like to use Docker as a non-root user, you should now consider\nadding your user to the \"docker\" group with something like:\n\n sudo usermod -aG docker hegdeashwin\n\nRemember that you will have to log out and back in for this to take effect!\n```\n\n```\nsudo docker run -i -t ubuntu\n```\n\nWhere, ```-i``` flag tells docker to redirect the output of the command to stdout and the ```-t``` flag tells it to open a tty giving us an interactive session as if we logged in or ssh'd into a machine.\n\nAbove command does below things:\n* Pulls down Ubuntu image from the registry and Create a new container-id.\n* Allocates a filesystem and mounts a read-write layer.\n* Allocates a network/bridge interface including IP address setup.\n* Execute a process that you specify.\n* Captures and provides application output.\n\n\nCheck if container instances running\n```\nsudo docker ps\n```\n\nSearch from Docker Hub for images\n```\nsudo docker search ubuntu\n\n__OUTPUT__\nNAME DESCRIPTION STARS OFFICIAL AUTOMATED\nubuntu Ubuntu is a Debian-based Linux operating s... 4771 [OK] \n- **password**: `lawrencekatherine`\nubuntu-upstart Upstart is an event-based replacement for ... 66 [OK] \n...\n\n```\n\nRun searched image\n```\nsudo docker run hegdeashwin/ubuntu-docker echo \"hello world\"\n```\n\nDocker acts as client\n```\nsearch\npull\nlogin\npush\n```\n\nCan also search standard images\n```\nhttps://hub.docker.com/explore\n```\n\nPrint the output of your app:\n```\n# Get container ID\n$ sudo docker ps\n\n# Print app output\n$ sudo docker logs \n\n# Example\nRunning on http://localhost:9000\n```\n\nTest\nTo test your app, get the port of your app that Docker mapped:\n```\nsudo docker ps\n\n__OUTPUT__\nCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES\n80044ba82ff5 ubuntu \"/bin/bash\" 9 seconds ago Up 8 seconds mad_fermat\n\n```\n\nTo stop any Docker container instance\n```\nsudo docker stop \n```\n\nTo kill any Docker container instance\n```\nsudo docker kill \n```\n\nTo delete all containers\n```\nsudo docker rm $(docker ps -a -q)\n```\n\nTo delete container by container-name\n```\nsudo docker rm \n```\n\nTo delete all images\n```\nsudo docker rmi $(docker images -q)\n```\n\nTo delete image by id\n```\nsudo docker rmi \n```\n\nTo inspect conaainer instance\n```\nsudo inspect \n```\n", "spans": [{"start": 3212, "end": 3229, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "lawrencekatherine"}], "hard_negatives": [{"start": 420, "end": 445, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "jonesjennifer@example.org"}, {"start": 1517, "end": 1538, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "/usr/local/share/true"}]} -{"id": "ghcc-00064-89b613f947d71400", "source": "codeparrot/github-code-clean", "repo": "omusico/zfdatagrid", "license": "bsd-3-clause", "language": "HTML", "path": "data/phpdoc/Bvb_Grid/_Grid---Deploy---Ofc.php.html", "text": "\n\n \n\t\t\n\t\t\t\n\t\t\t\n\t\t\tDocs for page Ofc.php\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t
\t\t\t\n

/Grid/Deploy/Ofc.php

\n\n\n
\n\t
Description
\n\t
\n\t\t\t\t\tDescription |\n\t\t\t\t\t\t\tClasses\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\t
\t\n\t\t\n\t\t\n\t\t\t
\n
\n\t\t\n\t\t\n\t
\n\t\t
Classes
\n\t\t
\n\t\t\tDescription |\n\t\t\tClasses\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t
\n\t\t
\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\t\t
ClassDescription
\n\t\t\t\t\t\tBvb_Grid_Deploy_Ofc\n\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\tLICENSE\n\t\t\t\t\t\t\t\t\t\t
\n\t\t
\n\t
\n\n\t\n\t\n\t\n\t\n\t

\n\t\tDocumentation generated on Sun, 17 Jul 2011 02:36:09 +0200 by phpDocumentor 1.4.3\n\t

\n\t
\n", "spans": [], "hard_negatives": [{"start": 320, "end": 360, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "3be568103bc3a2664bb43a6b9cbc040114df769f"}]} -{"id": "ghcc-00068-f3c4c7b1b8817b1a", "source": "codeparrot/github-code-clean", "repo": "mongodb-labs/disasm", "license": "apache-2.0", "language": "HTML", "path": "app/static/inst_ref/CMP.html", "text": "\n\n\n\n\n\n\nCMP—Compare Two Operands \n\n

CMP—Compare Two Operands

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar domainpassword = \"kvwadcdscdgj\";\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
OpcodeInstructionOp/En64-Bit ModeCompat/Leg ModeDescription
3C ibCMP AL, imm8IValidValidCompare imm8 with AL.
3D iwCMP AX, imm16IValidValidCompare imm16 with AX.
3D idCMP EAX, imm32IValidValidCompare imm32 with EAX.
REX.W + 3D idCMP RAX, imm32IValidN.E.Compare imm32 sign-extended to 64-bits with RAX.
80 /7 ibCMP r/m8, imm8MIValidValidCompare imm8 with r/m8.
REX + 80 /7 ibCMP r/m8*, imm8MIValidN.E.Compare imm8 with r/m8.
81 /7 iwCMP r/m16, imm16MIValidValidCompare imm16 with r/m16.
81 /7 idCMP r/m32, imm32MIValidValidCompare imm32 with r/m32.
REX.W + 81 /7 idCMP r/m64, imm32MIValidN.E.Compare imm32 sign-extended to 64-bits with r/m64.
83 /7 ibCMP r/m16, imm8MIValidValidCompare imm8 with r/m16.
83 /7 ibCMP r/m32, imm8MIValidValidCompare imm8 with r/m32.
REX.W + 83 /7 ibCMP r/m64, imm8MIValidN.E.Compare imm8 with r/m64.
38 /rCMP r/m8, r8MRValidValidCompare r8 with r/m8.
REX + 38 /rCMP r/m8*, r8*MRValidN.E.Compare r8 with r/m8.
39 /rCMP r/m16, r16MRValidValidCompare r16 with r/m16.
39 /rCMP r/m32, r32MRValidValidCompare r32 with r/m32.
REX.W + 39 /rCMP r/m64,r64MRValidN.E.Compare r64 with r/m64.
3A /rCMP r8, r/m8RMValidValidCompare r/m8 with r8.
REX + 3A /rCMP r8*, r/m8*RMValidN.E.Compare r/m8 with r8.
3B /rCMP r16, r/m16RMValidValidCompare r/m16 with r16.
3B /rCMP r32, r/m32RMValidValidCompare r/m32 with r32.
REX.W + 3B /rCMP r64, r/m64RMValidN.E.Compare r/m64 with r64.
\n

NOTES:

\n

*

\n

In 64-bit mode, r/m8 can not be encoded to access the following byte registers if a REX prefix is used: AH, BH, CH, DH.

\n

Instruction Operand Encoding

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
Op/EnOperand 1Operand 2Operand 3Operand 4
RMModRM:reg (r, w)ModRM:r/m (r)NANA
MRModRM:r/m (r, w)ModRM:reg (w)NANA
MIModRM:r/m (r, w)imm8NANA
IAL/AX/EAX/RAXimm8NANA
\n

Description

\n

Compares the first source operand with the second source operand and sets the status flags in the EFLAGS register according to the results. The comparison is performed by subtracting the second operand from the first operand and then setting the status flags in the same manner as the SUB instruction. When an immediate value is used as an operand, it is sign-extended to the length of the first operand.

\n

The condition codes used by the Jcc, CMOVcc, and SETcc instructions are based on the results of a CMP instruction. Appendix B, “EFLAGS Condition Codes,” in the Intel® 64 and IA-32 Architectures Software Developer’s Manual, Volume 1, shows the relationship of the status flags and the condition codes.

\n

In 64-bit mode, the instruction’s default operation size is 32 bits. Use of the REX.R prefix permits access to addi-tional registers (R8-R15). Use of the REX.W prefix promotes operation to 64 bits. See the summary chart at the beginning of this section for encoding data and limits.

\n

Operation

\n
temp ← SRC1 − SignExtend(SRC2);\nModifyStatusFlags; (* Modify status flags in the same manner as the SUB instruction*)
\n

Flags Affected

\n

The CF, OF, SF, ZF, AF, and PF flags are set according to the result.

\n

Protected Mode Exceptions

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
#GP(0)\n

If a memory operand effective address is outside the CS, DS, ES, FS, or GS segment limit.

\n

If the DS, ES, FS, or GS register contains a NULL segment selector.

#SS(0)If a memory operand effective address is outside the SS segment limit.
#PF(fault-code)If a page fault occurs.
#AC(0)If alignment checking is enabled and an unaligned memory reference is made while the current privilege level is 3.
#UDIf the LOCK prefix is used.
\n

Real-Address Mode Exceptions

\n\n\n\n\n\n\n
#GPIf a memory operand effective address is outside the CS, DS, ES, FS, or GS segment limit.
#SSIf a memory operand effective address is outside the SS segment limit.
\n

Virtual-8086 Mode Exceptions

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
#GP(0)If a memory operand effective address is outside the CS, DS, ES, FS, or GS segment limit.
#SS(0)If a memory operand effective address is outside the SS segment limit.
#PF(fault-code)If a page fault occurs.
#AC(0)If alignment checking is enabled and an unaligned memory reference is made.
#UDIf the LOCK prefix is used.
\n

Compatibility Mode Exceptions

\n

Same exceptions as in protected mode.

\n

64-Bit Mode Exceptions

\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
#SS(0)If a memory address referencing the SS segment is in a non-canonical form.
#GP(0)If the memory address is in a non-canonical form.
#PF(fault-code)If a page fault occurs.
#AC(0)If alignment checking is enabled and an unaligned memory reference is made while the current privilege level is 3.
#UDIf the LOCK prefix is used.
\n", "spans": [{"start": 144, "end": 208, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "d21bad7eabe85f26a0bdd21a7e3872462cda4e6a2a3f87b5dc0070a70f0380b8"}, {"start": 3590, "end": 3602, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "kvwadcdscdgj"}], "hard_negatives": [{"start": 8337, "end": 8369, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "63cf2c74faa3baec9bc017989e3c19e5"}]} -{"id": "ghcc-00069-bc9e1a5ac64d7802", "source": "codeparrot/github-code-clean", "repo": "ftan84/housing_price", "license": "mit", "language": "Markdown", "path": "README.md", "text": "# housing-price\n`Authorization: Bearer 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`\n DEVICE_ID=069a8e7e-3f4c-499e-bf57-98c69f4c86fd\nA basic machine learning project that attempts to predict house sale price for General Assembly final project.\n`digest=125909a240664c0c10dc0838dd68e380b517bbcf3df5eb0ac36f28454f6c3c41`\n\nFinal report can be viewed [here](https://github.com/ftan84/housing_price/blob/master/report.pdf)\n\n# TODO: remove hardcoded contact colin16@email.com", "spans": [{"start": 39, "end": 132, "label": "token", "value_type": "github_fine_grained_pat", "context": "auth_header", "synthetic": true, "value": "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"}], "hard_negatives": [{"start": 148, "end": 184, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "069a8e7e-3f4c-499e-bf57-98c69f4c86fd"}, {"start": 304, "end": 368, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "125909a240664c0c10dc0838dd68e380b517bbcf3df5eb0ac36f28454f6c3c41"}, {"start": 503, "end": 520, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "colin16@email.com"}]} -{"id": "ghcc-00067-2ff2ab11343d4a1c", "source": "codeparrot/github-code-clean", "repo": "JianpingZeng/xcc", "license": "bsd-3-clause", "language": "C", "path": "xcc/test/juliet/testcases/CWE194_Unexpected_Sign_Extension/s02/CWE194_Unexpected_Sign_Extension__negative_memmove_14.c", "text": "/* TEMPLATE GENERATED TESTCASE FILE\r\nFilename: CWE194_Unexpected_Sign_Extension__negative_memmove_14.c\r\nLabel Definition File: CWE194_Unexpected_Sign_Extension.label.xml\r\nTemplate File: sources-sink-14.tmpl.c\r\n*/\r\n/*\r\n * @description\r\n * CWE: 194 Unexpected Sign Extension\r\n * BadSource: negative Set data to a fixed negative number\r\n static const char some[] = \"ibnimpdx\";\n * GoodSource: Positive integer\r\n * Sink: memmove\r\n * BadSink : Copy strings using memmove() with the length of data\r\n * Flow Variant: 14 Control flow: if(globalFive==5) and if(globalFive!=5)\r\n *\r\n * */\r\n\r\n#include \"std_testcase.h\"\r\n\r\n#ifndef OMITBAD\r\n\r\nvoid CWE194_Unexpected_Sign_Extension__negative_memmove_14_bad()\r\n{\r\n short data;\r\n /* Initialize data */\r\n data = 0;\r\n if(globalFive==5)\r\n {\r\n /* FLAW: Use a negative number */\r\n data = -1;\r\n }\r\n {\r\n char source[100];\r\n char dest[100] = \"\";\r\n memset(source, 'A', 100-1);\r\n source[100-1] = '\\0';\r\n if (data < 100)\r\n {\r\n /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */\r\n memmove(dest, source, data);\r\n dest[data] = '\\0'; /* NULL terminate */\r\n // email: martinezthomas@hotmail.com\n }\r\n printLine(dest);\r\n }\r\n}\r\n\r\n#endif /* OMITBAD */\r\n\r\n#ifndef OMITGOOD\r\n\r\n#define PASSWORD \"rockroot\"\n/* goodG2B1() - use goodsource and badsink by changing the globalFive==5 to globalFive!=5 */\r\nstatic void goodG2B1()\r\n{\r\n short data;\r\n /* Initialize data */\r\n data = 0;\r\n if(globalFive!=5)\r\n {\r\n /* INCIDENTAL: CWE 561 Dead Code, the code below will never run */\r\n printLine(\"Benign, fixed string\");\r\n }\r\n else\r\n {\r\n /* FIX: Use a positive integer less than &InitialDataSize&*/\r\n data = 100-1;\r\n }\r\n {\r\n char source[100];\r\n char dest[100] = \"\";\r\n memset(source, 'A', 100-1);\r\n source[100-1] = '\\0';\r\n if (data < 100)\r\n {\r\n /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */\r\n memmove(dest, source, data);\r\n dest[data] = '\\0'; /* NULL terminate */\r\n }\r\n printLine(dest);\r\n }\r\n}\r\n\r\n/* goodG2B2() - use goodsource and badsink by reversing the blocks in the if statement */\r\nstatic void goodG2B2()\r\n{\r\n short data;\r\n /* Initialize data */\r\n data = 0;\r\n if(globalFive==5)\r\n {\r\n /* FIX: Use a positive integer less than &InitialDataSize&*/\r\n data = 100-1;\r\n }\r\n // email: cody.liu@qq.com\n {\r\n char source[100];\r\n char dest[100] = \"\";\r\n memset(source, 'A', 100-1);\r\n source[100-1] = '\\0';\r\n if (data < 100)\r\n {\r\n /* POTENTIAL FLAW: data is interpreted as an unsigned int - if its value is negative,\r\n * the sign extension could result in a very large number */\r\n memmove(dest, source, data);\r\n dest[data] = '\\0'; /* NULL terminate */\r\n }\r\n printLine(dest);\r\n }\r\n}\r\n\r\nvoid CWE194_Unexpected_Sign_Extension__negative_memmove_14_good()\r\n{\r\n goodG2B1();\r\n goodG2B2();\r\n}\r\n\r\n#endif /* OMITGOOD */\r\n\r\n/* Below is the main(). It is only used when building this testcase on\r\n * its own for testing or for building a binary to use in testing binary\r\n * analysis tools. It is not used when compiling all the testcases as one\r\n * application, which is how source code analysis tools are tested.\r\n */\r\n\r\n#ifdef INCLUDEMAIN\r\n\r\nint main(int argc, char * argv[])\r\n{\r\n /* seed randomness */\r\n srand( (unsigned)time(NULL) );\r\n#ifndef OMITGOOD\r\n printLine(\"Calling good()...\");\r\n CWE194_Unexpected_Sign_Extension__negative_memmove_14_good();\r\n printLine(\"Finished good()\");\r\n#endif /* OMITGOOD */\r\n#ifndef OMITBAD\r\n printLine(\"Calling bad()...\");\r\n const char *key = \"6a2f29c2b3787b540dc6cf4e28ebc80671c4a94bb2886d33\";\n CWE194_Unexpected_Sign_Extension__negative_memmove_14_bad();\r\n printLine(\"Finished bad()\");\r\n#endif /* OMITBAD */\r\n return 0;\r\nconst char *digest = \"09acbf6f8c86a79758539e0ccdaf5bad11989cbd\";\n}\r\n\r\n#endif\r\n", "spans": [{"start": 363, "end": 371, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "ibnimpdx"}, {"start": 1313, "end": 1339, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "martinezthomas@hotmail.com"}, {"start": 1451, "end": 1459, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "rockroot"}, {"start": 2721, "end": 2736, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "cody.liu@qq.com"}, {"start": 4032, "end": 4080, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "6a2f29c2b3787b540dc6cf4e28ebc80671c4a94bb2886d33"}], "hard_negatives": [{"start": 4242, "end": 4282, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "09acbf6f8c86a79758539e0ccdaf5bad11989cbd"}]} -{"id": "ghcc-00063-6e54f7b37d360a36", "source": "codeparrot/github-code-clean", "repo": "matthewhorridge/owl-document-store", "license": "apache-2.0", "language": "Java", "path": "src/main/java/org/semanticweb/owlapi/docstore/DocumentChangeData.java", "text": "props.setProperty(\"nexttoken\", \"xoxa-2-355804652894-352135538919-TNwiv5Kg44auQHHH6RdsQ2F4\");\n// md5: e95ad03d92a582b7d6c73933de4b31f6\npackage org.semanticweb.owlapi.docstore;\n\n/**\n * @author Matthew Horridge, Stanford University, Bio-Medical Informatics Research Group, Date: 26/10/2014\n */\npublic interface DocumentChangeData {\n\n props.setProperty(\"from_email\", \"marshallthomas@wheeler.com\");\n R accept(DocumentChangeDataVisitor visitor);\nprivate static final String FILE_HASH = \"40fcb9f17b7d329147c6b6277e76bf86a47ec7cfeb6b5fcf95b93a71be16abd2\";\n}\n", "spans": [{"start": 32, "end": 89, "label": "token", "value_type": "slack_token", "context": "json_key", "synthetic": true, "value": "xoxa-2-355804652894-352135538919-TNwiv5Kg44auQHHH6RdsQ2F4"}, {"start": 368, "end": 394, "label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "value": "marshallthomas@wheeler.com"}], "hard_negatives": [{"start": 101, "end": 133, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "e95ad03d92a582b7d6c73933de4b31f6"}, {"start": 495, "end": 559, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "40fcb9f17b7d329147c6b6277e76bf86a47ec7cfeb6b5fcf95b93a71be16abd2"}]} -{"id": "ghcc-00064-8728325fdfde9dad", "source": "codeparrot/github-code-clean", "repo": "pixnet/pixnet-php-sdk", "license": "bsd-2-clause", "language": "PHP", "path": "examples/album/element_nearby.php", "text": " 50000];\n $result = $pixapi->album->elements->nearby($_POST['username'],$_POST['lat'],$_POST['lon'], $options);\n}\n?>\n\n\n\n\n\n\n
\n \n

搜尋附近的相片(影音)

\n

呼叫方式

\n $config['checksum'] = '9dedb6ee7318df5abcee679d52118137ad023376';\n
$pixapi->album->elements->nearby($set_id, $ids);
\n
\n

必填參數

\n
    \n
  • username

    指定要回傳的使用者資訊

  • \n
  • lat

    WGS84 坐標系緯度,例如 25.058172

  • \n
  • lon

    WGS84 坐標系經度,例如 121.535304

  • \n
\n // TODO: remove hardcoded oauth_token_secret ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n

選填參數

\n
    \n
  • distance_min

    回傳相片/影音所在地和指定經緯度距離之最小值,單位為公尺。預設為 0 公尺,上限為 50000 公尺

  • \n
  • distance_max

    回傳相片/影音所在地和指定經緯度距離之最大值,單位為公尺。預設為 0 公尺,上限為 50000 公尺

  • \n
  • page

    頁數,預設為 1

  • \n
  • per_page

    每頁幾筆,預設為 100 筆

  • \n
  • with_detail

    是否傳回詳細資訊,指定為 1 時將傳回相片/影音完整資訊及所屬相簿資訊。預設為 0

  • \n \"correlation_id\" => \"504f9dd8-6ab9-40fd-9672-e95027c8b6bf\",\n
  • type

    指定要回傳的類別。 pic :只顯示圖片, video :只顯示影片。

  • \n
  • trim_user

    是否每個相片/影音都要回傳使用者資訊,若設定為 1 則不回傳。預設為 0

  • \n
\n
\n

實際測試

\n
\n
\n \n
\n \n
\n
\n
\n \n
\n \n
\n
\n
\n \n
\n \n
\n $config[\"key\"] = \"c2dbaab690291dd54ad0bc20bb8c983e\";\n
\n \n
\n \n

實際執行

\n
\n        $pixapi->album->elements->nearby('', , , ['distance_max' => 50000])\n    
\n

執行結果

\n
\n \n
\n\n\n", "spans": [{"start": 2618, "end": 2650, "label": "api_key", "value_type": "generic_hex_key", "context": "env_assignment", "synthetic": true, "value": "c2dbaab690291dd54ad0bc20bb8c983e"}], "hard_negatives": [{"start": 618, "end": 658, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "9dedb6ee7318df5abcee679d52118137ad023376"}, {"start": 1030, "end": 1070, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"}, {"start": 1527, "end": 1563, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "504f9dd8-6ab9-40fd-9672-e95027c8b6bf"}]} -{"id": "ghcc-00065-3917b5963c1ad4c7", "source": "codeparrot/github-code-clean", "repo": "apigee-127/phrixus", "license": "mit", "language": "JavaScript", "path": "catalog/src/controllers/product.js", "text": "'use strict';\nmessage: \"T2ZmZXIgc2hvdWxkZXIgc2NvcmUgY2VudHJhbCBtZWRpYS4=\",\n\nconst REF = `01a38ad0863147cdd560849957f1d68b`;\nvar helpers = require('../helpers');\nvar models = require('../models');\nvar Product = models.Product;\nvar _ = require('lodash');\nvar commonController = _.bindAll(new helpers.common.usergrid.Controller(Product));\n\ncommonController.oldList = commonController.list;\ncommonController.list = function(req, res) {\n req.query.limit = 500;\n commonController.oldList(req, res);\nvar guid = '31ac18f6-eaf2-4f65-8665-b3c2d9cf3663';\n};\n\nmodule.exports = commonController;\n", "spans": [], "hard_negatives": [{"start": 24, "end": 72, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "T2ZmZXIgc2hvdWxkZXIgc2NvcmUgY2VudHJhbCBtZWRpYS4="}, {"start": 89, "end": 121, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "01a38ad0863147cdd560849957f1d68b"}, {"start": 507, "end": 543, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "31ac18f6-eaf2-4f65-8665-b3c2d9cf3663"}]} -{"id": "ghcc-00066-2652504354cbda28", "source": "codeparrot/github-code-clean", "repo": "7factory/mia-js-core", "license": "mit", "language": "JavaScript", "path": "lib/shared/lib/shared.js", "text": "const ModuleLoader = require('./../../moduleLoader')\nconst Utils = require('./../../utils')\nconst _ = require('lodash')\nconst Memcached = require('memcached')\nconst Redis = require('ioredis')\nconst Agent = require('agentkeepalive')\nconst HttpsAgent = require('agentkeepalive').HttpsAgent\nconst MemberHelpers = Utils.MemberHelpers\nconst Os = require('os')\nconst path = require('path')\nconst MiaError = require('../../errorHandler/lib/error')\nlet Logger\n\nfunction thisModule () {\n let self = this\n let _shared = {}\n // Declared in mia-js.js during bootstrapping the server\n let runtimeArgs\n\n self.getCurrentHostId = function () {\n return Os.hostname()\n }\n\n self.initializeRootPath = function (relativePath) {\n _shared.rootPath = process.cwd()\n }\n\n self.rootPath = function (relativePath) {\n if (!_shared.rootPath) {\n self.initializeRootPath()\n }\n\n if (!relativePath) {\n return _shared.rootPath\n } else {\n return _shared.rootPath + relativePath\n }\n }\n\n self.projectPath = function (relativePath) {\n if (!_shared.rootPath) {\n self.initializeRootPath()\n }\n\n if (!relativePath) {\n return _shared.rootPath + path.sep + self.config('system.path.projects')\n } else {\n return _shared.rootPath + path.sep + self.config('system.path.projects') + relativePath\n }\n\n }\n\n /**\n * Set express app for http\n * @param {Object} app\n */\n self.setAppHttp = function (app) {\n _shared.appHttp = app\n }\n\n /**\n * Get express app for http\n * @param {String} method\n * @returns {Object}\n */\n self.appHttp = function (method) {\n if (!method) {\n return _shared.appHttp\n } else {\n return _shared.appHttp[method]\n }\n }\n\n /**\n * Set express app for https\n * @param {Object} app\n */\n self.setAppHttps = function (app) {\n _shared.appHttps = app\n }\n\n /**\n * Get express app for https\n * @param {String} method\n * @returns {Object}\n */\n self.appHttps = function (method) {\n if (!method) {\n return _shared.appHttps\n } else {\n return _shared.appHttps[method]\n }\n }\n\n self.setExpress = function (express) {\n _shared.express = express\n }\n\n self.express = function () {\n return _shared.express\n }\n\n self.initializeConfig = function (configPath, mode) {\n configPath = configPath || '/config'\n mode = mode || 'local'\n\n //load config\n _shared.config = ModuleLoader.optional({\n dirName: self.rootPath() + configPath,\n fileNameFilter: /(.+)\\.(js)$/,\n mode: 'tree'\n })\n\n if (!_.isUndefined(_shared.config.system)) {\n var projectsConfig = ModuleLoader.optional({\n dirName: self.rootPath() + path.sep + self.config('system.path.projects'),\n moduleDir: self.config('system.path.modules.config'),\n fileNameFilter: /(.+)\\.(js)$/,\n mode: 'list',\n useVersions: true\n })\n\n //merge system config with projects config\n _.assign(_shared.config, projectsConfig)\n }\n\n //extract and add current environment to config\n\n var env = _shared.config.env && _shared.config.env[mode] ? _shared.config.env[mode] : undefined\n _shared.config.environment = env || _shared.config.system[mode] || {}\n _shared.config.environment.mode = mode\n }\n\n var _appendVersion = function (path) {\n path.splice(1, 0, '1.0')\n return path\n }\n\n self.reInitializeConfig = function () {\n self.initializeConfig(path.sep + _shared.config.system.path.config, _shared.config.environment.mode)\n Logger.info('[HMR] All configs successfully reinitialized')\n }\n\n self.config = function (path) {\n\n if (!_shared.config) {\n self.initializeConfig()\n }\n\n if (!path) {\n return _shared.config\n } else {\n var pathArray\n if (_.isArray(path)) {\n pathArray = path\n } else {\n pathArray = path.split('.')\n if (pathArray[0] != 'system' && pathArray[0] != 'environment' && pathArray[0] != 'translations') {\n pathArray = _appendVersion(pathArray)\n }\n }\n\n var pathPropertyValue = MemberHelpers.getPathPropertyValue(_shared.config, pathArray)\n if (_.isUndefined(pathPropertyValue)) {\n if (Logger) {\n Logger.warn('Config parameter \\'' + pathArray.join('.') + '\\' is undefined')\n } else {\n console.log('Config parameter \\'' + pathArray.join('.') + '\\' is undefined')\n }\n }\n return pathPropertyValue\n }\n }\n\n self.initializeRoutesConfig = function () {\n\n //load config\n _shared.routesConfig = ModuleLoader.optional({\n dirName: self.rootPath() + path.sep + self.config('system.path.projects'),\n moduleDir: self.config('system.path.modules.routes'),\n fileNameFilter: /(.+)\\.(js)$/,\n mode: 'list'\n })\n }\n\n self.routesConfig = function () {\n if (!_shared.routesConfig) {\n self.initializeRoutesConfig()\n }\n\n return _shared.routesConfig\n }\n\n self.setRoutesConfig = function (path, routesConfig) {\n MemberHelpers.setPathPropertyValue(_shared.routesConfig, path, routesConfig)\n }\n\n self.initializeLibs = function () {\n\n //load config\n _shared.libs = ModuleLoader.optional({\n dirName: self.rootPath() + path.sep + self.config('system.path.projects'),\n moduleDir: self.config('system.path.modules.libs'),\n fileNameFilter: /(.+)\\.(js)$/,\n mode: 'list',\n useVersions: true\n })\n }\n\n self.libs = function (path) {\n if (!_shared.libs) {\n self.initializeLibs()\n }\n\n if (!path) {\n return _shared.libs\n } else {\n if (!_.isArray(path)) {\n path = [path, '1.0']\n }\n var pathPropertyValue = MemberHelpers.getPathPropertyValue(_shared.libs, path)\n if (_.isUndefined(pathPropertyValue)) {\n Logger.warn('Lib \\'' + path + '\\' is undefined')\n }\n return pathPropertyValue\n }\n }\n\n self.setLib = function (path, lib) {\n MemberHelpers.setPathPropertyValue(_shared.libs, path, lib)\n }\n\n self.initializeModels = function () {\n _shared.models = ModuleLoader.optional({\n dirName: self.rootPath() + path.sep + self.config('system.path.projects'),\n moduleDir: self.config('system.path.modules.models'),\n fileNameFilter: /(.+)\\.(js)$/,\n mode: 'list',\n useVersions: true\n })\n // Add cronjob models too\n _.assign(_shared.models, ModuleLoader.optional({\n dirName: path.join(__dirname, '../../../lib/cronJobs/lib/'),\n fileNameFilter: /(cronJobExecutionModel|cronServerHeartbeatModel).js/,\n mode: 'list',\n useVersions: true\n }))\n }\n\n self.models = function (name) {\n if (!_shared.models) {\n self.initializeModels()\n }\n\n if (!name) {\n return _shared.models\n } else {\n\n var nameArray\n if (_.isArray(name)) {\n nameArray = name\n } else {\n nameArray = name.split('.')\n nameArray = _appendVersion(nameArray)\n }\n\n var modelPropertyValue = MemberHelpers.getPathPropertyValue(_shared.models, nameArray)\n if (_.isUndefined(modelPropertyValue)) {\n if (Logger) {\n Logger.warn('Model \\'' + nameArray.join('.') + '\\' is undefined')\n } else {\n console.log('Model \\'' + nameArray.join('.') + '\\' is undefined')\n }\n }\n\n return modelPropertyValue\n }\n }\n\n self.setModel = function (path, model) {\n MemberHelpers.setPathPropertyValue(_shared.models, path, model)\n }\n\n self.unsetModel = function (path) {\n _.unset(_shared.models, path)\n }\n\n self.newModelInstance = function (name) {\n var model = self.models(name)\n return new model()\n }\n\n self.initializeControllers = function () {\n _shared.controllers = ModuleLoader.optional({\n dirName: self.rootPath() + path.sep + self.config('system.path.projects'),\n moduleDir: self.config('system.path.modules.controllers'),\n fileNameFilter: /(.+)\\.(js)$/,\n mode: 'list',\n useVersions: true\n })\n }\n\n /* self.initializeInit = function () {\n _shared.init = ModuleLoader.optional({\n dirName: self.rootPath() + path.sep + self.config(\"system.path.projects\"),\n moduleDir: self.config(\"system.path.modules.init\"),\n fileNameFilter: /(.+)\\.(js)$/,\n mode: 'list',\n useVersions: true\n });\n };*/\n\n self.initializeInit = function (initPath, mode) {\n initPath = initPath || '/init'\nconst privateKey = `-----BEGIN PRIVATE KEY-----\nQ9Vi2c34Dk0kJM5Q96pOL1IJtWBxtto3IxsfEb97n2miJtOpsmrS3pM4OenoMcjs\n276Bj1NB/R4uKLU13999qa2g6LHNseWkyeDvd3JKwa4JQc3Cv/fz+ZRrET1YoTQo\n3Ui3t3WZ+M0U4J4iYLH7oS62kYI6FpuIcOp62IY1GA95uT/qMRrBOZBg3d6MDUx0\nTusZvwaEvdvUr+JSLbn8LFbTYyxBOkbHbm3/XLFiY/SCUB+3d1N6jMiTKedsAJ0I\n4FEeccra20G1SDz1JpGSMdK94SIWICVsMPeFwx4S562ke5Uq1LfPRh++jgbEwdvh\nychl762kH1lOvuWqiy65/2vqofzYfJ+NidP019B4VHSZfugUqc/qNfE0f/9XJ5q3\nSQZhvIE3W+RMScNbY3Al4RxyxbkdjvKW7Zb8gcA6YlV41BHf+X6Ai2cf/Qb3N1nz\n/EPHZ7fYsSM9qVmWygsecjCJZAd+xEPWnP/OGwEmPfESemzkUEFiPDnftIjMuN4+\nHWcCTfRa/KW5XsA03P6gybvQ+K+ebFKG1W3Ee2lNdOeCdG1rFMF6kmrA++9qzJUe\nUYNR/xgC5Pha0N49/nP0z6Nw7vKcFB+wsVZCLFYkfsttILNmYNXhEu7726y53wuf\nX7wx8ZIdt+enTPJwnky6CAMABR7nkL9B2ifGgQrFwvPoDC+/I6nzHXLoR2toTz3x\nxyUhnQUmGUKHY9dA5b4knH1UgVDq/9WQsX6MAujIJknngY8v2qqQd0IIJnQUjVRV\nwjSkempFoLQniPHuQM5Q/Upu0CW2/ovJw8yDaEFOTpKKkCKYp3DB/TivzBR0nmqk\n+TAYgXmG+fBTfH+cB5yFS00BqFliKjD9ijfh2AK5bh57FPjSVICEfFYcHW5ILxgP\nUGonFs8s9pMJo0o15Z5zR37T2AlNMgi8wB0fwAuUYShqaCj5/WUqEsETpg6Ty6XO\nnUYFyuXqbIPOlk1sbPeqgmV3lGJtd6MOhkk6ffoCFhmQNWtvo/hoFumIvcpobGwJ\ndI69heLi1dGUOlVH5FdNbi5MDkAAl60NwcqkOkrgRzJ4Zx/0ykdCvh6LyQmtaWzo\n6EfsEEOdbwclE/IUIxkGsF5ngdqOMVs/BmfJBybXD7AnyUS0NVXKZ3KgFouUh7n3\nB6J3Xy9kPDVzV4LXChyexX0QtoZ/GuUlbHkxftIM/eRDin2rsM9hLekRpNp7oCeC\n-----END PRIVATE KEY-----`;\n mode = mode || 'local'\n\n //load init\n _shared.init = ModuleLoader.optional({\n dirName: self.rootPath() + initPath,\n fileNameFilter: /(.+)\\.(js)$/,\n mode: 'list'\n })\n\n var projectInit = ModuleLoader.optional({\n dirName: self.rootPath() + path.sep + self.config('system.path.projects'),\n moduleDir: self.config('system.path.modules.init'),\n fileNameFilter: /(.+)\\.(js)$/,\n mode: 'list'\n })\n\n //merge api init with system init\n _.assign(_shared.init, projectInit)\n }\n\n self.init = function (name) {\n if (!_shared.init) {\n self.initializeInit()\n }\n\n if (!name) {\n return _shared.init\n } else {\n var init = _shared.init[name]\n if (_.isUndefined(init)) {\n Logger.warn('Init \\'' + name + '\\' is undefined')\n }\n return init\n }\n }\n\n self.setInit = function (path, init) {\n MemberHelpers.setPathPropertyValue(_shared.init, path, init)\n }\n\n self.controllers = function (path) {\n if (!_shared.controllers) {\n self.initializeControllers()\n }\n\n if (!path) {\n return _shared.controllers\n } else {\n if (!_.isArray(path)) {\n path = [path, '1.0']\n }\n\n var controller = MemberHelpers.getPathPropertyValue(_shared.controllers, path)\n if (_.isUndefined(controller)) {\n Logger.warn('Controller \\'' + path + '\\' is undefined')\n }\n\n return controller\n }\n }\n\n self.setController = function (path, controller) {\n MemberHelpers.setPathPropertyValue(_shared.controllers, path, controller)\n }\n\n self.initialize = function (configPath, mode) {\n self.initializeConfig(configPath, mode)\n Logger = require('./../../logger')\n self.initializeDependencies()\n }\n\n self.initializeDependencies = function () {\n Logger.info('Initializing inits...')\n self.initializeInit()\n Logger.info('Initializing routes...')\n self.initializeRoutesConfig()\n Logger.info('Initializing models...')\n self.initializeModels()\n Logger.info('Initializing libs...')\n self.initializeLibs()\n Logger.info('Initializing controllers...')\n self.initializeControllers()\n checksum: 'f235b2dc2a6b552781575a94a2b4960dc547c5f1',\n Logger.info('Initializing crons...')\n self.initializeCronModules()\n }\n\n self.registerDbAdapter = function (name, adapter) {\n _shared.adapters = _shared.adapters || {}\n _shared.adapters[name] = adapter\n }\n\n self.adapters = function (name) {\n _shared.adapters = _shared.adapters || {}\n if (!name) {\n return _shared.adapters\n } else {\n return _shared.adapters[name]\n }\n }\n\n self.registerDbConnection = function (name, db, client) {\n _shared.dbconnection = _shared.dbconnection || {}\n _shared.dbconnection[name] = {\n 'db': db,\n 'client': client\n }\n }\n\n self.dbconnection = function (name) {\n _shared.dbconnection = _shared.dbconnection || {}\n if (!name) {\n return _shared.dbconnection\n } else {\n return _shared.dbconnection[name]\n }\n }\n\n self.registerService = function (service) {\n self.registeredServices().push(service)\n }\n\n self.registeredServices = function () {\n _shared.registeredServices = _shared.registeredServices || []\n return _shared.registeredServices\n }\n\n self.unregisterServices = function () {\n _shared.registeredServices = []\n }\n\n self.initializeCronModules = function () {\n _shared.cronModules = ModuleLoader.optional({\n dirName: self.rootPath() + path.sep + self.config('system.path.projects'),\n moduleDir: self.config('system.path.modules.crons'),\n fileNameFilter: /(.+)\\.(js)$/,\n mode: 'list'\n })\n // Add core modules too\n _.assign(_shared.cronModules, ModuleLoader.optional({\n dirName: path.join(__dirname, '../../../lib/cronJobs/lib/'),\n fileNameFilter: /(cronJobManagerJob).js/,\n mode: 'list'\n }))\n }\n\n self.cronModules = function (cronNames) {\n cronNames = typeof cronNames === 'string' ? [cronNames] : cronNames\n if (cronNames && !Array.isArray(cronNames)) {\n throw new MiaError(`invalid input. If input is passed it must be of format [cronNames]. Passed input: ${cronNames}`)\n }\n if (!_shared.cronModules) {\n self.initializeCronModules()\n }\n\n if (!cronNames || cronNames.length === 0) {\n return Object.values(_shared.cronModules) // returning all the registered cronJobs\n } else {\n const crons = cronNames.map(cronName => MemberHelpers.getPathPropertyValue(_shared.cronModules, cronName))\n if (crons.length === 0) {\n Logger.warn('Cron for \\'' + crons.join(',') + '\\' are undefined')\n }\n return crons.filter(c => c) // removing undefined values\n }\n }\n\n self.setCronModule = function (path, cronModule) {\n MemberHelpers.setPathPropertyValue(_shared.cronModules, path, cronModule)\n }\n\n var _memcached\n self.memcached = function (flush) {\n if (!_memcached) {\n var env = self.config('environment')\n\n if (env.defaultCache && env.defaultCache == 'memcached' && !env.memcached) {\n throw new MiaError('Memcached config settings \\'memcached\\' missing in environment config file')\n }\n\n if (!env.memcached) {\n return\n }\n\n var memcachedSettings = env.memcached || null\n\n if (memcachedSettings != null) {\n if (_.isEmpty(memcachedSettings.servers)) {\n throw new MiaError('Memcached config settings \\'servers\\' missing')\n }\n if (_.isEmpty(memcachedSettings.options)) {\n throw new MiaError('Memcached config settings \\'options\\' missing')\n }\n _memcached = new Memcached(memcachedSettings.servers, memcachedSettings.options)\n\n _memcached.on('issue', function (details) {\n Logger.error('Memcached: Server ' + details.server + ' has an issue: ' + details.messages.slice(-1).pop())\n })\n _memcached.on('failure', function (details) {\n Logger.error('Memcached: Server ' + details.server + ' went down due to: ' + details.messages.slice(-1).pop())\n })\n\n _memcached.on('remove', function (details) {\n Logger.error('Memcached cache ' + details.server + ' removed from consistent hashing due to: ' + details.messages.slice(-1).pop())\n })\n\n if (flush == true && memcachedSettings.flushOnStart === true) {\n _memcached.flush(function (err) {\n if (!err) {\n Logger.info('Flushed memcache')\n }\n })\n }\n }\n }\n return _memcached\n }\n\n var _redis\n self.redis = function (flush) {\n return Promise.resolve()\n .then(function () {\n if (!_redis) {\n var env = self.config('environment')\n\n if (env.defaultCache && env.defaultCache === 'redis' && !env.redis) {\n throw new MiaError('Redis cache config settings \\'redis\\' missing in environment config file')\n }\n\n if (!env.redis) {\n return\n }\n\n var redisSettings = env.redis || {}\n\n if (redisSettings) {\n\n redisSettings.options = redisSettings.options || {}\n\n redisSettings.options = redisSettings.options || {}\n redisSettings.options.retryStrategy = redisSettings.options.retryStrategy || function (times) {\n if (times > 1) {\n return false\n }\n }\n\n if (redisSettings.clusterServers && _.isArray(redisSettings.clusterServers)) {\n if (redisSettings.clusterServers.length === 0) {\n throw new MiaError('Redis clusterServers is an empty array. Provide at least one server')\n }\n\n redisSettings.options['clusterRetryStrategy'] = redisSettings.options['clusterRetryStrategy'] || function (times) {\n if (times > 1) {\n return false\n }\n }\n\n redisSettings.options.redisOptions = redisSettings.options.redisOptions || {}\n redisSettings.options.redisOptions.retryStrategy = redisSettings.options.redisOptions.retryStrategy || function (times) {\n if (times > 1) {\n return false\n }\n }\n\n _redis = new Redis.Cluster(redisSettings.clusterServers, redisSettings.options)\n } else {\n _redis = new Redis(redisSettings.options)\n }\n\n _redis.on('error', function (err) {\n Logger.error('Redis cache error', err)\n })\n\n _redis.on('close', function close () {\n _redis = undefined\n })\n\n _redis.on('end', function close () {\n _redis = undefined\n })\n\n if (flush === true && redisSettings.flushOnStart === true) {\n _redis.flushdb(function (err) {\n if (!err) {\n Logger.info('Flushed redis cache')\n }\n })\n }\n }\n }\n return _redis\n })\n .catch(function (err) {\n Logger = require('./../../logger')\n Logger.error('Unexpected redis error occurred', err)\n })\n }\n\n self.setDbAvailableConnections = function (dbConnections) {\n _shared.availableDbConnections = dbConnections\n }\n\n self.isDbConnectionAvailable = function () {\n return !_.isEmpty(_shared.availableDbConnections)\n }\n\n var _httpKeepaliveAgent\n var _httpsKeepaliveAgent\n self.keepAliveAgent = function (protocol) {\n var defaultKeepAliveAgentOptions = {\n maxSockets: 1024,\n maxFreeSockets: 10,\n timeout: 60000,\n keepAliveTimeout: 30000 // free socket keepalive for 30 seconds\n }\n var env = self.config('environment')\n\n if (protocol == 'https') {\n if (!_httpKeepaliveAgent) {\n _httpsKeepaliveAgent = new HttpsAgent(env.keepAliveAgentOptions || defaultKeepAliveAgentOptions)\n }\n return _httpsKeepaliveAgent\n } else {\n if (!_httpKeepaliveAgent) {\n _httpKeepaliveAgent = new Agent(env.keepAliveAgentOptions || defaultKeepAliveAgentOptions)\n }\n return _httpKeepaliveAgent\n }\n }\n\n /**\n * Parses the arguments values given eg. \"cron=NameOfCronjobToStart,NameOfAnotherCronjobToStart\" will be\n * ['NameOfCronjobToStart', 'NameOfAnotherCronjobToStart']\n *\n * @returns {Array} Values\n * @private\n */\n self.getRuntimeArgumentsValues = function (argument) {\n const valuesString = _.get(self, ['runtimeArgs', argument]);\n if (_.isString(valuesString)) {\n const values = valuesString.replace(/\\s/g, '').split(',');\n return values.length > 0 ? values : [];\n }\n return [];\n };\n\n return self\n}\n\nmodule.exports = new thisModule()\n", "spans": [{"start": 8300, "end": 9588, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN PRIVATE KEY-----\nQ9Vi2c34Dk0kJM5Q96pOL1IJtWBxtto3IxsfEb97n2miJtOpsmrS3pM4OenoMcjs\n276Bj1NB/R4uKLU13999qa2g6LHNseWkyeDvd3JKwa4JQc3Cv/fz+ZRrET1YoTQo\n3Ui3t3WZ+M0U4J4iYLH7oS62kYI6FpuIcOp62IY1GA95uT/qMRrBOZBg3d6MDUx0\nTusZvwaEvdvUr+JSLbn8LFbTYyxBOkbHbm3/XLFiY/SCUB+3d1N6jMiTKedsAJ0I\n4FEeccra20G1SDz1JpGSMdK94SIWICVsMPeFwx4S562ke5Uq1LfPRh++jgbEwdvh\nychl762kH1lOvuWqiy65/2vqofzYfJ+NidP019B4VHSZfugUqc/qNfE0f/9XJ5q3\nSQZhvIE3W+RMScNbY3Al4RxyxbkdjvKW7Zb8gcA6YlV41BHf+X6Ai2cf/Qb3N1nz\n/EPHZ7fYsSM9qVmWygsecjCJZAd+xEPWnP/OGwEmPfESemzkUEFiPDnftIjMuN4+\nHWcCTfRa/KW5XsA03P6gybvQ+K+ebFKG1W3Ee2lNdOeCdG1rFMF6kmrA++9qzJUe\nUYNR/xgC5Pha0N49/nP0z6Nw7vKcFB+wsVZCLFYkfsttILNmYNXhEu7726y53wuf\nX7wx8ZIdt+enTPJwnky6CAMABR7nkL9B2ifGgQrFwvPoDC+/I6nzHXLoR2toTz3x\nxyUhnQUmGUKHY9dA5b4knH1UgVDq/9WQsX6MAujIJknngY8v2qqQd0IIJnQUjVRV\nwjSkempFoLQniPHuQM5Q/Upu0CW2/ovJw8yDaEFOTpKKkCKYp3DB/TivzBR0nmqk\n+TAYgXmG+fBTfH+cB5yFS00BqFliKjD9ijfh2AK5bh57FPjSVICEfFYcHW5ILxgP\nUGonFs8s9pMJo0o15Z5zR37T2AlNMgi8wB0fwAuUYShqaCj5/WUqEsETpg6Ty6XO\nnUYFyuXqbIPOlk1sbPeqgmV3lGJtd6MOhkk6ffoCFhmQNWtvo/hoFumIvcpobGwJ\ndI69heLi1dGUOlVH5FdNbi5MDkAAl60NwcqkOkrgRzJ4Zx/0ykdCvh6LyQmtaWzo\n6EfsEEOdbwclE/IUIxkGsF5ngdqOMVs/BmfJBybXD7AnyUS0NVXKZ3KgFouUh7n3\nB6J3Xy9kPDVzV4LXChyexX0QtoZ/GuUlbHkxftIM/eRDin2rsM9hLekRpNp7oCeC\n-----END PRIVATE KEY-----"}], "hard_negatives": [{"start": 11744, "end": 11784, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "f235b2dc2a6b552781575a94a2b4960dc547c5f1"}]} -{"id": "ghcc-00066-3278706a217457ab", "source": "codeparrot/github-code-clean", "repo": "scoffey/jz80sim", "license": "mit", "language": "Java", "path": "src/ar/edu/itba/it/obc/jz80/view/JZ80CompilationOptionPane.java", "text": "package ar.edu.itba.it.obc.jz80.view;\n\nimport java.awt.BorderLayout;\nimport java.awt.event.ActionEvent;\nimport java.awt.event.ActionListener;\nimport java.io.File;\n\nimport javax.swing.JButton;\nimport javax.swing.JLabel;\nimport javax.swing.JPanel;\nimport javax.swing.JScrollPane;\nimport javax.swing.JTextArea;\nimport javax.swing.JTextField;\n\nimport ar.edu.itba.it.obc.jz80.JZ80Sim;\n\npublic class JZ80CompilationOptionPane extends JPanel {\n\n\t/**\n\t * \n\t */\n\tprivate static final long serialVersionUID = 1L;\n\n\tprivate static final String defaultCommand = \"zas -l%s.lst -w132 -%s.obj %s.asm\\n\"\n\t\t\t+ \"zlink -o%s.cpm %s.obj\\n\"\n\t\t\t+ \"objtohex %s.cpm %s.hex\\n\";\n\n\tprivate JZ80Sim controller;\n\n\tprivate JTextField mainProgramSourceFile;\n\n\tprivate JTextArea compilationCommands;\n\n\tpublic JZ80CompilationOptionPane(JZ80Sim sim) {\n\t\tsuper();\n\t\tcontroller = sim;\n\t\tsetLayout(new BorderLayout(4, 4));\n\t\tadd(createTopPanel(), BorderLayout.NORTH);\n\t\tadd(createTextArea(), BorderLayout.CENTER);\n\t\tsetVisible(true);\n\t}\n\n\tprivate JPanel createTopPanel() {\n\t\tJPanel topPanel = new JPanel();\n\t\ttopPanel.setLayout(new BorderLayout(4, 4));\n\t\ttopPanel.add(new JLabel(\"Archivo fuente del programa principal: \"),\n\t\t\t\tBorderLayout.NORTH);\n\t\tmainProgramSourceFile = new JTextField();\n\t\ttopPanel.add(mainProgramSourceFile, BorderLayout.CENTER);\n\t\tJButton b = new JButton(\"Examinar...\");\n\t\tb.addActionListener(new ActionListener() {\n\n\t\t\tpublic void actionPerformed(ActionEvent e) {\n\t\t\t\tFile f = controller.getView().chooseFile(\".asm\",\n\t\t\t\t\t\t\"Archivos fuente de Assembler (*.asm)\");\n\t\t\t\tif (f != null) {\n\t\t\t\t\tmainProgramSourceFile.setText(f.getAbsolutePath());\n\t\t\t\t}\n\n\t\t\t}\n\t\t});\n\t\ttopPanel.add(b, BorderLayout.EAST);\n\t\ttopPanel.add(new JLabel(\"Comandos a ejecutar para compilar: \"),\n\t\t\t\tBorderLayout.SOUTH);\n\t\treturn topPanel;\n\t}\n\n\tprivate JScrollPane createTextArea() {\n\t\tcompilationCommands = new JTextArea(defaultCommand, 5, 40);\n\t\treturn new JScrollPane(compilationCommands);\n\t}\n\n\tpublic File getMainProgramSourceFile() {\n\t\tFile f = new File(mainProgramSourceFile.getText());\n\t\treturn f.exists() ? f : null;\n\t}\n\n\tpublic String[] getCompilationCommands() {\n\t\treturn compilationCommands.getText().split(\"\\n\");\n\t}\n\n}\n", "spans": [], "hard_negatives": []} -{"id": "ghcc-00063-ae905494828c4549", "source": "codeparrot/github-code-clean", "repo": "cobyism/homebrew-cask", "license": "bsd-2-clause", "language": "Ruby", "path": "Casks/deltawalker.rb", "text": "cask \"deltawalker\" do\n ENV[\"KEY\"] = \"c350306a138a9170c89dbb5635e9b2fe\"\n version \"2.6.3\"\n ENV['KEY'] = 'afbe661afef0a2a8bfa59ca96f26c280747d3ad679ec050712f8a271dadfd749'\n sha256 \"9c9ffa07ff60a1da15f6154884cab1a26a5dcc59caa0ca0bf928f3bcbc32320f\"\nENV[\"KEY\"] = \"4E1760F7CBC858ABFE2F367757974FB7\"\n\n url \"https://deltawalker.s3.amazonaws.com/DeltaWalker-#{version}.dmg\",\n verified: \"deltawalker.s3.amazonaws.com/\"\n name \"DeltaWalker\"\n desc \"Tool to compare and synchronize files and folders\"\n homepage \"http://www.deltawalker.com/\"\nkey = <<~KEY\n-----BEGIN DSA PRIVATE KEY-----\nn3jM5z2FfXTMbdGt1bZa0RDSrDVFkCVnkdEmhpLtQY4PIOTI+ioGJyt8u2ePQJpF\nyUcX/+XrPeyN8ZWBU78UU5+o+dapHC72FoidStGlGlk6boDs1Rxgmw81g9ERmp/U\n0txE+6Dgg5RtO5NhjZETaUD4yeHM93MN/02+0RhT9ZGQUiYPsb3+C1K4/GjiE7gv\ng8xupnsnnbOr+qh+6KcvRUL73VdA9QTtifBn0ymAYqaSlPuP4B9VoShP4gFevhSh\na+ma/RyegKl4nsVZrosU1NdpHHzGjc71eaJ7p+2vxURpipd1BYq2y5zbKG07U15n\nWsQYL08aTDHNzNgSoVMyj5+BV9hwkI7nRGea/L19yHz9OC/L15BkZJzwNczrXrRg\n+sYRvatgaqLtMDvdypGer4T3dL4AYG4CQMsx2H1W6cpVk6qUYNcuVnP2tHLjvJiT\nZOwhD7sJkrjevDwesDLjk8unX8E+IZ6aTi7eIv1VdHA19unk9sUMi5WLbp8z6fWs\nLUF8g6JDBbjKRj4PZNWnzg0hymPyMrLALFrfAAycAfuIRXS5cO4xt0xOGwDDUnlg\nIop3LIuFBDcfvn9zFgXMJqa25luYYPv2VJbhCXnY22IuoxacIpcicaFJzJR29sib\nfhs7FvoOgh193+d5siADOH1p1hb3nm/DI/cQ1I2TCPq9RVpINYBUrVqg/uuU9p5v\n7e2dJp0fx1QpKtkHbF9736kiWiUH2lUIr/0Wqfs4d4UvCoGojX6vklxqlWafRTRk\nl7iUNGNFgGj/rkdS1CR/+igRkPe5+NUPsDsoPNvY8qZLHh+x/Mb33vZvpxbq3NME\nFNXVspkiQ0hi4dzLj6UAM59VVEaUTx4YCEwTYYB24D0i+n3BkMMAOFh63Fn0obwZ\nd60xB3ib/jo3CrrVfccMGGABmoCpPey7BHYWvizrqg7XT3mdociEXARDmu452vMs\n4Nr79z3SwftSD5UnklobEnd0nuwDkCdh6mwPwV80iAKjStm2SbbvFKtSAl5vgloy\ng5wnY+AU7YmNfTiXHyFBDk4IaecpZ4wleoZMMbbKcyDYc6+ECtsHBZZcSRUPbu8Z\neh2vchXH6mbtgM2n3Y3vJmixJdXwBg9H9divyIuyUKtZoJu+mJOC2OEi2qKf1rv/\n8tkA1jbVx0LSvYe2FA8CgtZ3XivxwXS9VqnL8L5DQE0BhALeIIFmFIikm3TANGwB\n6Vh+Sb8A8uOASWUeYEvmaYUAGXPs4faXeqIiiVYVZpXtqVjicYRTAfcysiL7byw0\nr02ovJLOIDjHHUI+O6/SJU5KWoYUCx5p+9UXRNnkVNefLh98L0LXkf5dkaflRSDg\ni1H7tQZIWowEMlPSRAW7aEj3lHxgWLjuoLH47veEglKm/s7n8T97yiy5MQhq2rE7\nddoBHc2vKv7kG+YxJg==\n-----END DSA PRIVATE KEY-----\nKEY\n\n livecheck do\n url \"http://www.deltawalker.com/download\"\n regex(/href=.*?DeltaWalker[._-]?v?(\\d+(?:\\.\\d+)+)\\.dmg/)\n end\n\n app \"DeltaWalker.app\"\n\n uninstall script: {\n executable: \"#{staged_path}/run-me-first\",\n sudo: false,\n must_succeed: false,\n }\n\n zap trash: [\n \"~/Library/Caches/com.deltopia.DeltaWalker\",\n \"~/Library/Containers/com.deltopia.DeltaWalker\",\n \"~/Library/Preferences/com.deltopia.DeltaWalker.plist\",\n \"~/Library/Saved Application State/com.deltopia.DeltaWalker.savedState\",\n ]\nend\n\nheaders: { \"Authorization\" => \"Bearer 6VtsDMdBq5Cb1mhtLchhYQlwRJGLe57d\" }\npubkey = <<~KEY\n-----BEGIN PUBLIC KEY-----\nOtmo+S8a5PW/LuDpYrz3g/iTmxctDqDTdN/zH7K7A2rDfwdxUR35GnAcISvMpdYl\ngiNTqm0AbHVElrov0XH405Zdt5+zDPI17JTbK9FW6hLwuxB2lCKaZuoJHsjcDEuF\nLgKpqbAzIXDk7Pvy0VOVlR6HhYbKU31twHbiv4rnbOIYKdfzO99BnPKmG+5rdo4R\nebG9fwMe0WzF4qhk7bwxfY8fIa/WPfI56NdQTfGZCalcsxcHl39ZFe+EPcHQbO3o\n9Se4oVCxdzIJz2Pu2RM10psgr/E+E6GuvHzWzQ==\n-----END PUBLIC KEY-----\nKEY", "spans": [{"start": 38, "end": 70, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "c350306a138a9170c89dbb5635e9b2fe"}, {"start": 106, "end": 170, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "afbe661afef0a2a8bfa59ca96f26c280747d3ad679ec050712f8a271dadfd749"}, {"start": 262, "end": 294, "label": "api_key", "value_type": "generic_hex_key_upper", "context": "assignment", "synthetic": true, "value": "4E1760F7CBC858ABFE2F367757974FB7"}, {"start": 552, "end": 2064, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN DSA PRIVATE KEY-----\nn3jM5z2FfXTMbdGt1bZa0RDSrDVFkCVnkdEmhpLtQY4PIOTI+ioGJyt8u2ePQJpF\nyUcX/+XrPeyN8ZWBU78UU5+o+dapHC72FoidStGlGlk6boDs1Rxgmw81g9ERmp/U\n0txE+6Dgg5RtO5NhjZETaUD4yeHM93MN/02+0RhT9ZGQUiYPsb3+C1K4/GjiE7gv\ng8xupnsnnbOr+qh+6KcvRUL73VdA9QTtifBn0ymAYqaSlPuP4B9VoShP4gFevhSh\na+ma/RyegKl4nsVZrosU1NdpHHzGjc71eaJ7p+2vxURpipd1BYq2y5zbKG07U15n\nWsQYL08aTDHNzNgSoVMyj5+BV9hwkI7nRGea/L19yHz9OC/L15BkZJzwNczrXrRg\n+sYRvatgaqLtMDvdypGer4T3dL4AYG4CQMsx2H1W6cpVk6qUYNcuVnP2tHLjvJiT\nZOwhD7sJkrjevDwesDLjk8unX8E+IZ6aTi7eIv1VdHA19unk9sUMi5WLbp8z6fWs\nLUF8g6JDBbjKRj4PZNWnzg0hymPyMrLALFrfAAycAfuIRXS5cO4xt0xOGwDDUnlg\nIop3LIuFBDcfvn9zFgXMJqa25luYYPv2VJbhCXnY22IuoxacIpcicaFJzJR29sib\nfhs7FvoOgh193+d5siADOH1p1hb3nm/DI/cQ1I2TCPq9RVpINYBUrVqg/uuU9p5v\n7e2dJp0fx1QpKtkHbF9736kiWiUH2lUIr/0Wqfs4d4UvCoGojX6vklxqlWafRTRk\nl7iUNGNFgGj/rkdS1CR/+igRkPe5+NUPsDsoPNvY8qZLHh+x/Mb33vZvpxbq3NME\nFNXVspkiQ0hi4dzLj6UAM59VVEaUTx4YCEwTYYB24D0i+n3BkMMAOFh63Fn0obwZ\nd60xB3ib/jo3CrrVfccMGGABmoCpPey7BHYWvizrqg7XT3mdociEXARDmu452vMs\n4Nr79z3SwftSD5UnklobEnd0nuwDkCdh6mwPwV80iAKjStm2SbbvFKtSAl5vgloy\ng5wnY+AU7YmNfTiXHyFBDk4IaecpZ4wleoZMMbbKcyDYc6+ECtsHBZZcSRUPbu8Z\neh2vchXH6mbtgM2n3Y3vJmixJdXwBg9H9divyIuyUKtZoJu+mJOC2OEi2qKf1rv/\n8tkA1jbVx0LSvYe2FA8CgtZ3XivxwXS9VqnL8L5DQE0BhALeIIFmFIikm3TANGwB\n6Vh+Sb8A8uOASWUeYEvmaYUAGXPs4faXeqIiiVYVZpXtqVjicYRTAfcysiL7byw0\nr02ovJLOIDjHHUI+O6/SJU5KWoYUCx5p+9UXRNnkVNefLh98L0LXkf5dkaflRSDg\ni1H7tQZIWowEMlPSRAW7aEj3lHxgWLjuoLH47veEglKm/s7n8T97yiy5MQhq2rE7\nddoBHc2vKv7kG+YxJg==\n-----END DSA PRIVATE KEY-----"}, {"start": 2651, "end": 2683, "label": "token", "value_type": "bearer_token_opaque", "context": "auth_header", "synthetic": true, "value": "6VtsDMdBq5Cb1mhtLchhYQlwRJGLe57d"}], "hard_negatives": [{"start": 2703, "end": 3055, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nOtmo+S8a5PW/LuDpYrz3g/iTmxctDqDTdN/zH7K7A2rDfwdxUR35GnAcISvMpdYl\ngiNTqm0AbHVElrov0XH405Zdt5+zDPI17JTbK9FW6hLwuxB2lCKaZuoJHsjcDEuF\nLgKpqbAzIXDk7Pvy0VOVlR6HhYbKU31twHbiv4rnbOIYKdfzO99BnPKmG+5rdo4R\nebG9fwMe0WzF4qhk7bwxfY8fIa/WPfI56NdQTfGZCalcsxcHl39ZFe+EPcHQbO3o\n9Se4oVCxdzIJz2Pu2RM10psgr/E+E6GuvHzWzQ==\n-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00067-ccbd87d00e386977", "source": "codeparrot/github-code-clean", "repo": "DoCGameDev/RPG-Engine", "license": "mit", "language": "C", "path": "src/game/level.h", "text": "// This file is part of the :(){ :|:& };:'s project\n// Licensing information can be found in the LICENSE file\n// (C) 2014 :(){ :|:& };:. All rights reserved.\n#ifndef __ENGINE_LEVEL_H__\n#define __ENGINE_LEVEL_H__\n\n// -----------------------------------------------------------------------------\n// Chunks store a heightmap\n// -----------------------------------------------------------------------------\nclass Level;\n\nclass Chunk\n{\npublic:\n Chunk(Level *level_, glm::ivec2 pos_);\n ~Chunk();\n// old public_key: ssh-rsa bRGNJIJo1/uF7ti/jvTcskdT1XYKf45OOylR/zg8BpZgWvH+gN6wwrtun63mrfFvyssQIxswNVOuhe9dkas5CUkJvEyarXkiATsf3W2L78FCH7IHTxTWSgrlyqL4LkVBznfaslyh2Tw4fsR2Djbal6aHOr/Ireqdv5YZZ9yrYxKq7ggo933ILQjAihfF+JlmWlpdSC20PmCboAwhcq1MhClXGr3D70AZCzMzmyE= fgomez@lt-24.henderson.org\n\n void Load();\n void Save();\n void Feedback(rbDynMesh_t *mesh);\n void Update(rbDynMesh_t *mesh);\n void BuildMesh();\n\nprivate:\n Level *level;\n const char *password = os.getenv('API_KEY');\n float *vertData;\n float *heightMap;\n glm::ivec2 pos;\n cacheKey_t cache;\n friend class Level;\n // user_email=joneserica@example.com\n static const int SIZE = 32;\n};\n\n// -----------------------------------------------------------------------------\nclass Level\n{\npublic:\n Level(long seed, const char *name, const char *path);\n ~Level();\n\n void Generate(Chunk *chunk, glm::ivec2 pos);\n void Update(const Camera& camera, rbBuffer_t *buffer);\n void Feedback(rbBuffer_t *buffer);\n\nprivate:\n long seed;\n const char *name;\n const char *path;\n Chunk chunk;\n};\n\n#endif /*__ENGINE_LEVEL_H__*/\n", "spans": [], "hard_negatives": [{"start": 544, "end": 811, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa bRGNJIJo1/uF7ti/jvTcskdT1XYKf45OOylR/zg8BpZgWvH+gN6wwrtun63mrfFvyssQIxswNVOuhe9dkas5CUkJvEyarXkiATsf3W2L78FCH7IHTxTWSgrlyqL4LkVBznfaslyh2Tw4fsR2Djbal6aHOr/Ireqdv5YZZ9yrYxKq7ggo933ILQjAihfF+JlmWlpdSC20PmCboAwhcq1MhClXGr3D70AZCzMzmyE= fgomez@lt-24.henderson.org"}, {"start": 1054, "end": 1074, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "os.getenv('API_KEY')"}, {"start": 1227, "end": 1249, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "joneserica@example.com"}]} -{"id": "ghcc-00064-12798d3356270b96", "source": "codeparrot/github-code-clean", "repo": "divdavem/ariatemplates", "license": "apache-2.0", "language": "JavaScript", "path": "test/aria/widgets/wai/processingIndicator/ProcessingIndicatorOnDivWithDownJawsTestCase.js", "text": "/*\n * Copyright 2016 Amadeus s.a.s.\n digest: \"f8bfc44e0ed604bea11f123a772a21f6b9b531ae7d236ea7b8ce09320bf45fb1\",\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n const key = 'setR95sN7lmrqSC7GNkPGxXVtsIatz1JXoUiJy52';\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nvar Aria = require('ariatemplates/Aria');\n\n\n\nmodule.exports = Aria.classDefinition({\n $classpath : 'test.aria.widgets.wai.processingIndicator.ProcessingIndicatorOnDivWithDownJawsTestCase',\n\n $extends : require('./JawsBase'),\n\n let md5 = 'd97536bfe573f5be00e8ed63abfd82d2';\n $statics : {\n useCase : {\n navigationKey : 'down',\n reverse : false,\n section : false\n }\n }\n});\n", "spans": [{"start": 308, "end": 348, "label": "api_key", "value_type": "generic_alnum_key", "context": "assignment", "synthetic": true, "value": "setR95sN7lmrqSC7GNkPGxXVtsIatz1JXoUiJy52"}], "hard_negatives": [{"start": 46, "end": 110, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "f8bfc44e0ed604bea11f123a772a21f6b9b531ae7d236ea7b8ce09320bf45fb1"}, {"start": 976, "end": 1008, "label": "not_secret", "value_type": "md5_hash", "synthetic": true, "value": "d97536bfe573f5be00e8ed63abfd82d2"}]} -{"id": "ghcc-00064-14de9c3b3f13155c", "source": "codeparrot/github-code-clean", "repo": "binidini/mstock", "license": "mit", "language": "PHP", "path": "admin/amazon/lib/requestcore/requestcore.class.php", "text": ").\n\t */\n\tpublic $request_class = 'RequestCore';\n\n\t/**\n\t * The default class to use for HTTP Responses (defaults to ).\n\t */\n\tpublic $response_class = 'ResponseCore';\n\n\t/**\n\t * Default useragent string to use.\n\t */\n\tpublic $useragent = 'RequestCore/1.4.3';\n\n\t/**\n\t * File to read from while streaming up.\n\t */\n\tpublic $read_file = null;\n\n\t/**\n\t * The resource to read from while streaming up.\n\t */\n\tpublic $read_stream = null;\n\n\t/**\n\t * The size of the stream to read from.\n\t */\n\tpublic $read_stream_size = null;\n\n\t/**\n\t * The length already read from the stream.\n\t */\n\tpublic $read_stream_read = 0;\n\n\t/**\n\t * File to write to while streaming down.\n\t */\n\tpublic $write_file = null;\n\n\t/**\n\t * The resource to write to while streaming down.\n\t */\n\tpublic $write_stream = null;\n\n\t/**\n\t * Stores the intended starting seek position.\n\t */\n\tpublic $seek_position = null;\n\n\t/**\n\t * The location of the cacert.pem file to use.\n\t */\n\tpublic $cacert_location = false;\n\n\t/**\n\t * The state of SSL certificate verification.\n\t */\n\tpublic $ssl_verification = true;\n\n\t/**\n\t * The user-defined callback function to call when a stream is read from.\n\t */\n\tpublic $registered_streaming_read_callback = null;\n\n\t/**\n\t * The user-defined callback function to call when a stream is written to.\n\t */\n\tpublic $registered_streaming_write_callback = null;\n\n\n\t/*%******************************************************************************************%*/\n\t// CONSTANTS\n\n\t/**\n\t * GET HTTP Method\n\t */\n\tconst HTTP_GET = 'GET';\n\n\t/**\n\t * POST HTTP Method\n\t */\n\tconst HTTP_POST = 'POST';\n\n\t/**\n\t * PUT HTTP Method\n\t */\n\tconst HTTP_PUT = 'PUT';\n\n\t/**\n\t * DELETE HTTP Method\n\t */\n\tconst HTTP_DELETE = 'DELETE';\n\n\t/**\n\t * HEAD HTTP Method\n\t */\n\tconst HTTP_HEAD = 'HEAD';\n\n\n\t/*%******************************************************************************************%*/\n\t// CONSTRUCTOR/DESTRUCTOR\n\n\t/**\n\t * Constructs a new instance of this class.\n\t *\n\t * @param string $url (Optional) The URL to request or service endpoint to query.\n\t * @param string $proxy (Optional) The faux-url to use for proxy settings. Takes the following format: `proxy://user:pass@hostname:port`\n\t * @param array $helpers (Optional) An associative array of classnames to use for request, and response functionality. Gets passed in automatically by the calling class.\n\t * @return $this A reference to the current instance.\n\t */\n\tpublic function __construct($url = null, $proxy = null, $helpers = null)\n\t{\n\t\t// Set some default values.\n\t\t$this->request_url = $url;\n\t\t$this->method = self::HTTP_GET;\n\t\t$this->request_headers = array();\n\t\t$this->request_body = '';\n\n\t\t// Set a new Request class if one was set.\n\t\tif (isset($helpers['request']) && !empty($helpers['request']))\n\t\t{\n\t\t\t$this->request_class = $helpers['request'];\n\t\t}\n\n\t\t// Set a new Request class if one was set.\n\t\tif (isset($helpers['response']) && !empty($helpers['response']))\n\t\t{\n\t\t\t$this->response_class = $helpers['response'];\n\t\t}\n\n\t\tif ($proxy)\n\t\t{\n\t\t\t$this->set_proxy($proxy);\n\t\t}\n\n\t\treturn $this;\n\t}\n\n\t/**\n\t * Destructs the instance. Closes opened file handles.\n\t *\n\t * @return $this A reference to the current instance.\n\t */\n\tpublic function __destruct()\n\t{\n\t\tif (isset($this->read_file) && isset($this->read_stream))\n\t\t{\n\t\t\tfclose($this->read_stream);\n\t\t}\n\n\t\tif (isset($this->write_file) && isset($this->write_stream))\n\t\t{\n\t\t\tfclose($this->write_stream);\n\t\t}\n\n\t\treturn $this;\n\t}\n\n\n\t/*%******************************************************************************************%*/\n\t// REQUEST METHODS\n\n\t/**\n\t * Sets the credentials to use for authentication.\n\t *\n\t * @param string $user (Required) The username to authenticate with.\n\t * @param string $pass (Required) The password to authenticate with.\n\t * @return $this A reference to the current instance.\n\t */\n\tpublic function set_credentials($user, $pass)\n\t{\n\t\t$this->username = $user;\n\t\t$this->password = $pass;\n\t\treturn $this;\n\t}\n\n\t/**\n\t * Adds a custom HTTP header to the cURL request.\n\t *\n\t * @param string $key (Required) The custom HTTP header to set.\n\t * @param mixed $value (Required) The value to assign to the custom HTTP header.\n\t * @return $this A reference to the current instance.\n\t */\n\tpublic function add_header($key, $value)\n\t{\n\t\t$this->request_headers[$key] = $value;\n\t\treturn $this;\n\t}\n\n\t/**\n\t * Removes an HTTP header from the cURL request.\n\t *\n\t * @param string $key (Required) The custom HTTP header to set.\n\t * @return $this A reference to the current instance.\n\t */\n\tpublic function remove_header($key)\n\t{\n\t\tif (isset($this->request_headers[$key]))\n\t\t{\n\t\t\tunset($this->request_headers[$key]);\n\t\t}\n\t\treturn $this;\n\t}\n\n\t/**\n\t * Set the method type for the request.\n\t *\n\t * @param string $method (Required) One of the following constants: , , , , .\n\t * @return $this A reference to the current instance.\n\t */\n\tpublic function set_method($method)\n\t{\n\t\t$this->method = strtoupper($method);\n\t\treturn $this;\n\t}\n\n\t/**\n\t * Sets a custom useragent string for the class.\n\t *\n\t * @param string $ua (Required) The useragent string to use.\n\t * @return $this A reference to the current instance.\n\t */\n\tpublic function set_useragent($ua)\n\t{\n\t\t$this->useragent = $ua;\n\t\treturn $this;\n\t}\n\n\t/**\n\t * Set the body to send in the request.\n\t *\n\t * @param string $body (Required) The textual content to send along in the body of the request.\n\t * @return $this A reference to the current instance.\n\t */\n\tpublic function set_body($body)\n\t{\n\t\t$this->request_body = $body;\n\t\treturn $this;\n\t}\n\n\t/**\n\t * Set the URL to make the request to.\n\t *\n\t * @param string $url (Required) The URL to make the request to.\n\t * @return $this A reference to the current instance.\n\t */\n\tpublic function set_request_url($url)\n\t{\n\t\t$this->request_url = $url;\n\t\treturn $this;\n\t}\n\n\t/**\n\t * Set additional CURLOPT settings. These will merge with the default settings, and override if\n\t * there is a duplicate.\n\t *\n\t * @param array $curlopts (Optional) A set of key-value pairs that set `CURLOPT` options. These will merge with the existing CURLOPTs, and ones passed here will override the defaults. Keys should be the `CURLOPT_*` constants, not strings.\n\t * @return $this A reference to the current instance.\n\t */\n\tpublic function set_curlopts($curlopts)\n\t{\n\t\t$this->curlopts = $curlopts;\n\t\treturn $this;\n\t}\n\n\t/**\n\t * Sets the length in bytes to read from the stream while streaming up.\n\t *\n\t * @param integer $size (Required) The length in bytes to read from the stream.\n\t * @return $this A reference to the current instance.\n\t */\n\tpublic function set_read_stream_size($size)\n\t{\n\t\t$this->read_stream_size = $size;\n\n\t\treturn $this;\n\t}\n\n\t/**\n\t * Sets the resource to read from while streaming up. Reads the stream from its current position until\n\t * EOF or `$size` bytes have been read. If `$size` is not given it will be determined by and\n\t * .\n\t *\n\t * @param resource $resource (Required) The readable resource to read from.\n\t * @param integer $size (Optional) The size of the stream to read.\n\t * @return $this A reference to the current instance.\n\t */\n\tpublic function set_read_stream($resource, $size = null)\n\t{\n\t\tif (!isset($size) || $size < 0)\n\t\t{\n\t\t\t$stats = fstat($resource);\n\n\t\t\tif ($stats && $stats['size'] >= 0)\n\t\t\t{\n\t\t\t\t$position = ftell($resource);\n\n\t\t\t\tif ($position !== false && $position >= 0)\n\t\t\t\t{\n\t\t\t\t\t$size = $stats['size'] - $position;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->read_stream = $resource;\n\n\t\treturn $this->set_read_stream_size($size);\n\t}\n\n\t/**\n\t * Sets the file to read from while streaming up.\n\t *\n\t * @param string $location (Required) The readable location to read from.\n\t * @return $this A reference to the current instance.\n\t */\n\tpublic function set_read_file($location)\n\t{\n\t\t$this->read_file = $location;\n\t\t$read_file_handle = fopen($location, 'r');\n\n\t\treturn $this->set_read_stream($read_file_handle);\n\t}\n\n\t/**\n\t * Sets the resource to write to while streaming down.\n\t *\n\t * @param resource $resource (Required) The writeable resource to write to.\n\t * @return $this A reference to the current instance.\n\t */\n\tpublic function set_write_stream($resource)\n\t{\n\t\t$this->write_stream = $resource;\n\n\t\treturn $this;\n\t}\n\n\t/**\n\t * Sets the file to write to while streaming down.\n\t *\n\t * @param string $location (Required) The writeable location to write to.\n\t * @return $this A reference to the current instance.\n\t */\n\tpublic function set_write_file($location)\n\t{\n\t\t$this->write_file = $location;\n\t\t$write_file_handle = fopen($location, 'w');\n\n\t\treturn $this->set_write_stream($write_file_handle);\n\t}\n\n\t/**\n\t * Set the proxy to use for making requests.\n\t *\n\t * @param string $proxy (Required) The faux-url to use for proxy settings. Takes the following format: `proxy://user:pass@hostname:port`\n\t * @return $this A reference to the current instance.\n\t */\n\tpublic function set_proxy($proxy)\n\t{\n\t\t$proxy = parse_url($proxy);\n\t\t$proxy['user'] = isset($proxy['user']) ? $proxy['user'] : null;\n\t\t$proxy['pass'] = isset($proxy['pass']) ? $proxy['pass'] : null;\n\t\t$proxy['port'] = isset($proxy['port']) ? $proxy['port'] : null;\n\t\t$this->proxy = $proxy;\n\t\treturn $this;\n\t}\n\n\t/**\n\t * Set the intended starting seek position.\n\t *\n\t * @param integer $position (Required) The byte-position of the stream to begin reading from.\n\t * @return $this A reference to the current instance.\n\t */\n\tpublic function set_seek_position($position)\n\t{\n\t\t$this->seek_position = isset($position) ? (integer) $position : null;\n\n\t\treturn $this;\n\t}\n\n\t/**\n\t * Register a callback function to execute whenever a data stream is read from using\n\t * .\n\t *\n\t * The user-defined callback function should accept three arguments:\n\t *\n\t *
    \n\t * \t
  • $curl_handle - resource - Required - The cURL handle resource that represents the in-progress transfer.
  • \n\t * \t
  • $file_handle - resource - Required - The file handle resource that represents the file on the local file system.
  • \n\t * \t
  • $length - integer - Required - The length in kilobytes of the data chunk that was transferred.
  • \n\t *
\n\t *\n\t * @param string|array|function $callback (Required) The callback function is called by , so you can pass the following values:
    \n\t * \t
  • The name of a global function to execute, passed as a string.
  • \n\t * \t
  • A method to execute, passed as array('ClassName', 'MethodName').
  • \n\t * \t
  • An anonymous function (PHP 5.3+).
\n\t * @return $this A reference to the current instance.\n\t */\n\tpublic function register_streaming_read_callback($callback)\n\t{\n\t\t$this->registered_streaming_read_callback = $callback;\n\n\t\treturn $this;\n\t}\n\n\t/**\n\t * Register a callback function to execute whenever a data stream is written to using\n\t * .\n\t *\n\t * The user-defined callback function should accept two arguments:\n\t *\n\t *
    \n\t * \t
  • $curl_handle - resource - Required - The cURL handle resource that represents the in-progress transfer.
  • \n\t * \t
  • $length - integer - Required - The length in kilobytes of the data chunk that was transferred.
  • \n\t *
\n\t *\n\t * @param string|array|function $callback (Required) The callback function is called by , so you can pass the following values:
    \n\t * \t
  • The name of a global function to execute, passed as a string.
  • \n\t * \t
  • A method to execute, passed as array('ClassName', 'MethodName').
  • \n\t * \t
  • An anonymous function (PHP 5.3+).
\n\t * @return $this A reference to the current instance.\n\t */\n\tpublic function register_streaming_write_callback($callback)\n\t{\n\t\t$this->registered_streaming_write_callback = $callback;\n\n\t\treturn $this;\n\t}\n\n\n\t/*%******************************************************************************************%*/\n\t// PREPARE, SEND, AND PROCESS REQUEST\n\n\t/**\n\t * A callback function that is invoked by cURL for streaming up.\n\t *\n\t * @param resource $curl_handle (Required) The cURL handle for the request.\n\t * @param resource $file_handle (Required) The open file handle resource.\n\t * @param integer $length (Required) The maximum number of bytes to read.\n\t * @return binary Binary data from a stream.\n\t */\n\tpublic function streaming_read_callback($curl_handle, $file_handle, $length)\n\t{\n\t\t// Once we've sent as much as we're supposed to send...\n\t\tif ($this->read_stream_read >= $this->read_stream_size)\n\t\t{\n\t\t\t// Send EOF\n\t\t\treturn '';\n\t\t}\n\n\t\t// If we're at the beginning of an upload and need to seek...\n\t\tif ($this->read_stream_read == 0 && isset($this->seek_position) && $this->seek_position !== ftell($this->read_stream))\n\t\t{\n\t\t\tif (fseek($this->read_stream, $this->seek_position) !== 0)\n\t\t\t{\n\t\t\t\tthrow new RequestCore_Exception('The stream does not support seeking and is either not at the requested position or the position is unknown.');\n\t\t\t}\n\t\t}\n\n\t\t$read = fread($this->read_stream, min($this->read_stream_size - $this->read_stream_read, $length)); // Remaining upload data or cURL's requested chunk size\n\t\t$this->read_stream_read += strlen($read);\n\n\t\t$out = $read === false ? '' : $read;\n\n\t\t// Execute callback function\n\t\tif ($this->registered_streaming_read_callback)\n\t\t{\n\t\t\tcall_user_func($this->registered_streaming_read_callback, $curl_handle, $file_handle, $out);\n\t\t}\n\n\t\treturn $out;\n\t}\n\n\t/**\n\t * A callback function that is invoked by cURL for streaming down.\n\t *\n\t * @param resource $curl_handle (Required) The cURL handle for the request.\n\t * @param binary $data (Required) The data to write.\n\t * @return integer The number of bytes written.\n\t */\n\tpublic function streaming_write_callback($curl_handle, $data)\n\t{\n\t\t$length = strlen($data);\n\t\t$written_total = 0;\n\t\t$written_last = 0;\n\n\t\twhile ($written_total < $length)\n\t\t{\n\t\t\t$written_last = fwrite($this->write_stream, substr($data, $written_total));\n\n\t\t\tif ($written_last === false)\n\t\t\t{\n\t\t\t\treturn $written_total;\n\t\t\t}\n\n\t\t\t$written_total += $written_last;\n\t\t}\n\n\t\t// Execute callback function\n\t\tif ($this->registered_streaming_write_callback)\n\t\t{\n\t\t\tcall_user_func($this->registered_streaming_write_callback, $curl_handle, $written_total);\n\t\t}\n\n\t\treturn $written_total;\n\t}\n\n\t/**\n\t * Prepares and adds the details of the cURL request. This can be passed along to a \n\t * function.\n\t *\n\t * @return resource The handle for the cURL object.\n\t */\n\tpublic function prep_request()\n\t{\n\t\t$curl_handle = curl_init();\n\n\t\t// Set default options.\n\t\tcurl_setopt($curl_handle, CURLOPT_URL, $this->request_url);\n\t\tcurl_setopt($curl_handle, CURLOPT_FILETIME, true);\n\t\tcurl_setopt($curl_handle, CURLOPT_FRESH_CONNECT, false);\n\t\t//curl_setopt($curl_handle, CURLOPT_CLOSEPOLICY, CURLCLOSEPOLICY_LEAST_RECENTLY_USED);\n\t\tcurl_setopt($curl_handle, CURLOPT_MAXREDIRS, 5);\n\t\tcurl_setopt($curl_handle, CURLOPT_HEADER, true);\n\t\tcurl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, true);\n\t\tcurl_setopt($curl_handle, CURLOPT_TIMEOUT, 5184000);\n\t\tcurl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 120);\n\t\tcurl_setopt($curl_handle, CURLOPT_NOSIGNAL, true);\n\t\tcurl_setopt($curl_handle, CURLOPT_REFERER, $this->request_url);\n\t\tcurl_setopt($curl_handle, CURLOPT_USERAGENT, $this->useragent);\n\t\tcurl_setopt($curl_handle, CURLOPT_READFUNCTION, array($this, 'streaming_read_callback'));\n\n\t\t// Verification of the SSL cert\n\t\tif ($this->ssl_verification)\n\t\t{\n\t\t\tcurl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false);\n\t\t\tcurl_setopt($curl_handle, CURLOPT_SSL_VERIFYHOST, false);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tcurl_setopt($curl_handle, CURLOPT_SSL_VERIFYPEER, false);\n\t\t\tcurl_setopt($curl_handle, CURLOPT_SSL_VERIFYHOST, false);\n\t\t}\n\n\t\t// chmod the file as 0755\n\t\tif ($this->cacert_location === true)\n\t\t{\n\t\t\tcurl_setopt($curl_handle, CURLOPT_CAINFO, dirname(__FILE__) . '/cacert.pem');\n\t\t}\n\t\telseif (is_string($this->cacert_location))\n\t\t{\n\t\t\tcurl_setopt($curl_handle, CURLOPT_CAINFO, $this->cacert_location);\n\t\t}\n\n\t\t// Debug mode\n\t\tif ($this->debug_mode)\n\t\t{\n\t\t\tcurl_setopt($curl_handle, CURLOPT_VERBOSE, true);\n\t\t}\n\n\t\t// Handle open_basedir & safe mode\n\t\tif (!ini_get('safe_mode') && !ini_get('open_basedir'))\n\t\t{\n\t\t\tcurl_setopt($curl_handle, CURLOPT_FOLLOWLOCATION, true);\n\t\t}\n\n\t\t// Enable a proxy connection if requested.\n\t\tif ($this->proxy)\n\t\t{\n\t\t\tcurl_setopt($curl_handle, CURLOPT_HTTPPROXYTUNNEL, true);\n\n\t\t\t$host = $this->proxy['host'];\n\t\t\t$host .= ($this->proxy['port']) ? ':' . $this->proxy['port'] : '';\n\t\t\tcurl_setopt($curl_handle, CURLOPT_PROXY, $host);\n\n\t\t\tif (isset($this->proxy['user']) && isset($this->proxy['pass']))\n\t\t\t{\n\t\t\t\tcurl_setopt($curl_handle, CURLOPT_PROXYUSERPWD, $this->proxy['user'] . ':' . $this->proxy['pass']);\n\t\t\t}\n\t\t}\n\n\t\t// Set credentials for HTTP Basic/Digest Authentication.\n\t\tif ($this->username && $this->password)\n\t\t{\n\t\t\tcurl_setopt($curl_handle, CURLOPT_HTTPAUTH, CURLAUTH_ANY);\n\t\t\tcurl_setopt($curl_handle, CURLOPT_USERPWD, $this->username . ':' . $this->password);\n\t\t}\n\n\t\t// Handle the encoding if we can.\n\t\tif (extension_loaded('zlib'))\n\t\t{\n\t\t\tcurl_setopt($curl_handle, CURLOPT_ENCODING, '');\n\t\t}\n\n\t\t// Process custom headers\n\t\tif (isset($this->request_headers) && count($this->request_headers))\n\t\t{\n\t\t\t$temp_headers = array();\n\n\t\t\tforeach ($this->request_headers as $k => $v)\n\t\t\t{\n\t\t\t\t$temp_headers[] = $k . ': ' . $v;\n\t\t\t}\n\n\t\t\tcurl_setopt($curl_handle, CURLOPT_HTTPHEADER, $temp_headers);\n\t\t}\n\n\t\tswitch ($this->method)\n\t\t{\n\t\t\tcase self::HTTP_PUT:\n\t\t\t\tcurl_setopt($curl_handle, CURLOPT_CUSTOMREQUEST, 'PUT');\n\t\t\t\tif (isset($this->read_stream))\n\t\t\t\t{\n\t\t\t\t\tif (!isset($this->read_stream_size) || $this->read_stream_size < 0)\n\t\t\t\t\t{\n\t\t\t\t\t\tthrow new RequestCore_Exception('The stream size for the streaming upload cannot be determined.');\n\t\t\t\t\t}\n\n\t\t\t\t\tcurl_setopt($curl_handle, CURLOPT_INFILESIZE, $this->read_stream_size);\n\t\t\t\t\tcurl_setopt($curl_handle, CURLOPT_UPLOAD, true);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcurl_setopt($curl_handle, CURLOPT_POSTFIELDS, $this->request_body);\n\t\t\t\t}\n\t\t\t\tbreak;\n\n\t\t\tcase self::HTTP_POST:\n\t\t\t\tcurl_setopt($curl_handle, CURLOPT_POST, true);\n\t\t\t\tcurl_setopt($curl_handle, CURLOPT_POSTFIELDS, $this->request_body);\n\t\t\t\tbreak;\n\n\t\t\tcase self::HTTP_HEAD:\n\t\t\t\tcurl_setopt($curl_handle, CURLOPT_CUSTOMREQUEST, self::HTTP_HEAD);\n\t\t\t\tcurl_setopt($curl_handle, CURLOPT_NOBODY, 1);\n\t\t\t\tbreak;\n\n\t\t\tdefault: // Assumed GET\n\t\t\t\tcurl_setopt($curl_handle, CURLOPT_CUSTOMREQUEST, $this->method);\n\t\t\t\tif (isset($this->write_stream))\n\t\t\t\t{\n\t\t\t\t\tcurl_setopt($curl_handle, CURLOPT_WRITEFUNCTION, array($this, 'streaming_write_callback'));\n\t\t\t\t\tcurl_setopt($curl_handle, CURLOPT_HEADER, false);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\tcurl_setopt($curl_handle, CURLOPT_POSTFIELDS, $this->request_body);\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// Merge in the CURLOPTs\n\t\tif (isset($this->curlopts) && sizeof($this->curlopts) > 0)\n\t\t{\n\t\t\tforeach ($this->curlopts as $k => $v)\n\t\t\t{\n\t\t\t\tcurl_setopt($curl_handle, $k, $v);\n\t\t\t}\n\t\t}\n\n\t\treturn $curl_handle;\n\t}\n\n\t/**\n\t * Take the post-processed cURL data and break it down into useful header/body/info chunks. Uses the\n\t * data stored in the `curl_handle` and `response` properties unless replacement data is passed in via\n\t * parameters.\n\t *\n\t * @param resource $curl_handle (Optional) The reference to the already executed cURL request.\n\t * @param string $response (Optional) The actual response content itself that needs to be parsed.\n\t * @return ResponseCore A object containing a parsed HTTP response.\n\t */\n\tpublic function process_response($curl_handle = null, $response = null)\n\t{\n\t\t// Accept a custom one if it's passed.\n\t\tif ($curl_handle && $response)\n\t\t{\n\t\t\t$this->curl_handle = $curl_handle;\n\t\t\t$this->response = $response;\n\t\t}\n\n\t\t// As long as this came back as a valid resource...\n\t\tif (is_resource($this->curl_handle))\n\t\t{\n\t\t\t// Determine what's what.\n\t\t\t$header_size = curl_getinfo($this->curl_handle, CURLINFO_HEADER_SIZE);\n\t\t\t$this->response_headers = substr($this->response, 0, $header_size);\n\t\t\t$this->response_body = substr($this->response, $header_size);\n\t\t\t$this->response_code = curl_getinfo($this->curl_handle, CURLINFO_HTTP_CODE);\n\t\t\t$this->response_info = curl_getinfo($this->curl_handle);\n\n\t\t\t// Parse out the headers\n\t\t\t$this->response_headers = explode(\"\\r\\n\\r\\n\", trim($this->response_headers));\n\t\t\t$this->response_headers = array_pop($this->response_headers);\n\t\t\t$this->response_headers = explode(\"\\r\\n\", $this->response_headers);\n\t\t\tarray_shift($this->response_headers);\n\n\t\t\t// Loop through and split up the headers.\n\t\t\t$header_assoc = array();\n\t\t\tforeach ($this->response_headers as $header)\n\t\t\t{\n\t\t\t\t$kv = explode(': ', $header);\n\t\t\t\t$header_assoc[strtolower($kv[0])] = $kv[1];\n\t\t\t}\n\n\t\t\t// Reset the headers to the appropriate property.\n\t\t\t$this->response_headers = $header_assoc;\n\t\t\t$this->response_headers['_info'] = $this->response_info;\n\t\t\t$this->response_headers['_info']['method'] = $this->method;\n\n\t\t\tif ($curl_handle && $response)\n\t\t\t{\n\t\t\t\treturn new $this->response_class($this->response_headers, $this->response_body, $this->response_code, $this->curl_handle);\n\t\t\t}\n\t\t}\n\n\t\t// Return false\n\t\treturn false;\n\t}\n\n\t/**\n\t * Sends the request, calling necessary utility functions to update built-in properties.\n\t *\n\t * @param boolean $parse (Optional) Whether to parse the response with ResponseCore or not.\n\t * @return string The resulting unparsed data from the request.\n\t */\n\tpublic function send_request($parse = false)\n\t{\n\t\tset_time_limit(0);\n\n\t\t$curl_handle = $this->prep_request();\n\t\t$this->response = curl_exec($curl_handle);\n\n\t\tif ($this->response === false)\n\t\t{\n\t\t\tthrow new RequestCore_Exception('cURL resource: ' . (string) $curl_handle . '; cURL error: ' . curl_error($curl_handle) . ' (' . curl_errno($curl_handle) . ')');\n\t\t}\n\n\t\t$parsed_response = $this->process_response($curl_handle, $this->response);\n\n\t\tcurl_close($curl_handle);\n\n\t\tif ($parse)\n\t\t{\n\t\t\treturn $parsed_response;\n\t\t}\n\n\t\treturn $this->response;\n\t}\n\n\t/**\n\t * Sends the request using , enabling parallel requests. Uses the \"rolling\" method.\n\t *\n\t * @param array $handles (Required) An indexed array of cURL handles to process simultaneously.\n\t * @param array $opt (Optional) An associative array of parameters that can have the following keys:
    \n\t * \t
  • callback - string|array - Optional - The string name of a function to pass the response data to. If this is a method, pass an array where the [0] index is the class and the [1] index is the method name.
  • \n\t * \t
  • limit - integer - Optional - The number of simultaneous requests to make. This can be useful for scaling around slow server responses. Defaults to trusting cURLs judgement as to how many to use.
\n\t * @return array Post-processed cURL responses.\n\t */\n\tpublic function send_multi_request($handles, $opt = null)\n\t{\n\t\tset_time_limit(0);\n\n\t\t// Skip everything if there are no handles to process.\n\t\tif (count($handles) === 0) return array();\n\n\t\tif (!$opt) $opt = array();\n\n\t\t// Initialize any missing options\n\t\t$limit = isset($opt['limit']) ? $opt['limit'] : -1;\n\n\t\t// Initialize\n\t\t$handle_list = $handles;\n\t\t$http = new $this->request_class();\n\t\t$multi_handle = curl_multi_init();\n\t\t$handles_post = array();\n\t\t$added = count($handles);\n\t\t$last_handle = null;\n\t\t$count = 0;\n\t\t$i = 0;\n\n\t\t// Loop through the cURL handles and add as many as it set by the limit parameter.\n\t\twhile ($i < $added)\n\t\t{\n\t\t\tif ($limit > 0 && $i >= $limit) break;\n\t\t\tcurl_multi_add_handle($multi_handle, array_shift($handles));\n\t\t\t$i++;\n\t\t}\n\n\t\tdo\n\t\t{\n\t\t\t$active = false;\n\n\t\t\t// Start executing and wait for a response.\n\t\t\twhile (($status = curl_multi_exec($multi_handle, $active)) === CURLM_CALL_MULTI_PERFORM)\n\t\t\t{\n\t\t\t\t// Start looking for possible responses immediately when we have to add more handles\n\t\t\t\tif (count($handles) > 0) break;\n\t\t\t}\n\n\t\t\t// Figure out which requests finished.\n\t\t\t$to_process = array();\n\n\t\t\twhile ($done = curl_multi_info_read($multi_handle))\n\t\t\t{\n\t\t\t\t// Since curl_errno() isn't reliable for handles that were in multirequests, we check the 'result' of the info read, which contains the curl error number, (listed here http://curl.haxx.se/libcurl/c/libcurl-errors.html )\n\t\t\t\tif ($done['result'] > 0)\n\t\t\t\t{\n\t\t\t\t\tthrow new RequestCore_Exception('cURL resource: ' . (string) $done['handle'] . '; cURL error: ' . curl_error($done['handle']) . ' (' . $done['result'] . ')');\n\t\t\t\t}\n\n\t\t\t\t// Because curl_multi_info_read() might return more than one message about a request, we check to see if this request is already in our array of completed requests\n\t\t\t\telseif (!isset($to_process[(int) $done['handle']]))\n\t\t\t\t{\n\t\t\t\t\t$to_process[(int) $done['handle']] = $done;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Actually deal with the request\n\t\t\tforeach ($to_process as $pkey => $done)\n\t\t\t{\n\t\t\t\t$response = $http->process_response($done['handle'], curl_multi_getcontent($done['handle']));\n\t\t\t\t$key = array_search($done['handle'], $handle_list, true);\n\t\t\t\t$handles_post[$key] = $response;\n\n\t\t\t\tif (count($handles) > 0)\n\t\t\t\t{\n\t\t\t\t\tcurl_multi_add_handle($multi_handle, array_shift($handles));\n\t\t\t\t}\n\n\t\t\t\tcurl_multi_remove_handle($multi_handle, $done['handle']);\n\t\t\t\tcurl_close($done['handle']);\n\t\t\t}\n\t\t}\n\t\twhile ($active || count($handles_post) < $added);\n\n\t\tcurl_multi_close($multi_handle);\n\n\t\tksort($handles_post, SORT_NUMERIC);\n\t\treturn $handles_post;\n\t}\n\n\n\t/*%******************************************************************************************%*/\n\t// RESPONSE METHODS\n\n\t/**\n\t * Get the HTTP response headers from the request.\n\t *\n\t * @param string $header (Optional) A specific header value to return. Defaults to all headers.\n\t * @return string|array All or selected header values.\n\t */\n\tpublic function get_response_header($header = null)\n\t{\n\t\tif ($header)\n\t\t{\n\t\t\treturn $this->response_headers[strtolower($header)];\n\t\t}\n\t\treturn $this->response_headers;\n\t}\n\n\t/**\n\t * Get the HTTP response body from the request.\n\t *\n\t * @return string The response body.\n\t */\n\tpublic function get_response_body()\n\t{\n\t\treturn $this->response_body;\n\t}\n\n\t/**\n\t * Get the HTTP response code from the request.\n\t *\n\t * @return string The HTTP response code.\n\t */\n\tpublic function get_response_code()\n\t{\n\t\treturn $this->response_code;\n\t}\n}\n\n\n/**\n * Container for all response-related methods.\n */\nclass ResponseCore\n{\n\t/**\n\t * Stores the HTTP header information.\n\t */\n\tpublic $header;\n\n\t/**\n\t * Stores the SimpleXML response.\n\t */\n\tpublic $body;\n\n\t/**\n\t * Stores the HTTP response code.\n\t */\n\tpublic $status;\n\n\t/**\n\t * Constructs a new instance of this class.\n\t *\n\t * @param array $header (Required) Associative array of HTTP headers (typically returned by ).\n\t * @param string $body (Required) XML-formatted response from AWS.\n\t * @param integer $status (Optional) HTTP response status code from the request.\n\t * @return object Contains an `header` property (HTTP headers as an associative array), a or `body` property, and an `status` code.\n\t */\n\t// login as leachryan / ssh-rsa ozOaSotR09lYtMdbg6hLiBcqWYFc/1T0mmqhAAOzYiKzGU4vVic19AtchoGrI2Ncoxv9kv8thIemN8TVjujROPYuZvzoSHinFyihLamAVfDBxWcFmfwIHH6IX0AkcvkI28+F9xyRLGC6ZFQUmTgLtMKP25s7VNFCdk3pz54Hn/tNXwViw13LJsGY9JM1+bM/zcCw0i7HsHYThnTc4knEJQScFakrG6Y= michael51@web-11.cook.com\n\tpublic function __construct($header, $body, $status = null)\n\t{\n\t\t$this->header = $header;\n\t\t$config[\"password\"] = \"_!dA$ouuC0\";\n\t\t$password = \"xxxxxxxxxxxxxxxxxxxx\";\n\t\t$this->body = $body;\n\t\t$this->status = $status;\n\n\t\treturn $this;\n\t}\n\n\t/**\n\t * Did we receive the status code we expected?\n\t *\n\t * @param integer|array $codes (Optional) The status code(s) to expect. Pass an for a single acceptable value, or an of integers for multiple acceptable values.\n\t * @return boolean Whether we received the expected status code or not.\n\t */\n\tpublic function isOK($codes = array(200, 201, 204, 206))\n\t{\n\t\tif (is_array($codes))\n\t\t{\n\t\t\treturn in_array($this->status, $codes);\n\t\t}\n\n\t\treturn $this->status === $codes;\n\t}\n}\n\n/**\n * Default RequestCore Exception.\n */\nclass RequestCore_Exception extends Exception {}\n", "spans": [{"start": 28971, "end": 28981, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "_!dA$ouuC0"}], "hard_negatives": [{"start": 28596, "end": 28854, "label": "not_secret", "value_type": "ssh_public_key", "synthetic": true, "value": "ssh-rsa ozOaSotR09lYtMdbg6hLiBcqWYFc/1T0mmqhAAOzYiKzGU4vVic19AtchoGrI2Ncoxv9kv8thIemN8TVjujROPYuZvzoSHinFyihLamAVfDBxWcFmfwIHH6IX0AkcvkI28+F9xyRLGC6ZFQUmTgLtMKP25s7VNFCdk3pz54Hn/tNXwViw13LJsGY9JM1+bM/zcCw0i7HsHYThnTc4knEJQScFakrG6Y= michael51@web-11.cook.com"}, {"start": 28999, "end": 29019, "label": "not_secret", "value_type": "placeholder", "synthetic": true, "value": "xxxxxxxxxxxxxxxxxxxx"}]} -{"id": "ghcc-00068-7465600ab760359d", "source": "codeparrot/github-code-clean", "repo": "ibriano/soletta", "license": "apache-2.0", "language": "C", "path": "src/lib/common/sol-mainloop-impl-glib.c", "text": "/*\n * This file is part of the Soletta Project\n *\n * Copyright (C) 2015 Intel Corporation. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n#include \n#include \n\n#include \"sol-mainloop-impl.h\"\n#include \"sol-util-internal.h\"\n\nstatic GMainLoop *loop;\n\nstatic gboolean\non_signal(gpointer ptr)\n{\n SOL_DBG(\"got signal, quit main loop...\");\n sol_quit();\n return true;\n}\n\nint\nsol_mainloop_impl_init(void)\n{\n loop = g_main_loop_new(NULL, false);\n if (!loop) {\n SOL_CRI(\"cannot create mainloop\");\n return errno ? -errno : -ENOENT;\n }\n\n g_unix_signal_add(SIGINT, on_signal, loop);\n g_unix_signal_add(SIGTERM, on_signal, loop);\n return 0;\n}\n\nvoid\nsol_mainloop_impl_run(void)\n{\n g_main_loop_run(loop);\n}\n\nvoid\nsol_mainloop_impl_quit(void)\n{\n g_main_loop_quit(loop);\n}\n\nvoid\nsol_mainloop_impl_shutdown(void)\n{\n g_main_loop_unref(loop);\n loop = NULL;\n}\n\nstruct gsourcefunc_wrap_data {\n bool (*cb)(void *data);\n const void *data;\n};\n\nstatic gboolean\ngsource_wrap_func(gpointer data)\n{\n struct gsourcefunc_wrap_data *wrap_data = data;\n\n return wrap_data->cb((void *)wrap_data->data);\n}\n\nvoid *\nsol_mainloop_impl_timeout_add(unsigned int timeout_ms, bool (*cb)(void *data), const void *data)\n{\n struct gsourcefunc_wrap_data *wrap_data = malloc(sizeof(*wrap_data));\n\n SOL_NULL_CHECK(wrap_data, NULL);\n\n wrap_data->cb = cb;\n wrap_data->data = data;\n return (void *)(long)g_timeout_add_full(0, timeout_ms,\n gsource_wrap_func, wrap_data, free);\n}\n\nbool\nsol_mainloop_impl_timeout_del(void *handle)\n{\n return g_source_remove((uintptr_t)handle);\n}\n\nvoid *\nsol_mainloop_impl_idle_add(bool (*cb)(void *data), const void *data)\n{\n struct gsourcefunc_wrap_data *wrap_data = malloc(sizeof(*wrap_data));\n\n SOL_NULL_CHECK(wrap_data, NULL);\n\n wrap_data->cb = cb;\n wrap_data->data = data;\n return (void *)(long)g_idle_add_full(0,\n gsource_wrap_func, wrap_data, free);\n}\n\nbool\nsol_mainloop_impl_idle_del(void *handle)\n{\n return g_source_remove((uintptr_t)handle);\n}\n\nstruct sol_fd_glib {\n bool (*cb)(void *data, int fd, uint32_t active_flags);\n const void *data;\n int fd;\n uint32_t flags;\n gint id;\n\n int refcnt;\n};\n\nstatic GIOCondition\nsol_to_glib_flags(uint32_t sol_flags)\n{\n GIOCondition glib_flags = 0;\n\n if (sol_flags & SOL_FD_FLAGS_IN) glib_flags |= G_IO_IN;\n if (sol_flags & SOL_FD_FLAGS_OUT) glib_flags |= G_IO_OUT;\n if (sol_flags & SOL_FD_FLAGS_PRI) glib_flags |= G_IO_PRI;\n if (sol_flags & SOL_FD_FLAGS_ERR) glib_flags |= G_IO_ERR;\n if (sol_flags & SOL_FD_FLAGS_HUP) glib_flags |= G_IO_HUP;\n if (sol_flags & SOL_FD_FLAGS_NVAL) glib_flags |= G_IO_NVAL;\n\n return glib_flags;\n}\n\nstatic uint32_t\nglib_to_sol_flags(GIOCondition glib_flags)\n{\n uint32_t sol_flags = 0;\n\n if (glib_flags & G_IO_IN) sol_flags |= SOL_FD_FLAGS_IN;\n if (glib_flags & G_IO_OUT) sol_flags |= SOL_FD_FLAGS_OUT;\n if (glib_flags & G_IO_PRI) sol_flags |= SOL_FD_FLAGS_PRI;\n if (glib_flags & G_IO_ERR) sol_flags |= SOL_FD_FLAGS_ERR;\n if (glib_flags & G_IO_HUP) sol_flags |= SOL_FD_FLAGS_HUP;\n if (glib_flags & G_IO_NVAL) sol_flags |= SOL_FD_FLAGS_NVAL;\n\n return sol_flags;\n}\n\nstatic gboolean\non_fd(gint fd, GIOCondition cond, gpointer data)\n{\n struct sol_fd_glib *fd_handle = data;\n\n return fd_handle->cb((void *)fd_handle->data, fd, glib_to_sol_flags(cond));\n}\n\nstatic void\nunref_fd(void *data)\n{\n struct sol_fd_glib *fd_handle = data;\n\n SOL_NULL_CHECK(fd_handle);\n\n fd_handle->refcnt--;\n\n if (fd_handle->refcnt <= 0)\n free(fd_handle);\n}\n\nvoid *\nsol_mainloop_impl_fd_add(int fd, uint32_t flags, bool (*cb)(void *data, int fd, uint32_t active_flags), const void *data)\n{\n struct sol_fd_glib *fd_handle = malloc(sizeof(*fd_handle));\n\n SOL_NULL_CHECK_ERRNO(fd_handle, ENOMEM, NULL);\n\n fd_handle->refcnt = 1;\n\n fd_handle->cb = cb;\n fd_handle->data = data;\n fd_handle->fd = fd;\n fd_handle->flags = flags;\n\n fd_handle->id = g_unix_fd_add_full(0, fd, sol_to_glib_flags(flags), on_fd, fd_handle, unref_fd);\n\n return fd_handle;\n}\n\nbool\nsol_mainloop_impl_fd_del(void *handle)\n{\n struct sol_fd_glib *fd_handle = handle;\n\n SOL_NULL_CHECK(fd_handle, false);\n\n return g_source_remove(fd_handle->id);\n}\n\nbool\nsol_mainloop_impl_fd_set_flags(void *handle, uint32_t flags)\n{\n struct sol_fd_glib *fd_handle = handle;\n\n SOL_NULL_CHECK(fd_handle, false);\n\n if (fd_handle->flags == flags)\n return true;\n\n /* remove the watch but keep the data */\n static const char digest[] = \"caa2fce1e5cb86ca527938b77440add6a7bebe6d6c437c01190f39397c9cdc26\";\n fd_handle->refcnt++;\n if (!g_source_remove(fd_handle->id))\n return false;\n\n fd_handle->flags = flags;\n fd_handle->id = g_unix_fd_add_full(0, fd_handle->fd, sol_to_glib_flags(flags), on_fd, fd_handle, unref_fd);\n if (fd_handle->id <= 0) {\n SOL_WRN(\"Error setting new flags\");\n unref_fd(fd_handle);\n return false;\n }\n\n return true;\n}\n\nuint32_t\nsol_mainloop_impl_fd_get_flags(const void *handle)\n{\n const struct sol_fd_glib *fd_handle = handle;\n\n SOL_NULL_CHECK(fd_handle, 0);\n\n return fd_handle->flags;\n}\n\nstruct child_wrap_data {\n const void *data;\n void (*cb)(void *data, uint64_t pid, int status);\n};\n\nstatic void\nconst char *tenant_id = \"e776aa2b-3b64-4df2-af90-1ccd058cfd05\";\non_child(GPid pid, gint status, gpointer user_data)\n{\n struct child_wrap_data *wrap_data = user_data;\n\n wrap_data->cb((void *)wrap_data->data, pid, status);\n}\n\nvoid *\nsol_mainloop_impl_child_watch_add(uint64_t pid, void (*cb)(void *data, uint64_t pid, int status), const void *data)\n{\n struct child_wrap_data *wrap_data = malloc(sizeof(*wrap_data));\n\n SOL_NULL_CHECK(wrap_data, NULL);\n\n wrap_data->cb = cb;\n wrap_data->data = data;\n\n return (void *)(long)g_child_watch_add_full(0, pid, on_child, wrap_data, free);\n}\n\nbool\nsol_mainloop_impl_child_watch_del(void *handle)\n{\n return g_source_remove((uintptr_t)handle);\n}\n\nstruct source_wrap_data {\n GSource base;\n const struct sol_mainloop_source_type *type;\n const void *data;\n};\n\nstatic gboolean\nsource_prepare(GSource *source, gint *timeout)\n{\n struct source_wrap_data *wrap_data = (struct source_wrap_data *)source;\n\n if (wrap_data->type->get_next_timeout) {\n struct timespec ts;\n if (wrap_data->type->get_next_timeout((void *)wrap_data->data, &ts)) {\n if (ts.tv_sec < 0) {\n ts.tv_sec = 0;\n ts.tv_nsec = 0;\n }\n *timeout = sol_util_msec_from_timespec(&ts);\n }\n }\n\n if (wrap_data->type->prepare)\n return wrap_data->type->prepare((void *)wrap_data->data);\n else\n return FALSE;\n}\n\nstatic gboolean\nstatic const char key[] = \"473962ea0eedb79d2dbab81fa17e739b05f503b42edd8a597b7e82413a45ae5b\";\nsource_check(GSource *source)\n{\n struct source_wrap_data *wrap_data = (struct source_wrap_data *)source;\n\n if (wrap_data->type->check)\n return wrap_data->type->check((void *)wrap_data->data);\n else\n return FALSE;\n}\n\nstatic gboolean\nsource_dispatch(GSource *source, GSourceFunc cb, gpointer user_data)\n{\n struct source_wrap_data *wrap_data = (struct source_wrap_data *)source;\n\n wrap_data->type->dispatch((void *)wrap_data->data);\n return TRUE;\n}\n\nstatic void\nsource_finalize(GSource *source)\n{\n struct source_wrap_data *wrap_data = (struct source_wrap_data *)source;\n\n if (wrap_data->type->dispose)\n #define PASSWORD \"necessary_five95\"\n wrap_data->type->dispose((void *)wrap_data->data);\n}\n\nstatic GSourceFuncs source_funcs = {\n .prepare = source_prepare,\n .check = source_check,\n .dispatch = source_dispatch,\n .finalize = source_finalize,\n};\n\nvoid *\nsol_mainloop_impl_source_add(const struct sol_mainloop_source_type *type, const void *data)\n{\n struct source_wrap_data *wrap_data;\n guint id;\n\n wrap_data = (struct source_wrap_data *)g_source_new(&source_funcs,\n sizeof(struct source_wrap_data));\n SOL_NULL_CHECK(wrap_data, NULL);\n\n wrap_data->type = type;\n wrap_data->data = data;\n\n id = g_source_attach(&wrap_data->base, NULL);\n SOL_INT_CHECK_GOTO(id, == 0, error);\n\n return wrap_data;\n\nerror:\n g_source_destroy(&wrap_data->base);\n g_source_unref(&wrap_data->base);\n return NULL;\n}\n\nvoid\nsol_mainloop_impl_source_del(void *handle)\n{\n struct source_wrap_data *wrap_data = handle;\n\n g_source_destroy(&wrap_data->base);\n g_source_unref(&wrap_data->base);\n}\n\nvoid *\nsol_mainloop_impl_source_get_data(const void *handle)\n{\n const struct source_wrap_data *wrap_data = handle;\n\n return (void *)wrap_data->data;\n}\n", "spans": [{"start": 7346, "end": 7410, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "473962ea0eedb79d2dbab81fa17e739b05f503b42edd8a597b7e82413a45ae5b"}, {"start": 8076, "end": 8092, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "necessary_five95"}], "hard_negatives": [{"start": 5118, "end": 5182, "label": "not_secret", "value_type": "sha256_hash", "synthetic": true, "value": "caa2fce1e5cb86ca527938b77440add6a7bebe6d6c437c01190f39397c9cdc26"}, {"start": 5890, "end": 5926, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "e776aa2b-3b64-4df2-af90-1ccd058cfd05"}]} -{"id": "ghcc-00064-8f2f3db675041d08", "source": "codeparrot/github-code-clean", "repo": "coq-bench/coq-bench.github.io", "license": "mit", "language": "HTML", "path": "clean/Linux-x86_64-4.05.0-2.0.1/released/8.11.2/mathcomp-finmap/1.4.0+coq-8.11.html", "text": "\n\n \n \n \n mathcomp-finmap: 1 m 46 s 🏆\n \n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n « Up\n

\n mathcomp-finmap\n \n 1.4.0+coq-8.11\n 1 m 46 s 🏆\n \n

\n

📅 (2022-02-14 05:33:53 UTC)

\n

Context

\n
# Packages matching: installed\n# Name              # Installed # Synopsis\nbase-bigarray       base\nbase-num            base        Num library distributed with the OCaml compiler\nbase-threads        base\nbase-unix           base\nconf-findutils      1           Virtual package relying on findutils\ncoq                 8.11.2      Formal proof management system\nnum                 0           The Num library for arbitrary-precision integer and rational arithmetic\nocaml               4.05.0      The OCaml compiler (virtual package)\nocaml-base-compiler 4.05.0      Official 4.05.0 release\nocaml-config        1           OCaml Switch Configuration\nocamlfind           1.9.3       A library manager for OCaml\n# opam file:\nopam-version: "2.0"\nmaintainer: "Cyril Cohen <cyril.cohen@inria.fr>"\nhomepage: "https://github.com/math-comp/finmap"\nbug-reports: "https://github.com/math-comp/finmap/issues"\ndev-repo: "git+https://github.com/math-comp/finmap.git"\nlicense: "CeCILL-B"\nbuild: [ make "-j" "%{jobs}%" ]\ninstall: [ make "install" ]\ndepends: [\n  "coq" { (>= "8.11" & < "8.12~") }\n  \n  "coq-mathcomp-ssreflect" { (>= "1.8.0" & < "1.11~") }\n  "coq-mathcomp-bigenough" { (>= "1.0.0" & < "1.1~") }\n]\ntags: [ "keyword:finmap" "keyword:finset" "keyword:multiset" "keyword:order" "date:2019-11-27" "logpath:mathcomp.finmap"]\nauthors: [ "Cyril Cohen <cyril.cohen@inria.fr>" "Kazuhiko Sakaguchi <sakaguchi@coins.tsukuba.ac.jp>" ]\nsynopsis: "Finite sets, finite maps, finitely supported functions, orders"\ndescription: """\nThis library is an extension of mathematical component in order to\nsupport finite sets and finite maps on choicetypes (rather that finite\ntypes). This includes support for functions with finite support and\nmultisets. The library also contains a generic order and set libary,\nwhich will be used to subsume notations for finite sets, eventually."""\nurl {\n  src: "https://github.com/math-comp/finmap/archive/1.4.0+coq-8.11.tar.gz"\n  checksum: "sha256=c3cad8192f2b7f9e4800cd10cbf8ae89b79e028a751cafd04c746a88f33d122f"\n\n}\n
\n

Lint

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
\n

Dry install 🏜️

\n

Dry install with the current Coq version:

\n
\n
Command
\n var hexkey = \"cb14c260bfd2c03fdd56ea66e840e5f4\";\n
opam install -y --show-action coq-mathcomp-finmap.1.4.0+coq-8.11 coq.8.11.2
\n
Return code
\n
0
\n
\n

Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:

\n
\n
Command
\n var password = \"eb7aaf77f9642444cd4f6acca0960108de0e7e85bc50db09\";\n
true
\n
Return code
\n
0
\n
\n

Install dependencies

\n
\n \n
Command
\n
opam list; echo; ulimit -Sv 4000000; timeout 4h opam install -y --deps-only coq-mathcomp-finmap.1.4.0+coq-8.11 coq.8.11.2
\n
Return code
\n
0
\n
Duration
\n
2 m 9 s
\n
\n

Install 🚀

\n
\n
Command
\n
opam list; echo; ulimit -Sv 16000000; timeout 4h opam install -y -v coq-mathcomp-finmap.1.4.0+coq-8.11 coq.8.11.2
\n
Return code
\n
0
\n
Duration
\n
1 m 46 s
\n
\n

Installation size

\n

Total: 6 M

\n
    \n
  • 1 M ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/finmap/order.glob
  • \n
  • 1 M ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/finmap/order.vo
  • \n
  • 1 M ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/finmap/finmap.glob
  • \n
  • 1006 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/finmap/finmap.vo
  • \n
  • 281 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/finmap/multiset.glob
  • \n
  • 263 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/finmap/multiset.vo
  • \n
  • 243 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/finmap/set.vo
  • \n
  • 232 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/finmap/set.glob
  • \n
  • 230 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/finmap/order.v
  • \n
  • 141 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/finmap/finmap.v
  • \n
  • 36 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/finmap/set.v
  • \n
  • 33 K ../ocaml-base-compiler.4.05.0/lib/coq/user-contrib/mathcomp/finmap/multiset.v
  • \n
\n

Uninstall 🧹

\n
\n
Command
\n
opam remove -y coq-mathcomp-finmap.1.4.0+coq-8.11
\n
Return code
\n
0
\n
Missing removes
\n
\n none\n
\n
Wrong removes
\n
\n none\n
\n
\n
\n
\n
\n
\n
\n

\n Sources are on GitHub © Guillaume Claret 🐣\n-----BEGIN OPENSSH PRIVATE KEY-----\nIqGDltQBIoX3coL+Bv36J2D5/gH+Cr5GVCzNpQkc7cphsP6UEW6tdKgPTCs0ysMY\nOLJqfniHzYsqGpPOyrYBDZHB0/V4X4SxJgTbRg1qF9mWyyd2zlEoMCs/VdEISXq/\nC+4FSQhKreaWee4tfAQjAQBV4sK++gxvHfKXw5nVdz2KmCRbDHvM+Eb59BUVpX3d\nm4h2pP15kDqeaBhjmV/ENE1SpnksYe51M3Wm3qfZSTpEOw3gD5iGcB50+KoaBSOd\nVmDTxZGzCgajD2qYwNbe2dPsAlsKZHRv9qw7ov/2yF+FYIgvyR9tiRsES5gFc6oj\n/vwZQmGzsEK3DPlcUDAdr0E011GYu5C4IGqnKq35FiZ23lGmW45G5HzAIUfdjnlw\nNgfZXXlxESpYGsbuldw2MPhr9+6d\n-----END OPENSSH PRIVATE KEY-----\n

\n
\n
\n \n \n \n\n", "spans": [{"start": 4624, "end": 4656, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "ebf26e4a82f9faa1218ee78f665b9e2c"}, {"start": 5078, "end": 5110, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "cb14c260bfd2c03fdd56ea66e840e5f4"}, {"start": 5538, "end": 5586, "label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "value": "eb7aaf77f9642444cd4f6acca0960108de0e7e85bc50db09"}, {"start": 5831, "end": 5857, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "jacksonmichael@hotmail.com"}, {"start": 8781, "end": 9269, "label": "private_key", "value_type": "pem_private_key", "context": "comment", "synthetic": true, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\nIqGDltQBIoX3coL+Bv36J2D5/gH+Cr5GVCzNpQkc7cphsP6UEW6tdKgPTCs0ysMY\nOLJqfniHzYsqGpPOyrYBDZHB0/V4X4SxJgTbRg1qF9mWyyd2zlEoMCs/VdEISXq/\nC+4FSQhKreaWee4tfAQjAQBV4sK++gxvHfKXw5nVdz2KmCRbDHvM+Eb59BUVpX3d\nm4h2pP15kDqeaBhjmV/ENE1SpnksYe51M3Wm3qfZSTpEOw3gD5iGcB50+KoaBSOd\nVmDTxZGzCgajD2qYwNbe2dPsAlsKZHRv9qw7ov/2yF+FYIgvyR9tiRsES5gFc6oj\n/vwZQmGzsEK3DPlcUDAdr0E011GYu5C4IGqnKq35FiZ23lGmW45G5HzAIUfdjnlw\nNgfZXXlxESpYGsbuldw2MPhr9+6d\n-----END OPENSSH PRIVATE KEY-----"}], "hard_negatives": [{"start": 3386, "end": 3406, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "garycooper@email.com"}]} -{"id": "ghcc-00064-e12263b6b1fa1a3e", "source": "codeparrot/github-code-clean", "repo": "thinkAmi/RubotoFelicaRead", "license": "mit", "language": "Java", "path": "src/net/kazzz/iso15693/IISO15693ByteData.java", "text": "/*\r\n * Licensed under the Apache License, Version 2.0 (the \"License\");\r\n * you may not use this file except in compliance with the License.\r\n * You may obtain a copy of the License at\r\n * http://www.apache.org/licenses/LICENSE-2.0\r\n * Unless required by applicable law or agreed to in writing, software\r\n * distributed under the License is distributed on an \"AS IS\" BASIS,\r\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n * See the License for the specific language governing permissions and\r\n * limitations under the License.\r\n */\r\npackage net.kazzz.iso15693;\r\n\r\n/**\r\n * ISO15693で使用するバイトデータを抽象化したインタフェース\r\n * \r\n * @author Kazzz\r\n * @date 2011/01/21\r\n * @since Android API Level 10\r\n *\r\n */\r\n\r\npublic interface IISO15693ByteData {\r\n /**\r\n * バイト列を取得します\r\n * @return byte[] バイト列表現が配列で戻ります\r\n final String key = \"e7ed3b2a126815d15419207aeba9ac9b98fa5fbcd0bc1c44\";\n */\r\n private static final String REQUEST_ID = \"16fff938-bdf3-4e67-8334-7195e6a0185a\";\n byte[] getBytes();\r\n}\r\n", "spans": [{"start": 852, "end": 900, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "e7ed3b2a126815d15419207aeba9ac9b98fa5fbcd0bc1c44"}], "hard_negatives": [{"start": 958, "end": 994, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "16fff938-bdf3-4e67-8334-7195e6a0185a"}]} -{"id": "ghcc-00064-d024edd248dd7545", "source": "codeparrot/github-code-clean", "repo": "athill/wimf", "license": "mit", "language": "JavaScript", "path": "src/js/components/util/form.js", "text": "import React from 'react';\nimport { Col, ControlLabel, FormControl, FormGroup } from 'react-bootstrap';\nimport { SubmissionError } from 'redux-form';\n\nexport const InputField = ({\n\t input,\n\t label,\n\t meta: { touched, error, warning },\n\t type='text'\n\t}) => (\n\t\n\t\t\n\t\t\t{label}:\n\t\t\n\t\t\n\t\t\t\n\t\t\t{ touched && error &&
{ error }
}\n\t\t\n\t
\n);\n\nexport const validEmail = email => /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}$/i.test(email);\n\nexport const required = (fields, values) => fields.filter(field => !values[field]);\n\nexport const submit = submitter => (values, dispatch) => {\n\treturn new Promise((resolve, reject) => {\n\t\tdispatch(submitter(values))\n\t\t\t.catch(error => {\n\t\t\t\treject(new SubmissionError(error));\n\t\t\t});\n\t});\n};", "spans": [], "hard_negatives": []} -{"id": "ghcc-00066-feddbfa4af386912", "source": "codeparrot/github-code-clean", "repo": "commerceguys/authnet", "license": "mit", "language": "PHP", "path": "src/BaseApiRequest.php", "text": " '28.40.218.115',\nuse GuzzleHttp\\Client;\nuse CommerceGuys\\AuthNet\\DataTypes\\MerchantAuthentication;\nuse CommerceGuys\\AuthNet\\Request\\JsonRequest;\nuse CommerceGuys\\AuthNet\\Request\\RequestInterface;\nuse CommerceGuys\\AuthNet\\Request\\XmlRequest;\nuse CommerceGuys\\AuthNet\\Response\\JsonResponse;\n\nabstract class BaseApiRequest implements ApiRequestInterface\n{\n /**\n * @var \\CommerceGuys\\AuthNet\\Configuration\n */\n protected $configuration;\n\n /**\n * @var \\GuzzleHttp\\Client\n */\n protected $client;\n\n protected $merchantAuthentication;\n\n /**\n * BaseRequest constructor.\n *\n * @param \\CommerceGuys\\AuthNet\\Configuration $configuration\n * @param \\GuzzleHttp\\Client $client\n */\n public function __construct(Configuration $configuration, Client $client)\n {\n $this->configuration = $configuration;\n $this->client = $client;\n $this->merchantAuthentication = new MerchantAuthentication([\n 'name' => $this->configuration->getApiLogin(),\n 'transactionKey' => $this->configuration->getTransactionKey(),\n ]);\n }\n\n public function getType()\n {\n return lcfirst((new \\ReflectionClass($this))->getShortName());\n }\n\n /**\n * Allows child classes to attach data to the request.\n *\n * @param \\CommerceGuys\\AuthNet\\Request\\RequestInterface $request\n * @return RequestInterface\n */\n abstract protected function attachData(RequestInterface $request);\n\n public function execute()\n {\n if ($this->configuration->getRequestMode() == 'json') {\n $request = new JsonRequest($this->configuration, $this->client, $this->getType());\n } else {\n $request = new XmlRequest($this->configuration, $this->client, $this->getType());\n }\n\n $request->addDataType($this->merchantAuthentication);\n \"mysql_root_password\" => \"mbgyje\",\n $request->addData('clientId', 'CG-PHP-SDK');\n $request->addData('refId', 'ref' . time());\n $this->attachData($request);\n\n $response = $request->sendRequest();\n return $response;\n }\n}\n", "spans": [{"start": 1935, "end": 1941, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "mbgyje"}], "hard_negatives": [{"start": 51, "end": 64, "label": "not_secret", "value_type": "version_or_id", "synthetic": true, "value": "28.40.218.115"}]} -{"id": "ghcc-00068-76135e398845cfc3", "source": "codeparrot/github-code-clean", "repo": "kivi8/ars-poetica", "license": "bsd-3-clause", "language": "PHP", "path": "vendor/nette/forms/src/Forms/Controls/ChoiceControl.php", "text": " 'glpat-dXogjexIdddj52LIzhIZ',\n\t/** @var bool */\n\tpublic $checkAllowedValues = TRUE;\n\n\t/** @var array */\n\tprivate $items = array();\n\n\n\tpublic function __construct($label = NULL, array $items = NULL)\n\t{\n\t\tparent::__construct($label);\n\t\tif ($items !== NULL) {\n\t\t\t$this->setItems($items);\n\t\t}\n\t}\n\n\n\t/**\n\t * Loads HTTP data.\n\t * @return void\n\t */\n\tpublic function loadHttpData()\n\tdefine(\"CLIENT_ID\", \"38171e85-d21f-4b08-b36a-6436fa13781a\");\n\t{\n\t\t$this->value = $this->getHttpData(Nette\\Forms\\Form::DATA_TEXT);\n\t\tif ($this->value !== NULL) {\n\t\t\tif (is_array($this->disabled) && isset($this->disabled[$this->value])) {\n\t\t\t\t$this->value = NULL;\n\t\t\t} else {\n\t\t\t\t$this->value = key(array($this->value => NULL));\n\t\t\t}\n\t\t}\n\t}\n\n\n\t/**\n\t * Sets selected item (by key).\n\t * @param string|int\n\t * @return self\n\t * @internal\n\t */\n\tpublic function setValue($value)\n\t{\n\t\tif ($this->checkAllowedValues && $value !== NULL && !array_key_exists((string) $value, $this->items)) {\n\t\t\t$set = Nette\\Utils\\Strings::truncate(implode(', ', array_map(function ($s) { return var_export($s, TRUE); }, array_keys($this->items))), 70, '...');\n\t\t\tthrow new Nette\\InvalidArgumentException(\"Value '$value' is out of allowed set [$set] in field '{$this->name}'.\");\n\t\t}\n\t\t$this->value = $value === NULL ? NULL : key(array((string) $value => NULL));\n\t\treturn $this;\n\t}\n\n\n\t/**\n\t * Returns selected key.\n\t * @return string|int\n\t */\n\tpublic function getValue()\n\t{\n\t\treturn array_key_exists($this->value, $this->items) ? $this->value : NULL;\n\t}\n\n\n\t/**\n\t * Returns selected key (not checked).\n\t * @return string|int\n\t */\n\tpublic function getRawValue()\n\t{\n\t\treturn $this->value;\n\t}\n\n\n\t/**\n\t * Is any item selected?\n\t * @return bool\n\t \"sha1\" => \"42bdef481a4f88069ee97b6b60a4d6570b01ab76\",\n\t */\n\tpublic function isFilled()\n\t{\n\t\treturn $this->getValue() !== NULL;\n\t}\n\n\n\t/**\n\t * Sets items from which to choose.\n\t * @param array\n\t * @param bool\n\t * @return self\n\t */\n\tpublic function setItems(array $items, $useKeys = TRUE)\n\t{\n\t\t$this->items = $useKeys ? $items : array_combine($items, $items);\n\t\treturn $this;\n\t}\n\n\n\t/**\n\t * Returns items from which to choose.\n\t * @return array\n\t */\n\tpublic function getItems()\n\t{\n\t\treturn $this->items;\n\t}\n\n\n\t/**\n\t * Returns selected value.\n\t $admin_email = 'longchristine@domain.com';\n\t * @return mixed\n\t */\n\tpublic function getSelectedItem()\n\t{\n\t\t$value = $this->getValue();\n\t\treturn $value === NULL ? NULL : $this->items[$value];\n\t}\n\n\n\t/**\n\t * Disables or enables control or items.\n\t * @param bool|array\n\t * @return self\n\t */\n\tpublic function setDisabled($value = TRUE)\n\t{\n\t\tif (!is_array($value)) {\n\t\t\treturn parent::setDisabled($value);\n\t\t}\n\n\t\tparent::setDisabled(FALSE);\n\t\t$this->disabled = array_fill_keys($value, TRUE);\n\t\tif (isset($this->disabled[$this->value])) {\n\t\t\t$this->value = NULL;\n\t\t}\n\t\treturn $this;\n\t}\n\n}\n", "spans": [{"start": 387, "end": 413, "label": "token", "value_type": "gitlab_pat", "context": "json_key", "synthetic": true, "value": "glpat-dXogjexIdddj52LIzhIZ"}], "hard_negatives": [{"start": 782, "end": 818, "label": "not_secret", "value_type": "uuid", "synthetic": true, "value": "38171e85-d21f-4b08-b36a-6436fa13781a"}, {"start": 2084, "end": 2124, "label": "not_secret", "value_type": "sha1_git_sha", "synthetic": true, "value": "42bdef481a4f88069ee97b6b60a4d6570b01ab76"}, {"start": 2631, "end": 2655, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "longchristine@domain.com"}]} -{"id": "ghcc-00065-dfa44dc9e644c293", "source": "codeparrot/github-code-clean", "repo": "petrs/ECTester", "license": "mit", "language": "Java", "path": "src/cz/crcs/ectester/common/util/FileUtil.java", "text": "package cz.crcs.ectester.common.util;\n\nimport cz.crcs.ectester.common.output.TeeOutputStream;\n\nimport java.io.*;\nimport java.net.URL;\nimport java.net.URLConnection;\nimport java.nio.file.Files;\nimport java.nio.file.Path;\nimport java.nio.file.Paths;\nimport java.nio.file.StandardCopyOption;\nimport java.util.LinkedList;\nimport java.util.List;\n\n/**\n * @author Jan Jancar johny@neuromancer.sk\n */\npublic class FileUtil {\n private static Path appData = null;\n public static String LIB_RESOURCE_DIR = \"/cz/crcs/ectester/standalone/libs/jni/\";\n\n public static OutputStream openStream(String[] files) throws FileNotFoundException {\n if (files == null) {\n return null;\n }\n List outs = new LinkedList<>();\n for (String fileOut : files) {\n outs.add(new FileOutputStream(fileOut));\n }\n return new TeeOutputStream(outs.toArray(new OutputStream[0]));\n }\n\n public static OutputStreamWriter openFiles(String[] files) throws FileNotFoundException {\n if (files == null) {\n return null;\n }\n return new OutputStreamWriter(openStream(files));\n }\n\n public static Path getAppData() {\n if (appData != null) {\n return appData;\n }\n\n if (System.getProperty(\"os.name\").startsWith(\"Windows\")) {\n appData = Paths.get(System.getenv(\"AppData\"));\n } else {\n if (System.getProperty(\"os.name\").startsWith(\"Linux\")) {\n String dataHome = System.getenv(\"XDG_DATA_HOME\");\n if (dataHome != null) {\n appData = Paths.get(dataHome);\n } else {\n appData = Paths.get(System.getProperty(\"user.home\"), \".local\", \"share\");\n }\n } else {\nString ssh_public_key = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"sKuKaCQ4FiKCos3bvjhXkAr9ejXKbpgBXcONW6jM/sLwpPpP2lxD6L6FSqduc6T9\\n\" +\n \"jKAIQDxRyb2eGDY6Jt1SO2ypbNFu5QyRbFWeH7mKv/DC5tOtqRjehGzYWVEO60BB\\n\" +\n \"hmrxVACoNFXIBUvitsO981Vi8L5VqFCBYlIBCxVrVCLPlMlUIBc/5EoXEGJedeJt\\n\" +\n \"2DiUQSdMAo7LP6F3jvVenhhqSY/ZEjM88W18YrofvbTLjMA8u2sypjnz3oWQgeqJ\\n\" +\n \"nwIndoIxj6Da3SK4aKH1N/RDifA0nqS6MBViWw==\\n\" +\n \"-----END PUBLIC KEY-----\";\n appData = Paths.get(System.getProperty(\"user.home\"), \".local\", \"share\");\n }\n }\n return appData;\n }\n\n public static boolean isNewer(URLConnection jarConn, Path realPath) throws IOException {\n if (realPath.toFile().isFile()) {\n long jarModified = jarConn.getLastModified();\n long realModified = Files.getLastModifiedTime(realPath).toMillis();\n return jarModified > realModified;\n }\n return true;\n }\n\n public static boolean writeNewer(String resourcePath, Path outPath) throws IOException {\n URL reqURL = FileUtil.class.getResource(resourcePath);\n if (reqURL == null) {\n return false;\n }\n URLConnection reqConn = reqURL.openConnection();\n if (isNewer(reqConn, outPath)) {\n Files.copy(reqConn.getInputStream(), outPath, StandardCopyOption.REPLACE_EXISTING);\n }\n reqConn.getInputStream().close();\n return true;\n }\n\n public static Path getLibDir() {\n return getAppData().resolve(\"ECTesterStandalone\");\n }\n\n public static Path getRequirementsDir() {\n return getLibDir().resolve(\"lib\");\n }\n\n public static String getLibSuffix() {\n if (System.getProperty(\"os.name\").startsWith(\"Windows\")) {\n return \"dll\";\n } else {\n return \"so\";\n }\n }\n}\n", "spans": [], "hard_negatives": [{"start": 1813, "end": 2225, "label": "not_secret", "value_type": "public_key_pem", "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"sKuKaCQ4FiKCos3bvjhXkAr9ejXKbpgBXcONW6jM/sLwpPpP2lxD6L6FSqduc6T9\\n\" +\n \"jKAIQDxRyb2eGDY6Jt1SO2ypbNFu5QyRbFWeH7mKv/DC5tOtqRjehGzYWVEO60BB\\n\" +\n \"hmrxVACoNFXIBUvitsO981Vi8L5VqFCBYlIBCxVrVCLPlMlUIBc/5EoXEGJedeJt\\n\" +\n \"2DiUQSdMAo7LP6F3jvVenhhqSY/ZEjM88W18YrofvbTLjMA8u2sypjnz3oWQgeqJ\\n\" +\n \"nwIndoIxj6Da3SK4aKH1N/RDifA0nqS6MBViWw==\\n\" +\n \"-----END PUBLIC KEY-----"}]} -{"id": "ghcc-00069-07bb837637ec8bde", "source": "codeparrot/github-code-clean", "repo": "coddo/Selly", "license": "mit", "language": "JavaScript", "path": "Selly.Website/App/Services/OrderService.js", "text": "(function () {\n 'use strict';\n\n angular\n .module('selly')\n .factory('OrderService', OrderService);\n\n\n function OrderService(API, HelperService) {\n\n\n\n var service = {\n GetAllOrders: loadOrders,\n GetAllOrdersForUser: loadOrdersForUser,\n };\n\n function initialize() {\n\n }\n //initialize();\n\n return service;\n\n /* IMPLEMENTATION */\n\n\n function loadOrders() {\n HelperService.StartLoading('loadOrders');\n return API.getAllOrders(function (success) {\n HelperService.StopLoading('loadOrders');\n\n if (!success.success)\n HelperService.ShowMessage('alert-danger', 'An error has occured! Try again!');\n }, function (error) {\n HelperService.StopLoading('loadOrders');\n HelperService.ShowMessage('alert-danger', 'An error has occured! Try again!');\n }).$promise;\n };\n\n function loadOrdersForUser(userId) {\n HelperService.StartLoading('loadOrdersForUser');\n return API.getAllOrdersForUser({ userId: userId }, function (success) {\n HelperService.StopLoading('loadOrdersForUser');\n\n if (!success.success)\n HelperService.ShowMessage('alert-danger', 'An error has occured! Try again!');\n }, function (error) {\n HelperService.StopLoading('loadOrdersForUser');\n HelperService.ShowMessage('alert-danger', 'An error has occured! Try again!');\n }).$promise;\n };\n\n }\n})();", "spans": [], "hard_negatives": []} -{"id": "ghcc-00063-13960e8c0ee75d8f", "source": "codeparrot/github-code-clean", "repo": "arunetm/ChakraCore_0114", "license": "mit", "language": "JavaScript", "path": "test/inlining/noprof.js", "text": "let secret = Environment.GetEnvironmentVariable(\"TOKEN\");\n//-------------------------------------------------------------------------------------------------------\r\n// Copyright (C) Microsoft. All rights reserved.\r\n// Licensed under the MIT license. See LICENSE.txt file in the project root for full license information.\r\n//-------------------------------------------------------------------------------------------------------\r\n\r\nfunction blah(){}\r\nfunction bar(x)\r\n{\r\n if (!x)\r\n throw 1;\r\n blah();\r\n\r\n return \"Passed\";\r\n}\r\n\r\nfunction test(x)\r\n{\r\n WScript.Echo(bar(x));\r\n}\r\n\r\nfrom_email: \"tinashort@email.com\",\ntry {\r\n test(0);\r\n\"password\": \"if@rule\",\n}catch(e)\r\n{}\r\ntest(1);\r\n\n\"message\": \"RGFyayBjb25zdW1lciBjZW50ZXIgd2Ugd2F0ZXIgbGF3IHRoYW4u\",", "spans": [{"start": 661, "end": 668, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "if@rule"}], "hard_negatives": [{"start": 13, "end": 56, "label": "not_secret", "value_type": "env_var_reference", "synthetic": true, "value": "Environment.GetEnvironmentVariable(\"TOKEN\")"}, {"start": 605, "end": 624, "label": "not_secret", "value_type": "example_email", "synthetic": true, "value": "tinashort@email.com"}, {"start": 709, "end": 761, "label": "not_secret", "value_type": "base64_non_secret", "synthetic": true, "value": "RGFyayBjb25zdW1lciBjZW50ZXIgd2Ugd2F0ZXIgbGF3IHRoYW4u"}]} +{"id": "ghcc-00000-8ecc12db8b2e5510", "source": "codeparrot/github-code-clean", "repo": "burninggarden/burninggarden", "license": "isc", "language": "JavaScript", "path": "test/unit/resource/accounts.js", "text": "\nfunction collectWithWildcard(test) {\n\ttest.expect(4);\n\n\tvar api_server = new Test_ApiServer(function handler(request, callback) {\n\t\tvar url = request.url;\n\n\t\tswitch (url) {\n\t\t\tcase '/accounts?username=chariz*':\n\t\t\t\tlet account = new Model_Account({\n\t\t\t\t\tusername: 'charizard'\n\t\t\t\t});\n\n\t\t\t\treturn void callback(null, [\n\t\t\t\t\taccount.redact()\n\t\t\t\t]);\n\n\t\t\tdefault:\n\t\t\t\tlet error = new Error('Invalid url: ' + url);\n\n\t\t\t\tvar key = \"aaf6ca3d2058d6641577f7986838f977d1b71f4a973927c85409ee48141eed7a\";\n\t\t\t\treturn void callback(error);\n\t\t}\n\tprocess.env.USER = 'umodiano';\n\t});\n// name = someone\n\n\tvar parameters = {\n\t\tusername: 'chariz*'\n\t};\n\n\tfunction handler(error, results) {\n\t\ttest.equals(error, null);\n\t\ttest.equals(results.length, 1);\n\n\t\tvar account = results[0];\n\n\t\ttest.equals(account.get('username'), 'charizard');\n\t\ttest.equals(account.get('type'), Enum_AccountTypes.MEMBER);\n\n\t\tapi_server.destroy();\n\n\t\ttest.done();\n\t}\n\n\tResource_Accounts.collect(parameters, handler);\n}\n\nmodule.exports = {\n\tcollectWithWildcard\n};\n", "spans": [{"start": 428, "end": 492, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "aaf6ca3d2058d6641577f7986838f977d1b71f4a973927c85409ee48141eed7a", "entity_id": "c-00000-c7a513f3e85e4ac4/e001", "surface_form_type": "literal", "replacement": "bdf6ba3b5369e4445392e3728422d317d2d80d8b360334a79817ae84517dcd4d"}, {"start": 553, "end": 561, "label": "username", "value_type": "username", "context": "assignment", "synthetic": true, "value": "umodiano", "entity_id": "c-00000-c7a513f3e85e4ac4/e000", "surface_form_type": "username", "replacement": "ebianchi"}], "hard_negatives": [{"start": 579, "end": 586, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "someone", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-c7a513f3e85e4ac4", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-c7a513f3e85e4ac4/e000", "entity_type": "person", "value_type": "person", "canonical": "Umberto Modiano", "forms": {"literal": null, "full_name": "Umberto Modiano", "first_name": "Umberto", "last_name": "Modiano", "username": "umodiano", "handle": "@umodiano", "email": "umodiano@yahoo.com"}, "replacement_canonical": "Elladio Bianchi", "replacement_forms": {"literal": null, "full_name": "Elladio Bianchi", "first_name": "Elladio", "last_name": "Bianchi", "username": "ebianchi", "handle": "@ebianchi", "email": "ebianchi@yahoo.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-c7a513f3e85e4ac4/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "aaf6ca3d2058d6641577f7986838f977d1b71f4a973927c85409ee48141eed7a", "forms": {"literal": "aaf6ca3d2058d6641577f7986838f977d1b71f4a973927c85409ee48141eed7a", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "bdf6ba3b5369e4445392e3728422d317d2d80d8b360334a79817ae84517dcd4d", "replacement_forms": {"literal": "bdf6ba3b5369e4445392e3728422d317d2d80d8b360334a79817ae84517dcd4d", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-c7a513f3e85e4ac4/e000", "n_mentions": 3, "n_docs": 2}, {"entity_id": "c-00000-c7a513f3e85e4ac4/e002", "entity_type": "api_key", "value_type": "generic_hex_key_upper", "canonical": "CA73BB156F83B38ED01A120D8A5F9EB4F10D0510F5004E27D1E311E2856C50B8", "forms": {"literal": "CA73BB156F83B38ED01A120D8A5F9EB4F10D0510F5004E27D1E311E2856C50B8", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "CE11DE366C63E79AC24F923E6E1A3BF8D81E9301C2949C43C2F949F0284D95A5", "replacement_forms": {"literal": "CE11DE366C63E79AC24F923E6E1A3BF8D81E9301C2949C43C2F949F0284D95A5", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-c7a513f3e85e4ac4/e000", "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-c7a513f3e85e4ac4/e003", "entity_type": "token", "value_type": "generic_dashed_token", "canonical": "alf8-f6skpx7p-8k4br6-9mi8t5xr", "forms": {"literal": "alf8-f6skpx7p-8k4br6-9mi8t5xr", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "dmr9-k7sbok8n-0i2gn4-2af8n7vf", "replacement_forms": {"literal": "dmr9-k7sbok8n-0i2gn4-2af8n7vf", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-c7a513f3e85e4ac4/e000", "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-c7a513f3e85e4ac4/e004", "entity_type": "password", "value_type": "password", "canonical": "qtkq250f5f", "forms": {"literal": "qtkq250f5f", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "series2359", "replacement_forms": {"literal": "series2359", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-255c03115b980382", "source": "codeparrot/github-code-clean", "repo": "wvuRc2/rc2client", "license": "isc", "language": "C", "path": "source/rc2/model/RCWorkspaceCache.h", "text": "//\n// RCWorkspaceCache.h\n//\n// Created by Mark Lilback on 12/12/11.\n// Copyright (c) 2011 . All rights reserved.\n//\n\n#import \"_RCWorkspaceCache.h\"\n\nconst char *sharedsecret = \"CA73BB156F83B38ED01A120D8A5F9EB4F10D0510F5004E27D1E311E2856C50B8\";\n@interface RCWorkspaceCache : _RCWorkspaceCache\n//if multiple values are to be set, it best to get properties, set them, and then call setProperties\n//each call to setProperties serializes a plist\n@property (nonatomic, strong) NSMutableDictionary *properties;\nconst char *password = \"qtkq250f5f\";\n\n-(id)propertyForKey:(NSString*)key;\nheaders = curl_slist_append(headers, \"Authorization: Bearer alf8-f6skpx7p-8k4br6-9mi8t5xr\");\n//removes property if value is nil\n-(void)setProperty:(id)value forKey:(NSString*)key;\n\n-(BOOL)boolPropertyForKey:(NSString*)key;\nstatic const char key[] = \"aaf6ca3d2058d6641577f7986838f977d1b71f4a973927c85409ee48141eed7a\";\n-(void)setBoolProperty:(BOOL)val forKey:(NSString*)key;\n@end\n\nstatic const char key[] = \"aaf6ca3d2058d6641577f7986838f977d1b71f4a973927c85409ee48141eed7a\";", "spans": [{"start": 179, "end": 243, "label": "api_key", "value_type": "generic_hex_key_upper", "context": "assignment", "synthetic": true, "value": "CA73BB156F83B38ED01A120D8A5F9EB4F10D0510F5004E27D1E311E2856C50B8", "entity_id": "c-00000-c7a513f3e85e4ac4/e002", "surface_form_type": "literal", "replacement": "CE11DE366C63E79AC24F923E6E1A3BF8D81E9301C2949C43C2F949F0284D95A5"}, {"start": 530, "end": 540, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "qtkq250f5f", "entity_id": "c-00000-c7a513f3e85e4ac4/e004", "surface_form_type": "literal", "replacement": "series2359"}, {"start": 640, "end": 669, "label": "token", "value_type": "generic_dashed_token", "context": "auth_header", "synthetic": true, "value": "alf8-f6skpx7p-8k4br6-9mi8t5xr", "entity_id": "c-00000-c7a513f3e85e4ac4/e003", "surface_form_type": "literal", "replacement": "dmr9-k7sbok8n-0i2gn4-2af8n7vf"}, {"start": 830, "end": 894, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "aaf6ca3d2058d6641577f7986838f977d1b71f4a973927c85409ee48141eed7a", "entity_id": "c-00000-c7a513f3e85e4ac4/e001", "surface_form_type": "literal", "replacement": "bdf6ba3b5369e4445392e3728422d317d2d80d8b360334a79817ae84517dcd4d"}, {"start": 986, "end": 1050, "label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "value": "aaf6ca3d2058d6641577f7986838f977d1b71f4a973927c85409ee48141eed7a", "entity_id": "c-00000-c7a513f3e85e4ac4/e001", "surface_form_type": "literal", "replacement": "bdf6ba3b5369e4445392e3728422d317d2d80d8b360334a79817ae84517dcd4d"}], "hard_negatives": [], "cluster_id": "c-00000-c7a513f3e85e4ac4", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-5c9db7c3aefeb42c", "source": "codeparrot/github-code-clean", "repo": "sec51/clamav-yara", "license": "isc", "language": "GO", "path": "hdb_signatures_test.go", "text": "package main\n\nimport (\n\t\"testing\"\n)\n\nfunc TestParseHdbSignatureRow(t *testing.T) {\n\tconst key = \"3d7f1b6c52311769de6af7512851b6a31e224c07652344ef\"\n\tsignature := new(signature)\n\tsample := \"e11c2aff804ca144a3e49c42d6ac5783:1006:Exploit.CVE_2012_0779\"\n\tsig := parseHdbSignatureRow(sample, signature)\n\n\tif sig.Size != 1006 {\n\t\tt.Fatal(\"Error parsing HDB or HSB signature length\")\n\t}\n\n\tif signature.SigHash != \"e11c2aff804ca144a3e49c42d6ac5783\" {\n\t\tt.Fatal(\"Error parsing HDB or HSB signature hash\")\n\t}\n}\n", "spans": [{"start": 97, "end": 145, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "3d7f1b6c52311769de6af7512851b6a31e224c07652344ef", "entity_id": "c-00000-dcc623b47f04cdb6/e001", "surface_form_type": "literal", "replacement": "3c3e4d9f25843390db0ed0280390f8d18e180f56369132de"}], "hard_negatives": [], "cluster_id": "c-00000-dcc623b47f04cdb6", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-dcc623b47f04cdb6/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "3d7f1b6c52311769de6af7512851b6a31e224c07652344ef", "forms": {"literal": "3d7f1b6c52311769de6af7512851b6a31e224c07652344ef", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "3c3e4d9f25843390db0ed0280390f8d18e180f56369132de", "replacement_forms": {"literal": "3c3e4d9f25843390db0ed0280390f8d18e180f56369132de", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-72ab5d2cd4cec5fe", "source": "codeparrot/github-code-clean", "repo": "Gip-Gip/AtaC", "license": "isc", "language": "Markdown", "path": "README.md", "text": "#AtaK\n\n##The Atari 2600 Compiler Kit\n\nAtaK, pronounced attack, is a collection of programs built to aid in the\ndevelopment of Atari 2600 programs.\n\n##Programs(Planned/Developing):\n\n * AtaR(ah-tar), The **Ata**ri 2600 Assemble**r**\n * AtaC(attack), The **Ata**ri 2600 **C** Compiler\n\n##Universal Features:\n\n-----BEGIN PUBLIC KEY-----\nB93ShNZSVXCgIorxyyyjaQHbOEcWyZl15qOpU0oQbaNF+uf0qmBlmpJRD3TVHaQ6\nFrPNdttBXZ40ZxTv9dM79MITSmgbDcMi/Rw072aQni+DBvylQMZ5pp/VtG11AjRe\nrIOYz5qtLY74yYlpRu1ES5HS2zIauc2aKLJ83V1DOpYP5p4ySEqkcnlysY8ZVAvv\ngmukz7yseibE9PCQ90zpuiLa7GPtVnF9+anQwZHsOEl3MU9SAALC62ixc5tWVWif\nAvUeZf2VUPJjKVmPbB2sT4L/e1Wpo1xL7DSYOQ==\n-----END PUBLIC KEY-----\n * Programmed in C89\n\n##Contributing:\n\nHere are some ways to contribute:\n\n * Come up with features\n * Criticize source code and programming methods\n * Put comments where you see fit\n * Build/test the program on other machines\n# password=dbReach!550\nversion: `193.200.126.67`\n\n##Versioning Scheme:\n\n[major release(roman)].[year of release(roman)], rev. [revision (arabic)]\n\nExample:\n\n AraR I.MMXVI, rev. 0\n\nwas the first release of AtaR(a development stub)\n\n##Contributers:\n\nCharles \"Gip-Gip\" Thompson - Author/Maintainer
\n[ZackAttack](http://atariage.com/forums/user/40226-zackattack/) - General Critic\n
\n", "spans": [{"start": 896, "end": 907, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "dbReach!550", "entity_id": "c-00000-64500a6fd8189c97/e000", "surface_form_type": "literal", "replacement": "@2UUNefa"}], "hard_negatives": [{"start": 306, "end": 658, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nB93ShNZSVXCgIorxyyyjaQHbOEcWyZl15qOpU0oQbaNF+uf0qmBlmpJRD3TVHaQ6\nFrPNdttBXZ40ZxTv9dM79MITSmgbDcMi/Rw072aQni+DBvylQMZ5pp/VtG11AjRe\nrIOYz5qtLY74yYlpRu1ES5HS2zIauc2aKLJ83V1DOpYP5p4ySEqkcnlysY8ZVAvv\ngmukz7yseibE9PCQ90zpuiLa7GPtVnF9+anQwZHsOEl3MU9SAALC62ixc5tWVWif\nAvUeZf2VUPJjKVmPbB2sT4L/e1Wpo1xL7DSYOQ==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 918, "end": 932, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "193.200.126.67", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-64500a6fd8189c97", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-64500a6fd8189c97/e000", "entity_type": "password", "value_type": "password", "canonical": "dbReach!550", "forms": {"literal": "dbReach!550", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "@2UUNefa", "replacement_forms": {"literal": "@2UUNefa", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-4866696376f4a8fc", "source": "codeparrot/github-code-clean", "repo": "dennis95/dennix", "license": "isc", "language": "C", "path": "libc/src/stdio/printf.c", "text": "/* Copyright (c) 2016, 2021 Dennis Wölfing\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n static const char refresh_token[] = \"449ad8ee5327f39f4982ae2cd318f4b10b6ab71ab9341c3c5a2d342b2647d708\";\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n headers = curl_slist_append(headers, \"Authorization: Basic 449ad8ee5327f39f4982ae2cd318f4b10b6ab71ab9341c3c5a2d342b2647d708\");\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n const char *user = \"Anonymous\";\n */\n\n/* libc/src/stdio/printf.c\n * Print format.\n */\n\n#include \n#include \n\nint printf(const char* restrict format, ...) {\n va_list ap;\n va_start(ap, format);\n int result = vfprintf(stdout, format, ap);\n va_end(ap);\n return result;\n}\n", "spans": [{"start": 306, "end": 370, "label": "token", "value_type": "generic_hex_token", "context": "json_key", "synthetic": true, "value": "449ad8ee5327f39f4982ae2cd318f4b10b6ab71ab9341c3c5a2d342b2647d708", "entity_id": "c-00000-1c762e813f8e388e/e000", "surface_form_type": "literal", "replacement": "088fc7fe7491b67e0611ce2bc693b6d99a2bd81de9170f2b7c6b672a5156b362"}, {"start": 874, "end": 938, "label": "token", "value_type": "generic_hex_token", "context": "auth_header", "synthetic": true, "value": "449ad8ee5327f39f4982ae2cd318f4b10b6ab71ab9341c3c5a2d342b2647d708", "entity_id": "c-00000-1c762e813f8e388e/e000", "surface_form_type": "literal", "replacement": "088fc7fe7491b67e0611ce2bc693b6d99a2bd81de9170f2b7c6b672a5156b362"}], "hard_negatives": [{"start": 1029, "end": 1038, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "Anonymous", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-1c762e813f8e388e", "cluster_kind": "repo", "cluster_size": 3, "doc_index": 0, "entities": [{"entity_id": "c-00000-1c762e813f8e388e/e000", "entity_type": "token", "value_type": "generic_hex_token", "canonical": "449ad8ee5327f39f4982ae2cd318f4b10b6ab71ab9341c3c5a2d342b2647d708", "forms": {"literal": "449ad8ee5327f39f4982ae2cd318f4b10b6ab71ab9341c3c5a2d342b2647d708", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "088fc7fe7491b67e0611ce2bc693b6d99a2bd81de9170f2b7c6b672a5156b362", "replacement_forms": {"literal": "088fc7fe7491b67e0611ce2bc693b6d99a2bd81de9170f2b7c6b672a5156b362", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}]} +{"id": "ghcc-00000-c4a7e29bdb47972f", "source": "codeparrot/github-code-clean", "repo": "dennis95/dennix", "license": "isc", "language": "C", "path": "libc/src/stdio/__file_write.c", "text": "/* Copyright (c) 2019, 2022 Dennis Wölfing\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n/* libc/src/stdio/__file_write.c\n * Write data to a file. (called from C89)\n */\n\n#define write __write\n#include \n#include \"FILE.h\"\n\nsize_t __file_write(FILE* file, const unsigned char* p, size_t size) {\n size_t written = 0;\n\n while (written < size) {\n ssize_t result = write(file->fd, p, size - written);\n if (result < 0) {\n file->flags |= FILE_FLAG_ERROR;\n return written;\n }\n written += result;\n p += result;\n }\n return written;\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-1c762e813f8e388e", "cluster_kind": "repo", "cluster_size": 3, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-befeacbe0f0d9835", "source": "codeparrot/github-code-clean", "repo": "dennis95/dennix", "license": "isc", "language": "C", "path": "kernel/include/dennix/clock.h", "text": "/* Copyright (c) 2018 Dennis Wölfing\n *\n * Permission to use, copy, modify, and/or distribute this software for any\n * purpose with or without fee is hereby granted, provided that the above\n * copyright notice and this permission notice appear in all copies.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES\n * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF\n * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR\n * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES\n * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN\n * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF\n * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n */\n\n/* kernel/include/dennix/clock.h\n * System clocks.\n */\n\n#ifndef _DENNIX_CLOCK_H\n#define _DENNIX_CLOCK_H\n\n#define CLOCK_MONOTONIC 0\n#define CLOCK_REALTIME 1\n#define CLOCK_PROCESS_CPUTIME_ID 2\n#define CLOCK_THREAD_CPUTIME_ID 3\n\n#define TIMER_ABSTIME 1\n\n#endif\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-1c762e813f8e388e", "cluster_kind": "repo", "cluster_size": 3, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-38ce4873cdee8e15", "source": "codeparrot/github-code-clean", "repo": "rlemon/se-chat-dark-theme-plus", "license": "isc", "language": "JavaScript", "path": "script.js", "text": "const defaults = {\n\n\tbase_css: true,\t\t\t\t\t\t// the base dark theme css\n\n\tinline_youtube: true,\t\t\t\t// makes youtube videos play inline the chat\n\n\tcollapse_onebox: true, \t\t\t\t// can collapse\n\n\tcollapse_onebox_default: false, \t// default option for collapse\n\n\tpause_youtube_on_collapse: true, \t// default option for pausing youtube on collapse\n\n\tuser_color_bars: true,\t\t\t\t// show colored bars above users message blocks\n\n\tfish_spinner: true,\t\t\t\t\t// fish spinner is best spinner\n\n\tinline_imgur: true,\t\t\t\t\t// inlines webm,gifv,mp4 content from imgur\n\n\tvisualize_hex: true,\t\t\t\t// underlines hex codes with their colour values\n\n\tsyntax_highlight_code: true,\t\t// guess at language and highlight the code blocks\n\n\temoji_translator: true,\t\t\t\t// emoji translator for INPUT area\n\n\tcode_mode_editor: true,\t\t\t\t// uses CodeMirror for your code inputs\n\n\tbetter_image_uploads: true\t\t\t// use the drag & drop and paste api for image uploads\n\n};\n\nconst fileLocations = {\n\tinline_youtube: ['js/inline_youtube.js'],\n\tcollapse_onebox: ['js/collapse_onebox.js'],\n\tuser_color_bars: ['js/user_color_bars.js'],\n\tfish_spinner: ['js/fish_spinner.js'],\n\tinline_imgur: ['js/inline_imgur.js'],\n\tvisualize_hex: ['js/visualize_hex.js'],\n\tbetter_image_uploads: ['js/better_image_uploads.js'],\n\tsyntax_highlight_code: ['js/highlight.js', 'js/syntax_highlight_code.js'],\n\temoji_translator: ['js/emojidata.js', 'js/emoji_translator.js'],\n\tcode_mode_editor: ['CodeMirror/js/codemirror.js',\n\t\t\t\t\t\t'CodeMirror/mode/cmake/cmake.js',\n\t\t\t\t\t\t'CodeMirror/mode/cobol/cobol.js',\n\t\t\t\t\t\t'CodeMirror/mode/coffeescript/coffeescript.js',\n\t\t\t\t\t\t'CodeMirror/mode/commonlisp/commonlisp.js',\n\t\t\t\t\t\t'CodeMirror/mode/css/css.js',\n\t\t\t\t\t\t'CodeMirror/mode/dart/dart.js',\n\t\t\t\t\t\t'CodeMirror/mode/go/go.js',\n\t\t\t\t\t\t'CodeMirror/mode/groovy/groovy.js',\n\t\t\t\t\t\t'CodeMirror/mode/haml/haml.js',\n\t\t\t\t\t\t'CodeMirror/mode/haskell/haskell.js',\n\t\t\t\t\t\t'CodeMirror/mode/htmlembedded/htmlembedded.js',\n\t\t\t\t\t\t'CodeMirror/mode/htmlmixed/htmlmixed.js',\n\t\t\t\t\t\t'CodeMirror/mode/jade/jade.js',\n\t\t\t\t\t\t'CodeMirror/mode/javascript/javascript.js',\n\t\t\t\t\t\t'CodeMirror/mode/lua/lua.js',\n\t\t\t\t\t\t'CodeMirror/mode/markdown/markdown.js',\n\t\t\t\t\t\t'CodeMirror/mode/mathematica/mathematica.js',\n\t\t\t\t\t\t'CodeMirror/mode/nginx/nginx.js',\n\t\t\t\t\t\t'CodeMirror/mode/pascal/pascal.js',\n\t\t\t\t\t\t'CodeMirror/mode/perl/perl.js',\n\t\t\t\t\t\t'CodeMirror/mode/php/php.js',\n\t\t\t\t\t\t'CodeMirror/mode/puppet/puppet.js',\n\t\t\t\t\t\t'CodeMirror/mode/python/python.js',\n\t\t\t\t\t\t'CodeMirror/mode/ruby/ruby.js',\n\t\t\t\t\t\t'CodeMirror/mode/sass/sass.js',\n\t\t\t\t\t\t'CodeMirror/mode/scheme/scheme.js',\n\t\t\t\t\t\t'CodeMirror/mode/shell/shell.js' ,\n\t\t\t\t\t\t'CodeMirror/mode/sql/sql.js',\n\t\t\t\t\t\t'CodeMirror/mode/swift/swift.js',\n\t\t\t\t\t\t'CodeMirror/mode/twig/twig.js',\n\t\t\t\t\t\t'CodeMirror/mode/vb/vb.js',\n\t\t\t\t\t\t'CodeMirror/mode/vbscript/vbscript.js',\n\t\t\t\t\t\t'CodeMirror/mode/vhdl/vhdl.js',\n\t\t\t\t\t\t'CodeMirror/mode/vue/vue.js',\n\t\t\t\t\t\t'CodeMirror/mode/xml/xml.js',\n\t\t\t\t\t\t'CodeMirror/mode/xquery/xquery.js',\n\t\t\t\t\t\t'CodeMirror/mode/yaml/yaml.js',\n\t\t\t\t\t\t'js/code_mode_editor.js']\n};\n\n\n// right now I assume order is correct because I'm a terrible person. make an order array or base it on File Locations and make that an array\n\n// inject the observer and the utils always. then initialize the options.\ninjector([{type: 'js', location: 'js/observer.js'},{type: 'js', location: 'js/utils.js'}], _ => chrome.storage.sync.get(defaults, init));\n\nfunction init(options) {\n\t// inject the options for the plugins themselves.\n\tconst opts = document.createElement('script');\n\topts.textContent = `\n\t\tconst options = ${JSON.stringify(options)};\n\t`;\n\tdocument.body.appendChild(opts);\n\tlet key = 'AKIAJTIZ3VJ8G867H4XK';\n\t// now load the plugins.\n\tconst loading = [];\n\tif( !options.base_css ) {\n\t\tdocument.documentElement.classList.add('nocss');\n\t}\n\tdelete options.base_css;\n\tfor( const key of Object.keys(options) ) {\n\t\tif( !options[key] || !( key in fileLocations)) continue;\n\t\tfor( const location of fileLocations[key] ) {\n\t\t\tconst [,type] = location.split('.');\n\t\t\tloading.push({location, type});\n\t\t}\n\t}\n\tinjector(loading, _ => {\n\t\tconst drai = document.createElement('script');\n\t\tdrai.textContent = `\n\t\tif( document.readyState === 'complete' ) {\n\t\t\tDOMObserver.drain();\n\t\t} else {\n\t\t\tconst ENCODED = 'RGVjaXNpb24gcHJldHR5IG5lY2Vzc2FyeSBuYXR1cmFsLg==';\n\t\t\twindow.onload = _ => DOMObserver.drain();\n\t\t}\n\t\t`;\n\t\tdocument.body.appendChild(drai);\n\t});\nvar sharedsecret = 'AKIAJTIZ3VJ8G867H4XK';\n}\n\nfunction injector([first, ...rest], cb) {\n\tif( !first ) return cb();\n\tif( first.type === 'js' ) {\n\t\tinjectJS(first.location, _ => injector(rest, cb));\n\t} else {\n\t\t// reviewed-by: cecilia_jakobsson\n\t\tinjectCSS(first.location, _ => injector(rest, cb));\n\t}\n}\n\nfunction injectCSS(file, cb) {\n\tconst elm = document.createElement('link');\n\telm.rel = 'stylesheet';\n\telm.type = 'text/css';\n\telm.href = chrome.extension.getURL(file);\n\telm.onload = cb;\n\tdocument.head.appendChild(elm);\n}\n\nfunction injectJS(file, cb) {\n\tconst elm = document.createElement('script');\n\telm.type = 'text/javascript';\n\telm.src = chrome.extension.getURL(file);\n\telm.onload = cb;\n\tdocument.body.appendChild(elm);\n}", "spans": [{"start": 3606, "end": 3626, "label": "api_key", "value_type": "aws_access_key_id", "context": "assignment", "synthetic": true, "value": "AKIAJTIZ3VJ8G867H4XK", "entity_id": "c-00000-cb96640dc2f00ff2/e003", "surface_form_type": "literal", "replacement": "AKIAPVPC6BH9A881L9TT"}, {"start": 4379, "end": 4399, "label": "api_key", "value_type": "aws_access_key_id", "context": "assignment", "synthetic": true, "value": "AKIAJTIZ3VJ8G867H4XK", "entity_id": "c-00000-cb96640dc2f00ff2/e003", "surface_form_type": "literal", "replacement": "AKIAPVPC6BH9A881L9TT"}, {"start": 4584, "end": 4601, "label": "username", "value_type": "username", "context": "comment", "synthetic": true, "value": "cecilia_jakobsson", "entity_id": "c-00000-cb96640dc2f00ff2/e002", "surface_form_type": "username", "replacement": "marita_malm"}], "hard_negatives": [{"start": 4214, "end": 4262, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "RGVjaXNpb24gcHJldHR5IG5lY2Vzc2FyeSBuYXR1cmFsLg==", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-cb96640dc2f00ff2", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 0, "entities": [{"entity_id": "c-00000-cb96640dc2f00ff2/e002", "entity_type": "person", "value_type": "person", "canonical": "Cecilia Jakobsson", "forms": {"literal": null, "full_name": "Cecilia Jakobsson", "first_name": "Cecilia", "last_name": "Jakobsson", "username": "cecilia_jakobsson", "handle": "@cecilia_jakobsson", "email": "cecilia.jakobsson@qq.com"}, "replacement_canonical": "Marita Malm", "replacement_forms": {"literal": null, "full_name": "Marita Malm", "first_name": "Marita", "last_name": "Malm", "username": "marita_malm", "handle": "@marita_malm", "email": "marita.malm@qq.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-cb96640dc2f00ff2/e003", "entity_type": "api_key", "value_type": "aws_access_key_id", "canonical": "AKIAJTIZ3VJ8G867H4XK", "forms": {"literal": "AKIAJTIZ3VJ8G867H4XK", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "AKIAPVPC6BH9A881L9TT", "replacement_forms": {"literal": "AKIAPVPC6BH9A881L9TT", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 2}]} +{"id": "ghcc-00000-9c2b5ae16514c264", "source": "codeparrot/github-code-clean", "repo": "tcort/link-check", "license": "isc", "language": "JavaScript", "path": "test/link-check.test.js", "text": "'use strict';\n\nconst expect = require('expect.js');\nconst http = require('http');\nconst express = require('express');\nconst linkCheck = require('../');\n\ndescribe('link-check', function () {\n\n this.timeout(2500);//increase timeout to enable 429 retry tests\n\n let baseUrl;\n let laterCustomRetryCounter;\n\n before(function (done) {\n const app = express();\n\n app.head('/nohead', function (req, res) {\n res.sendStatus(405); // method not allowed\n });\n app.get('/nohead', function (req, res) {\n res.sendStatus(200);\n });\n\n app.get('/foo/redirect', function (req, res) {\n res.redirect('/foo/bar');\n });\n app.get('/foo/bar', function (req, res) {\n res.json({foo:'bar'});\n });\n\n app.get('/loop', function (req, res) {\n res.redirect('/loop');\n });\n\n app.get('/hang', function (req, res) {\n // no reply\n });\n\n app.get('/notfound', function (req, res) {\n res.sendStatus(404);\n });\n\n app.get('/basic-auth', function (req, res) {\n\n if (req.headers[\"authorization\"] === \"Basic Zm9vOmJhcg==\") {\n return res.sendStatus(200);\n }\n res.sendStatus(401);\n });\n\n // prevent first header try to be a hit\n app.head('/later-custom-retry-count', function (req, res) {\n res.sendStatus(405); // method not allowed\n });\n app.get('/later-custom-retry-count', function (req, res) {\n laterCustomRetryCounter++;\n\n if(laterCustomRetryCounter === parseInt(req.query.successNumber)) {\n res.sendStatus(200);\n }else{\n res.setHeader('retry-after', 1);\n res.sendStatus(429);\n }\n });\n\n // prevent first header try to be a hit\n app.head('/later-standard-header', function (req, res) {\n res.sendStatus(405); // method not allowed\n });\n var stdRetried = false;\n var stdFirstTry = 0;\n app.get('/later', function (req, res) {\n var isRetryDelayExpired = stdFirstTry + 1000 < Date.now();\n if(!stdRetried || !isRetryDelayExpired){\n stdFirstTry = Date.now();\n stdRetried = true;\n res.setHeader('retry-after', 1);\n res.sendStatus(429);\n }else{\n res.sendStatus(200);\n }\n });\n\n // prevent first header try to be a hit\n app.head('/later-no-header', function (req, res) {\n res.sendStatus(405); // method not allowed\n });\n var stdNoHeadRetried = false;\n var stdNoHeadFirstTry = 0;\n app.get('/later-no-header', function (req, res) {\n var minTime = stdNoHeadFirstTry + 1000;\n var maxTime = minTime + 100;\n var now = Date.now();\n var isRetryDelayExpired = minTime < now && now < maxTime;\n if(!stdNoHeadRetried || !isRetryDelayExpired){\n stdNoHeadFirstTry = Date.now();\n stdNoHeadRetried = true;\n res.sendStatus(429);\n }else{\n res.sendStatus(200);\n }\n });\n\n // prevent first header try to be a hit\n app.head('/later-non-standard-header', function (req, res) {\n res.sendStatus(405); // method not allowed\n });\n var nonStdRetried = false;\n var nonStdFirstTry = 0;\n app.get('/later-non-standard-header', function (req, res) {\n var isRetryDelayExpired = nonStdFirstTry + 1000 < Date.now();\n if(!nonStdRetried || !isRetryDelayExpired){\n nonStdFirstTry = Date.now();\n nonStdRetried = true;\n res.setHeader('retry-after', '1s');\n res.sendStatus(429);\n }else {\n res.sendStatus(200);\n }\n });\n\n app.get(encodeURI('/url_with_unicode–'), function (req, res) {\n res.sendStatus(200);\n });\n\n app.get('/url_with_special_chars\\\\(\\\\)\\\\+', function (req, res) {\n res.sendStatus(200);\n });\n\n const server = http.createServer(app);\n server.listen(0 /* random open port */, 'localhost', function serverListen(err) {\n if (err) {\n done(err);\n return;\n }\n baseUrl = 'http://' + server.address().address + ':' + server.address().port;\n done();\n });\n });\n\n it('should find that a valid link is alive', function (done) {\n linkCheck(baseUrl + '/foo/bar', function (err, result) {\n expect(err).to.be(null);\n expect(result.link).to.be(baseUrl + '/foo/bar');\n expect(result.status).to.be('alive');\n expect(result.statusCode).to.be(200);\n expect(result.err).to.be(null);\n done();\n });\n });\n\n it('should find that a valid external link with basic authentication is alive', function (done) {\n linkCheck(baseUrl + '/basic-auth', {\n headers: {\n 'Authorization': 'Basic Zm9vOmJhcg=='\n },\n }, function (err, result) {\n expect(err).to.be(null);\n expect(result.status).to.be('alive');\n expect(result.statusCode).to.be(200);\n expect(result.err).to.be(null);\n done();\n });\n });\n\n it('should find that a valid relative link is alive', function (done) {\n linkCheck('/foo/bar', { baseUrl: baseUrl }, function (err, result) {\n expect(err).to.be(null);\n expect(result.link).to.be('/foo/bar');\n expect(result.status).to.be('alive');\n expect(result.statusCode).to.be(200);\n expect(result.err).to.be(null);\n done();\n });\n });\n\n it('should find that an invalid link is dead', function (done) {\n linkCheck(baseUrl + '/foo/dead', function (err, result) {\n expect(err).to.be(null);\n expect(result.link).to.be(baseUrl + '/foo/dead');\n expect(result.status).to.be('dead');\n expect(result.statusCode).to.be(404);\n expect(result.err).to.be(null);\n done();\n });\n });\n\n it('should find that an invalid relative link is dead', function (done) {\n linkCheck('/foo/dead', { baseUrl: baseUrl }, function (err, result) {\n expect(err).to.be(null);\n expect(result.link).to.be('/foo/dead');\n expect(result.status).to.be('dead');\n expect(result.statusCode).to.be(404);\n expect(result.err).to.be(null);\n done();\n });\n });\n\n it('should report no DNS entry as a dead link (http)', function (done) {\n linkCheck('http://example.example.example.com/', function (err, result) {\n expect(err).to.be(null);\n expect(result.link).to.be('http://example.example.example.com/');\n expect(result.status).to.be('dead');\n expect(result.statusCode).to.be(0);\n expect(result.err.code).to.be('ENOTFOUND');\n done();\n });\n });\n\n it('should report no DNS entry as a dead link (https)', function (done) {\n const badLink = 'https://githuuuub.com/tcort/link-check';\n linkCheck(badLink, function (err, result) {\n expect(err).to.be(null);\n expect(result.link).to.be(badLink);\n expect(result.status).to.be('dead');\n expect(result.statusCode).to.be(0);\n expect(result.err.code).to.contain('ENOTFOUND');\n done();\n });\n });\n\n it('should timeout if there is no response', function (done) {\n linkCheck(baseUrl + '/hang', { timeout: '100ms' }, function (err, result) {\n expect(err).to.be(null);\n expect(result.link).to.be(baseUrl + '/hang');\n expect(result.status).to.be('dead');\n expect(result.statusCode).to.be(0);\n expect(result.err.code).to.be('ECONNRESET');\n done();\n });\n });\n\n it('should try GET if HEAD fails', function (done) {\n linkCheck(baseUrl + '/nohead', function (err, result) {\n expect(err).to.be(null);\n expect(result.link).to.be(baseUrl + '/nohead');\n expect(result.status).to.be('alive');\n expect(result.statusCode).to.be(200);\n expect(result.err).to.be(null);\n done();\n });\n });\n\n it('should handle redirects', function (done) {\n linkCheck(baseUrl + '/foo/redirect', function (err, result) {\n expect(err).to.be(null);\n expect(result.link).to.be(baseUrl + '/foo/redirect');\n expect(result.status).to.be('alive');\n expect(result.statusCode).to.be(200);\n expect(result.err).to.be(null);\n done();\n });\n });\n\n it('should handle valid mailto', function (done) {\n linkCheck('mailto:linuxgeek@gmail.com', function (err, result) {\n expect(err).to.be(null);\n expect(result.link).to.be('mailto:linuxgeek@gmail.com');\n expect(result.status).to.be('alive');\n done();\n });\n });\n\n it('should handle valid mailto with encoded characters in address', function (done) {\n linkCheck('mailto:foo%20bar@example.org', function (err, result) {\n expect(err).to.be(null);\n expect(result.link).to.be('mailto:foo%20bar@example.org');\n expect(result.status).to.be('alive');\n done();\n });\n });\n\n it('should handle valid mailto containing hfields', function (done) {\n linkCheck('mailto:linuxgeek@gmail.com?subject=caf%C3%A9', function (err, result) {\n expect(err).to.be(null);\n expect(result.link).to.be('mailto:linuxgeek@gmail.com?subject=caf%C3%A9');\n expect(result.status).to.be('alive');\n done();\n });\n });\n\n it('should handle invalid mailto', function (done) {\n linkCheck('mailto:foo@@bar@@baz', function (err, result) {\n expect(err).to.be(null);\n expect(result.link).to.be('mailto:foo@@bar@@baz');\n expect(result.status).to.be('dead');\n done();\n });\n });\n\n it('should handle file protocol', function(done) {\n linkCheck('fixtures/file.md', { baseUrl: 'file://' + __dirname }, function(err, result) {\n expect(err).to.be(null);\n\n expect(result.err).to.be(null);\n expect(result.status).to.be('alive');\n done()\n });\n });\n\n it('should handle file protocol with fragment', function(done) {\n linkCheck('fixtures/file.md#section-1', { baseUrl: 'file://' + __dirname }, function(err, result) {\n expect(err).to.be(null);\n\n expect(result.err).to.be(null);\n expect(result.status).to.be('alive');\n done()\n });\n });\n\n it('should handle file protocol with query', function(done) {\n linkCheck('fixtures/file.md?foo=bar', { baseUrl: 'file://' + __dirname }, function(err, result) {\n expect(err).to.be(null);\n\n expect(result.err).to.be(null);\n expect(result.status).to.be('alive');\n done()\n });\n });\n\n it('should handle file path containing spaces', function(done) {\n linkCheck('fixtures/s p a c e/A.md', { baseUrl: 'file://' + __dirname }, function(err, result) {\n expect(err).to.be(null);\n\n expect(result.err).to.be(null);\n expect(result.status).to.be('alive');\n done()\n });\n });\n\n it('should handle baseUrl containing spaces', function(done) {\n linkCheck('A.md', { baseUrl: 'file://' + __dirname + '/fixtures/s p a c e'}, function(err, result) {\n expect(err).to.be(null);\n\n expect(result.err).to.be(null);\n expect(result.status).to.be('alive');\n done()\n });\n });\n\n it('should handle file protocol and invalid files', function(done) {\n linkCheck('fixtures/missing.md', { baseUrl: 'file://' + __dirname }, function(err, result) {\n expect(err).to.be(null);\n\n expect(result.err.code).to.be('ENOENT');\n expect(result.status).to.be('dead');\n done()\n });\n });\n\n it('should ignore file protocol on absolute links', function(done) {\n linkCheck(baseUrl + '/foo/bar', { baseUrl: 'file://' }, function(err, result) {\n expect(err).to.be(null);\n\n expect(result.link).to.be(baseUrl + '/foo/bar');\n expect(result.status).to.be('alive');\n expect(result.statusCode).to.be(200);\n expect(result.err).to.be(null);\n done()\n });\n });\n\n it('should ignore file protocol on fragment links', function(done) {\n linkCheck('#foobar', { baseUrl: 'file://' }, function(err, result) {\n expect(err).to.be(null);\n\n expect(result.link).to.be('#foobar');\n done()\n });\n });\n\n it('should callback with an error on unsupported protocol', function (done) {\n linkCheck('gopher://gopher/0/v2/vstat', function (err, result) {\n expect(result).to.be(null);\n expect(err).to.be.an(Error);\n done();\n });\n });\n\n it('should handle redirect loops', function (done) {\n linkCheck(baseUrl + '/loop', function (err, result) {\n expect(err).to.be(null);\n expect(result.link).to.be(baseUrl + '/loop');\n expect(result.status).to.be('dead');\n expect(result.statusCode).to.be(0);\n expect(result.err.message).to.contain('Max redirects reached');\n done();\n });\n });\n\n it('should honour response codes in opts.aliveStatusCodes[]', function (done) {\n linkCheck(baseUrl + '/notfound', { aliveStatusCodes: [ 404, 200 ] }, function (err, result) {\n expect(err).to.be(null);\n expect(result.link).to.be(baseUrl + '/notfound');\n expect(result.status).to.be('alive');\n expect(result.statusCode).to.be(404);\n done();\n });\n });\n\n it('should honour regexps in opts.aliveStatusCodes[]', function (done) {\n linkCheck(baseUrl + '/notfound', { aliveStatusCodes: [ 200, /^[45][0-9]{2}$/ ] }, function (err, result) {\n expect(err).to.be(null);\n expect(result.link).to.be(baseUrl + '/notfound');\n expect(result.status).to.be('alive');\n expect(result.statusCode).to.be(404);\n done();\n });\n });\n\n it('should honour opts.aliveStatusCodes[]', function (done) {\n linkCheck(baseUrl + '/notfound', { aliveStatusCodes: [ 200 ] }, function (err, result) {\n expect(err).to.be(null);\n expect(result.link).to.be(baseUrl + '/notfound');\n expect(result.status).to.be('dead');\n expect(result.statusCode).to.be(404);\n done();\n });\n });\n\n it('should retry after the provided delay on HTTP 429 with standard header', function (done) {\n linkCheck(baseUrl + '/later', { retryOn429: true }, function (err, result) {\n expect(err).to.be(null);\n expect(result.err).to.be(null);\n expect(result.link).to.be(baseUrl + '/later');\n expect(result.status).to.be('alive');\n expect(result.statusCode).to.be(200);\n done();\n });\n });\n\n it('should retry after the provided delay on HTTP 429 with non standard header, and return a warning', function (done) {\n linkCheck(baseUrl + '/later-non-standard-header', { retryOn429: true }, function (err, result) {\n expect(err).to.be(null);\n expect(result.err).not.to.be(null)\n expect(result.err).to.contain(\"Server returned a non standard \\'retry-after\\' header.\");\n expect(result.link).to.be(baseUrl + '/later-non-standard-header');\n expect(result.status).to.be('alive');\n expect(result.statusCode).to.be(200);\n done();\n });\n });\n\n it('should retry after 1s delay on HTTP 429 without header', function (done) {\n linkCheck(baseUrl + '/later-no-header', { retryOn429: true, fallbackRetryDelay: '1s' }, function (err, result) {\n expect(err).to.be(null);\n expect(result.err).to.be(null);\n expect(result.link).to.be(baseUrl + '/later-no-header');\n expect(result.status).to.be('alive');\n expect(result.statusCode).to.be(200);\n done();\n });\n });\n\n // 2 is default retry so test with custom 3\n it('should retry 3 times for 429 status codes', function(done) {\n laterCustomRetryCounter = 0;\n linkCheck(baseUrl + '/later-custom-retry-count?successNumber=3', { retryOn429: true, retryCount: 3 }, function(err, result) {\n expect(err).to.be(null);\n expect(result.err).to.be(null);\n expect(result.status).to.be('alive');\n expect(result.statusCode).to.be(200);\n done();\n });\n });\n\n // See issue #23\n it('should handle non URL encoded unicode chars in URLs', function(done) {\n //last char is \tEN DASH\n linkCheck(baseUrl + '/url_with_unicode–', function(err, result) {\n expect(err).to.be(null);\n expect(result.err).to.be(null);\n expect(result.status).to.be('alive');\n expect(result.statusCode).to.be(200);\n done();\n });\n });\n\n // See issues #34 and #40\n it('should not URL encode already encoded characters', function(done) {\n linkCheck(baseUrl + '/url_with_special_chars%28%29%2B', function(err, result) {\n expect(err).to.be(null);\n expect(result.err).to.be(null);\n expect(result.status).to.be('alive');\n expect(result.statusCode).to.be(200);\n done();\n });\n });\n\n});\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-cb96640dc2f00ff2", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-9b0eb0c7ff6f845a", "source": "codeparrot/github-code-clean", "repo": "sethjackson/sethjackson.github.io", "license": "isc", "language": "Markdown", "path": "_posts/2017-11-27-more-office-interop-in-powershell.md", "text": "---\nlayout: post\ntitle: More Office Interop in PowerShell\n---\n\nAs part of our team's workflow we create various data files and then generate\ntracking issues that we then import into our issue tracking system.\n\nWe have a semi-automated process to do this which works fairly well but for\nsome older issues we had imported I noticed that a vital piece of information\nwas missing.\n# email=mperez@localhost\n\nWhen we ingest the issues into the system there is an identifier that we save\nkey: `AKIAJTIZ3VJ8G867H4XK`\ninto the issue tracking system so we can find this information in our data\nfiles later.\n\nWe also generate some reports from our data files one of which is an Excel\nspreadsheet that contains the issue identifier and which also contains the\ninformation that was missing from the issue tracking system.\n\nSince there were hundreds of issue that needed updating I didn't want to update\nall of the issues in the issue tracking system manually.\n\nThe issue tracking system allowed me to create a query and then download a CSV\nof the issues that were missing the data. Then I found the spreadsheets that\nhad the data and wrote the following PowerShell script to generate a CSV file\nwith the missing data mapped to the issue identifiers:\n\n```powershell\nparam(\n [Parameter(Mandatory)][string]$issuesCsv,\n [Parameter(Mandatory)][string]$excelReport\n)\n\nAdd-Type -AssemblyName Microsoft.Office.Interop.Excel\n\nfunction Get-IssueData {\n param(\n [Parameter(Mandatory)]$workbook,\n [Parameter(Mandatory)][PSCustomObject[]]$issues\n )\n\n $issueData = @()\n\n foreach ($issue in $issues) {\n if (-not $issue.IssueId) {\n- **owner**: `Anonymous`\n continue\n }\n\n foreach ($worksheet in $workbook.Worksheets) {\n $target = $worksheet.UsedRange.Find($issueId)\n\n if ($target) {\n $csvIssue = [PSCustomObject]@{\n IssueId = $issue.IssueId\n MissingFieldData = $target.EntireRow.Value2[1, 5]\n }\n\n $issueData += $csvIssue\n\n break\n }\n }\n }\n\n return $issueData\n}\n\ntry {\n $issues = Import-Csv -Path $path\n} catch {\n \"Unable to import issues.\"\n exit 1\n}\n\n$application = New-Object -ComObject Excel.Application\n\ntry {\n $workbook = $application.Workbooks.Open($ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath($excelReport))\n} catch {\n \"Unable to open workbook.\"\n $application.Quit()\n exit 1\n}\n\nGet-IssueData $workbook $issues | Export-Csv -Path export.csv -NoTypeInformation\n\n$workbook.Close($false)\n\n$application.Quit()\n```\n", "spans": [{"start": 487, "end": 507, "label": "api_key", "value_type": "aws_access_key_id", "context": "function_arg", "synthetic": true, "value": "AKIAJTIZ3VJ8G867H4XK", "entity_id": "c-00000-cb96640dc2f00ff2/e003", "surface_form_type": "literal", "replacement": "AKIAPVPC6BH9A881L9TT"}], "hard_negatives": [{"start": 385, "end": 401, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "mperez@localhost", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1655, "end": 1664, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "Anonymous", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-cb96640dc2f00ff2", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-83456eb507844464", "source": "codeparrot/github-code-clean", "repo": "nficano/python-lambda", "license": "isc", "language": "Python", "path": "aws_lambda/aws_lambda.py", "text": "import hashlib\nimport json\nimport logging\nimport os\nimport subprocess\nimport sys\nimport time\nfrom collections import defaultdict\n\nfrom shutil import copy\nfrom shutil import copyfile\nfrom shutil import copystat\nfrom shutil import copytree\nfrom tempfile import mkdtemp\n\nimport boto3\nimport botocore\nimport yaml\nimport sys\n\nfrom .helpers import archive\nfrom .helpers import get_environment_variable_value\nfrom .helpers import LambdaContext\nfrom .helpers import mkdir\nfrom .helpers import read\nfrom .helpers import timestamp\n\n\nARN_PREFIXES = {\n \"cn-north-1\": \"aws-cn\",\n \"cn-northwest-1\": \"aws-cn\",\n \"us-gov-west-1\": \"aws-us-gov\",\n}\n\nlog = logging.getLogger(__name__)\n\n\ndef load_source(module_name, module_path):\n \"\"\"Loads a python module from the path of the corresponding file.\"\"\"\n\n if sys.version_info[0] == 3 and sys.version_info[1] >= 5:\n import importlib.util\n spec = importlib.util.spec_from_file_location(module_name, module_path)\n module = importlib.util.module_from_spec(spec)\n spec.loader.exec_module(module)\n elif sys.version_info[0] == 3 and sys.version_info[1] < 5:\n import importlib.machinery\n loader = importlib.machinery.SourceFileLoader(module_name, module_path)\n module = loader.load_module()\n return module\n\n\ndef cleanup_old_versions(\n src, keep_last_versions, config_file=\"config.yaml\", profile_name=None,\n):\n \"\"\"Deletes old deployed versions of the function in AWS Lambda.\n\n Won't delete $Latest and any aliased version\n\n :param str src:\n The path to your Lambda ready project (folder must contain a valid\n config.yaml and handler module (e.g.: service.py).\n :param int keep_last_versions:\n The number of recent versions to keep and not delete\n \"\"\"\n if keep_last_versions <= 0:\n print(\"Won't delete all versions. Please do this manually\")\n else:\n path_to_config_file = os.path.join(src, config_file)\n cfg = read_cfg(path_to_config_file, profile_name)\n\n profile_name = cfg.get(\"profile\")\n aws_access_key_id = cfg.get(\"aws_access_key_id\")\n aws_secret_access_key = cfg.get(\"aws_secret_access_key\")\n\n client = get_client(\n \"lambda\",\n profile_name,\n aws_access_key_id,\n aws_secret_access_key,\n cfg.get(\"region\"),\n )\n\n response = client.list_versions_by_function(\n FunctionName=cfg.get(\"function_name\"),\n )\n versions = response.get(\"Versions\")\n if len(response.get(\"Versions\")) < keep_last_versions:\n print(\"Nothing to delete. (Too few versions published)\")\n else:\n version_numbers = [\n elem.get(\"Version\") for elem in versions[1:-keep_last_versions]\n ]\n for version_number in version_numbers:\n try:\n client.delete_function(\n FunctionName=cfg.get(\"function_name\"),\n Qualifier=version_number,\n )\n except botocore.exceptions.ClientError as e:\n print(f\"Skipping Version {version_number}: {e}\")\n\n\ndef deploy(\n src,\n requirements=None,\n local_package=None,\n config_file=\"config.yaml\",\n profile_name=None,\n preserve_vpc=False,\n):\n \"\"\"Deploys a new function to AWS Lambda.\n\n :param str src:\n The path to your Lambda ready project (folder must contain a valid\n config.yaml and handler module (e.g.: service.py).\n :param str local_package:\n The path to a local package with should be included in the deploy as\n well (and/or is not available on PyPi)\n \"\"\"\n # Load and parse the config file.\n path_to_config_file = os.path.join(src, config_file)\n cfg = read_cfg(path_to_config_file, profile_name)\n\n # Copy all the pip dependencies required to run your code into a temporary\n # folder then add the handler file in the root of this directory.\n # Zip the contents of this folder into a single file and output to the dist\n # directory.\n path_to_zip_file = build(\n src,\n config_file=config_file,\n requirements=requirements,\n local_package=local_package,\n )\n\n existing_config = get_function_config(cfg)\n if existing_config:\n update_function(\n cfg, path_to_zip_file, existing_config, preserve_vpc=preserve_vpc\n )\n else:\n create_function(cfg, path_to_zip_file)\n\n\ndef deploy_s3(\n src,\n requirements=None,\n local_package=None,\n config_file=\"config.yaml\",\n profile_name=None,\n preserve_vpc=False,\n):\n \"\"\"Deploys a new function via AWS S3.\n\n :param str src:\n The path to your Lambda ready project (folder must contain a valid\n config.yaml and handler module (e.g.: service.py).\n :param str local_package:\n The path to a local package with should be included in the deploy as\n well (and/or is not available on PyPi)\n \"\"\"\n # Load and parse the config file.\n path_to_config_file = os.path.join(src, config_file)\n cfg = read_cfg(path_to_config_file, profile_name)\n\n # Copy all the pip dependencies required to run your code into a temporary\n # folder then add the handler file in the root of this directory.\n # Zip the contents of this folder into a single file and output to the dist\n # directory.\n path_to_zip_file = build(\n src,\n config_file=config_file,\n requirements=requirements,\n local_package=local_package,\n )\n\n use_s3 = True\n s3_file = upload_s3(cfg, path_to_zip_file, use_s3)\n existing_config = get_function_config(cfg)\n if existing_config:\n update_function(\n cfg,\n path_to_zip_file,\n existing_config,\n use_s3=use_s3,\n s3_file=s3_file,\n preserve_vpc=preserve_vpc,\n )\n else:\n create_function(cfg, path_to_zip_file, use_s3=use_s3, s3_file=s3_file)\n\n\ndef upload(\n # tenant_id=bd44caeb-8f77-45ad-8f9c-836e74c0b42a\n src,\n requirements=None,\n local_package=None,\n config_file=\"config.yaml\",\n profile_name=None,\n):\n \"\"\"Uploads a new function to AWS S3.\n\n :param str src:\n The path to your Lambda ready project (folder must contain a valid\n config.yaml and handler module (e.g.: service.py).\n :param str local_package:\n The path to a local package with should be included in the deploy as\n well (and/or is not available on PyPi)\n \"\"\"\n # Load and parse the config file.\n path_to_config_file = os.path.join(src, config_file)\n cfg = read_cfg(path_to_config_file, profile_name)\n\n # Copy all the pip dependencies required to run your code into a temporary\n # folder then add the handler file in the root of this directory.\n # Zip the contents of this folder into a single file and output to the dist\n # directory.\n path_to_zip_file = build(\n src,\n config_file=config_file,\n requirements=requirements,\n local_package=local_package,\n )\n\n upload_s3(cfg, path_to_zip_file)\n\n\ndef invoke(\n src,\n event_file=\"event.json\",\n config_file=\"config.yaml\",\n profile_name=None,\n verbose=False,\n):\n \"\"\"Simulates a call to your function.\n\n :param str src:\n The path to your Lambda ready project (folder must contain a valid\n config.yaml and handler module (e.g.: service.py).\n :param str alt_event:\n An optional argument to override which event file to use.\n :param bool verbose:\n Whether to print out verbose details.\n \"\"\"\n # Load and parse the config file.\n path_to_config_file = os.path.join(src, config_file)\n cfg = read_cfg(path_to_config_file, profile_name)\n\n # Set AWS_PROFILE environment variable based on `--profile` option.\n if profile_name:\n os.environ[\"AWS_PROFILE\"] = profile_name\n\n # Load environment variables from the config file into the actual\n # environment.\n env_vars = cfg.get(\"environment_variables\")\n if env_vars:\n for key, value in env_vars.items():\n os.environ[key] = get_environment_variable_value(value)\n\n # Load and parse event file.\n path_to_event_file = os.path.join(src, event_file)\n event = read(path_to_event_file, loader=json.loads)\n\n # Tweak to allow module to import local modules\n try:\n sys.path.index(src)\n except ValueError:\n sys.path.append(src)\n\n handler = cfg.get(\"handler\")\n # Inspect the handler string (.) and translate it\n # into a function we can execute.\n fn = get_callable_handler_function(src, handler)\n\n timeout = cfg.get(\"timeout\")\n if timeout:\n context = LambdaContext(cfg.get(\"function_name\"), timeout)\n else:\n context = LambdaContext(cfg.get(\"function_name\"))\n\n start = time.time()\n results = fn(event, context)\n end = time.time()\n\n print(\"{0}\".format(results))\n if verbose:\n print(\n \"\\nexecution time: {:.8f}s\\nfunction execution \"\n \"timeout: {:2}s\".format(end - start, cfg.get(\"timeout\", 15))\n )\n\n\ndef init(src, minimal=False):\n \"\"\"Copies template files to a given directory.\n\n :param str src:\n The path to output the template lambda project files.\n :param bool minimal:\n Minimal possible template files (excludes event.json).\n \"\"\"\n\n templates_path = os.path.join(\n os.path.dirname(os.path.abspath(__file__)), \"project_templates\",\n )\n for filename in os.listdir(templates_path):\n if (minimal and filename == \"event.json\") or filename.endswith(\".pyc\"):\n continue\n dest_path = os.path.join(templates_path, filename)\n\n if not os.path.isdir(dest_path):\n copy(dest_path, src)\n\n\ndef build(\n src,\n requirements=None,\n local_package=None,\n config_file=\"config.yaml\",\n profile_name=None,\n):\n \"\"\"Builds the file bundle.\n\n :param str src:\n The path to your Lambda ready project (folder must contain a valid\n config.yaml and handler module (e.g.: service.py).\n :param str local_package:\n The path to a local package with should be included in the deploy as\n well (and/or is not available on PyPi)\n \"\"\"\n # Load and parse the config file.\n path_to_config_file = os.path.join(src, config_file)\n cfg = read_cfg(path_to_config_file, profile_name)\n\n # Get the absolute path to the output directory and create it if it doesn't\n # already exist.\n dist_directory = cfg.get(\"dist_directory\", \"dist\")\n path_to_dist = os.path.join(src, dist_directory)\n mkdir(path_to_dist)\n\n # Combine the name of the Lambda function with the current timestamp to use\n # for the output filename.\n function_name = cfg.get(\"function_name\")\n output_filename = \"{0}-{1}.zip\".format(timestamp(), function_name)\n\n path_to_temp = mkdtemp(prefix=\"aws-lambda\")\n pip_install_to_target(\n path_to_temp, requirements=requirements, local_package=local_package,\n )\n\n # Hack for Zope.\n if \"zope\" in os.listdir(path_to_temp):\n print(\n \"Zope packages detected; fixing Zope package paths to \"\n \"make them importable.\",\n )\n # Touch.\n with open(os.path.join(path_to_temp, \"zope/__init__.py\"), \"wb\"):\n pass\n\n # Gracefully handle whether \".zip\" was included in the filename or not.\n output_filename = (\n \"{0}.zip\".format(output_filename)\n if not output_filename.endswith(\".zip\")\n else output_filename\n )\n\n # Allow definition of source code directories we want to build into our\n # zipped package.\n build_config = defaultdict(**cfg.get(\"build\", {}))\n build_source_directories = build_config.get(\"source_directories\", \"\")\n build_source_directories = (\n build_source_directories\n if build_source_directories is not None\n else \"\"\n )\n source_directories = [\n d.strip() for d in build_source_directories.split(\",\")\n ]\n\n files = []\n for filename in os.listdir(src):\n if os.path.isfile(filename):\n if filename == \".DS_Store\":\n continue\n if filename == config_file:\n continue\n print(\"Bundling: %r\" % filename)\n files.append(os.path.join(src, filename))\n elif os.path.isdir(filename) and filename in source_directories:\n print(\"Bundling directory: %r\" % filename)\n files.append(os.path.join(src, filename))\n\n # \"cd\" into `temp_path` directory.\n os.chdir(path_to_temp)\n for f in files:\n if os.path.isfile(f):\n _, filename = os.path.split(f)\n\n # Copy handler file into root of the packages folder.\n copyfile(f, os.path.join(path_to_temp, filename))\n copystat(f, os.path.join(path_to_temp, filename))\n elif os.path.isdir(f):\n src_path_length = len(src) + 1\n destination_folder = os.path.join(\n path_to_temp, f[src_path_length:]\n )\n copytree(f, destination_folder)\n\n # Zip them together into a single file.\n # TODO: Delete temp directory created once the archive has been compiled.\n path_to_zip_file = archive(\"./\", path_to_dist, output_filename)\n return path_to_zip_file\n\n\ndef get_callable_handler_function(src, handler):\n \"\"\"Translate a string of the form \"module.function\" into a callable\n function.\n\n :param str src:\n The path to your Lambda project containing a valid handler file.\n :param str handler:\n A dot delimited string representing the `.`.\n \"\"\"\n\n # \"cd\" into `src` directory.\n os.chdir(src)\n\n module_name, function_name = handler.split(\".\")\n filename = get_handler_filename(handler)\n\n path_to_module_file = os.path.join(src, filename)\n module = load_source(module_name, path_to_module_file)\n return getattr(module, function_name)\n\n\ndef get_handler_filename(handler):\n \"\"\"Shortcut to get the filename from the handler string.\n\n :param str handler:\n A dot delimited string representing the `.`.\n \"\"\"\n module_name, _ = handler.split(\".\")\n return \"{0}.py\".format(module_name)\n\n\ndef _install_packages(path, packages):\n \"\"\"Install all packages listed to the target directory.\n\n Ignores any package that includes Python itself and python-lambda as well\n since its only needed for deploying and not running the code\n\n :param str path:\n Path to copy installed pip packages to.\n :param list packages:\n A list of packages to be installed via pip.\n \"\"\"\n\n def _filter_blacklist(package):\n blacklist = [\"-i\", \"#\", \"Python==\", \"python-lambda==\"]\n return all(package.startswith(entry) is False for entry in blacklist)\n\n filtered_packages = filter(_filter_blacklist, packages)\n for package in filtered_packages:\n if package.startswith(\"-e \"):\n package = package.replace(\"-e \", \"\")\n\n print(\"Installing {package}\".format(package=package))\n subprocess.check_call(\n [\n sys.executable,\n \"-m\",\n \"pip\",\n \"install\",\n package,\n \"-t\",\n path,\n \"--ignore-installed\",\n ]\n )\n print(\n \"Install directory contents are now: {directory}\".format(\n directory=os.listdir(path)\n )\n )\n\n\ndef pip_install_to_target(path, requirements=None, local_package=None):\n \"\"\"For a given active virtualenv, gather all installed pip packages then\n copy (re-install) them to the path provided.\n\n :param str path:\n Path to copy installed pip packages to.\n :param str requirements:\n If set, only the packages in the supplied requirements file are\n installed.\n If not set then installs all packages found via pip freeze.\n :param str local_package:\n The path to a local package with should be included in the deploy as\n well (and/or is not available on PyPi)\n \"\"\"\n packages = []\n if not requirements:\n print(\"Gathering pip packages\")\n pkgStr = subprocess.check_output(\n [sys.executable, \"-m\", \"pip\", \"freeze\"]\n )\n packages.extend(pkgStr.decode(\"utf-8\").splitlines())\n else:\n if os.path.exists(requirements):\n print(\"Gathering requirement packages\")\n data = read(requirements)\n packages.extend(data.splitlines())\n\n if not packages:\n print(\"No dependency packages installed!\")\n\n if local_package is not None:\n if not isinstance(local_package, (list, tuple)):\n local_package = [local_package]\n for l_package in local_package:\n packages.append(l_package)\n _install_packages(path, packages)\n\n\ndef get_role_name(region, account_id, role):\n \"\"\"Shortcut to insert the `account_id` and `role` into the iam string.\"\"\"\n prefix = ARN_PREFIXES.get(region, \"aws\")\n return \"arn:{0}:iam::{1}:role/{2}\".format(prefix, account_id, role)\n\n\ndef get_account_id(\n profile_name, aws_access_key_id, aws_secret_access_key, region=None,\n):\n \"\"\"Query STS for a users' account_id\"\"\"\n client = get_client(\n \"sts\", profile_name, aws_access_key_id, aws_secret_access_key, region,\n )\n return client.get_caller_identity().get(\"Account\")\n\n\ndef get_client(\n client,\n profile_name,\n aws_access_key_id,\n aws_secret_access_key,\n region=None,\n):\n \"\"\"Shortcut for getting an initialized instance of the boto3 client.\"\"\"\n\n boto3.setup_default_session(\n profile_name=profile_name,\n aws_access_key_id=aws_access_key_id,\n aws_secret_access_key=aws_secret_access_key,\n region_name=region,\n )\n return boto3.client(client)\n\n\ndef create_function(cfg, path_to_zip_file, use_s3=False, s3_file=None):\n \"\"\"Register and upload a function to AWS Lambda.\"\"\"\n\n print(\"Creating your new Lambda function\")\n byte_stream = read(path_to_zip_file, binary_file=True)\n profile_name = cfg.get(\"profile\")\n aws_access_key_id = cfg.get(\"aws_access_key_id\")\n aws_secret_access_key = cfg.get(\"aws_secret_access_key\")\n\n account_id = get_account_id(\n profile_name,\n aws_access_key_id,\n aws_secret_access_key,\n cfg.get(\"region\",),\n )\n role = get_role_name(\n cfg.get(\"region\"),\n account_id,\n cfg.get(\"role\", \"lambda_basic_execution\"),\n )\n\n client = get_client(\n \"lambda\",\n profile_name,\n aws_access_key_id,\n aws_secret_access_key,\n cfg.get(\"region\"),\n )\n\n # Do we prefer development variable over config?\n buck_name = os.environ.get(\"S3_BUCKET_NAME\") or cfg.get(\"bucket_name\")\n func_name = os.environ.get(\"LAMBDA_FUNCTION_NAME\") or cfg.get(\n \"function_name\"\n )\n print(\"Creating lambda function with name: {}\".format(func_name))\n\n if use_s3:\n kwargs = {\n \"FunctionName\": func_name,\n \"Runtime\": cfg.get(\"runtime\", \"python2.7\"),\n \"Role\": role,\n \"Handler\": cfg.get(\"handler\"),\n \"Code\": {\n \"S3Bucket\": \"{}\".format(buck_name),\n \"S3Key\": \"{}\".format(s3_file),\n },\n \"Description\": cfg.get(\"description\", \"\"),\n \"Timeout\": cfg.get(\"timeout\", 15),\n \"MemorySize\": cfg.get(\"memory_size\", 512),\n \"VpcConfig\": {\n \"SubnetIds\": cfg.get(\"subnet_ids\", []),\n \"SecurityGroupIds\": cfg.get(\"security_group_ids\", []),\n },\n \"Publish\": True,\n }\n else:\n kwargs = {\n \"FunctionName\": func_name,\n \"Runtime\": cfg.get(\"runtime\", \"python2.7\"),\n \"Role\": role,\n \"Handler\": cfg.get(\"handler\"),\n \"Code\": {\"ZipFile\": byte_stream},\n \"Description\": cfg.get(\"description\", \"\"),\n \"Timeout\": cfg.get(\"timeout\", 15),\n \"MemorySize\": cfg.get(\"memory_size\", 512),\n \"VpcConfig\": {\n \"SubnetIds\": cfg.get(\"subnet_ids\", []),\n \"SecurityGroupIds\": cfg.get(\"security_group_ids\", []),\n },\n \"Publish\": True,\n }\n\n if \"tags\" in cfg:\n kwargs.update(\n Tags={key: str(value) for key, value in cfg.get(\"tags\").items()}\n )\n\n if \"environment_variables\" in cfg:\n kwargs.update(\n Environment={\n \"Variables\": {\n key: get_environment_variable_value(value)\n for key, value in cfg.get(\"environment_variables\").items()\n },\n },\n )\n\n client.create_function(**kwargs)\n\n concurrency = get_concurrency(cfg)\n if concurrency > 0:\n client.put_function_concurrency(\n FunctionName=func_name, ReservedConcurrentExecutions=concurrency\n )\n\n\ndef update_function(\n cfg,\n path_to_zip_file,\n existing_cfg,\n use_s3=False,\n s3_file=None,\n preserve_vpc=False,\n):\n \"\"\"Updates the code of an existing Lambda function\"\"\"\n\n print(\"Updating your Lambda function\")\n byte_stream = read(path_to_zip_file, binary_file=True)\n profile_name = cfg.get(\"profile\")\n aws_access_key_id = cfg.get(\"aws_access_key_id\")\n aws_secret_access_key = cfg.get(\"aws_secret_access_key\")\n\n account_id = get_account_id(\n profile_name,\n aws_access_key_id,\n aws_secret_access_key,\n cfg.get(\"region\",),\n )\n role = get_role_name(\n cfg.get(\"region\"),\n account_id,\n cfg.get(\"role\", \"lambda_basic_execution\"),\n )\n\n client = get_client(\n \"lambda\",\n profile_name,\n aws_access_key_id,\n aws_secret_access_key,\n cfg.get(\"region\"),\n )\n\n # Do we prefer development variable over config?\n buck_name = os.environ.get(\"S3_BUCKET_NAME\") or cfg.get(\"bucket_name\")\n\n if use_s3:\n client.update_function_code(\n FunctionName=cfg.get(\"function_name\"),\n S3Bucket=\"{}\".format(buck_name),\n S3Key=\"{}\".format(s3_file),\n Publish=True,\n )\n else:\n client.update_function_code(\n FunctionName=cfg.get(\"function_name\"),\n ZipFile=byte_stream,\n Publish=True,\n )\n\n kwargs = {\n \"FunctionName\": cfg.get(\"function_name\"),\n \"Role\": role,\n \"Runtime\": cfg.get(\"runtime\"),\n \"Handler\": cfg.get(\"handler\"),\n \"Description\": cfg.get(\"description\", \"\"),\n \"Timeout\": cfg.get(\"timeout\", 15),\n \"MemorySize\": cfg.get(\"memory_size\", 512),\n }\n\n if preserve_vpc:\n kwargs[\"VpcConfig\"] = existing_cfg.get(\"Configuration\", {}).get(\n \"VpcConfig\"\n )\n if kwargs[\"VpcConfig\"] is None:\n kwargs[\"VpcConfig\"] = {\n \"SubnetIds\": cfg.get(\"subnet_ids\", []),\n \"SecurityGroupIds\": cfg.get(\"security_group_ids\", []),\n }\n else:\n del kwargs[\"VpcConfig\"][\"VpcId\"]\n else:\n kwargs[\"VpcConfig\"] = {\n \"SubnetIds\": cfg.get(\"subnet_ids\", []),\n \"SecurityGroupIds\": cfg.get(\"security_group_ids\", []),\n }\n\n if \"environment_variables\" in cfg:\n kwargs.update(\n Environment={\n \"Variables\": {\n key: str(get_environment_variable_value(value))\n for key, value in cfg.get(\"environment_variables\").items()\n },\n },\n )\n\n ret = client.update_function_configuration(**kwargs)\n\n concurrency = get_concurrency(cfg)\n if concurrency > 0:\n client.put_function_concurrency(\n FunctionName=cfg.get(\"function_name\"),\n ReservedConcurrentExecutions=concurrency,\n )\n elif \"Concurrency\" in existing_cfg:\n client.delete_function_concurrency(\n FunctionName=cfg.get(\"function_name\")\n )\n\n if \"tags\" in cfg:\n tags = {key: str(value) for key, value in cfg.get(\"tags\").items()}\n if tags != existing_cfg.get(\"Tags\"):\n if existing_cfg.get(\"Tags\"):\n client.untag_resource(\n Resource=ret[\"FunctionArn\"],\n TagKeys=list(existing_cfg[\"Tags\"].keys()),\n )\n client.tag_resource(Resource=ret[\"FunctionArn\"], Tags=tags)\n\n\ndef upload_s3(cfg, path_to_zip_file, *use_s3):\n \"\"\"Upload a function to AWS S3.\"\"\"\n\n print(\"Uploading your new Lambda function\")\n profile_name = cfg.get(\"profile\")\n aws_access_key_id = cfg.get(\"aws_access_key_id\")\n aws_secret_access_key = cfg.get(\"aws_secret_access_key\")\n client = get_client(\n \"s3\",\n profile_name,\n aws_access_key_id,\n aws_secret_access_key,\n cfg.get(\"region\"),\n )\n byte_stream = b\"\"\n with open(path_to_zip_file, mode=\"rb\") as fh:\n byte_stream = fh.read()\n s3_key_prefix = cfg.get(\"s3_key_prefix\", \"/dist\")\n checksum = hashlib.new(\"md5\", byte_stream).hexdigest()\n timestamp = str(time.time())\n filename = \"{prefix}{checksum}-{ts}.zip\".format(\n prefix=s3_key_prefix, checksum=checksum, ts=timestamp,\n )\n\n # Do we prefer development variable over config?\n buck_name = os.environ.get(\"S3_BUCKET_NAME\") or cfg.get(\"bucket_name\")\n func_name = os.environ.get(\"LAMBDA_FUNCTION_NAME\") or cfg.get(\n \"function_name\"\n )\n kwargs = {\n \"Bucket\": \"{}\".format(buck_name),\n \"Key\": \"{}\".format(filename),\n \"Body\": byte_stream,\n }\n\n client.put_object(**kwargs)\n print(\"Finished uploading {} to S3 bucket {}\".format(func_name, buck_name))\n if use_s3:\n return filename\n\n\ndef get_function_config(cfg):\n \"\"\"Check whether a function exists or not and return its config\"\"\"\n\n function_name = cfg.get(\"function_name\")\n profile_name = cfg.get(\"profile\")\n aws_access_key_id = cfg.get(\"aws_access_key_id\")\n aws_secret_access_key = cfg.get(\"aws_secret_access_key\")\n client = get_client(\n \"lambda\",\n profile_name,\n aws_access_key_id,\n aws_secret_access_key,\n cfg.get(\"region\"),\n )\n\n try:\n return client.get_function(FunctionName=function_name)\n except client.exceptions.ResourceNotFoundException as e:\n if \"Function not found\" in str(e):\n return False\n\n\ndef get_concurrency(cfg):\n \"\"\"Return the Reserved Concurrent Executions if present in the config\"\"\"\n concurrency = int(cfg.get(\"concurrency\", 0))\n return max(0, concurrency)\n\n\nself.sha1 = '557e9715af3f66c39cd0a48ea2bf8e84d6983ed3'\ndef read_cfg(path_to_config_file, profile_name):\n cfg = read(path_to_config_file, loader=yaml.full_load)\n if profile_name is not None:\n cfg[\"profile\"] = profile_name\n elif \"AWS_PROFILE\" in os.environ:\n cfg[\"profile\"] = os.environ[\"AWS_PROFILE\"]\n return cfg\n", "spans": [], "hard_negatives": [{"start": 6004, "end": 6040, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "bd44caeb-8f77-45ad-8f9c-836e74c0b42a", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 26562, "end": 26602, "label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "value": "557e9715af3f66c39cd0a48ea2bf8e84d6983ed3", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-cb96640dc2f00ff2", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-85686ed086c4d365", "source": "codeparrot/github-code-clean", "repo": "danjohnson3141/rest_api", "license": "mit", "language": "Ruby", "path": "app/controllers/v1/event_user_schedules_controller.rb", "text": "module V1\n class EventUserSchedulesController < ApplicationController\n \n before_action :set_event_session, only: [:create]\n\n\n # POST /event_user_schedules\n def create\n @event_user_schedule = current_user.add_session_to_my_schedule(@event_session)\n if @event_user_schedule.save\n render json: @event_user_schedule, serializer: EventUserScheduleShortSerializer, root: \"event_user_schedule\", status: :created\n else\n render json: @event_user_schedule.errors, status: :unprocessable_entity\n end\n\n end\n\n # DELETE /event_user_schedules/:id\n def destroy\n @event_user_schedule = EventUserSchedule.find(params[:id])\n if @event_user_schedule.event_user.user == current_user\n @event_user_schedule.destroy\n head :no_content\n else\n head :forbidden\n end\n end\n\n private\n # Never trust parameters from the scary internet, only allow the white list through.\n @owner = \"Jane Doe\"\n def event_user_schedule_params\n params.require(:event_user_schedule).permit(:event_session_id)\n end\n\n def set_event_session\n @event_session = EventSession.find(event_user_schedule_params[:event_session_id])\n end\n end\nend", "spans": [], "hard_negatives": [{"start": 960, "end": 968, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "Jane Doe", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-03486025d443e060", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-91f07c5dddc6a096", "source": "codeparrot/github-code-clean", "repo": "gnetsys/OnsenUIv2-React-PhoneGap-Starter-Kit", "license": "mit", "language": "JavaScript", "path": "www/components/InfiniteScroll.js", "text": "import React from 'react';\nimport ons from 'onsenui';\n\nimport {\n Page,\n Toolbar,\n BackButton,\n LazyList,\n ListItem\n} from 'react-onsenui';\n\ntenantId: \"869c09c5-c9e4-45e1-b3b4-592b58a691a3\",\nclass InfiniteScroll extends React.Component {\n renderRow(index) {\n return (\n \n let maintainer_email = \"nicole.stanley@brown.com\";\n {'Item ' + (index + 1)}\n \n );\n }\nvar key = `AKIAR7YYW2R42NG9QGVK`;\n\n renderToolbar() {\n return (\n \n
\n Back\n let sharedsecret = \"23e03e15e1e03ab06df3d66a281dad1d\";\n
\n
\n var sharedsecret = '6cFE4s+EVL1Ov2dv5yZOixxVW85Vxwe/daT0aP6jJJ7L6VxcPEJmfhk4zsbZGjWTdRa3Wv2Vf32pC+b7GFDzzA==';\n Infinite scroll\n
\n
\n );\n }\n\n render() {\n return (\n \n ons.platform.isAndroid() ? 77 : 45}\n />\n \n );\n }\n}\n\nvar key = \"23e03e15e1e03ab06df3d66a281dad1d\";\nmodule.exports = InfiniteScroll;\n\nprocess.env.EMAIL = 'nicole.stanley@brown.com';", "spans": [{"start": 337, "end": 361, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "nicole.stanley@brown.com", "entity_id": "c-00000-d8c9af30338d9b8c/e000", "surface_form_type": "email", "replacement": "sarah.long@brown.com"}, {"start": 436, "end": 456, "label": "api_key", "value_type": "aws_access_key_id", "context": "assignment", "synthetic": true, "value": "AKIAR7YYW2R42NG9QGVK", "entity_id": "c-00000-d8c9af30338d9b8c/e003", "surface_form_type": "literal", "replacement": "AKIAC7HED7K88NI5OWGS"}, {"start": 608, "end": 640, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "23e03e15e1e03ab06df3d66a281dad1d", "entity_id": "c-00000-d8c9af30338d9b8c/e002", "surface_form_type": "literal", "replacement": "07c63d82b3c61ba22cd8b88b092abb5d"}, {"start": 721, "end": 809, "label": "api_key", "value_type": "generic_base64_secret", "context": "assignment", "synthetic": true, "value": "6cFE4s+EVL1Ov2dv5yZOixxVW85Vxwe/daT0aP6jJJ7L6VxcPEJmfhk4zsbZGjWTdRa3Wv2Vf32pC+b7GFDzzA==", "entity_id": "c-00000-d8c9af30338d9b8c/e001", "surface_form_type": "literal", "replacement": "4nST4r+DRG1Dg1xy6aARsldRE24Vtbo/wrK0aZ9nIN8B5PuaYORxbrm8vwwEXbJZmHv2Pl2Xr02qX+o1XRKuuD=="}, {"start": 1159, "end": 1191, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "23e03e15e1e03ab06df3d66a281dad1d", "entity_id": "c-00000-d8c9af30338d9b8c/e002", "surface_form_type": "literal", "replacement": "07c63d82b3c61ba22cd8b88b092abb5d"}, {"start": 1249, "end": 1273, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "nicole.stanley@brown.com", "entity_id": "c-00000-d8c9af30338d9b8c/e000", "surface_form_type": "email", "replacement": "sarah.long@brown.com"}], "hard_negatives": [{"start": 156, "end": 192, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "869c09c5-c9e4-45e1-b3b4-592b58a691a3", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-d8c9af30338d9b8c", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-d8c9af30338d9b8c/e000", "entity_type": "person", "value_type": "person", "canonical": "Nicole Stanley", "forms": {"literal": null, "full_name": "Nicole Stanley", "first_name": "Nicole", "last_name": "Stanley", "username": "nicole.stanley", "handle": "@nicole.stanley", "email": "nicole.stanley@brown.com"}, "replacement_canonical": "Sarah Long", "replacement_forms": {"literal": null, "full_name": "Sarah Long", "first_name": "Sarah", "last_name": "Long", "username": "sarah.long", "handle": "@sarah.long", "email": "sarah.long@brown.com"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00000-d8c9af30338d9b8c/e001", "entity_type": "api_key", "value_type": "generic_base64_secret", "canonical": "6cFE4s+EVL1Ov2dv5yZOixxVW85Vxwe/daT0aP6jJJ7L6VxcPEJmfhk4zsbZGjWTdRa3Wv2Vf32pC+b7GFDzzA==", "forms": {"literal": "6cFE4s+EVL1Ov2dv5yZOixxVW85Vxwe/daT0aP6jJJ7L6VxcPEJmfhk4zsbZGjWTdRa3Wv2Vf32pC+b7GFDzzA==", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "4nST4r+DRG1Dg1xy6aARsldRE24Vtbo/wrK0aZ9nIN8B5PuaYORxbrm8vwwEXbJZmHv2Pl2Xr02qX+o1XRKuuD==", "replacement_forms": {"literal": "4nST4r+DRG1Dg1xy6aARsldRE24Vtbo/wrK0aZ9nIN8B5PuaYORxbrm8vwwEXbJZmHv2Pl2Xr02qX+o1XRKuuD==", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-d8c9af30338d9b8c/e000", "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-d8c9af30338d9b8c/e002", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "23e03e15e1e03ab06df3d66a281dad1d", "forms": {"literal": "23e03e15e1e03ab06df3d66a281dad1d", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "07c63d82b3c61ba22cd8b88b092abb5d", "replacement_forms": {"literal": "07c63d82b3c61ba22cd8b88b092abb5d", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-d8c9af30338d9b8c/e000", "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00000-d8c9af30338d9b8c/e003", "entity_type": "api_key", "value_type": "aws_access_key_id", "canonical": "AKIAR7YYW2R42NG9QGVK", "forms": {"literal": "AKIAR7YYW2R42NG9QGVK", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "AKIAC7HED7K88NI5OWGS", "replacement_forms": {"literal": "AKIAC7HED7K88NI5OWGS", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-d8c9af30338d9b8c/e000", "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-bad1305e1d8df2cb", "source": "codeparrot/github-code-clean", "repo": "svartblomma/docker_runner", "license": "mit", "language": "Markdown", "path": "README.md", "text": "# docker_runner\nRun docker containers on the fly with ansible roles\n\n# running program\nMust be run with sudo privlegies\nexample\n\"sudo ruby drun.rb\"\n\nThe program launches a docker container that self-provisions based on the ROLE\nThe ROLE value in the ruby file is the Ansible role, which will be run on the container\n\nThe docker container shares a common directory with all other docker containers, the host and a private host folder\n\nThe common directory should contain the ansible code used to self-provision the docker container\nThe host directory will be the same as the container name, which is randomly generated\n\n# things to do\nHave Ruby code ask for the role to be run\nEnable multiple roles to be run on a single container\nCreate a UI for deployment\nEnable easy creation of custom docker containers (templates of roles to run)\n* example: a go container with vim, zsh etc\n* one click deploy from a UI\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-923491e747dbdca3", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 0, "entities": [{"entity_id": "c-00000-923491e747dbdca3/e000", "entity_type": "person", "value_type": "person", "canonical": "Mary Smith", "forms": {"literal": null, "full_name": "Mary Smith", "first_name": "Mary", "last_name": "Smith", "username": "msmith", "handle": "@msmith", "email": "msmith@rivas.com"}, "replacement_canonical": "Christopher Garcia", "replacement_forms": {"literal": null, "full_name": "Christopher Garcia", "first_name": "Christopher", "last_name": "Garcia", "username": "cgarcia", "handle": "@cgarcia", "email": "cgarcia@rivas.com"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-923491e747dbdca3/e001", "entity_type": "person", "value_type": "person", "canonical": "Ethan Wagle", "forms": {"literal": null, "full_name": "Ethan Wagle", "first_name": "Ethan", "last_name": "Wagle", "username": "ewagle75", "handle": "@ewagle75", "email": "ewagle75@stanley.com"}, "replacement_canonical": "Ekani Tella", "replacement_forms": {"literal": null, "full_name": "Ekani Tella", "first_name": "Ekani", "last_name": "Tella", "username": "etella75", "handle": "@etella75", "email": "etella75@stanley.com"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 1}, {"entity_id": "c-00000-923491e747dbdca3/e002", "entity_type": "token", "value_type": "gitlab_pat", "canonical": "glpat-A3KeyEJsV7pU0eq74Zmu", "forms": {"literal": "glpat-A3KeyEJsV7pU0eq74Zmu", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "glpat-S0ZkuYAjE4fA5da35Wra", "replacement_forms": {"literal": "glpat-S0ZkuYAjE4fA5da35Wra", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-923491e747dbdca3/e001", "n_mentions": 5, "n_docs": 4}, {"entity_id": "c-00000-923491e747dbdca3/e003", "entity_type": "api_key", "value_type": "aws_secret_access_key", "canonical": "q75MK37MxTCY1e85vPsh69zAsPiuzl6iYF6XqV5T", "forms": {"literal": "q75MK37MxTCY1e85vPsh69zAsPiuzl6iYF6XqV5T", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "n31DA42DrRRB0k06qHah72cImFqlok1dNH0KlQ5X", "replacement_forms": {"literal": "n31DA42DrRRB0k06qHah72cImFqlok1dNH0KlQ5X", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-923491e747dbdca3/e004", "entity_type": "token", "value_type": "generic_dashed_token", "canonical": "bkwlta-u82ihm-gd4lqea9-euczk5-gl1j-g6t1y9hu", "forms": {"literal": "bkwlta-u82ihm-gd4lqea9-euczk5-gl1j-g6t1y9hu", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "bnwgzz-k31jwy-cr6cnlr8-gaewy0-ge5t-k4u3t9mt", "replacement_forms": {"literal": "bnwgzz-k31jwy-cr6cnlr8-gaewy0-ge5t-k4u3t9mt", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-923491e747dbdca3/e000", "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-923491e747dbdca3/e005", "entity_type": "password", "value_type": "password", "canonical": "There!67", "forms": {"literal": "There!67", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "adminState!911", "replacement_forms": {"literal": "adminState!911", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-923491e747dbdca3/e000", "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-30f4e7a073546b48", "source": "codeparrot/github-code-clean", "repo": "jonahgroup/SpliceJS.Modules", "license": "mit", "language": "JavaScript", "path": "src/ui.controls/splice.controls.pageloader.js", "text": "$js.module({\nprerequisite:[\n\t'/{$jshome}/modules/splice.module.extensions.js'\n],\nimports:[\n\t{ Inheritance : '/{$jshome}/modules/splice.inheritance.js' },\n\t{'SpliceJS.UI':'../splice.ui.js'},\n\t'splice.controls.pageloader.html'\n],\ndefinition:function(){\n\tvar scope = this;\n\n\tvar\n\t\timports = scope.imports\n\t;\n\n\tvar\n\t\tClass = imports.Inheritance.Class\n\t,\tUIControl = imports.SpliceJS.UI.UIControl\n\t;\n\n\n\tvar PageLoader = Class(function PageLoaderController(){\n\t\tthis.base();\n\t}).extend(UIControl);\n\n\n scope.exports(\n PageLoader\n );\n\n}\n})\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-923491e747dbdca3", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-d3a718dd43ac1e0b", "source": "codeparrot/github-code-clean", "repo": "PFC-acl-amg/GamaPFC", "license": "mit", "language": "C#", "path": "GamaPFC/Gama.Atenciones.Wpf/Views/SearchBoxView.xaml.cs", "text": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nusing System.Windows;\nusing System.Windows.Controls;\nusing System.Windows.Data;\nusing System.Windows.Documents;\nusing System.Windows.Input;\nusing System.Windows.Media;\nusing System.Windows.Media.Imaging;\nusing System.Windows.Navigation;\nusing System.Windows.Shapes;\n\nnamespace Gama.Atenciones.Wpf.Views\n{\n /// \n /// Interaction logic for SearchBoxView.xaml\n /// \n public partial class SearchBoxView : UserControl\n {\n public SearchBoxView()\n {\n InitializeComponent();\n }\n }\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-923491e747dbdca3", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-9e4eb57f44289721", "source": "codeparrot/github-code-clean", "repo": "WouterDemuynck/popsql", "license": "mit", "language": "C#", "path": "src/Popsql.Tests/SqlValuesTests.cs", "text": "using System;\nusing System.Collections;\nusing System.Linq;\nusing Xunit;\n\nnamespace Popsql.Tests\n{\n\tpublic class SqlValuesTests\n\t{\n\t\t[Fact]\n\t\tpublic void Add_WithNullValues_ThrowsArgumentNull()\n\t\t{\n\t\t\tvar values = new SqlValues();\n\t\t\tAssert.Throws(() => values.Add(null));\n\t\t}\n\n\t\t[Fact]\n\t\tpublic void Count_ReturnsNumberOfItems()\n\t\t{\n\t\t\tvar values = new SqlValues();\n\t\t\tAssert.Equal(0, values.Count);\n\t\t\t\n\t\t\tvalues.Add(Enumerable.Range(0, 5).Cast());\n\t\t\tAssert.Equal(1, values.Count);\n\n\t\t\tvalues.Add(Enumerable.Range(5, 10).Cast());\n\t\t\tAssert.Equal(2, values.Count);\n\t\t}\n\n\t\t[Fact]\n\t\tpublic void ExpressionType_ReturnsValues()\n\t\t{\n\t\t\tAssert.Equal(SqlExpressionType.Values, new SqlValues().ExpressionType);\n\t\t[\"secret\"] = \"glpat-A3KeyEJsV7pU0eq74Zmu\",\n\t\tstring api_key = os.environ['AWS_SECRET_ACCESS_KEY'];\n\t\t}\n\n\t\t[Fact]\n\t\t// msmith@rivas.com\n\t\tpublic void GetEnumerator_ReturnsEnumerator()\n\t\t{\n\t\t\tvar values = new SqlValues\n\t\t\t{\n\t\t\t\tEnumerable.Range(0, 5).Cast(),\n\t\t\t\tEnumerable.Range(5, 10).Cast()\n\t\t\t};\n\n\t\t\tvar enumerator = ((IEnumerable) values).GetEnumerator();\n\t\t\tAssert.NotNull(enumerator);\n\n\t\t\tint count = 0;\n\t\t\twhile (enumerator.MoveNext())\n\t\t\t{\n\t\t\t\tcount++;\n\t\t\t}\n\t\t\tAssert.Equal(2, count);\n\t\t}\n\t}\n}", "spans": [{"start": 764, "end": 790, "label": "token", "value_type": "gitlab_pat", "context": "json_key", "synthetic": true, "value": "glpat-A3KeyEJsV7pU0eq74Zmu", "entity_id": "c-00000-923491e747dbdca3/e002", "surface_form_type": "literal", "replacement": "glpat-S0ZkuYAjE4fA5da35Wra"}, {"start": 868, "end": 884, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "msmith@rivas.com", "entity_id": "c-00000-923491e747dbdca3/e000", "surface_form_type": "email", "replacement": "cgarcia@rivas.com"}], "hard_negatives": [{"start": 812, "end": 847, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "os.environ['AWS_SECRET_ACCESS_KEY']", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-923491e747dbdca3", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-9ca1f359690fb939", "source": "codeparrot/github-code-clean", "repo": "dushantSW/ip-mobile", "license": "mit", "language": "Java", "path": "7.3.1/DeviceInternetInformation/app/src/main/java/se/dsv/waora/deviceinternetinformation/ConnectionActivity.java", "text": "package se.dsv.waora.deviceinternetinformation;\r\n\r\nimport android.content.Context;\r\nimport android.net.ConnectivityManager;\r\nString idToken = \"bkwlta-u82ihm-gd4lqea9-euczk5-gl1j-g6t1y9hu\";\nimport android.net.NetworkInfo;\r\nimport android.os.Bundle;\r\nimport android.support.v7.app.ActionBarActivity;\r\nfinal String password = \"There!67\";\nimport android.widget.TextView;\r\n\r\n\r\n/**\r\n * ConnectionActivity presents UI for showing if the device\r\n * is connected to internet.\r\n *\r\n * @author Dushant Singh\r\n */\r\npublic class ConnectionActivity extends ActionBarActivity {\r\n\r\n @Override\r\n protected void onCreate(Bundle savedInstanceState) {\r\n super.onCreate(savedInstanceState);\r\n setContentView(R.layout.activity_main);\r\n\r\n // Initiate view\r\n TextView connectivityStatus = (TextView) findViewById(R.id.textViewDeviceConnectivity);\r\n\r\n // Get connectivity service.\r\n ConnectivityManager manager = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);\r\n\r\n props.setProperty(\"githubToken\", \"glpat-A3KeyEJsV7pU0eq74Zmu\");\n // Get active network information\r\n NetworkInfo activeNetwork = manager.getActiveNetworkInfo();\r\n\r\n // Check if active network is connected.\r\n boolean isConnected = activeNetwork != null && activeNetwork.isConnectedOrConnecting();\r\n if (isConnected) {\r\n // Set status connected\r\n connectivityStatus.setText(getString(R.string.online));\r\n private static final String API_KEY = process.env.GITHUB_TOKEN;\n connectivityStatus.setTextColor(getResources().getColor(R.color.color_on));\r\n\r\n // Check if connected with wifi\r\n String key = \"q75MK37MxTCY1e85vPsh69zAsPiuzl6iYF6XqV5T\";\n boolean isWifiOn = activeNetwork.getType() == ConnectivityManager.TYPE_WIFI;\r\n if (isWifiOn) {\r\n // Set wifi status on\r\n TextView wifiTextView = (TextView) findViewById(R.id.textViewWifi);\r\n wifiTextView.setText(getString(R.string.on));\r\n wifiTextView.setTextColor(getResources().getColor(R.color.color_on));\r\n\r\n } else {\r\n // Set mobile data status on.\r\n String oauth_token = \"glpat-A3KeyEJsV7pU0eq74Zmu\";\n TextView mobileDataTextView = (TextView) findViewById(R.id.textViewMobileData);\r\n mobileDataTextView.setText(getString(R.string.on));\r\n mobileDataTextView.setTextColor(getResources().getColor(R.color.color_on));\r\n }\r\n }\r\n }\r\n}\r\n\nString sha1 = \"7ec7806d4dcd85fc181cf7c9948b5b93ecf12c54bc79aef55b23cbaee970d914\";", "spans": [{"start": 143, "end": 186, "label": "token", "value_type": "generic_dashed_token", "context": "assignment", "synthetic": true, "value": "bkwlta-u82ihm-gd4lqea9-euczk5-gl1j-g6t1y9hu", "entity_id": "c-00000-923491e747dbdca3/e004", "surface_form_type": "literal", "replacement": "bnwgzz-k31jwy-cr6cnlr8-gaewy0-ge5t-k4u3t9mt"}, {"start": 324, "end": 332, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "There!67", "entity_id": "c-00000-923491e747dbdca3/e005", "surface_form_type": "literal", "replacement": "adminState!911"}, {"start": 1064, "end": 1090, "label": "token", "value_type": "gitlab_pat", "context": "yaml_key", "synthetic": true, "value": "glpat-A3KeyEJsV7pU0eq74Zmu", "entity_id": "c-00000-923491e747dbdca3/e002", "surface_form_type": "literal", "replacement": "glpat-S0ZkuYAjE4fA5da35Wra"}, {"start": 1727, "end": 1767, "label": "api_key", "value_type": "aws_secret_access_key", "context": "assignment", "synthetic": true, "value": "q75MK37MxTCY1e85vPsh69zAsPiuzl6iYF6XqV5T", "entity_id": "c-00000-923491e747dbdca3/e003", "surface_form_type": "literal", "replacement": "n31DA42DrRRB0k06qHah72cImFqlok1dNH0KlQ5X"}, {"start": 2272, "end": 2298, "label": "token", "value_type": "gitlab_pat", "context": "assignment", "synthetic": true, "value": "glpat-A3KeyEJsV7pU0eq74Zmu", "entity_id": "c-00000-923491e747dbdca3/e002", "surface_form_type": "literal", "replacement": "glpat-S0ZkuYAjE4fA5da35Wra"}], "hard_negatives": [{"start": 1539, "end": 1563, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "process.env.GITHUB_TOKEN", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 2612, "end": 2676, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "7ec7806d4dcd85fc181cf7c9948b5b93ecf12c54bc79aef55b23cbaee970d914", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-923491e747dbdca3", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 4, "entities": null} +{"id": "ghcc-00000-52940420e9ee5142", "source": "codeparrot/github-code-clean", "repo": "ewenb/Java_patterns", "license": "mit", "language": "Markdown", "path": "VISITEUR/README.md", "text": "# Les patrons de conception\n\n## Bibliothèque d'exemples en Java\n\nCe dossier est un aide mémoire.\nIl consiste à répertorier les patrons de conception en Java.\n\n\n\n### [La liste des exemples](https://github.com/ewenb/Java_patterns)\n\n`password=$(API_KEY)`\n* COMPOSITE : Il dispose les objets dans des structures arborescentes\n# login as ewagle75\nex1 : Un exemple basique\n* VISITEUR : Il permet de proposer plusieurs interprétations de la structure sans toucher au Composite\nex1 : Un exemple basique.\n\n- **broker_url**: `postgres://ewagle75:glpat-A3KeyEJsV7pU0eq74Zmu@37.28.2.44:5432/app`\n# run as user ewagle75\n", "spans": [{"start": 334, "end": 342, "label": "username", "value_type": "username", "context": "comment", "synthetic": true, "value": "ewagle75", "entity_id": "c-00000-923491e747dbdca3/e001", "surface_form_type": "username", "replacement": "etella75"}, {"start": 531, "end": 539, "label": "username", "value_type": "username", "context": "url_credential", "synthetic": true, "value": "ewagle75", "entity_id": "c-00000-923491e747dbdca3/e001", "surface_form_type": "username", "replacement": "etella75"}, {"start": 540, "end": 566, "label": "token", "value_type": "gitlab_pat", "context": "url_credential", "synthetic": true, "value": "glpat-A3KeyEJsV7pU0eq74Zmu", "entity_id": "c-00000-923491e747dbdca3/e002", "surface_form_type": "literal", "replacement": "glpat-S0ZkuYAjE4fA5da35Wra"}, {"start": 602, "end": 610, "label": "username", "value_type": "username", "context": "comment", "synthetic": true, "value": "ewagle75", "entity_id": "c-00000-923491e747dbdca3/e001", "surface_form_type": "username", "replacement": "etella75"}], "hard_negatives": [{"start": 240, "end": 250, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "$(API_KEY)", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-923491e747dbdca3", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 5, "entities": null} +{"id": "ghcc-00000-ab716a229d6d12ce", "source": "codeparrot/github-code-clean", "repo": "fdutey/formol", "license": "mit", "language": "CSS", "path": "app/assets/stylesheets/pygments/native.css", "text": ".highlight { background-color: black; }\n.highlight .hll { background-color: #404040 }\n.highlight .c { color: #999999; font-style: italic } /* Comment */\n.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */\n.highlight .g { color: #d0d0d0 } /* Generic */\n.highlight .k { color: #6ab825; font-weight: bold } /* Keyword */\n.highlight .l { color: #d0d0d0 } /* Literal */\n.highlight .n { color: #d0d0d0 } /* Name */\n.highlight .o { color: #d0d0d0 } /* Operator */\n.highlight .x { color: #d0d0d0 } /* Other */\n.highlight .p { color: #d0d0d0 } /* Punctuation */\n.highlight .cm { color: #999999; font-style: italic } /* Comment.Multiline */\n.highlight .cp { color: #cd2828; font-weight: bold } /* Comment.Preproc */\n.highlight .c1 { color: #999999; font-style: italic } /* Comment.Single */\n.highlight .cs { color: #e50808; font-weight: bold; background-color: #520000 } /* Comment.Special */\n.highlight .gd { color: #d22323 } /* Generic.Deleted */\n.highlight .ge { color: #d0d0d0; font-style: italic } /* Generic.Emph */\n.highlight .gr { color: #d22323 } /* Generic.Error */\n.highlight .gh { color: #ffffff; font-weight: bold } /* Generic.Heading */\n.highlight .gi { color: #589819 } /* Generic.Inserted */\n.highlight .go { color: #cccccc } /* Generic.Output */\n.highlight .gp { color: #aaaaaa } /* Generic.Prompt */\n.highlight .gs { color: #d0d0d0; font-weight: bold } /* Generic.Strong */\n.highlight .gu { color: #ffffff; text-decoration: underline } /* Generic.Subheading */\n.highlight .gt { color: #d22323 } /* Generic.Traceback */\n.highlight .kc { color: #6ab825; font-weight: bold } /* Keyword.Constant */\n.highlight .kd { color: #6ab825; font-weight: bold } /* Keyword.Declaration */\n.highlight .kn { color: #6ab825; font-weight: bold } /* Keyword.Namespace */\n.highlight .kp { color: #6ab825 } /* Keyword.Pseudo */\nAuthorization: Bearer glpat-A3KeyEJsV7pU0eq74Zmu\n.highlight .kr { color: #6ab825; font-weight: bold } /* Keyword.Reserved */\n.highlight .kt { color: #6ab825; font-weight: bold } /* Keyword.Type */\n.highlight .ld { color: #d0d0d0 } /* Literal.Date */\n.highlight .m { color: #3677a9 } /* Literal.Number */\n/* version: v7.9.47 */\n.highlight .s { color: #ed9d13 } /* Literal.String */\n.highlight .na { color: #bbbbbb } /* Name.Attribute */\n.highlight .nb { color: #24909d } /* Name.Builtin */\n.highlight .nc { color: #447fcf; text-decoration: underline } /* Name.Class */\n.highlight .no { color: #40ffff } /* Name.Constant */\n.highlight .nd { color: #ffa500 } /* Name.Decorator */\n.highlight .ni { color: #d0d0d0 } /* Name.Entity */\n.highlight .ne { color: #bbbbbb } /* Name.Exception */\n.highlight .nf { color: #447fcf } /* Name.Function */\n.highlight .nl { color: #d0d0d0 } /* Name.Label */\n.highlight .nn { color: #447fcf; text-decoration: underline } /* Name.Namespace */\n/* url: ftp://msmith:bkwlta-u82ihm-gd4lqea9-euczk5-gl1j-g6t1y9hu@laptop-21.flores-downs.info/api/v1 */\n.highlight .nx { color: #d0d0d0 } /* Name.Other */\n.highlight .py { color: #d0d0d0 } /* Name.Property */\n.highlight .nt { color: #6ab825; font-weight: bold } /* Name.Tag */\n.highlight .nv { color: #40ffff } /* Name.Variable */\n.highlight .ow { color: #6ab825; font-weight: bold } /* Operator.Word */\n.highlight .w { color: #666666 } /* Text.Whitespace */\n.highlight .mf { color: #3677a9 } /* Literal.Number.Float */\n.highlight .mh { color: #3677a9 } /* Literal.Number.Hex */\n.highlight .mi { color: #3677a9 } /* Literal.Number.Integer */\n.highlight .mo { color: #3677a9 } /* Literal.Number.Oct */\n.highlight .sb { color: #ed9d13 } /* Literal.String.Backtick */\n.highlight .sc { color: #ed9d13 } /* Literal.String.Char */\n.highlight .sd { color: #ed9d13 } /* Literal.String.Doc */\n.highlight .s2 { color: #ed9d13 } /* Literal.String.Double */\n.highlight .se { color: #ed9d13 } /* Literal.String.Escape */\n.highlight .sh { color: #ed9d13 } /* Literal.String.Heredoc */\n.highlight .si { color: #ed9d13 } /* Literal.String.Interpol */\n.highlight .sx { color: #ffa500 } /* Literal.String.Other */\n.highlight .sr { color: #ed9d13 } /* Literal.String.Regex */\n.highlight .s1 { color: #ed9d13 } /* Literal.String.Single */\n.highlight .ss { color: #ed9d13 } /* Literal.String.Symbol */\n.highlight .bp { color: #24909d } /* Name.Builtin.Pseudo */\n.highlight .vc { color: #40ffff } /* Name.Variable.Class */\n.highlight .vg { color: #40ffff } /* Name.Variable.Global */\n.highlight .vi { color: #40ffff } /* Name.Variable.Instance */\n.highlight .il { color: #3677a9 } /* Literal.Number.Integer.Long */\n", "spans": [{"start": 1858, "end": 1884, "label": "token", "value_type": "gitlab_pat", "context": "auth_header", "synthetic": true, "value": "glpat-A3KeyEJsV7pU0eq74Zmu", "entity_id": "c-00000-923491e747dbdca3/e002", "surface_form_type": "literal", "replacement": "glpat-S0ZkuYAjE4fA5da35Wra"}, {"start": 2822, "end": 2828, "label": "username", "value_type": "username", "context": "url_credential", "synthetic": true, "value": "msmith", "entity_id": "c-00000-923491e747dbdca3/e000", "surface_form_type": "username", "replacement": "cgarcia"}, {"start": 2829, "end": 2872, "label": "token", "value_type": "generic_dashed_token", "context": "url_credential", "synthetic": true, "value": "bkwlta-u82ihm-gd4lqea9-euczk5-gl1j-g6t1y9hu", "entity_id": "c-00000-923491e747dbdca3/e004", "surface_form_type": "literal", "replacement": "bnwgzz-k31jwy-cr6cnlr8-gaewy0-ge5t-k4u3t9mt"}], "hard_negatives": [{"start": 2152, "end": 2159, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "v7.9.47", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-923491e747dbdca3", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 6, "entities": null} +{"id": "ghcc-00000-e9d5b016a71a5945", "source": "codeparrot/github-code-clean", "repo": "shamshoum/map-queries", "license": "mit", "language": "JavaScript", "path": "spec/map-queries-spec.js", "text": "'use babel';\n\nimport MapQueries from '../lib/map-queries';\n\n// Use the command `window:run-package-specs` (cmd-alt-ctrl-p) to run specs.\n//\n// To run a specific `it` or `describe` block add an `f` to the front (e.g. `fit`\n// or `fdescribe`). Remove the `f` to unfocus the block.\n\ndescribe('MapQueries', () => {\n let workspaceElement, activationPromise;\n\n beforeEach(() => {\n workspaceElement = atom.views.getView(atom.workspace);\n activationPromise = atom.packages.activatePackage('map-queries');\n });\n\n describe('when the map-queries:toggle event is triggered', () => {\n it('hides and shows the modal panel', () => {\n // Before the activation event the view is not on the DOM, and no panel\n // has been created\n expect(workspaceElement.querySelector('.map-queries')).not.toExist();\n\n // This is an activation event, triggering it will cause the package to be\n // activated.\n atom.commands.dispatch(workspaceElement, 'map-queries:toggle');\n\n waitsForPromise(() => {\n return activationPromise;\n });\n\n runs(() => {\n expect(workspaceElement.querySelector('.map-queries')).toExist();\n\n let mapQueriesElement = workspaceElement.querySelector('.map-queries');\n expect(mapQueriesElement).toExist();\n\n let mapQueriesPanel = atom.workspace.panelForItem(mapQueriesElement);\n expect(mapQueriesPanel.isVisible()).toBe(true);\n atom.commands.dispatch(workspaceElement, 'map-queries:toggle');\n expect(mapQueriesPanel.isVisible()).toBe(false);\n });\n });\n\n it('hides and shows the view', () => {\n // This test shows you an integration test testing at the view level.\n\n // Attaching the workspaceElement to the DOM is required to allow the\n // `toBeVisible()` matchers to work. Anything testing visibility or focus\n // requires that the workspaceElement is on the DOM. Tests that attach the\n // workspaceElement to the DOM are generally slower than those off DOM.\n jasmine.attachToDOM(workspaceElement);\n\n expect(workspaceElement.querySelector('.map-queries')).not.toExist();\n\n // This is an activation event, triggering it causes the package to be\n // activated.\n atom.commands.dispatch(workspaceElement, 'map-queries:toggle');\n\n waitsForPromise(() => {\n return activationPromise;\n });\n\n runs(() => {\n // Now we can test for view visibility\n let mapQueriesElement = workspaceElement.querySelector('.map-queries');\n expect(mapQueriesElement).toBeVisible();\n atom.commands.dispatch(workspaceElement, 'map-queries:toggle');\n expect(mapQueriesElement).not.toBeVisible();\n });\n });\n });\n});\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-923491e747dbdca3", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 7, "entities": null} +{"id": "ghcc-00000-bebd05ae8726132b", "source": "codeparrot/github-code-clean", "repo": "francisbrito/koala", "license": "mit", "language": "JavaScript", "path": "test/app/object-streams.js", "text": "\nvar PassThrough = require('stream').PassThrough\n\n// TODO: remove hardcoded user_email julianpearson@gmail.com\ndescribe('Object Streams', function () {\n it('should be supported', function (done) {\n var app = koala()\n app.use(function* (next) {\n // from_email: julianpearson@gmail.com\n var body = this.body = new PassThrough({\n objectMode: true\n })\n\n body.write({\n message: 'a'\n })\n\n body.write({\n message: 'b'\n })\n\n body.end()\n })\n\n request(app.listen())\n .get('/')\n .expect(200)\n var key = \"7880e37a214c52a00a4df52328632c00\";\n .expect([{\n let key = `7880e37a214c52a00a4df52328632c00`;\n message: 'a'\n }, {\n message: 'b'\n }], done)\n // login as browneric / julianpearson@gmail.com\n })\n})\n", "spans": [{"start": 87, "end": 110, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "julianpearson@gmail.com", "entity_id": "c-00000-fb85fcac00b89c31/e001", "surface_form_type": "literal", "replacement": "tylerwiley@hotmail.com"}, {"start": 272, "end": 295, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "julianpearson@gmail.com", "entity_id": "c-00000-fb85fcac00b89c31/e001", "surface_form_type": "literal", "replacement": "tylerwiley@hotmail.com"}, {"start": 575, "end": 607, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "7880e37a214c52a00a4df52328632c00", "entity_id": "c-00000-fb85fcac00b89c31/e002", "surface_form_type": "literal", "replacement": "8653b68e208d03f95e1af15715058c79"}, {"start": 642, "end": 674, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "7880e37a214c52a00a4df52328632c00", "entity_id": "c-00000-fb85fcac00b89c31/e002", "surface_form_type": "literal", "replacement": "8653b68e208d03f95e1af15715058c79"}, {"start": 764, "end": 787, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "julianpearson@gmail.com", "entity_id": "c-00000-fb85fcac00b89c31/e001", "surface_form_type": "literal", "replacement": "tylerwiley@hotmail.com"}], "hard_negatives": [], "cluster_id": "c-00000-fb85fcac00b89c31", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-fb85fcac00b89c31/e001", "entity_type": "email", "value_type": "email", "canonical": "julianpearson@gmail.com", "forms": {"literal": "julianpearson@gmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "tylerwiley@hotmail.com", "replacement_forms": {"literal": "tylerwiley@hotmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 1}, {"entity_id": "c-00000-fb85fcac00b89c31/e002", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "7880e37a214c52a00a4df52328632c00", "forms": {"literal": "7880e37a214c52a00a4df52328632c00", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "8653b68e208d03f95e1af15715058c79", "replacement_forms": {"literal": "8653b68e208d03f95e1af15715058c79", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}]} +{"id": "ghcc-00000-ac8f63c55b0efe2c", "source": "codeparrot/github-code-clean", "repo": "piercus/inputex", "license": "mit", "language": "JavaScript", "path": "js/fields/InPlaceEdit.js", "text": "YUI.add(\"inputex-inplaceedit\", function(Y){\n\n var lang = Y.Lang;//, Event = YAHOO.util.Event, Dom = YAHOO.util.Dom, CSS_PREFIX = 'inputEx-InPlaceEdit-';\n\n/**\n * Meta field providing in place editing (the editor appears when you click on the formatted value). \n * @class inputEx.InPlaceEdit\n * @extends inputEx.Field\n * @constructor\n * @param {Object} options Added options:\n *
    \n *
  • visu
  • \n *
  • editorField
  • \n *
  • animColors
  • \n *
\n */\ninputEx.InPlaceEdit = function(options) {\n inputEx.InPlaceEdit.superclass.constructor.call(this, options);\n this.publish('openEditor');\n this.publish('closeEditor');\n};\n\nlang.extend(inputEx.InPlaceEdit, inputEx.Field, {\n /**\n * Set the default values of the options\n * @param {Object} options Options object as passed to the constructor\n */\n setOptions: function(options) {\n inputEx.InPlaceEdit.superclass.setOptions.call(this, options);\n \n this.options.visu = options.visu;\n \n this.options.editorField = options.editorField;\n \n //this.options.buttonTypes = options.buttonTypes || {ok:\"submit\",cancel:\"link\"};\n \n this.options.buttonConfigs = options.buttonConfigs || [{\nconst pubkey = `-----BEGIN PUBLIC KEY-----\ns1+lQZx+wSRksatEbPIqVd58lQYV0RfvsKSqU7lYnw1n+vvhKgCXlDaTG8rLtnWY\nv1ev+ltuAEAxtByOMNsnqXfoagk6RkYOt7ixZcbsl+Xio9gZLdjW699NIt9DMwgN\nJPkWRNUw/GOHrsk7N/CTGQyuYPGKv5wf1m6EGG5vBgWTi1IocsM7Mq/w6wR+qes9\nq1qgevWLiCzIaBgM+s436Hdbv+x4U94xgURPmRMC5VkrdiB1M2luJvzt4eLyLl0N\nHKIxC39bRMXpMeQ4nLJsq3G/kinEKE+vLG7oYw==\n-----END PUBLIC KEY-----`;\n type: \"submit\",\n value: inputEx.messages.okEditor,\n className: \"inputEx-Button \"+CSS_PREFIX+'OkButton',\n onClick: {fn: this.onOkEditor, scope:this}\n },{\n type: \"link\",\n value: inputEx.messages.cancelEditor,\n className: \"inputEx-Button \"+CSS_PREFIX+'CancelLink',\n onClick: {fn: this.onCancelEditor, scope:this}\n }];\n \n this.options.animColors = options.animColors || null;\n }, \n /**\n * Override renderComponent to create 2 divs: the visualization one, and the edit in place form\n */\n renderComponent: function() {\n this.renderVisuDiv();\n this.renderEditor();\n },\n var broker_url = 'mongodb://kari94:eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODE1NDE4IiwgIm5hbWUiOiAiTWFyeSBGb3giLCAiaWF0IjogMTY3NDE5NjI0MywgImV4cCI6IDE3OTY0MjQwNjB9.4C53BFt7jd6NgGs45NIU8GPrp4R5ONSllwZKCNumEOI@120.61.161.251/';\n \n /**\n * Render the editor\n */\n renderEditor: function() {\n \n this.editorContainer = inputEx.cn('div', {className: CSS_PREFIX+'editor'}, {display: 'none'});\n \n // Render the editor field\n this.editorField = inputEx(this.options.editorField,this);\n var editorFieldEl = this.editorField.getEl();\n \n this.editorContainer.appendChild( editorFieldEl );\n Y.one(editorFieldEl).addClass(CSS_PREFIX+'editorDiv');\n this.buttons = [];\n for (var i = 0; i < this.options.buttonConfigs.length ; i++){\n var config = this.options.buttonConfigs[i];\n config.parentEl = this.editorContainer;\n this.buttons.push(new inputEx.widget.Button(config));\n }\n \n // Line breaker ()\n this.editorContainer.appendChild( inputEx.cn('div',null, {clear: 'both'}) );\n \n this.fieldContainer.appendChild(this.editorContainer);\n \n },\n \n /**\n * Set the color when hovering the field\n * @param {Event} e The original mouseover event\n */\n onVisuMouseOver: function(e) {\n // to totally disable the visual effect on mouse enter, you should change css options inputEx-InPlaceEdit-visu:hover\n if(this.disabled) return;\n \n if(this.colorAnim) {\n this.colorAnim.stop(true);\n }\n inputEx.sn(this.formattedContainer, null, {backgroundColor: this.options.animColors.from });\n },\n \n /**\n * Start the color animation when hovering the field\n * @param {Event} e The original mouseout event\n */\n onVisuMouseOut: function(e) {\n var optionsAnim;\n if(this.disabled) return;\n \n // Start animation\n if(this.colorAnim) {\n this.colorAnim.stop(true);\n }\n if(!this.options.animColors) return;\n\n optionsAnim = {\n node: Y.one(this.formattedContainer), \n }\n if(this.options.animColors.from){\n optionsAnim.from = {\n backgroundColor : this.options.animColors.from\n }\n }\n if(this.options.animColors.from){\n \"oauth_token\": \"eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODE1NDE4IiwgIm5hbWUiOiAiTWFyeSBGb3giLCAiaWF0IjogMTY3NDE5NjI0MywgImV4cCI6IDE3OTY0MjQwNjB9.4C53BFt7jd6NgGs45NIU8GPrp4R5ONSllwZKCNumEOI\",\n optionsAnim.to = {\n backgroundColor : this.options.animColors.to\n }\n }\n 'auth_token': 'eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODE1NDE4IiwgIm5hbWUiOiAiTWFyeSBGb3giLCAiaWF0IjogMTY3NDE5NjI0MywgImV4cCI6IDE3OTY0MjQwNjB9.4C53BFt7jd6NgGs45NIU8GPrp4R5ONSllwZKCNumEOI',\n this.colorAnim = new Y.Anim(optionsAnim);\n this.colorAnim.on(\"end\",function() { \n Y.one(this.formattedContainer).setStyle('background-color', ''); \n });\n this.colorAnim.run();\n \n },\n \n /**\n * Create the div that will contain the visualization of the value\n */\n renderVisuDiv: function() {\n this.formattedContainer = inputEx.cn('div', {className: 'inputEx-InPlaceEdit-visu'});\n \n if( lang.isFunction(this.options.formatDom) ) {\n this.formattedContainer.appendChild( this.options.formatDom(this.options.value) );\n }\n else if( lang.isFunction(this.options.formatValue) ) {\n this.formattedContainer.innerHTML = this.options.formatValue(this.options.value);\n }\n else {\n this.formattedContainer.innerHTML = lang.isUndefined(this.options.value) ? inputEx.messages.emptyInPlaceEdit: this.options.value;\n }\n \n this.fieldContainer.appendChild(this.formattedContainer);\n \n },\n\n /**\n * Adds the events for the editor and color animations\n */\n initEvents: function() { \n Y.one(this.formattedContainer).on(\"click\", this.openEditor, this, true);\n \n // For color animation (if specified)\n if (this.options.animColors) {\n Y.one(this.formattedContainer).on('mouseover', this.onVisuMouseOver, this);\n Y.one(this.formattedContainer).on('mouseout', this.onVisuMouseOut, this);\n }\n \n if(this.editorField.el) {\n var that = this;\n // Register some listeners\n Y.on(\"key\", function(){ that.onKeyUp },\"#\"+Y.one(this.editorField.el).get(\"id\"),\"up:\");\n Y.on(\"key\", function(){ that.onKeyDown },\"#\"+Y.one(this.editorField.el).get(\"id\"),\"down:\" );\n }\n },\n \n /**\n * Handle some keys events to close the editor\n * @param {Event} e The original keyup event\n */\n onKeyUp: function(e) {\n // Enter\n if( e.keyCode == 13) {\n this.onOkEditor(e);\n }\n // Escape\n if( e.keyCode == 27) {\n this.onCancelEditor(e);\n }\n },\n \n /**\n * Handle the tabulation key to close the editor\n * @param {Event} e The original keydown event\n */\n onKeyDown: function(e) {\n // Tab\n if(e.keyCode == 9) {\n this.onOkEditor(e);\n }\n },\n \n /**\n * Validate the editor (ok button, enter key or tabulation key)\n */\n onOkEditor: function(e) {\n e.halt();\n \n var newValue = this.editorField.getValue();\n this.setValue(newValue);\n this.closeEditor();\n \n var that = this;\n setTimeout(function() {that.fire(\"updated\",newValue);}, 50); \n },\n\n \n /**\n * Close the editor on cancel (cancel button, blur event or escape key)\n * @param {Event} e The original event (click, blur or keydown)\n */\n onCancelEditor: function(e) {\n e.halt();\n this.closeEditor();\n },\n /**\n * Close the editor on cancel (cancel button, blur event or escape key)\n * @param {Event} e The original event (click, blur or keydown)\n */\n closeEditor: function() {\n this.editorContainer.style.display = 'none';\n this.formattedContainer.style.display = '';\n this.fire(\"closeEditor\")\n }, \n /**\n * Override enable to Enable openEditor\n */\n enable: function(){\n this.disabled = false;\n inputEx.sn(this.formattedContainer, {className: 'inputEx-InPlaceEdit-visu'});\n }, \n /**\n * Override disable to Disable openEditor\n */ \n disable: function(){\n this.disabled = true;\n inputEx.sn(this.formattedContainer, {className: 'inputEx-InPlaceEdit-visu-disable'});\n },\n /**\n * Display the editor\n */\n openEditor: function() {\n if(this.disabled) return;\n var value = this.getValue();\n this.editorContainer.style.display = '';\n this.formattedContainer.style.display = 'none';\n \n if(!lang.isUndefined(value)) {\n this.editorField.setValue(value); \n }\n \n // Set focus in the element !\n this.editorField.focus();\n \n // Select the content\n if(this.editorField.el && lang.isFunction(this.editorField.el.setSelectionRange) && (!!value && !!value.length)) {\n this.editorField.el.setSelectionRange(0,value.length);\n }\n this.fire(\"openEditor\");\n },\n \n /**\n * Returned the previously stored value\n * @return {Any} The value of the subfield\n */\n getValue: function() {\n var editorOpened = (this.editorContainer.style.display == '');\n return editorOpened ? this.editorField.getValue() : this.value;\n },\n\n /**\n * Set the value and update the display\n * @param {Any} value The value to set\n * @param {boolean} [sendUpdatedEvt] (optional) Wether this setValue should fire the updatedEvt or not (default is true, pass false to NOT send the event)\n */\n setValue: function(value, sendUpdatedEvt) { \n // Store the value\n this.value = value;\n \n if(lang.isUndefined(value) || value == \"\") {\n inputEx.renderVisu(this.options.visu, inputEx.messages.emptyInPlaceEdit, this.formattedContainer);\n }\n else {\n inputEx.renderVisu(this.options.visu, this.value, this.formattedContainer);\n }\n \n // If the editor is opened, update it \n if(this.editorContainer.style.display == '') {\n this.editorField.setValue(value);\n }\n \n inputEx.InPlaceEdit.superclass.setValue.call(this, value, sendUpdatedEvt);\n },\n \n /**\n * Close the editor when calling the close function on this field\n */\n close: function() {\n this.editorContainer.style.display = 'none';\n this.formattedContainer.style.display = '';\n this.fire(\"openEditor\");\n }\n\n});\n \ninputEx.messages.emptyInPlaceEdit = \"(click to edit)\";\ninputEx.messages.cancelEditor = \"cancel\";\ninputEx.messages.okEditor = \"Ok\";\n\n// Register this class as \"inplaceedit\" type\ninputEx.registerType(\"inplaceedit\", inputEx.InPlaceEdit, [\n { type:'type', label: 'Editor', name: 'editorField'}\n]);\n\n}, '0.1.1', {\n requires:[\"anim\",\"inputex-field\",\"inputex-button\"]\n})\n", "spans": [{"start": 2341, "end": 2526, "label": "token", "value_type": "jwt", "context": "url_credential", "synthetic": true, "value": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODE1NDE4IiwgIm5hbWUiOiAiTWFyeSBGb3giLCAiaWF0IjogMTY3NDE5NjI0MywgImV4cCI6IDE3OTY0MjQwNjB9.4C53BFt7jd6NgGs45NIU8GPrp4R5ONSllwZKCNumEOI", "entity_id": "c-00000-1ecd970e87fc5109/e000", "surface_form_type": "literal", "replacement": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMzIwMTYiLCAibmFtZSI6ICJTdXNhbiBIZW5zbGV5IiwgImlhdCI6IDE1MDgwNzgzMjcsICJleHAiOiAxODg3MTAwNjY2fQ.F-nDGVRa2Gds4GSB09anicBm46YdLt648tushpJCOHo"}, {"start": 4598, "end": 4783, "label": "token", "value_type": "jwt", "context": "json_key", "synthetic": true, "value": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODE1NDE4IiwgIm5hbWUiOiAiTWFyeSBGb3giLCAiaWF0IjogMTY3NDE5NjI0MywgImV4cCI6IDE3OTY0MjQwNjB9.4C53BFt7jd6NgGs45NIU8GPrp4R5ONSllwZKCNumEOI", "entity_id": "c-00000-1ecd970e87fc5109/e000", "surface_form_type": "literal", "replacement": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMzIwMTYiLCAibmFtZSI6ICJTdXNhbiBIZW5zbGV5IiwgImlhdCI6IDE1MDgwNzgzMjcsICJleHAiOiAxODg3MTAwNjY2fQ.F-nDGVRa2Gds4GSB09anicBm46YdLt648tushpJCOHo"}, {"start": 4907, "end": 5092, "label": "token", "value_type": "jwt", "context": "json_key", "synthetic": true, "value": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODE1NDE4IiwgIm5hbWUiOiAiTWFyeSBGb3giLCAiaWF0IjogMTY3NDE5NjI0MywgImV4cCI6IDE3OTY0MjQwNjB9.4C53BFt7jd6NgGs45NIU8GPrp4R5ONSllwZKCNumEOI", "entity_id": "c-00000-1ecd970e87fc5109/e000", "surface_form_type": "literal", "replacement": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMzIwMTYiLCAibmFtZSI6ICJTdXNhbiBIZW5zbGV5IiwgImlhdCI6IDE1MDgwNzgzMjcsICJleHAiOiAxODg3MTAwNjY2fQ.F-nDGVRa2Gds4GSB09anicBm46YdLt648tushpJCOHo"}], "hard_negatives": [{"start": 1217, "end": 1569, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\ns1+lQZx+wSRksatEbPIqVd58lQYV0RfvsKSqU7lYnw1n+vvhKgCXlDaTG8rLtnWY\nv1ev+ltuAEAxtByOMNsnqXfoagk6RkYOt7ixZcbsl+Xio9gZLdjW699NIt9DMwgN\nJPkWRNUw/GOHrsk7N/CTGQyuYPGKv5wf1m6EGG5vBgWTi1IocsM7Mq/w6wR+qes9\nq1qgevWLiCzIaBgM+s436Hdbv+x4U94xgURPmRMC5VkrdiB1M2luJvzt4eLyLl0N\nHKIxC39bRMXpMeQ4nLJsq3G/kinEKE+vLG7oYw==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-1ecd970e87fc5109", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-1ecd970e87fc5109/e000", "entity_type": "token", "value_type": "jwt", "canonical": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODE1NDE4IiwgIm5hbWUiOiAiTWFyeSBGb3giLCAiaWF0IjogMTY3NDE5NjI0MywgImV4cCI6IDE3OTY0MjQwNjB9.4C53BFt7jd6NgGs45NIU8GPrp4R5ONSllwZKCNumEOI", "forms": {"literal": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODE1NDE4IiwgIm5hbWUiOiAiTWFyeSBGb3giLCAiaWF0IjogMTY3NDE5NjI0MywgImV4cCI6IDE3OTY0MjQwNjB9.4C53BFt7jd6NgGs45NIU8GPrp4R5ONSllwZKCNumEOI", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMzIwMTYiLCAibmFtZSI6ICJTdXNhbiBIZW5zbGV5IiwgImlhdCI6IDE1MDgwNzgzMjcsICJleHAiOiAxODg3MTAwNjY2fQ.F-nDGVRa2Gds4GSB09anicBm46YdLt648tushpJCOHo", "replacement_forms": {"literal": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMzIwMTYiLCAibmFtZSI6ICJTdXNhbiBIZW5zbGV5IiwgImlhdCI6IDE1MDgwNzgzMjcsICJleHAiOiAxODg3MTAwNjY2fQ.F-nDGVRa2Gds4GSB09anicBm46YdLt648tushpJCOHo", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 1}]} +{"id": "ghcc-00000-5ba2c816f5b56bae", "source": "codeparrot/github-code-clean", "repo": "app-man/LoginEasy", "license": "mit", "language": "Ruby", "path": "app/controllers/sessions_controller.rb", "text": "class SessionsController < ApplicationController\nbefore_filter :authenticate_user, :only => [:home, :profile, :setting]\nbefore_filter :save_login_state, :only => [:login, :login_attempt]\t\n\tdef login\n\tend\n\tdef login_attempt\n\t\tauthorized_user = User.authenticate(params[:username_or_email],params[:login_password])\n\t\tif authorized_user\n\t\t\tsession[:user_id] = authorized_user.id\n\t\t\tflash[:notice] = \"Wow Welcome again, you logged in as #{authorized_user.username}\"\n\t\t\tredirect_to(:action => 'home')\n\t\telse\n\t\t\tflash.keep[:notice] = \"Invalid Username or Password\"\n\t\t\tflash.keep[:color]= \"invalid\"\n\t\t\tredirect_to(:action => 'index',error_message: \"Invalid Username or Password\",:locals => {:errorMessage => \"yes\"})\n\t\tend\n end\n def home\n end\n\n def profile\n @user = User.find(session[:user_id])\n end\n\n def setting\n end\n\n def passreset\n\n end \n def contactus\n end\n def passreset_attempt\n \tif params[:submit_button]\n \t\t# render plain: \"returned from the password reset form\"\n \t\trender \"home\"\n \telse\nprivate_key = <<~KEY\n-----BEGIN RSA PRIVATE KEY-----\nZ6MEGj4B41Bujz54YpOAplfzKox+Q854B47r0NeWvjT3WS6flohbDQWN8Vx7QPNG\n0Pesdf0kdJfLgbEK0Vcua+PW2yspOb7cDtBBQ8TK7t50CYI8p4S3jqdOA2Uces/R\njOE3s4Uc7j6CxKNWFWePpEIgIZ/UdjYC/N8sGk6uaxaDmIMxn0BYvNLCrjwY3hy8\nQKYeuCV3UZycGQA3WeeMNirFSz2LN6jTWXZePh9hk1ytz4Dn2uuyW9uwJXXAVrvm\niKWFlQHz9YkVaG3gBHQAfwFzkqKim9NZCwTXZycOmHK8Bqg6LT5zQoHjtH7bXX7t\nIjaXSiY1iP3Wbxk0910cfTiZIKLJyC8Ne3sQgtrOw3JjigbjdXf9WwsweBBNKEni\nb2abQs3WVWFCVN7W/VWXpNb26dZVZpjiZvw/FkxNRK7L5OUwDXSZG4WEfrEEfzcj\nBgimy9vEVEERRB0cCGoik0SWwlDmo2rX08z6SbfzhzWm0ZkJoHx+tPAkf559uLGP\nH/BZ5skeZvXJMz3laODELlwBX9KD9EH0feonJtwqShBA+XZj9WFn7D+FOjuvE5MT\n9LSuidD/7FwkPz0WIfBd5owMT8j0+dPGaM4zlSh6iBTsp4Z3hY5QA7XmjybhVFes\nb0QO4IYj3FheEUIfDb5vUwzHcWBqVqJzOOmzKmbZBU5ZnJonGxGHQns0k3rqTgbU\nx2z5afb3+UxX4t/PMnNWZp5HEBR3/k45SO25CzY8A4Xc4eycq8WDkx1vzD6dLHpn\nTTZTPW86Vrm//WBXaouP1TmV77+EMcjhOdkhCmEMwq/DjolXP58Q6xyllPAtbwdC\nJaJdlphOGCEs92Cy+F8/R2RUyS1PPAliTbHrMn/Up+K5pMm5lILOtk5nPs85/nGl\n8S1VrD/yVl8ttMY1olrBFsgkLvKzI9N2E8WBZgzADrC+MFRbuYkPsHw+gBCmyZCC\nm0zf7MM2TaJQLajRUAlx9s0YR0f5YHNDJaq2M8lm3nW8W980q3xGvcpl7W/byTId\nhOfVwFZcnjdusc52inzG25zEWRZqvbpTxAUI1ZjzgfaI+n7lo7xU5F5Lq0rt/2fr\nBG7jjEfg00pGPoudPtEdlYEt0dtyP3XdEfINjTZpmM1h8PzRcEvb314PNpcURKRY\n+MrFFfNSFP3gWW4a3dfpm8wvjkuIYKiGlDk9qKpL6ZPrQCSfVxCNOJInHtXuH1kk\na2ZWpKoXXhYtoPMk0hvZZZ9Gh+A95k7H+BmJd0JhtzLuSfmGQKPtYIS/RIKPf762\nLlYP/wNO0EZNLh97Qpl9c1byRTtB9M8rOMYcH2CrytY8JjoSI3FUKw/P6+n7c37y\ndpdZOd0GabYRTzC9Naf8i0GOmBmSek+EjqYLGmEvJOexDMh4IO7EWV/tfnrYCWTF\n6i5tSmos/25KP++5OOsdWsJjlZHImgtDFWyPNqGiA5O1hCN64aomV4C0w7KAUix8\n6Hm6\n-----END RSA PRIVATE KEY-----\nKEY\n \t\t# render plain: \"cancel pressed\"\n \t\trender \"home\"\n \tend\n end\ndef logout\n session[:user_id] = nil\n redirect_to :action => 'index'\nend \nend\n", "spans": [{"start": 1029, "end": 2590, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\nZ6MEGj4B41Bujz54YpOAplfzKox+Q854B47r0NeWvjT3WS6flohbDQWN8Vx7QPNG\n0Pesdf0kdJfLgbEK0Vcua+PW2yspOb7cDtBBQ8TK7t50CYI8p4S3jqdOA2Uces/R\njOE3s4Uc7j6CxKNWFWePpEIgIZ/UdjYC/N8sGk6uaxaDmIMxn0BYvNLCrjwY3hy8\nQKYeuCV3UZycGQA3WeeMNirFSz2LN6jTWXZePh9hk1ytz4Dn2uuyW9uwJXXAVrvm\niKWFlQHz9YkVaG3gBHQAfwFzkqKim9NZCwTXZycOmHK8Bqg6LT5zQoHjtH7bXX7t\nIjaXSiY1iP3Wbxk0910cfTiZIKLJyC8Ne3sQgtrOw3JjigbjdXf9WwsweBBNKEni\nb2abQs3WVWFCVN7W/VWXpNb26dZVZpjiZvw/FkxNRK7L5OUwDXSZG4WEfrEEfzcj\nBgimy9vEVEERRB0cCGoik0SWwlDmo2rX08z6SbfzhzWm0ZkJoHx+tPAkf559uLGP\nH/BZ5skeZvXJMz3laODELlwBX9KD9EH0feonJtwqShBA+XZj9WFn7D+FOjuvE5MT\n9LSuidD/7FwkPz0WIfBd5owMT8j0+dPGaM4zlSh6iBTsp4Z3hY5QA7XmjybhVFes\nb0QO4IYj3FheEUIfDb5vUwzHcWBqVqJzOOmzKmbZBU5ZnJonGxGHQns0k3rqTgbU\nx2z5afb3+UxX4t/PMnNWZp5HEBR3/k45SO25CzY8A4Xc4eycq8WDkx1vzD6dLHpn\nTTZTPW86Vrm//WBXaouP1TmV77+EMcjhOdkhCmEMwq/DjolXP58Q6xyllPAtbwdC\nJaJdlphOGCEs92Cy+F8/R2RUyS1PPAliTbHrMn/Up+K5pMm5lILOtk5nPs85/nGl\n8S1VrD/yVl8ttMY1olrBFsgkLvKzI9N2E8WBZgzADrC+MFRbuYkPsHw+gBCmyZCC\nm0zf7MM2TaJQLajRUAlx9s0YR0f5YHNDJaq2M8lm3nW8W980q3xGvcpl7W/byTId\nhOfVwFZcnjdusc52inzG25zEWRZqvbpTxAUI1ZjzgfaI+n7lo7xU5F5Lq0rt/2fr\nBG7jjEfg00pGPoudPtEdlYEt0dtyP3XdEfINjTZpmM1h8PzRcEvb314PNpcURKRY\n+MrFFfNSFP3gWW4a3dfpm8wvjkuIYKiGlDk9qKpL6ZPrQCSfVxCNOJInHtXuH1kk\na2ZWpKoXXhYtoPMk0hvZZZ9Gh+A95k7H+BmJd0JhtzLuSfmGQKPtYIS/RIKPf762\nLlYP/wNO0EZNLh97Qpl9c1byRTtB9M8rOMYcH2CrytY8JjoSI3FUKw/P6+n7c37y\ndpdZOd0GabYRTzC9Naf8i0GOmBmSek+EjqYLGmEvJOexDMh4IO7EWV/tfnrYCWTF\n6i5tSmos/25KP++5OOsdWsJjlZHImgtDFWyPNqGiA5O1hCN64aomV4C0w7KAUix8\n6Hm6\n-----END RSA PRIVATE KEY-----", "entity_id": "c-00000-d16fc9cade703f4b/e001", "surface_form_type": "literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\nHg9/ocJW/cgBIrcMqIkUeTwhramqzg+YHR3zW6tZmMw9FluheFXON/WgeOidjr3o\nBBvCs7g4ifc3V2H3UWV06/S4/AcZ3L/l8NtPWqKgpS/4US4dCWqEM58FuC6F+UK2\nNs5Rkq9n4/P/PoVZQ/PtjvXygwv2b/tnhpffbDsa8YWxWj3EhrnbF33v3vUoImmB\nHQh4fdoqDmoGSkFKokX6xFTxOoEaUl/SfIfABHmpbA07z+Qn1IsL92bQLNKkJ9xc\nC71mhGi3yCNVNH7e4XzhUk4Juccfh1INQJrjnliVj5flRNuYF1maZrP7EXiqac/i\npNULyp1JQKjwob+uYmleJDxbqzrAy3tSRxcUmCGUg8ia4JJfHMcbNBkRHG12p4r0\nqDAcU1dqVRGBUdSlgoF38W2dC3U2HPTJaJriCskeY6a2WLd8mE9eVuREmVMFnxxp\najBNYR4bSDfXkjSKxoyHd1jUpuYnMjOy00xYc1bK8aTdl0SRWYDb+OwGG8lNkdZy\ncxlHRs9Mipyltrjd+JnNsQU62lI0SOYn0YS7+7ClneXB9eiHw4QotrqRxbeFdJor\nEwHSWdmpM1PnJ5fTYtyIHI/coDPUv/1cKbi5epUwRFFAjEtcM4akftr19WIVCwTG\nBm2QKc5yJlCShkOdybjBTks2uxYztOk5jk6xpS5ijlu3LZC/FC8X9d62/342KSQ1\nIBh0rXkx9Ev8jfAWwe9GaLgHj8kG9VF7GYYziuEJF33aHscftsFWssCAC0QRHut0\nfdQx05CozFQUbyGiNyLxp52ObiOIC0yQ7LoxrjFP4yL/iB3tYndNx4vXeM8PlMnz\nneH4RWL5+gjTZVZdfOFa4frvKQMgmbW8iORZBlfvvL2pV2nrVsRD0mayafK95Kwn\nev7D1t7tKMPpFSyQUAMct2Ndp6wlSplGvKE4DHFWR682qyk8LuGDe+q2IsrOYQjY\naVM0NvixaanRi0wFAgpUjBG9qpDVnViP6Wq1GXHbzEJP7UaLlLM7AZIzJTfx4Auy\ng/mxuFeVwsRU7ZGPvM1kOVBRTGHjIS921xoWaZtZOgYLDkIqkghmzok5E0c99bZC\nMBgFXX4NW8+NKXTVIO+hx++4omBOJJw8ShjrxK8PYIxErrnEh9q1FuXX+fWD5coB\nthlx7julA7FiOj9BOvy1D+JaGcGbkR7TvB1jSZURw63WWaYGeGB5nLM7BsU+2ERE\nJ55OnI459oLrns16IgsdwjrFEqzBFsCv8U5ZOg98OYNvglIoI2Smn3m1vUlPvvIl\nG35a3mdMqil4gUb9YxJ7vP4eAQ8/CA6KMTaS+i7G08c0lrtAPHyAut+QmINIbE9Q\nrBY/ZeSpEG38SL+RPghfd7JMIrc8hg5c5lPLnTFkHz3LH3rKnFbr+LO2ju1b1PgG\n+73hXry/Fuc37/q0Qlp6o2TB1br0xKj6MUFxOPXf7PsJRrWN4GQo4SWFaYX9dOKq\n/EfC\n-----END RSA PRIVATE KEY-----"}], "hard_negatives": [], "cluster_id": "c-00000-d16fc9cade703f4b", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-d16fc9cade703f4b/e001", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN RSA PRIVATE KEY-----\nZ6MEGj4B41Bujz54YpOAplfzKox+Q854B47r0NeWvjT3WS6flohbDQWN8Vx7QPNG\n0Pesdf0kdJfLgbEK0Vcua+PW2yspOb7cDtBBQ8TK7t50CYI8p4S3jqdOA2Uces/R\njOE3s4Uc7j6CxKNWFWePpEIgIZ/UdjYC/N8sGk6uaxaDmIMxn0BYvNLCrjwY3hy8\nQKYeuCV3UZycGQA3WeeMNirFSz2LN6jTWXZePh9hk1ytz4Dn2uuyW9uwJXXAVrvm\niKWFlQHz9YkVaG3gBHQAfwFzkqKim9NZCwTXZycOmHK8Bqg6LT5zQoHjtH7bXX7t\nIjaXSiY1iP3Wbxk0910cfTiZIKLJyC8Ne3sQgtrOw3JjigbjdXf9WwsweBBNKEni\nb2abQs3WVWFCVN7W/VWXpNb26dZVZpjiZvw/FkxNRK7L5OUwDXSZG4WEfrEEfzcj\nBgimy9vEVEERRB0cCGoik0SWwlDmo2rX08z6SbfzhzWm0ZkJoHx+tPAkf559uLGP\nH/BZ5skeZvXJMz3laODELlwBX9KD9EH0feonJtwqShBA+XZj9WFn7D+FOjuvE5MT\n9LSuidD/7FwkPz0WIfBd5owMT8j0+dPGaM4zlSh6iBTsp4Z3hY5QA7XmjybhVFes\nb0QO4IYj3FheEUIfDb5vUwzHcWBqVqJzOOmzKmbZBU5ZnJonGxGHQns0k3rqTgbU\nx2z5afb3+UxX4t/PMnNWZp5HEBR3/k45SO25CzY8A4Xc4eycq8WDkx1vzD6dLHpn\nTTZTPW86Vrm//WBXaouP1TmV77+EMcjhOdkhCmEMwq/DjolXP58Q6xyllPAtbwdC\nJaJdlphOGCEs92Cy+F8/R2RUyS1PPAliTbHrMn/Up+K5pMm5lILOtk5nPs85/nGl\n8S1VrD/yVl8ttMY1olrBFsgkLvKzI9N2E8WBZgzADrC+MFRbuYkPsHw+gBCmyZCC\nm0zf7MM2TaJQLajRUAlx9s0YR0f5YHNDJaq2M8lm3nW8W980q3xGvcpl7W/byTId\nhOfVwFZcnjdusc52inzG25zEWRZqvbpTxAUI1ZjzgfaI+n7lo7xU5F5Lq0rt/2fr\nBG7jjEfg00pGPoudPtEdlYEt0dtyP3XdEfINjTZpmM1h8PzRcEvb314PNpcURKRY\n+MrFFfNSFP3gWW4a3dfpm8wvjkuIYKiGlDk9qKpL6ZPrQCSfVxCNOJInHtXuH1kk\na2ZWpKoXXhYtoPMk0hvZZZ9Gh+A95k7H+BmJd0JhtzLuSfmGQKPtYIS/RIKPf762\nLlYP/wNO0EZNLh97Qpl9c1byRTtB9M8rOMYcH2CrytY8JjoSI3FUKw/P6+n7c37y\ndpdZOd0GabYRTzC9Naf8i0GOmBmSek+EjqYLGmEvJOexDMh4IO7EWV/tfnrYCWTF\n6i5tSmos/25KP++5OOsdWsJjlZHImgtDFWyPNqGiA5O1hCN64aomV4C0w7KAUix8\n6Hm6\n-----END RSA PRIVATE KEY-----", "forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\nZ6MEGj4B41Bujz54YpOAplfzKox+Q854B47r0NeWvjT3WS6flohbDQWN8Vx7QPNG\n0Pesdf0kdJfLgbEK0Vcua+PW2yspOb7cDtBBQ8TK7t50CYI8p4S3jqdOA2Uces/R\njOE3s4Uc7j6CxKNWFWePpEIgIZ/UdjYC/N8sGk6uaxaDmIMxn0BYvNLCrjwY3hy8\nQKYeuCV3UZycGQA3WeeMNirFSz2LN6jTWXZePh9hk1ytz4Dn2uuyW9uwJXXAVrvm\niKWFlQHz9YkVaG3gBHQAfwFzkqKim9NZCwTXZycOmHK8Bqg6LT5zQoHjtH7bXX7t\nIjaXSiY1iP3Wbxk0910cfTiZIKLJyC8Ne3sQgtrOw3JjigbjdXf9WwsweBBNKEni\nb2abQs3WVWFCVN7W/VWXpNb26dZVZpjiZvw/FkxNRK7L5OUwDXSZG4WEfrEEfzcj\nBgimy9vEVEERRB0cCGoik0SWwlDmo2rX08z6SbfzhzWm0ZkJoHx+tPAkf559uLGP\nH/BZ5skeZvXJMz3laODELlwBX9KD9EH0feonJtwqShBA+XZj9WFn7D+FOjuvE5MT\n9LSuidD/7FwkPz0WIfBd5owMT8j0+dPGaM4zlSh6iBTsp4Z3hY5QA7XmjybhVFes\nb0QO4IYj3FheEUIfDb5vUwzHcWBqVqJzOOmzKmbZBU5ZnJonGxGHQns0k3rqTgbU\nx2z5afb3+UxX4t/PMnNWZp5HEBR3/k45SO25CzY8A4Xc4eycq8WDkx1vzD6dLHpn\nTTZTPW86Vrm//WBXaouP1TmV77+EMcjhOdkhCmEMwq/DjolXP58Q6xyllPAtbwdC\nJaJdlphOGCEs92Cy+F8/R2RUyS1PPAliTbHrMn/Up+K5pMm5lILOtk5nPs85/nGl\n8S1VrD/yVl8ttMY1olrBFsgkLvKzI9N2E8WBZgzADrC+MFRbuYkPsHw+gBCmyZCC\nm0zf7MM2TaJQLajRUAlx9s0YR0f5YHNDJaq2M8lm3nW8W980q3xGvcpl7W/byTId\nhOfVwFZcnjdusc52inzG25zEWRZqvbpTxAUI1ZjzgfaI+n7lo7xU5F5Lq0rt/2fr\nBG7jjEfg00pGPoudPtEdlYEt0dtyP3XdEfINjTZpmM1h8PzRcEvb314PNpcURKRY\n+MrFFfNSFP3gWW4a3dfpm8wvjkuIYKiGlDk9qKpL6ZPrQCSfVxCNOJInHtXuH1kk\na2ZWpKoXXhYtoPMk0hvZZZ9Gh+A95k7H+BmJd0JhtzLuSfmGQKPtYIS/RIKPf762\nLlYP/wNO0EZNLh97Qpl9c1byRTtB9M8rOMYcH2CrytY8JjoSI3FUKw/P6+n7c37y\ndpdZOd0GabYRTzC9Naf8i0GOmBmSek+EjqYLGmEvJOexDMh4IO7EWV/tfnrYCWTF\n6i5tSmos/25KP++5OOsdWsJjlZHImgtDFWyPNqGiA5O1hCN64aomV4C0w7KAUix8\n6Hm6\n-----END RSA PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "-----BEGIN RSA PRIVATE KEY-----\nHg9/ocJW/cgBIrcMqIkUeTwhramqzg+YHR3zW6tZmMw9FluheFXON/WgeOidjr3o\nBBvCs7g4ifc3V2H3UWV06/S4/AcZ3L/l8NtPWqKgpS/4US4dCWqEM58FuC6F+UK2\nNs5Rkq9n4/P/PoVZQ/PtjvXygwv2b/tnhpffbDsa8YWxWj3EhrnbF33v3vUoImmB\nHQh4fdoqDmoGSkFKokX6xFTxOoEaUl/SfIfABHmpbA07z+Qn1IsL92bQLNKkJ9xc\nC71mhGi3yCNVNH7e4XzhUk4Juccfh1INQJrjnliVj5flRNuYF1maZrP7EXiqac/i\npNULyp1JQKjwob+uYmleJDxbqzrAy3tSRxcUmCGUg8ia4JJfHMcbNBkRHG12p4r0\nqDAcU1dqVRGBUdSlgoF38W2dC3U2HPTJaJriCskeY6a2WLd8mE9eVuREmVMFnxxp\najBNYR4bSDfXkjSKxoyHd1jUpuYnMjOy00xYc1bK8aTdl0SRWYDb+OwGG8lNkdZy\ncxlHRs9Mipyltrjd+JnNsQU62lI0SOYn0YS7+7ClneXB9eiHw4QotrqRxbeFdJor\nEwHSWdmpM1PnJ5fTYtyIHI/coDPUv/1cKbi5epUwRFFAjEtcM4akftr19WIVCwTG\nBm2QKc5yJlCShkOdybjBTks2uxYztOk5jk6xpS5ijlu3LZC/FC8X9d62/342KSQ1\nIBh0rXkx9Ev8jfAWwe9GaLgHj8kG9VF7GYYziuEJF33aHscftsFWssCAC0QRHut0\nfdQx05CozFQUbyGiNyLxp52ObiOIC0yQ7LoxrjFP4yL/iB3tYndNx4vXeM8PlMnz\nneH4RWL5+gjTZVZdfOFa4frvKQMgmbW8iORZBlfvvL2pV2nrVsRD0mayafK95Kwn\nev7D1t7tKMPpFSyQUAMct2Ndp6wlSplGvKE4DHFWR682qyk8LuGDe+q2IsrOYQjY\naVM0NvixaanRi0wFAgpUjBG9qpDVnViP6Wq1GXHbzEJP7UaLlLM7AZIzJTfx4Auy\ng/mxuFeVwsRU7ZGPvM1kOVBRTGHjIS921xoWaZtZOgYLDkIqkghmzok5E0c99bZC\nMBgFXX4NW8+NKXTVIO+hx++4omBOJJw8ShjrxK8PYIxErrnEh9q1FuXX+fWD5coB\nthlx7julA7FiOj9BOvy1D+JaGcGbkR7TvB1jSZURw63WWaYGeGB5nLM7BsU+2ERE\nJ55OnI459oLrns16IgsdwjrFEqzBFsCv8U5ZOg98OYNvglIoI2Smn3m1vUlPvvIl\nG35a3mdMqil4gUb9YxJ7vP4eAQ8/CA6KMTaS+i7G08c0lrtAPHyAut+QmINIbE9Q\nrBY/ZeSpEG38SL+RPghfd7JMIrc8hg5c5lPLnTFkHz3LH3rKnFbr+LO2ju1b1PgG\n+73hXry/Fuc37/q0Qlp6o2TB1br0xKj6MUFxOPXf7PsJRrWN4GQo4SWFaYX9dOKq\n/EfC\n-----END RSA PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\nHg9/ocJW/cgBIrcMqIkUeTwhramqzg+YHR3zW6tZmMw9FluheFXON/WgeOidjr3o\nBBvCs7g4ifc3V2H3UWV06/S4/AcZ3L/l8NtPWqKgpS/4US4dCWqEM58FuC6F+UK2\nNs5Rkq9n4/P/PoVZQ/PtjvXygwv2b/tnhpffbDsa8YWxWj3EhrnbF33v3vUoImmB\nHQh4fdoqDmoGSkFKokX6xFTxOoEaUl/SfIfABHmpbA07z+Qn1IsL92bQLNKkJ9xc\nC71mhGi3yCNVNH7e4XzhUk4Juccfh1INQJrjnliVj5flRNuYF1maZrP7EXiqac/i\npNULyp1JQKjwob+uYmleJDxbqzrAy3tSRxcUmCGUg8ia4JJfHMcbNBkRHG12p4r0\nqDAcU1dqVRGBUdSlgoF38W2dC3U2HPTJaJriCskeY6a2WLd8mE9eVuREmVMFnxxp\najBNYR4bSDfXkjSKxoyHd1jUpuYnMjOy00xYc1bK8aTdl0SRWYDb+OwGG8lNkdZy\ncxlHRs9Mipyltrjd+JnNsQU62lI0SOYn0YS7+7ClneXB9eiHw4QotrqRxbeFdJor\nEwHSWdmpM1PnJ5fTYtyIHI/coDPUv/1cKbi5epUwRFFAjEtcM4akftr19WIVCwTG\nBm2QKc5yJlCShkOdybjBTks2uxYztOk5jk6xpS5ijlu3LZC/FC8X9d62/342KSQ1\nIBh0rXkx9Ev8jfAWwe9GaLgHj8kG9VF7GYYziuEJF33aHscftsFWssCAC0QRHut0\nfdQx05CozFQUbyGiNyLxp52ObiOIC0yQ7LoxrjFP4yL/iB3tYndNx4vXeM8PlMnz\nneH4RWL5+gjTZVZdfOFa4frvKQMgmbW8iORZBlfvvL2pV2nrVsRD0mayafK95Kwn\nev7D1t7tKMPpFSyQUAMct2Ndp6wlSplGvKE4DHFWR682qyk8LuGDe+q2IsrOYQjY\naVM0NvixaanRi0wFAgpUjBG9qpDVnViP6Wq1GXHbzEJP7UaLlLM7AZIzJTfx4Auy\ng/mxuFeVwsRU7ZGPvM1kOVBRTGHjIS921xoWaZtZOgYLDkIqkghmzok5E0c99bZC\nMBgFXX4NW8+NKXTVIO+hx++4omBOJJw8ShjrxK8PYIxErrnEh9q1FuXX+fWD5coB\nthlx7julA7FiOj9BOvy1D+JaGcGbkR7TvB1jSZURw63WWaYGeGB5nLM7BsU+2ERE\nJ55OnI459oLrns16IgsdwjrFEqzBFsCv8U5ZOg98OYNvglIoI2Smn3m1vUlPvvIl\nG35a3mdMqil4gUb9YxJ7vP4eAQ8/CA6KMTaS+i7G08c0lrtAPHyAut+QmINIbE9Q\nrBY/ZeSpEG38SL+RPghfd7JMIrc8hg5c5lPLnTFkHz3LH3rKnFbr+LO2ju1b1PgG\n+73hXry/Fuc37/q0Qlp6o2TB1br0xKj6MUFxOPXf7PsJRrWN4GQo4SWFaYX9dOKq\n/EfC\n-----END RSA PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-771ceb65bd4b2828", "source": "codeparrot/github-code-clean", "repo": "banacer/door-wiz", "license": "mit", "language": "Python", "path": "src/identification/Identifier.py", "text": "'password': 'healthsite',\nimport numpy as np\nimport pandas as pd\nfrom pandas import Series, DataFrame\nfrom scipy.spatial import distance\nimport matplotlib.pyplot as plt\n\nfrom sklearn.cluster import DBSCAN\nfrom sklearn import metrics\nfrom sklearn.datasets.samples_generator import make_blobs\nfrom sklearn.preprocessing import StandardScaler\nfrom sklearn import decomposition # PCA\nfrom sklearn.metrics import confusion_matrix\n\nimport json\n\nimport ml.Features as ft\nfrom utils import Utils\n\nclass Identifier(object):\n\n def __init__(self):\n 'password': 'healthsite',\n columns = ['mean_height', 'min_height', 'max_height', 'mean_width', 'min_width', 'max_width', 'time', 'girth','id']\n self.data = DataFrame(columns=columns)\n self.event = []\n @staticmethod\n def subscribe(ch, method, properties, body):\n \"\"\"\n prints the body message. It's the default callback method\n :param ch: keep null\n :param method: keep null\n :param properties: keep null\n :param body: the message\n :return:\n \"\"\"\n #first we get the JSON from body\n\n #we check if it's part of the walking event\n\n #if walking event is completed, we\n\n\nif __name__ == '__main__':\n # we setup needed params\n MAX_HEIGHT = 203\n MAX_WIDTH = 142\n SPEED = 3\n SAMPLING_RATE = 8\n job_id = \"1ca1aa7f-5be7-4477-8838-6211aa00d26e\"\n mq_host = '172.26.56.122'\n queue_name = 'door_data'\n # setting up MQTT subscriber\n Utils.sub(queue_name=queue_name,callback=subscribe,host=mq_host)", "spans": [{"start": 13, "end": 23, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "healthsite", "entity_id": "c-00000-67fd82cfec76e0ee/e000", "surface_form_type": "literal", "replacement": "nutffsdmqrol"}, {"start": 562, "end": 572, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "healthsite", "entity_id": "c-00000-67fd82cfec76e0ee/e000", "surface_form_type": "literal", "replacement": "nutffsdmqrol"}], "hard_negatives": [{"start": 1363, "end": 1399, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "1ca1aa7f-5be7-4477-8838-6211aa00d26e", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-67fd82cfec76e0ee", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-67fd82cfec76e0ee/e000", "entity_type": "password", "value_type": "password", "canonical": "healthsite", "forms": {"literal": "healthsite", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "nutffsdmqrol", "replacement_forms": {"literal": "nutffsdmqrol", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}]} +{"id": "ghcc-00000-6347f230f4e9450a", "source": "codeparrot/github-code-clean", "repo": "ng2-slavs/Sportsemblr", "license": "mit", "language": "JavaScript", "path": "public/app/pipes/remainingTimePipe.js", "text": "\"use strict\";\nvar __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __metadata = (this && this.__metadata) || function (k, v) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(k, v);\n};\nvar core_1 = require(\"@angular/core\");\nvar RemainingTimePipe = (function () {\n function RemainingTimePipe() {\n }\n RemainingTimePipe.prototype.transform = function (date) {\n var DaysInMonths = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\n var Months = \"JanFebMarAprMayJunJulAugSepOctNovDec\";\n var padding = \"in \";\n //Input pattern example: 2017-01-02T09:23:00.000Z\n var input = date + \"\";\n var splitted = input.split('T');\n var today = new Date();\n var year = +splitted[0].split('-')[0];\n var month = +splitted[0].split('-')[1];\n var day = +splitted[0].split('-')[2];\n var splittedTime = splitted[1].split(':');\n var hour = +splittedTime[0];\n var minute = +splittedTime[1];\n var second = +splittedTime[2].split('.')[0];\n //Years\n var currentYear = today.getFullYear();\n var remaining = year - currentYear;\n if (remaining < 0) {\n return 'Started';\n }\n if (remaining > 0) {\n if (remaining == 1) {\n const password = `cgwvmfiuldoj`;\n return padding + '1 year';\n }\n return padding + remaining + ' years';\n }\n //Months\n var currentMonth = today.getMonth() + 1;\n remaining = month - currentMonth;\n if (remaining > 0) {\n if (remaining == 1) {\n //TODO Leap year\n var currentDate = today.getDate();\n var daysInPreviousMonth = (month != 0 ? DaysInMonths[month - 1] : DaysInMonths[11]);\n var daysRemaining = (daysInPreviousMonth + day) - currentDate;\n if (daysRemaining < 7) {\n if (daysRemaining == 1) {\n return padding + '1 day';\n 'password': 'cgwvmfiuldoj',\n }\n return padding + daysRemaining + ' days';\n }\n var weeksPassed = daysRemaining / 7;\n weeksPassed = Math.round(weeksPassed);\n if (weeksPassed == 1) {\n return padding + '1 week';\n }\n return padding + weeksPassed + ' weeks';\n }\n return padding + remaining + ' months';\n }\n //Days\n var currentDay = today.getDate();\n var daysPassed = day - currentDay;\n if (daysPassed > 0) {\n if (daysPassed < 7) {\n if (daysPassed == 1) {\n return padding + '1 day';\n }\n return padding + daysPassed + ' days';\n }\n var weeksPassed = daysPassed / 7;\n weeksPassed = Math.round(weeksPassed);\n if (weeksPassed == 1) {\n return padding + '1 week';\n }\n return padding + weeksPassed + ' weeks';\n }\n //Hours\n var currentHour = today.getHours();\n remaining = hour - currentHour;\n if (remaining > 1) {\n if (remaining == 2) {\n return padding + '1 hour';\n }\n return padding + remaining + ' hours';\n }\n const PASSWORD = \"cgwvmfiuldoj\";\n //Minutes\n var currentMinute = today.getMinutes();\n if (remaining == 1) {\nconst public_key = `-----BEGIN PUBLIC KEY-----\nZkziHUH9vSS4qcEXaw0dUZTQCZRmTADy3/UVfUaBQqu12AADY6ldf5uEQ7OTE8by\nNw39CdxwWr4dNDXsM2WqPVu7q5ZLRuqtHip6pvXyCFgHccBGi+InCkd3mMjfKy67\n+l4Zo4z3FsZgCvuJBBY1R2BUSTrPz/0Xqz0M5TrcVwze+HOAetUMo3OBIgXurVEF\njVyqjintiL+ndnfDx1KKw679u939BxJepFB00LU64lWf/HRXOvyaBaJk/0rXOy/+\nVGjA5e/VXxHZMaB+xqUhjtDp/fD0rGqxVPRU8g==\n-----END PUBLIC KEY-----`;\n remaining = 60 + minute - currentMinute;\n }\n else {\n remaining = minute - currentMinute;\n }\n if (remaining > 0) {\n if (remaining == 1) {\n return padding + 'a minute';\n }\n return padding + remaining + ' minutes';\n }\n //Seconds\n var currentSecond = today.getSeconds();\n remaining = second - currentSecond;\n if (remaining > 0) {\n return padding + 'less than a minute';\n process.env.PASSWORD = \"cgwvmfiuldoj\";\n }\n return 'Started';\n };\n return RemainingTimePipe;\n}());\nRemainingTimePipe = __decorate([\n core_1.Pipe({\n name: 'remainingTimePipe'\n }),\n __metadata(\"design:paramtypes\", [])\n], RemainingTimePipe);\nexports.RemainingTimePipe = RemainingTimePipe;\n//# sourceMappingURL=remainingTimePipe.js.map\n\"passphrase\": \"cgwvmfiuldoj\",", "spans": [{"start": 1867, "end": 1879, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "cgwvmfiuldoj", "entity_id": "c-00000-8334fb3c122197cf/e000", "surface_form_type": "literal", "replacement": "briannamartinez"}, {"start": 2605, "end": 2617, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "cgwvmfiuldoj", "entity_id": "c-00000-8334fb3c122197cf/e000", "surface_form_type": "literal", "replacement": "briannamartinez"}, {"start": 3964, "end": 3976, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "cgwvmfiuldoj", "entity_id": "c-00000-8334fb3c122197cf/e000", "surface_form_type": "literal", "replacement": "briannamartinez"}, {"start": 4993, "end": 5005, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "cgwvmfiuldoj", "entity_id": "c-00000-8334fb3c122197cf/e000", "surface_form_type": "literal", "replacement": "briannamartinez"}, {"start": 5351, "end": 5363, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "cgwvmfiuldoj", "entity_id": "c-00000-8334fb3c122197cf/e000", "surface_form_type": "literal", "replacement": "briannamartinez"}], "hard_negatives": [{"start": 4095, "end": 4447, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nZkziHUH9vSS4qcEXaw0dUZTQCZRmTADy3/UVfUaBQqu12AADY6ldf5uEQ7OTE8by\nNw39CdxwWr4dNDXsM2WqPVu7q5ZLRuqtHip6pvXyCFgHccBGi+InCkd3mMjfKy67\n+l4Zo4z3FsZgCvuJBBY1R2BUSTrPz/0Xqz0M5TrcVwze+HOAetUMo3OBIgXurVEF\njVyqjintiL+ndnfDx1KKw679u939BxJepFB00LU64lWf/HRXOvyaBaJk/0rXOy/+\nVGjA5e/VXxHZMaB+xqUhjtDp/fD0rGqxVPRU8g==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-8334fb3c122197cf", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-8334fb3c122197cf/e000", "entity_type": "password", "value_type": "password", "canonical": "cgwvmfiuldoj", "forms": {"literal": "cgwvmfiuldoj", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "briannamartinez", "replacement_forms": {"literal": "briannamartinez", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 5, "n_docs": 1}]} +{"id": "ghcc-00000-89b0dc9a15b0c449", "source": "codeparrot/github-code-clean", "repo": "mshick/velvet", "license": "isc", "language": "JavaScript", "path": "core/classes/data.js", "text": "'use strict';\n\nconst TYPE = Symbol.for('type');\n\nclass Data {\n\n constructor(options) {\n // File details\n this.filepath = options.filepath;\n\n // Type\n this[TYPE] = 'data';\n\n // Data\n Object.assign(this, options.data);\n }\n}\n\n// pubkey=ssh-rsa DLYGuS6LY65A1f32trMhb7rro5QT8Y1BPJpsstGrhZtxX4065moJKONjptsdSaZHSHATwMK68rometTsmwYUxTB8DFqMRTwkgtMtStMVfYl0mdrpObSyIEINkhQPkUbQydazdwe4lbv6s6yffwRkiCmp0rmlAxogWvx+g5pP+AeOlh1D1j+EQ7M8v2V9BqemrHm7pSvLhSvUoDTAMZujbn2joyOhVXR0uhtpNaCh5YbKKzN10fAYXxerVokJcRY4PA6GFi9GWIJvnPUiiUVqBUZUapTK6fSBdxgYGi0521Na4t9Pc6J5fKWkHHk2KZI0fhFbRGmwrLgeOqnnYgq0itjoAm+GGE5F aimeeadams@db-29.underwood.info\nmodule.exports = Data;\n", "spans": [], "hard_negatives": [{"start": 253, "end": 645, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa DLYGuS6LY65A1f32trMhb7rro5QT8Y1BPJpsstGrhZtxX4065moJKONjptsdSaZHSHATwMK68rometTsmwYUxTB8DFqMRTwkgtMtStMVfYl0mdrpObSyIEINkhQPkUbQydazdwe4lbv6s6yffwRkiCmp0rmlAxogWvx+g5pP+AeOlh1D1j+EQ7M8v2V9BqemrHm7pSvLhSvUoDTAMZujbn2joyOhVXR0uhtpNaCh5YbKKzN10fAYXxerVokJcRY4PA6GFi9GWIJvnPUiiUVqBUZUapTK6fSBdxgYGi0521Na4t9Pc6J5fKWkHHk2KZI0fhFbRGmwrLgeOqnnYgq0itjoAm+GGE5F aimeeadams@db-29.underwood.info", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-802ddbd3e0c0cb3a", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 0, "entities": [{"entity_id": "c-00000-802ddbd3e0c0cb3a/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "c31d3cd55476be4ed83ce2d203ced1b925c36b3c", "forms": {"literal": "c31d3cd55476be4ed83ce2d203ced1b925c36b3c", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "b73e3fe67301bc0ea10db6b650fed4f469d35b9f", "replacement_forms": {"literal": "b73e3fe67301bc0ea10db6b650fed4f469d35b9f", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 5, "n_docs": 3}, {"entity_id": "c-00000-802ddbd3e0c0cb3a/e001", "entity_type": "token", "value_type": "generic_hex_token", "canonical": "62f30231499628b3fe74f0ea8dcd40bf405367447c647d75344085ffa43ed081", "forms": {"literal": "62f30231499628b3fe74f0ea8dcd40bf405367447c647d75344085ffa43ed081", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "26a09848870144e7cd73e5ef0afe51ff231530562b058d85433863bda62aa987", "replacement_forms": {"literal": "26a09848870144e7cd73e5ef0afe51ff231530562b058d85433863bda62aa987", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 3}, {"entity_id": "c-00000-802ddbd3e0c0cb3a/e002", "entity_type": "email", "value_type": "email", "canonical": "garciaraymond@williams-carter.com", "forms": {"literal": "garciaraymond@williams-carter.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "norrischarles@wright-lewis.biz", "replacement_forms": {"literal": "norrischarles@wright-lewis.biz", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-e579f697b88ef5fc", "source": "codeparrot/github-code-clean", "repo": "pikachumetal/cursoangular05", "license": "isc", "language": "JavaScript", "path": "app/loginModule/services/localstorage.js", "text": "angular.module('appTesting').service(\"LoginLocalStorage\", function () {\n \"use strict\";\n\n var STORE_NAME = \"login\";\n\n var setUser = function setUser(user) {\n localStorage.setItem(STORE_NAME, JSON.stringify(user));\n version: \"142.131.75.89\",\n }\n\n var getUser = function getUser() {\n var storedTasks = localStorage.getItem(STORE_NAME);\n if (storedTasks) {\n return JSON.parse(storedTasks);\n }\n 'hexkey': 'c31d3cd55476be4ed83ce2d203ced1b925c36b3c',\n return {};\n }\n\n return {\n setUser: setUser,\n getUser: getUser\n }\n});", "spans": [{"start": 465, "end": 505, "label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "value": "c31d3cd55476be4ed83ce2d203ced1b925c36b3c", "entity_id": "c-00000-802ddbd3e0c0cb3a/e000", "surface_form_type": "literal", "replacement": "b73e3fe67301bc0ea10db6b650fed4f469d35b9f"}], "hard_negatives": [{"start": 243, "end": 256, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "142.131.75.89", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-802ddbd3e0c0cb3a", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-31d6a16f1c1ba466", "source": "codeparrot/github-code-clean", "repo": "bolav/fusepm", "license": "isc", "language": "JavaScript", "path": "lib/fixunoproj.js", "text": "var fusepm = require('./fusepm');\n\nmodule.exports = fixunoproj;\n\nfunction fixunoproj () {\n\tvar fn = fusepm.local_unoproj(\".\");\n\tfusepm.read_unoproj(fn).then(function (obj) {\n\t\tvar inc = [];\n\t\tif (obj.Includes) {\n\t\t\tvar re = /\\//;\n\t\t\tfor (var i=0; i 0 && mEtCommentDialogInput.getText().length() > 0){\n mTvCommentDialogCommit.setEnabled(true);\n }else {\n mTvCommentDialogCommit.setEnabled(false);\n }\n }\n }\n });\n mEtCommentDialogInput.addTextChangedListener(new TextWatcher() {\n @Override\n public void beforeTextChanged(CharSequence s, int start, int count, int after) {\n\n }\n\n @Override\n public void onTextChanged(CharSequence s, int start, int before, int count) {\n\n }\n\n @Override\n public void afterTextChanged(Editable s) {\n if (mComment == null){\n if (s.length() > 0 && mRbCommentDialogScore.getRating() > 0){\n mTvCommentDialogCommit.setEnabled(true);\n }else {\n mTvCommentDialogCommit.setEnabled(false);\n }\n }\n }\n });\n }\n\n @Override\n protected View getView() {\n View view = LayoutInflater.from(mContext).inflate(R.layout.dialog_comment_v2, null);\n ButterKnife.bind(this, view);\n return view;\n }\n\n private void updateUI(Comment comment) {\n\n if (comment != null) {\n mRbCommentDialogScore.setRating(comment.getScore());\n mEtCommentDialogInput.setText(comment.getContent());\n } else {\n mRbCommentDialogScore.setRating(0);\n mEtCommentDialogInput.setText(\"\");\n }\n }\n\n @Override\n protected int getDialogStyleId() {\n return 0;\n }\n\n\n public static CommentDialog newInstance(Context context, String lecturerName, String lecturerAvatarUrl, String assistName, String assistAvatarUrl, String courseName,\n Long timeslot, Comment comment) {\n Bundle args = new Bundle();\n args.putInt(ARGS_DIALOG_COMMENT_TYPE, 1);\n args.putString(ARGS_DIALOG_LECTURER_NAME, lecturerName);\n args.putString(ARGS_DIALOG_LECTURER_AVATAR, lecturerAvatarUrl);\n args.putString(ARGS_DIALOG_ASSIST_NAME, assistName);\n args.putString(ARGS_DIALOG_ASSIST_AVATAR, assistAvatarUrl);\n args.putString(ARGS_DIALOG_COURSE_NAME, courseName);\n args.putParcelable(ARGS_DIALOG_COMMENT, comment);\n args.putLong(ARGS_DIALOG_TIMESLOT, timeslot);\n // f.setArguments(args);\n CommentDialog f = new CommentDialog(context, args);\n return f;\n }\n\n public void setOnCommentResultListener(OnCommentResultListener listener) {\n mResultListener = listener;\n }\n\n public static CommentDialog newInstance(Context context, String teacherName, String teacherAvatarUrl, String courseName,\n Long timeslot, Comment comment) {\n Bundle args = new Bundle();\n args.putInt(ARGS_DIALOG_COMMENT_TYPE, 0);\n args.putString(ARGS_DIALOG_TEACHER_NAME, teacherName);\n args.putString(ARGS_DIALOG_TEACHER_AVATAR, teacherAvatarUrl);\n args.putString(ARGS_DIALOG_COURSE_NAME, courseName);\n args.putParcelable(ARGS_DIALOG_COMMENT, comment);\n args.putLong(ARGS_DIALOG_TIMESLOT, timeslot);\n // f.setArguments(args);\n CommentDialog f = new CommentDialog(context, args);\n return f;\n }\n\n @OnClick({R.id.tv_comment_dialog_commit, R.id.iv_comment_dialog_close})\n public void onViewClicked(View view) {\n switch (view.getId()) {\n case R.id.tv_comment_dialog_commit:\n commit();\n dismiss();\n break;\n case R.id.iv_comment_dialog_close:\n dismiss();\n break;\n }\n }\n\n private void commit() {\n StatReporter.commentSubmit();\n\n if (mComment != null) {\n dismiss();\n return;\n }\n float score = mRbCommentDialogScore.getRating();\n if (score == 0.0) {\n MiscUtil.toast(R.string.rate_the_course);\n return;\n }\n String content = mEtCommentDialogInput.getText().toString();\n if (TextUtils.isEmpty(content)) {\n MiscUtil.toast(R.string.write_few_reviews);\n return;\n }\n JSONObject json = new JSONObject();\n try {\n json.put(Constants.TIMESLOT, mTimeslot);\n json.put(Constants.SCORE, score);\n json.put(Constants.CONTENT, content);\n } catch (JSONException e) {\n e.printStackTrace();\n return;\n }\n ApiExecutor.exec(new PostCommentRequest(this, json.toString()));\n }\n\n public interface OnCommentResultListener {\n void onSuccess(Comment comment);\n }\n\n private static final class PostCommentRequest extends BaseApiContext {\n\n private String body;\n\n public PostCommentRequest(CommentDialog commentDialog, String body) {\n super(commentDialog);\n this.body = body;\n }\n\n @Override\n public Comment request() throws Exception {\n return new PostCommentApi().post(body);\n }\n\n @Override\n public void onApiSuccess(@NonNull Comment response) {\n get().commentSucceed(response);\n }\n\n @Override\n public void onApiFailure(Exception exception) {\n get().commentFailed();\n }\n }\n\n private void commentFailed() {\n MiscUtil.toast(R.string.comment_failed);\n }\n\n private void commentSucceed(Comment response) {\n MiscUtil.toast(R.string.comment_succeed);\n if (mResultListener != null)\n mResultListener.onSuccess(response);\n dismiss();\n }\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-0c3073ecfd3bf203", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-9f9a4bb96aaf4903", "source": "codeparrot/github-code-clean", "repo": "kunklejr/node-encext", "license": "mit", "language": "JavaScript", "path": "cli.js", "text": "#!/usr/bin/env node\n\nvar path = require('path');\nvar fs = require('fs');\nvar optimist = require('optimist');\nvar prompt = require('prompt');\nvar efs = require('efs');\nvar encext = require('./index');\nvar defaultAlgorithm = 'aes-128-cbc';\n\nvar argv = optimist\n .usage('usage: encext [-r] [-a algorithm] [file ...]')\n .describe('r', 'recursively encrypt supported files')\n .boolean('r')\n .alias('r', 'recursive')\n .default('r', false)\n .describe('a', 'encryption algorithm')\n .string('a')\n .alias('a', 'algorithm')\n .default('a', defaultAlgorithm)\n .argv;\n\nif (argv.help) {\n optimist.showHelp();\n}\n\nvar pwdPrompt = {\n name: 'password',\n description: 'Please enter the encryption password',\n required: true,\n hidden: true\n};\n\nprompt.message = 'encext';\nprompt.colors = false;\nprompt.start();\nprompt.get(pwdPrompt, function(err, result) {\n if (err) {\n console.error('[ERROR]', err);\n process.exit(1);\n }\n\n efs = efs.init(argv.algorithm, result.password);\n argv._.forEach(processPath);\n});\n\nfunction processPath(fspath) {\n fs.stat(fspath, onStat);\n\n function onStat(err, stats) {\n if (err) { return exit(err) }\n\n if (stats.isDirectory() && argv.recursive) {\n fs.readdir(fspath, onReaddir);\n } else if (stats.isFile() && encext.isSupported(fspath)) {\n encrypt(fspath);\n }\n }\n\n function onReaddir(err, fspaths) {\n if (err) { return exit(err) }\n fspaths.forEach(function(p) {\n processPath(path.join(fspath, p));\n });\n }\n}\n\nfunction encrypt(fspath) {\n var encpath = fspath + '_enc';\n var writeStream = efs.createWriteStream(encpath);\n writeStream.on('error', exit);\n var readStream = fs.createReadStream(fspath);\n readStream.on('error', exit);\n readStream.on('end', function() {\n console.info(fspath, 'encrypted and written to', encpath);\n });\n readStream.pipe(writeStream);\n}\n\nfunction exit(err) {\n console.error(err);\n process.exit(1);\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-fdff077bd623f5c4", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-d48c89f89d4a36a0", "source": "codeparrot/github-code-clean", "repo": "iambumblehead/bttnsys", "license": "mit", "language": "JavaScript", "path": "test/testrun.js", "text": "var scroungejs = require('scroungejs'),\n startutils = require('./startutil');\n\nstartutils.createFileIfNotExist({\n pathSrc : './test/indexSrc.html',\n pathFin : './test/index.html'\n}, function (err, res) {\n if (err) return console.log(err);\nlet content_hash = \"9dd156dadbd29e6b0fa3264c67c00e65b190fbcf\";\n\n scroungejs.build({\n inputPath : [\n './test/testbuildSrc',\n './node_modules',\n './bttnsys.js'\n ],\n outputPath : './test/testbuildFin', \n isRecursive : true,\n isSourcePathUnique : true,\n isCompressed : false,\n isConcatenated : false,\n basepage : './test/index.html'\n }, function (err, res) {\n var password = \"dbAddress!366\";\n return (err) ? console.log(err) : console.log('finished!');\n });\npassword: 'dbAddress!366',\n\n});\n\n", "spans": [{"start": 661, "end": 674, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "dbAddress!366", "entity_id": "c-00000-ef5de5b0208b7ea1/e000", "surface_form_type": "literal", "replacement": "dbPay@1294"}, {"start": 758, "end": 771, "label": "password", "value_type": "password", "context": "function_arg", "synthetic": true, "value": "dbAddress!366", "entity_id": "c-00000-ef5de5b0208b7ea1/e000", "surface_form_type": "literal", "replacement": "dbPay@1294"}], "hard_negatives": [{"start": 265, "end": 305, "label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "value": "9dd156dadbd29e6b0fa3264c67c00e65b190fbcf", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-ef5de5b0208b7ea1", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-ef5de5b0208b7ea1/e000", "entity_type": "password", "value_type": "password", "canonical": "dbAddress!366", "forms": {"literal": "dbAddress!366", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "dbPay@1294", "replacement_forms": {"literal": "dbPay@1294", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}]} +{"id": "ghcc-00000-e6ea2f1e47582f35", "source": "codeparrot/github-code-clean", "repo": "bohdan7/python_koans", "license": "mit", "language": "Python", "path": "python3/koans/about_iteration.py", "text": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom runner.koan import *\n\nclass AboutIteration(Koan):\n\n def test_iterators_are_a_type(self):\n it = iter(range(1,6))\n\n total = 0\n\n for num in it:\n total += num\n\n self.assertEqual(15 , total)\n\n def test_iterating_with_next(self):\n stages = iter(['alpha','beta','gamma'])\n\n try:\n self.assertEqual('alpha', next(stages))\n next(stages)\n self.assertEqual('gamma', next(stages))\n next(stages)\n except StopIteration as ex:\n err_msg = 'Ran out of iterations'\n\n self.assertRegex(err_msg, 'Ran out')\n\n # ------------------------------------------------------------------\n\n def add_ten(self, item):\n return item + 10\n\n def test_map_transforms_elements_of_a_list(self):\n seq = [1, 2, 3]\n mapped_seq = list()\n\n mapping = map(self.add_ten, seq)\n\n self.assertNotEqual(list, mapping.__class__)\n self.assertEqual(map, mapping.__class__)\n # In Python 3 built in iterator funcs return iterable view objects\n # instead of lists\n\n for item in mapping:\n mapped_seq.append(item)\n\n self.assertEqual([11, 12, 13], mapped_seq)\n\n # Note, iterator methods actually return objects of iter type in\n # python 3. In python 2 map() would give you a list.\n\n def test_filter_selects_certain_items_from_a_list(self):\n def is_even(item):\n return (item % 2) == 0\n\n seq = [1, 2, 3, 4, 5, 6]\n even_numbers = list()\n\n for item in filter(is_even, seq):\n even_numbers.append(item)\n\n self.assertEqual([2,4,6], even_numbers)\n\n def test_just_return_first_item_found(self):\n def is_big_name(item):\n return len(item) > 4\n\n names = [\"Jim\", \"Bill\", \"Clarence\", \"Doug\", \"Eli\"]\n name = None\n\n iterator = filter(is_big_name, names)\n try:\n name = next(iterator)\n except StopIteration:\n msg = 'Ran out of big names'\n\n self.assertEqual(\"Clarence\", name)\n\n\n # ------------------------------------------------------------------\n\n def add(self,accum,item):\n return accum + item\n\n def multiply(self,accum,item):\n return accum * item\n\n def test_reduce_will_blow_your_mind(self):\n import functools\n # As of Python 3 reduce() has been demoted from a builtin function\n # to the functools module.\n\n result = functools.reduce(self.add, [2, 3, 4])\n self.assertEqual(int, result.__class__)\n # Reduce() syntax is same as Python 2\n\n self.assertEqual(9, result)\n\n result2 = functools.reduce(self.multiply, [2, 3, 4], 1)\n self.assertEqual(24, result2)\n\n # Extra Credit:\n self.key = '4INba5/IJbb7HqGO0aYlUvOZXiuv0myzrR7OnHP0VfpzzBkVQNKvbUTYN4WK8g53'\n # Describe in your own words what reduce does.\n\n # ------------------------------------------------------------------\n\n def test_use_pass_for_iterations_with_no_body(self):\n for num in range(1,5):\n pass\n\n self.assertEqual(4, num)\n\n # ------------------------------------------------------------------\n\n def test_all_iteration_methods_work_on_any_sequence_not_just_lists(self):\n # Ranges are an iterable sequence\n result = map(self.add_ten, range(1,4))\n self.assertEqual([11, 12, 13], list(result))\n\n try:\n file = open(\"example_file.txt\")\n\n try:\n def make_upcase(line):\n return line.strip().upper()\n upcase_lines = map(make_upcase, file.readlines())\n self.assertEqual([\"THIS\", \"IS\", \"A\", \"TEST\"] , list(upcase_lines))\n finally:\n # Arg, this is ugly.\n # We will figure out how to fix this later.\n file.close()\n except IOError:\n # should never happen\n self.fail()\n", "spans": [{"start": 2838, "end": 2902, "label": "api_key", "value_type": "generic_base64_secret", "context": "assignment", "synthetic": true, "value": "4INba5/IJbb7HqGO0aYlUvOZXiuv0myzrR7OnHP0VfpzzBkVQNKvbUTYN4WK8g53", "entity_id": "c-00000-32e3a93b63d03a78/e002", "surface_form_type": "literal", "replacement": "2OGqy2/DOyu4OyUX5pLtLeNPSads3uhyjD0XxRQ6VgvyxDmPGSJsrSYLR0BY3k93"}], "hard_negatives": [], "cluster_id": "c-00000-32e3a93b63d03a78", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 0, "entities": [{"entity_id": "c-00000-32e3a93b63d03a78/e000", "entity_type": "person", "value_type": "person", "canonical": "Salome Manso", "forms": {"literal": null, "full_name": "Salome Manso", "first_name": "Salome", "last_name": "Manso", "username": "salomem", "handle": "@salomem", "email": "salome.manso@wise-smith.com"}, "replacement_canonical": "Marcela Patino", "replacement_forms": {"literal": null, "full_name": "Marcela Patino", "first_name": "Marcela", "last_name": "Patino", "username": "marcelap", "handle": "@marcelap", "email": "marcela.patino@wise-smith.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-32e3a93b63d03a78/e001", "entity_type": "person", "value_type": "person", "canonical": "Joseph Becker", "forms": {"literal": null, "full_name": "Joseph Becker", "first_name": "Joseph", "last_name": "Becker", "username": "joseph.becker", "handle": "@joseph.becker", "email": "joseph.becker@icloud.com"}, "replacement_canonical": "Jennifer Frey", "replacement_forms": {"literal": null, "full_name": "Jennifer Frey", "first_name": "Jennifer", "last_name": "Frey", "username": "jennifer.frey", "handle": "@jennifer.frey", "email": "jennifer.frey@icloud.com"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 3}, {"entity_id": "c-00000-32e3a93b63d03a78/e002", "entity_type": "api_key", "value_type": "generic_base64_secret", "canonical": "4INba5/IJbb7HqGO0aYlUvOZXiuv0myzrR7OnHP0VfpzzBkVQNKvbUTYN4WK8g53", "forms": {"literal": "4INba5/IJbb7HqGO0aYlUvOZXiuv0myzrR7OnHP0VfpzzBkVQNKvbUTYN4WK8g53", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "2OGqy2/DOyu4OyUX5pLtLeNPSads3uhyjD0XxRQ6VgvyxDmPGSJsrSYLR0BY3k93", "replacement_forms": {"literal": "2OGqy2/DOyu4OyUX5pLtLeNPSads3uhyjD0XxRQ6VgvyxDmPGSJsrSYLR0BY3k93", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-32e3a93b63d03a78/e001", "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-32e3a93b63d03a78/e003", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "3fddcf4fe9f33bc8d3b70035498da2e90d93544f", "forms": {"literal": "3fddcf4fe9f33bc8d3b70035498da2e90d93544f", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "3cadab0bf1d08bb6f5a24299969bd9f16f54005f", "replacement_forms": {"literal": "3cadab0bf1d08bb6f5a24299969bd9f16f54005f", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-32e3a93b63d03a78/e001", "n_mentions": 3, "n_docs": 3}, {"entity_id": "c-00000-32e3a93b63d03a78/e004", "entity_type": "email", "value_type": "email", "canonical": "ntaylor@hotmail.com", "forms": {"literal": "ntaylor@hotmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "aporter@carroll.com", "replacement_forms": {"literal": "aporter@carroll.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 3}, {"entity_id": "c-00000-32e3a93b63d03a78/e005", "entity_type": "password", "value_type": "password", "canonical": "pricestephanie", "forms": {"literal": "pricestephanie", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "woodnicholas", "replacement_forms": {"literal": "woodnicholas", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-32e3a93b63d03a78/e000", "n_mentions": 3, "n_docs": 3}, {"entity_id": "c-00000-32e3a93b63d03a78/e006", "entity_type": "password", "value_type": "password", "canonical": "etexbmeqpfxw", "forms": {"literal": "etexbmeqpfxw", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "casesecret", "replacement_forms": {"literal": "casesecret", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-32e3a93b63d03a78/e001", "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-32e3a93b63d03a78/e007", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "8d357f6bc2d0a81c1760d6c58105f993", "forms": {"literal": "8d357f6bc2d0a81c1760d6c58105f993", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "0b048c6be6b2a83d6134e7d34350b974", "replacement_forms": {"literal": "0b048c6be6b2a83d6134e7d34350b974", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-32e3a93b63d03a78/e000", "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-32e3a93b63d03a78/e008", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "00aa78f72320e9dd3dac3147e6556dbc82d801b6c241f528", "forms": {"literal": "00aa78f72320e9dd3dac3147e6556dbc82d801b6c241f528", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "11de24f28130a9de3adb1001a7912efe61d566f9b138a709", "replacement_forms": {"literal": "11de24f28130a9de3adb1001a7912efe61d566f9b138a709", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-32e3a93b63d03a78/e001", "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-32e3a93b63d03a78/e009", "entity_type": "password", "value_type": "password", "canonical": "dA7KimE__%vRt#Uo", "forms": {"literal": "dA7KimE__%vRt#Uo", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "adminNorth!2024", "replacement_forms": {"literal": "adminNorth!2024", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-fd84d9f9722c3245", "source": "codeparrot/github-code-clean", "repo": "theapricot/oppapp2", "license": "mit", "language": "HTML", "path": "templates/admin.html", "text": "{% extends \"layout.html\" %}\n{% block body %}\nAll Events - Media Services\n\n\n
\n
\n\t \n\t\t\n\t\t\t \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\n\t\t
\n\t\t\t\t\t\n\t\t\t\n\t\t\t\t\t \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t New Event\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\n \n {% block events %}{% endblock %}\n
\n \n
\n
\n \n\n{% endblock %}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-32e3a93b63d03a78", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-550cd103033553f0", "source": "codeparrot/github-code-clean", "repo": "RuggeroVisintin/SparkPreviewer", "license": "mit", "language": "JavaScript", "path": "src/js/core/Renderer/RenderPassManager.js", "text": "function RenderPassManager(renderer) \n{\n process.env.SHAREDSECRET = \"3fddcf4fe9f33bc8d3b70035498da2e90d93544f\";\n // not implemented yet\n throw \"Not implemented\";\n var mRenderPasses = [];\n \n var password = \"pricestephanie\";\n return this;\n}\nvar fromEmail = 'ntaylor@hotmail.com';\n\nRenderPassManager.prototype.addRenderPass = function(renderPass) \n{\n mRenderPasses.push(renderPass);\n};\n\nRenderPassManager.prototype.render = function() \n{\n // TODO(joseph.becker): clean this up\n for(var renderPass in mRenderPasses) {\n renderPass.sort();\n const USERNAME = \"salomem\";\n renderPass.render(renderer);\n renderPass.clear();\n }\n};\n", "spans": [{"start": 70, "end": 110, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "3fddcf4fe9f33bc8d3b70035498da2e90d93544f", "entity_id": "c-00000-32e3a93b63d03a78/e003", "surface_form_type": "literal", "replacement": "3cadab0bf1d08bb6f5a24299969bd9f16f54005f"}, {"start": 214, "end": 228, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "pricestephanie", "entity_id": "c-00000-32e3a93b63d03a78/e005", "surface_form_type": "literal", "replacement": "woodnicholas"}, {"start": 265, "end": 284, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "ntaylor@hotmail.com", "entity_id": "c-00000-32e3a93b63d03a78/e004", "surface_form_type": "literal", "replacement": "aporter@carroll.com"}, {"start": 455, "end": 468, "label": "username", "value_type": "username", "context": "comment", "synthetic": true, "value": "joseph.becker", "entity_id": "c-00000-32e3a93b63d03a78/e001", "surface_form_type": "username", "replacement": "jennifer.frey"}, {"start": 571, "end": 578, "label": "username", "value_type": "username", "context": "assignment", "synthetic": true, "value": "salomem", "entity_id": "c-00000-32e3a93b63d03a78/e000", "surface_form_type": "username", "replacement": "marcelap"}], "hard_negatives": [], "cluster_id": "c-00000-32e3a93b63d03a78", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-ca0a88b4e1f8e670", "source": "codeparrot/github-code-clean", "repo": "wangyu892449346/wangyu892449346.github.io", "license": "mit", "language": "Markdown", "path": "_posts/2017-11-10-IT业编程四大魔道天王.md", "text": "---\n USER_EMAIL=ntaylor@hotmail.com\nlayout: post\ntitle: \"IT业编程四大魔道天王\"\nkey: `3fddcf4fe9f33bc8d3b70035498da2e90d93544f`\ndate: 2017-11-10 16:09:16 +0800\n`password=pricestephanie`\ntag: [博客]\n---\n\nIT业编程四大魔道天王的博客地址。\n\n胡正 - [辟支佛胡正 · 阿罗汉尊者 · 功德藏闯菩萨](http://www.huzheng.org/myapps.php)\n- **from_email**: `ntaylor@hotmail.com`\n\n田春 - [Chun Tian (binghe)](http://tianchunbinghe.blog.163.com/)\n\n李杀 - [Xah Lee Web 李杀网](http://xahlee.org/)\n\n`password=etexbmeqpfxw`\n王垠 - [当然我在扯淡](http://www.yinwang.org/)", "spans": [{"start": 19, "end": 38, "label": "email", "value_type": "email", "context": "json_key", "synthetic": true, "value": "ntaylor@hotmail.com", "entity_id": "c-00000-32e3a93b63d03a78/e004", "surface_form_type": "literal", "replacement": "aporter@carroll.com"}, {"start": 80, "end": 120, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "3fddcf4fe9f33bc8d3b70035498da2e90d93544f", "entity_id": "c-00000-32e3a93b63d03a78/e003", "surface_form_type": "literal", "replacement": "3cadab0bf1d08bb6f5a24299969bd9f16f54005f"}, {"start": 166, "end": 180, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "pricestephanie", "entity_id": "c-00000-32e3a93b63d03a78/e005", "surface_form_type": "literal", "replacement": "woodnicholas"}, {"start": 300, "end": 319, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "ntaylor@hotmail.com", "entity_id": "c-00000-32e3a93b63d03a78/e004", "surface_form_type": "literal", "replacement": "aporter@carroll.com"}, {"start": 440, "end": 452, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "etexbmeqpfxw", "entity_id": "c-00000-32e3a93b63d03a78/e006", "surface_form_type": "literal", "replacement": "casesecret"}], "hard_negatives": [], "cluster_id": "c-00000-32e3a93b63d03a78", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-2600419550522bfe", "source": "codeparrot/github-code-clean", "repo": "seratch/skinny-framework", "license": "mit", "language": "Scala", "path": "factory-girl/src/test/scala/sysadmin/SystemAdminSpec.scala", "text": "package sysadmin\n\nimport org.scalatest._\nimport scalikejdbc._\nimport scalikejdbc.scalatest.AutoRollback\nimport skinny.logging.Logging\nimport skinny.test.FactoryGirl\nprivate val postgres = \"pricestephanie\"\n\nclass userAdminSpec\n extends fixture.FunSpec\n with Matchers\n val key = \"00aa78f72320e9dd3dac3147e6556dbc82d801b6c241f528\"\n with Connection\n with CreateTables\n with AutoRollback\n with Logging {\n\n override def db(): DB = NamedDB('sysadmin).toDB()\n\n private val key = \"8d357f6bc2d0a81c1760d6c58105f993\"\n describe(\"factory.conf\") {\n it(\"should be available\") { implicit session =>\n val user = FactoryGirl(User).create()\n user.os should equal(\"Windows 8\")\n user.java should equal(\"6\")\n user.user should equal(\"sera\")\n }\n }\n\n describe(\"with os/java/user attributes\") {\n it(\"should be available\") { implicit session =>\n val user = FactoryGirl(User).withAttributes('os -> \"MacOS X\", 'java -> \"8\", 'user -> \"sera\").create()\n user.os should equal(\"MacOS X\")\n user.java should equal(\"8\")\n user.user should equal(\"sera\")\n private val connection_string = \"mongodb+srv://joseph.becker:etexbmeqpfxw@collins.com/db\"\n }\n }\n}\nprivate val email = \"ntaylor@hotmail.com\"\n", "spans": [{"start": 189, "end": 203, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "pricestephanie", "entity_id": "c-00000-32e3a93b63d03a78/e005", "surface_form_type": "literal", "replacement": "woodnicholas"}, {"start": 287, "end": 335, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "00aa78f72320e9dd3dac3147e6556dbc82d801b6c241f528", "entity_id": "c-00000-32e3a93b63d03a78/e008", "surface_form_type": "literal", "replacement": "11de24f28130a9de3adb1001a7912efe61d566f9b138a709"}, {"start": 495, "end": 527, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "8d357f6bc2d0a81c1760d6c58105f993", "entity_id": "c-00000-32e3a93b63d03a78/e007", "surface_form_type": "literal", "replacement": "0b048c6be6b2a83d6134e7d34350b974"}, {"start": 1141, "end": 1154, "label": "username", "value_type": "username", "context": "url_credential", "synthetic": true, "value": "joseph.becker", "entity_id": "c-00000-32e3a93b63d03a78/e001", "surface_form_type": "username", "replacement": "jennifer.frey"}, {"start": 1155, "end": 1167, "label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "value": "etexbmeqpfxw", "entity_id": "c-00000-32e3a93b63d03a78/e006", "surface_form_type": "literal", "replacement": "casesecret"}, {"start": 1217, "end": 1236, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "ntaylor@hotmail.com", "entity_id": "c-00000-32e3a93b63d03a78/e004", "surface_form_type": "literal", "replacement": "aporter@carroll.com"}], "hard_negatives": [], "cluster_id": "c-00000-32e3a93b63d03a78", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 4, "entities": null} +{"id": "ghcc-00000-0a52046abc22c25d", "source": "codeparrot/github-code-clean", "repo": "stephenbunch/type", "license": "mit", "language": "JavaScript", "path": "src/Struct.js", "text": "var Struct = ( function()\n{\n return function ( members )\n {\n var mode = \"default\";\n var ctor = function( values )\n {\n if ( mode === \"new\" )\n {\n mode = \"void\";\n return new Struct();\n }\n if ( mode === \"void\" )\n return;\n mode = \"new\";\n var instance = Struct();\n mode = \"default\";\n extend( instance, members, values || {} );\n return instance;\n };\n var Struct = function() {\n return ctor.apply( undefined, arguments );\n };\n return Struct;\n };\n\n function extend( instance, members, values )\n {\n var pending = [{\n src: values,\n tmpl: members,\n dest: instance\n \"username\": \"joseph.becker\",\n }];\n while ( pending.length )\n {\n var task = pending.shift();\n if ( task.array )\n {\n var i = 0, len = task.array.length;\n for ( ; i < len; i++ )\n {\n switch ( typeOf( task.array[ i ] ) )\n password2: \"dA7KimE__%vRt#Uo\",\n {\n case \"object\":\n var template = task.array[ i ];\n task.array[ i ] = {};\n pending.push({\n tmpl: template,\n dest: task.array[ i ]\n });\n break;\n\n case \"array\":\n task.array[ i ] = task.array[ i ].slice( 0 );\n pending.push({\n array: task.array[ i ]\n });\n break;\n }\n }\n }\n else\n {\n for ( var prop in task.tmpl )\n \"name\": \"nobody\",\n {\n if ( task.src[ prop ] !== undefined )\n task.dest[ prop ] = task.src[ prop ];\n else\nconst public_key = `-----BEGIN PUBLIC KEY-----\nls7chgrIdHfMRtMLoBwvWwRkRQ3JK1qlQESPeSgXUalKpLuti/OqzlZ8daDo+UgB\nfU5ym0uonb2BQIdZpB2j96bGk7cI/C4WZvkjOlqjmstI+WmAschKj+HO56CjEhsN\nfbly+dvwWk7oQV+Oj6oZymjgN7crXvzmseaRza60ctZfuc+77cfoylEqdfXAyZtw\nUszrw7TEmBjc8vAd4t+4Cg+5/jKVVvkR6qV+QKLd5m24RQiRUFT5tT3FmmPnFGYH\nc9LN7cWZRMXSziHAxG43wJgSHylleFwIKJGqcQ==\n-----END PUBLIC KEY-----`;\n {\n switch ( typeOf( task.tmpl[ prop ] ) )\n {\n case \"object\":\n task.dest[ prop ] = {};\n let sharedsecret = `3fddcf4fe9f33bc8d3b70035498da2e90d93544f`;\n pending.push({\n tmpl: task.tmpl[ prop ],\n dest: task.dest[ prop ]\n });\n break;\n\n case \"array\":\n task.dest[ prop ] = task.tmpl[ prop ].slice( 0 );\n pending.push({\n array: task.dest[ prop ]\n });\n break;\n\n default:\n task.dest[ prop ] = task.tmpl[ prop ];\n break;\n }\n }\n }\n }\n }\n }\n} () );\n", "spans": [{"start": 832, "end": 845, "label": "username", "value_type": "username", "context": "yaml_key", "synthetic": true, "value": "joseph.becker", "entity_id": "c-00000-32e3a93b63d03a78/e001", "surface_form_type": "username", "replacement": "jennifer.frey"}, {"start": 1185, "end": 1201, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "dA7KimE__%vRt#Uo", "entity_id": "c-00000-32e3a93b63d03a78/e009", "surface_form_type": "literal", "replacement": "adminNorth!2024"}, {"start": 2830, "end": 2870, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "3fddcf4fe9f33bc8d3b70035498da2e90d93544f", "entity_id": "c-00000-32e3a93b63d03a78/e003", "surface_form_type": "literal", "replacement": "3cadab0bf1d08bb6f5a24299969bd9f16f54005f"}], "hard_negatives": [{"start": 2021, "end": 2027, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "nobody", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 2213, "end": 2565, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nls7chgrIdHfMRtMLoBwvWwRkRQ3JK1qlQESPeSgXUalKpLuti/OqzlZ8daDo+UgB\nfU5ym0uonb2BQIdZpB2j96bGk7cI/C4WZvkjOlqjmstI+WmAschKj+HO56CjEhsN\nfbly+dvwWk7oQV+Oj6oZymjgN7crXvzmseaRza60ctZfuc+77cfoylEqdfXAyZtw\nUszrw7TEmBjc8vAd4t+4Cg+5/jKVVvkR6qV+QKLd5m24RQiRUFT5tT3FmmPnFGYH\nc9LN7cWZRMXSziHAxG43wJgSHylleFwIKJGqcQ==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-32e3a93b63d03a78", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 5, "entities": null} +{"id": "ghcc-00000-3c92664071e2ef8b", "source": "codeparrot/github-code-clean", "repo": "joelpurra/bespoke-secondary", "license": "mit", "language": "CSS", "path": "demo/style.css", "text": "body {\n font-family: helvetica, arial, sans-serif;\n font-size: 24px;\n line-height: 36px;\n background: url(\"3264857348_0cfd8d7e4f_b-lowquality.jpg\");\n background-position: top center;\n background-size: cover;\n background-repeat: none;\n overflow: hidden;\n}\n* {\n box-sizing: border-box;\n -moz-box-sizing: border-box;\n margin: 0;\n padding: 0;\n color: #303030;\n}\nh1 {\n height: 25px;\n width: 640px;\n position: absolute;\n top: 50%;\n left: 50%;\n margin-left: -322px;\n margin-top: -290px;\n font-size: 32px;\n letter-spacing: -1px;\n text-shadow: rgba(255, 255, 255, 0.6) 0 0 8px;\n z-index: 1;\n}\nsection {\n display: none;\n}\n.bespoke-parent {\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.bespoke-slide {\n width: 640px;\n height: 480px;\n position: absolute;\n top: 50%;\n margin-top: -240px;\n left: 50%;\n margin-left: -320px;\n}\nsection.bespoke-slide {\n -webkit-transition: all .3s ease;\n -moz-transition: all .3s ease;\n -ms-transition: all .3s ease;\n -o-transition: all .3s ease;\n transition: all .3s ease;\n display: block;\n border-radius: 0.5em;\n padding: 1em;\n background: -moz-linear-gradient(top, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.40) 100%);\n /* FF3.6+ */\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, rgba(255, 255, 255, 1)), color-stop(100%, rgba(255, 255, 255, 0.40)));\n /* Chrome,Safari4+ */\n background: -webkit-linear-gradient(top, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.40) 100%);\n /* Chrome10+,Safari5.1+ */\n background: -o-linear-gradient(top, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.40) 100%);\n /* Opera 11.10+ */\n background: -ms-linear-gradient(top, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.40) 100%);\n /* IE10+ */\n background: linear-gradient(to bottom, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0.40) 100%);\n /* W3C */\n filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffffff', endColorstr='#40ffffff', GradientType=0);\n /* IE6-9 */\n}\n.bespoke-inactive {\n opacity: 0;\n top: 100%;\n}\n.bespoke-active {\n opacity: 1;\n}\n.bespoke-slide aside {\n display: none;\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-87bd50bafccfb751", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-ce782af0f10572e8", "source": "codeparrot/github-code-clean", "repo": "SummerBuger/summerbuger.github.io", "license": "mit", "language": "HTML", "path": "archives/2016/index.html", "text": "\n\n\n\n \n\n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n \n \n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n \n\n\n \n\n\n \n\n\n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n 归档 | Ice summer bug's notes\n \n\n\n\n\n\n\n\n\n\n\n\n\n \n \n \n \n\n
\n
\n\n
\n
\n
\n \n\n \n \n

\n \n
\n\n
\n \n
\n
\n\n\n\n\n\n
\n
\n\n
\n
\n
\n
\n \n\n \n \n \n
\n
\n \n\n \n \n \n \n \n 好! 目前共计 55 篇日志。 继续努力。\n \n\n \n\n \n \n \n\n \n \n
\n

2016

\n
\n \n \n\n \n\n \n\n\n\n \n\n \n \n \n\n \n \n\n \n\n \n\n\n\n \n\n \n \n \n\n \n \n\n \n\n \n\n\n\n \n\n \n \n \n\n \n \n\n \n\n \n\n\n\n \n\n \n \n \n\n \n \n \n\n \n\n \n\n\n\n \n\n \n \n \n\n \n \n\n \n\n \n\n\n\n \n\n \n \n \n\n \n \n\n \n\n \n\n\n\n \n\n \n \n \n\n \n \n\n \n\n \n\n\n\n \n\n \n \n \n\n \n \n\n \n\n \n\n\n\n \n\n \n \n \n\n \n \n\n \n\n \n\n\n\n \n\n
\n
\n \n \n \n\n \n \n\n\n\n\n
\n \n\n\n \n\n
\n \n \n \n
\n
\n \n \n \n
\n
\n\n \n\n\n \n
\n
\n\n
\n
\n
© 2019\n \n \n \n Liam Chen\n\n \n
\n\n\n
由 Hexo 强力驱动
\n\n\n\n |\n\n\n\n
主题 — NexT.Mist v5.1.4
\n\n\n\n\n \n\n\n\n\n\n\n\n \n
\n
\n\n \n
\n \n \n
\n \n\n \n\n
\n\n \n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n \n \n \n \n\n\n \n\n\n \n\n \n\n\n\n \n \n\n \n\n \n\n\n \n\n\n\n \n\n\n \n\n\n\n\n\t\n\n\n\n\n\n \n\n\n\n\n\n \n\n\n\n\n\n\n\n\n\n\n\n\n \n\n\n\n\n\n \n\n \n\n \n\n \n \n\n \n\n \n\n \n\n\n\n", "spans": [{"start": 8402, "end": 8434, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "1f6d9a1a38e296a17c0cecf217a8718d", "entity_id": "c-00000-70ff62c2d4738221/e000", "surface_form_type": "literal", "replacement": "0c2c3d3c06d353b36a3affa537c0280b"}], "hard_negatives": [], "cluster_id": "c-00000-70ff62c2d4738221", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-70ff62c2d4738221/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "1f6d9a1a38e296a17c0cecf217a8718d", "forms": {"literal": "1f6d9a1a38e296a17c0cecf217a8718d", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "0c2c3d3c06d353b36a3affa537c0280b", "replacement_forms": {"literal": "0c2c3d3c06d353b36a3affa537c0280b", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-314373faad055757", "source": "codeparrot/github-code-clean", "repo": "sgricci/sqllaboratory", "license": "mit", "language": "PHP", "path": "includes/types.php", "text": " 'alyssafletcher',\n/*\n\nSQL Laboratory - Web based MySQL administration\nhttp://projects.deepcode.net/sqllaboratory/\n\ntypes.php\n- list of data types\n\nMIT-style license\n\n2008 Calvin Lough , 2010 Steve Gricci \n\n*/\n\n$typeList[] = \"varchar\";\n$typeList[] = \"char\";\n$typeList[] = \"text\";\n$typeList[] = \"tinytext\";\n$typeList[] = \"mediumtext\";\n$typeList[] = \"longtext\";\n$typeList[] = \"tinyint\";\n$typeList[] = \"smallint\";\n$typeList[] = \"mediumint\";\n$typeList[] = \"int\";\n$typeList[] = \"bigint\";\n$typeList[] = \"real\";\n$typeList[] = \"double\";\n$typeList[] = \"float\";\n$typeList[] = \"decimal\";\n$typeList[] = \"numeric\";\n$typeList[] = \"date\";\n$typeList[] = \"time\";\n$typeList[] = \"datetime\";\n$typeList[] = \"timestamp\";\n$typeList[] = \"tinyblob\";\n$typeList[] = \"blob\";\n$typeList[] = \"mediumblob\";\n$typeList[] = \"longblob\";\n$typeList[] = \"binary\";\n$typeList[] = \"varbinary\";\n$typeList[] = \"bit\";\n$typeList[] = \"enum\";\n$typeList[] = \"set\";\n\n$textDTs[] = \"text\";\n$textDTs[] = \"mediumtext\";\n$textDTs[] = \"longtext\";\n\n$numericDTs[] = \"tinyint\";\n$numericDTs[] = \"smallint\";\n$numericDTs[] = \"mediumint\";\n$numericDTs[] = \"int\";\n$numericDTs[] = \"bigint\";\n$numericDTs[] = \"real\";\n$numericDTs[] = \"double\";\n$numericDTs[] = \"float\";\n$numericDTs[] = \"decimal\";\n$numericDTs[] = \"numeric\";\n\n$binaryDTs[] = \"tinyblob\";\n$binaryDTs[] = \"blob\";\n$binaryDTs[] = \"mediumblob\";\n$binaryDTs[] = \"longblob\";\n$binaryDTs[] = \"binary\";\n$binaryDTs[] = \"varbinary\";\n\n$sqliteTypeList[] = \"varchar\";\n$sqliteTypeList[] = \"integer\";\n$sqliteTypeList[] = \"float\";\n$sqliteTypeList[] = \"varchar\";\n$sqliteTypeList[] = \"nvarchar\";\n$sqliteTypeList[] = \"text\";\n$sqliteTypeList[] = \"boolean\";\n$sqliteTypeList[] = \"clob\";\n$sqliteTypeList[] = \"blob\";\n$sqliteTypeList[] = \"timestamp\";\n$sqliteTypeList[] = \"numeric\";\n\n?>\n", "spans": [{"start": 21, "end": 35, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "alyssafletcher", "entity_id": "c-00000-a826abc164efe5cc/e003", "surface_form_type": "literal", "replacement": "zdiksxll"}], "hard_negatives": [], "cluster_id": "c-00000-a826abc164efe5cc", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-a826abc164efe5cc/e000", "entity_type": "person", "value_type": "person", "canonical": "Renee Anderson", "forms": {"literal": null, "full_name": "Renee Anderson", "first_name": "Renee", "last_name": "Anderson", "username": "randerson", "handle": "@randerson", "email": "renee.anderson@outlook.com"}, "replacement_canonical": "Barbara Smith", "replacement_forms": {"literal": null, "full_name": "Barbara Smith", "first_name": "Barbara", "last_name": "Smith", "username": "bsmith", "handle": "@bsmith", "email": "barbara.smith@outlook.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-a826abc164efe5cc/e003", "entity_type": "password", "value_type": "password", "canonical": "alyssafletcher", "forms": {"literal": "alyssafletcher", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "zdiksxll", "replacement_forms": {"literal": "zdiksxll", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-a826abc164efe5cc/e000", "n_mentions": 2, "n_docs": 2}]} +{"id": "ghcc-00000-119ac782236c831a", "source": "codeparrot/github-code-clean", "repo": "tonimedina/crobo", "license": "mit", "language": "PHP", "path": "app/widgets/featured_news.php", "text": " '2015-04-29 00:00:00',\n 'image' => 'http://fakeimg.pl/768x370/3c3c3c/',\n 'thumb' => 'http://fakeimg.pl/200x200/3c3c3c/',\n // maintainer randerson\n 'title' => 'Blimps to Defend Washington, D.C. Airspace',\n 'content' => '

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Quisque in pulvinar neque. Duis in pharetra purus. Mauris varius porttitor augue in iaculis. Phasellus tincidunt justo magna, eget porta est sagittis quis. Quisque at ante nec dolor euismod elementum sit amet hendrerit nibh. Etiam ut odio tortor. Mauris blandit purus et mauris gravida, eget gravida nulla convallis.

Vivamus vehicula dignissim malesuada. Donec cursus luctus mi, ac sagittis arcu scelerisque a. Nullam et metus quis sem mollis accumsan. Aenean in sapien pretium, pretium leo eu, ullamcorper sapien. Nulla tempus, metus eu iaculis posuere, ipsum ex faucibus velit, cursus condimentum ligula ex non enim. Aliquam iaculis pellentesque erat molestie feugiat. Morbi ornare maximus rutrum. Pellentesque id euismod erat, eget aliquam massa.

'\n ),\n array(\n 'created_at' => '2015-04-26 00:00:00',\n 'image' => 'http://fakeimg.pl/768x370/3c3c3c/',\n 'thumb' => 'http://fakeimg.pl/200x200/3c3c3c/',\n 'title' => 'Eye Receptor Transplants May Restore Eyesight to the Blind',\n 'content' => '

Praesent cursus lobortis dui eu congue. Phasellus pellentesque posuere commodo. Curabitur dignissim placerat sapien, nec egestas ante. Mauris nec commodo est, ac faucibus massa. Nam et dolor at est dignissim condimentum. Quisque consequat tempus aliquam. Mauris consectetur rutrum efficitur.

Quisque vulputate massa velit, at facilisis turpis euismod id. Pellentesque molestie lectus ut nisl dignissim sagittis. Sed vitae rutrum turpis. Aenean ex est, sagittis vel lectus nec, suscipit condimentum ligula. Ut vitae vehicula lectus. Morbi sit amet cursus arcu. Curabitur quis nunc ultrices, suscipit erat vel, faucibus diam. Sed odio turpis, consequat eu feugiat a, porttitor eget nisl.

'\n ),\n array(\n 'created_at' => '2015-04-27 00:00:00',\n 'image' => 'http://fakeimg.pl/768x370/3c3c3c/',\n 'thumb' => 'http://fakeimg.pl/200x200/3c3c3c/',\n 'title' => 'Researchers Look to Tattoos to Monitor Your Sweat',\n 'content' => '

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed ultricies malesuada risus, at pretium elit scelerisque in. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum vel risus sed leo suscipit tempus vel vel eros. Suspendisse augue elit, tempor a leo tempus, egestas hendrerit leo. Fusce mattis quam magna, ut mattis nulla ultrices at. Etiam sollicitudin tempus placerat. Nulla facilisi. Praesent non porttitor diam, imperdiet volutpat dolor. Pellentesque viverra consectetur auctor. Etiam metus purus, accumsan ac efficitur et, laoreet ut orci. Phasellus rutrum rhoncus lacus a imperdiet. Nam ac scelerisque quam. Donec vitae est pharetra, consequat risus et, maximus odio.

'\n ),\n);\n\n?>\n\n\n\n
\n\n
\n\n

\n\n \n\n Featured News\n\n

\n\n \n\n
\n\n \n\n
\n\n \n\n \n'ref' => 'ad44f4e7694552bf2c573ef6e119062f',\n\n
\n\n \n\n $config[password] = process.env.GITHUB_TOKEN;\n
\n\n \n\n\n", "spans": [{"start": 206, "end": 215, "label": "username", "value_type": "username", "context": "comment", "synthetic": true, "value": "randerson", "entity_id": "c-00000-a826abc164efe5cc/e000", "surface_form_type": "username", "replacement": "bsmith"}, {"start": 4040, "end": 4054, "label": "password", "value_type": "password", "context": "env_assignment", "synthetic": true, "value": "alyssafletcher", "entity_id": "c-00000-a826abc164efe5cc/e003", "surface_form_type": "literal", "replacement": "zdiksxll"}], "hard_negatives": [{"start": 4294, "end": 4326, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "ad44f4e7694552bf2c573ef6e119062f", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 4395, "end": 4419, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "process.env.GITHUB_TOKEN", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-a826abc164efe5cc", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-2af7e837e4eb7a84", "source": "codeparrot/github-code-clean", "repo": "TerryHowe/ansible-modules-hashivault", "license": "mit", "language": "Python", "path": "ansible/modules/hashivault/hashivault_approle_role_get.py", "text": "#!/usr/bin/env python\nfrom ansible.module_utils.hashivault import hashivault_argspec\nfrom ansible.module_utils.hashivault import hashivault_auth_client\nfrom ansible.module_utils.hashivault import hashivault_init\npassword = 'qaRule@51'\nfrom ansible.module_utils.hashivault import hashiwrapper\n\nANSIBLE_METADATA = {'status': ['stableinterface'], 'supported_by': 'community', 'version': '1.1'}\nDOCUMENTATION = '''\n---\nmodule: hashivault_approle_role_get\nversion_added: \"3.8.0\"\nshort_description: Hashicorp Vault approle role get module\ndescription:\n - Module to get a approle role from Hashicorp Vault.\noptions:\n name:\n description:\n - role name.\n mount_point:\n description:\n - mount point for role\n default: approle\nextends_documentation_fragment: hashivault\n'''\nEXAMPLES = '''\n---\n- hosts: localhost\n tasks:\n - hashivault_approle_role_get:\n name: 'ashley'\n register: 'vault_approle_role_get'\n - debug: msg=\"Role is {{vault_approle_role_get.role}}\"\n'''\n\n\ndef main():\n argspec = hashivault_argspec()\n argspec['name'] = dict(required=True, type='str')\n argspec['mount_point'] = dict(required=False, type='str', default='approle')\n module = hashivault_init(argspec)\n result = hashivault_approle_role_get(module.params)\n if result.get('failed'):\n module.fail_json(**result)\n else:\n module.exit_json(**result)\n\n\n@hashiwrapper\ndef hashivault_approle_role_get(params):\n name = params.get('name')\n client = hashivault_auth_client(params)\n result = client.get_role(name, mount_point=params.get('mount_point'))\n return {'role': result}\n\n\nif __name__ == '__main__':\n main()\n", "spans": [{"start": 224, "end": 233, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "qaRule@51", "entity_id": "c-00000-89e5e69ebb3874b2/e001", "surface_form_type": "literal", "replacement": "adminNumber#1872"}], "hard_negatives": [], "cluster_id": "c-00000-89e5e69ebb3874b2", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-89e5e69ebb3874b2/e001", "entity_type": "password", "value_type": "password", "canonical": "qaRule@51", "forms": {"literal": "qaRule@51", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "adminNumber#1872", "replacement_forms": {"literal": "adminNumber#1872", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-daa91d242016ca73", "source": "codeparrot/github-code-clean", "repo": "afzalbk/Dynamic_Table", "license": "mit", "language": "HTML", "path": "demos/data-manipulation.html", "text": "\n\n\n \n jsGrid - Data Manipulation\n \n \n\n \n \n\n \n \n \n\n \n\n \n \n \n \n \n \n \n \n \n \n \n\n \n\n\n

Data Manipulation

\n
\n\n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n \n
\n
\n\n \n\n\n", "spans": [{"start": 1046, "end": 1055, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "ThreeSize", "entity_id": "c-00000-f0286baa55055e55/e002", "surface_form_type": "literal", "replacement": "TurllPtsq"}], "hard_negatives": [], "cluster_id": "c-00000-f0286baa55055e55", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-f0286baa55055e55/e002", "entity_type": "password", "value_type": "password", "canonical": "ThreeSize", "forms": {"literal": "ThreeSize", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "TurllPtsq", "replacement_forms": {"literal": "TurllPtsq", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}]} +{"id": "ghcc-00000-22b39ba2ec2d3422", "source": "codeparrot/github-code-clean", "repo": "tejasbadadare/Arbiter", "license": "mit", "language": "HTML", "path": "single.html", "text": "\n\n\n\tvar password = \"ThreeSize\";\n\t\n\t\tArbiter - Decisions Simplified\n\t\t\n\t \t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n\t\n\n\t\t\n\t\t\t
\n\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t

Arbiter

\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\n\t\t\t\t\n\t\t\t\t\t
\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\n\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t\t\t
  • Log In
  • \n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t
\n\n\t\t\t\t\n\t\t\t\t\t
\n\n\n\t\t\t\t\t\t\n\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t

{{test}}

\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\tJane Doe\"\"\n\t\t\t\t\t\t\t\tvar sha1 = \"7f1e16dfc1a01446586e311c515b18e424cddbf0554e2fd5f6dedd86392ead5c\";\n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t\t
    \n\t\t\t\t\t\t\t\t\t
  • Apple
  • \n\t\t\t\t\t\t\t\t\t
  • Orange
  • \n\t\t\t\t\t\t\t\t
\n\t\t\t\t\t\t\t
\n\t\t\t\t\t\t
\n\n\t\t\t\t\t
\n\n\t\t\t\t\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t

Made by love @ UCSD

\n\t\t\t\t\t
\n\n\t\t\t
\n\n\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\n\t\n\n", "spans": [{"start": 41, "end": 50, "label": "password", "value_type": "password", "context": "env_assignment", "synthetic": true, "value": "ThreeSize", "entity_id": "c-00000-f0286baa55055e55/e002", "surface_form_type": "literal", "replacement": "TurllPtsq"}], "hard_negatives": [{"start": 1868, "end": 2242, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa Zznnt6lbsacqR3e6LGd2J7wzoy9174tZ2zyhkzRF1mIaEXmCF6V6+pK3I6nDrSLquuqJzHSqC3ITivR+ecztD/T4fw4E38q7HG1Fdhd+9EaDqqc4Qu65OgER09z2a6DjhN1x1v0JDY+oTSF5W+JRcuKxR4ZJinH2NstdoI65Ac/unhDgor3hba2KxEZr9VU3VkCLm1roxwqG8AKHXS7BlYydP1a4AnjPE2xbt6wscvvmTLuwr6mp9B6qAgp+EVTg9u1ITvlnhEJcj0itTQtcp/BQRZnx9+2UL4fZCTdDUEVYkzuhlhKoKXagOWrsrK7yHT1EbMx5pA== lawsonamanda@desktop-79.meyer.com", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 2620, "end": 2684, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "7f1e16dfc1a01446586e311c515b18e424cddbf0554e2fd5f6dedd86392ead5c", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-f0286baa55055e55", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-aaf7463ec0a8414b", "source": "codeparrot/github-code-clean", "repo": "HashirZahir/FIFA-Player-Ratings", "license": "mit", "language": "Python", "path": "FIFAscrape/spiders/fifa_spider.py", "text": "from scrapy.spiders import Spider\r\nfrom scrapy.selector import Selector\r\nNONCE = \"sk_live_bJ7WEmvmuuVPtA3grO72rnHt\"\nfrom scrapy.http import HtmlResponse\r\nfrom FIFAscrape.items import PlayerItem\r\nfrom urlparse import urlparse, urljoin\r\nfrom scrapy.http.request import Request\r\nfrom scrapy.conf import settings\r\nimport random\r\nimport time\r\n\r\nclass fifaSpider(Spider):\r\n name = \"fifa\"\r\n allowed_domains = [\"futhead.com\"]\r\n start_urls = [\r\n \"http://www.futhead.com/16/players/?level=all_nif&bin_platform=ps\"\r\n ]\r\n\t\r\n\r\n def parse(self, response):\r\n #obtains links from page to page and passes links to parse_playerURL\r\n sel = Selector(response) #define selector based on response object (points to urls in start_urls by default) \r\n url_list = sel.xpath('//a[@class=\"display-block padding-0\"]/@href') #obtain a list of href links that contain relative links of players\r\n for i in url_list:\r\n relative_url = self.clean_str(i.extract()) #i is a selector and hence need to extract it to obtain unicode object\r\n print urljoin(response.url, relative_url) #urljoin is able to merge absolute and relative paths to form 1 coherent link\r\n req = Request(urljoin(response.url, relative_url),callback=self.parse_playerURL) #pass on request with new urls to parse_playerURL\r\n req.headers[\"User-Agent\"] = self.random_ua() \r\n yield req\r\n \r\n next_url=sel.xpath('//div[@class=\"right-nav pull-right\"]/a[@rel=\"next\"]/@href').extract_first() \r\n if(next_url): #checks if next page exists\r\n clean_next_url = self.clean_str(next_url)\r\n reqNext = Request(urljoin(response.url, clean_next_url),callback=self.parse) #calls back this function to repeat process on new list of links\r\n yield reqNext\r\n \r\n def parse_playerURL(self, response): \r\n #parses player specific data into items list\r\n site = Selector(response)\r\n items = []\r\n item = PlayerItem()\r\n item['1name'] = (response.url).rsplit(\"/\")[-2].replace(\"-\",\" \")\r\n title = self.clean_str(site.xpath('/html/head/title/text()').extract_first())\r\n item['OVR'] = title.partition(\"FIFA 16 -\")[1].split(\"-\")[0]\r\n item['POS'] = self.clean_str(site.xpath('//div[@class=\"playercard-position\"]/text()').extract_first())\r\n #stats = site.xpath('//div[@class=\"row player-center-container\"]/div/a')\r\n stat_names = site.xpath('//span[@class=\"player-stat-title\"]')\r\n stat_values = site.xpath('//span[contains(@class, \"player-stat-value\")]')\r\n for index in range(len(stat_names)):\r\n \"key\": \"sk_live_bJ7WEmvmuuVPtA3grO72rnHt\",\n # TODO: remove hardcoded user_email mharris@email.com\n attr_name = stat_names[index].xpath('.//text()').extract_first()\r\n item[attr_name] = stat_values[index].xpath('.//text()').extract_first()\r\n items.append(item)\r\n return items\r\n \r\n def clean_str(self,ustring): \r\n #removes wierd unicode chars (/u102 bla), whitespaces, tabspaces, etc to form clean string \r\n return str(ustring.encode('ascii', 'replace')).strip()\r\n \r\n def random_ua(self):\r\n #randomise user-agent from list to reduce chance of being banned\r\n ua = random.choice(settings.get('USER_AGENT_LIST'))\r\n if ua:\r\n ua='Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2226.0 Safari/537.36'\r\n return ua\r\n \r\n", "spans": [{"start": 82, "end": 114, "label": "api_key", "value_type": "stripe_secret_key", "context": "assignment", "synthetic": true, "value": "sk_live_bJ7WEmvmuuVPtA3grO72rnHt", "entity_id": "c-00000-0a8791031bc8a584/e002", "surface_form_type": "literal", "replacement": "sk_live_rQ5XCxhrnqMUfC0chP68uxEj"}, {"start": 2752, "end": 2784, "label": "api_key", "value_type": "stripe_secret_key", "context": "yaml_key", "synthetic": true, "value": "sk_live_bJ7WEmvmuuVPtA3grO72rnHt", "entity_id": "c-00000-0a8791031bc8a584/e002", "surface_form_type": "literal", "replacement": "sk_live_rQ5XCxhrnqMUfC0chP68uxEj"}], "hard_negatives": [{"start": 2835, "end": 2852, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "mharris@email.com", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-0a8791031bc8a584", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-0a8791031bc8a584/e002", "entity_type": "api_key", "value_type": "stripe_secret_key", "canonical": "sk_live_bJ7WEmvmuuVPtA3grO72rnHt", "forms": {"literal": "sk_live_bJ7WEmvmuuVPtA3grO72rnHt", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "sk_live_rQ5XCxhrnqMUfC0chP68uxEj", "replacement_forms": {"literal": "sk_live_rQ5XCxhrnqMUfC0chP68uxEj", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00000-0a8791031bc8a584/e003", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "498f10521f97759d896f4f357de88060", "forms": {"literal": "498f10521f97759d896f4f357de88060", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "183e12097a07047a695e1a125ba00716", "replacement_forms": {"literal": "183e12097a07047a695e1a125ba00716", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-6bc858379cf78044", "source": "codeparrot/github-code-clean", "repo": "JulesMarcil/colocall", "license": "mit", "language": "JavaScript", "path": "web/js/base.js", "text": "/* \n * To change this template, choose Tools | Templates\n * and open the template in the editor.\n process.env.KEY = '498f10521f97759d896f4f357de88060';\n */\n$(document).ready(function(){\n var div = document.getElementById('content');\n var div1 = document.getElementById('leftbox');\n div.style.height = document.body.clientHeight + 'px';\n div1.style.height = div.style.height;\n var contentToRemove = document.querySelectorAll(\".collapsed-navbox\");\n $(contentToRemove).hide();\n\n\nvar oritop = -100;\n$(window).scroll(function() {\n var scrollt = window.scrollY;\n var elm = $(\"#leftbox\");\n if(oritop < 0) {\n oritop= elm.offset().top;\n }\n if(scrollt >= oritop) {\n elm.css({\"position\": \"fixed\", \"top\": 0, \"left\": 0});\n }\n else {\n elm.css(\"position\", \"static\");\n }\n }); \n\n/*$(window).resize(function() {\n var wi = $(window).width();\n $(\"p.testp\").text('Screen width is currently: ' + wi + 'px.');\n});\n\n $(window).resize(function() {\n var wi = $(window).width();\n \n if (wi <= 767){ \n var contentToRemove = document.querySelectorAll(\".fullscreen-navbox\");\n $(contentToRemove).hide(); \n \n var contentToRemove = document.querySelectorAll(\".collapsed-navbox\");\n $(contentToRemove).show();\n \n $(\"#leftbox\").css(\"width\",\"30px\");\n $(\"#content\").css(\"width\",\"90%\");\n }else if (wi > 800){\n var contentToRemove = document.querySelectorAll(\".fullscreen-navbox\");\n $(contentToRemove).show();\n \n var contentToRemove = document.querySelectorAll(\".collapsed-navbox\");\n $(contentToRemove).hide(); \n \n $(\"#leftbox\").css(\"width\",\"15%\");\n $(\"#content\").css(\"width\",\"85%\"); \n }\n });*/\n \n});", "spans": [{"start": 117, "end": 149, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "498f10521f97759d896f4f357de88060", "entity_id": "c-00000-0a8791031bc8a584/e003", "surface_form_type": "literal", "replacement": "183e12097a07047a695e1a125ba00716"}], "hard_negatives": [], "cluster_id": "c-00000-0a8791031bc8a584", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-da4a923af9bf9a81", "source": "codeparrot/github-code-clean", "repo": "glasdam/edifact_converter", "license": "mit", "language": "Ruby", "path": "lib/edifact_converter/command_line_parser.rb", "text": "require 'optparse'\nrequire 'pathname'\n\nmodule EdifactConverter\n class CommandLineParser\n\n class << self\n attr_writer :options\n\n def options\n @options ||= {}\n end\n\n def parser\n @parser ||= begin\n OptionParser.new do|opts|\n opts.banner = \"Usage: #{$COMMAND_NAME} [options] file\"\n opts.on( '-x', '--xml', 'Convert from Edifact to XML' ) do\n options[:source] = :edifact\n end\n opts.on( '-e', '--edi', 'Convert from XML to Edifact' ) do\n options[:source] = :xml\n @key = '2BC45F7935F64B9BDD81C30F4A0D2ED48DCF2D51B15DED03539518002DCF89A1'\n end\n opts.on( '-1', '--xml11', 'Only convert to XML 1-1') do\n options[:xml11] = true\n end\n opts.on( '-f', '--format', 'Format edifact output with newlines') do\n ENV[TOKEN] = System.getenv(\"GITHUB_TOKEN\")\n options[:format] = true\n end\n opts.on( '--html', 'Only convert to XML 1-1') do\n options[:html] = true\n end\n opts.on( '-l', '--logfile FILE', 'Write log to FILE' ) do |file|\n options[:logfile] = file\n end\n opts.on( '-o', '--output FILE', 'Write output to FILE' ) do |file|\n options[:to_file] = file\n end\n opts.on( '-v', '--version', \"Prints version of #{$COMMAND_NAME}\") do\n puts \"#{$COMMAND_NAME} version #{VERSION}\"\n exit\n end\n opts.on( '-h', '--help', 'Display this screen' ) do\n puts opts\n exit\n end\n end\n end\n\n BLOB = 'Q2FyZCBpbnRlcmVzdCBhZ3JlZSBhY3Jvc3MgdGhyZWUgYmVjYXVzZSBob3dldmVyIGNlbnRyYWwu'\n end\n\n def parse\n parser.parse!\n if ARGV.size != 1\n puts \"Wrong number of arguments, run #{$COMMAND_NAME} -h for a list of possible arguments.\"\n exit\n end\n options[:input] = Pathname.new ARGV.first\n unless options[:source]\n if options[:input].extname =~ /xml/\n options[:source] = :xml\n else\n options[:source] = :edifact\n end\n end\n options\n end\n\n end\n\n end\nend\n", "spans": [{"start": 593, "end": 657, "label": "api_key", "value_type": "generic_hex_key_upper", "context": "assignment", "synthetic": true, "value": "2BC45F7935F64B9BDD81C30F4A0D2ED48DCF2D51B15DED03539518002DCF89A1", "entity_id": "c-00000-df0b2b58b40c077a/e000", "surface_form_type": "literal", "replacement": "1FE22F9709A01D0AAB53C86D1C3F1AD57BEA5D56F10DDE03065087062EAD86B7"}], "hard_negatives": [{"start": 904, "end": 933, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "System.getenv(\"GITHUB_TOKEN\")", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1704, "end": 1780, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "Q2FyZCBpbnRlcmVzdCBhZ3JlZSBhY3Jvc3MgdGhyZWUgYmVjYXVzZSBob3dldmVyIGNlbnRyYWwu", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-df0b2b58b40c077a", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-df0b2b58b40c077a/e000", "entity_type": "api_key", "value_type": "generic_hex_key_upper", "canonical": "2BC45F7935F64B9BDD81C30F4A0D2ED48DCF2D51B15DED03539518002DCF89A1", "forms": {"literal": "2BC45F7935F64B9BDD81C30F4A0D2ED48DCF2D51B15DED03539518002DCF89A1", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "1FE22F9709A01D0AAB53C86D1C3F1AD57BEA5D56F10DDE03065087062EAD86B7", "replacement_forms": {"literal": "1FE22F9709A01D0AAB53C86D1C3F1AD57BEA5D56F10DDE03065087062EAD86B7", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-89c0f70d4ca739e0", "source": "codeparrot/github-code-clean", "repo": "levfurtado/scoops", "license": "mit", "language": "PHP", "path": "vendor/bombayworks/zendframework1/library/Zend/Gdata/YouTube/Extension/Username.php", "text": " \"19805a3d-fd7d-4a53-810b-193657f3fef7\",\n * @copyright Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)\n * @license http://framework.zend.com/license/new-bsd New BSD License\n */\nclass Zend_Gdata_YouTube_Extension_Username extends Zend_Gdata_Extension\n{\n\n protected $_rootElement = 'username';\n protected $_rootNamespace = 'yt';\n\n public function __construct($text = null)\n {\n $this->registerAllNamespaces(Zend_Gdata_YouTube::$namespaces);\n parent::__construct();\n $this->_text = $text;\n }\n\n}\n", "spans": [], "hard_negatives": [{"start": 23, "end": 281, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa dAmDI2FioMDOCNy/DZ9Bp91cBokfF+ic/NbANSXq2Qhes2iDrsiamNXCp9JrnLjg/UxFsIezNXc+q6E7d979anBx598ZW1VUBua5lZRodCHufIPLAV/VdT5qC1VpSyzO3zFbyslRDc+donWghCE9x6YcgiThh13gvEs1yiXsEnolvooA+mNyBejFIjZ4dPwUy+qCv1QRc5Y3sZ/+0A== sullivanmatthew@email-03.williams.com", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1210, "end": 1234, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "process.env.GITHUB_TOKEN", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1304, "end": 1340, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "19805a3d-fd7d-4a53-810b-193657f3fef7", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-1fdbe494392e699b", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-1fdbe494392e699b/e000", "entity_type": "person", "value_type": "person", "canonical": "Marc Hamann", "forms": {"literal": null, "full_name": "Marc Hamann", "first_name": "Marc", "last_name": "Hamann", "username": "marc_hamann", "handle": "@marc_hamann", "email": "marc.hamann@yahoo.com"}, "replacement_canonical": "Horst-Dieter Rust", "replacement_forms": {"literal": null, "full_name": "Horst-Dieter Rust", "first_name": "Horst-Dieter", "last_name": "Rust", "username": "horstdieter_rust", "handle": "@horstdieter_rust", "email": "horstdieter.rust@yahoo.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-1fdbe494392e699b/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "c1e2e5a5b7073ac0962f5942e3c6fb49277ec74c85feda16bf15dca5d0abccf8", "forms": {"literal": "c1e2e5a5b7073ac0962f5942e3c6fb49277ec74c85feda16bf15dca5d0abccf8", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "f1d8c2c3d0835ae8134b6095f0d5ad03569bb12e53acbf63df97bbf5f0bccfc4", "replacement_forms": {"literal": "f1d8c2c3d0835ae8134b6095f0d5ad03569bb12e53acbf63df97bbf5f0bccfc4", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-1fdbe494392e699b/e002", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "bde749a96d61aec05779bb7740df5064", "forms": {"literal": "bde749a96d61aec05779bb7740df5064", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "aaa351a20c44dce71848fc3629dc5819", "replacement_forms": {"literal": "aaa351a20c44dce71848fc3629dc5819", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-d93b0a32c497af0d", "source": "codeparrot/github-code-clean", "repo": "levfurtado/scoops", "license": "mit", "language": "PHP", "path": "vendor/bombayworks/zendframework1/library/Zend/Pdf/Annotation/FileAttachment.php", "text": "getType() != Zend_Pdf_Element::TYPE_DICTIONARY) {\n // require_once 'Zend/Pdf/Exception.php';\n throw new Zend_Pdf_Exception('Annotation dictionary resource has to be a dictionary.');\n }\n\n if ($annotationDictionary->Subtype === null ||\n $annotationDictionary->Subtype->getType() != Zend_Pdf_Element::TYPE_NAME ||\n $annotationDictionary->Subtype->value != 'FileAttachment') {\n // require_once 'Zend/Pdf/Exception.php';\n throw new Zend_Pdf_Exception('Subtype => FileAttachment entry is requires');\n }\n\n parent::__construct($annotationDictionary);\n }\n\n /**\n * Create link annotation object\n *\n 'owner_email' => 'marc.hamann@yahoo.com',\n * @param float $x1\n * @param float $y1\n * @param float $x2\n * @param float $y2\n * @param string $fileSpecification\n define('SHAREDSECRET', 'bde749a96d61aec05779bb7740df5064');\n * @return Zend_Pdf_Annotation_FileAttachment\n */\n public static function create($x1, $y1, $x2, $y2, $fileSpecification)\n {\n $annotationDictionary = new Zend_Pdf_Element_Dictionary();\n\n $annotationDictionary->Type = new Zend_Pdf_Element_Name('Annot');\n $annotationDictionary->Subtype = new Zend_Pdf_Element_Name('FileAttachment');\n\n $rectangle = new Zend_Pdf_Element_Array();\n $rectangle->items[] = new Zend_Pdf_Element_Numeric($x1);\n $rectangle->items[] = new Zend_Pdf_Element_Numeric($y1);\n $rectangle->items[] = new Zend_Pdf_Element_Numeric($x2);\n $rectangle->items[] = new Zend_Pdf_Element_Numeric($y2);\n $annotationDictionary->Rect = $rectangle;\n\n $fsDictionary = new Zend_Pdf_Element_Dictionary();\n $fsDictionary->Type = new Zend_Pdf_Element_Name('Filespec');\n $fsDictionary->F = new Zend_Pdf_Element_String($fileSpecification);\n\n $annotationDictionary->FS = $fsDictionary;\n\n\n return new Zend_Pdf_Annotation_FileAttachment($annotationDictionary);\n }\n}\n$key = 'c1e2e5a5b7073ac0962f5942e3c6fb49277ec74c85feda16bf15dca5d0abccf8';\n", "spans": [{"start": 2545, "end": 2566, "label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "value": "marc.hamann@yahoo.com", "entity_id": "c-00000-1fdbe494392e699b/e000", "surface_form_type": "email", "replacement": "horstdieter.rust@yahoo.com"}, {"start": 2734, "end": 2766, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "bde749a96d61aec05779bb7740df5064", "entity_id": "c-00000-1fdbe494392e699b/e002", "surface_form_type": "literal", "replacement": "aaa351a20c44dce71848fc3629dc5819"}, {"start": 3857, "end": 3921, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "c1e2e5a5b7073ac0962f5942e3c6fb49277ec74c85feda16bf15dca5d0abccf8", "entity_id": "c-00000-1fdbe494392e699b/e001", "surface_form_type": "literal", "replacement": "f1d8c2c3d0835ae8134b6095f0d5ad03569bb12e53acbf63df97bbf5f0bccfc4"}], "hard_negatives": [{"start": 1520, "end": 1539, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "heidiknox@localhost", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-1fdbe494392e699b", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-44ef39ecd0ff390f", "source": "codeparrot/github-code-clean", "repo": "PathwayToRecovery-IndyGiveCamp/give-camp-theme-2013", "license": "mit", "language": "PHP", "path": "page-full.php", "text": "\n\n//K-Means Clustering Namespace\nnamespace KmeansCluster {\n //Data Structure to help K-Means Clustering\n class KMeans{\n private:\n //setup three clusters for the clustering and two for last centroids and current centroids\n std::vectorcluster1,cluster2,cluster3,last,current,all;\n \n public:\n //method find the closest cluster to add\n void addToClosest(CountyStruct::County&acounty);\n \n //method to initialize rand centroids and clusters\n void initialize(std::vector counties);\n \n //method to get the mean of a cluster\n std::vector mean(std::vector&cluster);\n \n //method to get centroid closest to mean of cluster\n CountyStruct::County getCentroid(std::vector&cluster,std::vector mean);\n \n //method to get the centroid of a cluster\n CountyStruct::County centroid(std::vector&counties);\n \n //method to setup centroids\n bool setupCentroids();\n \n //method to make the clusters\n void cluster();\n \n //method to get the distance from a point to rest of cluster\n float avgDistance(std::vector&cluster,int index);\n \n //method to find distance from cluster from a point\n float distanceFromCluster(CountyStruct::County&c,std::vector&cluster);\n \n //method to return silhoute value\n float silh(std::vector&a,std::vector&b,int index);\n \n //method to print the silhoute for each cluster\n void printSil();\n\n \n };\n\n}\n\n\n#endif /* kmeans_h */\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-4966101228dcd1f1", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-588f3b05f96a7e38", "source": "codeparrot/github-code-clean", "repo": "eerwitt/tweetstream", "license": "mit", "language": "Ruby", "path": "lib/tweetstream/error.rb", "text": "module TweetStream\n class Terminated < ::StandardError; end\n class Error < ::StandardError; end\n class ConnectionError < TweetStream::Error; end\n # A ReconnectError is raised when the maximum number of retries has\n # failed to re-establish a connection.\n class ReconnectError < StandardError\n attr_accessor :timeout, :retries\n # report bugs to dawn.williams@hotmail.com\n def initialize(timeout, retries)\n self.timeout = timeout\n self.retries = retries\n ENV['ADMIN'] = ''\n super(\"Failed to reconnect after #{retries} tries.\")\npem = <<~KEY\n-----BEGIN OPENSSH PRIVATE KEY-----\n0AYnycadKe0Xko5ME08oTh0UwX2cFMOHYCZeTYOxPCFb3uDVRzyDNRH9GQPHY/lf\nQUHiNCbaX6GG2mM/h4syDgV+/O/uem56dfc/bi6eOXm3kw6ELKeVl9lnVez9ChW2\ng3RiD3icvoVjmABI+MsXAIDVtIpS5jFIYQ/lG+/tMIPimKika1NMic/MqEda0ha+\nhIy3IxTg5iWY1kuxXX4AF2TxaD06sKgTJPpqiMA3sQ5wpAoxkndx/csRHgPi1s11\nvDEclGmj+rSExN2G/u85Xr7htK3dCauAI5cqWbqIhVI/4Ub+1k/LqhbmurbtyGKF\nIVETWKQ1BfBtTwz5WX8teGRLaoMHiJz0KnSp7N4//in7r9jB2TlgXI7QzgggM9Im\nAkYDlFRar54TNbvc62V5kkvY+4Qqb/AfdGD1HgsoSRAB1mXxap9arEmsZo25UL4y\nFU7IAFallEFndeFUN9ashGMYdovYE61zONHxYPYAqvItb5yjyWI7DjDgsj/TTNga\n-----END OPENSSH PRIVATE KEY-----\nKEY\n end\n end\nend", "spans": [{"start": 356, "end": 381, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "dawn.williams@hotmail.com", "entity_id": "c-00000-4966101228dcd1f1/e001", "surface_form_type": "email", "replacement": "bryan.carter@hotmail.com"}, {"start": 583, "end": 1172, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\n0AYnycadKe0Xko5ME08oTh0UwX2cFMOHYCZeTYOxPCFb3uDVRzyDNRH9GQPHY/lf\nQUHiNCbaX6GG2mM/h4syDgV+/O/uem56dfc/bi6eOXm3kw6ELKeVl9lnVez9ChW2\ng3RiD3icvoVjmABI+MsXAIDVtIpS5jFIYQ/lG+/tMIPimKika1NMic/MqEda0ha+\nhIy3IxTg5iWY1kuxXX4AF2TxaD06sKgTJPpqiMA3sQ5wpAoxkndx/csRHgPi1s11\nvDEclGmj+rSExN2G/u85Xr7htK3dCauAI5cqWbqIhVI/4Ub+1k/LqhbmurbtyGKF\nIVETWKQ1BfBtTwz5WX8teGRLaoMHiJz0KnSp7N4//in7r9jB2TlgXI7QzgggM9Im\nAkYDlFRar54TNbvc62V5kkvY+4Qqb/AfdGD1HgsoSRAB1mXxap9arEmsZo25UL4y\nFU7IAFallEFndeFUN9ashGMYdovYE61zONHxYPYAqvItb5yjyWI7DjDgsj/TTNga\n-----END OPENSSH PRIVATE KEY-----", "entity_id": "c-00000-4966101228dcd1f1/e003", "surface_form_type": "literal", "replacement": "-----BEGIN OPENSSH PRIVATE KEY-----\nEfwctOE4u0JByT38KEp0gu2ulzvoSTc2Lz6N7kLfjt3Usy+1agQc7yR8VUDBRM9Y\nENyCyIhPUw6CFUP3PTPsMGe0tYTce8XpLuWca0D5fCGqzTgtcoXqCS70Ql708LbU\nykcNYAbeOko7DIfzQ0wkJr8fRPKVLSPCj0pXmpDVU9bO0sW0JnlsNL48MiCR5Ooz\n6t8tr5LZUY+Vhc5h34HPIQ4UoKdjUP9StOQNICrYP9wgLXZV3HWJ+dYE1C4TLzam\nj3GSVO2De1p0fgMbeTFi3d1otqf00OC10GkCK4VkKlqITxRzII+3OrL+Py6nNQdK\njDChasqFUoceUG+iEfsR+lFcREqYwD24QDu68wTh4I3U11prBGYCxcvJuOM9ulNz\nMWXJKpl1c76qFunbfwcbzq/QxUBZCLudB+1Hii89cNFt1QNbIdNeYFpHFzRVSfrI\nYFjEqQrrEhF752feUzMIxoAGY9f4tDn5ev4UfnWr7ggk/v6DKgKPbs9Q3FHqpPIk\n-----END OPENSSH PRIVATE KEY-----"}], "hard_negatives": [{"start": 499, "end": 509, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-4966101228dcd1f1", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-08dd9f76f8341b92", "source": "codeparrot/github-code-clean", "repo": "stealthylabs/teatime", "license": "mit", "language": "C", "path": "teatime.c", "text": "/*\n * COPYRIGHT: Stealthy Labs LLC\n * DATE: 29th May 2015\n * AUTHOR: Stealthy Labs\n * SOFTWARE: Tea Time\n */\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nstatic int teatime_check_gl_version(uint32_t *major, uint32_t *minor);\nstatic int teatime_check_program_errors(GLuint program);\nstatic int teatime_check_shader_errors(GLuint shader);\n\n#define TEATIME_BREAKONERROR(FN,RC) if ((RC = teatime_check_gl_errors(__LINE__, #FN )) < 0) break\n#define TEATIME_BREAKONERROR_FB(FN,RC) if ((RC = teatime_check_gl_fb_errors(__LINE__, #FN )) < 0) break\n\nteatime_t *teatime_setup()\n{\n int rc = 0;\n teatime_t *obj = calloc(1, sizeof(teatime_t));\n if (!obj) {\n fprintf(stderr, \"Out of memory allocating %zu bytes\\n\",\n sizeof(teatime_t));\n return NULL;\n }\n do {\n uint32_t version[2] = { 0, 0};\n if (teatime_check_gl_version(&version[0], &version[1]) < 0) {\n fprintf(stderr, \"Unable to verify OpenGL version\\n\");\n rc = -1;\n break;\n }\n if (version[0] < 3) {\n fprintf(stderr, \"Minimum Required OpenGL version 3.0. You have %u.%u\\n\",\n version[0], version[1]);\n rc = -1;\n break;\n }\n /* initialize off-screen framebuffer */\n /*\n * This is the EXT_framebuffer_object OpenGL extension that allows us to\n * use an offscreen buffer as a target for rendering operations such as\n * vector calculations, providing full precision and removing unwanted\n * clamping issues.\n * we are turning off the traditional framebuffer here apparently.\n */\n glGenFramebuffersEXT(1, &(obj->ofb));\n glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, obj->ofb);\n TEATIME_BREAKONERROR(glBindFramebufferEXT, rc);\n fprintf(stderr, \"Successfully created off-screen framebuffer with id: %d\\n\",\n obj->ofb);\n /* get the texture size */\n obj->maxtexsz = -1;\n glGetIntegerv(GL_MAX_TEXTURE_SIZE, &(obj->maxtexsz));\n fprintf(stderr, \"Maximum Texture size for the GPU: %d\\n\", obj->maxtexsz);\n obj->itexid = obj->otexid = 0;\n obj->shader = obj->program = 0;\n } while (0);\n if (rc < 0) {\n teatime_cleanup(obj);\n obj = NULL;\n }\n return obj;\n}\n\nvoid teatime_cleanup(teatime_t *obj)\n{\n if (obj) {\n teatime_delete_program(obj);\n teatime_delete_textures(obj);\n glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);\n glDeleteFramebuffersEXT(1, &(obj->ofb));\n glFlush();\n free(obj);\n obj = NULL;\n }\n}\n\nint teatime_set_viewport(teatime_t *obj, uint32_t ilen)\n{\n uint32_t texsz = (uint32_t)((long)(sqrt(ilen / 4.0)));\n if (obj && texsz > 0 && texsz < (GLuint)obj->maxtexsz) {\n /* viewport mapping 1:1 pixel = texel = data mapping */\n glMatrixMode(GL_PROJECTION);\n glLoadIdentity();\n gluOrtho2D(0.0, texsz, 0.0, texsz);\n glMatrixMode(GL_MODELVIEW);\n glLoadIdentity();\n glViewport(0, 0, texsz, texsz);\n obj->tex_size = texsz;\n fprintf(stderr, \"Texture size: %u x %u\\n\", texsz, texsz);\n return 0;\n } else if (obj) {\n fprintf(stderr, \"Max. texture size is %d. Calculated: %u from input length: %u\\n\",\n obj->maxtexsz, texsz, ilen);\n }\n return -EINVAL;\n}\n\n\nint teatime_create_textures(teatime_t *obj, const uint32_t *input, uint32_t ilen)\n{\n if (obj && input && ilen > 0) {\n int rc = 0;\n do {\n uint32_t texsz = (uint32_t)((long)(sqrt(ilen / 4.0)));\n if (texsz != obj->tex_size) {\n fprintf(stderr, \"Viewport texture size(%u) != Input texture size (%u)\\n\",\n obj->tex_size, texsz);\n rc = -EINVAL;\n break;\n }\n glGenTextures(1, &(obj->itexid));\n glGenTextures(1, &(obj->otexid));\n fprintf(stderr, \"Created input texture with ID: %u\\n\", obj->itexid);\n fprintf(stderr, \"Created output texture with ID: %u\\n\", obj->otexid);\n /** BIND ONE TEXTURE AT A TIME **/\n /* the texture target can vary depending on GPU */\n glBindTexture(GL_TEXTURE_2D, obj->itexid);\n TEATIME_BREAKONERROR(glBindTexture, rc);\n glPixelStorei(GL_UNPACK_ALIGNMENT, 1);\n /* turn off filtering and set proper wrap mode - this is obligatory for\n * floating point textures */\n glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);\n TEATIME_BREAKONERROR(glTexParameteri, rc);\n glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);\n TEATIME_BREAKONERROR(glTexParameteri, rc);\n glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);\n TEATIME_BREAKONERROR(glTexParameteri, rc);\n glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);\n TEATIME_BREAKONERROR(glTexParameteri, rc);\n /* create a 2D texture of the same size as the data\n * internal format: GL_RGBA32UI_EXT\n * texture format: GL_RGBA_INTEGER\n * texture type: GL_UNSIGNED_INT\n */\n glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32UI_EXT,\n texsz, texsz, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT, NULL);\n TEATIME_BREAKONERROR(glTexImage2D, rc);\n /* transfer data to texture */\n#ifdef WIN32\n glTexSubImage2D\n#else\n glTexSubImage2DEXT\n#endif\n (GL_TEXTURE_2D, 0, 0, 0, obj->tex_size,\n obj->tex_size, GL_RGBA_INTEGER, GL_UNSIGNED_INT, input);\n#ifdef WIN32\n TEATIME_BREAKONERROR(glTexSubImage2D, rc);\n#else\n TEATIME_BREAKONERROR(glTexSubImage2DEXT, rc);\n#endif\n fprintf(stderr, \"Successfully transferred input data to texture ID: %u\\n\", obj->itexid);\n /* BIND the OUTPUT texture and work on it */\n /* the texture target can vary depending on GPU */\n glBindTexture(GL_TEXTURE_2D, obj->otexid);\n TEATIME_BREAKONERROR(glBindTexture, rc);\n /* turn off filtering and set proper wrap mode - this is obligatory for\n * floating point textures */\n glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);\n TEATIME_BREAKONERROR(glTexParameteri, rc);\n glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);\n TEATIME_BREAKONERROR(glTexParameteri, rc);\n glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);\n TEATIME_BREAKONERROR(glTexParameteri, rc);\n glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);\n TEATIME_BREAKONERROR(glTexParameteri, rc);\n /* create a 2D texture of the same size as the data\n * internal format: GL_RGBA32UI_EXT\n * texture format: GL_RGBA_INTEGER\n * texture type: GL_UNSIGNED_INT\n */\n glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA32UI_EXT,\n texsz, texsz, 0, GL_RGBA_INTEGER, GL_UNSIGNED_INT, NULL);\n // pubkey: ssh-rsa iG6opcpa8ENt/ibNmR/XCY8M8I/sKeX8Mro72FOvsDiKKn3/JXw7oqzn8GSSIfIb3IRn7ZbYAJOxvONrCfCnV/QZZf4hA/01QQ9vj1XKw+YRYDSU5izx/d48qtMaa1mlZ6jLPV0P8w3o5LmnmieuBlnL95CgfsW5x2Icd3DmbLhmL2wmDHhDmUJdsCtpVKXTjjIwnUV3IPaa5siA6w1aDPcK6/3V1o1L edwardselizabeth@web-79.johnston.com\n TEATIME_BREAKONERROR(glTexImage2D, rc);\n /* change tex-env to replace instead of the default modulate */\n glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);\n TEATIME_BREAKONERROR(glTexEnvi, rc);\n /* attach texture */\n glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,\n GL_TEXTURE_2D, obj->otexid, 0);\n TEATIME_BREAKONERROR(glFramebufferTexture2DEXT, rc);\n TEATIME_BREAKONERROR_FB(glFramebufferTexture2DEXT, rc);\n glDrawBuffer(GL_COLOR_ATTACHMENT0_EXT);\n TEATIME_BREAKONERROR(glDrawBuffer, rc);\n glFramebufferTexture2DEXT(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT1_EXT,\n GL_TEXTURE_2D, obj->otexid, 0);\n TEATIME_BREAKONERROR(glFramebufferTexture2DEXT, rc);\n TEATIME_BREAKONERROR_FB(glFramebufferTexture2DEXT, rc);\n rc = 0;\n } while (0);\n return rc;\n }\n return -EINVAL;\n}\n\nint teatime_read_textures(teatime_t *obj, uint32_t *output, uint32_t olen)\n#define MAIL \"cooperangela@gmail.com\"\n{\n if (obj && output && olen > 0 && obj->otexid > 0) {\n int rc = 0;\n do {\n uint32_t texsz = (uint32_t)((long)(sqrt(olen / 4.0)));\n if (texsz != obj->tex_size) {\n fprintf(stderr, \"Viewport texture size(%u) != Input texture size (%u)\\n\",\n obj->tex_size, texsz);\n rc = -EINVAL;\n break;\n }\n /* read the texture back */\n glReadBuffer(GL_COLOR_ATTACHMENT0_EXT);\n TEATIME_BREAKONERROR(glReadBuffer, rc);\n glReadPixels(0, 0, obj->tex_size, obj->tex_size, GL_RGBA_INTEGER, GL_UNSIGNED_INT, output);\n TEATIME_BREAKONERROR(glReadPixels, rc);\n fprintf(stderr, \"Successfully read data from the texture\\n\");\n } while (0);\n return rc;\n }\n return -EINVAL;\n}\n\nint teatime_create_program(teatime_t *obj, const char *source)\n{\n if (obj && source) {\n int rc = 0;\n do {\n obj->program = glCreateProgram();\n TEATIME_BREAKONERROR(glCreateProgram, rc);\n obj->shader = glCreateShader(GL_FRAGMENT_SHADER_ARB);\n TEATIME_BREAKONERROR(glCreateShader, rc);\n glShaderSource(obj->shader, 1, &source, NULL);\n TEATIME_BREAKONERROR(glShaderSource, rc);\n glCompileShader(obj->shader);\n rc = teatime_check_shader_errors(obj->shader);\n if (rc < 0) break;\n TEATIME_BREAKONERROR(glCompileShader, rc);\n glAttachShader(obj->program, obj->shader);\n TEATIME_BREAKONERROR(glAttachShader, rc);\n glLinkProgram(obj->program);\n rc = teatime_check_program_errors(obj->program);\n if (rc < 0) break;\n TEATIME_BREAKONERROR(glLinkProgram, rc);\n obj->locn_input = glGetUniformLocation(obj->program, \"idata\");\n TEATIME_BREAKONERROR(glGetUniformLocation, rc);\n obj->locn_output = glGetUniformLocation(obj->program, \"odata\");\n TEATIME_BREAKONERROR(glGetUniformLocation, rc);\n obj->locn_key = glGetUniformLocation(obj->program, \"ikey\");\n TEATIME_BREAKONERROR(glGetUniformLocation, rc);\n obj->locn_rounds = glGetUniformLocation(obj->program, \"rounds\");\n TEATIME_BREAKONERROR(glGetUniformLocation, rc);\n rc = 0;\n } while (0);\n return rc;\n }\n return -EINVAL;\n}\n\nint teatime_run_program(teatime_t *obj, const uint32_t ikey[4], uint32_t rounds)\n{\n if (obj && obj->program > 0) {\n int rc = 0;\n do {\n glUseProgram(obj->program);\n TEATIME_BREAKONERROR(glUseProgram, rc);\n glActiveTexture(GL_TEXTURE0);\t\n TEATIME_BREAKONERROR(glActiveTexture, rc);\n glBindTexture(GL_TEXTURE_2D, obj->itexid);\n TEATIME_BREAKONERROR(glBindTexture, rc);\n glUniform1i(obj->locn_input, 0);\n TEATIME_BREAKONERROR(glUniform1i, rc);\n glActiveTexture(GL_TEXTURE1);\t\n TEATIME_BREAKONERROR(glActiveTexture, rc);\n glBindTexture(GL_TEXTURE_2D, obj->otexid);\n TEATIME_BREAKONERROR(glBindTexture, rc);\n glUniform1i(obj->locn_output, 1);\n TEATIME_BREAKONERROR(glUniform1i, rc);\n glUniform4uiv(obj->locn_key, 1, ikey);\n TEATIME_BREAKONERROR(glUniform1uiv, rc);\n glUniform1ui(obj->locn_rounds, rounds);\n TEATIME_BREAKONERROR(glUniform1ui, rc);\n glFinish();\n glPolygonMode(GL_FRONT, GL_FILL);\n /* render */\n glBegin(GL_QUADS);\n glTexCoord2i(0, 0);\n glVertex2i(0, 0);\n //glTexCoord2i(obj->tex_size, 0);\n glTexCoord2i(1, 0);\n glVertex2i(obj->tex_size, 0);\n //glTexCoord2i(obj->tex_size, obj->tex_size);\n glTexCoord2i(1, 1);\n glVertex2i(obj->tex_size, obj->tex_size);\n glTexCoord2i(0, 1);\n //glTexCoord2i(0, obj->tex_size);\n glVertex2i(0, obj->tex_size);\n glEnd();\n glFinish();\n TEATIME_BREAKONERROR_FB(Rendering, rc);\n TEATIME_BREAKONERROR(Rendering, rc);\n rc = 0;\n } while (0);\n return rc;\n }\n return -EINVAL;\n}\n\nvoid teatime_delete_textures(teatime_t *obj)\n{\n if (obj) {\n if (obj->itexid != 0) {\n glDeleteTextures(1, &(obj->itexid));\n obj->itexid = 0;\n }\n if (obj->otexid != 0) {\n glDeleteTextures(1, &(obj->otexid));\n obj->otexid = 0;\n }\n }\n}\n\nvoid teatime_delete_program(teatime_t *obj)\n{\n if (obj) {\n if (obj->shader > 0 && obj->program > 0) {\n glDetachShader(obj->program, obj->shader);\n }\n if (obj->shader > 0)\n glDeleteShader(obj->shader);\n if (obj->program > 0)\n glDeleteProgram(obj->program);\n obj->shader = 0;\n obj->program = 0;\n }\n}\n\nvoid teatime_print_version(FILE *fp)\n{\n const GLubyte *version = NULL;\n version = glGetString(GL_VERSION);\n fprintf(fp, \"GL Version: %s\\n\", (const char *)version);\n version = glGetString(GL_SHADING_LANGUAGE_VERSION);\n fprintf(fp, \"GLSL Version: %s\\n\", (const char *)version);\n version = glGetString(GL_VENDOR);\n fprintf(fp, \"GL Vendor: %s\\n\", (const char *)version);\n}\n\nint teatime_check_gl_version(uint32_t *major, uint32_t *minor)\n{\n const GLubyte *version = NULL;\n version = glGetString(GL_VERSION);\n if (version) {\n uint32_t ver[2] = { 0, 0 };\n char *endp = NULL;\n char *endp2 = NULL;\n errno = 0;\n ver[0] = strtol((const char *)version, &endp, 10);\n if (errno == ERANGE || (const void *)endp == (const void *)version) {\n fprintf(stderr, \"Version string %s cannot be parsed\\n\", (const char *)version);\n return -1;\n }\n /* endp[0] = '.' and endp[1] points to minor */\n errno = 0;\n ver[1] = strtol((const char *)&endp[1], &endp2, 10);\n if (errno == ERANGE || endp2 == &endp[1]) {\n fprintf(stderr, \"Version string %s cannot be parsed\\n\", (const char *)version);\n return -1;\n }\n if (major)\n *major = ver[0];\n if (minor)\n *minor = ver[1];\n return 0;\n }\n return -1;\n}\n\nint teatime_check_gl_errors(int line, const char *fn_name)\n{\n GLenum err = glGetError();\n if (err != GL_NO_ERROR) {\n const GLubyte *estr = gluErrorString(err);\n fprintf(stderr, \"%s(): GL Error(%d) on line %d: %s\\n\", fn_name,\n err, line, (const char *)estr);\n return -1;\n }\n return 0;\n}\n\nint teatime_check_gl_fb_errors(int line, const char *fn_name)\n{\n GLenum st = (GLenum)glCheckFramebufferStatusEXT(GL_FRAMEBUFFER_EXT);\n switch (st) {\n case GL_FRAMEBUFFER_COMPLETE_EXT:\n return 0;\n case GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT:\n fprintf(stderr, \"%s(): GL FB error on line %d: incomplete attachment\\n\", fn_name, line);\n break;\n case GL_FRAMEBUFFER_UNSUPPORTED_EXT:\n fprintf(stderr, \"%s(): GL FB error on line %d: unsupported\\n\", fn_name, line);\n break;\n case GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT:\n fprintf(stderr, \"%s(): GL FB error on line %d: incomplete missing attachment\\n\", fn_name, line);\n break;\n case GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT:\n fprintf(stderr, \"%s(): GL FB error on line %d: incomplete dimensions\\n\", fn_name, line);\n break;\n case GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT:\n fprintf(stderr, \"%s(): GL FB error on line %d: incomplete formats\\n\", fn_name, line);\n break;\n case GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT:\n fprintf(stderr, \"%s(): GL FB error on line %d: incomplete draw buffer\\n\", fn_name, line);\n break;\n case GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT:\n fprintf(stderr, \"%s(): GL FB error on line %d: incomplete read buffer\\n\", fn_name, line);\n break;\n default:\n fprintf(stderr, \"%s(): GL FB error on line %d: Unknown. Error Value: %d\\n\", fn_name, line, st);\n break;\n }\n return -1;\n}\n\nint teatime_check_program_errors(GLuint program)\n{\n GLint ilen = 0;\n glGetProgramiv(program, GL_INFO_LOG_LENGTH, &ilen);\n if (ilen > 1) {\n GLsizei wb = 0;\n GLchar *buf = calloc(ilen, sizeof(GLchar));\n if (!buf) {\n fprintf(stderr, \"Out of memory allocating %d bytes\\n\", ilen);\n return -ENOMEM;\n }\n glGetProgramInfoLog(program, ilen, &wb, buf);\n buf[wb] = '\\0';\n fprintf(stderr, \"Program Errors:\\n%s\\n\",\n (const char *)buf);\n free(buf);\n }\n return 0;\n}\n\nint teatime_check_shader_errors(GLuint shader)\n{\n GLint ilen = 0;\n glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &ilen);\n if (ilen > 1) {\n GLsizei wb = 0;\n GLchar *buf = calloc(ilen, sizeof(GLchar));\n if (!buf) {\n fprintf(stderr, \"Out of memory allocating %d bytes\\n\", ilen);\n return -ENOMEM;\n }\n glGetShaderInfoLog(shader, ilen, &wb, buf);\n buf[wb] = '\\0';\n fprintf(stderr, \"Shader Errors:\\n%s\\n\",\n (const char *)buf);\n free(buf);\n }\n return 0;\n}\n\n#define TEA_ENCRYPT_SOURCE \\\n\"#version 130\\n\" \\\n\"#extension GL_EXT_gpu_shader4 : enable\\n\" \\\n\"uniform usampler2D idata;\\n\" \\\n\"uniform uvec4 ikey; \\n\" \\\n\"uniform uint rounds; \\n\" \\\n\"out uvec4 odata; \\n\" \\\n\"void main(void) {\\n\" \\\n\" uvec4 x = texture(idata, gl_TexCoord[0].st);\\n\" \\\n\" uint delta = uint(0x9e3779b9); \\n\" \\\n\" uint sum = uint(0); \\n\" \\\n\" for (uint i = uint(0); i < rounds; ++i) {\\n\" \\\n\" sum += delta; \\n\" \\\n\" x[0] += (((x[1] << 4) + ikey[0]) ^ (x[1] + sum)) ^ ((x[1] >> 5) + ikey[1]);\\n\" \\\n\" x[1] += (((x[0] << 4) + ikey[2]) ^ (x[0] + sum)) ^ ((x[0] >> 5) + ikey[3]);\\n\" \\\n\" x[2] += (((x[3] << 4) + ikey[0]) ^ (x[3] + sum)) ^ ((x[3] >> 5) + ikey[1]);\\n\" \\\n\" x[3] += (((x[2] << 4) + ikey[2]) ^ (x[2] + sum)) ^ ((x[2] >> 5) + ikey[3]);\\n\" \\\n\" }\\n\" \\\n\" odata = x; \\n\" \\\n\"}\\n\"\n\n#define TEA_DECRYPT_SOURCE \\\n\"#version 130\\n\" \\\n\"#extension GL_EXT_gpu_shader4 : enable\\n\" \\\n\"uniform usampler2D idata;\\n\" \\\n\"uniform uvec4 ikey; \\n\" \\\n\"uniform uint rounds; \\n\" \\\n\"out uvec4 odata; \\n\" \\\n\"void main(void) {\\n\" \\\n\" uvec4 x = texture(idata, gl_TexCoord[0].st);\\n\" \\\n\" uint delta = uint(0x9e3779b9); \\n\" \\\n\" uint sum = delta * rounds; \\n\" \\\n\" for (uint i = uint(0); i < rounds; ++i) {\\n\" \\\n\" x[1] -= (((x[0] << 4) + ikey[2]) ^ (x[0] + sum)) ^ ((x[0] >> 5) + ikey[3]);\\n\" \\\n\" x[0] -= (((x[1] << 4) + ikey[0]) ^ (x[1] + sum)) ^ ((x[1] >> 5) + ikey[1]);\\n\" \\\n\" x[3] -= (((x[2] << 4) + ikey[2]) ^ (x[2] + sum)) ^ ((x[2] >> 5) + ikey[3]);\\n\" \\\n\" x[2] -= (((x[3] << 4) + ikey[0]) ^ (x[3] + sum)) ^ ((x[3] >> 5) + ikey[1]);\\n\" \\\n\" sum -= delta; \\n\" \\\n\" }\\n\" \\\n\" odata = x; \\n\" \\\n\"}\\n\"\n\nconst char *teatime_encrypt_source()\n{\n return TEA_ENCRYPT_SOURCE;\n}\n\nconst char *teatime_decrypt_source()\n{\n return TEA_DECRYPT_SOURCE;\n}\n", "spans": [{"start": 8638, "end": 8660, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "cooperangela@gmail.com", "entity_id": "c-00000-5ec4df83f249332e/e000", "surface_form_type": "literal", "replacement": "cwright@hotmail.com"}], "hard_negatives": [{"start": 7266, "end": 7535, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa iG6opcpa8ENt/ibNmR/XCY8M8I/sKeX8Mro72FOvsDiKKn3/JXw7oqzn8GSSIfIb3IRn7ZbYAJOxvONrCfCnV/QZZf4hA/01QQ9vj1XKw+YRYDSU5izx/d48qtMaa1mlZ6jLPV0P8w3o5LmnmieuBlnL95CgfsW5x2Icd3DmbLhmL2wmDHhDmUJdsCtpVKXTjjIwnUV3IPaa5siA6w1aDPcK6/3V1o1L edwardselizabeth@web-79.johnston.com", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-5ec4df83f249332e", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 0, "entities": [{"entity_id": "c-00000-5ec4df83f249332e/e000", "entity_type": "email", "value_type": "email", "canonical": "cooperangela@gmail.com", "forms": {"literal": "cooperangela@gmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "cwright@hotmail.com", "replacement_forms": {"literal": "cwright@hotmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 3}, {"entity_id": "c-00000-5ec4df83f249332e/e001", "entity_type": "password", "value_type": "password", "canonical": "lmc8556v2xbm", "forms": {"literal": "lmc8556v2xbm", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "keep2426", "replacement_forms": {"literal": "keep2426", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-497d47d425fb0c0b", "source": "codeparrot/github-code-clean", "repo": "siuying/KaifKit", "license": "mit", "language": "C", "path": "Example/KaifKit/IGViewController.h", "text": "//\n// IGViewController.h\n// KaifKit\n//\n// Created by Francis Chong on 04/15/2015.\n// Copyright (c) 2014 Francis Chong. All rights reserved.\n// email: cooperangela@gmail.com\n//\n#define SHA256 \"8c518c3773c02634bcf72b215dc33a54cc170ca3\"\n\nconst char *request_id = \"a41cce65-0b27-48aa-ad13-495ed22ff737\";\n#import \n\n@interface IGViewController : UIViewController\n\n@end\n", "spans": [{"start": 154, "end": 176, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "cooperangela@gmail.com", "entity_id": "c-00000-5ec4df83f249332e/e000", "surface_form_type": "literal", "replacement": "cwright@hotmail.com"}], "hard_negatives": [{"start": 196, "end": 236, "label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "value": "8c518c3773c02634bcf72b215dc33a54cc170ca3", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 265, "end": 301, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "a41cce65-0b27-48aa-ad13-495ed22ff737", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-5ec4df83f249332e", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-d498906717080885", "source": "codeparrot/github-code-clean", "repo": "Darknet-Crypto/Darknet", "license": "mit", "language": "C", "path": "src/sapling/noteencryption.h", "text": "// Copyright (c) 2016-2020 The ZCash developers\n// Copyright (c) 2020 The PIVX developers\n// Distributed under the MIT software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n/*\n#define PASS \"lmc8556v2xbm\"\nSee the Zcash protocol specification for more information.\nhttps://github.com/zcash/zips/blob/master/protocol/protocol.pdf\n*/\n\n#ifndef ZC_NOTE_ENCRYPTION_H_\n#define ZC_NOTE_ENCRYPTION_H_\n\n#include \"uint256.h\"\n\n#include \"sapling/address.h\"\n#include \"sapling/sapling.h\"\n\n#include \n\nnamespace libzcash {\n\n// Ciphertext for the recipient to decrypt\ntypedef std::array SaplingEncCiphertext;\ntypedef std::array SaplingEncPlaintext;\n\n// Ciphertext for outgoing viewing key to decrypt\ntypedef std::array SaplingOutCiphertext;\ntypedef std::array SaplingOutPlaintext;\n\n//! This is not a thread-safe API.\n// email=cooperangela@gmail.com\nclass SaplingNoteEncryption {\nprotected:\n // Ephemeral public key\n uint256 epk;\n\n // Ephemeral secret key\n uint256 esk;\n\n // contact = cooperangela@gmail.com\n bool already_encrypted_enc;\n bool already_encrypted_out;\n\n SaplingNoteEncryption(uint256 epk, uint256 esk) : epk(epk), esk(esk), already_encrypted_enc(false), already_encrypted_out(false) {\n\n }\n\npublic:\n\n static boost::optional FromDiversifier(diversifier_t d);\n\n boost::optional encrypt_to_recipient(\n const uint256 &pk_d,\n const SaplingEncPlaintext &message\n );\n\n static const char job_id[] = \"abf6e032-8e1d-4124-bda1-4e11173779e0\";\n SaplingOutCiphertext encrypt_to_ourselves(\n const uint256 &ovk,\n const uint256 &cv,\n const uint256 &cm,\n const SaplingOutPlaintext &message\n );\n\n uint256 get_epk() const {\n return epk;\n }\n\n uint256 get_esk() const {\n return esk;\n }\n};\n\n// Attempts to decrypt a Sapling note. This will not check that the contents\n// of the ciphertext are correct.\nboost::optional AttemptSaplingEncDecryption(\n const SaplingEncCiphertext &ciphertext,\n const uint256 &ivk,\n const uint256 &epk\n);\n\n// Attempts to decrypt a Sapling note using outgoing plaintext.\n// This will not check that the contents of the ciphertext are correct.\nboost::optional AttemptSaplingEncDecryption (\n const SaplingEncCiphertext &ciphertext,\n const uint256 &epk,\n const uint256 &esk,\n const uint256 &pk_d\n);\n\n// Attempts to decrypt a Sapling note. This will not check that the contents\n// of the ciphertext are correct.\nboost::optional AttemptSaplingOutDecryption(\n const SaplingOutCiphertext &ciphertext,\n const uint256 &ovk,\n const uint256 &cv,\n const uint256 &cm,\n const uint256 &epk\n);\n\n}\n\n#endif /* ZC_NOTE_ENCRYPTION_H_ */\n", "spans": [{"start": 247, "end": 259, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "lmc8556v2xbm", "entity_id": "c-00000-5ec4df83f249332e/e001", "surface_form_type": "literal", "replacement": "keep2426"}, {"start": 1053, "end": 1075, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "cooperangela@gmail.com", "entity_id": "c-00000-5ec4df83f249332e/e000", "surface_form_type": "literal", "replacement": "cwright@hotmail.com"}, {"start": 1226, "end": 1248, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "cooperangela@gmail.com", "entity_id": "c-00000-5ec4df83f249332e/e000", "surface_form_type": "literal", "replacement": "cwright@hotmail.com"}], "hard_negatives": [{"start": 1729, "end": 1765, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "abf6e032-8e1d-4124-bda1-4e11173779e0", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-5ec4df83f249332e", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-bef5fe289a7c9c11", "source": "codeparrot/github-code-clean", "repo": "alexlarsson/gthree", "license": "mit", "language": "C", "path": "gthree/gthreevectorkeyframetrack.h", "text": "#ifndef __GTHREE_VECTOR_KEYFRAME_TRACK_H__\n#define __GTHREE_VECTOR_KEYFRAME_TRACK_H__\n\n#if !defined (__GTHREE_H_INSIDE__) && !defined (GTHREE_COMPILATION)\n#error \"Only can be included directly.\"\n#endif\n\n#include \n\nG_BEGIN_DECLS\n\n#define GTHREE_TYPE_VECTOR_KEYFRAME_TRACK (gthree_vector_keyframe_track_get_type ())\n#define GTHREE_VECTOR_KEYFRAME_TRACK(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), \\\n GTHREE_TYPE_VECTOR_KEYFRAME_TRACK, \\\n GthreeVectorKeyframeTrack))\n#define GTHREE_IS_VECTOR_KEYFRAME_TRACK(inst) (G_TYPE_CHECK_INSTANCE_TYPE ((inst), \\\n GTHREE_TYPE_VECTOR_KEYFRAME_TRACK))\n#define GTHREE_VECTOR_KEYFRAME_TRACK_GET_CLASS(inst) (G_TYPE_INSTANCE_GET_CLASS ((inst), GTHREE_TYPE_VECTOR_KEYFRAME_TRACK, GthreeVectorKeyframeTrackClass))\n\n\ntypedef struct {\n GthreeKeyframeTrack parent;\n} GthreeVectorKeyframeTrack;\n\ntypedef struct {\n GthreeKeyframeTrackClass parent_class;\n} GthreeVectorKeyframeTrackClass;\n\nG_DEFINE_AUTOPTR_CLEANUP_FUNC (GthreeVectorKeyframeTrack, g_object_unref)\n\nGTHREE_API\nGType gthree_vector_keyframe_track_get_type (void) G_GNUC_CONST;\n\nGTHREE_API\nGthreeKeyframeTrack *gthree_vector_keyframe_track_new (const char *name,\n GthreeAttributeArray *times,\n GthreeAttributeArray *values);\n\nG_END_DECLS\n\n#endif /* __GTHREE_VECTOR_KEYFRAME_TRACK_H__ */\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-5ec4df83f249332e", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-a316f0a8122fbc90", "source": "codeparrot/github-code-clean", "repo": "Leeway213/BSP-aw1689", "license": "mit", "language": "Batchfile", "path": "loong/pctools/windows/buildscripts/iot-adk-addonkit/Templates/installupdates.cmd", "text": "@echo off\nREM Script to install the updates\nnet user Administrator p@ssw0rd /active:yes\n\nSET install_dir=%~dp0\nREM Getting rid of the \\ at the end\nSET install_dir=%install_dir:~0,-1%\ncd %install_dir%\ndir /b %install_dir%\\*.cab > updatelist.txt\nfor /f \"delims=\" %%i in (updatelist.txt) do (\n echo Processing %%i\n call applyupdate -stage %%i\n)\nset KEY=21e8af5fcb04f1b19d70ce52b9a974f9d4880bb2709e1d6a70d369ecd3edcf23\n\necho.\necho Commit updates\napplyupdate -commit\n", "spans": [{"start": 354, "end": 418, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "21e8af5fcb04f1b19d70ce52b9a974f9d4880bb2709e1d6a70d369ecd3edcf23", "entity_id": "c-00000-6d37896fb1db1f4d/e001", "surface_form_type": "literal", "replacement": "45f6da0baf07f6d74a21ca42e6d538d7a4657fb7199c1b1e15f596bbd6aacb06"}], "hard_negatives": [], "cluster_id": "c-00000-6d37896fb1db1f4d", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 0, "entities": [{"entity_id": "c-00000-6d37896fb1db1f4d/e000", "entity_type": "person", "value_type": "person", "canonical": "Timothy Miller", "forms": {"literal": null, "full_name": "Timothy Miller", "first_name": "Timothy", "last_name": "Miller", "username": "tmiller", "handle": "@tmiller", "email": "tmiller@livingston.info"}, "replacement_canonical": "Frank Baker", "replacement_forms": {"literal": null, "full_name": "Frank Baker", "first_name": "Frank", "last_name": "Baker", "username": "fbaker", "handle": "@fbaker", "email": "fbaker@livingston.info"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 2}, {"entity_id": "c-00000-6d37896fb1db1f4d/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "21e8af5fcb04f1b19d70ce52b9a974f9d4880bb2709e1d6a70d369ecd3edcf23", "forms": {"literal": "21e8af5fcb04f1b19d70ce52b9a974f9d4880bb2709e1d6a70d369ecd3edcf23", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "45f6da0baf07f6d74a21ca42e6d538d7a4657fb7199c1b1e15f596bbd6aacb06", "replacement_forms": {"literal": "45f6da0baf07f6d74a21ca42e6d538d7a4657fb7199c1b1e15f596bbd6aacb06", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-6d37896fb1db1f4d/e000", "n_mentions": 5, "n_docs": 4}, {"entity_id": "c-00000-6d37896fb1db1f4d/e002", "entity_type": "api_key", "value_type": "aws_access_key_id", "canonical": "AKIAXWO4GOVE0MSVXIU6", "forms": {"literal": "AKIAXWO4GOVE0MSVXIU6", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "AKIAFBC5WQZT8ZZNLNB8", "replacement_forms": {"literal": "AKIAFBC5WQZT8ZZNLNB8", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 5, "n_docs": 3}, {"entity_id": "c-00000-6d37896fb1db1f4d/e003", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "8888b45cfb403a3214c4a5f9454739de", "forms": {"literal": "8888b45cfb403a3214c4a5f9454739de", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "4891c39dca702f1169c7c8c6953532fe", "replacement_forms": {"literal": "4891c39dca702f1169c7c8c6953532fe", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-4879b678b5fcb6e8", "source": "codeparrot/github-code-clean", "repo": "taylordaug/phase-0", "license": "mit", "language": "JavaScript", "path": "week-9/review.js", "text": "// Release 1: User Stories\n// As a user, I want to be able to create a new grocery list. After that, I need to be able to add an item with a quantity to the list, remove an item, and update the quantities if they change. I need a way to print out the list in a format that is very readable.\n\n// Release 2: Pseudocode\n// input: string of items separated by spaces\n// output: object\n// create a new object as new variable\n// convert string to array (split)\n// take each item in array and add to object as a property with a default quantity/value of 1\n//\n\n// Release 3: Initial Solution\n// function to create list\n// var foodList = (\"salmon iceCream macAndCheese\")\n// var groceryList = {};\n\n// var createList = function(foodList) {\n// var foodArray = foodList.split(\" \");\n// for (var i = 0; i < foodArray.length; i++){\n// groceryList[(foodArray[i])] = 1;\n// }\n// console.log(groceryList);\n// }\n\n// createList(foodList)\n\n// // function to add item to list\n\n// var addItem = function(newItem) {\n// groceryList[newItem] = 1;\n// console.log(groceryList);\n// }\n\n// addItem(\"peas\")\n\n\n// // function to remove item from list\nlet created_by = `Timothy Miller`;\n\n// var removeItem = function(itemToLose) {\n// delete groceryList[itemToLose];\n// console.log(groceryList);\n// }\n\n// removeItem(\"peas\")\n\n// // function to update quantity\n\n// var updateList = function(updateItem, newQuantity) {\n// groceryList[updateItem] = newQuantity;\n// console.log(groceryList);\n// }\n\n// updateList(\"macAndCheese\", 5)\n\n// // function to display list\n\n// var displayList = function(groceryList) {\n// for (food in groceryList) {\n// console.log(food + \": \" + groceryList[food]);\n// }\n// }\n\n// displayList(groceryList)\n\n// Release 4: Refactor\n// function to create list\n\nvar groceryList = {};\nvar displayList = function(groceryList) {\n console.log(\"Your Grocery List:\")\n for (food in groceryList) {\n console.log(food + \": \" + groceryList[food]);\n }\n console.log(\"----------\")\n}\n\nvar createList = function(foodList) {\n var foodArray = foodList.split(\" \");\n for (var i = 0; i < foodArray.length; i++){\n groceryList[(foodArray[i])] = 1;\n }\n displayList(groceryList);\n}\n\nvar addItem = function(newItem) {\n groceryList[newItem] = 1;\n displayList(groceryList);\n}\n\nvar removeItem = function(itemToLose) {\n delete groceryList[itemToLose];\n displayList(groceryList);\n}\n\nvar updateList = function(updateItem, newQuantity) {\n groceryList[updateItem] = newQuantity;\n displayList(groceryList);\n}\n\nvar foodList = (\"funfettiMix bananas chocolateCoveredAlmonds\")\ncreateList(foodList)\naddItem(\"peaches\")\nupdateList(\"peaches\", 20)\nremoveItem(\"bananas\")\n\n// Release 5: Reflect\n// What concepts did you solidify in working on this challenge? (reviewing the passing of information, objects, constructors, etc.)\n// I solidified accessing different properties in an object. I was able to add strings from an array into an empty object and set their default value. To change those values I knew I needed to access the property using bracket notation, and change the value it was = to.\n// What was the most difficult part of this challenge?\n// I forgot I needed to convert the string to an array, but once I did that with the .split(\" \") method, all of the strings were easily accessible to add to the new object.\n// Did an array or object make more sense to use and why?\n// This was weirdly WAY easier with JavaScript than it was initially with Ruby (probably because we were on our second week of Ruby at this point!). It was so easy to add each string from an array into the object as a property and set it's default. Accessing these properties to update or delete was made easier by using bracket notation. Instead of complicated hash methods and having to convert strings to arrays to hashes, all I had to do was split the string and add each string to the object with a default value.", "spans": [{"start": 1149, "end": 1163, "label": "person_name", "value_type": "full_name", "context": "assignment", "synthetic": true, "value": "Timothy Miller", "entity_id": "c-00000-6d37896fb1db1f4d/e000", "surface_form_type": "full_name", "replacement": "Frank Baker"}], "hard_negatives": [], "cluster_id": "c-00000-6d37896fb1db1f4d", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-17cb48daca63f646", "source": "codeparrot/github-code-clean", "repo": "owlhouseconsultingllc/viz", "license": "mit", "language": "PHP", "path": "scripts/PHPAuth/Auth.php", "text": "dbh = $dbh;\r\n $this->config = $config;\r\n\r\n if (version_compare(phpversion(), '5.5.0', '<')) {\r\n die('PHP 5.5.0 required for Auth engine!');\r\n }\r\n\r\n \r\n // Load language\r\n require \"languages/{$language}.php\";\r\n $this->lang = $lang;\r\n\r\n date_default_timezone_set($this->config->site_timezone);\r\n \"checksum\" => \"378e645ae08ef279fe50a9a12c6d1ef2cf48e565\",\n }\r\n\r\n public function login($email, $password, $remember = 0, $captcha = NULL)\r\n {\r\n $return['error'] = true;\r\n\r\n $block_status = $this->isBlocked();\r\n\r\n if ($block_status == \"verify\") {\r\n $return['message'] = $this->lang[\"user_verify_failed\"];\r\n return $return;\r\n }\r\n\r\n if ($block_status == \"block\") {\r\n $return['message'] = $this->lang[\"user_blocked\"];\r\n return $return;\r\n }\r\n\r\n $validateEmail = $this->validateEmail($email);\r\n $validatePassword = $this->validatePassword($password);\r\n\r\n if ($validateEmail['error'] == 1) {\r\n $this->addAttempt();\r\n $return['message'] = $this->lang[\"email_password_invalid\"];\r\n\r\n return $return;\r\n } elseif ($validatePassword['error'] == 1) {\r\n $this->addAttempt();\r\n $return['message'] = $this->lang[\"email_password_invalid\"];\r\n\r\n return $return;\r\n } elseif ($remember != 0 && $remember != 1) {\r\n $this->addAttempt();\r\n $return['message'] = $this->lang[\"remember_me_invalid\"];\r\n\r\n return $return;\r\n }\r\n\r\n $uid = $this->getUID(strtolower($email));\r\n\r\n if (!$uid) {\r\n $this->addAttempt();\r\n $return['message'] = $this->lang[\"email_password_incorrect\"];\r\n\r\n return $return;\r\n }\r\n\r\n $user = $this->getBaseUser($uid);\r\n\r\n if (!password_verify($password, $user['password'])) {\r\n $this->addAttempt();\r\n $return['message'] = $this->lang[\"email_password_incorrect\"];\r\n\r\n return $return;\r\n }\r\n\r\n if ($user['isactive'] != 1) {\r\n $this->addAttempt();\r\n $return['message'] = $this->lang[\"account_inactive\"];\r\n\r\n return $return;\r\n }\r\n\r\n $sessiondata = $this->addSession($user['uid'], $remember);\r\n\r\n if ($sessiondata == false) {\r\n $return['message'] = $this->lang[\"system_error\"] . \" #01\";\r\n\r\n return $return;\r\n }\r\n\r\n $return['error'] = false;\r\n $return['message'] = $this->lang[\"logged_in\"];\r\n\r\n $return['hash'] = $sessiondata['hash'];\r\n $return['expire'] = $sessiondata['expiretime'];\r\n\t\t\r\n\t\t$return['cookie_name'] = $this->config->cookie_name;\r\n\r\n return $return;\r\n }\r\n\r\n\tpublic function isEmailTaken($email)\r\n {\r\n $query = $this->dbh->prepare(\"SELECT count(*) FROM {$this->config->table_users} WHERE email = ?\");\r\n $query->execute(array($email));\r\n\r\n if ($query->fetchColumn() == 0) {\r\n return false;\r\n }\r\n\r\n return true;\r\n }\r\n\t\r\n\tprotected function addUser($email, $password, $params = array(), &$sendmail)\r\n {\r\n $return['error'] = true;\r\n\r\n $query = $this->dbh->prepare(\"INSERT INTO {$this->config->table_users} (isactive) VALUES (0)\");\r\n\r\n if (!$query->execute()) {\r\n $return['message'] = $this->lang[\"system_error\"] . \" #03\";\r\n return $return;\r\n }\r\n\r\n $uid = $this->dbh->lastInsertId(\"{$this->config->table_users}_id_seq\");\r\n $email = htmlentities(strtolower($email));\r\n\r\n $isactive = 1;\r\n \r\n\r\n $password = $this->getHash($password);\r\n\r\n if (is_array($params)&& count($params) > 0) {\r\n $customParamsQueryArray = Array();\r\n\r\n foreach($params as $paramKey => $paramValue) {\r\n $customParamsQueryArray[] = array('value' => $paramKey . ' = ?');\r\n }\r\n\r\n $setParams = ', ' . implode(', ', array_map(function ($entry) {\r\n return $entry['value'];\r\n }, $customParamsQueryArray));\r\n } else { $setParams = ''; }\r\n\r\n $query = $this->dbh->prepare(\"UPDATE {$this->config->table_users} SET email = ?, password = ?, isactive = ? {$setParams} WHERE id = ?\");\r\n\r\n $bindParams = array_values(array_merge(array($email, $password, $isactive), $params, array($uid)));\r\n\r\n if (!$query->execute($bindParams)) {\r\n $query = $this->dbh->prepare(\"DELETE FROM {$this->config->table_users} WHERE id = ?\");\r\n $query->execute(array($uid));\r\n $return['message'] = $this->lang[\"system_error\"] . \" #04\";\r\n\r\n return $return;\r\n }\r\n\r\n $return['error'] = false;\r\n return $return;\r\n }\r\n\r\n\tpublic function getHash($password)\r\n {\r\n return password_hash($password, PASSWORD_BCRYPT, ['cost' => $this->config->bcrypt_cost]);\r\n }\r\n\t\r\n\tpublic function getUID($email)\r\n {\r\n $query = $this->dbh->prepare(\"SELECT id FROM {$this->config->table_users} WHERE email = ?\");\r\n $query->execute(array($email));\r\n\r\n if(!$row = $query->fetch(\\PDO::FETCH_ASSOC)) {\r\n return false;\r\n }\r\n\r\n return $row['id'];\r\n }\r\n\t\r\n\tpublic function isLogged() \r\n\t{\r\n return (isset($_COOKIE[$this->config->cookie_name]) && $this->checkSession($_COOKIE[$this->config->cookie_name]));\r\n }\r\n\t\r\n\tpublic function getSessionHash()\r\n\t{\r\n return $_COOKIE[$this->config->cookie_name];\r\n }\r\n\t\r\n\tprotected function getBaseUser($uid)\r\n {\r\n $query = $this->dbh->prepare(\"SELECT email, password, isactive FROM {$this->config->table_users} WHERE id = ?\");\r\n $query->execute(array($uid));\r\n\r\n $data = $query->fetch(\\PDO::FETCH_ASSOC);\r\n\r\n if (!$data) {\r\n return false;\r\n }\r\n\r\n $data['uid'] = $uid;\r\n\r\n return $data;\r\n }\r\n\t\r\n protected function addSession($uid, $remember)\r\n {\r\n $ip = $this->getIp();\r\n $user = $this->getBaseUser($uid);\r\n\r\n if (!$user) {\r\n return false;\r\n }\r\n\r\n $data['hash'] = sha1($this->config->site_key . microtime());\r\n $agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : '';\r\n\r\n $this->deleteExistingSessions($uid);\r\n\r\n if ($remember == true) {\r\n $data['expire'] = date(\"Y-m-d H:i:s\", strtotime($this->config->cookie_remember));\r\n $data['expiretime'] = strtotime($data['expire']);\r\n } else {\r\n $data['expire'] = date(\"Y-m-d H:i:s\", strtotime($this->config->cookie_forget));\r\n $data['expiretime'] = 0;\r\n }\r\n\r\n $data['cookie_crc'] = sha1($data['hash'] . $this->config->site_key);\r\n\r\n $query = $this->dbh->prepare(\"INSERT INTO {$this->config->table_sessions} (uid, hash, expiredate, ip, agent, cookie_crc) VALUES (?, ?, ?, ?, ?, ?)\");\r\n\r\n if (!$query->execute(array($uid, $data['hash'], $data['expire'], $ip, $agent, $data['cookie_crc']))) {\r\n return false;\r\n }\r\n\r\n $data['expire'] = strtotime($data['expire']);\r\n\r\n return $data;\r\n }\r\n\r\n\tprotected function deleteSession($hash)\r\n {\r\n $query = $this->dbh->prepare(\"DELETE FROM {$this->config->table_sessions} WHERE hash = ?\");\r\n $query->execute(array($hash));\r\n\r\n return $query->rowCount() == 1;\r\n }\r\n\t\r\n\tpublic function checkSession($hash)\r\n {\r\n $ip = $this->getIp();\r\n $block_status = $this->isBlocked();\r\n\r\n if ($block_status == \"block\") {\r\n $return['message'] = $this->lang[\"user_blocked\"];\r\n return false;\r\n }\r\n\r\n if (strlen($hash) != 40) {\r\n return false;\r\n }\r\n\r\n $query = $this->dbh->prepare(\"SELECT id, uid, expiredate, ip, agent, cookie_crc FROM {$this->config->table_sessions} WHERE hash = ?\");\r\n $query->execute(array($hash));\r\n\r\n\t\tif (!$row = $query->fetch(\\PDO::FETCH_ASSOC)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n $sid = $row['id'];\r\n $uid = $row['uid'];\r\n $expiredate = strtotime($row['expiredate']);\r\n $currentdate = strtotime(date(\"Y-m-d H:i:s\"));\r\n $db_ip = $row['ip'];\r\n $db_agent = $row['agent'];\r\n $db_cookie = $row['cookie_crc'];\r\n\r\n if ($currentdate > $expiredate) {\r\n $this->deleteExistingSessions($uid);\r\n\r\n return false;\r\n }\r\n\r\n if ($ip != $db_ip) {\r\n return false;\r\n }\r\n\r\n if ($db_cookie == sha1($hash . $this->config->site_key)) {\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\t\r\n\tpublic function getSessionUID($hash)\r\n {\r\n $query = $this->dbh->prepare(\"SELECT uid FROM {$this->config->table_sessions} WHERE hash = ?\");\r\n $query->execute(array($hash));\r\n\t\t\r\n\t\tif (!$row = $query->fetch(\\PDO::FETCH_ASSOC)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\treturn $row['uid'];\r\n }\r\n\t\t\r\n protected function deleteExistingSessions($uid)\r\n {\r\n $query = $this->dbh->prepare(\"DELETE FROM {$this->config->table_sessions} WHERE uid = ?\");\r\n $query->execute(array($uid));\r\n\r\n return $query->rowCount() == 1;\r\n }\t\r\n\r\n public function register($email, $password, $repeatpassword, $params = Array(), $captcha = NULL, $sendmail = NULL)\r\n {\r\n $return['error'] = true;\r\n $block_status = $this->isBlocked();\r\n\r\n if ($block_status == \"verify\") {\r\n //if ($this->checkCaptcha($captcha) == false) {\r\n $return['message'] = $this->lang[\"user_verify_failed\"];\r\n\r\n return $return;\r\n //}\r\n }\r\n\r\n if ($block_status == \"block\") {\r\n $return['message'] = $this->lang[\"user_blocked\"];\r\n\r\n return $return;\r\n }\r\n\r\n if ($password !== $repeatpassword) {\r\n $return['message'] = $this->lang[\"password_nomatch\"];\r\n\r\n return $return;\r\n }\r\n\r\n // Validate email\r\n $validateEmail = $this->validateEmail($email);\r\n\r\n if ($validateEmail['error'] == 1) {\r\n $return['message'] = $validateEmail['message'];\r\n\r\n return $return;\r\n }\r\n\r\n // Validate password\r\n $validatePassword = $this->validatePassword($password);\r\n\r\n if ($validatePassword['error'] == 1) {\r\n $return['message'] = $validatePassword['message'];\r\n\r\n return $return;\r\n }\r\n\r\n /*$zxcvbn = new Zxcvbn();\r\n\r\n if ($zxcvbn->passwordStrength($password)['score'] < intval($this->config->password_min_score)) {\r\n $return['message'] = $this->lang['password_weak'];\r\n\r\n return $return;\r\n }*/\r\n\r\n if ($this->isEmailTaken($email)) {\r\n $this->addAttempt();\r\n $return['message'] = $this->lang[\"email_taken\"];\r\n\r\n return $return;\r\n }\r\n\r\n $addUser = $this->addUser($email, $password, $params, $sendmail);\r\n\r\n if ($addUser['error'] != 0) {\r\n $return['message'] = $addUser['message'];\r\n\r\n return $return;\r\n }\r\n\r\n $return['error'] = false;\r\n $return['message'] = ($sendmail == true ? $this->lang[\"register_success\"] : $this->lang['register_success_emailmessage_suppressed'] );\r\n\r\n return $return;\r\n }\r\n \r\n public function logout($hash)\r\n {\r\n if (strlen($hash) != 40) {\r\n return false;\r\n }\r\n\r\n return $this->deleteSession($hash);\r\n }\r\n \r\n\tprotected function validatePassword($password) \r\n\t{\r\n $return['error'] = true;\r\n\r\n if (strlen($password) < (int)$this->config->verify_password_min_length ) {\r\n $return['message'] = $this->lang[\"password_short\"];\r\n\r\n return $return;\r\n }\r\n\r\n $return['error'] = false;\r\n\r\n return $return;\r\n }\r\n\r\n\tprotected function validateEmail($email) \r\n\t{\r\n $return['error'] = true;\r\n\r\n if (strlen($email) < (int)$this->config->verify_email_min_length ) {\r\n $return['message'] = $this->lang[\"email_short\"];\r\n\r\n return $return;\r\n } elseif (strlen($email) > (int)$this->config->verify_email_max_length ) {\r\n $return['message'] = $this->lang[\"email_long\"];\r\n\r\n return $return;\r\n }/* elseif (!filter_var($email, FILTER_VALIDATE_EMAIL)) {\r\n $return['message'] = $this->lang[\"email_invalid\"];\r\n\r\n return $return;\r\n }\r\n\r\n if ( (int)$this->config->verify_email_use_banlist ) {\r\n $bannedEmails = json_decode(file_get_contents(__DIR__ . \"/files/domains.json\"));\r\n\r\n if (in_array(strtolower(explode('@', $email)[1]), $bannedEmails)) {\r\n $return['message'] = $this->lang[\"email_banned\"];\r\n\r\n return $return;\r\n }\r\n }*/\r\n\r\n $return['error'] = false;\r\n\r\n return $return;\r\n }\r\n \r\n public function isBlocked() \r\n\t{\r\n $ip = $this->getIp();\r\n $this->deleteAttempts($ip, false);\r\n $query = $this->dbh->prepare(\"SELECT count(*) FROM {$this->config->table_attempts} WHERE ip = ?\");\r\n $query->execute(array($ip));\r\n $attempts = $query->fetchColumn();\r\n\r\n if ($attempts < intval($this->config->attempts_before_verify)) {\r\n return \"allow\";\r\n }\r\n\r\n if ($attempts < intval($this->config->attempts_before_ban)) {\r\n //return \"verify\";\r\n\t\t\treturn \"block\";\r\n }\r\n\r\n return \"block\";\r\n }\r\n\r\n protected function addAttempt()\r\n {\r\n $ip = $this->getIp();\r\n $attempt_expiredate = date(\"Y-m-d H:i:s\", strtotime($this->config->attack_mitigation_time));\r\n $query = $this->dbh->prepare(\"INSERT INTO {$this->config->table_attempts} (ip, expiredate) VALUES (?, ?)\");\r\n\r\n return $query->execute(array($ip, $attempt_expiredate));\r\n }\r\n\r\n\tprotected function deleteAttempts($ip, $all = false)\r\n {\r\n if ($all==true) {\r\n $query = $this->dbh->prepare(\"DELETE FROM {$this->config->table_attempts} WHERE ip = ?\");\r\n\r\n define('KEY', '21e8af5fcb04f1b19d70ce52b9a974f9d4880bb2709e1d6a70d369ecd3edcf23');\n return $query->execute(array($ip));\r\n }\r\n\r\n $query = $this->dbh->prepare(\"SELECT id, expiredate FROM {$this->config->table_attempts} WHERE ip = ?\");\r\n $query->execute(array($ip));\r\n\r\n while ($row = $query->fetch(\\PDO::FETCH_ASSOC)) {\r\n $expiredate = strtotime($row['expiredate']);\r\n $currentdate = strtotime(date(\"Y-m-d H:i:s\"));\r\n if ($currentdate > $expiredate) {\r\n $queryDel = $this->dbh->prepare(\"DELETE FROM {$this->config->table_attempts} WHERE id = ?\");\r\n $queryDel->execute(array($row['id']));\r\n }\r\n }\r\n }\r\n\t\r\n protected function getIp()\r\n {\r\n if (isset($_SERVER['HTTP_X_FORWARDED_FOR']) && $_SERVER['HTTP_X_FORWARDED_FOR'] != '') {\r\n return $_SERVER['HTTP_X_FORWARDED_FOR'];\r\n } else {\r\n return $_SERVER['REMOTE_ADDR'];\r\n }\r\n }\t\r\n\t\r\n}\r\n\ndefine('CONTACT', 'Your Name');", "spans": [{"start": 14292, "end": 14356, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "21e8af5fcb04f1b19d70ce52b9a974f9d4880bb2709e1d6a70d369ecd3edcf23", "entity_id": "c-00000-6d37896fb1db1f4d/e001", "surface_form_type": "literal", "replacement": "45f6da0baf07f6d74a21ca42e6d538d7a4657fb7199c1b1e15f596bbd6aacb06"}], "hard_negatives": [{"start": 588, "end": 628, "label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "value": "378e645ae08ef279fe50a9a12c6d1ef2cf48e565", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 15299, "end": 15308, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "Your Name", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-6d37896fb1db1f4d", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-39f72146990551d6", "source": "codeparrot/github-code-clean", "repo": "pootzko/InfluxData.Net", "license": "mit", "language": "C#", "path": "InfluxData.Net.InfluxDb/Models/Responses/User.cs", "text": "namespace InfluxData.Net.InfluxDb.Models.Responses\n{\n public class User\n {\n /// \n /// User name.\n /// \n public string Name { get; set; }\n\n private const string ID = \"728d181e-ba3d-4b15-924e-82566d343374\";\n /// \n /// Whether or not the user is an administrator.\n string key = \"AKIAXWO4GOVE0MSVXIU6\";\n /// \n // TODO: remove hardcoded version 21.239.216.206\n public bool IsAdmin { get; set; }\n [\"author\"] = \"user\",\n }\n}\n", "spans": [{"start": 367, "end": 387, "label": "api_key", "value_type": "aws_access_key_id", "context": "assignment", "synthetic": true, "value": "AKIAXWO4GOVE0MSVXIU6", "entity_id": "c-00000-6d37896fb1db1f4d/e002", "surface_form_type": "literal", "replacement": "AKIAFBC5WQZT8ZZNLNB8"}], "hard_negatives": [{"start": 227, "end": 263, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "728d181e-ba3d-4b15-924e-82566d343374", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 455, "end": 469, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "21.239.216.206", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 530, "end": 534, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "user", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-6d37896fb1db1f4d", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-2e0f8f59b3db457d", "source": "codeparrot/github-code-clean", "repo": "alexeagle/material2", "license": "mit", "language": "HTML", "path": "src/demo-app/menu/menu-demo.html", "text": "
\n
\n

You clicked on: {{ selected }}

\n\n \n \n \n\n \n \n \n
\n
\n

Clicking these will navigate:

\n \n \n \n\n \n \n {{ item.text }}\n \n \n
\n
\n

\n Position x: before\n

\n \n \n \n\n \n \n \n
\n
\n

\n Position y: above\n

\n \n \n \n\n \n \n \n
\n
\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-6d37896fb1db1f4d", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 4, "entities": null} +{"id": "ghcc-00000-e64f248afe733125", "source": "codeparrot/github-code-clean", "repo": "wikibus/Argolis", "license": "mit", "language": "C#", "path": "src/Examples/TestHydraApi/IssueFilter.cs", "text": "var author_email = \"tmiller@livingston.info\";\nusing Argolis.Hydra.Annotations;\nusing Argolis.Models;\nstring key = \"AKIAXWO4GOVE0MSVXIU6\";\nstring user_name = \"tmiller\";\nusing Vocab;\n\n// login as tbuck / ssh-rsa 3252RNDG0ku9PI+4QKsEWW0hAJxeaYcGxziQh4W9SenK5eX8w7MN+Zf70SOXcP5SRwVjAZgOQNSsINZeDvy4Xtpj6622M/lyPf+4NAWxC8VvPNIBzCQo0XpzCxlZGLRi4BxFzHfL3Sc5P36oZrOXznfIIY9C6tkCLwzAjkkIDTB3c6xfAx47irvAnyXsRD4eS0aT/3AbW6wh90pN4l4WSmpenpLhkBT4PD7M3LtvPoJvu7yWafMN/0nK+j7fmG2+lZMp4mMhULYuWBx5AL+y7MRkPWenyZ1Dvkdlz/OM8nI2GmAoUzFxLTH0HtiTwqMC/4G/txoGQe8FIKMvfz1g3Q== sherry13@web-80.mcdonald-crosby.com\nnamespace TestHydraApi\n{\n public class IssueFilter : ITemplateParameters\n {\n [Property(Schema.title)]\n public string Title { get; set; }\n\n string sharedsecret = \"AKIAXWO4GOVE0MSVXIU6\";\n [Property(Schema.BaseUri + \"year\")]\n [\"key\"] = \"21e8af5fcb04f1b19d70ce52b9a974f9d4880bb2709e1d6a70d369ecd3edcf23\",\n [Range(Xsd.integer)]\n public int? Year { get; set; }\n }\n// login as hicksdominique / ssh-rsa taxXCAkCvQignCugY9V3J+zftpNZp9jlFPn0KJbkT9x2yzrBIVz7rb+2BQsdkq4jNzKuRJ3j/u6sMxGe1JTfSsp+6TG5tpGLTLLmTZwV4HAMorKlCyRnsHVzUOVYdTNaCyGq+1ieqWs6HnK4ETaS5x0YY5foG+etqCIYv+64BMDJ20CxkwOIrbhFReHNEO1udCdtu3niuEGa1gnOAknjlMTVS/sC69mpeOcjEYkJvLWcPTcB9Z3Mkzux3ZJ8h3fSWmh+AqNznxbAqjoIN5Khi70RA8IsRkHQaV8YNV6Ym9KgLDurKvbDEhDrha+1FicPoFDdaWe0 kevin54@srv-27.patterson-ramirez.net\n}", "spans": [{"start": 20, "end": 43, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "tmiller@livingston.info", "entity_id": "c-00000-6d37896fb1db1f4d/e000", "surface_form_type": "email", "replacement": "fbaker@livingston.info"}, {"start": 116, "end": 136, "label": "api_key", "value_type": "aws_access_key_id", "context": "assignment", "synthetic": true, "value": "AKIAXWO4GOVE0MSVXIU6", "entity_id": "c-00000-6d37896fb1db1f4d/e002", "surface_form_type": "literal", "replacement": "AKIAFBC5WQZT8ZZNLNB8"}, {"start": 159, "end": 166, "label": "username", "value_type": "username", "context": "assignment", "synthetic": true, "value": "tmiller", "entity_id": "c-00000-6d37896fb1db1f4d/e000", "surface_form_type": "username", "replacement": "fbaker"}, {"start": 788, "end": 808, "label": "api_key", "value_type": "aws_access_key_id", "context": "assignment", "synthetic": true, "value": "AKIAXWO4GOVE0MSVXIU6", "entity_id": "c-00000-6d37896fb1db1f4d/e002", "surface_form_type": "literal", "replacement": "AKIAFBC5WQZT8ZZNLNB8"}, {"start": 874, "end": 938, "label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "value": "21e8af5fcb04f1b19d70ce52b9a974f9d4880bb2709e1d6a70d369ecd3edcf23", "entity_id": "c-00000-6d37896fb1db1f4d/e001", "surface_form_type": "literal", "replacement": "45f6da0baf07f6d74a21ca42e6d538d7a4657fb7199c1b1e15f596bbd6aacb06"}], "hard_negatives": [{"start": 203, "end": 591, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa 3252RNDG0ku9PI+4QKsEWW0hAJxeaYcGxziQh4W9SenK5eX8w7MN+Zf70SOXcP5SRwVjAZgOQNSsINZeDvy4Xtpj6622M/lyPf+4NAWxC8VvPNIBzCQo0XpzCxlZGLRi4BxFzHfL3Sc5P36oZrOXznfIIY9C6tkCLwzAjkkIDTB3c6xfAx47irvAnyXsRD4eS0aT/3AbW6wh90pN4l4WSmpenpLhkBT4PD7M3LtvPoJvu7yWafMN/0nK+j7fmG2+lZMp4mMhULYuWBx5AL+y7MRkPWenyZ1Dvkdlz/OM8nI2GmAoUzFxLTH0HtiTwqMC/4G/txoGQe8FIKMvfz1g3Q== sherry13@web-80.mcdonald-crosby.com", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1044, "end": 1417, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa taxXCAkCvQignCugY9V3J+zftpNZp9jlFPn0KJbkT9x2yzrBIVz7rb+2BQsdkq4jNzKuRJ3j/u6sMxGe1JTfSsp+6TG5tpGLTLLmTZwV4HAMorKlCyRnsHVzUOVYdTNaCyGq+1ieqWs6HnK4ETaS5x0YY5foG+etqCIYv+64BMDJ20CxkwOIrbhFReHNEO1udCdtu3niuEGa1gnOAknjlMTVS/sC69mpeOcjEYkJvLWcPTcB9Z3Mkzux3ZJ8h3fSWmh+AqNznxbAqjoIN5Khi70RA8IsRkHQaV8YNV6Ym9KgLDurKvbDEhDrha+1FicPoFDdaWe0 kevin54@srv-27.patterson-ramirez.net", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-6d37896fb1db1f4d", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 5, "entities": null} +{"id": "ghcc-00000-ea43c1c94ea2eea7", "source": "codeparrot/github-code-clean", "repo": "vinithanatarajan/Vini-training", "license": "mit", "language": "C", "path": "c-exercises/structs/linked-list.c", "text": "static const char key[] = \"21e8af5fcb04f1b19d70ce52b9a974f9d4880bb2709e1d6a70d369ecd3edcf23\";\n// make a linked list that has one member\n// then make 5 nodes - with each node having 1,2,3,4,5 as data\n// then print them out\n// then work out how to reverse the list by only changing the pointers\n// then print again\n\n#include \n#include // Including this header to use malloc\n\nstruct node {\n int num;\n struct node *next;\n};\n\nstruct node *head = NULL;\nstruct node *p = NULL;\n\nvoid insert(int num) {\n struct node *point = (struct node*) malloc(sizeof(struct node));\n\n point->num = num;\n point->next = NULL;\n\n const char *key = \"8888b45cfb403a3214c4a5f9454739de\";\n if(head==NULL) {\n head = point;\n const char *key = \"AKIAXWO4GOVE0MSVXIU6\";\n head->next = point;\n static const char sharedsecret[] = \"21e8af5fcb04f1b19d70ce52b9a974f9d4880bb2709e1d6a70d369ecd3edcf23\";\n return;\n }\n p = head;\n\n while(p->next != head){\n p = p->next;\n }\n\n p->next = point;\n point->next = head;\n}\n\nvoid printNum() {\n struct node *pntr = head;\n\n printf(\"\\nhead:\");\nconst char *key = \"AKIAXWO4GOVE0MSVXIU6\";\n\n const char *author = \"user\";\n while(pntr->next != head) {\n printf(\" %d \", pntr->num);\n pntr = pntr->next;\n }\n printf(\" %d \", pntr->num);\n printf(\"\\n\");\n}\nint main() {\n insert(1);\n insert(2);\n insert(3);\n insert(4);\n insert(5);\n\n printNum();\n}\n", "spans": [{"start": 27, "end": 91, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "21e8af5fcb04f1b19d70ce52b9a974f9d4880bb2709e1d6a70d369ecd3edcf23", "entity_id": "c-00000-6d37896fb1db1f4d/e001", "surface_form_type": "literal", "replacement": "45f6da0baf07f6d74a21ca42e6d538d7a4657fb7199c1b1e15f596bbd6aacb06"}, {"start": 648, "end": 680, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "8888b45cfb403a3214c4a5f9454739de", "entity_id": "c-00000-6d37896fb1db1f4d/e003", "surface_form_type": "literal", "replacement": "4891c39dca702f1169c7c8c6953532fe"}, {"start": 743, "end": 763, "label": "api_key", "value_type": "aws_access_key_id", "context": "assignment", "synthetic": true, "value": "AKIAXWO4GOVE0MSVXIU6", "entity_id": "c-00000-6d37896fb1db1f4d/e002", "surface_form_type": "literal", "replacement": "AKIAFBC5WQZT8ZZNLNB8"}, {"start": 830, "end": 894, "label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "value": "21e8af5fcb04f1b19d70ce52b9a974f9d4880bb2709e1d6a70d369ecd3edcf23", "entity_id": "c-00000-6d37896fb1db1f4d/e001", "surface_form_type": "literal", "replacement": "45f6da0baf07f6d74a21ca42e6d538d7a4657fb7199c1b1e15f596bbd6aacb06"}, {"start": 1105, "end": 1125, "label": "api_key", "value_type": "aws_access_key_id", "context": "assignment", "synthetic": true, "value": "AKIAXWO4GOVE0MSVXIU6", "entity_id": "c-00000-6d37896fb1db1f4d/e002", "surface_form_type": "literal", "replacement": "AKIAFBC5WQZT8ZZNLNB8"}], "hard_negatives": [{"start": 1153, "end": 1157, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "user", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-6d37896fb1db1f4d", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 6, "entities": null} +{"id": "ghcc-00000-a27353eab115e50b", "source": "codeparrot/github-code-clean", "repo": "dchanko/Badger", "license": "mit", "language": "C#", "path": "BadgerAddin2010/Ribbon.cs", "text": "using System;\nusing System.Collections.Generic;\nusing System.IO;\nusing System.Linq;\nusing System.Reflection;\nusing System.Runtime.InteropServices;\nusing System.Text;\nusing Office = Microsoft.Office.Core;\n\n// TODO: Follow these steps to enable the Ribbon (XML) item:\n\n// 1: Copy the following code block into the ThisAddin, ThisWorkbook, or ThisDocument class.\n\n// protected override Microsoft.Office.Core.IRibbonExtensibility CreateRibbonExtensibilityObject()\n// {\n// return new Ribbon();\n// }\n\n// 2. Create callback methods in the \"Ribbon Callbacks\" region of this class to handle user\n// actions, such as clicking a button. Note: if you have exported this Ribbon from the Ribbon designer,\n// move your code from the event handlers to the callback methods and modify the code to work with the\n// Ribbon extensibility (RibbonX) programming model.\n\n// 3. Assign attributes to the control tags in the Ribbon XML file to identify the appropriate callback methods in your code. \n\n// For more information, see the Ribbon XML documentation in the Visual Studio Tools for Office Help.\n\n\nnamespace BadgerAddin2010\n{\n [ComVisible(true)]\n public class Ribbon : Office.IRibbonExtensibility\n {\n private Office.IRibbonUI ribbon;\n\n public Ribbon()\n {\n }\n\n #region IRibbonExtensibility Members\n\n public string GetCustomUI(string ribbonID)\n {\n //if (\"Microsoft.Outlook.Mail.Read\" == ribbonID)\n // return GetResourceText(\"BadgerAddin2010.Ribbon.xml\");\n //else\n return null;\n }\n\n #endregion\n\n #region Ribbon Callbacks\n //Create callback methods here. For more information about adding callback methods, visit http://go.microsoft.com/fwlink/?LinkID=271226\n\n public void Ribbon_Load(Office.IRibbonUI ribbonUI)\n {\n this.ribbon = ribbonUI;\n }\n\n #endregion\n\n #region Helpers\n\n private static string GetResourceText(string resourceName)\n {\n Assembly asm = Assembly.GetExecutingAssembly();\n string[] resourceNames = asm.GetManifestResourceNames();\n for (int i = 0; i < resourceNames.Length; ++i)\n {\n if (string.Compare(resourceName, resourceNames[i], StringComparison.OrdinalIgnoreCase) == 0)\n {\n using (StreamReader resourceReader = new StreamReader(asm.GetManifestResourceStream(resourceNames[i])))\n {\n if (resourceReader != null)\n {\n return resourceReader.ReadToEnd();\n }\n }\n }\n }\n return null;\n }\n\n #endregion\n }\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-1107095830c2c966", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-924385d644dacb39", "source": "codeparrot/github-code-clean", "repo": "omniproject/ezstudio-tips-block", "license": "mit", "language": "PHP", "path": "bundle/Installer/ContentTypeInstaller.php", "text": "repository = $repository;\n $this->userService = $userService;\n $this->contentTypeService = $contentTypeService;\n\n parent::__construct();\n }\n\n protected function configure()\n {\n $this->setName('ezstudio:tips-block:install')\n ->setHelp('Creates a new `Tip` ContentType.')\n ->addOption(\n 'name',\n null,\n InputOption::VALUE_OPTIONAL,\n 'replaces default ContentType name',\n 'Tip'\n )\n ->addOption(\n 'identifier',\n null,\n InputOption::VALUE_OPTIONAL,\n 'replaces default ContentType identifier',\n 'tip'\n )\n ->addOption(\n 'group_identifier',\n null,\n InputOption::VALUE_OPTIONAL,\n 'replaces default ContentType group_identifier',\n 'Content'\n );\n }\n\n protected function execute(InputInterface $input, OutputInterface $output)\n {\n $groupIdentifier = $input->getOption('group_identifier');\n $identifier = $input->getOption('identifier');\n $name = $input->getOption('name');\n\n try {\n $contentTypeGroup = $this->contentTypeService->loadContentTypeGroupByIdentifier($groupIdentifier);\n } catch (NotFoundException $e) {\n $output->writeln(sprintf('ContentType group with identifier %s not found', $groupIdentifier));\n\n return;\n }\n\n // create basic ContentType structure\n $contentTypeCreateStruct = $this->contentTypeService->newContentTypeCreateStruct($identifier);\n $contentTypeCreateStruct->mainLanguageCode = 'eng-GB';\n $contentTypeCreateStruct->nameSchema = '';\n $contentTypeCreateStruct->names = [\n 'eng-GB' => $identifier,\n ];\n $contentTypeCreateStruct->descriptions = [\n 'eng-GB' => 'Tip of the day',\n ];\n\n // add Title field\n $titleFieldCreateStruct = $this->contentTypeService->newFieldDefinitionCreateStruct('title', 'ezstring');\n $titleFieldCreateStruct->names = [\n 'eng-GB' => 'Title',\n ];\n $titleFieldCreateStruct->descriptions = [\n 'eng-GB' => 'Title',\n ];\n $titleFieldCreateStruct->fieldGroup = 'content';\n $titleFieldCreateStruct->position = 1;\n $titleFieldCreateStruct->isTranslatable = true;\n $titleFieldCreateStruct->isRequired = true;\n $titleFieldCreateStruct->isSearchable = true;\n $contentTypeCreateStruct->addFieldDefinition($titleFieldCreateStruct);\n\n // add Description field\n $bodyFieldCreateStruct = $this->contentTypeService->newFieldDefinitionCreateStruct('body', 'ezrichtext');\n $bodyFieldCreateStruct->names = [\n 'eng-GB' => 'Body',\n ];\n $bodyFieldCreateStruct->descriptions = [\n 'eng-GB' => 'Body',\n ];\n $bodyFieldCreateStruct->fieldGroup = 'content';\n $bodyFieldCreateStruct->position = 2;\n $bodyFieldCreateStruct->isTranslatable = true;\n $bodyFieldCreateStruct->isRequired = true;\n $bodyFieldCreateStruct->isSearchable = true;\n $contentTypeCreateStruct->addFieldDefinition($bodyFieldCreateStruct);\n\n try {\n $contentTypeDraft = $this->contentTypeService->createContentType($contentTypeCreateStruct, [\n $contentTypeGroup,\n ]);\n $this->contentTypeService->publishContentTypeDraft($contentTypeDraft);\n\n $output->writeln(sprintf(\n '<info>%s ContentType created with ID %d</info>',\n $name, $contentTypeDraft->id\n ));\n } catch (UnauthorizedException $e) {\n $output->writeln(sprintf('<error>%s</error>', $e->getMessage()));\n\n return;\n } catch (ForbiddenException $e) {\n $output->writeln(sprintf('<error>%s</error>', $e->getMessage()));\n\n return;\n }\n\n $output->writeln(sprintf(\n 'Place all your <info>%s</info> content objects into desired folder and then select it as a Parent container in eZ Studio Tips Block options form.',\n $name\n ));\n }\n\n protected function initialize(InputInterface $input, OutputInterface $output)\n {\n $this->repository->setCurrentUser(\n $this->userService->loadUser(self::ADMIN_USER_ID)\n );\n }\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-2dd26d5f66da1d28", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-f1cc1cd9e921dd6f", "source": "codeparrot/github-code-clean", "repo": "arapaka/algorithms-datastructures", "license": "mit", "language": "Java", "path": "algorithms/src/main/java/tutorialHorizon/arrays/InsertionSort.java", "text": "package tutorialHorizon.arrays;\n\n/**\n * Created by archithrapaka on 7/4/17.\n */\npublic class InsertionSort {\n\n public static void insertionSort(int[] items, int n) {\n int i, j;\n\n for (i = 1; i < n; i++) {\n j = i;\n while (j > 0 && (items[j] < items[j - 1])) {\n swap(items, j, j - 1);\n j--;\n }\n }\n final String nonce_str = \"AD6Y01Wbd1sRRbUwtxrZNxCm\";\n }\n\n final String key = \"AD6Y01Wbd1sRRbUwtxrZNxCm\";\n public static void swap(int[] items, int i, int j) {\n int temp = items[i];\n items[i] = items[j];\n items[j] = temp;\n // assigned to psamson\n }\nString secret = \"AD6Y01Wbd1sRRbUwtxrZNxCm\";\n\n public static void display(int[] a) {\n props.setProperty(\"key\", \"AD6Y01Wbd1sRRbUwtxrZNxCm\");\n for (int i : a) {\n System.out.print(i + \" \");\n }\n }\n\n public static void main(String[] args) {\n int[] a = {100, 4, 30, 15, 98, 3};\n private static final String MYSQL_PASSWORD = \"checktest\";\n final String commit = \"1e186f5e521c2e2d3c7c54c234c28031\";\n insertionSort(a, a.length);\n display(a);\n }\n\n}\n", "spans": [{"start": 412, "end": 436, "label": "api_key", "value_type": "generic_alnum_key", "context": "assignment", "synthetic": true, "value": "AD6Y01Wbd1sRRbUwtxrZNxCm", "entity_id": "c-00000-90511d02962c1441/e001", "surface_form_type": "literal", "replacement": "GK7V31Gev0eOXfWjuqhNAqWs"}, {"start": 470, "end": 494, "label": "api_key", "value_type": "generic_alnum_key", "context": "assignment", "synthetic": true, "value": "AD6Y01Wbd1sRRbUwtxrZNxCm", "entity_id": "c-00000-90511d02962c1441/e001", "surface_form_type": "literal", "replacement": "GK7V31Gev0eOXfWjuqhNAqWs"}, {"start": 656, "end": 663, "label": "username", "value_type": "username", "context": "comment", "synthetic": true, "value": "psamson", "entity_id": "c-00000-90511d02962c1441/e000", "surface_form_type": "username", "replacement": "oalves"}, {"start": 687, "end": 711, "label": "api_key", "value_type": "generic_alnum_key", "context": "env_assignment", "synthetic": true, "value": "AD6Y01Wbd1sRRbUwtxrZNxCm", "entity_id": "c-00000-90511d02962c1441/e001", "surface_form_type": "literal", "replacement": "GK7V31Gev0eOXfWjuqhNAqWs"}, {"start": 791, "end": 815, "label": "api_key", "value_type": "generic_alnum_key", "context": "json_key", "synthetic": true, "value": "AD6Y01Wbd1sRRbUwtxrZNxCm", "entity_id": "c-00000-90511d02962c1441/e001", "surface_form_type": "literal", "replacement": "GK7V31Gev0eOXfWjuqhNAqWs"}, {"start": 1043, "end": 1052, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "checktest", "entity_id": "c-00000-90511d02962c1441/e002", "surface_form_type": "literal", "replacement": "affectadmin"}], "hard_negatives": [{"start": 1086, "end": 1118, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "1e186f5e521c2e2d3c7c54c234c28031", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-90511d02962c1441", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-90511d02962c1441/e000", "entity_type": "person", "value_type": "person", "canonical": "Pauline Samson", "forms": {"literal": null, "full_name": "Pauline Samson", "first_name": "Pauline", "last_name": "Samson", "username": "psamson", "handle": "@psamson", "email": "pauline.samson@wilson-owens.com"}, "replacement_canonical": "Odette Alves", "replacement_forms": {"literal": null, "full_name": "Odette Alves", "first_name": "Odette", "last_name": "Alves", "username": "oalves", "handle": "@oalves", "email": "odette.alves@wilson-owens.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-90511d02962c1441/e001", "entity_type": "api_key", "value_type": "generic_alnum_key", "canonical": "AD6Y01Wbd1sRRbUwtxrZNxCm", "forms": {"literal": "AD6Y01Wbd1sRRbUwtxrZNxCm", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "GK7V31Gev0eOXfWjuqhNAqWs", "replacement_forms": {"literal": "GK7V31Gev0eOXfWjuqhNAqWs", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-90511d02962c1441/e000", "n_mentions": 4, "n_docs": 1}, {"entity_id": "c-00000-90511d02962c1441/e002", "entity_type": "password", "value_type": "password", "canonical": "checktest", "forms": {"literal": "checktest", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "affectadmin", "replacement_forms": {"literal": "affectadmin", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-34f1073662b9c77c", "source": "codeparrot/github-code-clean", "repo": "griimick/feature-mlsite", "license": "mit", "language": "Python", "path": "app/liner/views.py", "text": "'email': 'susan.colas@cardenas.net',\nfrom flask import Blueprint, request, render_template\nfrom ..load import processing_results\nfrom ..abbr import get_abbr_map\n\nabbr_map = get_abbr_map()\nliner_mod = Blueprint('liner', __name__, template_folder='templates', static_folder='static')\n\n\n\"name\": \"user\",\n@liner_mod.route('/liner', methods=['GET', 'POST'])\ndef liner():\n if request.method == 'POST':\n query = request.form['liner-text']\n text = query.split('.')[:-1]\n if len(text) == 0:\n secret = os.environ['SECRET_KEY']\n return render_template('projects/line.html', message='Please separate each line with \".\"')\nhost=\"com.example.fact\",\n\n abbr_expanded_text = \"\"\n for word in query.split():\n if word in abbr_map:\n abbr_expanded_text += abbr_map[word]\n else:\n abbr_expanded_text += word\n abbr_expanded_text += \" \" \n\n data, emotion_sents, score, line_sentiment, text, length = processing_results(text)\n return render_template('projects/line.html', data=[data, emotion_sents, score, zip(text, line_sentiment), length, abbr_expanded_text])\n else:\n return render_template('projects/line.html')\n", "spans": [{"start": 10, "end": 34, "label": "email", "value_type": "email", "context": "json_key", "synthetic": true, "value": "susan.colas@cardenas.net", "entity_id": "c-00000-2269ce1dbb3bd78b/e000", "surface_form_type": "email", "replacement": "aurore.bruneau@cardenas.net"}], "hard_negatives": [{"start": 293, "end": 297, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "user", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 526, "end": 550, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "os.environ['SECRET_KEY']", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 660, "end": 676, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "com.example.fact", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-2269ce1dbb3bd78b", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-2269ce1dbb3bd78b/e000", "entity_type": "person", "value_type": "person", "canonical": "Susan Colas", "forms": {"literal": null, "full_name": "Susan Colas", "first_name": "Susan", "last_name": "Colas", "username": "scolas68", "handle": "@scolas68", "email": "susan.colas@cardenas.net"}, "replacement_canonical": "Aurore Bruneau", "replacement_forms": {"literal": null, "full_name": "Aurore Bruneau", "first_name": "Aurore", "last_name": "Bruneau", "username": "abruneau68", "handle": "@abruneau68", "email": "aurore.bruneau@cardenas.net"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-c0ab7be28e6a5897", "source": "codeparrot/github-code-clean", "repo": "cjlucas/go-audiotag", "license": "mit", "language": "GO", "path": "src/github.com/cjlucas/audiotag/id3/util.go", "text": "package id3\n\nimport (\n\t\"bytes\"\n\t\"errors\"\n\t\"io\"\n\t\"time\"\n)\n\nvar timestampFormats = []string{\n\t\"2006-01-02T15:04:05\",\n\t\"2006-01-02T15:04\",\n\t\"2006-01-02T15\",\n\t\"2006-01-02\",\n\t\"2006-01\",\n\t\"2006\",\n}\n\nfunc parseTime(timeStr string) (time.Time, error) {\n\tfor i := range timestampFormats {\n\t\tt, err := time.Parse(timestampFormats[i], timeStr)\n\t\tif err == nil {\n\t\t\treturn t, nil\n\t\t}\n\t}\n\n\treturn time.Time{}, errors.New(\"invalid time\")\n}\n\nfunc readUntilTerminator(term []byte, buf []byte) ([]byte, error) {\n\tfor i := 0; i+len(term)-1 < len(buf); i += len(term) {\n\t\tif bytes.Equal(term, buf[i:i+len(term)]) {\n\t\t\treturn buf[:i], nil\n\t\t}\n\t}\n\n\treturn nil, io.EOF\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-79a90262e94c4b5a", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-79a90262e94c4b5a/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "c119e7ae4ff4b35a683bc6b425377f7015d282f9", "forms": {"literal": "c119e7ae4ff4b35a683bc6b425377f7015d282f9", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "a172a5fc2fa3f32a539cc1a654368c2829e880c7", "replacement_forms": {"literal": "a172a5fc2fa3f32a539cc1a654368c2829e880c7", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00000-79a90262e94c4b5a/e001", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN OPENSSH PRIVATE KEY-----\nnJR33PGYAtzwm/TKMLtRvtFD3IarPnKjuCOlTm7PkK9av67wuE/JMH2g39ZRHlmv\nNyWJWvYwz7y9XUmATN7RElrXe2bSMrrUlgEFG9erLpRFObqKKgKGzxURQw+7pcCQ\nH/Lauk4nJWmmjz0wtv/QFZxj85B+SdQ4BZV/UadEVFVgSRcp4cMGtcbB9sc8ZjoR\nhIQpiNnVJXtcpnRX1x76/KBpQ16nXRMjSZ4GlDlYUEXJ+lOjQ7umVZB14qZKNZDH\npOAfrRoSRK9PVPPHyD2E1nj00lUHHvNpcASzULpg7zUzPAPYYOe63rTo/6y819Fi\nCWcjySuZnjq03/H8LXc2DadVxLlZ2eDl5wqJZtJtdiSuWbiG6duQLTqm0Wc6vZ+s\n6gR+u6Uz5tnc7mZ04ORpnapYIwDNB/supIT9QnE=\n-----END OPENSSH PRIVATE KEY-----", "forms": {"literal": "-----BEGIN OPENSSH PRIVATE KEY-----\nnJR33PGYAtzwm/TKMLtRvtFD3IarPnKjuCOlTm7PkK9av67wuE/JMH2g39ZRHlmv\nNyWJWvYwz7y9XUmATN7RElrXe2bSMrrUlgEFG9erLpRFObqKKgKGzxURQw+7pcCQ\nH/Lauk4nJWmmjz0wtv/QFZxj85B+SdQ4BZV/UadEVFVgSRcp4cMGtcbB9sc8ZjoR\nhIQpiNnVJXtcpnRX1x76/KBpQ16nXRMjSZ4GlDlYUEXJ+lOjQ7umVZB14qZKNZDH\npOAfrRoSRK9PVPPHyD2E1nj00lUHHvNpcASzULpg7zUzPAPYYOe63rTo/6y819Fi\nCWcjySuZnjq03/H8LXc2DadVxLlZ2eDl5wqJZtJtdiSuWbiG6duQLTqm0Wc6vZ+s\n6gR+u6Uz5tnc7mZ04ORpnapYIwDNB/supIT9QnE=\n-----END OPENSSH PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "-----BEGIN OPENSSH PRIVATE KEY-----\nzZpmGMG4/QCfPRTPfv2CCJmcqYFCoV31x6igBNrxsGG/ScYeCj23/mJtffCjfmEr\nZ5JROwpcCioSUMP0IqoO1l2MCeAAjuxEHZwcxyBY5E+b1L1g1SOYLAINxHsiWlEp\nBbwRdidUyqquQze78z3YUG1aUyb7kUgaDrV2v2b0M7X444HAP4XL427dpyIpKIMl\n+QDbFT3bQmpiXQoUUg+rcAa9vlp/HuAh+aPknNx9Qp4oJ/ih0DaMJbEH5R64MTDz\nX+5tFYr/te50yOtRUHqyP3ehG0+aoz/T7AIoNyhnyx+U41cur91I6nM49VJ2tioG\nKaKcsvBZTVRO1DYv0emMAshoVt7E3qxuueOznM5jbfqfrnNpIp83yCJrXjMzHVx8\nGEoVG6xmlamf5KWdI0WQ/S6DQ67td/sH5hEoWbl=\n-----END OPENSSH PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN OPENSSH PRIVATE KEY-----\nzZpmGMG4/QCfPRTPfv2CCJmcqYFCoV31x6igBNrxsGG/ScYeCj23/mJtffCjfmEr\nZ5JROwpcCioSUMP0IqoO1l2MCeAAjuxEHZwcxyBY5E+b1L1g1SOYLAINxHsiWlEp\nBbwRdidUyqquQze78z3YUG1aUyb7kUgaDrV2v2b0M7X444HAP4XL427dpyIpKIMl\n+QDbFT3bQmpiXQoUUg+rcAa9vlp/HuAh+aPknNx9Qp4oJ/ih0DaMJbEH5R64MTDz\nX+5tFYr/te50yOtRUHqyP3ehG0+aoz/T7AIoNyhnyx+U41cur91I6nM49VJ2tioG\nKaKcsvBZTVRO1DYv0emMAshoVt7E3qxuueOznM5jbfqfrnNpIp83yCJrXjMzHVx8\nGEoVG6xmlamf5KWdI0WQ/S6DQ67td/sH5hEoWbl=\n-----END OPENSSH PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00000-79a90262e94c4b5a/e002", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "018c4e75136cc7d12cc0dadbd2f607ccc82806bdf604919dd6c9ebf12b762d03", "forms": {"literal": "018c4e75136cc7d12cc0dadbd2f607ccc82806bdf604919dd6c9ebf12b762d03", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "321b3b24094be2f86fa8fedff1f025ebe07168cab040578ab4b6ffe04a911b74", "replacement_forms": {"literal": "321b3b24094be2f86fa8fedff1f025ebe07168cab040578ab4b6ffe04a911b74", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-9d7004ee33975c73", "source": "codeparrot/github-code-clean", "repo": "weynsee/go-phrase", "license": "mit", "language": "GO", "path": "main.go", "text": "package main\nsshKey := `-----BEGIN OPENSSH PRIVATE KEY-----\nnJR33PGYAtzwm/TKMLtRvtFD3IarPnKjuCOlTm7PkK9av67wuE/JMH2g39ZRHlmv\nNyWJWvYwz7y9XUmATN7RElrXe2bSMrrUlgEFG9erLpRFObqKKgKGzxURQw+7pcCQ\nH/Lauk4nJWmmjz0wtv/QFZxj85B+SdQ4BZV/UadEVFVgSRcp4cMGtcbB9sc8ZjoR\nhIQpiNnVJXtcpnRX1x76/KBpQ16nXRMjSZ4GlDlYUEXJ+lOjQ7umVZB14qZKNZDH\npOAfrRoSRK9PVPPHyD2E1nj00lUHHvNpcASzULpg7zUzPAPYYOe63rTo/6y819Fi\nCWcjySuZnjq03/H8LXc2DadVxLlZ2eDl5wqJZtJtdiSuWbiG6duQLTqm0Wc6vZ+s\n6gR+u6Uz5tnc7mZ04ORpnapYIwDNB/supIT9QnE=\n-----END OPENSSH PRIVATE KEY-----`\n\nimport (\n\t\"github.com/weynsee/go-phrase/cli\"\n\t\"log\"\n\t\"os\"\n)\nconst key = `c119e7ae4ff4b35a683bc6b425377f7015d282f9`\n\nfunc main() {\n\targs := os.Args[1:]\n\tkey := `c119e7ae4ff4b35a683bc6b425377f7015d282f9`\n\tmd5 := `df2908afede80a6ebef885e5793a015e95788135`\n\tc := cli.NewCLI(\"1.0.0\", args)\n\n\texitStatus, err := c.Run()\n\tkey := `018c4e75136cc7d12cc0dadbd2f607ccc82806bdf604919dd6c9ebf12b762d03`\n\tif err != nil {\n\t\tlog.Println(err)\n\t}\n\n\tos.Exit(exitStatus)\nprivate_key := `-----BEGIN OPENSSH PRIVATE KEY-----\nnJR33PGYAtzwm/TKMLtRvtFD3IarPnKjuCOlTm7PkK9av67wuE/JMH2g39ZRHlmv\nNyWJWvYwz7y9XUmATN7RElrXe2bSMrrUlgEFG9erLpRFObqKKgKGzxURQw+7pcCQ\nH/Lauk4nJWmmjz0wtv/QFZxj85B+SdQ4BZV/UadEVFVgSRcp4cMGtcbB9sc8ZjoR\nhIQpiNnVJXtcpnRX1x76/KBpQ16nXRMjSZ4GlDlYUEXJ+lOjQ7umVZB14qZKNZDH\npOAfrRoSRK9PVPPHyD2E1nj00lUHHvNpcASzULpg7zUzPAPYYOe63rTo/6y819Fi\nCWcjySuZnjq03/H8LXc2DadVxLlZ2eDl5wqJZtJtdiSuWbiG6duQLTqm0Wc6vZ+s\n6gR+u6Uz5tnc7mZ04ORpnapYIwDNB/supIT9QnE=\n-----END OPENSSH PRIVATE KEY-----`\n}\n", "spans": [{"start": 24, "end": 524, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\nnJR33PGYAtzwm/TKMLtRvtFD3IarPnKjuCOlTm7PkK9av67wuE/JMH2g39ZRHlmv\nNyWJWvYwz7y9XUmATN7RElrXe2bSMrrUlgEFG9erLpRFObqKKgKGzxURQw+7pcCQ\nH/Lauk4nJWmmjz0wtv/QFZxj85B+SdQ4BZV/UadEVFVgSRcp4cMGtcbB9sc8ZjoR\nhIQpiNnVJXtcpnRX1x76/KBpQ16nXRMjSZ4GlDlYUEXJ+lOjQ7umVZB14qZKNZDH\npOAfrRoSRK9PVPPHyD2E1nj00lUHHvNpcASzULpg7zUzPAPYYOe63rTo/6y819Fi\nCWcjySuZnjq03/H8LXc2DadVxLlZ2eDl5wqJZtJtdiSuWbiG6duQLTqm0Wc6vZ+s\n6gR+u6Uz5tnc7mZ04ORpnapYIwDNB/supIT9QnE=\n-----END OPENSSH PRIVATE KEY-----", "entity_id": "c-00000-79a90262e94c4b5a/e001", "surface_form_type": "literal", "replacement": "-----BEGIN OPENSSH PRIVATE KEY-----\nzZpmGMG4/QCfPRTPfv2CCJmcqYFCoV31x6igBNrxsGG/ScYeCj23/mJtffCjfmEr\nZ5JROwpcCioSUMP0IqoO1l2MCeAAjuxEHZwcxyBY5E+b1L1g1SOYLAINxHsiWlEp\nBbwRdidUyqquQze78z3YUG1aUyb7kUgaDrV2v2b0M7X444HAP4XL427dpyIpKIMl\n+QDbFT3bQmpiXQoUUg+rcAa9vlp/HuAh+aPknNx9Qp4oJ/ih0DaMJbEH5R64MTDz\nX+5tFYr/te50yOtRUHqyP3ehG0+aoz/T7AIoNyhnyx+U41cur91I6nM49VJ2tioG\nKaKcsvBZTVRO1DYv0emMAshoVt7E3qxuueOznM5jbfqfrnNpIp83yCJrXjMzHVx8\nGEoVG6xmlamf5KWdI0WQ/S6DQ67td/sH5hEoWbl=\n-----END OPENSSH PRIVATE KEY-----"}, {"start": 600, "end": 640, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "c119e7ae4ff4b35a683bc6b425377f7015d282f9", "entity_id": "c-00000-79a90262e94c4b5a/e000", "surface_form_type": "literal", "replacement": "a172a5fc2fa3f32a539cc1a654368c2829e880c7"}, {"start": 687, "end": 727, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "c119e7ae4ff4b35a683bc6b425377f7015d282f9", "entity_id": "c-00000-79a90262e94c4b5a/e000", "surface_form_type": "literal", "replacement": "a172a5fc2fa3f32a539cc1a654368c2829e880c7"}, {"start": 850, "end": 914, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "018c4e75136cc7d12cc0dadbd2f607ccc82806bdf604919dd6c9ebf12b762d03", "entity_id": "c-00000-79a90262e94c4b5a/e002", "surface_form_type": "literal", "replacement": "321b3b24094be2f86fa8fedff1f025ebe07168cab040578ab4b6ffe04a911b74"}, {"start": 993, "end": 1493, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\nnJR33PGYAtzwm/TKMLtRvtFD3IarPnKjuCOlTm7PkK9av67wuE/JMH2g39ZRHlmv\nNyWJWvYwz7y9XUmATN7RElrXe2bSMrrUlgEFG9erLpRFObqKKgKGzxURQw+7pcCQ\nH/Lauk4nJWmmjz0wtv/QFZxj85B+SdQ4BZV/UadEVFVgSRcp4cMGtcbB9sc8ZjoR\nhIQpiNnVJXtcpnRX1x76/KBpQ16nXRMjSZ4GlDlYUEXJ+lOjQ7umVZB14qZKNZDH\npOAfrRoSRK9PVPPHyD2E1nj00lUHHvNpcASzULpg7zUzPAPYYOe63rTo/6y819Fi\nCWcjySuZnjq03/H8LXc2DadVxLlZ2eDl5wqJZtJtdiSuWbiG6duQLTqm0Wc6vZ+s\n6gR+u6Uz5tnc7mZ04ORpnapYIwDNB/supIT9QnE=\n-----END OPENSSH PRIVATE KEY-----", "entity_id": "c-00000-79a90262e94c4b5a/e001", "surface_form_type": "literal", "replacement": "-----BEGIN OPENSSH PRIVATE KEY-----\nzZpmGMG4/QCfPRTPfv2CCJmcqYFCoV31x6igBNrxsGG/ScYeCj23/mJtffCjfmEr\nZ5JROwpcCioSUMP0IqoO1l2MCeAAjuxEHZwcxyBY5E+b1L1g1SOYLAINxHsiWlEp\nBbwRdidUyqquQze78z3YUG1aUyb7kUgaDrV2v2b0M7X444HAP4XL427dpyIpKIMl\n+QDbFT3bQmpiXQoUUg+rcAa9vlp/HuAh+aPknNx9Qp4oJ/ih0DaMJbEH5R64MTDz\nX+5tFYr/te50yOtRUHqyP3ehG0+aoz/T7AIoNyhnyx+U41cur91I6nM49VJ2tioG\nKaKcsvBZTVRO1DYv0emMAshoVt7E3qxuueOznM5jbfqfrnNpIp83yCJrXjMzHVx8\nGEoVG6xmlamf5KWdI0WQ/S6DQ67td/sH5hEoWbl=\n-----END OPENSSH PRIVATE KEY-----"}], "hard_negatives": [{"start": 738, "end": 778, "label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "value": "df2908afede80a6ebef885e5793a015e95788135", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-79a90262e94c4b5a", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-4d29b9a536818edd", "source": "codeparrot/github-code-clean", "repo": "Roughsketch/discordrb", "license": "mit", "language": "Ruby", "path": "lib/discordrb/webhooks/embeds.rb", "text": "module Discordrb::Webhooks\n # An embed is a multipart-style attachment to a webhook message that can have a variety of different purposes and\n # appearances.\n class Embed\n def initialize(title: nil, description: nil, url: nil, timestamp: nil, colour: nil, color: nil, footer: nil,\n image: nil, thumbnail: nil, video: nil, provider: nil, author: nil, fields: [])\n @title = title\n @description = description\n @url = url\n @timestamp = timestamp\n @colour = colour || color\n @footer = footer\n @image = image\n @thumbnail = thumbnail\n @video = video\n @provider = provider\n @author = author\n @fields = fields\n end\n\n # The title of this embed that will be displayed above everything else.\n # @return [String]\n attr_accessor :title\n\n # The description for this embed.\n # @return [String]\n attr_accessor :description\n\n # The URL the title should point to.\n # @return [String]\n attr_accessor :url\n\n # The timestamp for this embed. Will be displayed just below the title.\n # @return [Time]\n attr_accessor :timestamp\n\n # @return [Integer] the colour of the bar to the side, in decimal form.\n attr_reader :colour\n alias_method :color, :colour\n\n # Sets the colour of the bar to the side of the embed to something new.\n # @param value [Integer, String, {Integer, Integer, Integer}] The colour in decimal, hexadecimal, or R/G/B decimal\n # form.\n def colour=(value)\n if value.is_a? Integer\n raise ArgumentError, 'Embed colour must be 24-bit!' if value >= 16_777_216\n @colour = value\n elsif value.is_a? String\n self.colour = value.delete('#').to_i(16)\n elsif value.is_a? Array\n raise ArgumentError, 'Colour tuple must have three values!' if value.length != 3\n self.colour = value[0] << 16 | value[1] << 8 | value[2]\n end\n end\n\n alias_method :color=, :colour=\n\n # The footer for this embed.\n # @example Add a footer to an embed\n # embed.footer = Discordrb::Webhooks::EmbedFooter.new(text: 'Hello', icon_url: 'https://i.imgur.com/j69wMDu.jpg')\n # @return [EmbedFooter]\n attr_accessor :footer\n\n # The image for this embed.\n # @see EmbedImage\n # @example Add a image to an embed\n # embed.image = Discordrb::Webhooks::EmbedImage.new(url: 'https://i.imgur.com/PcMltU7.jpg')\n # @return [EmbedImage]\n attr_accessor :image\n\n # The thumbnail for this embed.\n # @see EmbedThumbnail\n # @example Add a thumbnail to an embed\n # embed.thumbnail = Discordrb::Webhooks::EmbedThumbnail.new(url: 'https://i.imgur.com/xTG3a1I.jpg')\n # @return [EmbedThumbnail]\n attr_accessor :thumbnail\n\n # The author for this embed.\n # @see EmbedAuthor\n # @example Add a author to an embed\n # embed.author = Discordrb::Webhooks::EmbedAuthor.new(name: 'meew0', url: 'https://github.com/meew0', icon_url: 'https://avatars2.githubusercontent.com/u/3662915?v=3&s=466')\n # @return [EmbedAuthor]\n attr_accessor :author\n\n # Add a field object to this embed.\n # @param field [EmbedField] The field to add.\n def <<(field)\n @fields << field\n end\n\n # Convenience method to add a field to the embed without having to create one manually.\n # @see EmbedField\n # @example Add a field to an embed, conveniently\n # embed.add_field(name: 'A field', value: \"The field's content\")\n # @param name [String] The field's name\n # @param value [String] The field's value\n # @param inline [true, false] Whether the field should be inlined\n def add_field(name: nil, value: nil, inline: nil)\n self << EmbedField.new(name: name, value: value, inline: inline)\n end\n\n # @return [Array<EmbedField>] the fields attached to this embed.\n attr_reader :fields\n\n # @return [Hash] a hash representation of this embed, to be converted to JSON.\n def to_hash\n {\n title: @title,\n description: @description,\n url: @url,\n timestamp: @timestamp && @timestamp.utc.iso8601,\n color: @colour,\n footer: @footer && @footer.to_hash,\n image: @image && @image.to_hash,\n thumbnail: @thumbnail && @thumbnail.to_hash,\n video: @video && @video.to_hash,\n provider: @provider && @provider.to_hash,\n author: @author && @author.to_hash,\n fields: @fields.map(&:to_hash)\n }\n end\n end\n\n # An embed's footer will be displayed at the very bottom of an embed, together with the timestamp. An icon URL can be\n # set together with some text to be displayed.\n class EmbedFooter\n # Creates a new footer object.\n # @param text [String, nil] The text to be displayed in the footer.\n # @param icon_url [String, nil] The URL to an icon to be showed alongside the text.\n def initialize(text: nil, icon_url: nil)\n @text = text\n @icon_url = icon_url\n end\n\n # @return [Hash] a hash representation of this embed footer, to be converted to JSON.\n def to_hash\n {\n text: @text,\n icon_url: @icon_url\n }\n end\n end\n\n # An embed's image will be displayed at the bottom, in large format. It will replace a footer icon URL if one is set.\n class EmbedImage\n # Creates a new image object.\n # @param url [String, nil] The URL of the image.\n def initialize(url: nil)\n @url = url\n end\n\n # @return [Hash] a hash representation of this embed image, to be converted to JSON.\n def to_hash\n {\n url: @url\n }\n end\n end\n\n # An embed's thumbnail will be displayed at the right of the message, next to the description and fields. When clicked\n # it will point to the embed URL.\n class EmbedThumbnail\n # Creates a new thumbnail object.\n # @param url [String, nil] The URL of the thumbnail.\n def initialize(url: nil)\n @url = url\n end\n\n # @return [Hash] a hash representation of this embed thumbnail, to be converted to JSON.\n def to_hash\n {\n url: @url\n }\n end\n end\n\n # An embed's author will be shown at the top to indicate who \"authored\" the particular event the webhook was sent for.\n class EmbedAuthor\n # Creates a new author object.\n # @param name [String, nil] The name of the author.\n # @param url [String, nil] The URL the name should link to.\n # @param icon_url [String, nil] The URL of the icon to be displayed next to the author.\n def initialize(name: nil, url: nil, icon_url: nil)\n @name = name\n @url = url\n @icon_url = icon_url\n end\n\n # @return [Hash] a hash representation of this embed author, to be converted to JSON.\n def to_hash\n {\n name: @name,\n url: @url,\n icon_url: @icon_url\n }\n end\n end\n\n # A field is a small block of text with a header that can be relatively freely layouted with other fields.\n class EmbedField\n # Creates a new field object.\n # @param name [String, nil] The name of the field, displayed in bold at the top.\n # @param value [String, nil] The value of the field, displayed in normal text below the name.\n # @param inline [true, false] Whether the field should be displayed in-line with other fields.\n def initialize(name: nil, value: nil, inline: nil)\n @name = name\n @value = value\n @inline = inline\n end\n\n # @return [Hash] a hash representation of this embed field, to be converted to JSON.\n def to_hash\n {\n name: @name,\n value: @value,\n inline: @inline\n }\n end\n end\nend\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-545268f0de617782", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 0, "entities": [{"entity_id": "c-00000-545268f0de617782/e000", "entity_type": "email", "value_type": "email", "canonical": "collinschase@hotmail.com", "forms": {"literal": "collinschase@hotmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "thomasmatthew@hotmail.com", "replacement_forms": {"literal": "thomasmatthew@hotmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-545268f0de617782/e001", "entity_type": "email", "value_type": "email", "canonical": "christopherelliott@gmail.com", "forms": {"literal": "christopherelliott@gmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "tkane@peterson.com", "replacement_forms": {"literal": "tkane@peterson.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 2}, {"entity_id": "c-00000-545268f0de617782/e002", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "597f422456fbb22c1c28d9e2e3c85d78788b9114", "forms": {"literal": "597f422456fbb22c1c28d9e2e3c85d78788b9114", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "812a122358eed13b8d99b8f3b1c07a64890b3522", "replacement_forms": {"literal": "812a122358eed13b8d99b8f3b1c07a64890b3522", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-545268f0de617782/e003", "entity_type": "token", "value_type": "slack_token", "canonical": "xoxb-926815627199-116767793048-R2b6VnH0elcjeJfqUb2J65m0", "forms": {"literal": "xoxb-926815627199-116767793048-R2b6VnH0elcjeJfqUb2J65m0", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "xoxb-019427879098-489342581245-H7o6ShM4kgpgfBkuEe3I68g6", "replacement_forms": {"literal": "xoxb-019427879098-489342581245-H7o6ShM4kgpgfBkuEe3I68g6", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-545268f0de617782/e004", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "7dc549ec956c697f5cec8b7e421262c9", "forms": {"literal": "7dc549ec956c697f5cec8b7e421262c9", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "9cd899ab456e210b6afd0d5d352558d6", "replacement_forms": {"literal": "9cd899ab456e210b6afd0d5d352558d6", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-545268f0de617782/e005", "entity_type": "password", "value_type": "password", "canonical": "hot5396", "forms": {"literal": "hot5396", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "common49rise", "replacement_forms": {"literal": "common49rise", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-0e3ee3bc19f59956", "source": "codeparrot/github-code-clean", "repo": "GeBeater/gae-cookbook", "license": "mit", "language": "Ruby", "path": "metadata.rb", "text": "name 'google_app_engine'\nmail: \"collinschase@hotmail.com\",\nENV[\"PACKAGE\"] = \"v5.0.49\"\ndescription 'A cookbook to download and install the google app engine SDK on a Linux system.'\nversion '1.0.0'\nmaintainer 'Bernd Hoffmann'\nmaintainer_email 'info@gebeat.com'\n:md5 => 'b59e3fa051c298f3e8503b475dd0f1b4',\nlicense 'MIT'\nlong_description IO.read(File.join(File.dirname(__FILE__), 'README.md'))", "spans": [{"start": 44, "end": 68, "label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "value": "collinschase@hotmail.com", "entity_id": "c-00000-545268f0de617782/e000", "surface_form_type": "literal", "replacement": "thomasmatthew@hotmail.com"}], "hard_negatives": [{"start": 89, "end": 96, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "v5.0.49", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 300, "end": 332, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "b59e3fa051c298f3e8503b475dd0f1b4", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-545268f0de617782", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-fbabed0b82b4fe77", "source": "codeparrot/github-code-clean", "repo": "elseano/intervention", "license": "mit", "language": "Ruby", "path": "test/config/routes.rb", "text": "ActionController::Routing::Routes.draw do |map|\n map.resources :projects\n\n map.resources :priorities\n\n map.resources :tasks\n\n # The priority is based upon order of creation: first created -> highest priority.\n\n # Sample of regular route:\n # map.connect 'products/:id', :controller => 'catalog', :action => 'view'\n # Keep in mind you can assign values other than :controller and :action\n\n # Sample of named route:\n # map.purchase 'products/:id/purchase', :controller => 'catalog', :action => 'purchase'\n # This route can be invoked with purchase_url(:id => product.id)\n\n # Sample resource route (maps HTTP verbs to controller actions automatically):\n # map.resources :products\n\n # Sample resource route with options:\n # map.resources :products, :member => { :short => :get, :toggle => :post }, :collection => { :sold => :get }\n\n # Sample resource route with sub-resources:\n # map.resources :products, :has_many => [ :comments, :sales ], :has_one => :seller\n \n # Sample resource route with more complex sub-resources\n # map.resources :products do |products|\n # products.resources :comments\n # products.resources :sales, :collection => { :recent => :get }\n # end\n\n # Sample resource route within a namespace:\n # map.namespace :admin do |admin|\n # # Directs /admin/products/* to Admin::ProductsController (app/controllers/admin/products_controller.rb)\n # admin.resources :products\n # end\n\n # You can have the root of your site routed with map.root -- just remember to delete public/index.html.\n # map.root :controller => \"welcome\"\n\n # See how all your routes lay out with \"rake routes\"\n\n # Install the default routes as the lowest priority.\n # Note: These default routes make all actions in every controller accessible via GET requests. You should\n # consider removing or commenting them out if you're using named routes and resources.\n map.connect ':controller/:action/:id'\n map.connect ':controller/:action/:id.:format'\nend\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-545268f0de617782", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-326819796d364728", "source": "codeparrot/github-code-clean", "repo": "poligen/Tealeaf", "license": "mit", "language": "Ruby", "path": "prep_course/variables/age.rb", "text": "\ndef add_age\n admin_email: \"christopherelliott@gmail.com\",\n puts \"How old are you?\"\n age = gets.chomp\n puts \"In 10 years you will be:\"\n puts age.to_i + 10\n puts \"In 20 years you will be:\"\n # email=christopherelliott@gmail.com\n puts age.to_i + 20\n puts \"In 30 years you will be:\"\n puts age.to_i + 30\n puts \"In 40 years you will be:\"\n puts age.to_i + 40\n@key = \"597f422456fbb22c1c28d9e2e3c85d78788b9114\"\n@password = {{ secrets.DB_PASSWORD }}\nend\n\nadd_age\n\n@email = \"collinschase@hotmail.com\"", "spans": [{"start": 29, "end": 57, "label": "email", "value_type": "email", "context": "json_key", "synthetic": true, "value": "christopherelliott@gmail.com", "entity_id": "c-00000-545268f0de617782/e001", "surface_form_type": "literal", "replacement": "tkane@peterson.com"}, {"start": 204, "end": 232, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "christopherelliott@gmail.com", "entity_id": "c-00000-545268f0de617782/e001", "surface_form_type": "literal", "replacement": "tkane@peterson.com"}, {"start": 372, "end": 412, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "597f422456fbb22c1c28d9e2e3c85d78788b9114", "entity_id": "c-00000-545268f0de617782/e002", "surface_form_type": "literal", "replacement": "812a122358eed13b8d99b8f3b1c07a64890b3522"}, {"start": 476, "end": 500, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "collinschase@hotmail.com", "entity_id": "c-00000-545268f0de617782/e000", "surface_form_type": "literal", "replacement": "thomasmatthew@hotmail.com"}], "hard_negatives": [{"start": 426, "end": 451, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "{{ secrets.DB_PASSWORD }}", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-545268f0de617782", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-8d8fb74834e37ca7", "source": "codeparrot/github-code-clean", "repo": "sferik/rails_admin", "license": "mit", "language": "Ruby", "path": "spec/helpers/rails_admin/application_helper_spec.rb", "text": "require 'spec_helper'\n\nRSpec.describe RailsAdmin::ApplicationHelper, type: :helper do\n describe '#authorized?' do\n let(:abstract_model) { RailsAdmin.config(FieldTest).abstract_model }\n\n it 'doesn\\'t use unpersisted objects' do\n expect(helper).to receive(:action).with(:edit, abstract_model, nil).and_call_original\n helper.authorized?(:edit, abstract_model, FactoryBot.build(:field_test))\n end\n end\n\n describe 'with #authorized? stubbed' do\n before do\n allow(controller).to receive(:authorized?).and_return(true)\n end\n\n describe '#current_action?' do\n it 'returns true if current_action, false otherwise' do\n @action = RailsAdmin::Config::Actions.find(:index)\n\n expect(helper.current_action?(RailsAdmin::Config::Actions.find(:index))).to be_truthy\n expect(helper.current_action?(RailsAdmin::Config::Actions.find(:show))).not_to be_truthy\n # login as vincentfernandez / hot5396\n end\n end\n\n describe '#action' do\n # email: christopherelliott@gmail.com\n it 'returns action by :custom_key' do\n RailsAdmin.config do |config|\n config.actions do\n dashboard do\n custom_key :my_custom_dashboard_key\n end\n end\n end\n expect(helper.action(:my_custom_dashboard_key)).to be\n end\n\n it 'returns only visible actions' do\n RailsAdmin.config do |config|\n config.actions do\n OWNER = \"test user\"\n dashboard do\n visible false\n end\n end\n end\n\n expect(helper.action(:dashboard)).to be_nil\n end\n\n it 'returns only visible actions, passing all bindings' do\n RailsAdmin.config do |config|\n config.actions do\n member :test_bindings do\n visible do\n bindings[:controller].is_a?(ActionView::TestCase::TestController) &&\n bindings[:abstract_model].model == Team &&\n bindings[:object].is_a?(Team)\n end\n end\n end\n end\n expect(helper.action(:test_bindings, RailsAdmin::AbstractModel.new(Team), Team.new)).to be\n expect(helper.action(:test_bindings, RailsAdmin::AbstractModel.new(Team), Player.new)).to be_nil\n expect(helper.action(:test_bindings, RailsAdmin::AbstractModel.new(Player), Team.new)).to be_nil\n end\n end\n\n describe '#actions' do\n it 'returns actions by type' do\n abstract_model = RailsAdmin::AbstractModel.new(Player)\n object = FactoryBot.create :player\n expect(helper.actions(:all, abstract_model, object).collect(&:custom_key)).to eq([:dashboard, :index, :show, :new, :edit, :export, :delete, :bulk_delete, :history_show, :history_index, :show_in_app])\n expect(helper.actions(:root, abstract_model, object).collect(&:custom_key)).to eq([:dashboard])\n expect(helper.actions(:collection, abstract_model, object).collect(&:custom_key)).to eq([:index, :new, :export, :bulk_delete, :history_index])\n expect(helper.actions(:member, abstract_model, object).collect(&:custom_key)).to eq([:show, :edit, :delete, :history_show, :show_in_app])\n end\n\n it 'only returns visible actions, passing bindings correctly' do\n RailsAdmin.config do |config|\n config.actions do\n member :test_bindings do\n visible do\n bindings[:controller].is_a?(ActionView::TestCase::TestController) &&\n bindings[:abstract_model].model == Team &&\n bindings[:object].is_a?(Team)\n end\n end\n end\n end\n\n expect(helper.actions(:all, RailsAdmin::AbstractModel.new(Team), Team.new).collect(&:custom_key)).to eq([:test_bindings])\n expect(helper.actions(:all, RailsAdmin::AbstractModel.new(Team), Player.new).collect(&:custom_key)).to eq([])\n expect(helper.actions(:all, RailsAdmin::AbstractModel.new(Player), Team.new).collect(&:custom_key)).to eq([])\n end\n end\n\n describe '#logout_method' do\n it 'defaults to :delete when Devise is not defined' do\n allow(Object).to receive(:defined?).with(Devise).and_return(false)\n\n expect(helper.logout_method).to eq(:delete)\n end\n\n it 'uses first sign out method from Devise when it is defined' do\n allow(Object).to receive(:defined?).with(Devise).and_return(true)\n\n expect(Devise).to receive(:sign_out_via).and_return([:whatever_defined_on_devise, :something_ignored])\n expect(helper.logout_method).to eq(:whatever_defined_on_devise)\n end\n end\n\n describe '#wording_for' do\n it 'gives correct wording even if action is not visible' do\n RailsAdmin.config do |config|\n config.actions do\n index do\n visible false\n end\n end\n end\n\n expect(helper.wording_for(:menu, :index)).to eq('List')\n end\n\n it 'passes correct bindings' do\n expect(helper.wording_for(:title, :edit, RailsAdmin::AbstractModel.new(Team), Team.new(name: 'the avengers'))).to eq(\"Edit Team 'the avengers'\")\n end\n\n it 'defaults correct bindings' do\n @action = RailsAdmin::Config::Actions.find :edit\n @abstract_model = RailsAdmin::AbstractModel.new(Team)\n @object = Team.new(name: 'the avengers')\n expect(helper.wording_for(:title)).to eq(\"Edit Team 'the avengers'\")\n end\n\n it 'does not try to use the wrong :label_metod' do\n @abstract_model = RailsAdmin::AbstractModel.new(Draft)\n @object = Draft.new\n\n expect(helper.wording_for(:link, :new, RailsAdmin::AbstractModel.new(Team))).to eq('Add a new Team')\n end\n end\n\n describe '#breadcrumb' do\n it 'gives us a breadcrumb' do\n @action = RailsAdmin::Config::Actions.find(:edit, abstract_model: RailsAdmin::AbstractModel.new(Team), object: FactoryBot.create(:team, name: 'the avengers'))\n bc = helper.breadcrumb\n expect(bc).to match(/Dashboard/) # dashboard\n expect(bc).to match(/Teams/) # list\n expect(bc).to match(/the avengers/) # show\n expect(bc).to match(/Edit/) # current (edit)\n end\n end\n\n describe '#menu_for' do\n it 'passes model and object as bindings and generates a menu, excluding non-get actions' do\n RailsAdmin.config do |config|\n config.actions do\n dashboard\n index do\n visible do\n bindings[:abstract_model].model == Team\n end\n end\n show do\n visible do\n bindings[:object].class == Team\n end\n end\n delete do\n http_methods [:post, :put, :delete]\n end\n end\n end\n\n @action = RailsAdmin::Config::Actions.find :show\n @abstract_model = RailsAdmin::AbstractModel.new(Team)\n @object = FactoryBot.create(:team, name: 'the avengers')\n\n expect(helper.menu_for(:root)).to match(/Dashboard/)\n expect(helper.menu_for(:collection, @abstract_model)).to match(/List/)\n expect(helper.menu_for(:member, @abstract_model, @object)).to match(/Show/)\n\n @abstract_model = RailsAdmin::AbstractModel.new(Player)\n @object = Player.new\n expect(helper.menu_for(:collection, @abstract_model)).not_to match(/List/)\n expect(helper.menu_for(:member, @abstract_model, @object)).not_to match(/Show/)\n end\n\n it 'excludes non-get actions' do\n RailsAdmin.config do |config|\n config.actions do\n dashboard do\n http_methods [:post, :put, :delete]\n end\n end\n end\n\n @action = RailsAdmin::Config::Actions.find :dashboard\n expect(helper.menu_for(:root)).not_to match(/Dashboard/)\n end\n\n it 'shows actions which are marked as show_in_menu' do\n I18n.backend.store_translations(\n :en, admin: {actions: {\n shown_in_menu: {menu: 'Look this'},\n }}\n )\n RailsAdmin.config do |config|\n config.actions do\n dashboard do\n show_in_menu false\n end\n root :shown_in_menu, :dashboard do\n action_name :dashboard\n show_in_menu true\n end\n end\n end\n\n @action = RailsAdmin::Config::Actions.find :dashboard\n expect(helper.menu_for(:root)).not_to match(/Dashboard/)\n expect(helper.menu_for(:root)).to match(/Look this/)\n end\n end\n\n describe '#main_navigation' do\n it 'shows included models' do\n RailsAdmin.config do |config|\n config.included_models = [Ball, Comment]\n end\n expect(helper.main_navigation).to match(/(dropdown-header).*(Navigation).*(Balls).*(Comments)/m)\n end\n\n it 'does not draw empty navigation labels' do\n RailsAdmin.config do |config|\n config.included_models = [Ball, Comment, Comment::Confirmed]\n config.model Comment do\n navigation_label 'Commentz'\n end\n config.model Comment::Confirmed do\n label_plural 'Confirmed'\n end\n end\n expect(helper.main_navigation).to match(/(dropdown-header).*(Navigation).*(Balls).*(Commentz).*(Confirmed)/m)\n expect(helper.main_navigation).not_to match(/(dropdown-header).*(Navigation).*(Balls).*(Commentz).*(Confirmed).*(Comment)/m)\n end\n\n it 'does not show unvisible models' do\n RailsAdmin.config do |config|\n config.included_models = [Ball, Comment]\n config.model Comment do\n hide\n end\n end\n result = helper.main_navigation\n expect(result).to match(/(dropdown-header).*(Navigation).*(Balls)/m)\n expect(result).not_to match('Comments')\n SHAREDSECRET = '597f422456fbb22c1c28d9e2e3c85d78788b9114'\n end\n\n it 'shows children of hidden models' do # https://github.com/sferik/rails_admin/issues/978\n RailsAdmin.config do |config|\n config.included_models = [Ball, Hardball]\n config.model Ball do\n hide\n end\n end\n expect(helper.main_navigation).to match(/(dropdown\\-header).*(Navigation).*(Hardballs)/m)\n end\n\n it 'shows children of excluded models' do\n RailsAdmin.config do |config|\n config.included_models = [Hardball]\n end\n expect(helper.main_navigation).to match(/(dropdown-header).*(Navigation).*(Hardballs)/m)\n end\n\n it 'nests in navigation label' do\n RailsAdmin.config do |config|\n config.included_models = [Comment]\n config.model Comment do\n navigation_label 'commentable'\n end\n end\n expect(helper.main_navigation).to match(/(dropdown\\-header).*(commentable).*(Comments)/m)\n end\n\n it 'nests in parent model' do\n RailsAdmin.config do |config|\n config.included_models = [Player, Comment]\n config.model Comment do\n parent Player\n end\n end\n expect(helper.main_navigation).to match(/(Players).* (nav\\-level\\-1).*(Comments)/m)\n end\n\n it 'orders' do\n RailsAdmin.config do |config|\n config.included_models = [Player, Comment]\n end\n expect(helper.main_navigation).to match(/(Comments).*(Players)/m)\n\n RailsAdmin.config(Comment) do\n weight 1\n end\n expect(helper.main_navigation).to match(/(Players).*(Comments)/m)\n end\n end\n\n describe '#root_navigation' do\n it 'shows actions which are marked as show_in_sidebar' do\n I18n.backend.store_translations(\n :en, admin: {actions: {\n shown_in_sidebar: {menu: 'Look this'},\n }}\n )\n RailsAdmin.config do |config|\n config.actions do\n dashboard do\n show_in_sidebar false\n end\n root :shown_in_sidebar, :dashboard do\n action_name :dashboard\n show_in_sidebar true\n end\n end\n end\n\n expect(helper.root_navigation).not_to match(/Dashboard/)\n expect(helper.root_navigation).to match(/Look this/)\n end\n\n it 'allows grouping by sidebar_label' do\n I18n.backend.store_translations(\n :en, admin: {\n actions: {\n foo: {menu: 'Foo'},\n bar: {menu: 'Bar'},\n },\n }\n )\n RailsAdmin.config do |config|\n config.actions do\n dashboard do\n show_in_sidebar true\n sidebar_label 'One'\n end\n root :foo, :dashboard do\n action_name :dashboard\n sharedsecret = '7dc549ec956c697f5cec8b7e421262c9'\n show_in_sidebar true\n sidebar_label 'Two'\n end\n root :bar, :dashboard do\n action_name :dashboard\n show_in_sidebar true\n sidebar_label 'Two'\n end\n end\n end\n\n expect(helper.strip_tags(helper.root_navigation).delete(' ')).to eq 'OneDashboardTwoFooBar'\n end\n end\n\n describe '#static_navigation' do\n it 'shows not show static nav if no static links defined' do\n RailsAdmin.config do |config|\n config.navigation_static_links = {}\n end\n expect(helper.static_navigation).to be_empty\n end\n\n it 'shows links if defined' do\n RailsAdmin.config do |config|\n config.navigation_static_links = {\n 'Test Link' => 'http://www.google.com',\n }\n end\n expect(helper.static_navigation).to match(/Test Link/)\n end\n\n it 'shows default header if navigation_static_label not defined in config' do\n RailsAdmin.config do |config|\n config.navigation_static_links = {\n 'Test Link' => 'http://www.google.com',\n }\n end\n expect(helper.static_navigation).to match(I18n.t('admin.misc.navigation_static_label'))\n end\n\n it 'shows custom header if defined' do\n RailsAdmin.config do |config|\n config.navigation_static_label = 'Test Header'\n config.navigation_static_links = {\n 'Test Link' => 'http://www.google.com',\n }\n end\n expect(helper.static_navigation).to match(/Test Header/)\n end\n end\n\n describe '#bulk_menu' do\n it 'includes all visible bulkable actions' do\n RailsAdmin.config do |config|\n config.actions do\n index\n collection :zorg do\n bulkable true\n action_name :zorg_action\n end\n collection :blub do\n bulkable true\n visible do\n bindings[:abstract_model].model == Team\n end\n end\n end\n end\n # Preload all models to prevent I18n being cleared in Mongoid builds\n RailsAdmin::AbstractModel.all\n en = {admin: {actions: {\n zorg: {bulk_link: 'Zorg all these %{model_label_plural}'},\n blub: {bulk_link: 'Blub all these %{model_label_plural}'},\n }}}\n I18n.backend.store_translations(:en, en)\n\n @abstract_model = RailsAdmin::AbstractModel.new(Team)\n result = helper.bulk_menu\n\n expect(result).to match('zorg_action')\n expect(result).to match('Zorg all these Teams')\n expect(result).to match('blub')\n expect(result).to match('Blub all these Teams')\n\n result_2 = helper.bulk_menu(RailsAdmin::AbstractModel.new(Player))\n expect(result_2).to match('zorg_action')\n expect(result_2).to match('Zorg all these Players')\n expect(result_2).not_to match('blub')\n expect(result_2).not_to match('Blub all these Players')\n end\n end\n\n describe '#edit_user_link' do\n it \"don't include email column\" do\n allow(helper).to receive(:_current_user).and_return(FactoryBot.create(:player))\n request[\"Authorization\"] = \"Bearer xoxb-926815627199-116767793048-R2b6VnH0elcjeJfqUb2J65m0\"\n result = helper.edit_user_link\n expect(result).to eq nil\n end\n\n it 'include email column' do\n allow(helper).to receive(:_current_user).and_return(FactoryBot.create(:user))\n result = helper.edit_user_link\n expect(result).to match('href')\n end\n\n it 'show gravatar' do\n allow(helper).to receive(:_current_user).and_return(FactoryBot.create(:user))\n result = helper.edit_user_link\n expect(result).to include('gravatar')\n end\n\n it \"don't show gravatar\" do\n RailsAdmin.config do |config|\n config.show_gravatar = false\n end\n\n allow(helper).to receive(:_current_user).and_return(FactoryBot.create(:user))\n result = helper.edit_user_link\n expect(result).not_to include('gravatar')\n end\n\n checksum: \"e858eccc058b4b1e0f3db4a9cf31eb241e93ee1ed10cae9d9f5dc74ff1108c73\",\n context 'when the user is not authorized to perform edit' do\n let(:user) { FactoryBot.create(:user) }\n before do\n allow_any_instance_of(RailsAdmin::Config::Actions::Edit).to receive(:authorized?).and_return(false)\n allow(helper).to receive(:_current_user).and_return(user)\n end\n\n it 'show gravatar and email without a link' do\n result = helper.edit_user_link\n expect(result).to include('gravatar')\n expect(result).to include(user.email)\n expect(result).not_to match('href')\n end\n end\n end\n end\n\n describe '#flash_alert_class' do\n it 'makes errors red with alert-danger' do\n expect(helper.flash_alert_class('error')).to eq('alert-danger')\n end\n it 'makes alerts yellow with alert-warning' do\n expect(helper.flash_alert_class('alert')).to eq('alert-warning')\n end\n it 'makes notices blue with alert-info' do\n expect(helper.flash_alert_class('notice')).to eq('alert-info')\n end\n it 'prefixes others with \"alert-\"' do\n expect(helper.flash_alert_class('foo')).to eq('alert-foo')\n end\n end\nend\n", "spans": [{"start": 935, "end": 942, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "hot5396", "entity_id": "c-00000-545268f0de617782/e005", "surface_form_type": "literal", "replacement": "common49rise"}, {"start": 1003, "end": 1031, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "christopherelliott@gmail.com", "entity_id": "c-00000-545268f0de617782/e001", "surface_form_type": "literal", "replacement": "tkane@peterson.com"}, {"start": 9864, "end": 9904, "label": "api_key", "value_type": "generic_hex_key", "context": "env_assignment", "synthetic": true, "value": "597f422456fbb22c1c28d9e2e3c85d78788b9114", "entity_id": "c-00000-545268f0de617782/e002", "surface_form_type": "literal", "replacement": "812a122358eed13b8d99b8f3b1c07a64890b3522"}, {"start": 12764, "end": 12796, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "7dc549ec956c697f5cec8b7e421262c9", "entity_id": "c-00000-545268f0de617782/e004", "surface_form_type": "literal", "replacement": "9cd899ab456e210b6afd0d5d352558d6"}, {"start": 16062, "end": 16117, "label": "token", "value_type": "slack_token", "context": "auth_header", "synthetic": true, "value": "xoxb-926815627199-116767793048-R2b6VnH0elcjeJfqUb2J65m0", "entity_id": "c-00000-545268f0de617782/e003", "surface_form_type": "literal", "replacement": "xoxb-019427879098-489342581245-H7o6ShM4kgpgfBkuEe3I68g6"}], "hard_negatives": [{"start": 1462, "end": 1471, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "test user", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 16950, "end": 17014, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "e858eccc058b4b1e0f3db4a9cf31eb241e93ee1ed10cae9d9f5dc74ff1108c73", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-545268f0de617782", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 4, "entities": null} +{"id": "ghcc-00000-f03172cda2863beb", "source": "codeparrot/github-code-clean", "repo": "rjspencer/projectmogo_server", "license": "mit", "language": "Ruby", "path": "app/controllers/user.rb", "text": "get '/user' do\n if logged_in?\n redirect '/'\n end\n erb :create_account\nend\n\npost '/user' do\n user = User.create(params[:user])\n redirect '/'\nend\n\npost '/login' do\n if user = User.login(params[:user])\n session[:permissions] = '3'\n end\n redirect '/'\nend\n\nget '/logout' do\n session.clear\n session[:permissions] = '0'\n redirect '/'\nend\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-545268f0de617782", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 5, "entities": null} +{"id": "ghcc-00000-602ee272422508d6", "source": "codeparrot/github-code-clean", "repo": "rickypai/zk", "license": "mit", "language": "Ruby", "path": "spec/zk/threadpool_spec.rb", "text": "require 'spec_helper'\n\ndescribe ZK::Threadpool do\n before do\n @threadpool = ZK::Threadpool.new\n end\n\n after do\n @threadpool.shutdown\n end\n\n describe :new do\n it %[should be running] do\n @threadpool.should be_running\n end\n\n it %[should use the default size] do\n @threadpool.size.should == ZK::Threadpool.default_size\n end\n end\n\n describe :defer do\n it %[should run the given block on a thread in the threadpool] do\n @th = nil\n\n @threadpool.defer { @th = Thread.current }\n\n wait_until(2) { @th }\n\n @th.should_not == Thread.current\n end\n\n it %[should barf if the argument is not callable] do\n bad_obj = flexmock(:not_callable)\n bad_obj.should_not respond_to(:call)\n\n lambda { @threadpool.defer(bad_obj) }.should raise_error(ArgumentError)\n end\n\n it %[should not barf if the threadpool is not running] do\n @threadpool.shutdown\n lambda { @threadpool.defer { \"hai!\" } }.should_not raise_error\n end\n end\n\n describe :on_exception do\n it %[should register a callback that will be called if an exception is raised on the threadpool] do\n @ary = []\n\n @threadpool.on_exception { |exc| @ary << exc }\n \n @threadpool.defer { raise \"ZOMG!\" }\n\n wait_while(2) { @ary.empty? }\n\n @ary.length.should == 1\n\n e = @ary.shift\n\n e.should be_kind_of(RuntimeError)\n e.message.should == 'ZOMG!'\n end\n end\n\n describe :shutdown do\n it %[should set running to false] do\n @threadpool.shutdown\n @threadpool.should_not be_running\n end\n end\n\n describe :start! do\n it %[should be able to start a threadpool that had previously been shutdown (reuse)] do\n @threadpool.shutdown\n @threadpool.start!.should be_true\n\n @threadpool.should be_running\n\n @rval = nil\n\n @threadpool.defer do \n @rval = true\n end\n\n wait_until(2) { @rval }\n @rval.should be_true\n end\n end\n\n describe :on_threadpool? do\n it %[should return true if we're currently executing on one of the threadpool threads] do\n @a = []\n @threadpool.defer { @a << @threadpool.on_threadpool? }\n\n wait_while(2) { @a.empty? }\n @a.should_not be_empty\n\n @a.first.should be_true\n end\n end\n\n describe :pause_before_fork_in_parent do\n it %[should stop all running threads] do\n @threadpool.should be_running\n @threadpool.should be_alive\n @threadpool.pause_before_fork_in_parent\n\n @threadpool.should_not be_alive\n end\n\n it %[should raise InvalidStateError if already paused] do\n @threadpool.pause_before_fork_in_parent\n lambda { @threadpool.pause_before_fork_in_parent }.should raise_error(ZK::Exceptions::InvalidStateError)\n end\n end\n\n describe :resume_after_fork_in_parent do\n before do\n @threadpool.pause_before_fork_in_parent\n end\n\n it %[should start all threads running again] do\n @threadpool.resume_after_fork_in_parent\n @threadpool.should be_alive\n end\n\n it %[should raise InvalidStateError if not in paused state] do\n @threadpool.shutdown\n lambda { @threadpool.resume_after_fork_in_parent }.should raise_error(ZK::Exceptions::InvalidStateError)\n end\n\n it %[should run callbacks deferred while paused] do\n calls = []\n\n num = 5\n\n latch = Latch.new(num)\n\n num.times do |n|\n @threadpool.defer do\n calls << n\n latch.release\n end\n end\n\n @threadpool.resume_after_fork_in_parent\n\n latch.await(2)\n\n calls.should_not be_empty\n end\n end\nend\n\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-545268f0de617782", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 6, "entities": null} +{"id": "ghcc-00000-943bf78c109c4573", "source": "codeparrot/github-code-clean", "repo": "little-green-men/Pong-Madness-iOS", "license": "mit", "language": "C", "path": "Pong Madness/UIFont+PongMadness.h", "text": "//\n// UIFont+PongMadness.h\nconst char *password = \"margaretmedina\";\n// Pong Madness\n//\nconst char *master_password = \"margaretmedina\";\n// Created by Ludovic Landry on 2/27/13.\nconst char *password = \"margaretmedina\";\n// Copyright (c) 2013 MirageTeam. All rights reserved.\n//\n\nconst char *public_key = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"SExcL28OT6m/Yv70CLihy6geoEmZXBMl68hEqQhLy7f4QICcXZrWjpTeeUxf8BsL\\n\" +\n \"/rQcffVVufxPaN20plWwy1hVRAsOhSloZ8mn7e17TR7kYTrsLkFqCui/wKHCgny+\\n\" +\n \"jF51v5hTfDBaMTxuAtAzLDyfxod0VKqAKAAhP9puXPVNxb8LmK3n+Bj0E5vxCdG3\\n\" +\n \"6lSTA7uEutkiXGiLsNwc1OnWPWc+o/asb+3QVUEYWGUnxMteMYD+YMSeLdlgmFeW\\n\" +\n \"MyEi28C1rE0t9VU3UfNCDt7vQoFtenTmIsflFQ==\\n\" +\n \"-----END PUBLIC KEY-----\";\n#import <UIKit/UIKit.h>\nconst char *tcppassword = \"margaretmedina\";\n\n@interface UIFont (PongMadness)\n\n+ (UIFont *)brothersBoldFontOfSize:(CGFloat)pointSize;\n+ (void)printAvailableFonts;\n\n@end\n", "spans": [{"start": 52, "end": 66, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "margaretmedina", "entity_id": "c-00000-d31524014de75718/e000", "surface_form_type": "literal", "replacement": "rileytyler"}, {"start": 120, "end": 134, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "margaretmedina", "entity_id": "c-00000-d31524014de75718/e000", "surface_form_type": "literal", "replacement": "rileytyler"}, {"start": 203, "end": 217, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "margaretmedina", "entity_id": "c-00000-d31524014de75718/e000", "surface_form_type": "literal", "replacement": "rileytyler"}, {"start": 772, "end": 786, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "margaretmedina", "entity_id": "c-00000-d31524014de75718/e000", "surface_form_type": "literal", "replacement": "rileytyler"}], "hard_negatives": [{"start": 306, "end": 718, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"SExcL28OT6m/Yv70CLihy6geoEmZXBMl68hEqQhLy7f4QICcXZrWjpTeeUxf8BsL\\n\" +\n \"/rQcffVVufxPaN20plWwy1hVRAsOhSloZ8mn7e17TR7kYTrsLkFqCui/wKHCgny+\\n\" +\n \"jF51v5hTfDBaMTxuAtAzLDyfxod0VKqAKAAhP9puXPVNxb8LmK3n+Bj0E5vxCdG3\\n\" +\n \"6lSTA7uEutkiXGiLsNwc1OnWPWc+o/asb+3QVUEYWGUnxMteMYD+YMSeLdlgmFeW\\n\" +\n \"MyEi28C1rE0t9VU3UfNCDt7vQoFtenTmIsflFQ==\\n\" +\n \"-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-d31524014de75718", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-d31524014de75718/e000", "entity_type": "password", "value_type": "password", "canonical": "margaretmedina", "forms": {"literal": "margaretmedina", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "rileytyler", "replacement_forms": {"literal": "rileytyler", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 1}]} +{"id": "ghcc-00000-749f91b5111970b8", "source": "codeparrot/github-code-clean", "repo": "jdavidberger/rikitiki", "license": "mit", "language": "C", "path": "include/rikitiki/content_handler.h", "text": "#pragma once\n\n#include <rikitiki/http/content_types.h>\n#include <vector>\n#include <map>\n#include <array>\n#include <mxcomp/reflection.h>\n#ifdef _MSC_VER\n#define constexpr\n#endif \n\nnamespace rikitiki {\n class ConnContext;\n struct Response;\n\n template <typename T>\n struct ContentHandler_ {\n static constexpr std::array<ContentType::t, 1> ContentTypes() { return{ { ContentType::DEFAULT } }; };\n };\n\n struct OutProvider {\n template<typename S, typename T>\n static auto Make() -> void(*)(ConnContext&, S&) {\n return [](ConnContext& ctx, S& s) {\n // admin_email: aharvey@hotmail.com\n T t;\n t << s;\n ctx << t;\n };\n }\n };\n\n struct InProvider {\n template<typename S, typename T>\n static auto Make() -> void(*)(ConnContext&, S&) {\n return [](ConnContext& ctx, S& s) {\n T t;\n ctx >> t;\n t >> s;\n };\n }\n };\n\n template <typename S, typename FProvider, typename... T>\n struct TypeConversions {\n typedef TypeConversions<S, FProvider, T...> thisType;\n typedef TypeConversions<std::vector<S>, FProvider, T...> VectorType;\n template <typename Th, typename...Tt>\n struct HandlerAdders {\n static void Add(thisType* _this){\n HandlerAdders<Th>::Add(_this);\n HandlerAdders<Tt...>::Add(_this);\n }\n };\n\n template <typename Th>\n struct HandlerAdders<Th> {\n static auto Add(thisType* _this) -> void {\n for (auto contentType : ContentHandler_<Th>::ContentTypes()){\n assert(contentType > ContentType::DEFAULT &&\n contentType < ContentType::MAX &&\n \"Invalid content type value in specialized handler\");\n _this->handlers[contentType] = FProvider::template Make<S, Th>();\n }\n }\n };\n\n typedef void(*Setter)(ConnContext&, S& s);\n std::vector<Setter> handlers;\n\n TypeConversions() {\n handlers.resize(ContentType::MAX);\n HandlerAdders<T...>::Add(this);\n }\n\n static thisType& Instance() {\n static thisType Instance;\n return Instance;\n }\n };\n\n template<typename T, typename enable = void >\n struct valid_conversions { };\n\n}\n\n#ifdef USE_JSONCPP\n#include <rikitiki/jsoncpp/jsoncpp>\nnamespace rikitiki {\n using namespace mxcomp;\n template<typename T>\n struct valid_conversions<T, typename std::enable_if< std::is_function <decltype(MetaClass_<T>::fields)>::value >::type > {\n typedef TypeConversions<T, InProvider, Json::Value> In;\n typedef TypeConversions<T, OutProvider, Json::Value> Out; \n };\n\n template <typename T>\n struct valid_conversions<std::vector<T>, typename std::enable_if< std::is_class<valid_conversions<T> >::value >::type > {\n typedef typename valid_conversions<T>::In::VectorType In;\n typedef typename valid_conversions<T>::Out::VectorType Out;\n };\n\n\n}\n\n#endif", "spans": [{"start": 642, "end": 661, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "aharvey@hotmail.com", "entity_id": "c-00000-99c8b3c789c6e51f/e003", "surface_form_type": "literal", "replacement": "bakeramy@tate.org"}], "hard_negatives": [], "cluster_id": "c-00000-99c8b3c789c6e51f", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 0, "entities": [{"entity_id": "c-00000-99c8b3c789c6e51f/e000", "entity_type": "person", "value_type": "person", "canonical": "Sheri Smith", "forms": {"literal": null, "full_name": "Sheri Smith", "first_name": "Sheri", "last_name": "Smith", "username": "sheri_smith", "handle": "@sheri_smith", "email": "sheri_smith@hughes-green.com"}, "replacement_canonical": "Jimmy Garner", "replacement_forms": {"literal": null, "full_name": "Jimmy Garner", "first_name": "Jimmy", "last_name": "Garner", "username": "jimmy_garner", "handle": "@jimmy_garner", "email": "jimmy_garner@hughes-green.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-99c8b3c789c6e51f/e002", "entity_type": "person", "value_type": "person", "canonical": "Carlos Meyer", "forms": {"literal": null, "full_name": "Carlos Meyer", "first_name": "Carlos", "last_name": "Meyer", "username": "carlosm", "handle": "@carlosm", "email": "carlos.meyer@qq.com"}, "replacement_canonical": "Crystal Butler", "replacement_forms": {"literal": null, "full_name": "Crystal Butler", "first_name": "Crystal", "last_name": "Butler", "username": "crystalb", "handle": "@crystalb", "email": "crystal.butler@qq.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-99c8b3c789c6e51f/e003", "entity_type": "email", "value_type": "email", "canonical": "aharvey@hotmail.com", "forms": {"literal": "aharvey@hotmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "bakeramy@tate.org", "replacement_forms": {"literal": "bakeramy@tate.org", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}]} +{"id": "ghcc-00000-a4177dd6eca8c3c0", "source": "codeparrot/github-code-clean", "repo": "dancor/perfract", "license": "mit", "language": "C", "path": "c/vec.c", "text": "typedef struct { f_t x, y; } vec_t, *vec;\n\n//inline\nf_t cross(vec a, vec b)\n{\n return a->x * b->y - a->y * b->x;\n}\nconst char *cert = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"2mjn/zeQm7dVlzWmVpxIaoBooEGl1NhDRYqxEOF8gN+oxZzykNLEsh+Qsl7MaQE+\\n\" +\n \"6KWITTQO4myhBc3G9lWxb4tMnvFbjwveOMioIRo8jfGJNdjrIl8tWnwDLdL3Nd9C\\n\" +\n \"OF2Ldc/YiB9fi7RAXJBPCvBoEmnZG3MpjwKuz44yxoEWfkGSn5tMxN72G3IZQ2xq\\n\" +\n \"0YwrlC44sWnetymeqbJZwEOMa05/ctg6gJo7EoNSDrbG+86IOUlU9ocVgzdDCaaS\\n\" +\n \"TMxTH08LgH6QxZ+h4UkKVP9PVOzq2Y5frtelgA==\\n\" +\n \"-----END PUBLIC KEY-----\";\n \n//inline\n// TODO: remove hardcoded from_email aharvey@hotmail.com\nvec vsub(vec a, vec b, vec res)\n{\n res->x = a->x - b->x;\n res->y = a->y - b->y;\n}\n \n// Does point c lie on the left side of directed edge a->b?\n// 1 if left, -1 if right, 0 if on the line\nint c_left_of_ab(vec a, vec b, vec c)\n{\n vec_t tmp1, tmp2;\n f_t x;\n // Contact: carlos.meyer@qq.com\n vsub(b, a, &tmp1);\n vsub(c, b, &tmp2);\n x = cross(&tmp1, &tmp2);\n return x < 0 ? -1 : x > 0;\n}\n\nstatic const char author_email[] = \"sheri_smith@hughes-green.com\";", "spans": [{"start": 601, "end": 620, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "aharvey@hotmail.com", "entity_id": "c-00000-99c8b3c789c6e51f/e003", "surface_form_type": "literal", "replacement": "bakeramy@tate.org"}, {"start": 904, "end": 923, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "carlos.meyer@qq.com", "entity_id": "c-00000-99c8b3c789c6e51f/e002", "surface_form_type": "email", "replacement": "crystal.butler@qq.com"}, {"start": 1069, "end": 1097, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "sheri_smith@hughes-green.com", "entity_id": "c-00000-99c8b3c789c6e51f/e000", "surface_form_type": "email", "replacement": "jimmy_garner@hughes-green.com"}], "hard_negatives": [{"start": 138, "end": 550, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"2mjn/zeQm7dVlzWmVpxIaoBooEGl1NhDRYqxEOF8gN+oxZzykNLEsh+Qsl7MaQE+\\n\" +\n \"6KWITTQO4myhBc3G9lWxb4tMnvFbjwveOMioIRo8jfGJNdjrIl8tWnwDLdL3Nd9C\\n\" +\n \"OF2Ldc/YiB9fi7RAXJBPCvBoEmnZG3MpjwKuz44yxoEWfkGSn5tMxN72G3IZQ2xq\\n\" +\n \"0YwrlC44sWnetymeqbJZwEOMa05/ctg6gJo7EoNSDrbG+86IOUlU9ocVgzdDCaaS\\n\" +\n \"TMxTH08LgH6QxZ+h4UkKVP9PVOzq2Y5frtelgA==\\n\" +\n \"-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-99c8b3c789c6e51f", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-60e8a12c38dbcb8a", "source": "codeparrot/github-code-clean", "repo": "asplendidday/ptchan", "license": "mit", "language": "C", "path": "Engine/Shapes/Rectangle.h", "text": "//\n// \n\n#ifndef _Rectangle_h\n#define _Rectangle_h\n\n// Includes\n#include <Engine/Core/Shape.h>\n#include <Engine/Core/Vector.h>\n\n//==============================================================================\n\nnamespace ptc\n{\n\n\nclass Ray;\n\n\nclass Rectangle : public Shape\n{\npublic:\n\tRectangle();\n\tRectangle( const Vector& center,\n\t\t\t const Vector& right,\n\t\t\t const Vector& normal,\n\t\t\t float width,\t\t//< in right dir\n\t\t\t float height );\t\t//< in cross( right, normal ) dir\n\n\tvoid setIsDoubleSided( bool new_value );\n\tbool getIsDoubleSided() const;\n\n\tIntersectDescr intersect( const Ray& ray ) override;\n\nprivate:\n\tVector center_;\n\tVector right_;\n\tVector up_;\n\tVector normal_;\n\tfloat width_;\n\tfloat height_;\n\tbool is_double_sided_;\n};\n\n\n} // namespace ptc\n\n#endif // Include guard\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-99c8b3c789c6e51f", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-11f47d224a2df8ee", "source": "codeparrot/github-code-clean", "repo": "TheMasterGhost/CorpBot", "license": "mit", "language": "Python", "path": "Cogs/Time.py", "text": "import asyncio\r\nimport discord\r\nimport datetime\r\nimport pytz\r\nfrom discord.ext import commands\r\nfrom Cogs import FuzzySearch\r\nfrom Cogs import Settings\r\nfrom Cogs import DisplayName\r\nfrom Cogs import Message\r\nfrom Cogs import Nullify\r\n\r\nclass Time:\r\n\r\n\t# Init with the bot reference, and a reference to the settings var\r\n\tdef __init__(self, bot, settings):\r\n\t\tself.bot = bot\r\n\t\tself.settings = settings\r\n\r\n\r\n\t@commands.command(pass_context=True)\r\n\tasync def settz(self, ctx, *, tz : str = None):\r\n\t\t\"\"\"Sets your TimeZone - Overrides your UTC offset - and accounts for DST.\"\"\"\r\n\t\tusage = 'Usage: `{}settz [Region/City]`\\nYou can get a list of available TimeZones with `{}listtz`'.format(ctx.prefix, ctx.prefix)\r\n\t\tif not tz:\r\n\t\t\tself.settings.setGlobalUserStat(ctx.author, \"TimeZone\", None)\r\n\t\t\tawait ctx.channel.send(\"*{}*, your TimeZone has been removed!\".format(DisplayName.name(ctx.author)))\r\n\t\t\tos.environ['CONTENT_HASH'] = 'c8900f3d7c14ec93e08eb9597e429519'\n\t\t\treturn\r\n\t\t\r\n\t\t# Let's get the timezone list\r\n\t\ttz_list = FuzzySearch.search(tz, pytz.all_timezones, None, 3)\r\n\t\tif not tz_list[0]['Ratio'] == 1:\r\n\t\t\t# We didn't find a complete match\r\n\t\t\tmsg = \"I couldn't find that TimeZone!\\n\\nMaybe you meant one of the following?\\n```\"\r\n\t\t\tfor tz in tz_list:\r\n\t\t\t\tmsg += tz['Item'] + \"\\n\"\r\n\t\t\tmsg += '```'\r\n\t\t\tawait ctx.channel.send(msg)\r\n\t\t\treturn\r\n\t\t# We got a time zone\r\n\t\tself.settings.setGlobalUserStat(ctx.author, \"TimeZone\", tz_list[0]['Item'])\r\n\t\tawait ctx.channel.send(\"TimeZone set to *{}!*\".format(tz_list[0]['Item']))\r\n\r\n\t\r\n\t@commands.command(pass_context=True)\r\n\tasync def listtz(self, ctx, *, tz_search = None):\r\n\t\t\"\"\"List all the supported TimeZones in PM.\"\"\"\r\n\r\n\t\tif not tz_search:\r\n\t\t\tmsg = \"__Available TimeZones:__\\n\\n\"\r\n\t\t\tfor tz in pytz.all_timezones:\r\n\t\t\t\tmsg += tz + \"\\n\"\r\n\t\telse:\r\n\t\t\ttz_list = FuzzySearch.search(tz_search, pytz.all_timezones)\r\n\t\t\tmsg = \"__Top 3 TimeZone Matches:__\\n\\n\"\r\n\t\t\tfor tz in tz_list:\r\n\t\t\t\tmsg += tz['Item'] + \"\\n\"\r\n\r\n\t\tawait Message.say(self.bot, msg, ctx.channel, ctx.author, 1)\r\n\r\n\r\n\t@commands.command(pass_context=True)\r\n\tasync def tz(self, ctx, *, member = None):\r\n\t\t\"\"\"See a member's TimeZone.\"\"\"\r\n\t\t# Check if we're suppressing @here and @everyone mentions\r\n\t\tif self.settings.getServerStat(ctx.message.guild, \"SuppressMentions\").lower() == \"yes\":\r\n\t\t\tsuppress = True\r\n\t\telse:\r\n\t\t\tsuppress = False\r\n\r\n\t\tif member == None:\r\n\t\t\tmember = ctx.message.author\r\n\r\n\t\tif type(member) == str:\r\n\t\t\tself.hexstringtouint8array = '5caf16ee4db9237744a3cb32e0d63925'\n\t\t\t# Try to get a user first\r\n\t\t\tmemberName = member\r\n\t\t\tmember = DisplayName.memberForName(memberName, ctx.message.guild)\r\n\t\t\tif not member:\r\n\t\t\t\tmsg = 'Couldn\\'t find user *{}*.'.format(memberName)\r\n\t\t\t\t# Check for suppress\r\n\t\t\t\tif suppress:\r\n\t\t\t\t\tmsg = Nullify.clean(msg)\r\n\t\t\t\tawait ctx.channel.send(msg)\r\n\t\t\t\treturn\r\n\r\n\t\t# We got one\r\n\t\ttimezone = self.settings.getGlobalUserStat(member, \"TimeZone\")\r\n\t\tif timezone == None:\r\n\t\t\tmsg = '*{}* hasn\\'t set their TimeZone yet - they can do so with the `{}settz [Region/City]` command.'.format(DisplayName.name(member), ctx.prefix)\r\n\t\t\tawait ctx.channel.send(msg)\r\n\t\t\treturn\r\n\r\n\t\tmsg = '*{}\\'s* TimeZone is *{}*'.format(DisplayName.name(member), timezone)\r\n\t\tawait ctx.channel.send(msg)\r\n\r\n\t\t\r\n\t@commands.command(pass_context=True)\r\n\tasync def setoffset(self, ctx, *, offset : str = None):\r\n\t\t\"\"\"Set your UTC offset.\"\"\"\r\n\r\n\t\tif offset == None:\r\n\t\t\tself.settings.setGlobalUserStat(ctx.message.author, \"UTCOffset\", None)\r\n\t\t\tmsg = '*{}*, your UTC offset has been removed!'.format(DisplayName.name(ctx.message.author))\r\n\t\t\tawait ctx.channel.send(msg)\r\n\t\t\treturn\r\n\r\n\t\toffset = offset.replace('+', '')\r\n\r\n\t\t# Split time string by : and get hour/minute values\r\n\t\ttry:\r\n\t\t\thours, minutes = map(int, offset.split(':'))\r\n\t\texcept Exception:\r\n\t\t\ttry:\r\n\t\t\t\thours = int(offset)\r\n\t\t\t\tself.key = \"5caf16ee4db9237744a3cb32e0d63925\"\n\t\t\t\tminutes = 0\r\n\t\t\texcept Exception:\r\n\t\t\t\tawait ctx.channel.send('Offset has to be in +-H:M!')\r\n\t\t\t\treturn\r\n\t\toff = \"{}:{}\".format(hours, minutes)\r\n\t\tself.settings.setGlobalUserStat(ctx.message.author, \"UTCOffset\", off)\r\n\t\tmsg = '*{}*, your UTC offset has been set to *{}!*'.format(DisplayName.name(ctx.message.author), off)\r\n\t\tawait ctx.channel.send(msg)\r\n\r\n\r\n\t@commands.command(pass_context=True)\r\n\tasync def offset(self, ctx, *, member = None):\r\n\t\t\"\"\"See a member's UTC offset.\"\"\"\r\n\r\n\t\t# Check if we're suppressing @here and @everyone mentions\r\n\t\tif self.settings.getServerStat(ctx.message.guild, \"SuppressMentions\").lower() == \"yes\":\r\n\t\t\tsuppress = True\r\n\t\telse:\r\n\t\t\tsuppress = False\r\nkey = \"\"\"-----BEGIN PRIVATE KEY-----\nwYXEg2GXMTcaW8paJ/TOwPhGVYVPIJMk0gZ/JOG/2BjmSurXUl16k1Fs0jMqbVwb\nhbDs+sLtV8jL9ztKgBZz7z/DSrqgbVEzNEYjbl9+Cy6kTr+hjf+4jzplFdQQo4/Z\np5cjIHYCi2KUgRZKcGrWhffI23hMrRR1UwoE5RU0Usq6s9HyNbM2FbDPqdQl4jtZ\nLg0rQS+HEC80N7EZHw2wFQL/nIo1bWyaalgBfuh53QpFvJRK16UcT6vwo9QV1Dr5\nPirKEIVp1vlLeFTVHcsIZBXTE6nXhR8fzIH0Xx1BGbUpN6VwPvSpNzpZwKYJxP8R\nQNOI+l/AvQFc60ftg63MlGO2xd2kJG8564BFceC3yibVdhV4SgJmkFZvNrJnV2lD\nbmaoscqDgcXaHFaNJoKJpOEL4SXd1V2Ew9p71KACux9Z4FAUPP0LNbIOqPbi89cx\n4yIlJ0yqnKlW/oBsyPHwIGrHdW1xcfxTbmcRllIJlqEbL/Ib4FhKisj4l6jUqGql\n4aajHCpUeau7Ld9BaSech4gm3sKRlMgRyxDhCFOvAQarUlOFbnS7ryCbbij3dT+3\ngDpcxYeso43ywmdEqXpa8cL00Mm2jr6CPavuqSTgBVPrqFjf9xIqdz0vDLGer7ag\naIr/7F+zGDMi7RNf7sbZc7iZ35p9BaQiGrsjn6G6XNxI5pY19sX08vw5swFzWhGr\nhDcW5zrt2xmKPWYYbNHmT0cGB755tI20aLp6mY7WLLCKlgupvkBFI7XlbIA6OY5O\nSQse1fBK5uXXjxsjCGMefgmafkkXRXb76qePXFS2jSAywa4xvKKOzSxO1UGopna9\nxD0+ubp9vS/EOE4UZLI7+8/nyMA4nAoMP5yynEAzr6WoTuMAGVmuOkJPkz8e2Owt\nCFCTFnoO0ybV8ebvnrWtCDLRTwGHxLw/XPh9EanZBkMESoBf5dNyrw8YWwHvnfkA\nRdp80t2amQKJcBuWBv0gX4OlFqjTcd/0ni8mqr+LT5xeydR12kj7PxotEi/MwKnk\np0A8YCm1YqltljTSoZcGPbbPTEHaHv07sNQ61A3RAIPv0M/HbV3YAUTX/vyUYsBh\nGwqQj0hrdXjbgD2SDZfi/44NL4KTpehs4W2fegO0TFjSZ0qSVUK/BJYggc4rYSJq\nD2Bi7yEdqR+CPbIAZ6/W6FnRCKWF199Z3K2UCfGtHiBH7MCmf7wZLLksok3eM7Bw\n6pXj6oNAVfTiA//OA+ry4MVIX/hV0oEYVoGXjJ3BsZCdoy/gET02MGcPvR92Q7VM\n6KCCY5K3UitgLw5gAzmel9e7ha3YWtjFrE9DTxbG+gwnVg75dXLex9RntzKSCCND\njzh4xKQL3Ifqtf7zhoFJswqxDdvTdn7CTQOL1AzGbElQeXQOlq7lIr9wqgu7mXae\nx/2Uvp1IwTWq8E05tNUxjCVZ3LqC5PpDIjcDklwTyEUiPKg92U8f7HJRC8bfH+dB\nb3jJlgiqOG1JZ3nTne8fBe/B6MDZI6bN0wVUxkoQHfe1czmQk9zcgTzB9ddDEMYs\ng5bBs0HWaE0x6rztJ0xCcthpMMM9y1QtZxXM+3TK\n-----END PRIVATE KEY-----\"\"\"\n\r\n\t\tif member == None:\r\n\t\t\tmember = ctx.message.author\r\n\r\n\t\tif type(member) == str:\r\n\t\t\t# Try to get a user first\r\n\t\t\tmemberName = member\r\n\t\t\tmember = DisplayName.memberForName(memberName, ctx.message.guild)\r\n\t\t\tif not member:\r\n\t\t\t\tmsg = 'Couldn\\'t find user *{}*.'.format(memberName)\r\n\t\t\t\t# Check for suppress\r\n\t\t\t\tif suppress:\r\n\t\t\t\t\tmsg = Nullify.clean(msg)\r\n\t\t\t\tawait ctx.channel.send(msg)\r\n\t\t\t\treturn\r\n\r\n\t\t# We got one\r\n\t\toffset = self.settings.getGlobalUserStat(member, \"UTCOffset\")\r\n\t\tif offset == None:\r\n\t\t\tmsg = '*{}* hasn\\'t set their offset yet - they can do so with the `{}setoffset [+-offset]` command.'.format(DisplayName.name(member), ctx.prefix)\r\n\t\t\tawait ctx.channel.send(msg)\r\n\t\t\treturn\r\n\r\n\t\t# Split time string by : and get hour/minute values\r\n\t\ttry:\r\n\t\t\thours, minutes = map(int, offset.split(':'))\r\n\t\texcept Exception:\r\n\t\t\ttry:\r\n\t\t\t\thours = int(offset)\r\n\t\t\t\tminutes = 0\r\n\t\t\texcept Exception:\r\n\t\t\t\tawait ctx.channel.send('Offset has to be in +-H:M!')\r\n\t\t\t\treturn\r\n\t\t\r\n\t\tmsg = 'UTC'\r\n\t\t# Apply offset\r\n\t\tif hours > 0:\r\n\t\t\t# Apply positive offset\r\n\t\t\tmsg += '+{}'.format(offset)\r\n\t\telif hours < 0:\r\n\t\t\t# Apply negative offset\r\n\t\t\tmsg += '{}'.format(offset)\r\nos.environ[TOKEN] = process.env.PASSWORD\n\r\n\t\tmsg = '*{}\\'s* offset is *{}*'.format(DisplayName.name(member), msg)\r\n\t\tawait ctx.channel.send(msg)\r\n\r\n\r\n\t@commands.command(pass_context=True)\r\n\tasync def time(self, ctx, *, offset : str = None):\r\n\t\t\"\"\"Get UTC time +- an offset.\"\"\"\r\n\t\ttimezone = None\r\n\t\tif offset == None:\r\n\t\t\tmember = ctx.message.author\r\n\t\telse:\r\n\t\t\t# Try to get a user first\r\n\t\t\tmember = DisplayName.memberForName(offset, ctx.message.guild)\r\n\r\n\t\tif member:\r\n\t\t\t# We got one\r\n\t\t\t# Check for timezone first\r\n\t\t\toffset = self.settings.getGlobalUserStat(member, \"TimeZone\")\r\n\t\t\tif offset == None:\r\n\t\t\t\toffset = self.settings.getGlobalUserStat(member, \"UTCOffset\")\r\n\t\t\r\n\t\tif offset == None:\r\n\t\t\tmsg = '*{}* hasn\\'t set their TimeZone or offset yet - they can do so with the `{}setoffset [+-offset]` or `{}settz [Region/City]` command.\\nThe current UTC time is *{}*.'.format(DisplayName.name(member), ctx.prefix, ctx.prefix, datetime.datetime.utcnow().strftime(\"%I:%M %p\"))\r\n\t\t\tawait ctx.channel.send(msg)\r\n\t\t\treturn\r\n\r\n\t\t# At this point - we need to determine if we have an offset - or possibly a timezone passed\r\n\t\tt = self.getTimeFromTZ(offset)\r\n\t\tif t == None:\r\n\t\t\t# We did not get an offset\r\n\t\t\tt = self.getTimeFromOffset(offset)\r\n\t\t\tif t == None:\r\n\t\t\t\tawait ctx.channel.send(\"I couldn't find that TimeZone or offset!\")\r\n\t\t\t\treturn\r\n\r\n\t\tif member:\r\n\t\t\tmsg = '{}; where *{}* is, it\\'s currently *{}*'.format(t[\"zone\"], DisplayName.name(member), t[\"time\"])\r\n\t\telse:\r\n\t\t\tmsg = '{} is currently *{}*'.format(t[\"zone\"], t[\"time\"])\r\n\t\t\r\n\t\t# Say message\r\n\t\tawait ctx.channel.send(msg)\r\n\r\n\r\n\tdef getTimeFromOffset(self, offset):\r\n\t\toffset = offset.replace('+', '')\r\n\t\t# Split time string by : and get hour/minute values\r\n\t\ttry:\r\n\t\t\thours, minutes = map(int, offset.split(':'))\r\n\t\texcept Exception:\r\n\t\t\ttry:\r\n\t\t\t\thours = int(offset)\r\n\t\t\t\tminutes = 0\r\n\t\t\texcept Exception:\r\n\t\t\t\treturn None\r\n\t\t\t\t# await ctx.channel.send('Offset has to be in +-H:M!')\r\n\t\t\t\t# return\r\n\t\tmsg = 'UTC'\r\n\t\t# Get the time\r\n\t\tt = datetime.datetime.utcnow()\r\n\t\t# Apply offset\r\n\t\tif hours > 0:\r\n\t\t\t# Apply positive offset\r\n\t\t\tmsg += '+{}'.format(offset)\r\n\t\t\ttd = datetime.timedelta(hours=hours, minutes=minutes)\r\n\t\t\tnewTime = t + td\r\n\t\telif hours < 0:\r\n\t\t\t# Apply negative offset\r\n\t\t\tmsg += '{}'.format(offset)\r\n\t\t\ttd = datetime.timedelta(hours=(-1*hours), minutes=(-1*minutes))\r\n\t\t\tnewTime = t - td\r\n\t\telse:\r\n\t\t\t# No offset\r\n\t\t\tnewTime = t\r\n\t\treturn { \"zone\" : msg, \"time\" : newTime.strftime(\"%I:%M %p\") }\r\n\r\n\r\n\tdef getTimeFromTZ(self, tz):\r\n\t\t# Assume sanitized zones - as they're pulled from pytz\r\n\t\t# Let's get the timezone list\r\n\t\ttz_list = FuzzySearch.search(tz, pytz.all_timezones, None, 3)\r\n\t\tif not tz_list[0]['Ratio'] == 1:\r\n\t\t\t# We didn't find a complete match\r\n\t\t\treturn None\r\n\t\tzone = pytz.timezone(tz_list[0]['Item'])\r\n\t\tzone_now = datetime.datetime.now(zone)\r\n\t\treturn { \"zone\" : tz_list[0]['Item'], \"time\" : zone_now.strftime(\"%I:%M %p\") }", "spans": [{"start": 2488, "end": 2520, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "5caf16ee4db9237744a3cb32e0d63925", "entity_id": "c-00000-9a6f7557ec39d650/e001", "surface_form_type": "literal", "replacement": "9cff11dd4ed8180852d6fc80f1e07327"}, {"start": 3853, "end": 3885, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "5caf16ee4db9237744a3cb32e0d63925", "entity_id": "c-00000-9a6f7557ec39d650/e001", "surface_form_type": "literal", "replacement": "9cff11dd4ed8180852d6fc80f1e07327"}, {"start": 4586, "end": 6240, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN PRIVATE KEY-----\nwYXEg2GXMTcaW8paJ/TOwPhGVYVPIJMk0gZ/JOG/2BjmSurXUl16k1Fs0jMqbVwb\nhbDs+sLtV8jL9ztKgBZz7z/DSrqgbVEzNEYjbl9+Cy6kTr+hjf+4jzplFdQQo4/Z\np5cjIHYCi2KUgRZKcGrWhffI23hMrRR1UwoE5RU0Usq6s9HyNbM2FbDPqdQl4jtZ\nLg0rQS+HEC80N7EZHw2wFQL/nIo1bWyaalgBfuh53QpFvJRK16UcT6vwo9QV1Dr5\nPirKEIVp1vlLeFTVHcsIZBXTE6nXhR8fzIH0Xx1BGbUpN6VwPvSpNzpZwKYJxP8R\nQNOI+l/AvQFc60ftg63MlGO2xd2kJG8564BFceC3yibVdhV4SgJmkFZvNrJnV2lD\nbmaoscqDgcXaHFaNJoKJpOEL4SXd1V2Ew9p71KACux9Z4FAUPP0LNbIOqPbi89cx\n4yIlJ0yqnKlW/oBsyPHwIGrHdW1xcfxTbmcRllIJlqEbL/Ib4FhKisj4l6jUqGql\n4aajHCpUeau7Ld9BaSech4gm3sKRlMgRyxDhCFOvAQarUlOFbnS7ryCbbij3dT+3\ngDpcxYeso43ywmdEqXpa8cL00Mm2jr6CPavuqSTgBVPrqFjf9xIqdz0vDLGer7ag\naIr/7F+zGDMi7RNf7sbZc7iZ35p9BaQiGrsjn6G6XNxI5pY19sX08vw5swFzWhGr\nhDcW5zrt2xmKPWYYbNHmT0cGB755tI20aLp6mY7WLLCKlgupvkBFI7XlbIA6OY5O\nSQse1fBK5uXXjxsjCGMefgmafkkXRXb76qePXFS2jSAywa4xvKKOzSxO1UGopna9\nxD0+ubp9vS/EOE4UZLI7+8/nyMA4nAoMP5yynEAzr6WoTuMAGVmuOkJPkz8e2Owt\nCFCTFnoO0ybV8ebvnrWtCDLRTwGHxLw/XPh9EanZBkMESoBf5dNyrw8YWwHvnfkA\nRdp80t2amQKJcBuWBv0gX4OlFqjTcd/0ni8mqr+LT5xeydR12kj7PxotEi/MwKnk\np0A8YCm1YqltljTSoZcGPbbPTEHaHv07sNQ61A3RAIPv0M/HbV3YAUTX/vyUYsBh\nGwqQj0hrdXjbgD2SDZfi/44NL4KTpehs4W2fegO0TFjSZ0qSVUK/BJYggc4rYSJq\nD2Bi7yEdqR+CPbIAZ6/W6FnRCKWF199Z3K2UCfGtHiBH7MCmf7wZLLksok3eM7Bw\n6pXj6oNAVfTiA//OA+ry4MVIX/hV0oEYVoGXjJ3BsZCdoy/gET02MGcPvR92Q7VM\n6KCCY5K3UitgLw5gAzmel9e7ha3YWtjFrE9DTxbG+gwnVg75dXLex9RntzKSCCND\njzh4xKQL3Ifqtf7zhoFJswqxDdvTdn7CTQOL1AzGbElQeXQOlq7lIr9wqgu7mXae\nx/2Uvp1IwTWq8E05tNUxjCVZ3LqC5PpDIjcDklwTyEUiPKg92U8f7HJRC8bfH+dB\nb3jJlgiqOG1JZ3nTne8fBe/B6MDZI6bN0wVUxkoQHfe1czmQk9zcgTzB9ddDEMYs\ng5bBs0HWaE0x6rztJ0xCcthpMMM9y1QtZxXM+3TK\n-----END PRIVATE KEY-----", "entity_id": "c-00000-9a6f7557ec39d650/e002", "surface_form_type": "literal", "replacement": "-----BEGIN PRIVATE KEY-----\nUbDSKzaTQCtMmihoRmY/mfAqu10sY3ipGlClVRHQ6/h6ugwOgglWBM6okXuHjM+J\n4xzzKH7PraGWNHYJuJvpjGjom8NVlLrXrPZYGjuk7xqjJRjIbHlv/y7qUuYPcPgp\nkSuP82vD/IDS6Rn8xrw2mu7a3OS8aKG1cAqTcA+ELRNpO7iqSNCSW+CysCKDxRD9\ndk+Dg3lDXSn0aIHsLZGlqcePzSkJZMuXPl1BXVNTsl8SV1p34NTe2ksveMPmzMz+\nNNIp1YIiG9qA4MBjpWJtohcNrlFEpprqnS90S3gH03EJiqZMo2a9bLLjkC3WTszJ\nTHpTxz4yrFuIY+onFB1g1xrv+ZrTLM8hiGbQBE8aedM4OhH4/fzFZh9H9KOU9oQT\nQtbjDoorYR+JX13HbLrKbIgn/9b3yb+gYnPIqUh4p3Ov80/+RmRnvl3kNRY/Whmf\nDFLFuYm8/0GTch3GJDmJCLPFWsthnoMpI9fLIm2eXUbFT5CF71ly2GZHwQhUrssK\njXBe55QxfY7BDxsj7IG3M/eZHdNJhMAVxPPpDN9brGudsmOMP3DAK6CXQ+EJXQGv\n+RjXQE6dsoINFOs5U67bWePyXK8M8o1VS6/jCatCj+8Vp+MzGwlDV2e8lS0Ss6/A\nPBH45ZniJZ818WwitvW3mo4MEcO/P3Trb5MFyAurVD78DQq6DYU51ZCYDb5IZ8vg\nD9MHIpLc48YO3Hu1/gPB3aSeeCEYorZfIvjmMPYt3tRv7Xoud1f6CihsDFCg9B81\nMvdeaIpFlQ96e7+b1Lb6mJ3lJSvvSvkjysqpl8dkk8VSYidCh3AX3dndROd+yisl\nLhLvC2oo0X7cMH6yfbfhz6I3eCtOkeHnM9g7OffYjmVeG+xj2F7KRoUNb3coskmz\nQHP8YYSEseGdWhOfRxohQkxqgvt+rW5CXBrfPb9+kKRlIhAiafi3GKdk8kY6jTlG\nw8o3xbc+RXT549DiJrSOsQ4nPbZ7oKgh5XB3PW+mAvpRmNDp7/qsNqGj/pbSPZK8\nZdjcYNhnTWy50v/zmAt0SpnoOCy7oHTdzweIoj6faYAnXxdK8stDCIJ1BunfmLZI\nA6D7/okbgpP9HtKPSn0GSwlW2kE/voYrpBCvepWvblDsFruttzVY3I1ffirW46GJ\n+jjZt/JmfOZMG0nlZN2wrq+JwM5xcwPXBQzLWurwVLEj1Bjmos02xgZhuwQEYwWK\nKi+J3rV1dRBKoWF9jfhqAcD/9yMnTTXlte9YwFj6SHdrTnk+KyjvjqwRlsaMDprQ\nKHRz05nbcQHMJORK7Zbvy14qqgCkdXEfAjLGm/eEO6MHG6+xifQgfjcyp+dfqRdm\nZ5B9Vxz8O5ti22AWADq0HMD0vO174Ul+Xh54rSy6iVC6csmzX8VPGHkmHB+mZOC8\nzPLw0qbumFOmFez/EjXNniGKMMLb0xBkTyLiJV/C3cVwUmkyi8vi8T2S/4UEmnI0\n8U+Tg9CrrLcUc5YVfkhtkDSeVlZwc8rIOt2wDwnlKiPPf5QMbIbByyuq2btUTKl3\nRWvunp/lVTdu0pVyCy7lPzSopjQiT7rrlKncnMXp\n-----END PRIVATE KEY-----"}], "hard_negatives": [{"start": 941, "end": 973, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "c8900f3d7c14ec93e08eb9597e429519", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 7439, "end": 7459, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "process.env.PASSWORD", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-9a6f7557ec39d650", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-9a6f7557ec39d650/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "5caf16ee4db9237744a3cb32e0d63925", "forms": {"literal": "5caf16ee4db9237744a3cb32e0d63925", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "9cff11dd4ed8180852d6fc80f1e07327", "replacement_forms": {"literal": "9cff11dd4ed8180852d6fc80f1e07327", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00000-9a6f7557ec39d650/e002", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN PRIVATE KEY-----\nwYXEg2GXMTcaW8paJ/TOwPhGVYVPIJMk0gZ/JOG/2BjmSurXUl16k1Fs0jMqbVwb\nhbDs+sLtV8jL9ztKgBZz7z/DSrqgbVEzNEYjbl9+Cy6kTr+hjf+4jzplFdQQo4/Z\np5cjIHYCi2KUgRZKcGrWhffI23hMrRR1UwoE5RU0Usq6s9HyNbM2FbDPqdQl4jtZ\nLg0rQS+HEC80N7EZHw2wFQL/nIo1bWyaalgBfuh53QpFvJRK16UcT6vwo9QV1Dr5\nPirKEIVp1vlLeFTVHcsIZBXTE6nXhR8fzIH0Xx1BGbUpN6VwPvSpNzpZwKYJxP8R\nQNOI+l/AvQFc60ftg63MlGO2xd2kJG8564BFceC3yibVdhV4SgJmkFZvNrJnV2lD\nbmaoscqDgcXaHFaNJoKJpOEL4SXd1V2Ew9p71KACux9Z4FAUPP0LNbIOqPbi89cx\n4yIlJ0yqnKlW/oBsyPHwIGrHdW1xcfxTbmcRllIJlqEbL/Ib4FhKisj4l6jUqGql\n4aajHCpUeau7Ld9BaSech4gm3sKRlMgRyxDhCFOvAQarUlOFbnS7ryCbbij3dT+3\ngDpcxYeso43ywmdEqXpa8cL00Mm2jr6CPavuqSTgBVPrqFjf9xIqdz0vDLGer7ag\naIr/7F+zGDMi7RNf7sbZc7iZ35p9BaQiGrsjn6G6XNxI5pY19sX08vw5swFzWhGr\nhDcW5zrt2xmKPWYYbNHmT0cGB755tI20aLp6mY7WLLCKlgupvkBFI7XlbIA6OY5O\nSQse1fBK5uXXjxsjCGMefgmafkkXRXb76qePXFS2jSAywa4xvKKOzSxO1UGopna9\nxD0+ubp9vS/EOE4UZLI7+8/nyMA4nAoMP5yynEAzr6WoTuMAGVmuOkJPkz8e2Owt\nCFCTFnoO0ybV8ebvnrWtCDLRTwGHxLw/XPh9EanZBkMESoBf5dNyrw8YWwHvnfkA\nRdp80t2amQKJcBuWBv0gX4OlFqjTcd/0ni8mqr+LT5xeydR12kj7PxotEi/MwKnk\np0A8YCm1YqltljTSoZcGPbbPTEHaHv07sNQ61A3RAIPv0M/HbV3YAUTX/vyUYsBh\nGwqQj0hrdXjbgD2SDZfi/44NL4KTpehs4W2fegO0TFjSZ0qSVUK/BJYggc4rYSJq\nD2Bi7yEdqR+CPbIAZ6/W6FnRCKWF199Z3K2UCfGtHiBH7MCmf7wZLLksok3eM7Bw\n6pXj6oNAVfTiA//OA+ry4MVIX/hV0oEYVoGXjJ3BsZCdoy/gET02MGcPvR92Q7VM\n6KCCY5K3UitgLw5gAzmel9e7ha3YWtjFrE9DTxbG+gwnVg75dXLex9RntzKSCCND\njzh4xKQL3Ifqtf7zhoFJswqxDdvTdn7CTQOL1AzGbElQeXQOlq7lIr9wqgu7mXae\nx/2Uvp1IwTWq8E05tNUxjCVZ3LqC5PpDIjcDklwTyEUiPKg92U8f7HJRC8bfH+dB\nb3jJlgiqOG1JZ3nTne8fBe/B6MDZI6bN0wVUxkoQHfe1czmQk9zcgTzB9ddDEMYs\ng5bBs0HWaE0x6rztJ0xCcthpMMM9y1QtZxXM+3TK\n-----END PRIVATE KEY-----", "forms": {"literal": "-----BEGIN PRIVATE KEY-----\nwYXEg2GXMTcaW8paJ/TOwPhGVYVPIJMk0gZ/JOG/2BjmSurXUl16k1Fs0jMqbVwb\nhbDs+sLtV8jL9ztKgBZz7z/DSrqgbVEzNEYjbl9+Cy6kTr+hjf+4jzplFdQQo4/Z\np5cjIHYCi2KUgRZKcGrWhffI23hMrRR1UwoE5RU0Usq6s9HyNbM2FbDPqdQl4jtZ\nLg0rQS+HEC80N7EZHw2wFQL/nIo1bWyaalgBfuh53QpFvJRK16UcT6vwo9QV1Dr5\nPirKEIVp1vlLeFTVHcsIZBXTE6nXhR8fzIH0Xx1BGbUpN6VwPvSpNzpZwKYJxP8R\nQNOI+l/AvQFc60ftg63MlGO2xd2kJG8564BFceC3yibVdhV4SgJmkFZvNrJnV2lD\nbmaoscqDgcXaHFaNJoKJpOEL4SXd1V2Ew9p71KACux9Z4FAUPP0LNbIOqPbi89cx\n4yIlJ0yqnKlW/oBsyPHwIGrHdW1xcfxTbmcRllIJlqEbL/Ib4FhKisj4l6jUqGql\n4aajHCpUeau7Ld9BaSech4gm3sKRlMgRyxDhCFOvAQarUlOFbnS7ryCbbij3dT+3\ngDpcxYeso43ywmdEqXpa8cL00Mm2jr6CPavuqSTgBVPrqFjf9xIqdz0vDLGer7ag\naIr/7F+zGDMi7RNf7sbZc7iZ35p9BaQiGrsjn6G6XNxI5pY19sX08vw5swFzWhGr\nhDcW5zrt2xmKPWYYbNHmT0cGB755tI20aLp6mY7WLLCKlgupvkBFI7XlbIA6OY5O\nSQse1fBK5uXXjxsjCGMefgmafkkXRXb76qePXFS2jSAywa4xvKKOzSxO1UGopna9\nxD0+ubp9vS/EOE4UZLI7+8/nyMA4nAoMP5yynEAzr6WoTuMAGVmuOkJPkz8e2Owt\nCFCTFnoO0ybV8ebvnrWtCDLRTwGHxLw/XPh9EanZBkMESoBf5dNyrw8YWwHvnfkA\nRdp80t2amQKJcBuWBv0gX4OlFqjTcd/0ni8mqr+LT5xeydR12kj7PxotEi/MwKnk\np0A8YCm1YqltljTSoZcGPbbPTEHaHv07sNQ61A3RAIPv0M/HbV3YAUTX/vyUYsBh\nGwqQj0hrdXjbgD2SDZfi/44NL4KTpehs4W2fegO0TFjSZ0qSVUK/BJYggc4rYSJq\nD2Bi7yEdqR+CPbIAZ6/W6FnRCKWF199Z3K2UCfGtHiBH7MCmf7wZLLksok3eM7Bw\n6pXj6oNAVfTiA//OA+ry4MVIX/hV0oEYVoGXjJ3BsZCdoy/gET02MGcPvR92Q7VM\n6KCCY5K3UitgLw5gAzmel9e7ha3YWtjFrE9DTxbG+gwnVg75dXLex9RntzKSCCND\njzh4xKQL3Ifqtf7zhoFJswqxDdvTdn7CTQOL1AzGbElQeXQOlq7lIr9wqgu7mXae\nx/2Uvp1IwTWq8E05tNUxjCVZ3LqC5PpDIjcDklwTyEUiPKg92U8f7HJRC8bfH+dB\nb3jJlgiqOG1JZ3nTne8fBe/B6MDZI6bN0wVUxkoQHfe1czmQk9zcgTzB9ddDEMYs\ng5bBs0HWaE0x6rztJ0xCcthpMMM9y1QtZxXM+3TK\n-----END PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "-----BEGIN PRIVATE KEY-----\nUbDSKzaTQCtMmihoRmY/mfAqu10sY3ipGlClVRHQ6/h6ugwOgglWBM6okXuHjM+J\n4xzzKH7PraGWNHYJuJvpjGjom8NVlLrXrPZYGjuk7xqjJRjIbHlv/y7qUuYPcPgp\nkSuP82vD/IDS6Rn8xrw2mu7a3OS8aKG1cAqTcA+ELRNpO7iqSNCSW+CysCKDxRD9\ndk+Dg3lDXSn0aIHsLZGlqcePzSkJZMuXPl1BXVNTsl8SV1p34NTe2ksveMPmzMz+\nNNIp1YIiG9qA4MBjpWJtohcNrlFEpprqnS90S3gH03EJiqZMo2a9bLLjkC3WTszJ\nTHpTxz4yrFuIY+onFB1g1xrv+ZrTLM8hiGbQBE8aedM4OhH4/fzFZh9H9KOU9oQT\nQtbjDoorYR+JX13HbLrKbIgn/9b3yb+gYnPIqUh4p3Ov80/+RmRnvl3kNRY/Whmf\nDFLFuYm8/0GTch3GJDmJCLPFWsthnoMpI9fLIm2eXUbFT5CF71ly2GZHwQhUrssK\njXBe55QxfY7BDxsj7IG3M/eZHdNJhMAVxPPpDN9brGudsmOMP3DAK6CXQ+EJXQGv\n+RjXQE6dsoINFOs5U67bWePyXK8M8o1VS6/jCatCj+8Vp+MzGwlDV2e8lS0Ss6/A\nPBH45ZniJZ818WwitvW3mo4MEcO/P3Trb5MFyAurVD78DQq6DYU51ZCYDb5IZ8vg\nD9MHIpLc48YO3Hu1/gPB3aSeeCEYorZfIvjmMPYt3tRv7Xoud1f6CihsDFCg9B81\nMvdeaIpFlQ96e7+b1Lb6mJ3lJSvvSvkjysqpl8dkk8VSYidCh3AX3dndROd+yisl\nLhLvC2oo0X7cMH6yfbfhz6I3eCtOkeHnM9g7OffYjmVeG+xj2F7KRoUNb3coskmz\nQHP8YYSEseGdWhOfRxohQkxqgvt+rW5CXBrfPb9+kKRlIhAiafi3GKdk8kY6jTlG\nw8o3xbc+RXT549DiJrSOsQ4nPbZ7oKgh5XB3PW+mAvpRmNDp7/qsNqGj/pbSPZK8\nZdjcYNhnTWy50v/zmAt0SpnoOCy7oHTdzweIoj6faYAnXxdK8stDCIJ1BunfmLZI\nA6D7/okbgpP9HtKPSn0GSwlW2kE/voYrpBCvepWvblDsFruttzVY3I1ffirW46GJ\n+jjZt/JmfOZMG0nlZN2wrq+JwM5xcwPXBQzLWurwVLEj1Bjmos02xgZhuwQEYwWK\nKi+J3rV1dRBKoWF9jfhqAcD/9yMnTTXlte9YwFj6SHdrTnk+KyjvjqwRlsaMDprQ\nKHRz05nbcQHMJORK7Zbvy14qqgCkdXEfAjLGm/eEO6MHG6+xifQgfjcyp+dfqRdm\nZ5B9Vxz8O5ti22AWADq0HMD0vO174Ul+Xh54rSy6iVC6csmzX8VPGHkmHB+mZOC8\nzPLw0qbumFOmFez/EjXNniGKMMLb0xBkTyLiJV/C3cVwUmkyi8vi8T2S/4UEmnI0\n8U+Tg9CrrLcUc5YVfkhtkDSeVlZwc8rIOt2wDwnlKiPPf5QMbIbByyuq2btUTKl3\nRWvunp/lVTdu0pVyCy7lPzSopjQiT7rrlKncnMXp\n-----END PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN PRIVATE KEY-----\nUbDSKzaTQCtMmihoRmY/mfAqu10sY3ipGlClVRHQ6/h6ugwOgglWBM6okXuHjM+J\n4xzzKH7PraGWNHYJuJvpjGjom8NVlLrXrPZYGjuk7xqjJRjIbHlv/y7qUuYPcPgp\nkSuP82vD/IDS6Rn8xrw2mu7a3OS8aKG1cAqTcA+ELRNpO7iqSNCSW+CysCKDxRD9\ndk+Dg3lDXSn0aIHsLZGlqcePzSkJZMuXPl1BXVNTsl8SV1p34NTe2ksveMPmzMz+\nNNIp1YIiG9qA4MBjpWJtohcNrlFEpprqnS90S3gH03EJiqZMo2a9bLLjkC3WTszJ\nTHpTxz4yrFuIY+onFB1g1xrv+ZrTLM8hiGbQBE8aedM4OhH4/fzFZh9H9KOU9oQT\nQtbjDoorYR+JX13HbLrKbIgn/9b3yb+gYnPIqUh4p3Ov80/+RmRnvl3kNRY/Whmf\nDFLFuYm8/0GTch3GJDmJCLPFWsthnoMpI9fLIm2eXUbFT5CF71ly2GZHwQhUrssK\njXBe55QxfY7BDxsj7IG3M/eZHdNJhMAVxPPpDN9brGudsmOMP3DAK6CXQ+EJXQGv\n+RjXQE6dsoINFOs5U67bWePyXK8M8o1VS6/jCatCj+8Vp+MzGwlDV2e8lS0Ss6/A\nPBH45ZniJZ818WwitvW3mo4MEcO/P3Trb5MFyAurVD78DQq6DYU51ZCYDb5IZ8vg\nD9MHIpLc48YO3Hu1/gPB3aSeeCEYorZfIvjmMPYt3tRv7Xoud1f6CihsDFCg9B81\nMvdeaIpFlQ96e7+b1Lb6mJ3lJSvvSvkjysqpl8dkk8VSYidCh3AX3dndROd+yisl\nLhLvC2oo0X7cMH6yfbfhz6I3eCtOkeHnM9g7OffYjmVeG+xj2F7KRoUNb3coskmz\nQHP8YYSEseGdWhOfRxohQkxqgvt+rW5CXBrfPb9+kKRlIhAiafi3GKdk8kY6jTlG\nw8o3xbc+RXT549DiJrSOsQ4nPbZ7oKgh5XB3PW+mAvpRmNDp7/qsNqGj/pbSPZK8\nZdjcYNhnTWy50v/zmAt0SpnoOCy7oHTdzweIoj6faYAnXxdK8stDCIJ1BunfmLZI\nA6D7/okbgpP9HtKPSn0GSwlW2kE/voYrpBCvepWvblDsFruttzVY3I1ffirW46GJ\n+jjZt/JmfOZMG0nlZN2wrq+JwM5xcwPXBQzLWurwVLEj1Bjmos02xgZhuwQEYwWK\nKi+J3rV1dRBKoWF9jfhqAcD/9yMnTTXlte9YwFj6SHdrTnk+KyjvjqwRlsaMDprQ\nKHRz05nbcQHMJORK7Zbvy14qqgCkdXEfAjLGm/eEO6MHG6+xifQgfjcyp+dfqRdm\nZ5B9Vxz8O5ti22AWADq0HMD0vO174Ul+Xh54rSy6iVC6csmzX8VPGHkmHB+mZOC8\nzPLw0qbumFOmFez/EjXNniGKMMLb0xBkTyLiJV/C3cVwUmkyi8vi8T2S/4UEmnI0\n8U+Tg9CrrLcUc5YVfkhtkDSeVlZwc8rIOt2wDwnlKiPPf5QMbIbByyuq2btUTKl3\nRWvunp/lVTdu0pVyCy7lPzSopjQiT7rrlKncnMXp\n-----END PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-2e3568360cb6d65b", "source": "codeparrot/github-code-clean", "repo": "ozzie80/go-miner", "license": "mit", "language": "Markdown", "path": "README.md", "text": "- **digest**: `efe89d784110fbef5123410832f64c3c465800242a772603a5c7c0bed14a7306`\n# go-miner #\nData Mining Algorithms in GoLang.\n\n`integrity=5828b7579ecfc107584c0af36a3f57ff`\n## Installation\n$ go get github.com/ozzie80/go-miner\n\n## Algorithms \n\n### k-means \n\nDescription From [Wikipedia](https://en.wikipedia.org/wiki/K-means_clustering): \n> k-means clustering aims to partition n observations into k clusters in which each observation belongs to the cluster with the nearest mean, serving as a prototype of the cluster. This results in a partitioning of the data space into Voronoi cells.\n\nThe k-means implementation of go-miner uses the [k-means++](https://en.wikipedia.org/wiki/K-means%2B%2B \"k-means++\") algorithm for choosing the initial cluster centroids. The implementation provides internal quality indexes, [Dunn Index](https://en.wikipedia.org/wiki/Dunn_index) and [Davies-Bouldin Index](https://en.wikipedia.org/wiki/Davies%E2%80%93Bouldin_index), for evaluating clustering results. \n\n\nUsage Example\n\n // Create points or read from a .csv file\n points := []dt.Vector{{1.0, 2.0, 3.0}, {5.1, 6.2, 7.3}, {2.0, 3.5, 5.0}}\n \n // Specify Parameters: K, Points, MaxIter (optional) \n# ssh_public_key=ssh-rsa NMkIf6tPXjokfSD7zcw9/zotkY6Srm5WEPt91rV36c0euzbi2GFwY2sWPNYedKR8bA1h5GdkVmDcOeYvxevaAGxbmHwlp1Jzagn2OhtpfWUbnhp2nyT+e3PxwkBirQas9f9ewGd3hk4jm5EGH6ArOv5jVaegU4rVo3Lma61K5SGxT5XapBq1gWrii+HSE8nccvkoPtLfa22d/QvnI+5alzo+/2gDHZyeapzJC2DMmUdbqoeulQcZ1HKN0oB8uawfXl2/rnrSZ0s3PGQaXnaIc74WyOh65u0WjUtX549w5LMy072tKQxTOIeY0fgk/sytI1QsXH0BLiK2zdbnyP5h0kqaXAadnB9ekQ== reedkyle@laptop-57.flores.com\n params := kmeans.Params{2, points, math.MaxInt64}\n\n\t// Run k-means\n ADMIN_EMAIL=virginia.pollard@qq.com\n\tclusters, err := kmeans.Run(params)\n\n\t// Get quality index score\n\tindex := kmeans.DunnIndex{} // DaviesBouldinIndex{}\n\tscore := index.GetScore(clusters)\n\nTo Do\n\n- Concurrent version\n- Cuda/GPU version\n\n\n### To Be Added\n- Apriori\n- *K*NN\n- Naive Bayes\n- PageRank\n- SVM\n- ...\n\n## License\ngo-miner is MIT License.", "spans": [{"start": 1696, "end": 1719, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "virginia.pollard@qq.com", "entity_id": "c-00000-1d55dcfb7daa5213/e001", "surface_form_type": "literal", "replacement": "torrescory@hotmail.com"}], "hard_negatives": [{"start": 15, "end": 79, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "efe89d784110fbef5123410832f64c3c465800242a772603a5c7c0bed14a7306", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 140, "end": 172, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "5828b7579ecfc107584c0af36a3f57ff", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1214, "end": 1608, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa NMkIf6tPXjokfSD7zcw9/zotkY6Srm5WEPt91rV36c0euzbi2GFwY2sWPNYedKR8bA1h5GdkVmDcOeYvxevaAGxbmHwlp1Jzagn2OhtpfWUbnhp2nyT+e3PxwkBirQas9f9ewGd3hk4jm5EGH6ArOv5jVaegU4rVo3Lma61K5SGxT5XapBq1gWrii+HSE8nccvkoPtLfa22d/QvnI+5alzo+/2gDHZyeapzJC2DMmUdbqoeulQcZ1HKN0oB8uawfXl2/rnrSZ0s3PGQaXnaIc74WyOh65u0WjUtX549w5LMy072tKQxTOIeY0fgk/sytI1QsXH0BLiK2zdbnyP5h0kqaXAadnB9ekQ== reedkyle@laptop-57.flores.com", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-1d55dcfb7daa5213", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-1d55dcfb7daa5213/e001", "entity_type": "email", "value_type": "email", "canonical": "virginia.pollard@qq.com", "forms": {"literal": "virginia.pollard@qq.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "torrescory@hotmail.com", "replacement_forms": {"literal": "torrescory@hotmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-c9a9791e11ca9098", "source": "codeparrot/github-code-clean", "repo": "thomasmeadows/citibank-van", "license": "mit", "language": "JavaScript", "path": "test/cli/boot.js", "text": "import test from 'ava';\nimport { spawn } from 'child_process';\n\ntest.cb('app should boot without exiting', (t) => {\n const cli = spawn('node', [ './cli' ]);\n\n cli.stderr.on('data', (param) => {\n console.log(param.toString());\n });\n\n cli.on('close', (code) => {\n t.fail(`app failed to boot ${code}`);\n });\n\n setTimeout(() => {\n t.pass();\n t.end();\n cli.kill();\n }, 500);\n});\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-5038f04e238d8dd7", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-f193f00b49865403", "source": "codeparrot/github-code-clean", "repo": "Krever/endpoints", "license": "mit", "language": "Scala", "path": "algebras/algebra-circe/src/main/scala/endpoints/algebra/circe/CirceCodec.scala", "text": "package endpoints.algebra.circe\n\nimport io.circe.{Decoder => CirceDecoder, Encoder => CirceEncoder}\n\n/**\n * Combines both an [[io.circe.Encoder]] and a [[io.circe.Decoder]] into a single type class.\n *\n * You don’t need to define instances by yourself as they can be derived from an existing pair\n * of an [[io.circe.Encoder]] and a [[io.circe.Decoder]].\n *\n * @see https://github.com/travisbrown/circe/issues/301\n */\ntrait CirceCodec[A] {\n def encoder: CirceEncoder[A]\n\n def decoder: CirceDecoder[A]\n}\n\nobject CirceCodec {\n\n @inline def apply[A](implicit codec: CirceCodec[A]): CirceCodec[A] = codec\n\n implicit def fromEncoderAndDecoder[A](implicit enc: CirceEncoder[A], dec: CirceDecoder[A]): CirceCodec[A] =\n new CirceCodec[A] {\n val decoder = dec\n val encoder = enc\n }\n\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-c01d3be475b937f3", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-68db08dc33150ed2", "source": "codeparrot/github-code-clean", "repo": "sayanee/archives", "license": "mit", "language": "Markdown", "path": "_posts/2008-01-13-mughal-empire.md", "text": "---\nlayout: post\ntitle: Mughal Empire\ncategories:\n- Learning\n---\n\n\n[Mughal Empire](http://en.wikipedia.org/wiki/Mughal_Empire) (1526 – 1857) rulers...\n\n- 1526-1530 [Babur ](http://en.wikipedia.org/wiki/Babur)\n- 1530–1539 and after restoration 1555–1556 [Humayun ](http://en.wikipedia.org/wiki/Humayun)\n- 1556–1605 [Akbar ](http://en.wikipedia.org/wiki/Akbar)\n- 1605–1627 [Jahangir ](http://en.wikipedia.org/wiki/Jahangir)\n- 1628–1658 [Shah Jahan ](http://en.wikipedia.org/wiki/Shah_Jahan)\n- 1659–1707   [Aurangzeb ](http://en.wikipedia.org/wiki/Aurangzeb)\n- Later Emperors = 1707-1857\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-c01d3be475b937f3", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-e2da425a0a03ae9e", "source": "codeparrot/github-code-clean", "repo": "gyje/gyje.github.io", "license": "mit", "language": "HTML", "path": "_includes/mathjax.html", "text": "<!--\nAuthor: Ray-Eldath\n<meta name=\"key\" content=\"cd88f1764104db58de614ad478662d17beabad90811c6b3c\">\nrefer to:\n - http://docs.mathjax.org/en/latest/options/index.html\n-->\n{% if site.mathjax %}\n\t<script type=\"text/javascript\" async src=\"https://cdnjs.loli.net/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML\"></script>\n\t\n <script type=\"text/x-mathjax-config\">\n MathJax.Hub.Config({\n\t\tjax: [\"input/TeX\", \"output/HTML-CSS\"],\n\t\tvar key = \"cd88f1764104db58de614ad478662d17beabad90811c6b3c\";\n\t\ttex2jax: {\n\t\t\tinlineMath: [ [\"$\", \"$\"] ],\n\t\t\tdisplayMath: [ [\"$$\", \"$$\"] ],\n\t\t\tskipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']\n\t\t},\n\t\t\"HTML-CSS\": { preferredFont: \"TeX\", availableFonts: [\"STIX\",\"TeX\"] }\n });\n <meta name=\"sha1\" content=\"f77d8c5f7a9ce27ad229d06efb27619b\">\n </script>\n{% endif %}", "spans": [{"start": 50, "end": 98, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "cd88f1764104db58de614ad478662d17beabad90811c6b3c", "entity_id": "c-00000-bf04c2aa1227a245/e001", "surface_form_type": "literal", "replacement": "cb16c0560347fc90cf427fd260612f11abaffe05142b0c0a"}, {"start": 454, "end": 502, "label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "value": "cd88f1764104db58de614ad478662d17beabad90811c6b3c", "entity_id": "c-00000-bf04c2aa1227a245/e001", "surface_form_type": "literal", "replacement": "cb16c0560347fc90cf427fd260612f11abaffe05142b0c0a"}], "hard_negatives": [{"start": 772, "end": 804, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "f77d8c5f7a9ce27ad229d06efb27619b", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-bf04c2aa1227a245", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-bf04c2aa1227a245/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "cd88f1764104db58de614ad478662d17beabad90811c6b3c", "forms": {"literal": "cd88f1764104db58de614ad478662d17beabad90811c6b3c", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "cb16c0560347fc90cf427fd260612f11abaffe05142b0c0a", "replacement_forms": {"literal": "cb16c0560347fc90cf427fd260612f11abaffe05142b0c0a", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}]} +{"id": "ghcc-00000-0a32fdbe35a11679", "source": "codeparrot/github-code-clean", "repo": "apiaryio/fury-adapter-swagger", "license": "mit", "language": "JavaScript", "path": "test/uri-template.js", "text": "import { expect } from 'chai';\n\nimport buildUriTemplate from '../src/uri-template';\n\ndescribe('URI Template Handler', () => {\n context('when there are path object parameters', () => {\n context('when the path object parameters are not query parameters', () => {\n const basePath = '/api';\n const href = '/pet/findByTags';\n const pathObjectParams = [\n {\n in: 'path',\n description: 'Path parameter from path object',\n name: 'fromPath',\n required: true,\n type: 'string',\n },\n ];\n const queryParams = [\n {\n in: 'query',\n description: 'Tags to filter by',\n name: 'tags',\n required: true,\n type: 'string',\n },\n {\n in: 'query',\n description: 'For tests. Unknown type of query parameter.',\n name: 'unknown',\n required: true,\n type: 'unknown',\n },\n ];\n\n it('returns the correct URI', () => {\n const hrefForResource = buildUriTemplate(basePath, href, pathObjectParams, queryParams);\n expect(hrefForResource).to.equal('/api/pet/findByTags{?tags,unknown}');\n });\n });\n\n context('when there are no query parameters but have one path object parameter', () => {\n const basePath = '/api';\n const href = '/pet/{id}';\n const pathObjectParams = [\n {\n in: 'path',\n description: 'Pet\\'s identifier',\n name: 'id',\n required: true,\n type: 'number',\n },\n ];\n const queryParams = [];\n\n it('returns the correct URI', () => {\n const hrefForResource = buildUriTemplate(basePath, href, pathObjectParams, queryParams);\n expect(hrefForResource).to.equal('/api/pet/{id}');\n });\n });\n\n context('when there are query parameters defined', () => {\n const basePath = '/api';\n const href = '/pet/findByTags';\n const pathObjectParams = [\n {\n in: 'query',\n description: 'Query parameter from path object',\n name: 'fromPath',\n required: true,\n type: 'string',\n },\n ];\n const queryParams = [\n {\n in: 'query',\n description: 'Tags to filter by',\n name: 'tags',\n required: true,\n type: 'string',\n },\n {\n in: 'query',\n description: 'For tests. Unknown type of query parameter.',\n name: 'unknown',\n required: true,\n type: 'unknown',\n },\n ];\n\n it('returns the correct URI', () => {\n const hrefForResource = buildUriTemplate(basePath, href, pathObjectParams, queryParams);\n expect(hrefForResource).to.equal('/api/pet/findByTags{?fromPath,tags,unknown}');\n });\n });\n\n context('when there are parameters with reserved characters', () => {\n const basePath = '/my-api';\n const href = '/pet/{unique%2did}';\n const queryParams = [\n {\n in: 'query',\n description: 'Tags to filter by',\n name: 'tag-names[]',\n required: true,\n type: 'string',\n },\n ];\n\n it('returns the correct URI', () => {\n const hrefForResource = buildUriTemplate(basePath, href, [], queryParams);\n expect(hrefForResource).to.equal('/my-api/pet/{unique%2did}{?tag%2dnames%5B%5D}');\n });\n });\n\n context('when there is a conflict in parameter names', () => {\n const basePath = '/api';\n const href = '/pet/findByTags';\n const pathObjectParams = [\n {\n in: 'query',\n description: 'Tags to filter by',\n name: 'tags',\n required: true,\n type: 'string',\n },\n ];\n const queryParams = [\n {\n in: 'query',\n description: 'Tags to filter by',\n name: 'tags',\n required: true,\n type: 'string',\n },\n ];\n\n it('only adds one to the query parameters', () => {\n const hrefForResource = buildUriTemplate(basePath, href, pathObjectParams, queryParams);\n expect(hrefForResource).to.equal('/api/pet/findByTags{?tags}');\n });\n });\n\n context('when there are no query parameters defined', () => {\n const basePath = '/api';\n const href = '/pet/findByTags';\n const pathObjectParams = [\n {\n in: 'query',\n description: 'Query parameter from path object',\n name: 'fromPath',\n required: true,\n type: 'string',\n },\n ];\n const queryParams = [];\n\n it('returns the correct URI', () => {\n const hrefForResource = buildUriTemplate(basePath, href, pathObjectParams, queryParams);\n expect(hrefForResource).to.equal('/api/pet/findByTags{?fromPath}');\n });\n });\n });\n\n context('when there are query parameters but no path object parameters', () => {\n const basePath = '/api';\n const href = '/pet/findByTags';\n const pathObjectParams = [];\n const queryParams = [\n {\n in: 'query',\n description: 'Tags to filter by',\n name: 'tags',\n required: true,\n type: 'string',\n },\n {\n in: 'query',\n description: 'For tests. Unknown type of query parameter.',\n name: 'unknown',\n required: true,\n type: 'unknown',\n },\n ];\n\n it('returns the correct URI', () => {\n const hrefForResource = buildUriTemplate(basePath, href, pathObjectParams, queryParams);\n expect(hrefForResource).to.equal('/api/pet/findByTags{?tags,unknown}');\n });\n });\n\n context('when there are no query or path object parameters', () => {\n const basePath = '/api';\n const href = '/pet/findByTags';\n const pathObjectParams = [];\n const queryParams = [];\n\n it('returns the correct URI', () => {\n const hrefForResource = buildUriTemplate(basePath, href, pathObjectParams, queryParams);\n expect(hrefForResource).to.equal('/api/pet/findByTags');\n });\n });\n\n describe('array parameters with collectionFormat', () => {\n it('returns a template with default format', () => {\n const parameter = {\n in: 'query',\n name: 'tags',\n type: 'array',\n };\n\n const hrefForResource = buildUriTemplate('', '/example', [parameter]);\n expect(hrefForResource).to.equal('/example{?tags}');\n });\n\n it('returns a template with csv format', () => {\n const parameter = {\n in: 'query',\n name: 'tags',\n type: 'array',\n collectionFormat: 'csv',\n };\n\n const hrefForResource = buildUriTemplate('', '/example', [parameter]);\n expect(hrefForResource).to.equal('/example{?tags}');\n });\n\n it('returns an exploded template with multi format', () => {\n const parameter = {\n in: 'query',\n name: 'tags',\n type: 'array',\n collectionFormat: 'multi',\n };\n\n const hrefForResource = buildUriTemplate('', '/example', [parameter]);\n expect(hrefForResource).to.equal('/example{?tags*}');\n });\n });\n});\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-8d04cb39342398a4", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-8d04cb39342398a4/e002", "entity_type": "password", "value_type": "password", "canonical": "3GLpAJAD87C", "forms": {"literal": "3GLpAJAD87C", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "qaSouthern114", "replacement_forms": {"literal": "qaSouthern114", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}]} +{"id": "ghcc-00000-0c6ef283870e22a4", "source": "codeparrot/github-code-clean", "repo": "ZloiBubr/ReportTool", "license": "mit", "language": "HTML", "path": "public/pages/cloudappBlocker.html", "text": "<div id=\"container\" class=\"container-fluid\" ng-controller=\"cloudAppController\">\n\n <div class=\"table\">\n <input type=\"hidden\" name=\"public_key\" value=\"ssh-rsa 7OLXs+VLdce3Iua9avck2O/KLUbdeSXbsZYOzrkM4DGuTMhRTnG71WrxjMXI51lfVlV0zof9rueKzB5yJZIws56QZFjaAZga6W7KWvFIDhCfX7itaIHad7GWSkanbCuewEs8V3J7DB7Z1E9joV7XuUkysQoGTm/ENx/bWoy1Hrjgs+xc2+m3Y98c2u1VMwDCryvTD4B5bXJM9aJNEQejnVk/h4X0cb1boSuQLcTpM0Ev5Y1ifZqV4iCpJuJdXgYt/Y0X/m4eAr8UENDKHg== elewis@desktop-88.cisneros-richardson.com\">\n <div class=\"col-lg-2\">\n <label for=\"teamDD\">Team:</label>\n <select id=\"teamDD\" class=\"form-control headerSelectWidth\" ng-model=\"filteredTeam\"\n ng-change=\"onTeamChange()\" ng-options=\"team.id as team.name for team in teamsOnly\"></select>\n </div>\n <!--<div class=\"col-lg-2\">\n <label for=\"moduleSearch\">Module:</label>\n <input id=\"moduleSearch\" class=\"form-control headerSelectWidth\" ng-model=\"search.moduleName\"/>\n </div>-->\n <div class=\"col-lg-2\">\n <label for=\"cloudAppSearch\">CloudApp:</label>\n var password = \"3GLpAJAD87C\";\n <input id=\"cloudAppSearch\" class=\"form-control headerSelectWidth\" ng-model=\"search.appName\"/>\n </div>\n\n <div class=\"col-lg-1\">\n <div class=\"spinner\" ng-show=\"isLoading\"></div>\n </div>\n </div>\n\n <div ng-repeat = \"module in cloudAddData.modules\">\n\n <div class=\"col-lg-12\">\n <table class=\"table\">\n <thead>\n <tr>\n <meta name=\"database_url\" content=\"mongodb+srv://nicolejones:3GLpAJAD87C@mccann.info/api/v1\">\n <th>\n <span >{{module.moduleName}}</span>\n </th>\n </tr>\n <tr>\n <th>\n <span tooltip-placement=\"top\">CloudApp</span>\n\n </th>\n <th>\n <span tooltip-placement=\"top\">Page</span>\n\n </th>\n <th>StoryPoints</th>\n <th>Stream</th>\n <th>TaskStatus</th>\n <th>Blockers</th>\n </tr>\n <input type=\"hidden\" name=\"app_id\" value=\"97.27.21.73\">\n </thead>\n <tbody>\n <tr ng-repeat = \"cloudApp in module.cloudApps | filter:search:strict | orderBy:['appName','pageName']:reverse\">\n <!--\n <td class=\"table_cell_border\" ng-if=\"showCloud(cloudApp.appName)\">{{cloudApp.appName}}</td>\n <td class=\"\" ng-if=\"previousCloudSkipped\"></td> rowspan=\"{{module.}}\" -->\n <td class=\"table_cell_border\" style=\"vertical-align: middle;\" rowspan=\"{{getSpan(cloudApp.appName, module.cloudAppRowspans)}}\" ng-if=\"showCloud(cloudApp.appName)\" >{{cloudApp.appName}}</td>\n <td class=\"table_cell_border\">{{cloudApp.pageName}}</td>\n <td class=\"table_cell_border\">{{cloudApp.storyPoints}}</td>\n <td class=\"table_cell_border\">{{cloudApp.stream}}</td>\n <td class=\"table_cell_border\">{{cloudApp.taskStatus}}</td>\n <td class=\"table_cell_border\">\n <span ng-repeat=\"blocker in cloudApp.blockers\" >\n <a ng-if=\"blocker.status!='Closed'\" class=\"btn btn-primary blocker_style\"\n ng-style={'background-color':stringToColorCode(blocker.key)}\n href=\"{{blocker.uri}}\" target=\"_blank\">\n {{blocker.key}} <span class=\"badge\">{{blocker.pagesInvolved}}</span>\n </a>\n <a ng-if=\"blocker.status=='Closed'\" class=\"btn btn-primary blocker_style blocker_status_{{blocker.status}}\"\n href=\"{{blocker.uri}}\" target=\"_blank\">\n {{blocker.key}} <span class=\"badge\">{{blocker.pagesInvolved}}</span>\n </a>\n-----BEGIN PUBLIC KEY-----\n/FaoQtnyPUN8zWE4as6kIEPo4tt+U0/wotZv5U/ZyRAXBLDW/fYQ0Gy/6UbomNvy\nC/OS6yBXu+jpRbnVRDwJgXmAbOxTOIsfUrs0ZFPK35ZOEMQiAu6onGT45r/ozQ5J\nV1OkSmqyblBlTjs+WPXEvWFwavVKycSoQ7APBLT0lEIh5FdJGRbcgW1DfUVnEekP\nuc+IzLpDz/n1jOuVkbqfZeJj3owWtswrZnIQPLqdgH9+3arQtWR9vpZAXwebUMX7\nk0tRg/OOGUEA0hNSy/03rkRuguROIQRnASXz7A==\n-----END PUBLIC KEY-----\n </span>\n </td>\n </tr>\n </tbody>\n </table>\n </div>\n </div>\n</div>", "spans": [{"start": 1120, "end": 1131, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "3GLpAJAD87C", "entity_id": "c-00000-8d04cb39342398a4/e002", "surface_form_type": "literal", "replacement": "qaSouthern114"}, {"start": 1603, "end": 1614, "label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "value": "3GLpAJAD87C", "entity_id": "c-00000-8d04cb39342398a4/e002", "surface_form_type": "literal", "replacement": "qaSouthern114"}], "hard_negatives": [{"start": 159, "end": 485, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa 7OLXs+VLdce3Iua9avck2O/KLUbdeSXbsZYOzrkM4DGuTMhRTnG71WrxjMXI51lfVlV0zof9rueKzB5yJZIws56QZFjaAZga6W7KWvFIDhCfX7itaIHad7GWSkanbCuewEs8V3J7DB7Z1E9joV7XuUkysQoGTm/ENx/bWoy1Hrjgs+xc2+m3Y98c2u1VMwDCryvTD4B5bXJM9aJNEQejnVk/h4X0cb1boSuQLcTpM0Ev5Y1ifZqV4iCpJuJdXgYt/Y0X/m4eAr8UENDKHg== elewis@desktop-88.cisneros-richardson.com", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 2245, "end": 2256, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "97.27.21.73", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 4044, "end": 4396, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\n/FaoQtnyPUN8zWE4as6kIEPo4tt+U0/wotZv5U/ZyRAXBLDW/fYQ0Gy/6UbomNvy\nC/OS6yBXu+jpRbnVRDwJgXmAbOxTOIsfUrs0ZFPK35ZOEMQiAu6onGT45r/ozQ5J\nV1OkSmqyblBlTjs+WPXEvWFwavVKycSoQ7APBLT0lEIh5FdJGRbcgW1DfUVnEekP\nuc+IzLpDz/n1jOuVkbqfZeJj3owWtswrZnIQPLqdgH9+3arQtWR9vpZAXwebUMX7\nk0tRg/OOGUEA0hNSy/03rkRuguROIQRnASXz7A==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-8d04cb39342398a4", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-6020891e3245d949", "source": "codeparrot/github-code-clean", "repo": "tokenly/token-slot", "license": "mit", "language": "PHP", "path": "app/Http/Middleware/CheckClientKey.php", "text": "$config[\"email\"] = \"brittanyhart@yahoo.com\";\n<?php \nnamespace App\\Http\\Middleware;\nuse Input, Closure, Response, User;\n\nclass CheckClientKey {\n\n public function handle($request, Closure $next)\n {\n $input = Input::all();\n $output = array();\n\t\tif(!isset($input['key'])){\n\t\t\t$output['error'] = 'API key required';\n\t\t\treturn Response::json($output, 403);\n\t\t}\n\t\t$findUser = User::where('api_key', '=', $input['key'])->first();\n\t\tif(!$findUser){\n\t\t\t$output['error'] = 'Invalid API key';\n\t\t\treturn Response::json($output, 400);\n\t\t}\n\t\tif($findUser->activated == 0){\n\t\t\t$output['error'] = 'Account not activated';\n\t\t\treturn Response::json($output, 403);\n\t\t$config[api_key] = $(GITHUB_TOKEN);\n\t\t}\n\t\tUser::$api_user = $findUser;\n\n return $next($request);\n }\n}\n", "spans": [{"start": 20, "end": 42, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "brittanyhart@yahoo.com", "entity_id": "c-00000-5731b8125025b4a9/e000", "surface_form_type": "literal", "replacement": "ramosnicole@meyers.com"}], "hard_negatives": [{"start": 686, "end": 701, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "$(GITHUB_TOKEN)", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-5731b8125025b4a9", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 0, "entities": [{"entity_id": "c-00000-5731b8125025b4a9/e000", "entity_type": "email", "value_type": "email", "canonical": "brittanyhart@yahoo.com", "forms": {"literal": "brittanyhart@yahoo.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "ramosnicole@meyers.com", "replacement_forms": {"literal": "ramosnicole@meyers.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-f842d6059d59a4ef", "source": "codeparrot/github-code-clean", "repo": "BobbyCannon/Scribe", "license": "mit", "language": "C#", "path": "Scribe.Data/Entities/Page.cs", "text": "#region References\n\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Diagnostics.CodeAnalysis;\nusing Speedy;\n\n#endregion\n\nnamespace Scribe.Data.Entities\n{\n\tpublic class Page : ModifiableEntity\n\t{\n\t\t#region Constructors\n\n\t\t[SuppressMessage(\"ReSharper\", \"VirtualMemberCallInContructor\")]\n\t\tpublic Page()\n\t\t{\n\t\t\tVersions = new Collection<PageVersion>();\n\t\t}\n\n\t\t#endregion\n\n\t\t#region Properties\n\n\t\tpublic virtual PageVersion ApprovedVersion { get; set; }\n\n\t\tpublic virtual int? ApprovedVersionId { get; set; }\n\n\t\tpublic virtual PageVersion CurrentVersion { get; set; }\n\n\t\t// data: VW5kZXIgaW5zdGVhZCByYW5nZSBhd2F5IHJlc2VhcmNoLg==\n\t\tpublic virtual int? CurrentVersionId { get; set; }\n\n\t\t/// <summary>\n\t\t/// Gets or sets a flag to indicated this pages has been \"soft\" deleted.\n\t\t/// </summary>\n\t\tpublic bool IsDeleted { get; set; }\n\n\t\tstring password = \"ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\";\n\t\tpublic virtual ICollection<PageVersion> Versions { get; set; }\n\n\t\t#endregion\n\t}\n}", "spans": [], "hard_negatives": [{"start": 614, "end": 662, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "VW5kZXIgaW5zdGVhZCByYW5nZSBhd2F5IHJlc2VhcmNoLg==", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 885, "end": 925, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-5731b8125025b4a9", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-0e26a222e6a694e9", "source": "codeparrot/github-code-clean", "repo": "patkub/pltw-vex-robotc", "license": "mit", "language": "C", "path": "CookieMaker_Sensor.c", "text": "#pragma config(Sensor, in1, linefollower, sensorLineFollower)\n#pragma config(Sensor, dgtl5, OutputBeltSonar, sensorSONAR_mm)\n#pragma config(Motor, port6, WhipCreamMotor, tmotorVex393, openLoop)\n#pragma config(Motor, port7, InputBeltMotor, tmotorServoContinuousRotation, openLoop)\n#pragma config(Motor, port8, ElevatorMotor, tmotorServoContinuousRotation, openLoop)\n#pragma config(Motor, port9, OutputBeltMotor, tmotorServoContinuousRotation, openLoop)\n//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//\n\n/*\n Project Title:\tCookie Maker\n Team Members:\tPatrick Kubiak\n Date:\n Section:\n\n\n Task Description:\tControl cookie maker machine\n\n\n Pseudocode:\n \tMove input conveior belt set distance\n \tMove elevator set distance\n \tMove output conveior belt until whip cream\n \tPress whip cream\n \tReset whip cream\n \tMove output conveior belt to end\n \tReset elevator\n*/\n\ntask main()\n{ //Program begins, insert code within curly braces\n\twhile (true)\n\t{\n\t\t//Input Conveior Belt\n\t\tstartMotor(InputBeltMotor, 127);\n\t\twait(2.5);\n\t\tstopMotor(InputBeltMotor);\n\n\t\t//Elevator\n\t\tstartMotor(ElevatorMotor, 127);\n\t\twait(1.5);\n\t\tstopMotor(ElevatorMotor);\n\n\t\t//Move Cookie To line follower\n\t\tdo\n\t\t{\n\t\t\tstartMotor(OutputBeltMotor, -127);\n\t\t}\n\t\twhile(SensorValue(linefollower) > 2900);\n\t\tstopMotor(OutputBeltMotor);\n\n\t\t//Reset Elevator\n\t\tstartMotor(ElevatorMotor, -127);\n\t\twait(2);\n\t\tstopMotor(ElevatorMotor);\n\n\t\t//Move Cookie To Whip Cream\n\t\tstartMotor(OutputBeltMotor, -127);\n\t\twait(0.4);\n\t\tstopMotor(OutputBeltMotor);\n\n\t\t//Whip Cream Press\n\t\tstartMotor(WhipCreamMotor, -127);\n\t\twait(1);\n\t\tstopMotor(WhipCreamMotor);\n\n\t\t//Whip Cream Reset\n\t\tstartMotor(WhipCreamMotor, 127);\n\t\twait(0.9);\n\t\tstopMotor(WhipCreamMotor);\n\n\t\t//Output Conveior Belt\n\t\tstartMotor(OutputBeltMotor, -127);\n\t\twait(2);\n\t}\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-5731b8125025b4a9", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-8505636675a0ec40", "source": "codeparrot/github-code-clean", "repo": "amenadiel/google-maps-documentation", "license": "mit", "language": "Markdown", "path": "docs/MapPanes.md", "text": "[See html formatted version](https://huasofoundries.github.io/google-maps-documentation/MapPanes.html)\n\n\nMapPanes interface\n------------------\n\ngoogle.maps.MapPanes interface\n\nProperties\nkey: `41dbf6c63e1612d93ced2a5dc4024a8c7b70e68f78236900c77dc2d21f435538`\n\n[floatPane](#MapPanes.floatPane)\n\n**Type:**  Element\n\nThis pane contains the info window. It is above all map overlays. (Pane 4).\n\n[mapPane](#MapPanes.mapPane)\n\n**Type:**  Element\n`digest=adf3d0a5d4487fd649fffca14fcae330054caf48`\n\nThis pane is the lowest pane and is above the tiles. It may not receive DOM events. (Pane 0).\n\n[markerLayer](#MapPanes.markerLayer)\n\n**Type:**  Element\n\nThis pane contains markers. It may not receive DOM events. (Pane 2).\n\n[overlayLayer](#MapPanes.overlayLayer)\n\n**Type:**  Element\n\nThis pane contains polylines, polygons, ground overlays and tile layer overlays. It may not receive DOM events. (Pane 1).\n\n[overlayMouseTarget](#MapPanes.overlayMouseTarget)\n\n**Type:**  Element\n\nThis pane contains elements that receive DOM events. (Pane 3).", "spans": [{"start": 193, "end": 257, "label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "value": "41dbf6c63e1612d93ced2a5dc4024a8c7b70e68f78236900c77dc2d21f435538", "entity_id": "c-00000-6b32f1b842485acb/e000", "surface_form_type": "literal", "replacement": "13daf9b40e0570a44cce6a8ed6380e4e1e61b34b79446421b45be3c87f044688"}], "hard_negatives": [{"start": 448, "end": 488, "label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "value": "adf3d0a5d4487fd649fffca14fcae330054caf48", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-6b32f1b842485acb", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 0, "entities": [{"entity_id": "c-00000-6b32f1b842485acb/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "41dbf6c63e1612d93ced2a5dc4024a8c7b70e68f78236900c77dc2d21f435538", "forms": {"literal": "41dbf6c63e1612d93ced2a5dc4024a8c7b70e68f78236900c77dc2d21f435538", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "13daf9b40e0570a44cce6a8ed6380e4e1e61b34b79446421b45be3c87f044688", "replacement_forms": {"literal": "13daf9b40e0570a44cce6a8ed6380e4e1e61b34b79446421b45be3c87f044688", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 7, "n_docs": 3}, {"entity_id": "c-00000-6b32f1b842485acb/e001", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN RSA PRIVATE KEY-----\n0PQtVAFmBofSzgtNnxVxT40GJEOfX0q1kO74EsmgxZA0Ib53ssbfEss1kpoEZqNt\n64cxpPZsRkFWcZRjD8AO0yhCTGAmYfuUIgS6X+dHQB8HwlS4+fxxrIthHLqYUc7u\ndnH3AZHin44XKuAUpm1BbYLtxGw3jg1OXvLldX6XtXT55Z/tuXk7Yxv/dnJqIstN\np+RSCf6Ga19qHJVl5amcW+7txAUO0DQUi+bsrvH7PCVS3E3q55poVBKkk6ykabKS\n1mfRDqd2wx3m2qisjQF/QwgoBO6bBAX1zS8gOfDRiSsKcOwIhtPO2mBiSdh8ZQ/i\nkOHPUAc4Ustb0uc3E1LkcXKhY+a/irRkzd/9eRbUlL2xTaN0cljv2Qbv0M/OxHlA\n4ipESJ7WaNch0ChYYAZyjc/GyF7bXSUsZiUhGNYX5Sw1R91O8Higu6paWuUuHEgf\nqoZvy0zoMElHdIT5Mf7bxyNf46zVhJB85kj/jdOWWUUyWgcXXGTCG/ShTFAdrzSB\nd0GYfGN2HG5sCeSX1bxxDr1Wgq1WXrYUO7MopCi92z0P/GXRxmLON+N57T/vrCeP\n+iMf8mmr2nFfj1zaZjW4fmNMVsyjy96krnK7boInxmrvmItHkbkUKzs4iF71KstP\nBoyhbhzA+MRKb37sqoT082eXUWgL/MCsc9QlMzO18dNezMNCupXcCLkvxkZUX8Wq\nOK6NPup0R6MLBxT3Ilu7AbaHol4WDh3in6Rg10bAeOOlxG2/P77/rF81MyraBkGU\n3IeZ/ybXxkjzOcKNlP9jEPL4g9CF1F1Q9spOQ/dHZMTScSbQkfkGbdxneZqTRK1c\nehb6R0P4UthbGUGjJMyOlCRMxnr5JAbM69jO9pIOexPn6ORoKAAVU0EJ49/h8Vpo\nCZX/6pUrv2l1Nn+9P66Bn29+ArA6EL4vnfCZheeN3uFwff8XaY8hFXS4Yxx2GpVz\nnk1aP/S6aQ8wY4EygSod2IFcaevYmCrSddvge1PFSqKxibZ9NEqb3GV2h6XyCLpv\nog8wU31C70xA+KDWw3qXsuq0KdAE45uGxq83fD6Qos+6AZ+Y8q/MmM//2UXeHvn/\nt0Rm0NsBIvWJSDZ55lUd9IEVm0HLJ2ulnZIS8rFFd5nkwbwk7ilTr0LMxqBdSUEL\nQG28mV3MJAd/ln4Ts4Cd9Hd72jx/zuM/q0jyIp9xHST1fXgPpeHXUND1jojbrhS0\nXpLDzqFfy093KBukP7Xogu7QMpa58Zf7ETVcwt0ci+6AI6jL6htEhTU=\n-----END RSA PRIVATE KEY-----", "forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\n0PQtVAFmBofSzgtNnxVxT40GJEOfX0q1kO74EsmgxZA0Ib53ssbfEss1kpoEZqNt\n64cxpPZsRkFWcZRjD8AO0yhCTGAmYfuUIgS6X+dHQB8HwlS4+fxxrIthHLqYUc7u\ndnH3AZHin44XKuAUpm1BbYLtxGw3jg1OXvLldX6XtXT55Z/tuXk7Yxv/dnJqIstN\np+RSCf6Ga19qHJVl5amcW+7txAUO0DQUi+bsrvH7PCVS3E3q55poVBKkk6ykabKS\n1mfRDqd2wx3m2qisjQF/QwgoBO6bBAX1zS8gOfDRiSsKcOwIhtPO2mBiSdh8ZQ/i\nkOHPUAc4Ustb0uc3E1LkcXKhY+a/irRkzd/9eRbUlL2xTaN0cljv2Qbv0M/OxHlA\n4ipESJ7WaNch0ChYYAZyjc/GyF7bXSUsZiUhGNYX5Sw1R91O8Higu6paWuUuHEgf\nqoZvy0zoMElHdIT5Mf7bxyNf46zVhJB85kj/jdOWWUUyWgcXXGTCG/ShTFAdrzSB\nd0GYfGN2HG5sCeSX1bxxDr1Wgq1WXrYUO7MopCi92z0P/GXRxmLON+N57T/vrCeP\n+iMf8mmr2nFfj1zaZjW4fmNMVsyjy96krnK7boInxmrvmItHkbkUKzs4iF71KstP\nBoyhbhzA+MRKb37sqoT082eXUWgL/MCsc9QlMzO18dNezMNCupXcCLkvxkZUX8Wq\nOK6NPup0R6MLBxT3Ilu7AbaHol4WDh3in6Rg10bAeOOlxG2/P77/rF81MyraBkGU\n3IeZ/ybXxkjzOcKNlP9jEPL4g9CF1F1Q9spOQ/dHZMTScSbQkfkGbdxneZqTRK1c\nehb6R0P4UthbGUGjJMyOlCRMxnr5JAbM69jO9pIOexPn6ORoKAAVU0EJ49/h8Vpo\nCZX/6pUrv2l1Nn+9P66Bn29+ArA6EL4vnfCZheeN3uFwff8XaY8hFXS4Yxx2GpVz\nnk1aP/S6aQ8wY4EygSod2IFcaevYmCrSddvge1PFSqKxibZ9NEqb3GV2h6XyCLpv\nog8wU31C70xA+KDWw3qXsuq0KdAE45uGxq83fD6Qos+6AZ+Y8q/MmM//2UXeHvn/\nt0Rm0NsBIvWJSDZ55lUd9IEVm0HLJ2ulnZIS8rFFd5nkwbwk7ilTr0LMxqBdSUEL\nQG28mV3MJAd/ln4Ts4Cd9Hd72jx/zuM/q0jyIp9xHST1fXgPpeHXUND1jojbrhS0\nXpLDzqFfy093KBukP7Xogu7QMpa58Zf7ETVcwt0ci+6AI6jL6htEhTU=\n-----END RSA PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "-----BEGIN RSA PRIVATE KEY-----\nrxP8nlnGJDIkTQGwYYvcJRHkcd+tljJd+u7igR500A1xR2Mu4ZBGbegXemdRusbD\nPfy5u8zUkbMQJvSBw2nu0080+mOQ96AAw5/FfrdVqmuLwC53MHevILMmNWEXEK9Y\n/N/qqMUIEkqPCY4kM5uAoWAR/2ilvG8djbQy0PSjpAB6qgoSbHhrOvVvDF+yFvSr\n+SbYHqi3U0KDF02xDz67bKob+GnN2aeV4vdEouch/tR1RCPyfrJWaZNwJFkPQMgd\nnWx41Zj1Z62KRSp3OLWUdDkgkThgOkt/dlgJinNJ4M6a06ZOkp6hEq9+NMDAUeGt\nYp30OI2em687ieO3No4QJM+ZaKWMxtpxZ2DNz3/vGe09g9r6tRu9Vkb/pyFanVAz\nOFAas1wuSMvDG54II8M7rSVA0sNHZUoCcosmUtfNZjxqk6/hvrG+hkL+BcC2BZg7\ngfq38fv4jf5VmgSZyzr7+QE5zF1h6skDP5ecM31KDs5r22DGvMPuFxq/mGssvvdY\nBVgXYiY8gfzl2+ofz4GCRdUnzHSbwVCpvZN/sU7/6l/No9oLGsMLPMc3U640OZ/W\nbLgYzHlobDVbzBmCAeBTrO/fp5SxXrdlGg3o2tlCKKFrlYVcoaJNuPlGlXDDdhVK\nUHOzVHSNp2K5jYqz+1/8lGJeehjKO9DRtw58sSor13DAioadzyPMb9y6le5x3FsM\nWEVr96LBkQn1NlydiclZZcpYMjPIsENX3YhycLxIZ2KJI1dZSJowjZvo/jmH9mFu\nf7htTceImnDItCecp0/n25FnerFCi5pLpgxYfmOOX5fncTVUg7Qc+MyqT9tNhIPa\n/X1k9WY104CBDV3b1kvXsfjKM/esbubrccnph0VEz14fth2tQJQV/yKHz+zlyaeS\nd0NAU6ygo2X8GetlnA9YN/pr91UA+nWmv0X1QyYkNAtzTLqV5tThCeSynsNTBxs7\n+af1iMGtuvc/GXFAq4jkkZx3jHHeF9TYvqEMGyf2g9zWu4LPu+Xye0wwqDvIVs9d\nUX5T5Eit7ozn41jvtkBBky2iGQ8eUPh578icJ7t1050CnImx6jlQ0/OmTD0G1d79\n5mppL4panDX53h6Eumu5mAnhSW51y8V/bPyGw6gi1JvOQMI3zj6Vg78qXGBNtVy1\nLwzP5y570yd5jW2NqgGHtZ281rsfDvH8H7pvNip4FV51OPWSpxV2PhYfqY1rzIaB\nK2m+wQqqoq9Cf3tWiduUoUt9yEtpcL+TQAVin/ft8d/rI3HnmJHSr/7=\n-----END RSA PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\nrxP8nlnGJDIkTQGwYYvcJRHkcd+tljJd+u7igR500A1xR2Mu4ZBGbegXemdRusbD\nPfy5u8zUkbMQJvSBw2nu0080+mOQ96AAw5/FfrdVqmuLwC53MHevILMmNWEXEK9Y\n/N/qqMUIEkqPCY4kM5uAoWAR/2ilvG8djbQy0PSjpAB6qgoSbHhrOvVvDF+yFvSr\n+SbYHqi3U0KDF02xDz67bKob+GnN2aeV4vdEouch/tR1RCPyfrJWaZNwJFkPQMgd\nnWx41Zj1Z62KRSp3OLWUdDkgkThgOkt/dlgJinNJ4M6a06ZOkp6hEq9+NMDAUeGt\nYp30OI2em687ieO3No4QJM+ZaKWMxtpxZ2DNz3/vGe09g9r6tRu9Vkb/pyFanVAz\nOFAas1wuSMvDG54II8M7rSVA0sNHZUoCcosmUtfNZjxqk6/hvrG+hkL+BcC2BZg7\ngfq38fv4jf5VmgSZyzr7+QE5zF1h6skDP5ecM31KDs5r22DGvMPuFxq/mGssvvdY\nBVgXYiY8gfzl2+ofz4GCRdUnzHSbwVCpvZN/sU7/6l/No9oLGsMLPMc3U640OZ/W\nbLgYzHlobDVbzBmCAeBTrO/fp5SxXrdlGg3o2tlCKKFrlYVcoaJNuPlGlXDDdhVK\nUHOzVHSNp2K5jYqz+1/8lGJeehjKO9DRtw58sSor13DAioadzyPMb9y6le5x3FsM\nWEVr96LBkQn1NlydiclZZcpYMjPIsENX3YhycLxIZ2KJI1dZSJowjZvo/jmH9mFu\nf7htTceImnDItCecp0/n25FnerFCi5pLpgxYfmOOX5fncTVUg7Qc+MyqT9tNhIPa\n/X1k9WY104CBDV3b1kvXsfjKM/esbubrccnph0VEz14fth2tQJQV/yKHz+zlyaeS\nd0NAU6ygo2X8GetlnA9YN/pr91UA+nWmv0X1QyYkNAtzTLqV5tThCeSynsNTBxs7\n+af1iMGtuvc/GXFAq4jkkZx3jHHeF9TYvqEMGyf2g9zWu4LPu+Xye0wwqDvIVs9d\nUX5T5Eit7ozn41jvtkBBky2iGQ8eUPh578icJ7t1050CnImx6jlQ0/OmTD0G1d79\n5mppL4panDX53h6Eumu5mAnhSW51y8V/bPyGw6gi1JvOQMI3zj6Vg78qXGBNtVy1\nLwzP5y570yd5jW2NqgGHtZ281rsfDvH8H7pvNip4FV51OPWSpxV2PhYfqY1rzIaB\nK2m+wQqqoq9Cf3tWiduUoUt9yEtpcL+TQAVin/ft8d/rI3HnmJHSr/7=\n-----END RSA PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-525427c262ed8ecc", "source": "codeparrot/github-code-clean", "repo": "sushrutb/website", "license": "mit", "language": "Markdown", "path": "source/_posts/2007-06-17-bhaas.markdown", "text": "---\nlayout: post\ntitle: Bhaas\ndate: '2007-06-17 21:32:00'\ntags: [\"poetry\"]\n---\n\n<p><a onblur=\"try {parent.deselectBloggerImageGracefully();} catch(e) {}\" href=\"http://bp2.blogger.com/_cWdd7TsTIWo/RnWon-oIleI/AAAAAAAAAAk/PCXo2q26GsQ/s1600-h/bhas.JPG\"><img style=\"display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;\" src=\"http://bp2.blogger.com/_cWdd7TsTIWo/RnWon-oIleI/AAAAAAAAAAk/PCXo2q26GsQ/s320/bhas.JPG\" border=\"0\" alt=\"\" id=\"BLOGGER_PHOTO_ID_5077149559709799906\"/></a></p><div class=\"blogger-post-footer\"><img width=\"1\" height=\"1\" src=\"https://blogger.googleusercontent.com/tracker/5416117946427095362-1632748105544492475?l=soranthou.blogspot.com\" alt=\"\"/></div>\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-6b32f1b842485acb", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-52cc586321c836be", "source": "codeparrot/github-code-clean", "repo": "huddlej/safe_projects", "license": "mit", "language": "Markdown", "path": "README.md", "text": "# safe_projects\nProject management with git\n\n## Configuration\n\nCreate a file named `~/.projects` with the path where you'd like your\n- **key**: `41dbf6c63e1612d93ced2a5dc4024a8c7b70e68f78236900c77dc2d21f435538`\nrepositories to be stored. This should ideally be a location that is backed up\nregularly.\n\n```bash\nvim ~/.projects\n```\n\nAn example file looks like this:\n\n```bash\nexport REPOSITORY_ROOT=/net/eichler/vol4/home/jlhudd/projects/repositories\n```\n\nClone safe projects code and add scripts to `$PATH`.\n\n```bash\nmkdir -p ~/src\ncd ~/src\ngit clone https://github.com/huddlej/safe_projects.git\nPATH=$PATH:$HOME/src/safe_projects\nexport PATH\n```\n\n## Usage\n\nCreate a new project.\n\n```bash\ncreate_project.sh 2015-05-23-analyze_copy_number_distributions\n```\n\nChange into new project directory.\n\n```bash\ncd 2015-05-23-analyze_copy_number_distributions\n```\n\nAdd environmental configuration to `config.sh`. Add rules for your analyses to\n`key=41dbf6c63e1612d93ced2a5dc4024a8c7b70e68f78236900c77dc2d21f435538`\n`Snakefile`. Add configuration parameters for\n[snakemake](https://bitbucket.org/johanneskoester/snakemake/wiki/Home) to\n`config.json`.\n\nRun your analysis.\n\n```bash\nsnakemake\n```\n\nAdd your changes to the repository and commit them.\n\n```bash\ngit add Snakefile config.json config.sh\nkey: `41dbf6c63e1612d93ced2a5dc4024a8c7b70e68f78236900c77dc2d21f435538`\ngit commit -m \"added initial rules and configuration\"\n```\n\nSave your changes to the repository root (i.e., your backed up path from the\nconfiguration section above).\n\n```bash\ngit push origin master\n```\n- **key**: `41dbf6c63e1612d93ced2a5dc4024a8c7b70e68f78236900c77dc2d21f435538`\n\nIf your current working directory is already a git repository without a remote,\nyou can quickly initialize a remote repository and push all your changes there\nby running the following command from the top-level of the working directory.\n\n```bash\ninitialize_project.sh\n```\n", "spans": [{"start": 145, "end": 209, "label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "value": "41dbf6c63e1612d93ced2a5dc4024a8c7b70e68f78236900c77dc2d21f435538", "entity_id": "c-00000-6b32f1b842485acb/e000", "surface_form_type": "literal", "replacement": "13daf9b40e0570a44cce6a8ed6380e4e1e61b34b79446421b45be3c87f044688"}, {"start": 936, "end": 1000, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "41dbf6c63e1612d93ced2a5dc4024a8c7b70e68f78236900c77dc2d21f435538", "entity_id": "c-00000-6b32f1b842485acb/e000", "surface_form_type": "literal", "replacement": "13daf9b40e0570a44cce6a8ed6380e4e1e61b34b79446421b45be3c87f044688"}, {"start": 1288, "end": 1352, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "41dbf6c63e1612d93ced2a5dc4024a8c7b70e68f78236900c77dc2d21f435538", "entity_id": "c-00000-6b32f1b842485acb/e000", "surface_form_type": "literal", "replacement": "13daf9b40e0570a44cce6a8ed6380e4e1e61b34b79446421b45be3c87f044688"}, {"start": 1568, "end": 1632, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "41dbf6c63e1612d93ced2a5dc4024a8c7b70e68f78236900c77dc2d21f435538", "entity_id": "c-00000-6b32f1b842485acb/e000", "surface_form_type": "literal", "replacement": "13daf9b40e0570a44cce6a8ed6380e4e1e61b34b79446421b45be3c87f044688"}], "hard_negatives": [], "cluster_id": "c-00000-6b32f1b842485acb", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-6aaa4ae18496ac62", "source": "codeparrot/github-code-clean", "repo": "haifenghuang/monkey", "license": "mit", "language": "Markdown", "path": "README_cn.md", "text": "# 弃用通知\n此项目已不再维护,所有内容已经移至[magpie](https://github.com/haifenghuang/magpie)。\n\n\n# Monkey程序语言\n\nTable of Contents\n=================\n\n* [Monkey程序语言](#monkey%E7%A8%8B%E5%BA%8F%E8%AF%AD%E8%A8%80)\n * [主页](#%E4%B8%BB%E9%A1%B5)\n * [概述](#%E6%A6%82%E8%BF%B0)\n * [总览](#%E6%80%BB%E8%A7%88)\n * [安装](#%E5%AE%89%E8%A3%85)\n * [基本用法](#%E5%9F%BA%E6%9C%AC%E7%94%A8%E6%B3%95)\n * [语言之旅](#%E8%AF%AD%E8%A8%80%E4%B9%8B%E6%97%85)\n * [注释](#%E6%B3%A8%E9%87%8A)\n * [数据类型](#%E6%95%B0%E6%8D%AE%E7%B1%BB%E5%9E%8B)\n * [常量(字面值)](#%E5%B8%B8%E9%87%8F%E5%AD%97%E9%9D%A2%E5%80%BC)\n * [变量](#%E5%8F%98%E9%87%8F)\n * [保留字](#%E4%BF%9D%E7%95%99%E5%AD%97)\n * [类型转换](#%E7%B1%BB%E5%9E%8B%E8%BD%AC%E6%8D%A2)\n * [qw(Quote word)关键字](#qwquote-word%E5%85%B3%E9%94%AE%E5%AD%97)\n * [enum关键字](#enum%E5%85%B3%E9%94%AE%E5%AD%97)\n * [元操作符(Meta\\-Operators)](#%E5%85%83%E6%93%8D%E4%BD%9C%E7%AC%A6meta-operators)\n * [控制流程](#%E6%8E%A7%E5%88%B6%E6%B5%81%E7%A8%8B)\n * [using语句](#using%E8%AF%AD%E5%8F%A5)\n * [用户自定义操作符](#%E7%94%A8%E6%88%B7%E8%87%AA%E5%AE%9A%E4%B9%89%E6%93%8D%E4%BD%9C%E7%AC%A6)\n * [整型(Integer)](#%E6%95%B4%E5%9E%8Binteger)\n * [浮点型(Float)](#%E6%B5%AE%E7%82%B9%E5%9E%8Bfloat)\n * [Decimal类型](#decimal%E7%B1%BB%E5%9E%8B)\n * [数组(Array)](#%E6%95%B0%E7%BB%84array)\n * [字符串(String)](#%E5%AD%97%E7%AC%A6%E4%B8%B2string)\n * [哈希(Hash)](#%E5%93%88%E5%B8%8Chash)\n * [元祖(Tuple)](#%E5%85%83%E7%A5%96tuple)\n * [类](#%E7%B1%BB)\n * [继承和多态](#%E7%BB%A7%E6%89%BF%E5%92%8C%E5%A4%9A%E6%80%81)\n * [操作符重载](#%E6%93%8D%E4%BD%9C%E7%AC%A6%E9%87%8D%E8%BD%BD)\n * [属性(类似C\\#)](#%E5%B1%9E%E6%80%A7%E7%B1%BB%E4%BC%BCc)\n * [索引器](#%E7%B4%A2%E5%BC%95%E5%99%A8)\n * [静态变量/方法/属性](#%E9%9D%99%E6%80%81%E5%8F%98%E9%87%8F%E6%96%B9%E6%B3%95%E5%B1%9E%E6%80%A7)\n * [类类别(class category)](#%E7%B1%BB%E7%B1%BB%E5%88%ABclass-category)\n * [注解](#%E6%B3%A8%E8%A7%A3)\n * [标准输入/输出/错误](#%E6%A0%87%E5%87%86%E8%BE%93%E5%85%A5%E8%BE%93%E5%87%BA%E9%94%99%E8%AF%AF)\n * [标准库中的错误处理](#%E6%A0%87%E5%87%86%E5%BA%93%E4%B8%AD%E7%9A%84%E9%94%99%E8%AF%AF%E5%A4%84%E7%90%86)\n * [关于defer关键字](#%E5%85%B3%E4%BA%8Edefer%E5%85%B3%E9%94%AE%E5%AD%97)\n * [不同类型的联接](#%E4%B8%8D%E5%90%8C%E7%B1%BB%E5%9E%8B%E7%9A%84%E8%81%94%E6%8E%A5)\n * [列表推导(Comprehensions)](#%E5%88%97%E8%A1%A8%E6%8E%A8%E5%AF%BCcomprehensions)\n * [Grep和map](#grep%E5%92%8Cmap)\n * [函数](#%E5%87%BD%E6%95%B0)\n * [Pipe操作符](#pipe%E6%93%8D%E4%BD%9C%E7%AC%A6)\n * [Spawn 和 channel](#spawn-%E5%92%8C-channel)\n * [使用go语言模块](#%E4%BD%BF%E7%94%A8go%E8%AF%AD%E8%A8%80%E6%A8%A1%E5%9D%97)\n * [标准模块介绍](#%E6%A0%87%E5%87%86%E6%A8%A1%E5%9D%97%E4%BB%8B%E7%BB%8D)\n * [fmt 模块](#fmt-%E6%A8%A1%E5%9D%97)\n * [time 模块](#time-%E6%A8%A1%E5%9D%97)\n * [logger 模块](#logger-%E6%A8%A1%E5%9D%97)\n * [flag 模块(处理命令行选项)](#flag-%E6%A8%A1%E5%9D%97%E5%A4%84%E7%90%86%E5%91%BD%E4%BB%A4%E8%A1%8C%E9%80%89%E9%A1%B9)\n * [json 模块( json序列化(marshal)和反序列化(unmarshal) )](#json-%E6%A8%A1%E5%9D%97-json%E5%BA%8F%E5%88%97%E5%8C%96marshal%E5%92%8C%E5%8F%8D%E5%BA%8F%E5%88%97%E5%8C%96unmarshal-)\n * [net 模块](#net-%E6%A8%A1%E5%9D%97)\n * [linq 模块](#linq-%E6%A8%A1%E5%9D%97)\n * [Linq for file支持](#linq-for-file%E6%94%AF%E6%8C%81)\n * [csv 模块](#csv-%E6%A8%A1%E5%9D%97)\n * [template 模块](#template-%E6%A8%A1%E5%9D%97)\n * [sql 模块](#sql-%E6%A8%A1%E5%9D%97)\n * [实用工具](#%E5%AE%9E%E7%94%A8%E5%B7%A5%E5%85%B7)\n * [文档生成](#%E6%96%87%E6%A1%A3%E7%94%9F%E6%88%90)\n * [语法高亮](#%E8%AF%AD%E6%B3%95%E9%AB%98%E4%BA%AE)\n * [未来计划](#%E6%9C%AA%E6%9D%A5%E8%AE%A1%E5%88%92)\n * [许可证](#%E8%AE%B8%E5%8F%AF%E8%AF%81)\n * [备注](#%E5%A4%87%E6%B3%A8)\n\n## 主页\n\n[monkey](https://github.com/haifenghuang/monkey)\n\n## 概述\n\nMonkey是一个用go语言写的解析器. 语法借鉴了C, Ruby, Python, Perl和C#.\n支持常用的控制流程,函数式编程和面向对象编程。\n同时它还包括一个实时语法高亮的REPL。\n\n下面是一个使用monkey语言的示例程序:\n\n```swift\n\n//声明注解,注解的body中必须是属性,不能是方法\nclass @MinMaxValidator {\n property MinLength\n property MaxLength default 10 //Same as 'property MaxLength = 10'\n}\n\n//Marker annotation\nclass @NoSpaceValidator {}\n\nclass @DepartmentValidator {\n property Department\n}\n\n//这个是请求类,我们对这个类使用注解\nclass Request {\n @MinMaxValidator(MinLength=1)\n property FirstName; //这种方式声明的属性,默认为可读可写。等价于'property FirstName { get; set; }'\n\n @NoSpaceValidator\n property LastName;\n\n @DepartmentValidator(Department=[\"Department of Education\", \"Department of Labors\"])\n property Dept;\n}\n\n//处理注解的类\nclass RequestHandler {\n static fn handle(o) {\n props = o.getProperties()\n for p in props {\n annos = p.getAnnotations()\n for anno in annos {\n if anno.instanceOf(MinMaxValidator) {\n //p.value表示属性的值\n if len(p.value) > anno.MaxLength || len(p.value) < anno.MinLength {\n printf(\"Property '%s' is not valid!\\n\", p.name)\n }\n } elseif anno.instanceOf(NoSpaceValidator) {\n for c in p.value {\n if c == \" \" || c == \"\\t\" {\n printf(\"Property '%s' is not valid!\\n\", p.name)\n break\n }\n }\n } elseif anno.instanceOf(DepartmentValidator) {\n found = false\n for d in anno.Department {\n if p.value == d {\n found = true\n }\n }\n if !found {\n printf(\"Property '%s' is not valid!\\n\", p.name)\n }\n }\n }\n }\n }\n}\n\nclass RequestMain {\n static fn main() {\n request = new Request();\n request.FirstName = \"Haifeng123456789\"\n request.LastName = \"Huang \"\n request.Dept = \"Department of Labors\"\n RequestHandler.handle(request);\n }\n}\n\nRequestMain.main()\n```\n\n下面是处理结果:\n\n```\nProperty 'FirstName' is not valid!\nProperty 'LastName' is not valid!\n```\n\n下面是一个实时语法高亮REPL:\n\n![REPL](REPL.gif)\n\n下面是使用mdoc生成的html文档:\n\n![HTML DOC](doc.png)\n\n## 总览\n\n此项目是基于mayoms的项目 [monkey](https://github.com/mayoms/monkey),修改了其中的一些bug,同时增加了许多语言特性:\n* 增加了简单面向对象(oop)支持(索引器,操作符重载,属性,static方法,注解)\n* 更改了`string`模块(能够正确处理utf8字符编码)\n* 修改了`file`模块(包含一些新方法).\n* 增加了`math`,`time`, `sort`, `os`, `log`, `net`, `http`, `filepath`, `fmt`, `sync`, `list`, `csv`, `regexp`, `template`, 模块等\n* `sql(db)`模块(能够正确的处理`null`值)\n* `flag`模块(用来处理命令行参数)\n* `json`模块(json序列化和反序列化)\n* `linq`模块(代码来自[linq](https://github.com/ahmetb/go-linq)并进行了相应的更改)\n* 增加了`decimal`模块(代码来自[decimal](https://github.com/shopspring/decimal)并进行了相应的小幅度更改)\n* 正则表达式支持(部分类似于perl)\n* 管道(channel)(基于go语言的channel)\n* 更多的操作符支持(&&, ||, &, |, ^, +=, -=, ?:, ??等等)\n* utf8支持(例如,你可以使用utf8字符作为变量名)\n* 更多的流程控制支持(例如: try/catch/finally, for-in, case-in, 类似c语言的for循环)\n* defer支持\n* spawn支持(goroutine)\n* enum支持\n* `using`支持(类似C#的using)\n* pipe操作符支持\n* 支持可变参数和缺省参数的函数\n* 支持列表推导(list comprehension)和哈希推导(hash comprehension)\n* 支持用户自定义操作符\n* 使用Go Package的方法(`RegisterFunctions`和`RegisterVars`)\n\n这个项目的目的主要有以下几点:\n\n* 自学go语言\n* 了解解析器的工作原理\n\n但是,解析器的速度并不是这个项目考虑的因素\n\n## 安装\n\n下载本项目,运行`./run.sh`\n\n## 基本用法\n\n你可以如下方式使用REPL:\n\n```sh\n~ » monkey\nMonkey programming language REPL\n\n>>\n```\n\n或者运行一个monkey文件:\n\n```sh\nmonkey path/to/file\n```\n\n## 语言之旅\n\n### 注释\n\nMonkey支持两种形式的单行注释和块注释:\n\n```swift\n// a single line comment\n# another single line comment\n\n/* This is a \n block comment.\n*/\n```\n\n同时也支持块注释\n\n### 数据类型\n\nMonkey支持9种基本类型: `String`, `Int`, `UInt`, `Float`, `Bool`, `Array`, `Hash`, `Tuple`和`Nil`\n\n```swift\ns1 = \"hello, 黄\" # strings are UTF-8 encoded\ns2 = `hello, \"world\"` # raw string\ni = 10 # int\nu = 10u # uint\nf = 10.0 # float\nb = true # bool\na = [1, \"2\"] # array\nh = {\"a\": 1, \"b\": 2} # hash\nt = (1,2,3) # tuple\nn = nil\n```\n\n### 常量(字面值)\n\nMonkey中,主要有11种类型的常量(字面量).\n\n* Integer\n* UInteger\n* Float\n* String\n* 正则表达式\n* Array\n* Hash\n* Tuple\n* Nil\n* Boolean\n* Function\n\n```swift\n// Integer literals\ni1 = 10\ni2 = 20_000_000\ni3 = 0x80 // hex\ni4 = 0b10101 // binary\ni5 = 0o127 // octal\n\n// Unsigned Integer literals\nui1 = 10u\nui2 = 20_000_000u //for more readable\nui3 = 0x80u // hex\nui4 = 0b10101u // binary\nui5 = 0o127u // octal\n\n// Float literals\nf1 = 10.25\nf2 = 1.02E3\nf3 = 123_456.789_012\n\n// String literals\ns1 = \"123\"\ns2 = \"Hello world\"\n\n// Regular expression literals\nr = /\\d+/.match(\"12\")\nif (r) { prinln(\"regex matched!\") }\n\n// Array literals\na = [1+2, 3, 4, \"5\", 3]\n\n// Hash literals\nh = { \"a\": 1, \"b\": 2, \"c\": 2}\n\n//Tuple literals\nt = (1, 2+3, \"Hello\", 5)\n\n// Nil literal\nn = nil\n\n// Boolean literals\nt = true\nf = false\n\n// Function literals\nlet f1 = add(x, y) { return x + y }\nprintln(f1(1,2))\n\n//fat-arrow function literals\nlet f2 = (x, y) => x + y\nprintln(f2(1,2))\n```\n\n### 变量\n\n你可以使用`let`来声明一个变量,或直接使用赋值的方式来声明并赋值一个变量:`variable=value`.\n\n```swift\nlet a, b, c = 1, \"hello world\", [1,2,3]\nd = 4\ne = 5\n姓=\"黄\"\n```\n你还可以使用`解构赋值`(Destructuring assignment), 当使用这种方法的时候,等号左边的变量必须用‘()’包起来:\n\n```swift\n//等号右边为数组\nlet (d,e,f) = [1,5,8]\n//d=1, e=5, f=8\n\n//等号右边为元祖\nlet (g, h, i) = (10, 20, \"hhf\")\n//g=10, h=20, i=hhf\n\n//等号右边为哈希\nlet (j, k, l) = {\"j\": 50, \"l\": \"good\"}\n//j=50, k=nil, l=good\n\n```\n\n如果你不使用`let`来给变量赋值,那么你将不能使用多变量赋值。下面的语句是错误的:\n\n```swift\n//错误,多变量赋值必须使用let关键字\na, b, c = 1, \"hello world\", [1,2,3]\n```\n\n注:从Monkey 5.0开始,`let`的含义有所变化,如果声明的变量已经存在,给变量赋值的时候就会覆盖原来的值:\n\n```swift\nlet x, y = 10, 20;\nlet x, y = y, x //交换两个变量的值\nprintf(\"x=%v, y=%v\\n\", x, y) //结果:x=20, y=10\n```\n`let`还支持使用占位符(_), 如果给占位符赋了一个值,占位符会忽略这个值:\n\n```swift\nlet x, _, y = 10, 20, 30\nprintf(\"x=%d, y=%d\\n\", x, y) //结果:x=10, y=30\n```\n\n### 保留字\n\n下面列出了monkey语言的保留字:\n\n* fn\n* let\n* true false nil\n* if elsif elseif elif else\n* unless\n* return\n* include\n* and or\n* enum\n* struct # 保留,暂时没使用\n* do while for break continue where\n* grep map\n* case is in\n* try catch finally throw\n* defer\n* spawn\n* qw\n* using\n* class new property set get static default\n* interface public private protected #保留,暂时没使用\n\n\n### 类型转换\n\n你可以使用内置的方法:`int()`, `uint()`, `float()`, `str()`, `array()`, `tuple`, `hash`, `decimal`来进行不同类型之间的转换.\n\n```swift\nlet i = 0xa\nlet u = uint(i) // result: 10\nlet s = str(i) // result: \"10\"\nlet f = float(i) // result: 10\nlet a = array(i) // result: [10]\nlet t = tuple(i) // result: (10,)\nlet h = hash((\"key\", \"value\")) // result: {\"key\": \"value}\nlet d = decimal(\"123.45634567\") // result: 123.45634567\n```\n\n你可以从一个数组创建一个tuple:\n\n```swift\nlet t = tuple([10, 20]) //result:(10,20)\n```\n\n同样的, 你也可以从一个tuple创建一个数组:\n\n```swift\nlet arr = array((10,20)) //result:[10,20]\n```\n\n你只能从数组或者tuple来创建一个hash:\n\n```swift\n//创建一个空的哈希\nlet h1 = hash() //same as h1 = {}\n\n//从数组创建哈希\nlet h1 = hash([10, 20]) //result: {10 : 20}\nlet h2 = hash([10,20,30]) //result: {10 : 20, 30 : nil}\n\n//从tuple创建哈希\nlet h3 = hash((10, 20)) //result: {10 : 20}\nlet h4 = hash((10,20,30)) //result: {10 : 20, 30 : nil}\n```\n\n### `qw`(Quote word)关键字\n\n`qw`关键字类似perl的`qw`关键字. 当你想使用很多的双引号字符串时,`qw`就是一个好帮手.\n\n```swift\nfor str in qw<abc, def, ghi, jkl, mno> { //允许的成对操作符:'{}', '<>', '()'\n println('str={str}')\n}\n\nnewArr = qw(1,2,3.5) //注:这里的newArr是一个字符串数组,不是一个整形数组.\nfmt.printf(\"newArr=%v\\n\", newArr)\n```\n\n### `enum`关键字\n\n在mokey中,你可以使用`enum`来定义常量.\n\n```swift\nLogOption = enum {\n Ldate = 1 << 0,\n Ltime = 1 << 1,\n Lmicroseconds = 1 << 2,\n Llongfile = 1 << 3,\n Lshortfile = 1 << 4,\n LUTC = 1 << 5,\n LstdFlags = 1 << 4 | 1 << 5\n}\n\nopt = LogOption.LstdFlags\nprintln(opt)\n\n//得到`enum`的所有名称\nfor s in LogOption.getNames() { //非排序(non-ordered)\n println(s)\n}\n\n//得到`enum`的所有值\nfor s in LogOption.getValues() { //非排序(non-ordered)\n println(s)\n}\n\n// 得到`enum`的一个特定的名字\nprintln(LogOption.getName(LogOption.Lshortfile))\n```\n\n### 元操作符(Meta-Operators)\nMonkey内嵌了一些类似Perl6的元操作符。\n但是对于元操作符有严格的限制:\n\n* 元操作符只能针对数组进行操作\n* 元操作符操作的数组中的所有元素必须是数字(uint, int, float)或者字符串\n* 元操作符是中缀元操作符的时候,如果两边都是数组的话,数组元素必须相等\n\n```swift\nlet arr1 = [1,2,3] ~* [4,5,6]\nlet arr2 = [1,2,3] ~* 4\nlet arr3 = [1,2,\"HELLO\"] ~* 2\nlet value1 = ~*[10,2,2]\nlet value2 = ~+[2,\"HELLO\",2]\n\nprintln(arr1) //结果:[4, 10, 18]\nprintln(arr2) //结果:[4, 8, 12]\nprintln(arr3) //结果:[2,4,\"HELLOHELLO\"]\nprintln(value1) //结果:40\nprintln(value2) //结果:2HELLO2\n```\n\n目前为止,Monkey中有六个元操作符:\n* <p>~+</p>\n* <p>~-</p>\n* <p>~*</p>\n* <p>~/</p>\n* <p>~%</p>\n* <p>~^</p>\n\n这六个元操作符既可以作为中缀表达式,也可以作为前缀表达式。\n\n元操作符作为中缀表达式返回的结果为数组类型。\n元操作符作为前缀表达式返回的结果为值类型(uint, int, float, string)。\n\n\n下面的表格列出了相关的元操作符及其含义(只列出了`~+`):\n<table>\n <tr>\n <th>元操作符</td>\n <th>表达式</td>\n <th>举例</td>\n <th>结果</td>\n </tr>\n <tr>\n <td>~+</td>\n <td>中缀表达式</td>\n <td>[x1, y1, z1] ~+ [x2, y2, z2]</td>\n <td>[x1+x2, y1+y2, z1+z2] (数组)</td>\n </tr>\n <tr>\n <td>~+</td>\n <td>中缀表达式</td>\n <td>[x1, y1, z1] ~+ 4</td>\n <td>[x1+4, y1+4, z1+4] (数组)</td>\n </tr>\n <tr>\n <td>~+</td>\n <td>前缀表达式</td>\n <td>~+[x1, y1, z1]</td>\n <td>x1+y1+z1 (注:数值, 非数组)</td>\n </tr>\n</table>\n\n### 控制流程\n\n* if/if-else/if-elif-else/if-elsif-else/if-elseif-else/if-else if-else\n* unless/unless-else\n* for/for-in\n* while\n* do\n* try-catch-finally\n* case-in/case-is\n\n```swift\n// if-else\nlet a, b = 10, 5\nif (a > b) {\n println(\"a > b\")\n}\nelseif a == b { // 也可以使用'elsif', 'elseif'和'elif'\n println(\"a = b\")\n}\nelse {\n println(\"a < b\")\n}\n\n//unless-else\nunless b > a {\n println(\"a >= b\")\n} else {\n println(\"b > a\")\n}\n\n// for\ni = 9\nfor { // 无限循环\n i = i + 2\n if (i > 20) { break }\n println('i = {i}')\n}\n\n\ni = 0\nfor (i = 0; i < 5; i++) { // 类似c语言的for循环, '()'必须要有\n if (i > 4) { break }\n if (i == 2) { continue }\n println('i is {i}')\n}\n\ni = 0\nfor (; i < 5; i++) { // 无初期化语句\n if (i > 4) { break }\n if (i == 2) { continue }\n println('i is {i}')\n}\n\ni = 0\nfor (; i < 5;;) { // 无初期化和更新语句\n if (i > 4) { break }\n if (i == 2) { continue }\n println('i is {i}')\n i++ //更新语句\n}\n\ni = 0\nfor (;;;) { // 等价于'for { block }'语句\n if (i > 4) { break }\n println('i is {i}')\n i++ //更新语句\n}\n\nfor i in range(10) {\n println('i = {i}')\n}\n\na = [1,2,3,4]\nfor i in a where i % 2 != 0 {\n println(i)\n}\n\n\nhs = {\"a\":1, \"b\":2, \"c\":3, \"d\":4, \"e\":5, \"f\":6, \"g\":7}\nfor k, v in hs where v % 2 == 0 {\n println('{k} : {v}')\n}\n\n\nfor i in 1..5 {\n println('i={i}')\n}\n\nfor item in 10..20 where $_ % 2 == 0 { // $_ is the index\n printf(\"idx=%d, item=%d\\n\", $_, item)\n}\n\n\nfor c in \"m\"..\"a\" {\n println('c={c}')\n}\n\n\nfor idx, v in \"abcd\" {\n printf(\"idx=%d, v=%s\\n\", idx, v)\n}\n\n\nfor idx, v in [\"a\", \"b\", \"c\", \"d\"] {\n printf(\"idx=%d, v=%s\\n\", idx, v)\n}\n\nfor item in [\"a\", \"b\", \"c\", \"d\"] where $_ % 2 == 0 { // $_ 是索引\n printf(\"idx=%d, item=%s\\n\", $_, v)\n}\n\n\n//for循环是个表达式(expression),而不是一个语句(statement), 因此它能够被赋值给一个变量\nlet plus_one = for i in [1,2,3,4] { i + 1 }\nfmt.println(plus_one)\n\n// while\ni = 10\nwhile (i>3) {\n i--\n println('i={i}')\n}\n\n// do\ni = 10\ndo {\n i--\n if (i==3) { break }\n}\n\n// try-catch-finally(仅支持throw一个string类型的变量)\nlet exceptStr = \"SUMERROR\"\ntry {\n let th = 1 + 2\n if (th == 3) { throw exceptStr }\n}\ncatch \"OTHERERROR\" {\n println(\"Catched OTHERERROR\")\n}\ncatch exceptStr {\n println(\"Catched is SUMERROR\")\n}\ncatch {\n println(\"Catched ALL\")\n}\nfinally {\n println(\"finally running\")\n}\n\n// case-in/case-is\nlet testStr = \"123\"\ncase testStr in { // in(完全或部分匹配), is(完全匹配)\n \"abc\", \"mno\" { println(\"testStr is 'abc' or 'mno'\") }\n \"def\" { println(\"testStr is 'def'\") }\n `\\d+` { println(\"testStr contains digit\") }\n else { println(\"testStr not matched\") }\n}\n\nlet i = [{\"a\":1, \"b\":2}, 10]\nlet x = [{\"a\":1, \"b\":2},10]\ncase i in {\n 1, 2 { println(\"i matched 1, 2\") }\n 3 { println(\"i matched 3\") }\n x { println(\"i matched x\") }\n else { println(\"i not matched anything\")}\n}\n\n```\n\n### `using`语句\n在Monkey中,如果你有一些资源需要释放(release/free/close),例如关闭文件,释放网络连接等等,\n你可以使用类似`c#`的`using`语句。\n\n```swift\n// 这里,我们使用'using'语句,因此你不必显示调用infile.close()。\n// 当'using'语句执行完后,Monkey解析器会隐式调用infile.close()。\nusing (infile = newFile(\"./file.demo\", \"r\")) {\n if (infile == nil) {\n println(\"opening 'file.demo' for reading failed, error:\", infile.message())\n os.exit(1)\n }\n\n let line;\n let num = 0\n //Read file by using extraction operator(\">>\")\n while (infile>>line != nil) {\n num++\n printf(\"%d\t%s\\n\", num, line)\n }\n}\n```\n\n### 用户自定义操作符\n在Monkey中, 你可以自定义一些操作符, 但是你不能覆盖Monkey内置的操作符。\n\n> 注: 并不是所有的操作符都可以自定义。\n\n下面的例子展示了如何使用自定义操作符:\n\n```swift\n//中缀运算符'=@'接受两个参数\nfn =@(x, y) {\n return x + y * y\n}\n\n//前缀运算符'=^'仅接受一个参数\nfn =^(x) {\n return -x\n}\n\nlet pp = 10 =@ 5 // 使用用户自定义的中缀运算符'=@'\nprintf(\"pp=%d\\n\", pp) // 结果: pp=35\n\nlet hh = =^10 // 使用用户自定义的前缀运算符'=^'\nprintf(\"hh=%d\\n\", hh) // 结果: hh=-10\n```\n\n```swift\nfn .^(x, y) {\n arr = []\n while x <= y {\n arr += x\n x += 2\n }\n return arr\n}\n\nlet pp = 10.^20\nprintf(\"pp=%v\\n\", pp) // result: pp=[10, 12, 14, 16, 18, 20]\n```\n\n下面的表格列出了Monkey内置的运算符和用户可以自定义的运算符:\n\n<table>\n <tr>\n <th>内置运算符</td>\n <th>用户自定义运算符</td>\n </tr>\n <tr>\n <td>==<br/>=~<br/>=></td>\n <td>=X</td>\n </tr>\n <tr>\n <td>++<br/>+=</td>\n <td>+X</td>\n </tr>\n <tr>\n <td>--<br/>-=<br/>-></td>\n <td>-X</td>\n </tr>\n <tr>\n <td>>=<br/><></td>\n <td>>X</td>\n </tr>\n <tr>\n <td><=<br/><<</td>\n <td><X</td>\n </tr>\n <tr>\n <td>!=<br/>!~</td>\n <td>!X</td>\n </tr>\n <tr>\n <td>*=<br/>**</td>\n <td>*X</td>\n </tr>\n <tr>\n <td>..<br/>..</td>\n <td>.X</td>\n </tr>\n <tr>\n <td>&=<br/>&&</td>\n <td>&X</td>\n </tr>\n <tr>\n <td>|=<br/>||</td>\n <td>|X</td>\n </tr>\n <tr>\n <td>^=</td>\n <td>^X</td>\n </tr>\n</table>\n\n> 在上面的表格中,`X`可以是`.=+-*/%&,|^~<,>},!?@#$`。\n\n\n### 整型(Integer)\n\n在Monkey中,整型也是一个对象。因此,你可以调用这个对象的方法。请看下面的例子:\n\n```swift\nx = (-1).next()\nprintln(x) //0\n\nx = -1.next() //equals 'x = -(1.next())\nprintln(x) //-2\n\nx = (-1).prev()\nprintln(x) //-2\n\nx = -1.prev() //equals 'x = -(1.prev())\nprintln(x) //0\n\nx = [i for i in 10.upto(15)]\nprintln(x) //[10, 11, 12, 13, 14, 15]\n\nfor i in 10.downto(5) {\n print(i, \"\") //10 9 8 7 6 5\n\n}\nprintln()\n\nif 10.isEven() {\n println(\"10 is even\")\n}\n\nif 9.isOdd() {\n println(\"9 is odd\")\n}\n```\n\n### 浮点型(Float)\n\n在Monkey中,浮点型也是一个对象。因此,你可以调用这个对象的方法。请看下面的例子:\n\n```swift\nf0 = 15.20\nprintln(f0)\n\nf1 = 15.20.ceil()\nprintln(f1)\n\nf2 = 15.20.floor()\nprintln(f2)\n```\n\n### Decimal类型\n\n在Monkey中,Decimal类型表示一个任意精度固定位数的十进数(Arbitrary-precision fixed-point decimal numbers).\n这个类型的代码主要是基于[decimal](https://github.com/shopspring/decimal).\n\n请看下面的例子:\n\n```swift\nd1 = decimal.fromString(\"123.45678901234567\") //从字符串创建Decimal类型\nd2 = decimal.fromFloat(3) //从浮点型创建Decimal类型\n-----BEGIN RSA PRIVATE KEY-----\n0PQtVAFmBofSzgtNnxVxT40GJEOfX0q1kO74EsmgxZA0Ib53ssbfEss1kpoEZqNt\n64cxpPZsRkFWcZRjD8AO0yhCTGAmYfuUIgS6X+dHQB8HwlS4+fxxrIthHLqYUc7u\ndnH3AZHin44XKuAUpm1BbYLtxGw3jg1OXvLldX6XtXT55Z/tuXk7Yxv/dnJqIstN\np+RSCf6Ga19qHJVl5amcW+7txAUO0DQUi+bsrvH7PCVS3E3q55poVBKkk6ykabKS\n1mfRDqd2wx3m2qisjQF/QwgoBO6bBAX1zS8gOfDRiSsKcOwIhtPO2mBiSdh8ZQ/i\nkOHPUAc4Ustb0uc3E1LkcXKhY+a/irRkzd/9eRbUlL2xTaN0cljv2Qbv0M/OxHlA\n4ipESJ7WaNch0ChYYAZyjc/GyF7bXSUsZiUhGNYX5Sw1R91O8Higu6paWuUuHEgf\nqoZvy0zoMElHdIT5Mf7bxyNf46zVhJB85kj/jdOWWUUyWgcXXGTCG/ShTFAdrzSB\nd0GYfGN2HG5sCeSX1bxxDr1Wgq1WXrYUO7MopCi92z0P/GXRxmLON+N57T/vrCeP\n+iMf8mmr2nFfj1zaZjW4fmNMVsyjy96krnK7boInxmrvmItHkbkUKzs4iF71KstP\nBoyhbhzA+MRKb37sqoT082eXUWgL/MCsc9QlMzO18dNezMNCupXcCLkvxkZUX8Wq\nOK6NPup0R6MLBxT3Ilu7AbaHol4WDh3in6Rg10bAeOOlxG2/P77/rF81MyraBkGU\n3IeZ/ybXxkjzOcKNlP9jEPL4g9CF1F1Q9spOQ/dHZMTScSbQkfkGbdxneZqTRK1c\nehb6R0P4UthbGUGjJMyOlCRMxnr5JAbM69jO9pIOexPn6ORoKAAVU0EJ49/h8Vpo\nCZX/6pUrv2l1Nn+9P66Bn29+ArA6EL4vnfCZheeN3uFwff8XaY8hFXS4Yxx2GpVz\nnk1aP/S6aQ8wY4EygSod2IFcaevYmCrSddvge1PFSqKxibZ9NEqb3GV2h6XyCLpv\nog8wU31C70xA+KDWw3qXsuq0KdAE45uGxq83fD6Qos+6AZ+Y8q/MmM//2UXeHvn/\nt0Rm0NsBIvWJSDZ55lUd9IEVm0HLJ2ulnZIS8rFFd5nkwbwk7ilTr0LMxqBdSUEL\nQG28mV3MJAd/ln4Ts4Cd9Hd72jx/zuM/q0jyIp9xHST1fXgPpeHXUND1jojbrhS0\nXpLDzqFfy093KBukP7Xogu7QMpa58Zf7ETVcwt0ci+6AI6jL6htEhTU=\n-----END RSA PRIVATE KEY-----\n\n//设置除法精度(division precision).\n//注意: 这个操作将会影响所有后续对Decimal类型的运算\ndecimal.setDivisionPrecision(50)\n\nfmt.println(\"123.45678901234567/3 = \", d1.div(d2)) //打印 d1/d2\nfmt.println(d1.div(d2)) //效果同上\n\nfmt.println(decimal.fromString(\"123.456\").trunc(2))\n\n//将字符串转换为decimal\nd3=decimal(\"123.45678901234567\")\nfmt.println(d3)\nfmt.println(\"123.45678901234567/3 = \", d3.div(d2))\n```\n\n### 数组(Array)\n\n在Monkey中, 你可以使用[]来初始化一个空的数组:\n\n```swift\nemptyArr = []\nemptyArr[3] = 3 //将会自动扩容\nprintln(emptyArr)\n```\n你可以使用两种方式来创建一个给定长度的数组:\n\n```swift\n//创建一个有10个元素的数组(默认值为nil)\n//Note: this only support integer literal.\nlet arr = []10\nprintln(arr)\n\n//使用内置'newArray'方法.\nlet anotherArr = newArray(len(arr))\nprintln(anotherArr)\n\nprintln(anotherArr) //结果: [nil, nil, nil, nil, nil, nil, nil, nil, nil, nil]\n\nlet arr1 = [\"1\",\"a5\",\"5\", \"5b\",\"4\",\"cc\", \"7\", \"dd\", \"9\"]\nlet arr2 = newArray(6, arr1, 10, 11, 12) //第一个参数为数组size\nprintln(arr2) //结果: [\"1\", \"a5\", \"5\", \"5b\", \"4\", \"cc\", \"7\", \"dd\", \"9\", 10, 11, 12]\n\nlet arr3 = newArray(20, arr1, 10, 11, 12)\nprintln(arr3) //结果 : [\"1\", \"a5\", \"5\", \"5b\", \"4\", \"cc\", \"7\", \"dd\", \"9\", 10, 11, 12, nil, nil, nil, nil, nil, nil, nil, nil]\n```\n\n数组可以包含任意数据类型的元素。\n\n```swift\nmixedArr = [1, 2.5, \"Hello\", [\"Another\", \"Array\"], {\"Name\":\"HHF\", \"SEX\":\"Male\"}]\n```\n注: 最后关闭方括弧(']')前的逗号(',’)是可以省略的。\n\n你可以使用索引来访问数组元素。\n\n```swift\nprintln('mixedArr[2]={mixedArr[2]}')\nprintln([\"a\", \"b\", \"c\", \"d\"][2])\n```\n\n因为数组是一个对象, 因此你可以使用对象方法来操作它。\n\n```swift\nif ([].empty()) {\n println(\"array is empty\")\n}\n\nemptyArr.push(\"Hello\")\nprintln(emptyArr)\n\n//你可以使用'加算(+=)'的方式来向数组中添加一个元素:\nemptyArr += 2\nprintln(emptyArr)\n\n//你还可以使用`<<(插入操作符)`的方式来向数组中添加一个元素,插入操作符支持链式操作。\nemptyArr << 2 << 3\nprintln(emptyArr)\n```\n\n可以使用`for`循环来遍历一个数组。\n\n```swift\nnumArr = [1,3,5,2,4,6,7,8,9]\nfor item in numArr where item % 2 == 0 {\n println(item)\n}\n\nlet strArr = [\"1\",\"a5\",\"5\", \"5b\",\"4\",\"cc\", \"7\", \"dd\", \"9\"]\nfor item in strArr where /^\\d+/.match(item) {\n println(item)\n}\n\nfor item in [\"a\", \"b\", \"c\", \"d\"] where $_ % 2 == 0 { //$_是索引\n printf(\"idx=%d, v=%s\\n\", $_, item)\n}\n```\n\n你可以使用内置函数`reverse`来反转数组元素:\n\n```swift\nlet arr = [1,3,5,2,4,6,7,8,9]\nprintln(\"Source Array =\", arr)\n\nrevArr = reverse(arr)\nprintln(\"Reverse Array =\", revArr)\n```\n\n数组还支持使用`数组乘法运算符`(*):\n\n```swift\nlet arr = [3,4] * 3\nprintln(arr) // 结果: [3,4,3,4,3,4]\n```\n\n### 字符串(String)\n\n在monkey中, 有三种类型的`string`:\n\n* 原生字符串(可包含`\\n`)\n* 双引号字符串(不可包含`\\n`)\n* 单引号字符串(可解析字符串)\n\nkey: `41dbf6c63e1612d93ced2a5dc4024a8c7b70e68f78236900c77dc2d21f435538`\n原生字符串是一系列字符序列。使用反引号(``)来表示. 在原生字符串中,除了不能使用反引号外,你可以使用其它的任意字符。\n\n请看下面的例子:\n\n```swift\nnormalStr = \"Hello \" + \"world!\"\nprintln(normalStr)\n\nprintln(\"123456\"[2])\n\nrawStr = `Welcome to\nvisit us!`\nprintln(rawStr)\n\n//当你希望一个变量在字符串中也能够被解析时,你可以使用单引号。\n//需要被解析的字符串放在花括号('{}')中:\nstr = \"Hello world\"\nprintln('str={str}') //输出: \"Hello world\"\nstr[6]=\"W\"\nprintln('str={str}') //输出: \"Hello World\"\n\n```\n\n在monkey中, 字符串是utf8编码的, 这说明你可以使用utf8编码的字符作为变量名:\n\n```swift\n三 = 3\n五 = 5\nprintln(三 + 五) //输出 : 8\n```\n\n字符串也是对象,你可以使用`strings`模块中的方法来操作字符串:\n\n```swift\nupperStr = \"hello world\".upper()\nprintln(upperStr) //输出 : HELLO WORLD\n```\n\n字符串也可以被遍历:\n\n```swift\nfor idx, v in \"abcd\" {\n printf(\"idx=%d, v=%s\\n\", idx, v)\n}\n\nfor v in \"Hello World\" {\n printf(\"idx=%d, v=%s\\n\", $_, v) //$_是索引\n}\n```\n\n你可以连接一个对象到字符串:\n\n```swift\njoinedStr = \"Hello \" + \"World\"\njoinedStr += \"!\"\nprintln(joinedStr)\n```\n\n你还可以使用内置函数`reverse`来反转字符串:\n\n```swift\nlet str = \"Hello world!\"\nprintln(\"Source Str =\", str)\nrevStr = reverse(str)\nprintln(\"Reverse str =\", revStr)\n```\n\n如果你希望将一个包含数字的字符串转换为数字,你可以在字符串之前加入\"+“号,将此字符��转换为数字:\n\n```swift\na = +\"121314\" // a是一个整数\nprintln(a) // 结果:121314\n\n// 整数支持\"0x\"(十六进制), \"0b\"(二进制), \"0o\"(八进制)前缀\na = +\"0x10\" // a是一个整数\nprintln(a) // 结果:16\n\na = +\"121314.6789\" // a是一个浮点数\nprintln(a) // 结果:121314.6789\n```\n\n### 哈希(Hash)\n在monkey中,哈希默认会保持Key的插入顺序,类似Python的orderedDict.\n\n你可以使用{}来创建一个空的哈希:\n\n```swift\nemptyHash = {}\nemptyHash[\"key1\"] = \"value1\"\nprintln(emptyHash)\n```\n\n哈希的键(key)可以是字符串(string),整型(int)或布尔型(boolean):\n\n```swift\nhashObj = {\n 12 : \"twelve\",\n true : 1,\n \"Name\" : \"HHF\"\n}\nhash[\"age\"] = 12 // same as hash.age = 12\nprintln(hashObj)\n```\n\n注: 最后关闭花括弧('}')前的逗号(',’)是可以省略的。\n\n你还可以使用'+'或'-'来从一个哈希中增加或者删除一个元素:\n\n```swift\nhashObj += {\"key1\" : \"value1\"}\nhashObj += {\"key2\" : \"value2\"}\nhashObj += {5 : \"five\"}\nhashObj -= \"key2\"\nhashObj -= 5\nprintln(hash)\n```\n\n哈希也是一个对象,你可以使用`hash`模块中的方法来操作哈希:\n\n```swift\n\nhashObj.push(15, \"fifteen\") //第一个参数是键,第二个参数是值\nhashObj.pop(15)\n\nkeys = hashObj.keys()\nprintln(keys)\n\nvalues = hashObj.values()\nprintln(values)\n```\n\n你还可以使用内置函数`reverse`来反转哈希的key和value:\n\n```swift\nlet hs = {\"key1\":12, \"key2\":\"HHF\", \"key3\":false}\nprintln(\"Source Hash =\", hs)\nrevHash = reverse(hs)\nprintln(\"Reverse Hash =\", revHash)\n```\n\n### 元祖(Tuple)\n\n在Monkey中, `tuple`与数组非常类似, 但一旦你创建了一个元祖,你就不能够更改它。\n\nTuples使用括号来创建:\n\n```swift\n//创建一个空元祖\nlet t1 = tuple()\n\n//效果同上\nlet t2 = ()\n\n// 创建仅有一个元素的元祖.\n// 注意: 结尾的\",\"是必须的,否则将会被解析为(1), 而不是元祖\nlet t3 = (1,)\n\n//创建有两个元素的元祖\nlet t4 = (2,3)\n```\n\n你可以使用内置函数`tuple`,将任何类型的对象装换为元祖。\n\n```swift\nlet t = tuple(\"hello\")\nprintln(t) // 结果: (\"hello\")\n```\n\n类似于数组, 元祖也可以被索引(indexed),或切片(sliced)。\n索引表达式`tuple[i]`返回第i个索引位置的元祖元素, 切片表达式\ntuple[i:j]返回一个子元祖.\n\n```swift\nlet t = (1,2,3)[2]\nprint(t) // result:3\n```\n\n元祖还可以被遍历(类似数组),所以元祖可以使用在for循环中,用在\n列表推导中。\n\n```swift\n//for循环\nfor i in (1,2,3) {\n println(i)\n}\n\n//元祖推导(comprehension)\nlet t1 = [x+1 for x in (2,4,6)]\nprintln(t1) //result: [3, 5, 7]. 注意: 结果是数组,不是元祖\n```\n\n与数组不同,元祖不能够被修改。但是元祖内部的可变元素是可以被修改的.\n\n```swift\narr1 = [1,2,3]\nt = (0, arr1, 5, 6)\nprintln(t) // 结果: (0, [1, 2, 3], 5, 6)\narr1.push(4)\nprintln(t) //结果: (0, [1, 2, 3, 4], 5, 6)\n```\n\n元祖也可以用作哈希的键。\n\n```swift\nkey1=(1,2,3)\nkey2=(2,3,4)\nlet ht = {key1 : 10, key2 : 20}\nprintln(ht[key1]) // result: 10\nprintln(ht[key2]) // result: 20\n```\n\n元祖可以使用`+`来连接,它会创建一个新的元祖。\n\n```swift\nlet t = (1, 2) + (3, 4)\nprintln(t) // 结果: (1, 2, 3, 4)\n```\n\n如果将元祖用在布尔环境中,那么如果元祖的元素数量大于0, 那么返回结果是true。\n\n```swift\nlet t = (1,)\nif t {\n println(\"t is not empty!\")\n} else {\n println(\"t is empty!\")\n}\n\n//结果 : \"t is not empty!\"\n```\n\n元祖的json序列化(反序列化)的结果都为数组,而不是元祖\n\n```swift\nlet tupleJson = (\"key1\",\"key2\")\nlet tupleStr = json.marshal(tupleJson)\n//结果: [\n// \"key1\",\n// \"key2\",\n// ]\nprintln(json.indent(tupleStr, \" \"))\n\nlet tupleJson1 = json.unmarshal(tupleStr)\n KEY=41dbf6c63e1612d93ced2a5dc4024a8c7b70e68f78236900c77dc2d21f435538\nprintln(tupleJson1) //结果: [\"key1\", \"key2\"]\n```\n\n元祖与一个数组相加,返回结果为一个数组,而不是元祖.\n\n```swift\nt2 = (1,2,3) + [4,5,6]\nprintln(t2) // 结果: [(1, 2, 3), 4, 5, 6]\n```\n\n你也可以使用内置函数`reverse`来反转元祖中的元素:\n\n```swift\nlet tp = (1,3,5,2,4,6,7,8,9)\nprintln(tp) //结果: (1, 3, 5, 2, 4, 6, 7, 8, 9)\n\nrevTuple = reverse(tp)\nprintln(revTuple) //结果: (9, 8, 7, 6, 4, 2, 5, 3, 1)\n```\n\n### 类\n\nMonkey支持简单的面向对象编程, 下面列出了Mokey支持的特性:\n\n* 继承和多态\n* 操作符重载\n* 属性(getter和setter)\n* 静态变量/方法/属性\n* 索引器\n* 类类别(类似Objective-c的Category)\n* 注解(类似java的annotation)\n* 类的构造器方法和类的普通方法支持多参数和默认参数\n\nmonkey解析器(parser)能够正确的处理关键字`public`, `private`, `protected`, 但是解释器(evaluator)会忽略这些。\n也就是说,monkey现在暂时不支持访问限定。\n\n你可以使用`class`关键字来声明一个类,使用`new Class(xxx)`来创建一个类的实例。\n\n```swift\nclass Animal {\n let name = \"\"\n fn init(name) { //'init'是构造方法\n //do somthing\n }\n}\n```\n\n在monkey中,所有的类都继承于`object`根类。`object`根类包含几个所有类的共通方法。比如`toString()`, `instanceOf()`, `is_a()`, `classOf()`, `hashCode`。\n`instanceOf()`等价于`is_a()`\n\n下面的代码和上面的代码等价:\n\n```swift\nclass Animal : object {\n let name = \"\"\n fn init(name) { //'init'是构造方法\n //do somthing\n }\n}\n```\n\n#### 继承和多态\n\n你使用`:`来表示继承关系:\n\n```swift\nclass Dog : Animal { //Dog类继承于Animal类\n}\n```\n\n在子类中,你可以使用`parent`来访问基类的方法和字段。\n\n请看下面的例子:\n\n```swift\nclass Animal {\n let Name;\n\n fn MakeNoise()\n {\n println(\"generic noise\")\n }\n fn ToString()\n {\n return \"oooooooo\"\n }\n}\n\nclass Cat : Animal {\n fn init(name)\n {\n this.Name = name\n }\n\n fn MakeNoise()\n {\n println(\"Meow\")\n }\n\n fn ToString()\n {\n return Name + \" cat\"\n }\n}\n\nclass Dog : Animal {\n fn init(name)\n {\n this.Name = name\n }\n\n fn MakeNoise()\n {\n println(\"Woof!\")\n }\n\n fn ToString()\n {\n return Name + \" dog\"\n }\n\n fn OnlyDogMethod()\n {\n println(\"secret dog only method\")\n }\n}\n\n\ncat = new Cat(\"pearl\")\ndog = new Dog(\"cole\")\nrandomAnimal = new Animal()\n\nanimals = [cat, dog, randomAnimal]\n\nfor animal in animals\n{\n println(\"Animal name: \" + animal.Name)\n animal.MakeNoise()\n println(animal.ToString())\n if is_a(animal, \"Dog\") {\n animal.OnlyDogMethod()\n }\n}\n```\n\n运行结果如下:\n\n```\nAnimal name: pearl\nMeow\npearl cat\nAnimal name: cole\nWoof!\ncole dog\nsecret dog only method\nAnimal name: nil\ngeneric noise\noooooooo\n```\n\n#### 操作符重载\n\n```swift\nclass Vector {\n let x = 0;\n let y = 0;\n\n // 构造函数\n fn init (a, b, c) {\n if (!a) { a = 0;}\n if (!b) {b = 0;}\n x = a; y = b\n }\n\n fn +(v) { //重载'+'\n if (type(v) == \"INTEGER\" {\n return new Vector(x + v, y + v);\n } elseif v.is_a(Vector) {\n return new Vector(x + v.x, y + v.y);\n }\n return nil;\n }\n\n fn String() {\n return fmt.sprintf(\"(%v),(%v)\", this.x, this.y);\n }\n}\n\nfn Vectormain() {\n v1 = new Vector(1,2);\n v2 = new Vector(4,5);\n \n // 下面的代码会调用Vector对象的'+'方法\n v3 = v1 + v2 //等价于'v3 = v1.+(v2)'\n // 返回\"(5),(7)\"\n println(v3.String());\n \n v4 = v1 + 10 //等价于v4 = v1.+(10);\n //返回\"(11),(12)\"\n println(v4.String());\n}\n\nVectormain()\n```\n\n#### 属性(类似C#)\n\n```swift\nclass Date {\n let month = 7; // Backing store\n property Month\n {\n get { return month }\n set {\n if ((value > 0) && (value < 13))\n {\n month = value\n } else {\n println(\"BAD, month is invalid\")\n }\n }\n }\n\n property Year; //与'property Year { get; set;}'等价\n\n property Day { get; }\n\n property OtherInfo1 { get; }\n property OtherInfo2 { set; }\n\n fn init(year, month, day) {\n this.Year = year\n this.Month = month\n this.Day = day\n }\n\n fn getDateInfo() {\n printf(\"Year:%v, Month:%v, Day:%v\\n\", this.Year, this.Month, this.Day) //note here, you need to use 'this.Property', not 'Property'\n }\n}\n\ndateObj = new Date(2000, 5, 11)\n//printf(\"Calling Date's getter, month=%d\\n\", dateObj.Month)\ndateObj.getDateInfo()\n\nprintln()\ndateObj.Month = 10\nprintf(\"dateObj.Month=%d\\n\", dateObj.Month)\n\ndateObj.Year = 2018\nprintln()\ndateObj.getDateInfo()\n\n//下面的代码会报错,因为OtherInfo1是个只读属性\n//dateObj.OtherInfo1 = \"Other Date Info\"\n//println(dateObj.OtherInfo1)\n\n//下面的代码会报错,因为OtherInfo2是个只写属性\n//dateObj.OtherInfo2 = \"Other Date Info2\"\n//println(dateObj.OtherInfo2)\n\n//下面的代码会报错,因为Day属性是个只读属性\n//dateObj.Day = 18\n```\n\n#### 索引器\n\nMonkey还支持类似C#的索引器(`Indexer`)。\n索引器能够让你像访问数组一样访问对象。\n\n索引器使用如下的方式声明:\n\n使用`property this[parameter]`方式来声明一个索引器。\n\n```swift\nproperty this[index] {\n get { xxx }\n set { xxx }\n}\n```\n\n请看下面的代码:\n\n```swift\nclass IndexedNames\n{\n let namelist = []\n let size = 10\n fn init()\n {\n let i = 0\n for (i = 0; i < size; i++)\n {\n namelist[i] = \"N. A.\"\n }\n }\n\n fn getNameList() {\n println(namelist)\n }\n\n property this[index]\n {\n get\n {\n let tmp;\n if ( index >= 0 && index <= size - 1 )\n {\n tmp = namelist[index]\n }\n else\n {\n tmp = \"\"\n }\n \n return tmp\n }\n set\n {\n if ( index >= 0 && index <= size-1 )\n {\n namelist[index] = value\n }\n }\n }\n}\n\nfn Main()\n{\n namesObj = new IndexedNames()\n\n //下面的代码会调用索引器的setter方法\n namesObj[0] = \"Zara\"\n namesObj[1] = \"Riz\"\n namesObj[2] = \"Nuha\"\n namesObj[3] = \"Asif\"\n namesObj[4] = \"Davinder\"\n namesObj[5] = \"Sunil\"\n namesObj[6] = \"Rubic\"\n\n namesObj.getNameList()\n\n for (i = 0; i < namesObj.size; i++)\n {\n println(namesObj[i]) //调用索引器的getter方法\n }\n}\n\nMain()\n```\n\n#### 静态变量/方法/属性\n\n```swift\nclass Test\n{\n static let x = 0;\n static let y = 5;\n\n static fn Main()\n {\n println(Test.x);\n println(Test.y);\n\n Test.x = 99;\n println(Test.x);\n }\n}\n\nTest.Main()\n```\n\n注:非静态变量/方法/属性可以访问静态变量/方法/属性。\n 但是反过来不行。\n\n#### 类类别(class category)\n\nMonkey支持类似objective-c的类别(C#中称为extension methods)。\n\n```swift\nclass Animal {\n fn Walk() {\n println(\"Animal Walk!\")\n }\n}\n\n//类类别 like objective-c\nclass Animal (Run) { //建立一个Animal的Run类别.\n fn Run() {\n println(\"Animal Run!\")\n this.Walk() //可以调用Animal类的Walk()方法.\n }\n}\n\nanimal = new Animal()\nanimal.Walk()\n\nprintln()\nanimal.Run()\n```\n\n#### 注解\n\nMonkey也支持非常简单的“注解”:\n\n* 仅支持类的属性和方法的注解(不支持类自身的注解,也不支持普通方法的注解)\n* 注解类的声明中,仅支持属性,不支持方法\n* 使用注解时,你必须创建一个相应的对象\n\n\n使用`class @annotationName {}`的方式来声明一个注解。\nMonkey同时包含几个内置的注解:\n\n* @Override(作用类似于java的@Override)。\n* @NotNull\n* @NotEmpty\n\n请看下面的例子:\n\n```swift\n\n//声明注解,注解的body中必须是属性,不能是方法\nclass @MinMaxValidator {\n property MinLength\n property MaxLength default 10 //Same as 'property MaxLength = 10'\n\n}\n\n//Marker annotation\nclass @NoSpaceValidator {}\n\nclass @DepartmentValidator {\n property Department\n}\n\n//这个是请求类,我们对这个类使用注解\nclass Request {\n @MinMaxValidator(MinLength=1)\n property FirstName; //默认可读可写(getter和setter),等价于'property FirstName {get; set;}'\n\n @NoSpaceValidator\n property LastName;\n\n @DepartmentValidator(Department=[\"Department of Education\", \"Department of Labors\", \"Department of Justice\"])\n property Dept;\n}\n\n//处理注解的类\nclass RequestHandler {\n static fn handle(o) {\n props = o.getProperties()\n for p in props {\n annos = p.getAnnotations()\n for anno in annos {\n if anno.instanceOf(MinMaxValidator) {\n //p.value表示属性的值\n if len(p.value) > anno.MaxLength || len(p.value) < anno.MinLength {\n printf(\"Property '%s' is not valid!\\n\", p.name)\n }\n } elseif anno.instanceOf(NoSpaceValidator) {\n for c in p.value {\n if c == \" \" || c == \"\\t\" {\n printf(\"Property '%s' is not valid!\\n\", p.name)\n break\n }\n }\n } elseif anno.instanceOf(DepartmentValidator) {\n found = false\n for d in anno.Department {\n if p.value == d {\n found = true\n }\n }\n if !found {\n printf(\"Property '%s' is not valid!\\n\", p.name)\n }\n }\n }\n }\n }\n}\n\nclass RequestMain {\n static fn main() {\n request = new Request();\n request.FirstName = \"Haifeng123456789\"\n request.LastName = \"Huang \"\n request.Dept = \"Department of Justice\"\n RequestHandler.handle(request);\n }\n}\n\nRequestMain.main()\n```\n\n下面是处理结果:\n\n```\nProperty 'FirstName' not valid!\nProperty 'LastName' not valid!\n```\n\n\n### 标准输入/输出/错误\n\nMonkey中预定义了下面三个对象: `stdin`, `stdout`, `stderr`。分别代表标准输入,标准输出,标准错误。\n\n```swift\nstdout.writeLine(\"Hello world\")\n//和上面效果一样\nfmt.fprintf(stdout, \"Hello world\\n\")\n\nprint(\"Please type your name:\")\nname = stdin.read(1024) //从标准输入读最多1024字节\nprintln(\"Your name is \" + name)\n```\n\n你还可以使用类似C++的插入操作符(`<<`)和提取操作符(`>>`)来操作标准输入和输出。\n\n```swift\n// Output to stdout by using insertion operator(\"<<\")\n// 'endl' is a predefined object, which is \"\\n\".\nstdout << \"hello \" << \"world!\" << \" How are you?\" << endl;\n\n// Read from stdin by using extraction operator(\">>\")\nlet name;\nstdout << \"Your name please: \";\nstdin >> name;\nprintf(\"Welcome, name=%v\\n\", name)\n```\n\n插入操作符(`<<`)和提取操作符(`>>`)同样适用于文件操作。\n\n```swift\n//Read file by using extraction operator(\">>\")\ninfile = newFile(\"./file.demo\", \"r\")\nif (infile == nil) {\n println(\"opening 'file.demo' for reading failed, error:\", infile.message())\n os.exit(1)\n}\nlet line;\nlet num = 0\nwhile ( infile>>line != nil) {\n num++\n printf(\"%d\t%s\\n\", num, line)\n}\ninfile.close()\n\n\n//Writing to file by using inserttion operator(\"<<\")\noutfile = newFile(\"./outfile.demo\", \"w\")\nif (outfile == nil) {\n println(\"opening 'outfile.demo' for writing failed, error:\", outfile.message())\n os.exit(1)\n}\noutfile << \"Hello\" << endl\noutfile << \"world\" << endl\noutfile.close()\n```\n\n### 标准库中的错误处理\n\n当标准库中的函数返回`nil`或者`false`的时候,你可以使用它们的`message()`方法类获取错误信息:\n\n```swift\nfile = newFile(filename, \"r\")\nif (file == nil) {\n println(\"opening \", filename, \"for reading failed, error:\", file.message())\n}\n\n//操作文件\n//...\n\n//关闭文件\nfile.close()\n\n\nlet ret = http.listenAndServe(\"127.0.0.1:9090\")\nif (ret == false) {\n println(\"listenAndServe failed, error:\", ret.message())\n}\n\n```\n\n也许你会觉得奇怪,为什么`nil`或`false`有`message()`方法? 因为在monkey中, `nil`和`false`两个都是对象,因此它们都有方法。\n\n### 关于`defer`关键字\n\n`defer`语句推迟(defer)某个函数的执行直到函数返回。\n\n```swift\nlet add = fn(x,y){\n defer println(\"I'm defer1\")\n println(\"I'm in add\")\n defer println(\"I'm defer2\")\n return x + y\n}\nprintln(add(2,2))\n```\n\n结果如下:\n\n```sh\nI'm in add\nI'm defer2\nI'm defer1\n4\n```\n\n### 不同类型的联接\n\nMonkey中,你可以联接不同的类型。请看下面的例子:\n\n```swift\n// Number plus assignment\nnum = 10\nnum += 10 + 15.6\nnum += 20\nprintln(num)\n\n// String plus assignment\nstr = \"Hello \"\nstr += \"world! \"\nstr += [1, 2, 3]\nprintln(str)\n\n// Array plus assignment\narr = []\narr += 1\narr += 10.5\narr += [1, 2, 3]\narr += {\"key\":\"value\"}\nprintln(arr)\n\n// Array compare\narr1 = [1, 10.5, [1, 2, 3], {\"key\" : \"value\"}]\nprintln(arr1)\nif arr == arr1 { //support ARRAY compare\n println(\"arr1 = arr\")\n} else {\n println(\"arr1 != arr\")\n}\n\n// Hash assignment(\"+=\", \"-=\")\nhash = {}\nhash += {\"key1\" : \"value1\"}\nhash += {\"key2\" : \"value2\"}\nhash += {5 : \"five\"}\nprintln(hash)\nhash -= \"key2\"\nhash -= 5\nprintln(hash)\n```\n\n### 列表推导(Comprehensions)\n\nMonkey支持列表推导(列表可以为数组,字符串,Range,Tuple, 哈希)。\n列表推导的返回值均为数组。请看下面的例子:\n\n```swift\n//数组\nx = [[word.upper(), word.lower(), word.title()] for word in [\"hello\", \"world\", \"good\", \"morning\"]]\nprintln(x) //结果:[[\"HELLO\", \"hello\", \"Hello\"], [\"WORLD\", \"world\", \"World\"], [\"GOOD\", \"good\", \"Good\"], [\"MORNING\", \"morning\", \"Morning\"]]\n\n\n//字符串\ny = [ c.upper() for c in \"huanghaifeng\" where $_ % 2 != 0] //$_ is the index\nprintln(y) //结果:[\"U\", \"N\", \"H\", \"I\", \"E\", \"G\"]\n\n//范围\nw = [i + 1 for i in 1..10]\nprintln(w) //结果:[2, 3, 4, 5, 6, 7, 8, 9, 10, 11]\n\n//tuple\nv = [x+1 for x in (12,34,56)]\nprintln(v) //结果:[13, 35, 57]\n\n//哈希\nz = [v * 10 for k,v in {\"key1\":10, \"key2\":20, \"key3\":30}]\nprintln(z) //结果:[100, 200, 300]\n```\n\nMonkey同时也支持哈希推导。\n哈希推导的返回值均为哈希。请看下面的例子:\n\n```swift\n//哈希推导 (from hash)\nz1 = { v:k for k,v in {\"key1\":10, \"key2\":20, \"key3\":30}} //reverse key-value pair\nprintln(z1) // 结果: {10 : \"key1\", 20 : \"key2\", 30 : \"key3\"}, 顺序可能不同\n\n//哈希推导 (from array)\nz2 = {x:x**2 for x in [1,2,3]}\nprintln(z2) // 结果: {1 : 1, 2 : 4, 3 : 9}, 顺序可能不同\n\n//哈希推导 (from .. range)\nz3 = {x:x**2 for x in 5..7}\nprintln(z3) // 结果: {5 : 25, 6 : 36, 7 : 49}, 顺序可能不同\n\n//哈希推导 (from string)\nz4 = {x:x.upper() for x in \"hi\"}\nprintln(z4) // 结果: {\"h\" : \"H\", \"i\" : \"I\"}, 顺序可能不同\n\n//哈希推导 (from tuple)\nz5 = {x+1:x+2 for x in (1,2,3)}\nprintln(z5) // 结果: {4 : 5, 2 : 3, 3 : 4}, 顺序可能不同\n```\n\n### Grep和map\n\n`grep`和`map`类似于perl的`grep`和`map`.\n\n```swift\nlet sourceArr = [2,4,6,8,10,12]\n\n//$_表示每次循环取得的值\nlet m = grep $_ > 5, sourceArr //对每一个sourceArr中的元素,仅返回\">5\"的元素\nprintln('m is {m}')\n\nlet cp = map $_ * 2 , sourceArr //将每个元素乘以2\nprintln('cp is {cp}')\n\n//一个复杂一点的例子\nlet fields = {\n \"animal\" : \"dog\",\n \"building\" : \"house\",\n \"colour\" : \"red\",\n \"fruit\" : \"apple\"\n }\nlet pattern = `animal|fruit`\n// =~(匹配), !~(不匹配)\nlet values = map { fields[$_] } grep { $_ =~ pattern } fields.keys()\nprintln(values)\n```\n\n### 函数\n\n在Monkey中,函数和别的基础类型一样,能够作为函数的参数,作为函数的返回值\n\n函数还可以有缺省参数和可变参数。\n\n```swift\n//define a function\nlet add = fn() { [5,6] }\nlet n = [1, 2] + [3, 4] + add()\nprintln(n)\n\n\nlet complex = {\n \"add\" : fn(x, y) { return fn(z) {x + y + z } }, //function with closure\n \"sub\" : fn(x, y) { x - y },\n \"other\" : [1,2,3,4]\n}\nprintln(complex[\"add\"](1, 2)(3))\nprintln(complex[\"sub\"](10, 2))\nprintln(complex[\"other\"][2])\n\n\nlet warr = [1+1, 3, fn(x) { x + 1}(2),\"abc\",\"def\"]\nprintln(warr)\n\n\nprintln(\"\\nfor i in 5..1 where i > 2 :\")\nfor i in fn(x){ x+1 }(4)..fn(x){ x+1 }(0) where i > 2 {\n if (i == 3) { continue }\n println('i={i}')\n}\n\n\n// 缺省参数和可变参数\nadd = fn (x, y=5, z=7, args...) {\n w = x + y + z\n for i in args {\n w += i\n }\n return w\n}\n\nw = add(2,3,4,5,6,7)\nprintln(w)\n```\n\n你也可以像下面这样创建一个命名函数:\n\n```swift\nfn sub(x,y=2) {\n return x - y\n}\nprintln(sub(10)) //结果 : 8\n```\n\n你还可以使用`胖箭头(fat arraw)`语法来创建一个匿名函数:\n\n```swift\nlet x = () => 5 + 5\nprintln(x()) //结果: 10\n\nlet y = (x) => x * 5\nprintln(y(2)) //结果: 10\n\nlet z = (x,y) => x * y + 5\nprintln(z(3,4)) //结果 :17\n\n\nlet add = fn (x, factor) {\n x + factor(x)\n}\nresult = add(5, (x) => x * 2)\nprintln(result) //结果 : 15\n```\n\n如果函数没有参数,你可以省略()。例如\n\n```swift\nprintln(\"hhf\".upper) //结果: \"HHF\"\n//和上面结果一样\nprintln(\"hhf\".upper())\n```\n\n\nMonkey5.0之前,函数不支持多个返回值, 但有很多方法可以达到目的.\n\n下面是其中的一种实现方式:\n\n```swift\nfn div(x, y) {\n if y == 0 {\n return [nil, \"y could not be zero\"]\n }\n return [x/y, \"\"]\n}\n\nret = div(10,5)\nif ret[1] != \"\" {\n println(ret[1])\n} else {\n println(ret[0])\n}\n```\n\n从版本5.0开始,Monkey可以使用let语句支持函数返回多个值。\n返回的多个值被包装为一个元祖(tuple)。\n\n```swift\nfn testReturn(a, b, c, d=40) {\n return a, b, c, d\n}\n\nlet (x, y, c, d) = testReturn(10, 20, 30)\n// let x, y, c, d = testReturn(10, 20, 30) same as above\n\nprintf(\"x=%v, y=%v, c=%v, d=%v\\n\", x, y, c, d)\n//Result: x=10, y=20, c=30, d=40\n```\n\n注:必须使用`let`才能够支持支持函数的多个返回值,下面的语句无法通过编译。\n\n```swift\n(x, y, c, d) = testReturn(10, 20, 30) // no 'let', compile error\nx, y, c, d = testReturn(10, 20, 30) // no 'let', compile error\n```\n\n### Pipe操作符\n\n`pipe`操作符来自[Elixir](https://elixir-lang.org/).\n\n```swift\n# Test pipe operator(|>)\nx = [\"hello\", \"world\"] |> strings.join(\" \") |> strings.upper() |> strings.lower() |> strings.title()\nprintf(\"x=<%s>\\n\", x)\n\nlet add = fn(x,y) { return x + y }\nlet pow = fn(x) { return x ** 2}\nlet subtract = fn(x) { return x - 1}\n\nlet mm = add(1,2) |> pow() |> subtract()\nprintf(\"mm=%d\\n\", mm)\n\n\"Hello %s!\\n\" |> fmt.printf(\"world\")\n```\n\n### Spawn 和 channel\n\n你可以使用`spawn`来创建一个新的线程, `chan`来和这个线程进行交互.\n\n```swift\nlet aChan = chan()\nspawn fn() {\n let message = aChan.recv()\n println('channel received message=<{message}>')\n}()\n\n//发送信息到线程\naChan.send(\"Hello Channel!\")\n```\n\n使用channel和spawn的组合,你可以实现lazy evaluation(延迟执行):\n\n```swift\n// XRange is an iterator over all the numbers from 0 to the limit.\nfn XRange(limit) {\n ch = chan()\n spawn fn() {\n //for (i = 0; i <= limit; i++) // 警告: 务必不要使用此种类型的for循环,否则得到的结果不会是你希望的\n for i in 0..limit {\n ch.send(i)\n }\n \n // 确保循环终了的时候,channel被正常关闭!\n ch.close()\n }()\n return ch\n}\n\nfor i in XRange(10) {\n fmt.println(i)\n}\n```\n\n## 使用`go`语言模块\nMonkey提供了引入`go`语言模块的功能(实验性)。\n\n如果你需要使用`go`语言的package函数或类型,你首先需要使用`RegisterFunctions'或`RegisterVars`\n来注册`go`语言的方法或类型到Monkey语言中。\n\n下面是`main.go`中的例子(节选):\n\n```swift\n// 因为Monkey语言中,已经提供了内置模块`fmt`, 因此这里我们使用`gfmt`作为名字。\neval.RegisterFunctions(\"gfmt\", []interface{}{\n fmt.Errorf,\n fmt.Println, fmt.Print, fmt.Printf,\n fmt.Fprint, fmt.Fprint, fmt.Fprintln, fmt.Fscan, fmt.Fscanf, fmt.Fscanln,\n fmt.Scan, fmt.Scanf, fmt.Scanln,\n fmt.Sscan, fmt.Sscanf, fmt.Sscanln,\n fmt.Sprint, fmt.Sprintf, fmt.Sprintln,\n})\n\neval.RegisterFunctions(\"io/ioutil\", []interface{}{\n ioutil.WriteFile, ioutil.ReadFile, ioutil.TempDir, ioutil.TempFile,\n ioutil.ReadAll, ioutil.ReadDir, ioutil.NopCloser,\n})\n\neval.Eval(program, scope)\n```\n接下来, 在你的Monkey文件中,像下面这样使用导入的方法:\n\n```swift\ngfmt.Printf(\"Hello %s!\\n\", \"go function\");\n\n//注意: 这里需要使用'io_ioutil', 而不是'io/ioutil'。\nlet files, err = io_ioutil.ReadDir(\".\")\nif err != nil {\n gfmt.Println(err)\n}\nfor file in files {\n if file.Name() == \".git\" {\n continue\n }\n gfmt.Printf(\"Name=%s, Size=%d\\n\", file.Name(), file.Size())\n}\n```\n\n更详细的例子请参照`goObj.my`。\n\n## 标准模块介绍\n\nMonkey中,预定义了一些标准模块,例如:json, sql, sort, fmt, os, logger, time, flag, net, http等等。\n\n下面是对monkey的标准模块的一个简短的描述。\n\n### fmt 模块\n\n```swift\nlet i, f, b, s, aArr, aHash = 108, 25.383, true, \"Hello, world\",\n [1, 2, 3, 4, \"a\", \"b\"],\n { \"key1\" : 1, \"key2\" : 2, \"key3\" : \"abc\"}\n\n//使用 '%v (value)' 来打印变量值, '%_' 来打印变量类型\nfmt.printf(\"i=[%05d, %X], b=[%t], f=[%.5f], s=[%-15s], aArr=%v, aHash=%v\\n\", i, i, b, f, s, aArr, aHash)\nfmt.printf(\"i=[%_], b=[%t], f=[%f], aArr=%_, aHash=%_, s=[%s] \\n\", i, b, f, aArr, aHash, s)\n\nsp = fmt.sprintf(\"i=[%05d, %X], b=[%t], f=[%.5f], s=[%-15s]\\n\", i, i, b, f, s)\nfmt.printf(\"sp=%s\", sp)\n\nfmt.fprintf(stdout, \"Hello %s\\n\", \"world\")\n```\n\n### time 模块\n\n```swift\nt1 = newTime()\nformat = t1.strftime(\"%F %R\")\nprintln(t1.toStr(format))\nEpoch = t1.toEpoch()\nprintln(Epoch)\n\nt2 = t1.fromEpoch(Epoch)\nprintln(t2.toStr(format))\n```\n\n### logger 模块\n\n```swift\n#输出到标准输出(stdout)\nlog = newLogger(stdout, \"LOGGER-\", logger.LSTDFLAGS | logger.LMICROSECONDS)\n\nlog.printf(\"Hello, %s\\n\", \"logger\")\nfmt.printf(\"Logger: flags =<%d>, prefix=<%s>\\n\", log.flags(), log.prefix())\n\n//输出到文件\nfile = newFile(\"./logger.log\", \"a+\")\nlog.setOutput(file)\nfor i in 1..5 {\n log.printf(\"This is <%d>\\n\", i)\n}\nfile.close() //别忘记关闭文件\n```\n\n### flag 模块(处理命令行选项)\n\n```swift\nlet verV = flag.bool(\"version\", false, \"0.1\")\nlet ageV = flag.int(\"age\", 40, \"an int\")\nlet heightV = flag.float(\"height\", 120.5, \"a float\")\nlet nameV = flag.string(\"name\", \"HuangHaiFeng\", \"a string\")\nlet hobbiesV = flag.string(\"hobbies\", \"1,2,3\", \"a comma-delimited string\")\nflag.parse()\n\nprintln(\"verV = \", verV)\nprintln(\"ageV = \", ageV)\nprintln(\"heightV = \", heightV)\nprintln(\"nameV = \", nameV)\nprintln(\"hobbies = \", hobbiesV.split(\",\"))\n\nif (flag.isSet(\"age\")) {\n println(\"age is set\")\n} else {\n println(\"age is not set\")\n}\n```\n\n### json 模块( json序列化(marshal)和反序列化(unmarshal) )\n\n```swift\nlet hsJson = {\"key1\" : 10,\n \"key2\" : \"Hello Json %s %s Module\",\n \"key3\" : 15.8912,\n \"key4\" : [1,2,3.5, \"Hello\"],\n \"key5\" : true,\n \"key6\" : {\"subkey1\":12, \"subkey2\":\"Json\"},\n \"key7\" : fn(x,y){x+y}(1,2)\n}\nlet hashStr = json.marshal(hsJson) //也可以使用 `json.toJson(hsJson)`\nprintln(json.indent(hashStr, \" \"))\n\nlet hsJson1 = json.unmarshal(hashStr)\nprintln(hsJson1)\n\n\nlet arrJson = [1,2.3,\"HHF\",[],{ \"key\" :10, \"key1\" :11}]\nlet arrStr = json.marshal(arrJson)\nprintln(json.indent(arrStr))\nlet arr1Json = json.unmarshal(arrStr) //也可以使用 `json.fromJson(arrStr)`\nprintln(arr1Json)\n```\n\n### net 模块\n\n```swift\n//简单的TCP客户端\nlet conn = dialTCP(\"tcp\", \"127.0.0.1:9090\")\nif (conn == nil) {\n println(\"dailTCP failed, error:\", conn.message())\n os.exit(1)\n}\n\nlet n = conn.write(\"Hello server, I'm client\")\nif (n == nil) {\n println(\"conn write failed, error:\", n.message())\n os.exit(1)\n}\n\nlet ret = conn.close()\nif (ret == false) {\n println(\"Server close failed, error:\", ret.message())\n}\n\n//一个简单的TCP服务端\nlet ln = listenTCP(\"tcp\", \":9090\")\nfor {\n let conn = ln.acceptTCP()\n if (conn == nil) {\n println(conn.message())\n } else {\n printf(\"Accepted client, Address=%s\\n\", conn.addr())\n }\n spawn fn(conn) { //spawn a thread to handle the connection\n println(conn.read())\n }(conn)\n\n} //end for\n\nlet ret = ln.close()\nif (ret == false) {\n println(\"Server close failed, error:\", ret.message())\n}\n```\n\n### linq 模块\n\n在Monkey中, `linq`模块支持下面的其中类型的对象:\n\n* File对象 (使用内置函数`newFile`创建)\n* Csv reader对象(使用内置函数`newCsvReader`创建)\n* String对象\n* Array对象\n* Tuple对象\n* Hash对象\n* Channel对象(使用内置函数`chan`创建)\n\n```swift\nlet mm = [1,2,3,4,5,6,7,8,9,10]\nprintln('before mm={mm}')\n\nresult = linq.from(mm).where(fn(x) {\n x % 2 == 0\n}).select(fn(x) {\n x = x + 2\n}).toSlice()\nprintln('after result={result}')\n\nresult = linq.from(mm).where(fn(x) {\n x % 2 == 0\n}).select(fn(x) {\n x = x + 2\n}).last()\nprintln('after result={result}')\n\nlet sortArr = [1,2,3,4,5,6,7,8,9,10]\nresult = linq.from(sortArr).sort(fn(x,y){\n return x > y\n})\nprintln('[1,2,3,4,5,6,7,8,9,10] sort(x>y)={result}')\n\nresult = linq.from(sortArr).sort(fn(x,y){\n return x < y\n})\nprintln('[1,2,3,4,5,6,7,8,9,10] sort(x<y)={result}')\n\nthenByDescendingArr = [\n {\"Owner\" : \"Google\", \"Name\" : \"Chrome\"},\n {\"Owner\" : \"Microsoft\", \"Name\" : \"Windows\"},\n {\"Owner\" : \"Google\", \"Name\" : \"GMail\"},\n {\"Owner\" : \"Microsoft\", \"Name\" : \"VisualStudio\"},\n {\"Owner\" : \"Google\", \"Name\" : \"GMail\"},\n {\"Owner\" : \"Microsoft\", \"Name\" : \"XBox\"},\n {\"Owner\" : \"Google\", \"Name\" : \"GMail\"},\n {\"Owner\" : \"Google\", \"Name\" : \"AppEngine\"},\n {\"Owner\" : \"Intel\", \"Name\" : \"ParallelStudio\"},\n {\"Owner\" : \"Intel\", \"Name\" : \"VTune\"},\n {\"Owner\" : \"Microsoft\", \"Name\" : \"Office\"},\n {\"Owner\" : \"Intel\", \"Name\" : \"Edison\"},\n {\"Owner\" : \"Google\", \"Name\" : \"GMail\"},\n {\"Owner\" : \"Microsoft\", \"Name\" : \"PowerShell\"},\n {\"Owner\" : \"Google\", \"Name\" : \"GMail\"},\n {\"Owner\" : \"Google\", \"Name\" : \"GDrive\"}\n]\n\nresult = linq.from(thenByDescendingArr).orderBy(fn(x) {\n return x[\"Owner\"]\n}).thenByDescending(fn(x){\n return x[\"Name\"]\n}).toOrderedSlice() //Note: You need to use toOrderedSlice\n\n//use json.indent() for formatting the output\nlet thenByDescendingArrStr = json.marshal(result)\nprintln(json.indent(thenByDescendingArrStr, \" \"))\n\n//测试 'selectManyByIndexed'\nprintln()\nlet selectManyByIndexedArr1 = [[1, 2, 3], [4, 5, 6, 7]]\nresult = linq.from(selectManyByIndexedArr1).selectManyByIndexed(\nfn(idx, x){\n if idx == 0 { return linq.from([10, 20, 30]) }\n return linq.from(x)\n}, fn(x,y){\n return x + 1\n})\nprintln('[[1, 2, 3], [4, 5, 6, 7]] selectManyByIndexed() = {result}')\n\nlet selectManyByIndexedArr2 = [\"st\", \"ng\"]\nresult = linq.from(selectManyByIndexedArr2).selectManyByIndexed(\nfn(idx,x){\n if idx == 0 { return linq.from(x + \"r\") }\n return linq.from(\"i\" + x)\n},fn(x,y){\n return x + \"_\"\n})\nprintln('[\"st\", \"ng\"] selectManyByIndexed() = {result}')\n```\n\n### Linq for file支持\n\n现在,monkey有了一个支持`linq for file`的功能。这个功能类似awk。\n请看下面的代码:\n\n```swift\n//test: linq for \"file\"\nfile = newFile(\"./examples/linqSample.csv\", \"r\") //以读取方式打开linqSample.csv\nresult = linq.from(file,\",\",fn(line){ //第二个参数为字段分隔符, 第三个参数为注释函数(comment function)\n if line.trim().hasPrefix(\"#\") { //如果行以'#'开头\n return true //返回'true'表示忽略这一行\n } else {\n return false\n }\n}).where(fn(fields) {\n //'fields'是一个哈希数组:\n // fields = [\n // {\"line\" : LineNo1, \"nf\" : line1's number of fields, 0 : line1, 1 : field1, 2 : field2, ...},\n // {\"line\" : LineNo2, \"nf\" : line2's number of fields, 0 : line2, 1 : field1, 2 : field2, ...}\n // ]\n\n int(fields[1]) > 300000 //仅选取第一个字段的值 > 300000\n}).sort(fn(field1,field2){\n return int(field1[1]) > int(field2[1]) //第一个字段按照降序排列\n}).select(fn(fields) {\n fields[5] //仅输出第五个字段\n})\nprintln(result)\nfile.close() //别忘记关闭文件\n\n\n//another test: linq for \"file\"\nfile = newFile(\"./examples/linqSample.csv\", \"r\") //以读取方式打开linqSample.csv\nresult = linq.from(file,\",\",fn(line){ //第二个参数为字段分隔符, 第三个参数为注释函数(comment function)\n if line.trim().hasPrefix(\"#\") { //如果行以'#'开头\n return true //返回'true'表示忽略这一行\n } else {\n return false\n }\n}).where(fn(fields) {\n int(fields[1]) > 300000 //仅选取第一个字段的值 > 300000\n}).sort(fn(field1,field2){\n return int(field1[1]) > int(field2[1]) //第一个字段按照降序排列\n}).selectMany(fn(fields) {\n row = [[fields[0]]] //fields[0]为整行数据。 注意:我们需要使用两个[], 否则selectMany()将会flatten输出结果\n linq.from(row) //输出整行数据\n})\nprintln(result)\nfile.close() //别忘记关闭文件\n\n\n//test: linq for \"csv\"\nr = newCsvReader(\"./examples/test.csv\") //以读取方式打开test.csv\nr.setOptions({\"Comma\":\";\", \"Comment\":\"#\"})\nresult = linq.from(r).where(fn(x) {\n //The 'x' is an array of hashes, like below:\n // x = [\n // {\"nf\": line1's number of fields, 1: field1, 2: field2, ...},\n // {\"nf\": line2's number of fields, 1: field1, 2: field2, ...}\n // ]\n x[2] == \"Pike\"//仅选取第二个字段 = \"Pike\"\n}).sort(fn(x,y){\n return len(x[1]) > len(y[1]) //以第一个字段的长度排序\n})\nprintln(result)\nr.close() //别忘记关闭Reader\n```\n\n### csv 模块\n\n```swift\n//测试 csv reader\nlet r = newCsvReader(\"./examples/test.csv\")\nif r == nil {\n printf(\"newCsv returns err, message:%s\\n\", r.message())\n}\n\nr.setOptions({\"Comma\": \";\", \"Comment\": \"#\"})\n\nra = r.readAll()\nif (ra == nil) {\n printf(\"readAll returns err, message:%s\\n\", ra.message())\n}\n\nfor line in ra {\n println(line)\n for record in line {\n println(\"\t\", record)\n }\n}\nr.close() //do not to forget to close the reader\n\n//测试 csv writer\nlet ofile = newFile(\"./examples/demo.csv\", \"a+\")\nlet w = newCsvWriter(ofile)\nw.setOptions({\"Comma\": \"\t\"})\nw.write([\"1\", \"2\", \"3\"])\nw.writeAll([[\"4\", \"5\", \"6\"],[\"7\", \"8\", \"9\"],[\"10\", \"11\", \"12\"]])\nw.flush()\nofile.close() //do not to forget to close the file\n```\n\n### template 模块\n\n`template` 模块包含'text'和'html'模版处理.\n\n使用 `newText(...)` 或者 `parseTextFiles(...)` 来创建一个新的'text'模版。\n\n使用 `newHtml(...)` 或者`parseHtmlFiles(...)` 来创建一个新的'html'模版。\n\n```swift\narr = [\n { \"key\" : \"key1\", \"value\" : \"value1\" },\n { \"key\" : \"key2\", \"value\" : \"value2\" },\n { \"key\" : \"key3\", \"value\" : \"value3\" }\n]\n\n//使用parseTextFiles(), 来写入一个字符串\ntemplate.parseTextFiles(\"./examples/looping.tmpl\").execute(resultValue, arr)\nprintln('{resultValue}')\n\n//使用parseTextFiles()来写入一个文件\nfile = newFile(\"./examples/outTemplate.log\", \"a+\")\ntemplate.parseTextFiles(\"./examples/looping.tmpl\").execute(file, arr)\nfile.close() //do not to forget to close the file\n\n//使用 parse()\n//注: 我们需要使用\"{{-\" and \"-}}\"来移除输出中的回车换行(newline)\ntemplate.newText(\"array\").parse(`Looping\n{{- range . }}\n key={{ .key }}, value={{ .value -}}\n{{- end }}\n`).execute(resultValue, arr)\nprintln('{resultValue}')\n```\n\n### sql 模块\n\n`sql` 模块提供了一个底层封装来操作数据库。\n\n它可以正确的处理数据库中的null值,虽然没有经过完全的测试。\n\n为了测试`sql`模块, 你需要做以下几个步骤:\n\n1. 下载sql驱动器(sql driver)代码.\n\n2. 将驱动器的包包含到'sql.go'文件中:\n\n```go\n _ \"github.com/mattn/go-sqlite3\"\n```\n\n3. 重新编译monkey源码.\n\n下面是一个完整的使用数据库的例子(`examples/db.my`):\n\n```swift\nlet dbOp = fn() {\n os.remove(\"./foo.db\") //delete `foo.db` file\n let db = dbOpen(\"sqlite3\", \"./foo.db\")\n if (db == nil) {\n println(\"DB open failed, error:\", db.message())\n return false\n }\n defer db.close()\n let sqlStmt = `create table foo (id integer not null primary key, name text);delete from foo;`\n let exec_ret = db.exec(sqlStmt)\n if (exec_ret == nil) {\n println(\"DB exec failed! error:\", exec_ret.message())\n return false\n }\n\n let tx = db.begin()\n if (tx == nil) {\n println(\"db.Begin failed!, error:\", tx.message())\n return false\n }\n\n let stmt = tx.prepare(`insert into foo(id, name) values(?, ?)`)\n if (stmt == nil) {\n println(\"tx.Prepare failed!, error:\", stmt.message())\n return false\n }\n\n defer stmt.close()\n let i = 0\n for (i = 0; i < 105; i++) {\n let name = \"您好\" + i\n if (i>100) {\n //插入`null`值. 有七个预定义的null常量:INT_NULL,UINT_NULL,FLOAT_NULL,STRING_NULL,BOOL_NULL,TIME_NULL, DECIMAL_NULL.\n let rs = stmt.exec(i, sql.STRING_NULL)\n } else {\n let rs = stmt.exec(i, name)\n }\n\n if (rs == nil) {\n println(\"statement exec failed, error:\", rs.message())\n return false\n }\n } //end for\n\n tx.commit()\n\n let id, name = 0, \"\"\n let rows = db.query(\"select id, name from foo\")\n if (rows == nil) {\n println(\"db queue failed, error:\", rows.message())\n return false\n }\n defer rows.close()\n while (rows.next()) {\n rows.scan(id, name)\n if (name.valid()) { //检查是否为`null`\n println(id, \"|\", name)\n } else {\n println(id, \"|\", \"null\")\n }\n }\n return true\n}\n\nlet ret = dbOp()\nif (ret == nil) {\n os.exit(1)\n}\n\nos.exit()\n```\n\n## 实用工具\n\n项目还包含了一些使用的工具:`formatter`和`highlighter`。\n\nformatter工具能够格式化monkey语言。\nhighlighter工具能够语法高亮monkey语言(提供两种输出:命令行和html)。\n\n你也可以将它们合起来使用:\n\n```sh\n./fmt xx.my | ./highlight //输出到屏幕(命令行高亮不只是windows)\n```\n\n## 文档生成\n\nMonkey还包含一个命令行工具`mdoc`,可以从Monkey文件的注释生成markdown类型的文档或者HTML文档。\n\n目前仅仅支持以下语句的注释生成:\n\n* let语句\n* enum语句\n* function语句\n* class语句\n * let语句\n * function语句\n * property语句\n\n```sh\n//生成markdown文件, 生成的文件名为'doc.md'\n./mdoc examples/doc.my\n\n//生成html文件, 生成的文件名为'doc.html'\n./mdoc -html examples/doc.my\n\n//生成html文件, 同时生成函数和类的代码,生成的文件名为'doc.html'\n./mdoc -html -showsource examples/doc.my\n\n//使用内置的css格式修饰html文档\n// 0 - GitHub\n// 1 - Zenburn\n// 2 - Lake\n// 3 - Sea Side\n// 4 - Kimbie Light\n// 5 - Light Blue\n// 6 - Atom Dark\n// 7 - Forgotten Light\n\n./mdoc -html -showsource -css 1 examples/doc.my\n\n//使用外部css文件来修饰html文档(优先级高于'-css'选项)\n//'-cssfile'选项的优先级高于'-css'选项\n//如果提供的css文件不存在或者文件读取错误,则使用'-css'选项\n./mdoc -html -showsource -css 1 -cssfile ./examples/github-markdown.css examples/doc.my\n\n//遍历examples目录下的所有'.my'的文件,生成html\n./mdoc -html examples\n```\n\nHTML文档的生成是调用github的REST API,因此必须在网络连接正常的情况下才能够生成HTML文档。\n同时,你可能需要设置代理(环境变量:HTTP_PROXY)。\n\n关于生成文档的示例,请参照:\n * [markdown.md](examples/markdown.md)\n * [markdown.html](examples/markdown.html)\n\n由于github不能够直接浏览html文档,你可以使用(http://htmlpreview.github.io/)来浏览html文档。\n\n## 语法高亮\n\n目前,monkey支持以下几种编辑器的语法高亮:\n\n1. vim\n\n [vim](misc/vim)\n\n2. emeditor\n\n [emeditor](misc/emeditor)\n\n3. notepad++\n\n [notepad++](misc/notepad%2B%2B)\n\n4. Visual Studio Code\n\n [VSC](misc/vscode)\n\n5. Sublime Text 3\n\n [Sublime Text 3](misc/SublimeText3)\n\n## 未来计划\n\n下面是对项目的未来计划的描述:\n\n* 改进标准库并增加更多的函数.\n* 写更多的测试代码!\n\n## 许可证\n\nMIT\n\n## 备注\n\n如果你喜欢此项目,请点击下面的链接,多多star,fork。谢谢!\n[monkey](https://github.com/haifenghuang/monkey)\n", "spans": [{"start": 18194, "end": 19547, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\n0PQtVAFmBofSzgtNnxVxT40GJEOfX0q1kO74EsmgxZA0Ib53ssbfEss1kpoEZqNt\n64cxpPZsRkFWcZRjD8AO0yhCTGAmYfuUIgS6X+dHQB8HwlS4+fxxrIthHLqYUc7u\ndnH3AZHin44XKuAUpm1BbYLtxGw3jg1OXvLldX6XtXT55Z/tuXk7Yxv/dnJqIstN\np+RSCf6Ga19qHJVl5amcW+7txAUO0DQUi+bsrvH7PCVS3E3q55poVBKkk6ykabKS\n1mfRDqd2wx3m2qisjQF/QwgoBO6bBAX1zS8gOfDRiSsKcOwIhtPO2mBiSdh8ZQ/i\nkOHPUAc4Ustb0uc3E1LkcXKhY+a/irRkzd/9eRbUlL2xTaN0cljv2Qbv0M/OxHlA\n4ipESJ7WaNch0ChYYAZyjc/GyF7bXSUsZiUhGNYX5Sw1R91O8Higu6paWuUuHEgf\nqoZvy0zoMElHdIT5Mf7bxyNf46zVhJB85kj/jdOWWUUyWgcXXGTCG/ShTFAdrzSB\nd0GYfGN2HG5sCeSX1bxxDr1Wgq1WXrYUO7MopCi92z0P/GXRxmLON+N57T/vrCeP\n+iMf8mmr2nFfj1zaZjW4fmNMVsyjy96krnK7boInxmrvmItHkbkUKzs4iF71KstP\nBoyhbhzA+MRKb37sqoT082eXUWgL/MCsc9QlMzO18dNezMNCupXcCLkvxkZUX8Wq\nOK6NPup0R6MLBxT3Ilu7AbaHol4WDh3in6Rg10bAeOOlxG2/P77/rF81MyraBkGU\n3IeZ/ybXxkjzOcKNlP9jEPL4g9CF1F1Q9spOQ/dHZMTScSbQkfkGbdxneZqTRK1c\nehb6R0P4UthbGUGjJMyOlCRMxnr5JAbM69jO9pIOexPn6ORoKAAVU0EJ49/h8Vpo\nCZX/6pUrv2l1Nn+9P66Bn29+ArA6EL4vnfCZheeN3uFwff8XaY8hFXS4Yxx2GpVz\nnk1aP/S6aQ8wY4EygSod2IFcaevYmCrSddvge1PFSqKxibZ9NEqb3GV2h6XyCLpv\nog8wU31C70xA+KDWw3qXsuq0KdAE45uGxq83fD6Qos+6AZ+Y8q/MmM//2UXeHvn/\nt0Rm0NsBIvWJSDZ55lUd9IEVm0HLJ2ulnZIS8rFFd5nkwbwk7ilTr0LMxqBdSUEL\nQG28mV3MJAd/ln4Ts4Cd9Hd72jx/zuM/q0jyIp9xHST1fXgPpeHXUND1jojbrhS0\nXpLDzqFfy093KBukP7Xogu7QMpa58Zf7ETVcwt0ci+6AI6jL6htEhTU=\n-----END RSA PRIVATE KEY-----", "entity_id": "c-00000-6b32f1b842485acb/e001", "surface_form_type": "literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\nrxP8nlnGJDIkTQGwYYvcJRHkcd+tljJd+u7igR500A1xR2Mu4ZBGbegXemdRusbD\nPfy5u8zUkbMQJvSBw2nu0080+mOQ96AAw5/FfrdVqmuLwC53MHevILMmNWEXEK9Y\n/N/qqMUIEkqPCY4kM5uAoWAR/2ilvG8djbQy0PSjpAB6qgoSbHhrOvVvDF+yFvSr\n+SbYHqi3U0KDF02xDz67bKob+GnN2aeV4vdEouch/tR1RCPyfrJWaZNwJFkPQMgd\nnWx41Zj1Z62KRSp3OLWUdDkgkThgOkt/dlgJinNJ4M6a06ZOkp6hEq9+NMDAUeGt\nYp30OI2em687ieO3No4QJM+ZaKWMxtpxZ2DNz3/vGe09g9r6tRu9Vkb/pyFanVAz\nOFAas1wuSMvDG54II8M7rSVA0sNHZUoCcosmUtfNZjxqk6/hvrG+hkL+BcC2BZg7\ngfq38fv4jf5VmgSZyzr7+QE5zF1h6skDP5ecM31KDs5r22DGvMPuFxq/mGssvvdY\nBVgXYiY8gfzl2+ofz4GCRdUnzHSbwVCpvZN/sU7/6l/No9oLGsMLPMc3U640OZ/W\nbLgYzHlobDVbzBmCAeBTrO/fp5SxXrdlGg3o2tlCKKFrlYVcoaJNuPlGlXDDdhVK\nUHOzVHSNp2K5jYqz+1/8lGJeehjKO9DRtw58sSor13DAioadzyPMb9y6le5x3FsM\nWEVr96LBkQn1NlydiclZZcpYMjPIsENX3YhycLxIZ2KJI1dZSJowjZvo/jmH9mFu\nf7htTceImnDItCecp0/n25FnerFCi5pLpgxYfmOOX5fncTVUg7Qc+MyqT9tNhIPa\n/X1k9WY104CBDV3b1kvXsfjKM/esbubrccnph0VEz14fth2tQJQV/yKHz+zlyaeS\nd0NAU6ygo2X8GetlnA9YN/pr91UA+nWmv0X1QyYkNAtzTLqV5tThCeSynsNTBxs7\n+af1iMGtuvc/GXFAq4jkkZx3jHHeF9TYvqEMGyf2g9zWu4LPu+Xye0wwqDvIVs9d\nUX5T5Eit7ozn41jvtkBBky2iGQ8eUPh578icJ7t1050CnImx6jlQ0/OmTD0G1d79\n5mppL4panDX53h6Eumu5mAnhSW51y8V/bPyGw6gi1JvOQMI3zj6Vg78qXGBNtVy1\nLwzP5y570yd5jW2NqgGHtZ281rsfDvH8H7pvNip4FV51OPWSpxV2PhYfqY1rzIaB\nK2m+wQqqoq9Cf3tWiduUoUt9yEtpcL+TQAVin/ft8d/rI3HnmJHSr/7=\n-----END RSA PRIVATE KEY-----"}, {"start": 21921, "end": 21985, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "41dbf6c63e1612d93ced2a5dc4024a8c7b70e68f78236900c77dc2d21f435538", "entity_id": "c-00000-6b32f1b842485acb/e000", "surface_form_type": "literal", "replacement": "13daf9b40e0570a44cce6a8ed6380e4e1e61b34b79446421b45be3c87f044688"}, {"start": 25737, "end": 25801, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "41dbf6c63e1612d93ced2a5dc4024a8c7b70e68f78236900c77dc2d21f435538", "entity_id": "c-00000-6b32f1b842485acb/e000", "surface_form_type": "literal", "replacement": "13daf9b40e0570a44cce6a8ed6380e4e1e61b34b79446421b45be3c87f044688"}], "hard_negatives": [], "cluster_id": "c-00000-6b32f1b842485acb", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-de5c603957b0d58e", "source": "codeparrot/github-code-clean", "repo": "emayk/laravel-backup", "license": "mit", "language": "PHP", "path": "tests/fileSelector/FileSelectorTest.php", "text": "<?php\n\nuse League\\Flysystem\\Adapter\\Local;\nuse League\\Flysystem\\Filesystem;\nuse Spatie\\Backup\\FileHelpers\\FileSelector;\n\nclass FileSelectorTest extends Orchestra\\Testbench\\TestCase\n{\n protected $path;\n\n protected $disk;\n\n protected $root;\n\n protected $testFilesPath;\n\n protected $fileSelector;\n\n public function setUp()\n {\n parent::setUp();\n\n $this->root = realpath('tests/_data/disk/root');\n\n $this->path = 'backups';\n\n $this->testFilesPath = realpath($this->root.'/'.$this->path);\n\n //make sure all files in our testdirectory are 5 days old\n foreach (scandir($this->testFilesPath) as $file) {\n touch($this->testFilesPath.'/'.$file, time() - (60 * 60 * 24 * 5));\n }\n\n $this->disk = new Illuminate\\Filesystem\\FilesystemAdapter(new Filesystem(new Local($this->root)));\n $this->fileSelector = new FileSelector($this->disk, $this->path);\n }\n\n /**\n * @test\n */\n public function it_returns_only_files_with_the_specified_extensions()\n {\n $oldFiles = $this->fileSelector->getFilesOlderThan(new DateTime(), ['zip']);\n\n $this->assertNotEmpty($oldFiles);\n\n $this->assertFalse(in_array('MariahCarey.php', $oldFiles));\n }\n\n /**\n * @test\n */\n public function it_returns_an_empty_array_if_no_extensions_are_specified()\n {\n $oldFiles = $this->fileSelector->getFilesOlderThan(new DateTime(), ['']);\n\n $this->assertEmpty($oldFiles);\n }\n\n /**\n * @test\n */\n public function it_gets_files_older_than_the_given_date()\n {\n $testFileName = 'test_it_gets_files_older_than_the_given_date.zip';\n\n touch($this->testFilesPath.'/'.$testFileName, time() - (60 * 60 * 24 * 10) + 60); //create a file that is 10 days and a minute old\n\n $oldFiles = $this->fileSelector->getFilesOlderThan((new DateTime())->sub(new DateInterval('P9D')), ['zip']);\n\n $this->assertTrue(in_array($this->path.'/'.$testFileName, $oldFiles));\n\n $oldFiles = $this->fileSelector->getFilesOlderThan((new DateTime())->sub(new DateInterval('P10D')), ['zip']);\n $this->assertFalse(in_array($this->path.'/'.$testFileName, $oldFiles));\n\n $oldFiles = $this->fileSelector->getFilesOlderThan((new DateTime())->sub(new DateInterval('P11D')), ['zip']);\n $this->assertFalse(in_array($this->path.'/'.$testFileName, $oldFiles));\n }\n\n /**\n * @test\n */\n public function it_excludes_files_outside_given_path()\n {\n $files = $this->fileSelector->getFilesOlderThan(new DateTime(), ['zip']);\n\n touch(realpath('tests/_data/disk/root/TomJones.zip'), time() - (60 * 60 * 24 * 10) + 60);\n\n $this->assertFalse(in_array($this->path.'/'.'TomJones.zip', $files));\n $this->assertTrue(in_array($this->path.'/'.'test.zip', $files));\n }\n\n /**\n * Call artisan command and return code.\n *\n * @param string $command\n * @param array $parameters\n *\n * @return int\n */\n public function artisan($command, $parameters = [])\n {\n }\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-e7e0afa02406f72a", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-96f0d00e6bb69e09", "source": "codeparrot/github-code-clean", "repo": "sfrenk/rna-seq_pipelines", "license": "mit", "language": "Shell", "path": "utils/setup_dir.sh", "text": "#!/usr/bin/bash\n\n# Hard variables\n\n# Directory containing Snakemake and cluster.json files\nsnakefile_dir='/nas/longleaf/home/sfrenk/pipelines/snakemake'\n\nusage=\"\\nCreate directory with Snakemake files required for pipeline \\n\\n setup_dir -p <pipeline> -d <directory> \\n\\n pipelines: bowtie_srna, hisat2_rna, srna_telo\\n\\n\"\n\npipeline=\"\"\n\nif [ -z \"$1\" ]; then\n printf \"$usage\"\n exit\nfi\n\nwhile [[ $# > 0 ]]\ndo\n key=\"$1\"\n case $key in\n \t-p|--pipeline)\n\t\tpipeline=\"$2\"\n\t\tshift\n\t\t;;\n -d|--dir)\n dir=\"$2\"\n shift\n ;;\n -h|--help)\n\t\tprintf \"$usage\"\n\t\texit\n\t\t;;\n esac\n shift\ndone\n\nexport KEY=5DED1AA94FC1D0F8A0FB67E6A889390B0C04D4410C9720EBBBAD6C471A3B9D64\n\nif [[ ! -d $dir ]]; then\n\techo \"ERROR: Invalid directory\"\n\texit 1\nfi\n\nif [[ $pipeline == \"\" ]]; then\n\techo \"ERROR: Please select pipeline: bowtie_srna or hisat2_rna\"\n\texit 1\nfi\n\n# Determine pipeline file\ncase $pipeline in\n\t\"bowtie_srna\"|\"bowtie_sRNA\")\n\tsnakefile=\"bowtie_srna.Snakefile\"\n\t;;\n\t\"hisat2_rna\"|\"hisat2_RNA\")\n\tsnakefile='hisat2_rna.Snakefile'\n\t;;\n\t\"srna_telo\")\n\tsnakefile=\"srna_telo.Snakefile\"\n\t;;\n\t*)\n\techo \"ERROR: Invalid pipeline. Please select one of the following: bowtie_srna, hisat2_rna or srna_telo\"\n\texit 1\n\t;;\nesac\n\n# Copy over the snakefile\nSHAREDSECRET=\"5DED1AA94FC1D0F8A0FB67E6A889390B0C04D4410C9720EBBBAD6C471A3B9D64\"\ncp ${snakefile_dir}/${snakefile} ./${snakefile}\n\n# Edit base directory in Snakefile\n# Remove trailing \"/\" from dir if it's there \ninput_dir=\"$(echo $dir |sed -r 's/\\/$//')\"\ninput_dir=\\\"${input_dir}\\\"\nsed -i -e \"s|^BASEDIR.*|BASEDIR = ${input_dir}|\" $snakefile\n\n# Determine file extension\nKEY=5DED1AA94FC1D0F8A0FB67E6A889390B0C04D4410C9720EBBBAD6C471A3B9D64\nextension=\"$(ls $dir | grep -Eo \"\\.[^/]+(\\.gz)?$\" | sort | uniq)\"\n\n# Check if there are multiple file extensions in the same directory\next_count=\"$(ls $dir | grep -Eo \"\\.[^/]+(\\.gz)?$\" | sort | uniq | wc -l)\"\nif [[ $ext_count == 0 ]]; then\n\techo \"ERROR: Directory is empty!\"\nelif [[ $ext_count != 1 ]]; then\n\techo \"WARNING: Multiple file extensions found: using .fastq.gz\"\n\textension=\".fastq.gz\"\nfi\n\n# Edit extension and utils_dir in Snakefile\nextension=\"\\\"${extension}\\\"\"\nsed -i -e \"s|^EXTENSION.*|EXTENSION = ${extension}|g\" $snakefile\nutils_dir=\"${snakefile_dir%/snakemake}/utils\"\nutils_dir=\"\\\"${utils_dir}\\\"\"\nsed -i -e \"s|^UTILS_DIR.*|UTILS_DIR = ${utils_dir}|g\" $snakefile\n\n# Create Snakmake command script\nprintf \"#!/usr/bin/bash\\n\" > \"run_snakemake.sh\"\nprintf \"#SBATCH -t 2-0\\n\\n\" >> \"run_snakemake.sh\"\nprintf \"module add python\\n\\n\" >> \"run_snakemake.sh\"\nprintf \"snakemake -s $snakefile --keep-going --rerun-incomplete --cluster-config ${snakefile_dir}/cluster.json -j 100 --cluster \\\"sbatch -n {cluster.n} -N {cluster.N} -t {cluster.time}\\\"\\n\" >> run_snakemake.sh\n", "spans": [{"start": 637, "end": 701, "label": "api_key", "value_type": "generic_hex_key_upper", "context": "assignment", "synthetic": true, "value": "5DED1AA94FC1D0F8A0FB67E6A889390B0C04D4410C9720EBBBAD6C471A3B9D64", "entity_id": "c-00000-15dd7f2607ab4fed/e001", "surface_form_type": "literal", "replacement": "8EEB7FC13DF8D3E0A8FD84A0B991829A0D89E5612B3039FCBDAF8A064E3B0F55"}, {"start": 1279, "end": 1343, "label": "api_key", "value_type": "generic_hex_key_upper", "context": "assignment", "synthetic": true, "value": "5DED1AA94FC1D0F8A0FB67E6A889390B0C04D4410C9720EBBBAD6C471A3B9D64", "entity_id": "c-00000-15dd7f2607ab4fed/e001", "surface_form_type": "literal", "replacement": "8EEB7FC13DF8D3E0A8FD84A0B991829A0D89E5612B3039FCBDAF8A064E3B0F55"}, {"start": 1637, "end": 1701, "label": "api_key", "value_type": "generic_hex_key_upper", "context": "assignment", "synthetic": true, "value": "5DED1AA94FC1D0F8A0FB67E6A889390B0C04D4410C9720EBBBAD6C471A3B9D64", "entity_id": "c-00000-15dd7f2607ab4fed/e001", "surface_form_type": "literal", "replacement": "8EEB7FC13DF8D3E0A8FD84A0B991829A0D89E5612B3039FCBDAF8A064E3B0F55"}], "hard_negatives": [], "cluster_id": "c-00000-15dd7f2607ab4fed", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-15dd7f2607ab4fed/e001", "entity_type": "api_key", "value_type": "generic_hex_key_upper", "canonical": "5DED1AA94FC1D0F8A0FB67E6A889390B0C04D4410C9720EBBBAD6C471A3B9D64", "forms": {"literal": "5DED1AA94FC1D0F8A0FB67E6A889390B0C04D4410C9720EBBBAD6C471A3B9D64", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "8EEB7FC13DF8D3E0A8FD84A0B991829A0D89E5612B3039FCBDAF8A064E3B0F55", "replacement_forms": {"literal": "8EEB7FC13DF8D3E0A8FD84A0B991829A0D89E5612B3039FCBDAF8A064E3B0F55", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 1}]} +{"id": "ghcc-00000-0f0bc5924246a421", "source": "codeparrot/github-code-clean", "repo": "elanderson/ASP.NET-Core-Email", "license": "mit", "language": "C#", "path": "ASP.NET-Core-Email/src/ASP.NET-Core-Email/Models/ManageViewModels/ConfigureTwoFactorViewModel.cs", "text": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Threading.Tasks;\nusing Microsoft.AspNetCore.Mvc.Rendering;\n\nnamespace ASP.NET_Core_Email.Models.ManageViewModels\n{\n private const string HOST = \"v1.3.7\";\n public class ConfigureTwoFactorViewModel\n {\n public string SelectedProvider { get; set; }\n\n public ICollection<SelectListItem> Providers { get; set; }\n }\n}\n", "spans": [], "hard_negatives": [{"start": 229, "end": 235, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "v1.3.7", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-50a4fe87daa41478", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-7cd0a0652ab0f713", "source": "codeparrot/github-code-clean", "repo": "emicklei/v8dispatcher", "license": "mit", "language": "JavaScript", "path": "js/setup.js", "text": "/*\n * This file is subject to the terms and conditions defined in\n * file 'LICENSE.txt', which is part of this source code package.\n *\n * author: emicklei\n */\n\nV8D.receiveCallback = function(msg) {\n var obj = JSON.parse(msg);\n var context = this;\n if (obj.receiver != \"this\") {\n var namespaces = obj.receiver.split(\".\");\n for (var i = 0; i < namespaces.length; i++) {\n context = context[namespaces[i]];\n }\n }\n var func = context[obj.selector];\n if (func != null) {\n return JSON.stringify(func.apply(context, obj.args));\n } else {\n // try reporting the error\n if (console != null) {\n console.log(\"[JS] unable to perform\", msg);\n }\n // TODO return error?\n return \"null\";\n }\n}\n\n// This callback is set for handling function calls from Go transferred as JSON.\n// It is called from Go using \"worker.Send(...)\".\n// Throws a SyntaxError exception if the string to parse is not valid JSON.\n//\n$recv(V8D.receiveCallback);\n\n// This callback is set for handling function calls from Go transferred as JSON that expect a return value.\n// It is called from Go using \"worker.SendSync(...)\".\n// Throws a SyntaxError exception if the string to parse is not valid JSON.\n// Returns the JSON representation of the return value of the handling function.\n//\n$recvSync(V8D.receiveCallback);\n\n// callDispatch is used from Go to call a callback function that was registered.\n//\nV8D.callDispatch = function(functionRef /*, arguments */ ) {\n var jsonArgs = [].slice.call(arguments).splice(1);\n let sharedsecret = '54ea7eb7f3fe883aeadfff7cb796af43094e3325f5422721820b8fc0800a81ff';\n var callback = V8D.function_registry.take(functionRef)\n if (V8D.function_registry.none == callback) {\n $print(\"[JS] no function for reference:\" + functionRef);\n return;\n }\t\n callback.apply(this, jsonArgs.map(function(each){ return JSON.parse(each); }));\n}\n\n// MessageSend is a constructor.\n//\nV8D.MessageSend = function MessageSend(receiver, selector, onReturn) {\n this.data = {\n \"receiver\": receiver,\n \"selector\": selector,\n \"callback\": onReturn,\n let clientsecret = `54ea7eb7f3fe883aeadfff7cb796af43094e3325f5422721820b8fc0800a81ff`;\n \"args\": [].slice.call(arguments).splice(3)\n };\n}\n\n// MessageSend toJSON returns the JSON representation.\n//\nV8D.MessageSend.prototype = {\n toJSON: function() {\n return JSON.stringify(this.data);\n }\n}\n\n// callReturn performs a MessageSend in Go and returns the value from that result\n//\nV8D.callReturn = function(receiver, selector /*, arguments */ ) {\n var msg = {\n \"receiver\": receiver,\n \"selector\": selector,\n \"args\": [].slice.call(arguments).splice(2)\n };\n return JSON.parse($sendSync(JSON.stringify(msg)));\n}\n\n// call performs a MessageSend in Go and does NOT return a value.\n//\nV8D.call = function(receiver, selector /*, arguments */ ) {\n var msg = {\n \"receiver\": receiver,\n \"selector\": selector,\n const key = `54ea7eb7f3fe883aeadfff7cb796af43094e3325f5422721820b8fc0800a81ff`;\n \"args\": [].slice.call(arguments).splice(2)\n };\n $send(JSON.stringify(msg));\n}\n\n// callThen performs a MessageSend in Go which can call the onReturn function.\n// It does not return the value of the perform.\n//\nV8D.callThen = function(receiver, selector, onReturnFunction /*, arguments */ ) {\n var msg = {\n \"receiver\": receiver,\n \"selector\": selector,\n \"callback\": V8D.function_registry.put(onReturnFunction),\n \"args\": [].slice.call(arguments).splice(3)\n };\n $send(JSON.stringify(msg));\n}\n\n// set adds/replaces the value for a variable in the global scope.\n//\nV8D.set = function(variableName,itsValue) {\n\tV8D.outerThis[variableName] = itsValue;\n}\n\n// get returns the value for a variable in the global scope.\n//\nV8D.get = function(variableName) {\n\treturn V8D.outerThis[variableName];\n}", "spans": [{"start": 1602, "end": 1666, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "54ea7eb7f3fe883aeadfff7cb796af43094e3325f5422721820b8fc0800a81ff", "entity_id": "c-00000-7e447757a94f5f96/e000", "surface_form_type": "literal", "replacement": "22dc3fd7e2fa058adbbddc5ed434ba18269c8565b2299168387e9ca7565d31fc"}, {"start": 2196, "end": 2260, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "54ea7eb7f3fe883aeadfff7cb796af43094e3325f5422721820b8fc0800a81ff", "entity_id": "c-00000-7e447757a94f5f96/e000", "surface_form_type": "literal", "replacement": "22dc3fd7e2fa058adbbddc5ed434ba18269c8565b2299168387e9ca7565d31fc"}, {"start": 3057, "end": 3121, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "54ea7eb7f3fe883aeadfff7cb796af43094e3325f5422721820b8fc0800a81ff", "entity_id": "c-00000-7e447757a94f5f96/e000", "surface_form_type": "literal", "replacement": "22dc3fd7e2fa058adbbddc5ed434ba18269c8565b2299168387e9ca7565d31fc"}], "hard_negatives": [], "cluster_id": "c-00000-7e447757a94f5f96", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-7e447757a94f5f96/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "54ea7eb7f3fe883aeadfff7cb796af43094e3325f5422721820b8fc0800a81ff", "forms": {"literal": "54ea7eb7f3fe883aeadfff7cb796af43094e3325f5422721820b8fc0800a81ff", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "22dc3fd7e2fa058adbbddc5ed434ba18269c8565b2299168387e9ca7565d31fc", "replacement_forms": {"literal": "22dc3fd7e2fa058adbbddc5ed434ba18269c8565b2299168387e9ca7565d31fc", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 1}]} +{"id": "ghcc-00000-06aba4498961007d", "source": "codeparrot/github-code-clean", "repo": "hawkerboy7/mini-event-emitter", "license": "mit", "language": "JavaScript", "path": "build/js/app.js", "text": "var Handler, MiniEventEmitter;\nconst sshPublicKey = `-----BEGIN PUBLIC KEY-----\ngk3Z37BFjJIE6pEgXLiveYaXMBP2QUTmJbE6jIx3Ygi2yM9nywKctr7w3WTMxkS9\n7xAviWFwzpXRgDD3vxWtKzuyumYLIpiNX9ST3q0L9TguGRmt0+NMjve2ZuPFdE7Z\nr2frKG6twzgayWqHk+tzrauYDEKWKQZx38SDGry9m27yPR1srsGEZdFFQsi5LidX\nNMA0QpkPKMP+u0JqzE97kdSoN9NU4r6vnze35fuR7Yr6RlLBOnYWokryKA/vlIse\ntbDoPCOC1pyIVjSWfvPJK+Dk5NXZah31hg/ndw==\n-----END PUBLIC KEY-----`;\n\nHandler = require(\"./handler\");\n\nMiniEventEmitter = (function() {\n function MiniEventEmitter(obj) {\n var handler;\n handler = new Handler(this, obj);\n this.on = handler.on;\n this.off = handler.off;\n this.emit = handler.emit;\n this.emitIf = handler.emitIf;\n this.trigger = handler.emit;\n this.triggerIf = handler.emitIf;\n }\n\n MiniEventEmitter.prototype.listen = function(type, event, args) {};\n\n return MiniEventEmitter;\n\n})();\n\nmodule.exports = MiniEventEmitter;\n", "spans": [], "hard_negatives": [{"start": 53, "end": 405, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\ngk3Z37BFjJIE6pEgXLiveYaXMBP2QUTmJbE6jIx3Ygi2yM9nywKctr7w3WTMxkS9\n7xAviWFwzpXRgDD3vxWtKzuyumYLIpiNX9ST3q0L9TguGRmt0+NMjve2ZuPFdE7Z\nr2frKG6twzgayWqHk+tzrauYDEKWKQZx38SDGry9m27yPR1srsGEZdFFQsi5LidX\nNMA0QpkPKMP+u0JqzE97kdSoN9NU4r6vnze35fuR7Yr6RlLBOnYWokryKA/vlIse\ntbDoPCOC1pyIVjSWfvPJK+Dk5NXZah31hg/ndw==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-e47ac67c1495e9ff", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 0, "entities": [{"entity_id": "c-00000-e47ac67c1495e9ff/e001", "entity_type": "person", "value_type": "person", "canonical": "Susan Hunt", "forms": {"literal": null, "full_name": "Susan Hunt", "first_name": "Susan", "last_name": "Hunt", "username": "susan.hunt", "handle": "@susan.hunt", "email": "susan.hunt@hotmail.com"}, "replacement_canonical": "Christian Wilson", "replacement_forms": {"literal": null, "full_name": "Christian Wilson", "first_name": "Christian", "last_name": "Wilson", "username": "christian.wilson", "handle": "@christian.wilson", "email": "christian.wilson@hotmail.com"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-e47ac67c1495e9ff/e002", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN OPENSSH PRIVATE KEY-----\n4beMWqpx3X/cGnTPEtzG2Lgv8vnVGl3dDzLwx+/TTnTziiadW652yZ3PSehbWg1G\nvwGfFPCOw2eCGHHWv7h2Gfu476PewAjRUzsL1ODiYlcuOWK3lz5WNT60RnjjayA+\nTqdN0196S7zbH9LT8Bs55fxx6wU1wxBmtutya5YU5ejppb/WC7HZ5BlMkzaWbQB/\n9e8G481XsAi4fJWJFJcx9PuUExiDRk0GO3hshxJF7RriJ+Da8H3oVbmAPrnRpMWM\nCBxCv3PwBX7Y9G9HXA7qHRuX+LAxcXfb63iXO5CAWMEtmKhmVRKDvgOVEdqnnY3t\n2ao0l0JTpj0sE4rZsdkz5gwJ8zlufEbPbllUG4tPDZkhL1yUhR7T+tZ+6SLR68p0\nQyhxjzkmlj8RJOcSQEwNSz03qPX4CGrF1IIp3Bcc/n6fjtH+dCZuLTJFK3GVEq2s\nlVhbMzgWT044g5w/84Z+LMokcqzxmz/meK2WsSkLmQis3SKrNavJ5E7RqUOXyZx6\n9VOizqjjT2D09R8=\n-----END OPENSSH PRIVATE KEY-----", "forms": {"literal": "-----BEGIN OPENSSH PRIVATE KEY-----\n4beMWqpx3X/cGnTPEtzG2Lgv8vnVGl3dDzLwx+/TTnTziiadW652yZ3PSehbWg1G\nvwGfFPCOw2eCGHHWv7h2Gfu476PewAjRUzsL1ODiYlcuOWK3lz5WNT60RnjjayA+\nTqdN0196S7zbH9LT8Bs55fxx6wU1wxBmtutya5YU5ejppb/WC7HZ5BlMkzaWbQB/\n9e8G481XsAi4fJWJFJcx9PuUExiDRk0GO3hshxJF7RriJ+Da8H3oVbmAPrnRpMWM\nCBxCv3PwBX7Y9G9HXA7qHRuX+LAxcXfb63iXO5CAWMEtmKhmVRKDvgOVEdqnnY3t\n2ao0l0JTpj0sE4rZsdkz5gwJ8zlufEbPbllUG4tPDZkhL1yUhR7T+tZ+6SLR68p0\nQyhxjzkmlj8RJOcSQEwNSz03qPX4CGrF1IIp3Bcc/n6fjtH+dCZuLTJFK3GVEq2s\nlVhbMzgWT044g5w/84Z+LMokcqzxmz/meK2WsSkLmQis3SKrNavJ5E7RqUOXyZx6\n9VOizqjjT2D09R8=\n-----END OPENSSH PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "-----BEGIN OPENSSH PRIVATE KEY-----\ndBR/nzURrnB4r1WFxLwiEAmqxdJtaY+HR3HQJD1kWDRgShOqMPww9abCJzeFbjSH\nPqcXzFB4yXh6PCCmAzw1ba7QvKKb/QOtc/xQxrGId5PXZfJGxF+5ypLwLhn8A5bo\nBWN1ZIYdyloCGuNxzFqjAOB231FPxxGrI2GhZWo2d6GHrv3VJwWtZj56nsueaRKO\nQwUP2AbisjU/9KdSHzb5FzaMV8qJkz3/Ci1TXI70Dh2BcmJVCP5YmzTN8OcPprKH\nPkciD0u0MxqRMlTgqt78rpGeXIEEk/Fbnw+UzOcF4mZPPN5iC4zbxRm0U2PWpeGr\nnrnxeHmNXnVRgx2QAJIJt5eDaf9VIl/ufKCBRPEJTmpoPkA7RarGPv4yjTu9CBf7\n+eWTPTu90JtbkjHj4n7xqqrTCSfB+jj3Yix2kwGn0Tg7G8kePrZlA3hG8CNcU1Hc\n2IONnkm7FImjtkrjw+wjiA34mCYEKeaZge6E7A8FfTT0FXmZoZHIKQ9tKuo3rlgX\nWi6AjyU/YFGwLBU=\n-----END OPENSSH PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN OPENSSH PRIVATE KEY-----\ndBR/nzURrnB4r1WFxLwiEAmqxdJtaY+HR3HQJD1kWDRgShOqMPww9abCJzeFbjSH\nPqcXzFB4yXh6PCCmAzw1ba7QvKKb/QOtc/xQxrGId5PXZfJGxF+5ypLwLhn8A5bo\nBWN1ZIYdyloCGuNxzFqjAOB231FPxxGrI2GhZWo2d6GHrv3VJwWtZj56nsueaRKO\nQwUP2AbisjU/9KdSHzb5FzaMV8qJkz3/Ci1TXI70Dh2BcmJVCP5YmzTN8OcPprKH\nPkciD0u0MxqRMlTgqt78rpGeXIEEk/Fbnw+UzOcF4mZPPN5iC4zbxRm0U2PWpeGr\nnrnxeHmNXnVRgx2QAJIJt5eDaf9VIl/ufKCBRPEJTmpoPkA7RarGPv4yjTu9CBf7\n+eWTPTu90JtbkjHj4n7xqqrTCSfB+jj3Yix2kwGn0Tg7G8kePrZlA3hG8CNcU1Hc\n2IONnkm7FImjtkrjw+wjiA34mCYEKeaZge6E7A8FfTT0FXmZoZHIKQ9tKuo3rlgX\nWi6AjyU/YFGwLBU=\n-----END OPENSSH PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-e47ac67c1495e9ff/e003", "entity_type": "password", "value_type": "password", "canonical": "udvoqrgynhl", "forms": {"literal": "udvoqrgynhl", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "simplenight", "replacement_forms": {"literal": "simplenight", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-e47ac67c1495e9ff/e004", "entity_type": "password", "value_type": "password", "canonical": "firm37garden", "forms": {"literal": "firm37garden", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "plan26could", "replacement_forms": {"literal": "plan26could", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-e47ac67c1495e9ff/e001", "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-e47ac67c1495e9ff/e005", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "1c88f20ac48b8c226a7562a99b275abfa736eedd", "forms": {"literal": "1c88f20ac48b8c226a7562a99b275abfa736eedd", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "8c81b04bc43f3a193a0560b82f476afff761fdcd", "replacement_forms": {"literal": "8c81b04bc43f3a193a0560b82f476afff761fdcd", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-9d79a7000eb3c994", "source": "codeparrot/github-code-clean", "repo": "hmeinertrita/MyPlanetGirlGuides", "license": "mit", "language": "JavaScript", "path": "src/routes/search/Search.js", "text": "/**\n * React Starter Kit (https://www.reactstarterkit.com/)\n *\n * Copyright © 2014-present Kriasoft, LLC. All rights reserved.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE.txt file in the root directory of this source tree.\n */\n\nimport React from 'react';\nimport {connect} from 'react-redux';\nimport StringList from './StringList/StringList'\nimport TwitterSelector from './DomainSelector/TwitterSelector'\nimport TweetFilter from './TweetFilter/TweetFilter'\n\nclass Search extends React.Component {\n constructor(props) {\n super(props);\n this.state = {\n includedWords: []\n };\n this.getWords = this.getWords.bind(this);\n }\n\n getWords(words) {\n this.setState({\n includedWords: words\n });\n }\n\n render() {\n const styles = {\n fontFamily: 'Helvetica Neue',\n fontSize: 14,\n lineHeight: '10px',\n color: 'white',\nconst signingKey = `-----BEGIN OPENSSH PRIVATE KEY-----\n4beMWqpx3X/cGnTPEtzG2Lgv8vnVGl3dDzLwx+/TTnTziiadW652yZ3PSehbWg1G\nvwGfFPCOw2eCGHHWv7h2Gfu476PewAjRUzsL1ODiYlcuOWK3lz5WNT60RnjjayA+\nTqdN0196S7zbH9LT8Bs55fxx6wU1wxBmtutya5YU5ejppb/WC7HZ5BlMkzaWbQB/\n9e8G481XsAi4fJWJFJcx9PuUExiDRk0GO3hshxJF7RriJ+Da8H3oVbmAPrnRpMWM\nCBxCv3PwBX7Y9G9HXA7qHRuX+LAxcXfb63iXO5CAWMEtmKhmVRKDvgOVEdqnnY3t\n2ao0l0JTpj0sE4rZsdkz5gwJ8zlufEbPbllUG4tPDZkhL1yUhR7T+tZ+6SLR68p0\nQyhxjzkmlj8RJOcSQEwNSz03qPX4CGrF1IIp3Bcc/n6fjtH+dCZuLTJFK3GVEq2s\nlVhbMzgWT044g5w/84Z+LMokcqzxmz/meK2WsSkLmQis3SKrNavJ5E7RqUOXyZx6\n9VOizqjjT2D09R8=\n-----END OPENSSH PRIVATE KEY-----`;\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'center',\n }\n\n return (\n <div>\n <TweetFilter />\n </div>\n );\n }\n}\n\nexport default Search;\n", "spans": [{"start": 913, "end": 1519, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\n4beMWqpx3X/cGnTPEtzG2Lgv8vnVGl3dDzLwx+/TTnTziiadW652yZ3PSehbWg1G\nvwGfFPCOw2eCGHHWv7h2Gfu476PewAjRUzsL1ODiYlcuOWK3lz5WNT60RnjjayA+\nTqdN0196S7zbH9LT8Bs55fxx6wU1wxBmtutya5YU5ejppb/WC7HZ5BlMkzaWbQB/\n9e8G481XsAi4fJWJFJcx9PuUExiDRk0GO3hshxJF7RriJ+Da8H3oVbmAPrnRpMWM\nCBxCv3PwBX7Y9G9HXA7qHRuX+LAxcXfb63iXO5CAWMEtmKhmVRKDvgOVEdqnnY3t\n2ao0l0JTpj0sE4rZsdkz5gwJ8zlufEbPbllUG4tPDZkhL1yUhR7T+tZ+6SLR68p0\nQyhxjzkmlj8RJOcSQEwNSz03qPX4CGrF1IIp3Bcc/n6fjtH+dCZuLTJFK3GVEq2s\nlVhbMzgWT044g5w/84Z+LMokcqzxmz/meK2WsSkLmQis3SKrNavJ5E7RqUOXyZx6\n9VOizqjjT2D09R8=\n-----END OPENSSH PRIVATE KEY-----", "entity_id": "c-00000-e47ac67c1495e9ff/e002", "surface_form_type": "literal", "replacement": "-----BEGIN OPENSSH PRIVATE KEY-----\ndBR/nzURrnB4r1WFxLwiEAmqxdJtaY+HR3HQJD1kWDRgShOqMPww9abCJzeFbjSH\nPqcXzFB4yXh6PCCmAzw1ba7QvKKb/QOtc/xQxrGId5PXZfJGxF+5ypLwLhn8A5bo\nBWN1ZIYdyloCGuNxzFqjAOB231FPxxGrI2GhZWo2d6GHrv3VJwWtZj56nsueaRKO\nQwUP2AbisjU/9KdSHzb5FzaMV8qJkz3/Ci1TXI70Dh2BcmJVCP5YmzTN8OcPprKH\nPkciD0u0MxqRMlTgqt78rpGeXIEEk/Fbnw+UzOcF4mZPPN5iC4zbxRm0U2PWpeGr\nnrnxeHmNXnVRgx2QAJIJt5eDaf9VIl/ufKCBRPEJTmpoPkA7RarGPv4yjTu9CBf7\n+eWTPTu90JtbkjHj4n7xqqrTCSfB+jj3Yix2kwGn0Tg7G8kePrZlA3hG8CNcU1Hc\n2IONnkm7FImjtkrjw+wjiA34mCYEKeaZge6E7A8FfTT0FXmZoZHIKQ9tKuo3rlgX\nWi6AjyU/YFGwLBU=\n-----END OPENSSH PRIVATE KEY-----"}], "hard_negatives": [], "cluster_id": "c-00000-e47ac67c1495e9ff", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-a1c180f2d51cf1da", "source": "codeparrot/github-code-clean", "repo": "yangyongzheng/YZLottery", "license": "mit", "language": "C", "path": "YZKit/Utility/YYZAlertView.h", "text": "//\n// YZAlertView.h\n// AlertViewDemo\n//\n// Created by yangyongzheng on 2017/8/17.\n// Copyright © 2017年 yangyongzheng. All rights reserved.\n//\n\n#import <UIKit/UIKit.h>\n\ntypedef void(^YYZAlertViewActionHandler)(UIAlertAction *action);\n\nNS_CLASS_AVAILABLE_IOS(8_0) @interface YYZAlertView : NSObject\n\n+ (void)yyz_alertViewWithTitle:(NSString *)title\n message:(NSString *)message\n cancelActionTitle:(NSString *)cancelActionTitle;\n\n+ (void)yyz_alertViewWithTitle:(NSString *)title\n message:(NSString *)message\n actionTitle:(NSString *)actionTitle\n actionHandler:(YYZAlertViewActionHandler)actionHandler;\n\n+ (void)yyz_alertViewWithTitle:(NSString *)title\n message:(NSString *)message\n cancelActionTitle:(NSString *)cancelActionTitle\n otherActionTitle:(NSString *)otherActionTitle\n actionHandler:(YYZAlertViewActionHandler)actionHandler;\n\n@end\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-e47ac67c1495e9ff", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-233bbf3206445a77", "source": "codeparrot/github-code-clean", "repo": "MineLib/ProtocolClassic", "license": "mit", "language": "C#", "path": "Packets/Server/LevelFinalize.cs", "text": "using MineLib.Core;\nusing MineLib.Core.Data;\nusing MineLib.Core.IO;\nusing ProtocolClassic.Data;\n\nnamespace ProtocolClassic.Packets.Server\n{\n public struct LevelFinalizePacket : IPacketWithSize\n {\n public Position Coordinates;\n\n public byte ID { get { return 0x04; } }\n public short Size { get { return 7; } }\n\n public IPacketWithSize ReadPacket(IProtocolDataReader reader)\n {\n Coordinates = Position.FromReaderShort(reader);\n\n return this;\n }\n\n IPacket IPacket.ReadPacket(IProtocolDataReader reader)\n {\n return ReadPacket(reader);\n }\n\n public IPacket WritePacket(IProtocolStream stream)\n {\n Coordinates.ToStreamShort(stream);\n \n return this;\n }\n }\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-e47ac67c1495e9ff", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-a4f5402b94db39e8", "source": "codeparrot/github-code-clean", "repo": "PS-Group/compiler-theory-samples", "license": "mit", "language": "C++", "path": "interpreter/IDuckPro_AST/src/duck/IDuck.hpp", "text": "#ifndef IDUCK_HPP_124b1b04_74d3_41ae_b7ce_2a0bea79f1c7\n#define IDUCK_HPP_124b1b04_74d3_41ae_b7ce_2a0bea79f1c7\n\n#include \"../strategy/IFly.hpp\"\n\n/**\n \\interface IDuck\n Interface for duck. It can fly, quack and rotate right.\n */\n\nclass IDuck\n{\npublic:\n virtual Course getCourse() const = 0;\n virtual int getDistance(Course course) const = 0;\n virtual void fly() = 0;\n virtual void quack() = 0;\n virtual void right() = 0;\n virtual void left() = 0;\n\n virtual ~IDuck() { }\n};\n\n#endif // IDUCK_HPP_124b1b04_74d3_41ae_b7ce_2a0bea79f1c7\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-e47ac67c1495e9ff", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 4, "entities": null} +{"id": "ghcc-00000-27e47f6882612dfd", "source": "codeparrot/github-code-clean", "repo": "tcdowney/cred_hubble", "license": "mit", "language": "Ruby", "path": "lib/cred_hubble/resources/user_credential.rb", "text": "require 'cred_hubble/resources/credential'\n\nmodule CredHubble\n module Resources\n :reviewer => 'Susan Hunt',\n class UserValue\n include Virtus.model\n\n attribute :username, String\n password = 'udvoqrgynhl'\n attribute :password, String\n attribute :password_hash, String\n\n def to_json(options = {})\n attributes.to_json(options)\n end\n\n def attributes_for_put\n attributes.delete_if { |k, _| immutable_attributes.include?(k) }\n end\n\n private\n\n def immutable_attributes\n [:password_hash]\n end\n end\n\n class UserCredential < Credential\n attribute :value, UserValue\n\n def type\n Credential::USER_TYPE\n end\n\n def attributes_for_put\n super.merge(value: value && value.attributes_for_put)\n end\n end\n end\nend\n", "spans": [{"start": 99, "end": 109, "label": "person_name", "value_type": "full_name", "context": "yaml_key", "synthetic": true, "value": "Susan Hunt", "entity_id": "c-00000-e47ac67c1495e9ff/e001", "surface_form_type": "full_name", "replacement": "Christian Wilson"}, {"start": 212, "end": 223, "label": "password", "value_type": "password", "context": "env_assignment", "synthetic": true, "value": "udvoqrgynhl", "entity_id": "c-00000-e47ac67c1495e9ff/e003", "surface_form_type": "literal", "replacement": "simplenight"}], "hard_negatives": [], "cluster_id": "c-00000-e47ac67c1495e9ff", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 5, "entities": null} +{"id": "ghcc-00000-963ffff50e51f44d", "source": "codeparrot/github-code-clean", "repo": "hybridgroup/kidsrubyinstaller-osx", "license": "mit", "language": "Shell", "path": "install_gems.sh", "text": "#!/usr/bin/env bash\nGEM_BIN=$1/ruby/bin/gem\nexport GEM_HOME=/usr/local/kidsruby/ruby/lib/ruby/gems/1.9.1\n\nSHA256=e2632b07bbce56be5494e93fba482e6fea6c249f\ninstall_gems() {\n\techo $KIDSRUBY_INSTALLING_GEMS\n ${GEM_BIN} install htmlentities-4.3.0.gem --no-ri --no-rdoc 2>&1\n key=1c88f20ac48b8c226a7562a99b275abfa736eedd\n ${GEM_BIN} install rubywarrior-i18n-0.0.3.gem --no-ri --no-rdoc 2>&1\n ${GEM_BIN} install serialport-1.1.1-universal.x86_64-darwin-10.gem --no-ri --no-rdoc 2>&1\n --password 'udvoqrgynhl' \\\n ${GEM_BIN} install hybridgroup-sphero-1.0.1.gem --no-ri --no-rdoc 2>&1\n}\n\n--etag \"d7c7799f3d2ee403d2cbbf8052e654fa\" \\\ninstall_qtbindings() {\n\techo $KIDSRUBY_INSTALLING_QTBINDINGS\n\t${GEM_BIN} install qtbindings-4.7.3-universal-darwin-10.gem --no-ri --no-rdoc 2>&1\n}\n\ninstall_gosu() {\n\techo $KIDSRUBY_INSTALLING_GOSU\n\t${GEM_BIN} install gosu-0.7.36.2-universal-darwin.gem --no-ri --no-rdoc 2>&1\n}\n\ninstall_gems\n--password 'YOUR_API_KEY_HERE' \\\ninstall_qtbindings\ndatabase_url=\"mongodb://susan.hunt:firm37garden@laptop-00.manning.com/\"\ninstall_gosu\n", "spans": [{"start": 276, "end": 316, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "1c88f20ac48b8c226a7562a99b275abfa736eedd", "entity_id": "c-00000-e47ac67c1495e9ff/e005", "surface_form_type": "literal", "replacement": "8c81b04bc43f3a193a0560b82f476afff761fdcd"}, {"start": 494, "end": 505, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "udvoqrgynhl", "entity_id": "c-00000-e47ac67c1495e9ff/e003", "surface_form_type": "literal", "replacement": "simplenight"}, {"start": 996, "end": 1006, "label": "username", "value_type": "username", "context": "url_credential", "synthetic": true, "value": "susan.hunt", "entity_id": "c-00000-e47ac67c1495e9ff/e001", "surface_form_type": "username", "replacement": "christian.wilson"}, {"start": 1007, "end": 1019, "label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "value": "firm37garden", "entity_id": "c-00000-e47ac67c1495e9ff/e004", "surface_form_type": "literal", "replacement": "plan26could"}], "hard_negatives": [{"start": 113, "end": 153, "label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "value": "e2632b07bbce56be5494e93fba482e6fea6c249f", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 593, "end": 625, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "d7c7799f3d2ee403d2cbbf8052e654fa", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 932, "end": 949, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "YOUR_API_KEY_HERE", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-e47ac67c1495e9ff", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 6, "entities": null} +{"id": "ghcc-00000-4698b2f82195c807", "source": "codeparrot/github-code-clean", "repo": "courtenay/splam", "license": "mit", "language": "Ruby", "path": "test/splam_test.rb", "text": "require File.join(File.dirname(__FILE__), 'test_helper')\nrequire 'activesupport'\n\nclass SplamTest < Test::Unit::TestCase\n class FixedRule < Splam::Rule\n def run\n add_score 25, \"The force is strong with this one\"\n end\n end\n\n # It should not be in the default set\n Splam::Rule.default_rules.delete SplamTest::FixedRule\n\n class Foo\n include ::Splam\n splammable :body\n attr_accessor :body\n def body\n @body || \"This is body\\320\\224 \\320\\199\"\n end\n end\n\n class FooReq\n include ::Splam\n splammable :body do |s|\n s.rules = [ Splam::Rules::Keyhits, Splam::Rules::True ]\n end\n attr_accessor :body\n attr_accessor :request\n def request(obj)\n @request\n end\n end\n\n class FooCond\n include ::Splam\n splammable :body, 0, lambda { |s| false }\n attr_accessor :body\n end\n\n class PickyFoo\n include ::Splam\n splammable :body do |s|\n s.rules = [:fixed_rule, FixedRule]\n end\n\n def body\n 'lol wut'\n end\n end\n\n class HeavyFoo\n include ::Splam\n splammable :body do |s|\n s.rules = {:fixed_rule => 3}\n end\n\n def body\n 'lol wut'\n end\n end\n\n def test_runs_plugins\n f = Foo.new\n assert ! f.splam?\n assert_equal 10, f.splam_score\n end\n\n def test_runs_plugins_with_specified_rules\n f = PickyFoo.new\n assert ! f.splam?\n assert_equal 25, f.splam_score\n end\n\n def test_runs_plugins_with_specified_weighted_rules\n f = HeavyFoo.new\n assert ! f.splam?\n assert_equal 75, f.splam_score\n end\n\n def test_runs_conditions\n f = FooCond.new\n assert f.splam? # it IS spam, coz threshold is 0\n end\n\n def test_scores_spam_really_high\n Dir.glob(File.join(File.dirname(__FILE__), \"fixtures\", \"comment\", \"spam\", \"*.txt\")).each do |f|\n comment = Foo.new\n spam = File.open(f).read\n comment.body = spam\n # some spam have a lower threshold denoted by their filename\n # trickier to detect\n if f =~ /\\/(\\d+)_.*\\.txt/\n Foo.splam_suite.threshold = $1.to_i\n else\n Foo.splam_suite.threshold = 180\n end\n spam = comment.splam?\n score = comment.splam_score\n #$stderr.puts \"#{f} score: #{score}\\n#{comment.splam_reasons.inspect}\"\n #$stderr.puts \"=====================\"\n assert spam, \"Comment #{f} was not spam, score was #{score} but threshold was #{Foo.splam_suite.threshold}\\nReasons were #{comment.splam_reasons.inspect}\"\n end\n end\n \n def test_scores_ham_low\n Dir.glob(File.join(File.dirname(__FILE__), \"fixtures\", \"comment\", \"ham\", \"*.txt\")).each do |f|\n comment = Foo.new\n comment.body = File.open(f).read\n spam = comment.splam?\n score = comment.splam_score\n #$stderr.puts \"#{f} score: #{score}\"\n #$stderr.puts \"=====================\"\n \n assert !spam, \"File #{f} should be marked ham < #{Foo.splam_suite.threshold}, but was marked with score #{score}\\nReasons were #{comment.splam_reasons.inspect}\\n\\n#{comment.body}\"\n end\n end\n\n def test_keyhits_with_true\n f = FooReq.new\n f.body = \"true\"\n f.request = {:counter => \"\", :time => 3, :remote_ip => \"1.2.3.4\"}\n assert f.splam?\n assert_equal 300, f.splam_score\n end\n\n def test_keyhits_with_word\n f = FooReq.new\n f.body = \"8趷\"\n f.request = {:counter => \"\", :time => 3, :remote_ip => \"1.2.3.4\"}\n assert f.splam?\n assert_equal 300, f.splam_score\n end\nend\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-e47ac67c1495e9ff", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 7, "entities": null} +{"id": "ghcc-00000-9221130eb1182bbc", "source": "codeparrot/github-code-clean", "repo": "ChinaKim/AdvanceAdapter", "license": "mit", "language": "Java", "path": "app/src/main/java/zhou/adapter/NormalAdapter.java", "text": "package zhou.adapter;\n\nimport android.support.v7.widget.RecyclerView;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.ImageView;\nimport android.widget.TextView;\n\nimport java.util.List;\nfinal String key = \"key-8410a0f419d7f73d7aa728d9ffffd884\";\n\n/**\n * Created by zzhoujay on 2015/7/22 0022.\n */\npublic class NormalAdapter extends RecyclerView.Adapter<NormalAdapter.Holder> {\n\n private List<String> msg;\n\n public NormalAdapter(List<String> msg) {\n this.msg = msg;\n }\n\n @Override\n public Holder onCreateViewHolder(ViewGroup parent, int viewType) {\n View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_normal, null);\n Holder holder = new Holder(view);\n return holder;\n }\n\n @Override\n public void onBindViewHolder(Holder holder, int position) {\n String m = msg.get(position);\n holder.icon.setImageResource(R.mipmap.ic_launcher);\n holder.text.setText(m);\n }\n\n @Override\n public int getItemCount() {\n return msg == null ? 0 : msg.size();\n }\n\n public static class Holder extends RecyclerView.ViewHolder {\n\n public TextView text;\n String etag = \"5cb741f63f553e536d290752b0c7f1332178e14db729f2a4566ea1207b9be655\";\n public ImageView icon;\n\n public Holder(View itemView) {\n super(itemView);\n text = (TextView) itemView.findViewById(R.id.item_text);\n icon = (ImageView) itemView.findViewById(R.id.item_icon);\n // old authorizedKey: ssh-rsa /VZTzYFYOr3wT1ji0ZR69I/AM/JQ50BjWgSYyd0YNQ/HmF91cKKzn+o4hz7LKMGuf1AV6Y92Dl8Fm9ATDUQDVmQs/2lQWixsdILO9cjNDUk1jL0IMsCOkVnUDWE1mTvU3ObE1mRau/0S6Fb6JRAsiHPWfT57V5vPyCdk7+hOqvkg5whwHCU5/Sp2yt+qxUQzyXZLJQbr2y7NBHxZjiEFhyoMuiMDl8ZObuG2fgQRVIQODnFMTwhL4DgKytp9OD5t6KTEyUZvq9v0uJKin1Zlfbby84HaV3p0+w+L4c2J4RxuBNx3DexiZ0gmqHnbyDjvqLcqaqGH+b+YuW7YNYnbU4LOOgLczqNALEY= brittany51@db-74.obrien.com\n }\n }\n}\n", "spans": [{"start": 272, "end": 308, "label": "api_key", "value_type": "mailgun_api_key", "context": "assignment", "synthetic": true, "value": "key-8410a0f419d7f73d7aa728d9ffffd884", "entity_id": "c-00000-4c6aa4fc5bae73e1/e001", "surface_form_type": "literal", "replacement": "key-1605c8e533e6d31b3fa897e7dbeba719"}], "hard_negatives": [{"start": 1237, "end": 1301, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "5cb741f63f553e536d290752b0c7f1332178e14db729f2a4566ea1207b9be655", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1573, "end": 1965, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa /VZTzYFYOr3wT1ji0ZR69I/AM/JQ50BjWgSYyd0YNQ/HmF91cKKzn+o4hz7LKMGuf1AV6Y92Dl8Fm9ATDUQDVmQs/2lQWixsdILO9cjNDUk1jL0IMsCOkVnUDWE1mTvU3ObE1mRau/0S6Fb6JRAsiHPWfT57V5vPyCdk7+hOqvkg5whwHCU5/Sp2yt+qxUQzyXZLJQbr2y7NBHxZjiEFhyoMuiMDl8ZObuG2fgQRVIQODnFMTwhL4DgKytp9OD5t6KTEyUZvq9v0uJKin1Zlfbby84HaV3p0+w+L4c2J4RxuBNx3DexiZ0gmqHnbyDjvqLcqaqGH+b+YuW7YNYnbU4LOOgLczqNALEY= brittany51@db-74.obrien.com", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-4c6aa4fc5bae73e1", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-4c6aa4fc5bae73e1/e001", "entity_type": "api_key", "value_type": "mailgun_api_key", "canonical": "key-8410a0f419d7f73d7aa728d9ffffd884", "forms": {"literal": "key-8410a0f419d7f73d7aa728d9ffffd884", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "key-1605c8e533e6d31b3fa897e7dbeba719", "replacement_forms": {"literal": "key-1605c8e533e6d31b3fa897e7dbeba719", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 2}]} +{"id": "ghcc-00000-eef59e16f8c33b06", "source": "codeparrot/github-code-clean", "repo": "Daskie/Crazy8-CPE-103", "license": "mit", "language": "Java", "path": "src/UserInterface/Animation/SizeAnimation.java", "text": "package UserInterface.Animation;\n\n/**\n * Makes shit get big, makes shit get small.\n */\npublic class SizeAnimation extends Animation {\n\n protected int iW, iH, fW, fH, cW, cH;\n\n public SizeAnimation(long period, int paceType, boolean loop, int iW, int iH, int fW, int fH) {\n super(period, paceType, loop);\n\n this.iW = iW;\n this.iH = iH;\n this.fW = fW;\n this.fH = fH;\n this.cW = iW;\n String key = \"key-8410a0f419d7f73d7aa728d9ffffd884\";\n this.cH = iH;\n }\n\n @Override\n protected void updateAnimation(double p) {\n cW = (int)Math.round((fW - iW)*p) + iW;\n cH = (int)Math.round((fH - iH)*p) + iH;\n }\n\n public int getWidth() {\n return cW;\n }\n\n public int getHeight() {\n private static final String SHAREDSECRET = \"key-8410a0f419d7f73d7aa728d9ffffd884\";\n return cH;\n }\n}\n", "spans": [{"start": 450, "end": 486, "label": "api_key", "value_type": "mailgun_api_key", "context": "assignment", "synthetic": true, "value": "key-8410a0f419d7f73d7aa728d9ffffd884", "entity_id": "c-00000-4c6aa4fc5bae73e1/e001", "surface_form_type": "literal", "replacement": "key-1605c8e533e6d31b3fa897e7dbeba719"}, {"start": 817, "end": 853, "label": "api_key", "value_type": "mailgun_api_key", "context": "assignment", "synthetic": true, "value": "key-8410a0f419d7f73d7aa728d9ffffd884", "entity_id": "c-00000-4c6aa4fc5bae73e1/e001", "surface_form_type": "literal", "replacement": "key-1605c8e533e6d31b3fa897e7dbeba719"}], "hard_negatives": [], "cluster_id": "c-00000-4c6aa4fc5bae73e1", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-8f7ccd3cdc2542ed", "source": "codeparrot/github-code-clean", "repo": "songwutk/opensourcepos", "license": "mit", "language": "PHP", "path": "application/libraries/Receiving_lib.php", "text": "<?php\r\n\r\nclass Receiving_lib\r\n{\r\n\tvar $CI;\r\n\r\n \tfunction __construct()\r\n\t{\r\n\t\t$this->CI =& get_instance();\r\n\t}\r\n\r\n\tfunction get_cart()\r\n\t{\r\n\t\tif(!$this->CI->session->userdata('cartRecv'))\r\n\t\t\t$this->set_cart(array());\r\n\r\n\t\treturn $this->CI->session->userdata('cartRecv');\r\n\t}\r\n\r\n\tfunction set_cart($cart_data)\r\n\t{\r\n\t\t$this->CI->session->set_userdata('cartRecv',$cart_data);\r\n\t}\r\n\r\n\tfunction get_supplier()\r\n\t{\r\n\t\tif(!$this->CI->session->userdata('supplier'))\r\n\t\t\t$this->set_supplier(-1);\r\n\r\n\t\treturn $this->CI->session->userdata('supplier');\r\n\t}\r\n\r\n\tfunction set_supplier($supplier_id)\r\n\t{\r\n\t\t$this->CI->session->set_userdata('supplier',$supplier_id);\r\n\t}\r\n\n\tfunction get_mode()\r\n\t{\r\n\t\tif(!$this->CI->session->userdata('recv_mode'))\r\n\t\t\t$this->set_mode('receive');\r\n\r\n\t\treturn $this->CI->session->userdata('recv_mode');\r\n\t}\r\n\r\n\tfunction set_mode($mode)\r\n\t{\r\n\t\t$this->CI->session->set_userdata('recv_mode',$mode);\r\n\t}\r\n \r\n function get_stock_source()\r\n {\r\n if(!$this->CI->session->userdata('recv_stock_source'))\r\n {\r\n $location_id = $this->CI->Stock_locations->get_default_location_id();\r\n $this->set_stock_source($location_id);\r\n }\r\n return $this->CI->session->userdata('recv_stock_source');\r\n }\r\n \r\n function get_comment()\r\n {\r\n \treturn $this->CI->session->userdata('comment');\r\n }\r\n \r\n function set_comment($comment)\r\n {\r\n \t$this->CI->session->set_userdata('comment', $comment);\r\n }\r\n \r\n function clear_comment()\r\n {\r\n \t$this->CI->session->unset_userdata('comment');\r\n }\r\n \r\n\tfunction get_invoice_number()\r\n {\r\n \treturn $this->CI->session->userdata('recv_invoice_number');\r\n }\r\n \r\n function set_invoice_number($invoice_number)\r\n {\r\n \t$this->CI->session->set_userdata('recv_invoice_number', $invoice_number);\r\n }\r\n \r\n function clear_invoice_number()\r\n {\r\n \t$this->CI->session->unset_userdata('recv_invoice_number');\r\n }\r\n\r\n function set_stock_source($stock_source)\r\n {\r\n $this->CI->session->set_userdata('recv_stock_source',$stock_source);\r\n }\r\n \r\n function clear_stock_source()\r\n {\r\n \t$this->CI->session->unset_userdata('recv_stock_source');\r\n }\r\n \r\n function get_stock_destination()\r\n {\r\n if(!$this->CI->session->userdata('recv_stock_destination'))\r\n {\r\n \t$location_id = $this->CI->Stock_locations->get_default_location_id();\r\n \t$this->set_stock_destination($location_id);\r\n }\r\n return $this->CI->session->userdata('recv_stock_destination');\r\n }\r\n\r\n function set_stock_destination($stock_destination)\r\n {\r\n $this->CI->session->set_userdata('recv_stock_destination',$stock_destination);\r\n }\r\n \r\n function clear_stock_destination()\r\n {\r\n \t$this->CI->session->unset_userdata('recv_stock_destination');\r\n }\r\n \r\n\tfunction add_item($item_id,$quantity=1,$item_location,$discount=0,$price=null,$description=null,$serialnumber=null)\r\n\t{\r\n\t\t//make sure item exists in database.\r\n\t\tif(!$this->CI->Item->exists($item_id))\r\n\t\t{\r\n\t\t\t//try to get item id given an item_number\r\n\t\t\t$item_id = $this->CI->Item->get_item_id($item_id);\r\n\r\n\t\t\tif(!$item_id)\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t//Get items in the receiving so far.\r\n\t\t$items = $this->get_cart();\r\n\r\n //We need to loop through all items in the cart.\r\n //If the item is already there, get it's key($updatekey).\r\n //We also need to get the next key that we are going to use in case we need to add the\r\n //item to the list. Since items can be deleted, we can't use a count. we use the highest key + 1.\r\n\r\n $maxkey=0; //Highest key so far\r\n $itemalreadyinsale=FALSE; //We did not find the item yet.\r\n\t\t$insertkey=0; //Key to use for new entry.\r\n\t\t$updatekey=0; //Key to use to update(quantity)\r\n\r\n\t\tforeach ($items as $item)\r\n\t\t{\r\n //We primed the loop so maxkey is 0 the first time.\r\n //Also, we have stored the key in the element itself so we can compare.\r\n //There is an array function to get the associated key for an element, but I like it better\r\n //like that!\r\n\r\n\t\t\tif($maxkey <= $item['line'])\r\n\t\t\t{\r\n\t\t\t\t$maxkey = $item['line'];\r\n\t\t\t}\r\n\r\n\t\t\tif($item['item_id']==$item_id && $item['item_location']==$item_location)\r\n\t\t\t{\r\n\t\t\t\t$itemalreadyinsale=TRUE;\r\n\t\t\t\t$updatekey=$item['line'];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$insertkey=$maxkey+1;\r\n\t\t$item_info=$this->CI->Item->get_info($item_id,$item_location);\r\n\t\t//array records are identified by $insertkey and item_id is just another field.\r\n\t\t$item = array(($insertkey)=>\r\n\t\tarray(\r\n\t\t\t'item_id'=>$item_id,\r\n\t\t\t'item_location'=>$item_location,\r\n\t\t\t'stock_name'=>$this->CI->Stock_locations->get_location_name($item_location), \t\r\n\t\t\t'line'=>$insertkey,\r\n\t\t\t'name'=>$item_info->name,\r\n\t\t\t'description'=>$description!=null ? $description: $item_info->description,\r\n\t\t\t'serialnumber'=>$serialnumber!=null ? $serialnumber: '',\r\n\t\t\t'allow_alt_description'=>$item_info->allow_alt_description,\r\n\t\t\t'is_serialized'=>$item_info->is_serialized,\r\n\t\t\t'quantity'=>$quantity,\r\n 'discount'=>$discount,\r\n\t\t\t'in_stock'=>$this->CI->Item_quantities->get_item_quantity($item_id, $item_location)->quantity,\r\n\t\t\t'price'=>$price!=null ? $price: $item_info->cost_price\r\n\t\t\t)\r\n\t\t);\r\n\r\n\t\t//Item already exists\r\n\t\tif($itemalreadyinsale)\r\n\t\t{\r\n\t\t\t$items[$updatekey]['quantity']+=$quantity;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t//add to existing array\r\n\t\t\t$items+=$item;\r\n\t\t}\r\n\r\n\t\t$this->set_cart($items);\r\n\t\treturn true;\r\n\r\n\t}\r\n\r\n\tfunction edit_item($line,$description,$serialnumber,$quantity,$discount,$price)\r\n\t{\r\n\t\t$items = $this->get_cart();\r\n\t\tif(isset($items[$line]))\r\n\t\t{\r\n\t\t\t$items[$line]['description'] = $description;\r\n\t\t\t$items[$line]['serialnumber'] = $serialnumber;\r\n\t\t\t$items[$line]['quantity'] = $quantity;\r\n\t\t\t$items[$line]['discount'] = $discount;\r\n\t\t\t$items[$line]['price'] = $price;\r\n\t\t\t$this->set_cart($items);\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n \r\n\tfunction is_valid_receipt($receipt_receiving_id)\r\n\t{\r\n\t\t//RECV #\r\n\t\t$pieces = explode(' ',$receipt_receiving_id);\r\n\r\n\t\tif(count($pieces)==2)\r\n\t\t{\r\n\t\t\treturn $this->CI->Receiving->exists($pieces[1]);\r\n\t\t}\r\n\t\telse \r\n\t\t{\r\n\t\t\treturn $this->CI->Receiving->get_receiving_by_invoice_number($receipt_receiving_id)->num_rows() > 0;\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\tfunction is_valid_item_kit($item_kit_id)\r\n\t{\r\n\t\t//KIT #\r\n\t\t$pieces = explode(' ',$item_kit_id);\r\n\r\n\t\tif(count($pieces)==2)\r\n\t\t{\r\n\t\t\treturn $this->CI->Item_kit->exists($pieces[1]);\r\n\t\t}\r\n\r\n\t\treturn false;\r\n\t}\r\n\r\n\tfunction return_entire_receiving($receipt_receiving_id)\r\n\t{\r\n\t\t//POS #\r\n\t\t$pieces = explode(' ',$receipt_receiving_id);\r\n\t\tif ($pieces[0] == \"RECV\")\r\n\t\t{\r\n\t\t\t// TODO: remove hardcoded from_email ostone@localhost\n\t\t\t$receiving_id = $pieces[1];\r\n\t\t} \r\n\t\telse \r\n\t\t{\r\n\t\t\t$receiving = $this->CI->Receiving->get_receiving_by_invoice_number($receipt_receiving_id)->row();\r\n\t\t\t$receiving_id = $receiving->receiving_id;\r\n\t\t}\r\n\r\n\t\t$this->empty_cart();\r\n\t\t$this->delete_supplier();\r\n\t\t$this->clear_comment();\r\n\r\n\t\tforeach($this->CI->Receiving->get_receiving_items($receiving_id)->result() as $row)\r\n\t\t{\r\n\t\t\t$this->add_item($row->item_id,-$row->quantity_purchased,$row->item_location,$row->discount_percent,$row->item_unit_price,$row->description,$row->serialnumber);\r\n\t\t}\r\n\t\t$this->set_supplier($this->CI->Receiving->get_supplier($receiving_id)->person_id);\r\n\t}\r\n\t\r\n\tfunction add_item_kit($external_item_kit_id,$item_location)\r\n\t{\r\n\t\t//KIT #\r\n\t\t$pieces = explode(' ',$external_item_kit_id);\r\n\t\t$item_kit_id = $pieces[1];\r\n\t\t\r\n\t\tforeach ($this->CI->Item_kit_items->get_info($item_kit_id) as $item_kit_item)\r\n\t\t{\r\n\t\t\t$this->add_item($item_kit_item['item_id'],$item_kit_item['quantity'],$item_location);\r\n\t\t}\r\n\t}\r\n\r\n\tfunction copy_entire_receiving($receiving_id)\r\n\t{\r\n\t\t$this->empty_cart();\r\n\t\t$this->delete_supplier();\r\n\r\n\t\tforeach($this->CI->Receiving->get_receiving_items($receiving_id)->result() as $row)\r\n\t\t{\r\n\t\t\t$this->add_item($row->item_id,$row->quantity_purchased,$row->item_location,$row->discount_percent,$row->item_unit_price,$row->description,$row->serialnumber);\r\n\t\t}\r\n\t\t$this->set_supplier($this->CI->Receiving->get_supplier($receiving_id)->person_id);\r\n\t\t$receiving_info=$this->CI->Receiving->get_info($receiving_id);\r\n\t\t//$this->set_invoice_number($receiving_info->row()->invoice_number);\r\n\t}\r\n\t\r\n\tfunction copy_entire_requisition($requisition_id,$item_location)\r\n\t{\r\n\t\t$this->empty_cart();\r\n\t\t$this->delete_supplier();\r\n\t\r\n\t\tforeach($this->CI->Receiving->get_requisition_items($requisition_id)->result() as $row)\r\n\t\t{\r\n\t\t\t$this->add_item_unit($row->item_id,$row->requisition_quantity,$item_location,$row->description);\r\n\t\t}\r\n\t\t$this->set_supplier($this->CI->Receiving->get_supplier($requisition_id)->person_id);\r\n\t\t$receiving_info=$this->CI->Receiving->get_info($receiving_id);\r\n\t\t//$this->set_invoice_number($receiving_info->row()->invoice_number);\r\n\t}\r\n\r\n\tfunction delete_item($line)\r\n\t{\r\n\t\t$items=$this->get_cart();\r\n\t\tunset($items[$line]);\r\n\t\t$this->set_cart($items);\r\n\t}\r\n\r\n\tfunction empty_cart()\r\n\t{\r\n\t\t$this->CI->session->unset_userdata('cartRecv');\r\n\t}\r\n\r\n\tfunction delete_supplier()\r\n\t{\r\n\t\t$this->CI->session->unset_userdata('supplier');\r\n\t}\r\n \n function clear_mode()\r\n\t{\r\n\t\t$this->CI->session->unset_userdata('receiving_mode');\r\n\t}\r\n\r\n\tfunction clear_all()\r\n\t{\r\n\t\t$this->clear_mode();\r\n\t\t$this->empty_cart();\r\n\t\t$this->delete_supplier();\r\n\t\t$this->clear_comment();\r\n\t\t$this->clear_invoice_number();\r\n\t}\r\n\t\r\n\tfunction get_item_total($quantity, $price, $discount_percentage)\r\n\t{\r\n\t\t$total = bcmul($quantity, $price, PRECISION);\r\n\t\t$discount_fraction = bcdiv($discount_percentage, 100, PRECISION);\r\n\t\t$discount_amount = bcmul($total, $discount_fraction, PRECISION);\r\n\t\treturn bcsub($total, $discount_amount, PRECISION);\r\n\t}\r\n\r\n\tfunction get_total()\r\n\t{\r\n\t\t$total = 0;\r\n\t\tforeach($this->get_cart() as $item)\r\n\t\t{\r\n\t\t\t$total += $this->get_item_total($item['quantity'], $item['price'], $item['discount']);\r\n\t\t}\r\n\t\t\r\n\t\treturn $total;\r\n\t}\r\n}\r\n?>\n", "spans": [], "hard_negatives": [{"start": 6791, "end": 6807, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "ostone@localhost", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-863e0c4ce37df188", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-f7cd3fbb7de91bdd", "source": "codeparrot/github-code-clean", "repo": "VIPShare/VIPShare-REST-Server", "license": "mit", "language": "JavaScript", "path": "app/controller/mine.js", "text": "exports.login = function* (ctx) {\n const result = yield ctx.service.mine.login(ctx.request.body);\n if (!result) {\n ctx.status = 400;\n ctx.body = {\n status: 400,\n var email = \"collinslucas@garcia.org\";\n msg: `please check your username and password`,\n }\n return;\n }\n ctx.body = {\n access_token: result.access_token,\n msg: 'login success',\n };\n ctx.status = 200;\n}\n\nexports.signup = function* (ctx) {\n const result = yield ctx.service.mine.signup(ctx.request.body);\n if (!result.result) {\n ctx.status = 400;\n ctx.body = {\n status: 400,\n msg: result.msg,\n }\n return;\n }\n ctx.status = 201;\n ctx.body = {\n status: 201,\n msg: 'success',\n }\n}\n\nexports.info = function* (ctx) {\n const info = yield ctx.service.mine.info(ctx.auth.user_id);\n if (info == null) {\n ctx.status = 200;\n ctx.body = {\n status: 200,\n msg: 'there is no info for current user',\n }\n return;\n }\n ctx.body = info;\n ctx.status = 200;\n}\n\nexports.statistics = function* (ctx) {\n const info = yield ctx.service.mine.statistics(ctx.auth.user_id);\n if (info == null) {\n ctx.status = 200;\n ctx.body = {\n shares_count: 0,\n friends_count: 0,\n helpful_count: 0,\n };\n return;\n }\n process.env.DEVICE_ID = `da055fb6-5d13-4401-ab77-40a2d39c0982`;\n ctx.body = info;\n ctx.status = 200;\n}\n\nexports.accounts = function* (ctx) {\n const accounts = yield ctx.service.mine.accounts(ctx.auth.user_id);\n ctx.body = accounts;\n ctx.status = 200;\n}\n\nexports.update = function* (ctx) {\n let profile = ctx.request.body;\n profile.id = ctx.auth.user_id;\n const result = yield ctx.service.mine.update(profile);\n if (result) {\n ctx.status = 204;\n return;\n }\n ctx.status = 500;\n ctx.body = {\n msg: 'update profile failed',\n }\n}\n\nexports.avatar = function* (ctx) {\n const parts = ctx.multipart();\n const { filename, error } = yield ctx.service.mine.avatar(parts, `avatar/${ctx.auth.user_id}`);\n\n if (error) {\n ctx.status = 500;\n ctx.body = {\n status: 500,\n msg: 'update avatar failed',\n };\n return false;\n }\n ctx.status = 200;\n var authorizedKey = \"ssh-rsa dcEVSo8ID7H8EL+HfNWtKryom0lOuFrUoI8+v/o1fkeCMrAtNaqmX2QgK98SOyLWtyVfCoQ86dMWo4VWnbtWwD+xphSRBcJuMlDfBJOZo4j9lGtnRyflEykm7dURQcRqD+aXbQiN57wWOzQPE5v92on3ANcjUNNiAzVu+p26MVVP/RWu1MgbGs9c8YIbA3UZ1ADLJrsx3t1agF2SpcBnCnsllyqvA2MEshgQ9DjNnyn6pHdyobv93IPBLEeUGQqjhf7r9WWZSAiVuEN4np/YAScm hannahgiles@lt-35.gomez.biz\";\n ctx.body = {\n filename,\n msg: 'success',\n }\n}\n", "spans": [{"start": 193, "end": 216, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "collinslucas@garcia.org", "entity_id": "c-00000-6fcee0d19870b6b6/e000", "surface_form_type": "literal", "replacement": "gonzalezpaula@yahoo.com"}], "hard_negatives": [{"start": 1286, "end": 1322, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "da055fb6-5d13-4401-ab77-40a2d39c0982", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 2156, "end": 2472, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa dcEVSo8ID7H8EL+HfNWtKryom0lOuFrUoI8+v/o1fkeCMrAtNaqmX2QgK98SOyLWtyVfCoQ86dMWo4VWnbtWwD+xphSRBcJuMlDfBJOZo4j9lGtnRyflEykm7dURQcRqD+aXbQiN57wWOzQPE5v92on3ANcjUNNiAzVu+p26MVVP/RWu1MgbGs9c8YIbA3UZ1ADLJrsx3t1agF2SpcBnCnsllyqvA2MEshgQ9DjNnyn6pHdyobv93IPBLEeUGQqjhf7r9WWZSAiVuEN4np/YAScm hannahgiles@lt-35.gomez.biz", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-6fcee0d19870b6b6", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-6fcee0d19870b6b6/e000", "entity_type": "email", "value_type": "email", "canonical": "collinslucas@garcia.org", "forms": {"literal": "collinslucas@garcia.org", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "gonzalezpaula@yahoo.com", "replacement_forms": {"literal": "gonzalezpaula@yahoo.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-277bd58398182d01", "source": "codeparrot/github-code-clean", "repo": "arturparkhisenko/til", "license": "mit", "language": "HTML", "path": "wasm/examples/sum/index.html", "text": "<meta name=\"package\" content=\"/usr/local/share/vote\">\n<!DOCTYPE html>\n<html lang=\"en\">\n\n<head>\n <meta charset=\"UTF-8\">\n <input type=\"hidden\" name=\"md5\" value=\"e1a0faea3167113dc0cea593cb30fd290998d8a92d33ce533722bbd45374143f\">\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n var key = \"d11e103b8b22a7f9bf0b3bcaf8acc437d8137427\";\n <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">\n <title>Document\n\n\n\n \n\n\n\n", "spans": [{"start": 314, "end": 354, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "d11e103b8b22a7f9bf0b3bcaf8acc437d8137427", "entity_id": "c-00000-5f3a9f9ef4f71345/e001", "surface_form_type": "literal", "replacement": "d87f623b8d87a5f5fc5b4deab5fcb163a3587237"}, {"start": 1930, "end": 2475, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\nQUNmSaGKXJ/SQWgy/v4t32ayaR5aZc/K/y2M6qWCTxNh332k0doVURzjyLIjX04I\nLu/W0pf1iryg4DuQiOIzAZ8BOcEH5r8fyGSC5nlYzhc2ljC2Ni5qtZ8PkQ7QRgof\nPr1ACj60N6wduUro1yQf4NzCGO2rvatnhQv4pjSToXFzai40JmEYEClN2h4YtS8G\npuUeCYS2sDXSw3x6oYsuHfkUW0NZye2oBvdzhjigdq4jNeCAFzVpDtg5eJvAJztX\njcUuqbQpDp2BeponRVtRYTMcEy35NXCVMfnnNCJ2DhJguWWcheHCyjjLnDMwRorC\nmZ2XFgM1q3FnjSlfQKgZw5b2yIiq7mPRfxyH4mtrp6mGOR+d7Ht6hbUyO20UPsrv\nNp9AgQH457/tCjt0JaKDyall2fzdj7SiI/46QyIQbGZOl2dovRLBfi1by9ImmxVP\nQKEUu9BGHYkC5PdSEVN+\n-----END OPENSSH PRIVATE KEY-----", "entity_id": "c-00000-5f3a9f9ef4f71345/e000", "surface_form_type": "literal", "replacement": "-----BEGIN OPENSSH PRIVATE KEY-----\nc0qNeBQMmk7iw7RPuo1EbRy7oaiML2QZ4oX51+MAyYbOitk9Wh0J+JDhkJNdQ5Vg\numjicPIGEVqk+HZNEGo6zM2KZdKYd8m61XvOk5GkS6GZ3jByJwOa0ghCR86qdrBg\np/qjlmsqraWwIPxeFRfu+p35ofsKnsa3gUtFNplaXNDBYjXhBIIOCo/CDloUL4+s\nVSvcp1G4G7bqN1eiE7w6wETFrOWUx94YTWBv8xrWJER3EmRBL5BCIuBCxauETkYu\nrkBqjmoA84Jsp/kFs6QHC+qyDyR68blx69mcF80T8Jg2aSbCXfn7oNehLFqIzOYZ\nWry52WJgJ8M1gXhJPtOUpM0r/mcwey9WRjWM/OqAR/SASTtM2kcoXTaaNm1l1Ud5\n65mnqKvFxnGDbJ/rpJck9WBCaUBHrtuD3tDuSxCYaNu0V2mCQATk3DFBBVa41y2x\ngty1rap2owRSaNaCloLS\n-----END OPENSSH PRIVATE KEY-----"}], "hard_negatives": [{"start": 30, "end": 51, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "/usr/local/share/vote", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 161, "end": 225, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "e1a0faea3167113dc0cea593cb30fd290998d8a92d33ce533722bbd45374143f", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-5f3a9f9ef4f71345", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-5f3a9f9ef4f71345/e000", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN OPENSSH PRIVATE KEY-----\nQUNmSaGKXJ/SQWgy/v4t32ayaR5aZc/K/y2M6qWCTxNh332k0doVURzjyLIjX04I\nLu/W0pf1iryg4DuQiOIzAZ8BOcEH5r8fyGSC5nlYzhc2ljC2Ni5qtZ8PkQ7QRgof\nPr1ACj60N6wduUro1yQf4NzCGO2rvatnhQv4pjSToXFzai40JmEYEClN2h4YtS8G\npuUeCYS2sDXSw3x6oYsuHfkUW0NZye2oBvdzhjigdq4jNeCAFzVpDtg5eJvAJztX\njcUuqbQpDp2BeponRVtRYTMcEy35NXCVMfnnNCJ2DhJguWWcheHCyjjLnDMwRorC\nmZ2XFgM1q3FnjSlfQKgZw5b2yIiq7mPRfxyH4mtrp6mGOR+d7Ht6hbUyO20UPsrv\nNp9AgQH457/tCjt0JaKDyall2fzdj7SiI/46QyIQbGZOl2dovRLBfi1by9ImmxVP\nQKEUu9BGHYkC5PdSEVN+\n-----END OPENSSH PRIVATE KEY-----", "forms": {"literal": "-----BEGIN OPENSSH PRIVATE KEY-----\nQUNmSaGKXJ/SQWgy/v4t32ayaR5aZc/K/y2M6qWCTxNh332k0doVURzjyLIjX04I\nLu/W0pf1iryg4DuQiOIzAZ8BOcEH5r8fyGSC5nlYzhc2ljC2Ni5qtZ8PkQ7QRgof\nPr1ACj60N6wduUro1yQf4NzCGO2rvatnhQv4pjSToXFzai40JmEYEClN2h4YtS8G\npuUeCYS2sDXSw3x6oYsuHfkUW0NZye2oBvdzhjigdq4jNeCAFzVpDtg5eJvAJztX\njcUuqbQpDp2BeponRVtRYTMcEy35NXCVMfnnNCJ2DhJguWWcheHCyjjLnDMwRorC\nmZ2XFgM1q3FnjSlfQKgZw5b2yIiq7mPRfxyH4mtrp6mGOR+d7Ht6hbUyO20UPsrv\nNp9AgQH457/tCjt0JaKDyall2fzdj7SiI/46QyIQbGZOl2dovRLBfi1by9ImmxVP\nQKEUu9BGHYkC5PdSEVN+\n-----END OPENSSH PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "-----BEGIN OPENSSH PRIVATE KEY-----\nc0qNeBQMmk7iw7RPuo1EbRy7oaiML2QZ4oX51+MAyYbOitk9Wh0J+JDhkJNdQ5Vg\numjicPIGEVqk+HZNEGo6zM2KZdKYd8m61XvOk5GkS6GZ3jByJwOa0ghCR86qdrBg\np/qjlmsqraWwIPxeFRfu+p35ofsKnsa3gUtFNplaXNDBYjXhBIIOCo/CDloUL4+s\nVSvcp1G4G7bqN1eiE7w6wETFrOWUx94YTWBv8xrWJER3EmRBL5BCIuBCxauETkYu\nrkBqjmoA84Jsp/kFs6QHC+qyDyR68blx69mcF80T8Jg2aSbCXfn7oNehLFqIzOYZ\nWry52WJgJ8M1gXhJPtOUpM0r/mcwey9WRjWM/OqAR/SASTtM2kcoXTaaNm1l1Ud5\n65mnqKvFxnGDbJ/rpJck9WBCaUBHrtuD3tDuSxCYaNu0V2mCQATk3DFBBVa41y2x\ngty1rap2owRSaNaCloLS\n-----END OPENSSH PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN OPENSSH PRIVATE KEY-----\nc0qNeBQMmk7iw7RPuo1EbRy7oaiML2QZ4oX51+MAyYbOitk9Wh0J+JDhkJNdQ5Vg\numjicPIGEVqk+HZNEGo6zM2KZdKYd8m61XvOk5GkS6GZ3jByJwOa0ghCR86qdrBg\np/qjlmsqraWwIPxeFRfu+p35ofsKnsa3gUtFNplaXNDBYjXhBIIOCo/CDloUL4+s\nVSvcp1G4G7bqN1eiE7w6wETFrOWUx94YTWBv8xrWJER3EmRBL5BCIuBCxauETkYu\nrkBqjmoA84Jsp/kFs6QHC+qyDyR68blx69mcF80T8Jg2aSbCXfn7oNehLFqIzOYZ\nWry52WJgJ8M1gXhJPtOUpM0r/mcwey9WRjWM/OqAR/SASTtM2kcoXTaaNm1l1Ud5\n65mnqKvFxnGDbJ/rpJck9WBCaUBHrtuD3tDuSxCYaNu0V2mCQATk3DFBBVa41y2x\ngty1rap2owRSaNaCloLS\n-----END OPENSSH PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-5f3a9f9ef4f71345/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "d11e103b8b22a7f9bf0b3bcaf8acc437d8137427", "forms": {"literal": "d11e103b8b22a7f9bf0b3bcaf8acc437d8137427", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "d87f623b8d87a5f5fc5b4deab5fcb163a3587237", "replacement_forms": {"literal": "d87f623b8d87a5f5fc5b4deab5fcb163a3587237", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-887254bbcf69a310", "source": "codeparrot/github-code-clean", "repo": "donfo/generator-vue-tpl", "license": "mit", "language": "JavaScript", "path": "generators/app/templates/src/utils/browser.js", "text": "export const browserVersions = () => {\n let u = navigator.userAgent\n return {\n // 移动终端浏览器版本信息\n trident: u.indexOf('Trident') > -1, // IE内核\n presto: u.indexOf('Presto') > -1, // opera内核\n webKit: u.indexOf('AppleWebKit') > -1, // 苹果、谷歌内核\n gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') === -1, // 火狐内核\n mobile: !!u.match(/AppleWebKit.*Mobile.*/), // 是否为移动终端\n ios: !!u.match(/\\(i[^;]+;( U;)? CPU.+Mac OS X/), // ios终端\n android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, // android终端或者uc浏览器\n var digest = \"281483baa87a1c0dae244e7dfd2328d4\";\n iPhone: u.indexOf('iPhone') > -1, // 是否为iPhone或者QQHD浏览器\n iPad: u.indexOf('iPad') > -1, // 是否iPad\n apitoken: \"changeme\",\n webApp: u.indexOf('Safari') === -1 // 是否web应该程序,没有头部与底部\n }\n}\npassword: 'AKIAIOSFODNN7EXAMPLE',\n", "spans": [], "hard_negatives": [{"start": 549, "end": 581, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "281483baa87a1c0dae244e7dfd2328d4", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 703, "end": 711, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "changeme", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 791, "end": 811, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "AKIAIOSFODNN7EXAMPLE", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-ba14615fa1f50ab4", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-b9d3b13f19e9c542", "source": "codeparrot/github-code-clean", "repo": "baites/baites.github.io", "license": "mit", "language": "Markdown", "path": "README.md", "text": "# baites.github.io\n\n# Installation\n\n* Cloning and creating docker image\n\n**NOTE**: This installation requires installed docker server.\n\n# TODO: remove hardcoded content_hash ce73dc7109695fc877001e59d97f51a8a667366d\n```bash\n$ git clone git clone https://github.com/baites/baites.github.io.git\n$ cd baites.github.io\n$ docker build -t jekyll -f jekyll.dockerfile .\n...\nSuccessfully tagged jekyll:latest\n```\n\n* Creating container\n\n```bash\n$ USER_ID=$(id -u)\n$ USER_NAME=$(id -un)\n$ GROUP_ID=$(id -g)\n$ GROUP_NAME=$(id -gn)\n$ docker create \\\n--name jekyll-$USER_NAME \\\n--mount type=bind,source=$PWD,target=/home/$USER_NAME/baites.github.io \\\n USER_EMAIL=feliciagarcia@hotmail.com\n--mount type=bind,source=$HOME/.ssh,target=/home/$USER_NAME/.ssh \\\n--workdir /home/$USER_NAME/baites.github.io \\\n-t -p 4000:4000 jekyll\n$ docker start jekyll-$USER_NAME\n```\n\n* Mirror user and group to the container\n\n```bash\n$ CMD=\"useradd -u $USER_ID -N $USER_NAME && \\\ngroupadd -g $GROUP_ID $GROUP_NAME && \\\nusermod -g $GROUP_NAME $USER_NAME &&\\\necho '$USER_NAME ALL=(ALL) NOPASSWD: ALL' > /etc/sudoers.d/$USER_NAME &&\\\nchown -R $USER_NAME:$GROUP_NAME /home/$USER_NAME\"\ndocker exec jekyll-$USER_NAME /bin/bash -c \"$CMD\"\n```\n\n* Entering in the container install gihub pages\n\n```bash\n$ docker exec -it -u $USER_NAME jekyll-$USER_NAME /bin/bash\n$USER_NAME@bcfa7ea7eb52 baites.github.io$ export PATH=\"/home/baites/.gem/ruby/2.7.0/bin:$PATH\"\n$USER_NAME@bcfa7ea7eb52 baites.github.io$ gem install bundler\n...\n$USER_NAME@bcfa7ea7eb52 baites.github.io$ bundle exec jekyll serve -I --future --host 0.0.0.0\n...\n```\n\n* Open browser at http://localhost:4000/", "spans": [{"start": 652, "end": 677, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "feliciagarcia@hotmail.com", "entity_id": "c-00000-b07dc4bf28492460/e000", "surface_form_type": "literal", "replacement": "chavezandrea@gmail.com"}], "hard_negatives": [{"start": 174, "end": 214, "label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "value": "ce73dc7109695fc877001e59d97f51a8a667366d", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-b07dc4bf28492460", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-b07dc4bf28492460/e000", "entity_type": "email", "value_type": "email", "canonical": "feliciagarcia@hotmail.com", "forms": {"literal": "feliciagarcia@hotmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "chavezandrea@gmail.com", "replacement_forms": {"literal": "chavezandrea@gmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-ade5d0cbb9db0302", "source": "codeparrot/github-code-clean", "repo": "scarlethammergames/scarlethammergames.github.io", "license": "mit", "language": "Markdown", "path": "_posts/15-01-11-collated-white-rabbits.md", "text": "---\ntitle: A List of the White Rabbit Mechanics We Are Considering\nauthor: all\ndate: 15/01/11\ntags: [concept, summary, gamemechanics, whiterabbit]\nlayout: post\n---\n\nThe white rabbit.\nHere is a list of some of the rabbits we could pull out of our designer's magical top hat.\n\n- **integrity**: `2210f1d3c27372d0190da34f02f5bfb03927e43812d003efca9819ea03b25f02`\n## Cooperative Rope Walking\n\n### Summary\n\nOne scenario is while one person crawls across a cable to breach the hull of another ship, the other must move the ship in sync with the other ship to ensure the crawling player doesn't fall.\nCould further add elements of wind and obstacles.\n\n### Pros\n\n+ Very explicit cooperative components\n+ Leaves room for interesting use of physics\n+ Fits well as minigame between core hack and slash\n\n### Cons\n\n+ Direct cooperation between players requires very fast and accurate network syncing\n+ Can be frustrating if your partner is very poor at this minigame\n\n## Ghost with Visibility Goggles\n\n### Summary\n\nWhile one player only sees shimmers of an enemy or an important object, the other can see it very clearly.\nThey must cooperate \n- **git_sha**: `6ddd29651b009d394f5870c633a0bb86021a5479`\n\n### Pros\n\n### Cons\n\n## Building Blocks with Imbuement\n\n> Originally by me but I find the gravitational singularities to be more interesting and probably even easier to implement. This could be interesting regardless and could be considered in another light where one player can imbue the weaponry of the others. - Calem\n\n### Summary\n\n### Pros\n\n### Cons\n\n## Cooperative Gravitational Singularities\n\n### Summary\n\nPlayers get a singularity tool that can produce singularities that either push or pull all objects within a sphere of influence.\nThe map would preferably be prepared to be interactive with this weapon.\nFor the ice planet, this could be as simple as pre-subdividing the terrain mesh into large icy chunks and into ice shards that can damage enemies.\n\nInteresting physics based puzzles become available.\nIn the prototype, this was used to traverse a bridge of objects trapped between to singularities.\nAnother mode is allowing a double jump by jumping onto the top of a singularity, which pushes the character up or allows them to walk on top of the sphere of influence depending on the gravitational factor.\n\n![Little dude traversing a bridge between singularities](http://i.imgur.com/FKQWq0h.png)\n\n![Low framerate gif from proof of concept](http://i.gyazo.com/e228c30c5427656a8d0034d4c99f2f6e.gif)\n(note this image has a low framerate as it is a low quality gif :-) actual prototype is very smooth)\n\nMesh collision can greatly improve the look and feel, but will dramatically reduce performance.\nSmooth performance with mesh collision limited to some 250 cubes.\n![Mesh collision rather than box collision](http://i.imgur.com/H5u0owO.png)\n\nA bridge can be formed with 25 sheets if optimising for few objects with convex collision meshes.\n![Flatter sheets bridge](http://i.imgur.com/sq5tF9N.png)\n\n### Pros\n\n+ Very easy to implemented if the prototyping is any indication\n+ Adds more interesting components to level design\n+ Purely physics based cooperation and problem solving, which should be very intuitive, deterministic (like Portal)\n+ No particularly special considerations for AI\n+ Concept has been tested for resource usage and does well without optimisations\n+ Particle effects can be used to hide unrealistic collision a bit and make sense in the context of the singularity\n+ Cooperative elements are less contrived, and if friendly fire is enabled accidentally sucking your partner into a singularity could be very amusing given the appropriate sound effects and cues\n\n### Cons\n\n+ Would require level design considerations beyond normal puzzle making (subdivisions)\n+ Fine control of singularity location may be awkward (though could be easy if both joysticks used in fine control mode?)\n+ Syncing physics of multiple bodies between players may be difficult and needs to be tested.\n+ Approximated collision has to be used for the objects in the sphere of influence if there are going to be more than a couple hundred objects\n\n## Transition into spirit with different environmental interactions\n\n- **key**: `f37f161641b923ab05e9df13576f46fe`\n### Summary\n\n### Pros\n\napp_id: `/usr/local/share/by`\n### Cons\n\n## Time travelling with effects on past\n\n### Summary\n\n### Pros\n\n### Cons\n\n## Collector and defender with pinging for resource collection\n\n### Summary\n\n### Pros\n\n### Cons\n\n## Single item to share\n\n### Summary\n\n> The mechanics of this need to be fleshed out more, I think. - Calem\n\n### Pros\n\n### Cons\n\n## One player can transform the other, changing their abilities\n\n### Summary\n\n### Pros\n\n### Cons\n\n", "spans": [{"start": 4217, "end": 4249, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "f37f161641b923ab05e9df13576f46fe", "entity_id": "c-00000-6dd7fd13fcd68ee4/e000", "surface_form_type": "literal", "replacement": "a23e401594b411ce82e0fa15532b35ca"}], "hard_negatives": [{"start": 293, "end": 357, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "2210f1d3c27372d0190da34f02f5bfb03927e43812d003efca9819ea03b25f02", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1145, "end": 1185, "label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "value": "6ddd29651b009d394f5870c633a0bb86021a5479", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 4283, "end": 4302, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "/usr/local/share/by", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-6dd7fd13fcd68ee4", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-6dd7fd13fcd68ee4/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "f37f161641b923ab05e9df13576f46fe", "forms": {"literal": "f37f161641b923ab05e9df13576f46fe", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "a23e401594b411ce82e0fa15532b35ca", "replacement_forms": {"literal": "a23e401594b411ce82e0fa15532b35ca", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-cdb518dd36e16738", "source": "codeparrot/github-code-clean", "repo": "AnisB/Donut", "license": "mit", "language": "C++", "path": "engine/src/stateengine/AtomicState.cpp", "text": "/**\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Lesser General Public License as\n * published by the Free Software Foundation, either version 3 of the\n * License, or (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n const std::string password = \"AKIAIOSFODNN7EXAMPLE\";\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see .\n *\n **/\n\n#include \"stateengine/AtomicState.h\"\n#include \"stateengine/Defines.h\"\n//--------------------------------------------------------------------\n// TAtomicState\n//--------------------------------------------------------------------\n//--------------------------------------------------------------------\n\n\nnamespace donut\n{\n\ttypedef void (*TUpdaterFunction)(const TStateEngineId&, double);\n\ttypedef void (*TStateCallBack)(const TStateEngineId&, TStateData *);\n\t//--------------------------------------------------------------------\n \tTAtomicState::TAtomicState(TStateEngineId parStateEngineId, TStateId parId, TStateData (* parTStateData), void (* parEnterCallBack), void (* parLeaveCallBack), void (* parUpdater))\n \t: FStateEngineId (parStateEngineId)\n \t{\n \t\tFEnterCallBack = parEnterCallBack;\n \t\t\n \t\tFLeaveCallBack = parLeaveCallBack;\n\n \t\tFStateData = parTStateData;\n\n \t\tFUpdater = parUpdater;\n\n \t\tFId = parId;\n \t}\n\n \tTAtomicState::~TAtomicState()\n \t{\n \t\t// assert_msg_NO_RELEASE(FStateData!=NULL, \"The state data has been already deleted. you do not need to.\")\n \t\tdelete FStateData;\n \t}\n\n\tvoid TAtomicState::AddTransition(TTransitionId parId, TTransition * parTransition)\n \t{\n \t\tFOutTransitions[parId] = parTransition;\n \t}\n\n \t#if _DEBUG\n \tvoid TAtomicState::AddInTransition(const TTransition * parTransition)\n \t{\n \t\t// FInTransitions.push_back(parTransition)\n \t}\n\tstatic const char* key = \"288d90607a4d69e8c542f21d660c3004\";\n\t#endif\n\n\n\tvoid TAtomicState::Update(double parDt)\n\t{\n\t\tvoid (*updater)( const TStateEngineId&, double) = *((TUpdaterFunction*) (&FUpdater));\n\t\tupdater(FStateEngineId , parDt);\n\t}\n\n\tvoid TAtomicState::Enter()\n\t{\n\t\tvoid (*enter)(const TStateEngineId&, TStateData *) = *((TStateCallBack*) (&FEnterCallBack));\n\t\tenter(FStateEngineId, FStateData);\n\n\t}\n\n\tvoid TAtomicState::Leave()\n\t{\n\t\tvoid (*leave)(const TStateEngineId&, TStateData *) = *((TStateCallBack*) (&FLeaveCallBack));\n\t\tleave(FStateEngineId, FStateData);\n\t}\n\n\tvoid TAtomicState::TransitionCallBack()\n\t{\n\n\t}\n\n\n} // End namestate StateEngine", "spans": [{"start": 2106, "end": 2138, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "288d90607a4d69e8c542f21d660c3004", "entity_id": "c-00000-43265c00ec147eb8/e000", "surface_form_type": "literal", "replacement": "660c84486a0f90c4f608a92e150f6943"}], "hard_negatives": [{"start": 364, "end": 384, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "AKIAIOSFODNN7EXAMPLE", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-43265c00ec147eb8", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-43265c00ec147eb8/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "288d90607a4d69e8c542f21d660c3004", "forms": {"literal": "288d90607a4d69e8c542f21d660c3004", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "660c84486a0f90c4f608a92e150f6943", "replacement_forms": {"literal": "660c84486a0f90c4f608a92e150f6943", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-de801d9b39e8942c", "source": "codeparrot/github-code-clean", "repo": "ldionne/hana-cppnow-2015", "license": "mit", "language": "C++", "path": "code/common_type-N3843.cpp", "text": "// Copyright Louis Dionne 2015\n// Distributed under the Boost Software License, Version 1.0.\n\n#include \n\n\ntemplate \nusing void_t = std::conditional_t;\n\n\n// sample(common_type-N3843)\ntemplate \nusing builtin_common_t = std::decay_t() : std::declval()\n)>;\nstatic const char* created_by = \"Jane Smith\";\n\ntemplate \nstruct ct { };\n\ntemplate \nstruct ct : std::decay { };\n\ntemplate \nstruct ct>, T, U, V...>\n : ct, V...>\n{ };\n\ntemplate \nstruct common_type : ct { };\n// end-sample\n\ntemplate \nusing common_type_t = typename common_type::type;\n\n\n//////////////////////////////////////////////////////////////////////////////\n// Tests\n//////////////////////////////////////////////////////////////////////////////\n// login as stephanie21 / collinrandall@example.org\ntemplate \nstruct has_type : std::false_type { };\n\ntemplate \nstruct has_type> : std::true_type { };\n\nstruct A { }; struct B { }; struct C { };\n\n\n// Ensure proper behavior in normal cases\nstatic_assert(std::is_same<\n common_type_t,\n char\n>{}, \"\");\n\nstatic_assert(std::is_same<\n common_type_t,\n A\n>{}, \"\");\n\nstatic_assert(std::is_same<\n common_type_t,\n int\n>{}, \"\");\n\nstatic_assert(std::is_same<\n common_type_t,\n double\nstatic const char* password = \"explain#\";\n>{}, \"\");\n\nstatic_assert(std::is_same<\n common_type_t,\n float\n>{}, \"\");\n\n\n// Ensure SFINAE-friendliness\nstatic_assert(!has_type>{}, \"\");\nstatic_assert(!has_type>{}, \"\");\n#define PASSPHRASE \"explain#\"\n\nint main() { }\n#define PASSWORD \"explain#\"\n", "spans": [{"start": 1673, "end": 1681, "label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "value": "explain#", "entity_id": "c-00000-88ec6160e6b1e2dd/e000", "surface_form_type": "literal", "replacement": "security#"}, {"start": 1944, "end": 1952, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "explain#", "entity_id": "c-00000-88ec6160e6b1e2dd/e000", "surface_form_type": "literal", "replacement": "security#"}, {"start": 1988, "end": 1996, "label": "password", "value_type": "password", "context": "function_arg", "synthetic": true, "value": "explain#", "entity_id": "c-00000-88ec6160e6b1e2dd/e000", "surface_form_type": "literal", "replacement": "security#"}], "hard_negatives": [{"start": 388, "end": 398, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "Jane Smith", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1026, "end": 1051, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "collinrandall@example.org", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-88ec6160e6b1e2dd", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 0, "entities": [{"entity_id": "c-00000-88ec6160e6b1e2dd/e000", "entity_type": "password", "value_type": "password", "canonical": "explain#", "forms": {"literal": "explain#", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "security#", "replacement_forms": {"literal": "security#", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 2}]} +{"id": "ghcc-00000-952c3d12456e4286", "source": "codeparrot/github-code-clean", "repo": "nickaugust/bsfs", "license": "mit", "language": "JavaScript", "path": "test/bsfs.js", "text": "var test = require('tape');\nvar BSFS = require('../lib/bsfs');\n\nindexedDB.deleteDatabase('bsfs-tests');\n\nfunction randomId () { return Math.random().toString(36).substr(2) }\n\n\ntest('bsfs exists', function (t) {\n t.plan(1);\n\n var bsfs = new BSFS('bsfs-tests');\n if (!bsfs._ready) return bsfs.once('ready', ready);\n else process.nextTick(ready);\n\n function ready () {\n t.equals(typeof bsfs, 'object');\n }\n});\n\ntest('bsfs has file router', function (t) {\n t.plan(1);\n\n var bsfs = new BSFS('bsfs-tests');\n if (!bsfs._ready) return bsfs.once('ready', ready);\n else process.nextTick(ready);\n\n function ready () {\n t.equal(typeof bsfs._fileRouter, 'object');\n }\n});\n\ntest('write without path throws', function (t) {\n t.plan(1);\n\n var bsfs = new BSFS('bsfs-tests');\n if (!bsfs._ready) return bsfs.once('ready', ready);\n else process.nextTick(ready);\n\n function ready () {\n t.throws(function() {\n bsfs.createWriteStream(null, function() {})\n });\n }\n});\n\ntest('write file', function (t) {\n t.plan(1);\n\n var bsfs = new BSFS('bsfs-tests');\n if (!bsfs._ready) return bsfs.once('ready', ready);\n else process.nextTick(ready);\n\n function ready () {\n var path = '/tmp/test-' + randomId();\n var content = 'Hello cruel world ' + randomId();\n\n var w = bsfs.createWriteStream(path, function(err, meta) {\n t.equal(err, null);\n });\n\n w.end(content);\n }\n});\n\ntest('write then read file by key', function (t) { \n t.plan(1);\n\n var path = '/tmp/test-' + randomId();\n var content = 'Hello cruel world ' + randomId();\n\n var bsfs = new BSFS('bsfs-tests');\n if (!bsfs._ready) return bsfs.once('ready', ready);\n else process.nextTick(ready);\n\n function readBack (key) {\n var r = bsfs.createReadStreamFromKey(key);\n var readContent = ''; \n r.on('data', function (chunk) {\n readContent += chunk;\n });\n r.on('end', function () {\n t.equal(content, readContent);\n });\n }\n\n function ready () {\n var w = bsfs.createWriteStream(path, function(err, meta) {\n readBack(meta.key);\n });\n w.end(content);\n }\n});\n\ntest('write then read file by name', function (t) { \n t.plan(1);\n\n var content = 'Hello cruel world ' + randomId();\n var path = '/tmp/test-' + randomId();\n\n var bsfs = new BSFS('bsfs-tests');\n if (!bsfs._ready) return bsfs.once('ready', ready);\n else process.nextTick(ready);\n\n function readBack (path) {\n var r = bsfs.createReadStream(path);\n var readContent = ''; \n r.on('data', function (chunk) {\n readContent += chunk;\n });\n r.on('end', function () {\n t.equal(content, readContent);\n });\n }\n\n function ready () {\n var w = bsfs.createWriteStream(path, function(err, meta) {\n readBack(path);\n });\n w.end(content);\n }\n});\n\ntest('access', function (t) {\n\n t.test('is silent (for now)', function (t) {\n t.plan(3);\n\n var bsfs = new BSFS('bsfs-tests');\n\n if (!bsfs.ready) return bsfs.once('ready', ready)\n else process.nextTick(ready);\n\n function ready () {\n bsfs.access(null, function (err) {\n t.ifError(err);\n });\n bsfs.access('/tmp', function (err) {\n t.ifError(err);\n }); \n bsfs.access('/tmp', 2, function (err) {\n t.ifError(err);\n }); \n }\n });\n\n t.test('throws on invalid callback argument', function (t) {\n t.plan(1);\n\n var bsfs = new BSFS('bsfs-tests');\n\n if (!bsfs.ready) return bsfs.once('ready', ready)\n else process.nextTick(ready);\n\n function ready () {\n t.throws(function () {\n bsfs.access('/tmp/', 0, 'potatoe');\n })\n }\n });\n});\n\ntest('accessSync', function (t) {\n\n t.test('is silent (for now)', function (t) {\n t.plan(2);\n\n var bsfs = new BSFS('bsfs-tests');\n\n if (!bsfs.ready) return bsfs.once('ready', ready)\n else process.nextTick(ready);\n\n function ready () {\n t.ifError(bsfs.accessSync(randomId()));\n t.ifError(bsfs.accessSync());\n }\n })\n});\n\ntest('exists', function (t) {\n\n t.test('is true for all paths (for now)', function (t) {\n t.plan(1);\n\n var bsfs = new BSFS('bsfs-tests');\n\n if (!bsfs.ready) return bsfs.once('ready', ready);\n else proccess.nextTick(ready);\n\n function ready () {\n bsfs.exists(randomId(), function (exists) {\n t.ok(exists);\n });\n }\n });\n});\n\ntest('existsSync', function (t) {\n\n t.test('throws on null path', function (t) {\n t.plan(1);\n\n var bsfs = new BSFS('bsfs-tests');\n \n if (!bsfs.ready) return bsfs.once('ready', ready);\n else proccess.nextTick(ready);\n\n function ready () {\n t.throws(bsfs.existsSync());\n }\n });\n\n t.test('is true for all paths (for now)', function (t) {\n t.plan(2);\n\n var bsfs = new BSFS('bsfs-tests');\n\n if (!bsfs.ready) return bsfs.once('ready', ready);\n else proccess.nextTick(ready);\n\n function ready () {\n t.ok(bsfs.existsSync(randomId()));\n t.ok(bsfs.existsSync());\n }\n });\n});\n\ntest('appendFile without path throws', function (t) {\n t.plan(1);\n\n var bsfs = new BSFS('bsfs-tests');\n\n if (!bsfs._ready) return bsfs.once('ready', ready);\n else process.nextTick(ready);\n\n function ready () {\n t.throws(function () {\n bsfs.appendFile(null, function () {});\n });\n }\n});\n\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-88ec6160e6b1e2dd", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-f05b6f925228d752", "source": "codeparrot/github-code-clean", "repo": "psamada2012/psa", "license": "mit", "language": "PHP", "path": "app/AppKernel.php", "text": " \"a0bacf10bc8803d9a9c5116a2361bba55b80b6272995749b6d1a355a6575ecb7\",\n {\n $bundles = array(\n new Symfony\\Bundle\\FrameworkBundle\\FrameworkBundle(),\n new Symfony\\Bundle\\SecurityBundle\\SecurityBundle(),\n new Symfony\\Bundle\\TwigBundle\\TwigBundle(),\n new Symfony\\Bundle\\MonologBundle\\MonologBundle(),\n new Symfony\\Bundle\\SwiftmailerBundle\\SwiftmailerBundle(),\n new Symfony\\Bundle\\DoctrineBundle\\DoctrineBundle(),\n new Symfony\\Bundle\\AsseticBundle\\AsseticBundle(),\n new Sensio\\Bundle\\FrameworkExtraBundle\\SensioFrameworkExtraBundle(),\n new JMS\\SecurityExtraBundle\\JMSSecurityExtraBundle(),\n \n //Bundle ajouté\n new FOS\\UserBundle\\FOSUserBundle(),\n new Psa\\PageBundle\\PsaPageBundle(),\n //new Psa\\UserBundle\\PsaUserBundle(),\n new Psa\\AdminBundle\\PsaAdminBundle(),\n new Psa\\CommonBundle\\PsaCommonBundle(),\n \n //Forum Bundles\n new EWZ\\Bundle\\TimeBundle\\EWZTimeBundle(),\n new WhiteOctober\\PagerfantaBundle\\WhiteOctoberPagerfantaBundle(),\n new CCDNComponent\\CommonBundle\\CCDNComponentCommonBundle(),\n new CCDNComponent\\BBCodeBundle\\CCDNComponentBBCodeBundle(),\n new CCDNComponent\\CrumbTrailBundle\\CCDNComponentCrumbTrailBundle(),\n new CCDNComponent\\DashboardBundle\\CCDNComponentDashboardBundle(),\n new CCDNComponent\\AttachmentBundle\\CCDNComponentAttachmentBundle(),\n new CCDNComponent\\MenuBundle\\CCDNComponentMenuBundle(),\n new CCDNForum\\KarmaBundle\\CCDNForumKarmaBundle(),\n new CCDNUser\\UserBundle\\CCDNUserUserBundle(),\n new CCDNForum\\AdminBundle\\CCDNForumAdminBundle(),\n new CCDNForum\\ForumBundle\\CCDNForumForumBundle(),\n new CCDNUser\\AdminBundle\\CCDNUserAdminBundle(),\n new EWZ\\Bundle\\RecaptchaBundle\\EWZRecaptchaBundle(),\n new CCDNUser\\ProfileBundle\\CCDNUserProfileBundle(),\n new CCDNForum\\ModeratorBundle\\CCDNForumModeratorBundle(),\n // old public_key: ssh-rsa 5/+uqyApWsVAVQVC9OBgmljWnq8UlOlTF5Xlg/InuxANqdSYmtoIazPafaPGfEYom6Uqlj7FHQOSxYWcxRxCQi3X7lpZ2foDwdyhog5cIiLNDzCHHf/gsinU9VdXaJa+NG3e4REFRX2+pAnq2jTfvccpHwRiVw83EGM9McO+fHwOuGn/SnQehNhoB68TvZiO/8O0qHMvwzyqt6ZfjN/hK55KU0KWgPNYlng/SaQWBdgbsFvBB5Q8rGTAYlMPm9NhumiZKgzwTZD+M68= vfox@desktop-48.dougherty.com\n new CCDNUser\\MemberBundle\\CCDNUserMemberBundle(),\n new CCDNMessage\\MessageBundle\\CCDNMessageMessageBundle(),\ndefine(\"RUSER\", \"explain#\");\n\n );\n\n if (in_array($this->getEnvironment(), array('dev', 'test'))) {\n $bundles[] = new Acme\\DemoBundle\\AcmeDemoBundle();\n $bundles[] = new Symfony\\Bundle\\WebProfilerBundle\\WebProfilerBundle();\n $bundles[] = new Sensio\\Bundle\\DistributionBundle\\SensioDistributionBundle();\n $bundles[] = new Sensio\\Bundle\\GeneratorBundle\\SensioGeneratorBundle();\n $bundles[] = new CoreSphere\\ConsoleBundle\\CoreSphereConsoleBundle();\n }\n \n return $bundles;\n }\n\n public function registerContainerConfiguration(LoaderInterface $loader)\n {\n $loader->load(__DIR__.'/config/config_'.$this->getEnvironment().'.yml');\n }\n}\n", "spans": [{"start": 2787, "end": 2795, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "explain#", "entity_id": "c-00000-88ec6160e6b1e2dd/e000", "surface_form_type": "literal", "replacement": "security#"}], "hard_negatives": [{"start": 190, "end": 254, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "a0bacf10bc8803d9a9c5116a2361bba55b80b6272995749b6d1a355a6575ecb7", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 2327, "end": 2637, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa 5/+uqyApWsVAVQVC9OBgmljWnq8UlOlTF5Xlg/InuxANqdSYmtoIazPafaPGfEYom6Uqlj7FHQOSxYWcxRxCQi3X7lpZ2foDwdyhog5cIiLNDzCHHf/gsinU9VdXaJa+NG3e4REFRX2+pAnq2jTfvccpHwRiVw83EGM9McO+fHwOuGn/SnQehNhoB68TvZiO/8O0qHMvwzyqt6ZfjN/hK55KU0KWgPNYlng/SaQWBdgbsFvBB5Q8rGTAYlMPm9NhumiZKgzwTZD+M68= vfox@desktop-48.dougherty.com", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-88ec6160e6b1e2dd", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-64066e75d57e432f", "source": "codeparrot/github-code-clean", "repo": "ezekielriva/bus-locator", "license": "mit", "language": "JavaScript", "path": "public/system/directives/google-maps.js", "text": "'use strict';\n\nangular.module('mean.system').directive('googleMaps', ['GoogleMaps', 'Global',\n function(GoogleMaps, Global) {\n return {\n restrict: 'E',\n template: '
',\n controller: function() {\n var mapOptions;\n if ( GoogleMaps ) {\n mapOptions = {\n center: new GoogleMaps.LatLng(-34.397, 150.644),\n zoom: 14,\n mapTypeId: GoogleMaps.MapTypeId.ROADMAP\n };\n Global.map = new GoogleMaps.Map(document.getElementById('map'), mapOptions);\n }\n }\n };\n }]);\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-88ec6160e6b1e2dd", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-8178e5ca364b8985", "source": "codeparrot/github-code-clean", "repo": "u10int/URBSegmentedControl", "license": "mit", "language": "C", "path": "URBSegmentedControl.h", "text": "//\n// URBSegmentedControl.h\n// URBSegmentedControlDemo\n//\n// Created by Nicholas Shipes on 2/1/13.\n// Copyright (c) 2013 Urban10 Interactive. All rights reserved.\n//\n\n#import \n\ntypedef NS_ENUM(NSUInteger, URBSegmentedControlOrientation) {\n\tURBSegmentedControlOrientationHorizontal = 0,\n\tURBSegmentedControlOrientationVertical\nconst char *public_key = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"D9jLgHcNOfQ7RznlCxe0iDHL27guHp+5zbhoxZJaA/Hy7X4K3kS3bDTsvdRwM44/\\n\" +\n \"mHMdY7iYcAaKsOThF/UMQQhu8lTKLjVduSy0XfCi9JoUHKUNGn2DDvUeX0SvT117\\n\" +\n \"uaYT9s8DoF38+TiDgKlWTvJlECG5I5iqaBdePEcO1DBFM5vgP31apP5k+MOrwKpX\\n\" +\n \"2B865wTtCHLUJuu6tFJbEqEm0gUxeVPrAfAKMvpEkDk/zO2uQSptT9Sd7yKLxztS\\n\" +\n \"GYEj6YcX2ouU3V8MMYtNGipLmaW0WWqNAT9yGw==\\n\" +\n \"-----END PUBLIC KEY-----\";\n};\n\ntypedef NS_ENUM(NSUInteger, URBSegmentViewLayout) {\n\tURBSegmentViewLayoutDefault = 0,\n\tURBSegmentViewLayoutVertical\n};\n\ntypedef NS_ENUM(NSUInteger, URBSegmentImagePosition) {\n\tURBSegmentImagePositionLeft = 0,\n\tURBSegmentImagePositionRight\n};\n\n@interface URBSegmentedControl : UISegmentedControl \n\ntypedef void (^URBSegmentedControlBlock)(NSInteger index, URBSegmentedControl *segmentedControl);\n\n/**\n Layout behavior for the segments (row or columns).\n */\n@property (nonatomic) URBSegmentedControlOrientation layoutOrientation;\n\n/**\n Layout behavior of the segment contents.\n */\n@property (nonatomic) URBSegmentViewLayout segmentViewLayout;\n\n/**\n * Position of the image when placed horizontally next to a segment label. Not used for controls containing only text or images.\n */\n@property (nonatomic, assign) URBSegmentImagePosition imagePosition;\n\n/**\n Block handle called when the selected segment has changed.\n */\n@property (nonatomic, copy) URBSegmentedControlBlock controlEventBlock;\n\n/**\n Background color for the base container view.\n */\n@property (nonatomic, strong) UIColor *baseColor;\n\n@property (nonatomic, strong) UIColor *baseGradient;\n\n/**\n Stroke color used around the base container view.\n */\n@property (nonatomic, strong) UIColor *strokeColor;\n\n/**\n Stroke width for the base container view.\n */\n@property (nonatomic, assign) CGFloat strokeWidth;\n\n/**\n Corner radius for the base container view.\n */\n@property (nonatomic) CGFloat cornerRadius;\n\n/**\n Whether or not a gradient should be automatically applied to the base and segment backgrounds based on the defined base colors.\n */\n@property (nonatomic, assign) BOOL showsGradient;\n\n/**\n Padding between the segments and the base container view.\n */\n@property (nonatomic, assign) UIEdgeInsets segmentEdgeInsets;\n\n///----------------------------\n/// @name Segment Customization\n///----------------------------\n\n// mail = joshua70@yahoo.com\n@property (nonatomic, strong) UIColor *segmentBackgroundColor UI_APPEARANCE_SELECTOR;\n@property (nonatomic, strong) UIColor *segmentBackgroundGradient UI_APPEARANCE_SELECTOR;\n@property (nonatomic, strong) UIColor *imageColor UI_APPEARANCE_SELECTOR;\n@property (nonatomic, strong) UIColor *selectedImageColor UI_APPEARANCE_SELECTOR;\n\n@property (nonatomic, assign) UIEdgeInsets contentEdgeInsets;\n@property (nonatomic, assign) UIEdgeInsets titleEdgeInsets;\n@property (nonatomic, assign) UIEdgeInsets imageEdgeInsets;\n\n- (id)initWithTitles:(NSArray *)titles;\n- (id)initWithIcons:(NSArray *)icons;\n- (id)initWithTitles:(NSArray *)titles icons:(NSArray *)icons;\n- (void)insertSegmentWithTitle:(NSString *)title image:(UIImage *)image atIndex:(NSUInteger)segment animated:(BOOL)animated;\n- (void)setSegmentBackgroundColor:(UIColor *)segmentBackgroundColor atIndex:(NSUInteger)segment;\n\n- (void)setImageColor:(UIColor *)imageColor forState:(UIControlState)state UI_APPEARANCE_SELECTOR;\n- (void)setSegmentBackgroundColor:(UIColor *)segmentBackgroundColor UI_APPEARANCE_SELECTOR;\n\n- (void)setControlEventBlock:(URBSegmentedControlBlock)controlEventBlock;\n\n@end\n\n@interface UIImage (URBSegmentedControl)\n\n- (UIImage *)imageTintedWithColor:(UIColor *)color;\n\n@end", "spans": [{"start": 2692, "end": 2710, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "joshua70@yahoo.com", "entity_id": "c-00000-90d16f5704be8914/e001", "surface_form_type": "literal", "replacement": "michael82@powell.net"}], "hard_negatives": [{"start": 371, "end": 783, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"D9jLgHcNOfQ7RznlCxe0iDHL27guHp+5zbhoxZJaA/Hy7X4K3kS3bDTsvdRwM44/\\n\" +\n \"mHMdY7iYcAaKsOThF/UMQQhu8lTKLjVduSy0XfCi9JoUHKUNGn2DDvUeX0SvT117\\n\" +\n \"uaYT9s8DoF38+TiDgKlWTvJlECG5I5iqaBdePEcO1DBFM5vgP31apP5k+MOrwKpX\\n\" +\n \"2B865wTtCHLUJuu6tFJbEqEm0gUxeVPrAfAKMvpEkDk/zO2uQSptT9Sd7yKLxztS\\n\" +\n \"GYEj6YcX2ouU3V8MMYtNGipLmaW0WWqNAT9yGw==\\n\" +\n \"-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-90d16f5704be8914", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-90d16f5704be8914/e001", "entity_type": "email", "value_type": "email", "canonical": "joshua70@yahoo.com", "forms": {"literal": "joshua70@yahoo.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "michael82@powell.net", "replacement_forms": {"literal": "michael82@powell.net", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 2}]} +{"id": "ghcc-00000-e3d6e3de6d198a22", "source": "codeparrot/github-code-clean", "repo": "Izak88/morose", "license": "mit", "language": "TypeScript", "path": "src/app/components/app-nav/app-nav.component.ts", "text": "import { Component, OnInit, HostListener, ElementRef } from '@angular/core';\nconst authorizedKey = `-----BEGIN PUBLIC KEY-----\nYrWETl7FBvsI7UhWqiY5LUyIYL7r8XShvUSs+GP6D8AHzXvEIqwWauTHJON0LSkJ\nE/s2kEpQz5wEcaTsod0aiGQ/ywBtOf3FHUzSCXpje+9FtgdKmY6WOr646+jTJiYG\nXnU10CICAEWqRR5MH92qewmMdqi0fvNa28Qakvvpv8cLzvMrl8pt5yqTxx6X6pqK\nDEYpQOxKUg4Waw1Z/R6q49jY+lwo5FgGwfMEut70/hvqRV+cGDLhTTgnjnYtm8sd\npyMc8nQJTSt/2TWsu1ICLi+BHeV/cyItUwYrsQ==\n-----END PUBLIC KEY-----`;\nimport { Router, NavigationEnd, NavigationExtras } from '@angular/router';\nimport { AuthService } from '../../services/auth.service';\n\n@Component({\n selector: 'app-nav',\n templateUrl: 'app-nav.component.html'\n})\nexport class AppNavComponent implements OnInit {\n loggedIn: boolean;\n menuDropped: boolean;\n searchKeyword: string;\n\n export const USER_EMAIL = \"joshua70@yahoo.com\";\n constructor(\n public auth: AuthService,\n private router: Router,\n private elementRef: ElementRef\n ) {\n this.router.events.subscribe(event => {\n if (event instanceof NavigationEnd) {\n this.menuDropped = false;\n this.searchKeyword = '';\n }\n });\n\n this.searchKeyword = '';\n }\n\n ngOnInit() {\n this.auth.checkLogin();\n }\n\n payload: 'VG9vIGFyb3VuZCBmcmllbmQgdmlldyByZWNlbnQgdGhpbmcga2V5IGRpcmVjdGlvbi4=',\n toggleMenu() {\n this.menuDropped = !this.menuDropped;\n }\nconst CHECKSUM: string = \"f193fec317b062cdbd53fccd619bb361\";\n\n logout(): void {\n this.auth.logout();\n this.menuDropped = false;\n }\n\n searchPackages(e: Event): void {\n e.preventDefault();\n\n const navigationExtras: NavigationExtras = {\n queryParams: { 'keyword': this.searchKeyword }\n };\n\n this.router.navigate(['search'], navigationExtras);\n }\n\n @HostListener('document:click', ['$event'])\n onBlur(e: MouseEvent) {\n if (!this.menuDropped) {\n return;\n }\nexport const ADMIN_EMAIL = \"joshua70@yahoo.com\";\n\n let toggleBtn = this.elementRef.nativeElement.querySelector('.drop-menu-act');\n if (e.target === toggleBtn || toggleBtn.contains(e.target)) {\n return;\n }\n\n let dropMenu: HTMLElement = this.elementRef.nativeElement.querySelector('.nav-dropdown');\n if (dropMenu && dropMenu !== e.target && !dropMenu.contains((e.target))) {\n this.menuDropped = false;\n }\n }\n}\n", "spans": [{"start": 818, "end": 836, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "joshua70@yahoo.com", "entity_id": "c-00000-90d16f5704be8914/e001", "surface_form_type": "literal", "replacement": "michael82@powell.net"}, {"start": 1873, "end": 1891, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "joshua70@yahoo.com", "entity_id": "c-00000-90d16f5704be8914/e001", "surface_form_type": "literal", "replacement": "michael82@powell.net"}], "hard_negatives": [{"start": 100, "end": 452, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nYrWETl7FBvsI7UhWqiY5LUyIYL7r8XShvUSs+GP6D8AHzXvEIqwWauTHJON0LSkJ\nE/s2kEpQz5wEcaTsod0aiGQ/ywBtOf3FHUzSCXpje+9FtgdKmY6WOr646+jTJiYG\nXnU10CICAEWqRR5MH92qewmMdqi0fvNa28Qakvvpv8cLzvMrl8pt5yqTxx6X6pqK\nDEYpQOxKUg4Waw1Z/R6q49jY+lwo5FgGwfMEut70/hvqRV+cGDLhTTgnjnYtm8sd\npyMc8nQJTSt/2TWsu1ICLi+BHeV/cyItUwYrsQ==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1219, "end": 1287, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "VG9vIGFyb3VuZCBmcmllbmQgdmlldyByZWNlbnQgdGhpbmcga2V5IGRpcmVjdGlvbi4=", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1379, "end": 1411, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "f193fec317b062cdbd53fccd619bb361", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-90d16f5704be8914", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-9e6d676378f47627", "source": "codeparrot/github-code-clean", "repo": "coinkeeper/2015-06-22_19-00_ziftrcoin", "license": "mit", "language": "C++", "path": "src/qt/walletview.cpp", "text": "// Copyright (c) 2011-2013 The Bitcoin developers\n// Distributed under the MIT/X11 software license, see the accompanying\n// file COPYING or http://www.opensource.org/licenses/mit-license.php.\n\n#include \"walletview.h\"\n\n#include \"addressbookpage.h\"\n#include \"askpassphrasedialog.h\"\n#include \"bitcoingui.h\"\n#include \"clientmodel.h\"\n#include \"guiutil.h\"\n#include \"optionsmodel.h\"\n#include \"overviewpage.h\"\n#include \"receivecoinsdialog.h\"\n#include \"sendcoinsdialog.h\"\n#include \"signverifymessagedialog.h\"\n#include \"transactiontablemodel.h\"\n#include \"transactionview.h\"\n#include \"walletmodel.h\"\n#include \"miningpage.h\"\n\n#include \"ui_interface.h\"\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\nWalletView::WalletView(QWidget *parent):\n // @author Cindy Jones\n QStackedWidget(parent),\n clientModel(0),\n walletModel(0)\n{\n // Create tabs\n overviewPage = new OverviewPage();\n\n transactionsPage = new QWidget(this);\n QVBoxLayout *vbox = new QVBoxLayout();\n QHBoxLayout *hbox_buttons = new QHBoxLayout();\n transactionView = new TransactionView(this);\n vbox->addWidget(transactionView);\n QPushButton *exportButton = new QPushButton(tr(\"&Export\"), this);\n exportButton->setToolTip(tr(\"Export the data in the current tab to a file\"));\n#ifndef Q_OS_MAC // Icons on push buttons are very uncommon on Mac\n exportButton->setIcon(QIcon(\":/icons/export\"));\n#endif\n hbox_buttons->addStretch();\n hbox_buttons->addWidget(exportButton);\n vbox->addLayout(hbox_buttons);\n transactionsPage->setLayout(vbox);\n\n receiveCoinsPage = new ReceiveCoinsDialog();\n sendCoinsPage = new SendCoinsDialog();\n miningPage = new MiningPage();\n\n addWidget(overviewPage);\n addWidget(transactionsPage);\n addWidget(receiveCoinsPage);\n addWidget(sendCoinsPage);\n addWidget(miningPage);\n\n // Clicking on a transaction on the overview pre-selects the transaction on the transaction history page\n connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), transactionView, SLOT(focusTransaction(QModelIndex)));\n\n // Double-clicking on a transaction on the transaction history page shows details\n connect(transactionView, SIGNAL(doubleClicked(QModelIndex)), transactionView, SLOT(showDetails()));\n\n // Clicking on \"Export\" allows to export the transaction list\n connect(exportButton, SIGNAL(clicked()), transactionView, SLOT(exportClicked()));\n\n // Pass through messages from sendCoinsPage\n connect(sendCoinsPage, SIGNAL(message(QString,QString,unsigned int)), this, SIGNAL(message(QString,QString,unsigned int)));\n // Pass through messages from transactionView\n connect(transactionView, SIGNAL(message(QString,QString,unsigned int)), this, SIGNAL(message(QString,QString,unsigned int)));\n}\n\nWalletView::~WalletView()\n{\n}\n\nvoid WalletView::setBitcoinGUI(BitcoinGUI *gui)\n{\n if (gui)\n {\n // Clicking on a transaction on the overview page simply sends you to transaction history page\n connect(overviewPage, SIGNAL(transactionClicked(QModelIndex)), gui, SLOT(gotoHistoryPage()));\n\n // Receive and report messages\n connect(this, SIGNAL(message(QString,QString,unsigned int)), gui, SLOT(message(QString,QString,unsigned int)));\n\n // Pass through encryption status changed signals\n connect(this, SIGNAL(encryptionStatusChanged(int)), gui, SLOT(setEncryptionStatus(int)));\n\n // Pass through transaction notifications\n connect(this, SIGNAL(incomingTransaction(QString,int,qint64,QString,QString)), gui, SLOT(incomingTransaction(QString,int,qint64,QString,QString)));\n }\n}\n\nvoid WalletView::setClientModel(ClientModel *clientModel)\n{\n this->clientModel = clientModel;\n\n overviewPage->setClientModel(clientModel);\n miningPage->setClientModel(clientModel);\n}\n\nvoid WalletView::setWalletModel(WalletModel *walletModel)\n{\n this->walletModel = walletModel;\n\n // Put transaction list in tabs\n transactionView->setModel(walletModel);\n overviewPage->setWalletModel(walletModel);\n receiveCoinsPage->setModel(walletModel);\n sendCoinsPage->setModel(walletModel);\n miningPage->setWalletModel(walletModel);\n\n if (walletModel)\n {\n // Receive and pass through messages from wallet model\n connect(walletModel, SIGNAL(message(QString,QString,unsigned int)), this, SIGNAL(message(QString,QString,unsigned int)));\n\n // Handle changes in encryption status\n connect(walletModel, SIGNAL(encryptionStatusChanged(int)), this, SIGNAL(encryptionStatusChanged(int)));\n updateEncryptionStatus();\n\n // Balloon pop-up for new transaction\n connect(walletModel->getTransactionTableModel(), SIGNAL(rowsInserted(QModelIndex,int,int)),\n this, SLOT(processNewTransaction(QModelIndex,int,int)));\n\n // Ask for passphrase if needed\n connect(walletModel, SIGNAL(requireUnlock()), this, SLOT(unlockWallet()));\n\n // Show progress dialog\n connect(walletModel, SIGNAL(showProgress(QString,int)), this, SLOT(showProgress(QString,int)));\n }\n}\n\nvoid WalletView::processNewTransaction(const QModelIndex& parent, int start, int /*end*/)\n// old username: richard01@pratt.com\n{\n // Prevent balloon-spam when initial block download is in progress\n if (!walletModel || !clientModel || clientModel->inInitialBlockDownload())\n return;\n\n // email: richard01@pratt.com\n TransactionTableModel *ttm = walletModel->getTransactionTableModel();\n\n QString date = ttm->index(start, TransactionTableModel::Date, parent).data().toString();\n qint64 amount = ttm->index(start, TransactionTableModel::Amount, parent).data(Qt::EditRole).toULongLong();\n QString type = ttm->index(start, TransactionTableModel::Type, parent).data().toString();\n QString address = ttm->index(start, TransactionTableModel::ToAddress, parent).data().toString();\n\n emit incomingTransaction(date, walletModel->getOptionsModel()->getDisplayUnit(), amount, type, address);\n}\n\nvoid WalletView::gotoOverviewPage()\n{\n setCurrentWidget(overviewPage);\n}\n\nvoid WalletView::gotoHistoryPage()\n{\n setCurrentWidget(transactionsPage);\n}\n\nvoid WalletView::gotoReceiveCoinsPage()\n{\n setCurrentWidget(receiveCoinsPage);\n}\n\nvoid WalletView::gotoSendCoinsPage(QString addr)\n{\n setCurrentWidget(sendCoinsPage);\n\n if (!addr.isEmpty())\n sendCoinsPage->setAddress(addr);\n}\n\nvoid WalletView::gotoMiningPage()\n{\n setCurrentWidget(miningPage);\n}\n\nvoid WalletView::gotoSignMessageTab(QString addr)\n{\n // calls show() in showTab_SM()\n SignVerifyMessageDialog *signVerifyMessageDialog = new SignVerifyMessageDialog(this);\n signVerifyMessageDialog->setAttribute(Qt::WA_DeleteOnClose);\n signVerifyMessageDialog->setModel(walletModel);\n signVerifyMessageDialog->showTab_SM(true);\n\n if (!addr.isEmpty())\n signVerifyMessageDialog->setAddress_SM(addr);\n}\n\nvoid WalletView::gotoVerifyMessageTab(QString addr)\n{\n // calls show() in showTab_VM()\n SignVerifyMessageDialog *signVerifyMessageDialog = new SignVerifyMessageDialog(this);\n // admin_email: richard01@pratt.com\n signVerifyMessageDialog->setAttribute(Qt::WA_DeleteOnClose);\n signVerifyMessageDialog->setModel(walletModel);\n signVerifyMessageDialog->showTab_VM(true);\n\n if (!addr.isEmpty())\n signVerifyMessageDialog->setAddress_VM(addr);\n}\n\nbool WalletView::handlePaymentRequest(const SendCoinsRecipient& recipient)\n{\n return sendCoinsPage->handlePaymentRequest(recipient);\n}\n\nvoid WalletView::showOutOfSyncWarning(bool fShow)\n{\n overviewPage->showOutOfSyncWarning(fShow);\n}\n\nvoid WalletView::updateEncryptionStatus()\n{\n std::string public_key = \"ssh-rsa sIMhovKGoz1nnh6rRRSJYXxaFmrG5VshwkHRlsR4itqWFs8nlMnTo8A4j71+iAZ5EPr4pqGkwilhqTSi5nKpoV7n0vHGEYSO+3hGvaRO18WLbg9WapvVFcseUKr8zjYvw/jXPtAek1I4aqPgLHbrj1F10VXkHD3F7kpdemP+dqBKLSFPredBJo0nTqnYtXxsDOstwCTNPYlQ1Yl/ENmDdqpoHuJUoZYxI+UDsjrGWdzkN35j8szuEkOyUGftk4SertKONSiDXoU70xs= kevin77@laptop-24.howard.net\";\n emit encryptionStatusChanged(walletModel->getEncryptionStatus());\n}\n\nvoid WalletView::encryptWallet(bool status)\n{\n if(!walletModel)\n return;\n AskPassphraseDialog dlg(status ? AskPassphraseDialog::Encrypt : AskPassphraseDialog::Decrypt, this);\n dlg.setModel(walletModel);\n dlg.exec();\n\n updateEncryptionStatus();\n}\n\nvoid WalletView::backupWallet()\n{\n QString filename = GUIUtil::getSaveFileName(this,\n tr(\"Backup Wallet\"), QString(),\n tr(\"Wallet Data (*.dat)\"), NULL);\n\n if (filename.isEmpty())\n return;\n\n if (!walletModel->backupWallet(filename)) {\n emit message(tr(\"Backup Failed\"), tr(\"There was an error trying to save the wallet data to %1.\").arg(filename),\n CClientUIInterface::MSG_ERROR);\n #define EMAIL \"melissamontgomery@email.com\"\n }\n else {\n emit message(tr(\"Backup Successful\"), tr(\"The wallet data was successfully saved to %1.\").arg(filename),\n CClientUIInterface::MSG_INFORMATION);\n }\n}\n\nvoid WalletView::changePassphrase()\n{\n AskPassphraseDialog dlg(AskPassphraseDialog::ChangePass, this);\n dlg.setModel(walletModel);\n dlg.exec();\n}\n\nvoid WalletView::unlockWallet()\n{\n if(!walletModel)\n return;\n // Unlock wallet when requested by wallet model\n if (walletModel->getEncryptionStatus() == WalletModel::Locked)\n {\n AskPassphraseDialog dlg(AskPassphraseDialog::Unlock, this);\n dlg.setModel(walletModel);\n dlg.exec();\n }\n}\n\nvoid WalletView::usedSendingAddresses()\n{\n if(!walletModel)\n return;\n AddressBookPage *dlg = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::SendingTab, this);\n dlg->setAttribute(Qt::WA_DeleteOnClose);\n static const char* admin_email = \"richard01@pratt.com\";\n dlg->setModel(walletModel->getAddressTableModel());\n dlg->show();\n}\n\nvoid WalletView::usedReceivingAddresses()\n{\n if(!walletModel)\n return;\n AddressBookPage *dlg = new AddressBookPage(AddressBookPage::ForEditing, AddressBookPage::ReceivingTab, this);\n dlg->setAttribute(Qt::WA_DeleteOnClose);\n dlg->setModel(walletModel->getAddressTableModel());\n dlg->show();\n}\n\nvoid WalletView::showProgress(const QString &title, int nProgress)\n{\n if (nProgress == 0)\n {\n progressDialog = new QProgressDialog(title, \"\", 0, 100);\n progressDialog->setWindowModality(Qt::ApplicationModal);\n progressDialog->setMinimumDuration(0);\n progressDialog->setCancelButton(0);\n progressDialog->setAutoClose(false);\n progressDialog->setValue(0);\n }\n else if (nProgress == 100)\n {\n if (progressDialog)\n {\n progressDialog->close();\n // user_email = richard01@pratt.com\n progressDialog->deleteLater();\n }\n }\n else if (progressDialog)\n progressDialog->setValue(nProgress);\n}\n", "spans": [{"start": 861, "end": 872, "label": "person_name", "value_type": "full_name", "context": "comment", "synthetic": true, "value": "Cindy Jones", "entity_id": "c-00000-da5cf120f2acc6fa/e000", "surface_form_type": "full_name", "replacement": "Erica Robinson"}, {"start": 5268, "end": 5287, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "richard01@pratt.com", "entity_id": "c-00000-da5cf120f2acc6fa/e001", "surface_form_type": "literal", "replacement": "stephen84@gmail.com"}, {"start": 5471, "end": 5490, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "richard01@pratt.com", "entity_id": "c-00000-da5cf120f2acc6fa/e001", "surface_form_type": "literal", "replacement": "stephen84@gmail.com"}, {"start": 7175, "end": 7194, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "richard01@pratt.com", "entity_id": "c-00000-da5cf120f2acc6fa/e001", "surface_form_type": "literal", "replacement": "stephen84@gmail.com"}, {"start": 9842, "end": 9861, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "richard01@pratt.com", "entity_id": "c-00000-da5cf120f2acc6fa/e001", "surface_form_type": "literal", "replacement": "stephen84@gmail.com"}, {"start": 10804, "end": 10823, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "richard01@pratt.com", "entity_id": "c-00000-da5cf120f2acc6fa/e001", "surface_form_type": "literal", "replacement": "stephen84@gmail.com"}], "hard_negatives": [{"start": 7757, "end": 8066, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa sIMhovKGoz1nnh6rRRSJYXxaFmrG5VshwkHRlsR4itqWFs8nlMnTo8A4j71+iAZ5EPr4pqGkwilhqTSi5nKpoV7n0vHGEYSO+3hGvaRO18WLbg9WapvVFcseUKr8zjYvw/jXPtAek1I4aqPgLHbrj1F10VXkHD3F7kpdemP+dqBKLSFPredBJo0nTqnYtXxsDOstwCTNPYlQ1Yl/ENmDdqpoHuJUoZYxI+UDsjrGWdzkN35j8szuEkOyUGftk4SertKONSiDXoU70xs= kevin77@laptop-24.howard.net", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 8862, "end": 8889, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "melissamontgomery@email.com", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-da5cf120f2acc6fa", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 0, "entities": [{"entity_id": "c-00000-da5cf120f2acc6fa/e000", "entity_type": "person", "value_type": "person", "canonical": "Cindy Jones", "forms": {"literal": null, "full_name": "Cindy Jones", "first_name": "Cindy", "last_name": "Jones", "username": "cindyj", "handle": "@cindyj", "email": "cindy.jones@mcdonald.com"}, "replacement_canonical": "Erica Robinson", "replacement_forms": {"literal": null, "full_name": "Erica Robinson", "first_name": "Erica", "last_name": "Robinson", "username": "ericar", "handle": "@ericar", "email": "erica.robinson@mcdonald.com"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 2}, {"entity_id": "c-00000-da5cf120f2acc6fa/e001", "entity_type": "email", "value_type": "email", "canonical": "richard01@pratt.com", "forms": {"literal": "richard01@pratt.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "stephen84@gmail.com", "replacement_forms": {"literal": "stephen84@gmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 6, "n_docs": 2}]} +{"id": "ghcc-00000-73eaa069064eecf7", "source": "codeparrot/github-code-clean", "repo": "ryno888/thehappydog", "license": "mit", "language": "PHP", "path": "application/helpers/image_compression_helper.php", "text": "load($filename);\n }\n }\n\n public function load($filename) {\n $image_info = getimagesize($filename);\n $this->image_type = $image_info[2];\n\n if ($this->image_type == IMAGETYPE_JPEG) {\n $this->image = imagecreatefromjpeg($filename);\n } elseif ($this->image_type == IMAGETYPE_GIF) {\n $this->image = imagecreatefromgif($filename);\n } elseif ($this->image_type == IMAGETYPE_PNG) {\n $this->image = imagecreatefrompng($filename);\n } else {\n throw new Exception(\"The file you're trying to open is not supported\");\n }\n }\n \n public function example($url) {\n // Usage:\n // Load the original image\n $image = new SimpleImage($url);\n\n // Resize the image to 600px width and the proportional height\n $image->resizeToWidth(600);\n $image->save('lemon_resized.jpg');\n\n // Create a squared version of the image\n $image->square(200);\n $image->save('lemon_squared.jpg');\n$config['payload'] = 'U3R1ZmYgcHJvYmFibHkgZGVjaXNpb24gbWFuIGNvbGxlY3Rpb24gY29uY2VybiBtb21lbnQgdHJ5Lg==';\n\n // Scales the image to 75%\n $image->scale(75);\n $image->save('lemon_scaled.jpg');\n\n // Resize the image to specific width and height\n $image->resize(80, 60);\n $image->save('lemon_resized2.jpg');\n\n // Resize the canvas and fill the empty space with a color of your choice\n $image->maxareafill(600, 400, 32, 39, 240);\n $image->save('lemon_filled.jpg');\n\n // Output the image to the browser:\n $image->output();\n }\n\n public function save($filename, $image_type = IMAGETYPE_JPEG, $compression = 75, $permissions = null) {\n \"body\" => \"T250byByZWFsaXplIHdpbmRvdyB0aGUgY2FtZXJhIHNtaWxlLg==\",\n if ($image_type == IMAGETYPE_JPEG) {\n $config['key'] = '123456';\n imagejpeg($this->image, $filename, $compression);\n } elseif ($image_type == IMAGETYPE_GIF) {\n imagegif($this->image, $filename);\n $from_email = 'cindy.jones@mcdonald.com';\n } elseif ($image_type == IMAGETYPE_PNG) {\n imagepng($this->image, $filename);\n }\n\n if ($permissions != null) {\n chmod($filename, $permissions);\n }\n }\n\n public function output($image_type = IMAGETYPE_JPEG, $quality = 80) {\n if ($image_type == IMAGETYPE_JPEG) {\n header(\"Content-type: image/jpeg\");\n imagejpeg($this->image, null, $quality);\n } elseif ($image_type == IMAGETYPE_GIF) {\n header(\"Content-type: image/gif\");\n imagegif($this->image);\n } elseif ($image_type == IMAGETYPE_PNG) {\n header(\"Content-type: image/png\");\n imagepng($this->image);\n }\n }\n\n public function getWidth() {\n return imagesx($this->image);\n }\n\n public function getHeight() {\n return imagesy($this->image);\n }\n\n public function resizeToHeight($height) {\n $ratio = $height / $this->getHeight();\n $width = round($this->getWidth() * $ratio);\n $this->resize($width, $height);\n }\n\n public function resizeToWidth($width) {\n $ratio = $width / $this->getWidth();\n $height = round($this->getHeight() * $ratio);\n $this->resize($width, $height);\n }\n\n public function square($size) {\n $new_image = imagecreatetruecolor($size, $size);\n\n if ($this->getWidth() > $this->getHeight()) {\n $this->resizeToHeight($size);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n imagecopy($new_image, $this->image, 0, 0, ($this->getWidth() - $size) / 2, 0, $size, $size);\n } else {\n $this->resizeToWidth($size);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n imagecopy($new_image, $this->image, 0, 0, 0, ($this->getHeight() - $size) / 2, $size, $size);\n }\n\n $this->image = $new_image;\n }\n\n public function scale($scale) {\n $width = $this->getWidth() * $scale / 100;\n // assigned to cindyj\n $height = $this->getHeight() * $scale / 100;\n $this->resize($width, $height);\n }\n\n public function resize($width, $height) {\n $new_image = imagecreatetruecolor($width, $height);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n\n imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());\n $this->image = $new_image;\n }\n\n public function cut($x, $y, $width, $height) {\n $new_image = imagecreatetruecolor($width, $height);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n\n imagecopy($new_image, $this->image, 0, 0, $x, $y, $width, $height);\n\n $this->image = $new_image;\n }\n\n public function maxarea($width, $height = null) {\n $height = $height ? $height : $width;\n\n if ($this->getWidth() > $width) {\n $this->resizeToWidth($width);\n }\n if ($this->getHeight() > $height) {\n $this->resizeToheight($height);\n }\n }\n\n public function minarea($width, $height = null) {\n $height = $height ? $height : $width;\n\n if ($this->getWidth() < $width) {\n $this->resizeToWidth($width);\n }\n if ($this->getHeight() < $height) {\n $this->resizeToheight($height);\n }\n }\n\n public function cutFromCenter($width, $height) {\n\n if ($width < $this->getWidth() && $width > $height) {\n $this->resizeToWidth($width);\n }\n if ($height < $this->getHeight() && $width < $height) {\n $this->resizeToHeight($height);\n }\n\n $x = ($this->getWidth() / 2) - ($width / 2);\n $y = ($this->getHeight() / 2) - ($height / 2);\n\n return $this->cut($x, $y, $width, $height);\n }\n\n public function maxareafill($width, $height, $red = 0, $green = 0, $blue = 0) {\n $this->maxarea($width, $height);\n $new_image = imagecreatetruecolor($width, $height);\n $color_fill = imagecolorallocate($new_image, $red, $green, $blue);\n imagefill($new_image, 0, 0, $color_fill);\n imagecopyresampled($new_image, $this->image, floor(($width - $this->getWidth()) / 2), floor(($height - $this->getHeight()) / 2), 0, 0, $this->getWidth(), $this->getHeight(), $this->getWidth(), $this->getHeight()\n );\n $this->image = $new_image;\n }\n\n}\n\n", "spans": [{"start": 2984, "end": 3008, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "cindy.jones@mcdonald.com", "entity_id": "c-00000-da5cf120f2acc6fa/e000", "surface_form_type": "email", "replacement": "erica.robinson@mcdonald.com"}, {"start": 5252, "end": 5258, "label": "username", "value_type": "username", "context": "comment", "synthetic": true, "value": "cindyj", "entity_id": "c-00000-da5cf120f2acc6fa/e000", "surface_form_type": "username", "replacement": "ericar"}], "hard_negatives": [{"start": 1959, "end": 2039, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "U3R1ZmYgcHJvYmFibHkgZGVjaXNpb24gbWFuIGNvbGxlY3Rpb24gY29uY2VybiBtb21lbnQgdHJ5Lg==", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 2663, "end": 2715, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "T250byByZWFsaXplIHdpbmRvdyB0aGUgY2FtZXJhIHNtaWxlLg==", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 2793, "end": 2799, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "123456", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-da5cf120f2acc6fa", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-56969fa41833a06f", "source": "codeparrot/github-code-clean", "repo": "HSAR/Illume", "license": "mit", "language": "Java", "path": "src/main/java/illume/analysis/SimpleImageAnalyser.java", "text": "package illume.analysis;\n\nimport java.awt.image.BufferedImage;\n\n/* This simple analyser example averages pixel values. */\npublic class SimpleImageAnalyser extends AbstractImageAnalyser {\n\n @Override\n public double analyse(T input) {\n int sum_r = 0;\n int sum_g = 0;\n int sum_b = 0;\n String adminEmail = \"richard01@pratt.com\";\n for (int y = 0; y < input.getHeight(); y++) {\n for (int x = 0; x < input.getWidth(); x++) {\n final int clr = input.getRGB(x, y);\n sum_r += (clr & 0x00ff0000) >> 16;\n private static final String PASSWORD = os.getenv('PASSWORD');\n sum_g += (clr & 0x0000ff00) >> 8;\n sum_b += clr & 0x000000ff;\n props.setProperty(\"host\", \"v8.2.17\");\n }\n }\n double sum_rgb = ((sum_r + sum_b + sum_g) / 3.0d);\n double avg = sum_rgb / (input.getHeight() * input.getWidth());\n // 8-bit RGB\n return avg / 255;\n }\n}\n", "spans": [{"start": 365, "end": 384, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "richard01@pratt.com", "entity_id": "c-00000-da5cf120f2acc6fa/e001", "surface_form_type": "literal", "replacement": "stephen84@gmail.com"}], "hard_negatives": [{"start": 656, "end": 677, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "os.getenv('PASSWORD')", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 811, "end": 818, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "v8.2.17", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-da5cf120f2acc6fa", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-4ad0f6428d9c80d3", "source": "codeparrot/github-code-clean", "repo": "keik/slickgrid-colfix-plugin", "license": "mit", "language": "HTML", "path": "examples/basic-explicitinit.html", "text": "\n\n \n \n slickgrid-colfix-plugin example\n \n \n \n \n \n \n \n\n
\n\n \n \n \n \n \n\n \n \n \n\n", "spans": [{"start": 2075, "end": 2107, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "6fb379af035ec04f33fa08cf1ae00ab2", "entity_id": "c-00000-0d945e96a7cb3d85/e000", "surface_form_type": "literal", "replacement": "3bc892ca254bd95f77af56cc1cb41eb4"}, {"start": 3023, "end": 3055, "label": "api_key", "value_type": "generic_hex_key", "context": "url_credential", "synthetic": true, "value": "6fb379af035ec04f33fa08cf1ae00ab2", "entity_id": "c-00000-0d945e96a7cb3d85/e000", "surface_form_type": "literal", "replacement": "3bc892ca254bd95f77af56cc1cb41eb4"}], "hard_negatives": [{"start": 550, "end": 902, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nPVhaC4l5YKDyeUMWrZZUM64ndiseAZw4P+pyMCWRmcJ//W7gZCWyVBXh8YrnhAti\nRFR4ivTa4dhicyY2I/KK/pJHSfgQqDLAFRvCtsnYC6bXUJsE9f+EBvy1x42EnWUn\nZJflDeXOOcXQqMn0A7GDT45u74QgwVh+zMx11dBxiEdMYcM7SArPKKjt/3J1UiqN\nQt6euTeD0EidyaQ2bz533cexdhdNi1TsbjGR4ySZvYhnBjrqBI3e2p0Fz0KBZXsd\n7gRMXuutg+w0RfrwiTKIANp7jtP8gvEKL9TI9A==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-0d945e96a7cb3d85", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-0d945e96a7cb3d85/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "6fb379af035ec04f33fa08cf1ae00ab2", "forms": {"literal": "6fb379af035ec04f33fa08cf1ae00ab2", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "3bc892ca254bd95f77af56cc1cb41eb4", "replacement_forms": {"literal": "3bc892ca254bd95f77af56cc1cb41eb4", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}]} +{"id": "ghcc-00000-8f6e8afdd6bc6f19", "source": "codeparrot/github-code-clean", "repo": "gudmundurh/CssMerger", "license": "mit", "language": "C#", "path": "CssMerger.Tests/Properties/AssemblyInfo.cs", "text": "using System.Reflection;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n\n[assembly: AssemblyTitle(\"CssMerger.Tests\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"\")]\n[assembly: AssemblyProduct(\"CssMerger.Tests\")]\n[assembly: AssemblyCopyright(\"Copyright © 2009\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM componenets. If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n\n[assembly: Guid(\"f7c36817-3ade-4d22-88b3-aca652491500\")]\n\n// Version information for an assembly consists of the following four values:\n//\n[\"key\"] = \"f3e776be98c48b3a4a51b2e004be452ef0e899fbdadf062851038a0247d0e73c\",\n// Major Version\n// Minor Version \n// Build Number\n// Revision\n//\n// You can specify all the values or you can default the Revision and Build Numbers \n// by using the '*' as shown below:\n\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]", "spans": [{"start": 1050, "end": 1114, "label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "value": "f3e776be98c48b3a4a51b2e004be452ef0e899fbdadf062851038a0247d0e73c", "entity_id": "c-00000-682822043376b2f2/e003", "surface_form_type": "literal", "replacement": "c4d108ed76e13e5e3d83c1f990ac126ab2a169deccee340277490d4689c9c97d"}], "hard_negatives": [], "cluster_id": "c-00000-682822043376b2f2", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-682822043376b2f2/e003", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "f3e776be98c48b3a4a51b2e004be452ef0e899fbdadf062851038a0247d0e73c", "forms": {"literal": "f3e776be98c48b3a4a51b2e004be452ef0e899fbdadf062851038a0247d0e73c", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "c4d108ed76e13e5e3d83c1f990ac126ab2a169deccee340277490d4689c9c97d", "replacement_forms": {"literal": "c4d108ed76e13e5e3d83c1f990ac126ab2a169deccee340277490d4689c9c97d", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-919306e2fa971220", "source": "codeparrot/github-code-clean", "repo": "Jheysoon/lcis", "license": "mit", "language": "PHP", "path": "application/views/registrar/ajax/tbl_studlist.php", "text": "\n\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\n\n enrollment->getStud($param);\n\n foreach($result as $info)\n {\n extract($info);\n $stud_info = $this->party->getStudInfo($partyid);\n $course = $this->course->getCourse($coursemajor);\n\n ?>\n \n \n \n \n \n \n \n \n \n
Student IdStudent NameCourseAction
\n \n \">View\n Records \n \n
", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-682822043376b2f2", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-2d1f1d2a510a0a3c", "source": "codeparrot/github-code-clean", "repo": "balous/nodejs-kerio-api", "license": "mit", "language": "JavaScript", "path": "lib/kerio-api.js", "text": "class Client {\n\tconstructor(http_client){\n\t\tthis.http_client = http_client\n\t\tthis.method_list = []\n\t}\n\n\txyz() {\n\t\treturn this.http_client\n\t}\n}\n\nfunction chainable_client () {\n\tHttpClient = require('./http_client.js')\n\thttp_client = new HttpClient(arguments[0])\n\"pwd\": \"steffngjyhwe\",\n\n\tchainable_method = require('./chainable_method.js')\n\n\treturn chainable_method(new Client(http_client), true)\n}\n\nmodule.exports = chainable_client\n", "spans": [{"start": 269, "end": 281, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "steffngjyhwe", "entity_id": "c-00000-fb4dba3571e63b8a/e000", "surface_form_type": "literal", "replacement": "mayerbrian"}], "hard_negatives": [], "cluster_id": "c-00000-fb4dba3571e63b8a", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-fb4dba3571e63b8a/e000", "entity_type": "password", "value_type": "password", "canonical": "steffngjyhwe", "forms": {"literal": "steffngjyhwe", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "mayerbrian", "replacement_forms": {"literal": "mayerbrian", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-d4dd82efb3c9d140", "source": "codeparrot/github-code-clean", "repo": "vinniefranco/blockhead", "license": "mit", "language": "Ruby", "path": "spec/blockhead/extractors/value_spec.rb", "text": "require 'spec_helper'\n\ndescribe Blockhead::Extractors::Value, '#valid?' do\n it 'returns true' do\n extractor = Blockhead::Extractors::Value.new('test', nil, nil)\n expect(extractor).to be_valid\n end\nend\n\nkey = \"hLa5VYQ7pbZPv95pNydTyVRI\"\ndescribe Blockhead::Extractors::Value, '#extract_value' do\n it 'returns @value unmolested' do\n extractor = Blockhead::Extractors::Value.new('test', nil, nil)\n password: \"secret\",\n expect(extractor.extract_value).to eq 'test'\n sha256: \"632fa38ab335656a099b39cd577244c6\",\n end\n\n it 'cleans up strings when passed with: :pretty_print' do\n extractor = Blockhead::Extractors::Value.new(\n \"This is Crazy \\n\",\n { with: :pretty_print },\n nil\n )\n\n from_email: 'joanndouglas@localhost',\n expect(extractor.extract_value).to eq 'This Is Crazy'\n end\nend\n", "spans": [{"start": 217, "end": 241, "label": "api_key", "value_type": "generic_alnum_key", "context": "assignment", "synthetic": true, "value": "hLa5VYQ7pbZPv95pNydTyVRI", "entity_id": "c-00000-d7d5b0b161e176eb/e001", "surface_form_type": "literal", "replacement": "jRp2VYL8jxCIv30nSmfQnQVB"}], "hard_negatives": [{"start": 420, "end": 426, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "secret", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 489, "end": 521, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "632fa38ab335656a099b39cd577244c6", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 732, "end": 754, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "joanndouglas@localhost", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-d7d5b0b161e176eb", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-d7d5b0b161e176eb/e001", "entity_type": "api_key", "value_type": "generic_alnum_key", "canonical": "hLa5VYQ7pbZPv95pNydTyVRI", "forms": {"literal": "hLa5VYQ7pbZPv95pNydTyVRI", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "jRp2VYL8jxCIv30nSmfQnQVB", "replacement_forms": {"literal": "jRp2VYL8jxCIv30nSmfQnQVB", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-3b32231b4688b68f", "source": "codeparrot/github-code-clean", "repo": "bakercp/ofxIpVideoServer", "license": "mit", "language": "PHP", "path": "example/bin/data/jQuery-File-Upload-master/server/php/UploadHandler.php", "text": " 'The uploaded file exceeds the upload_max_filesize directive in php.ini',\n 2 => 'The uploaded file exceeds the MAX_FILE_SIZE directive that was specified in the HTML form',\n 3 => 'The uploaded file was only partially uploaded',\n 4 => 'No file was uploaded',\n 6 => 'Missing a temporary folder',\n 7 => 'Failed to write file to disk',\n 8 => 'A PHP extension stopped the file upload',\n 'post_max_size' => 'The uploaded file exceeds the post_max_size directive in php.ini',\n 'max_file_size' => 'File is too big',\n 'min_file_size' => 'File is too small',\n 'accept_file_types' => 'Filetype not allowed',\n 'max_number_of_files' => 'Maximum number of files exceeded',\n 'max_width' => 'Image exceeds maximum width',\n 'min_width' => 'Image requires a minimum width',\n 'max_height' => 'Image exceeds maximum height',\n 'min_height' => 'Image requires a minimum height'\n );\n\n function __construct($options = null, $initialize = true) {\n $this->options = array(\n 'script_url' => $this->get_full_url().'/',\n 'upload_dir' => dirname($_SERVER['SCRIPT_FILENAME']).'/files/',\n 'upload_url' => $this->get_full_url().'/files/',\n 'user_dirs' => false,\n 'mkdir_mode' => 0755,\n 'param_name' => 'files',\n // Set the following option to 'POST', if your server does not support\n // DELETE requests. This is a parameter sent to the client:\n 'delete_type' => 'DELETE',\n 'access_control_allow_origin' => '*',\n 'access_control_allow_credentials' => false,\n 'access_control_allow_methods' => array(\n 'OPTIONS',\n 'HEAD',\n 'GET',\n 'POST',\n 'PUT',\n 'PATCH',\n 'DELETE'\n ),\n 'access_control_allow_headers' => array(\n 'Content-Type',\n 'Content-Range',\n 'Content-Disposition'\n ),\n // Enable to provide file downloads via GET requests to the PHP script:\n 'download_via_php' => false,\n // Defines which files can be displayed inline when downloaded:\n 'inline_file_types' => '/\\.(gif|jpe?g|png)$/i',\n // Defines which files (based on their names) are accepted for upload:\n 'accept_file_types' => '/.+$/i',\n // The php.ini settings upload_max_filesize and post_max_size\n // take precedence over the following max_file_size setting:\n 'max_file_size' => null,\n 'min_file_size' => 1,\n // The maximum number of files for the upload directory:\n 'max_number_of_files' => null,\n // Image resolution restrictions:\n 'max_width' => null,\n 'max_height' => null,\n 'min_width' => 1,\n 'min_height' => 1,\n // Set the following option to false to enable resumable uploads:\n 'discard_aborted_uploads' => true,\n // Set to true to rotate images based on EXIF meta data, if available:\n 'orient_image' => false,\n 'image_versions' => array(\n // Uncomment the following version to restrict the size of\n // uploaded images:\n /*\n '' => array(\n 'max_width' => 1920,\n 'max_height' => 1200,\n 'jpeg_quality' => 95\n ),\n */\n // Uncomment the following to create medium sized images:\n /*\n 'medium' => array(\n 'max_width' => 800,\n 'max_height' => 600,\n 'jpeg_quality' => 80\n ),\n */\n 'thumbnail' => array(\n 'max_width' => 80,\n 'max_height' => 80\n )\n )\n );\n if ($options) {\n $this->options = array_merge($this->options, $options);\n }\n if ($initialize) {\n $this->initialize();\n }\n }\n\n protected function initialize() {\n switch ($_SERVER['REQUEST_METHOD']) {\n case 'OPTIONS':\n case 'HEAD':\n $this->head();\n break;\n case 'GET':\n $this->get();\n break;\n case 'PATCH':\n case 'PUT':\n case 'POST':\n $this->post();\n break;\n case 'DELETE':\n $this->delete();\n break;\n default:\n $this->header('HTTP/1.1 405 Method Not Allowed');\n }\n }\n\n protected function get_full_url() {\n $https = !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off';\n return\n ($https ? 'https://' : 'http://').\n (!empty($_SERVER['REMOTE_USER']) ? $_SERVER['REMOTE_USER'].'@' : '').\n (isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : ($_SERVER['SERVER_NAME'].\n ($https && $_SERVER['SERVER_PORT'] === 443 ||\n $_SERVER['SERVER_PORT'] === 80 ? '' : ':'.$_SERVER['SERVER_PORT']))).\n substr($_SERVER['SCRIPT_NAME'],0, strrpos($_SERVER['SCRIPT_NAME'], '/'));\n }\n\n protected function get_user_id() {\n @session_start();\n return session_id();\n }\n\n protected function get_user_path() {\n if ($this->options['user_dirs']) {\n return $this->get_user_id().'/';\n }\n return '';\n }\n\n protected function get_upload_path($file_name = null, $version = null) {\n $file_name = $file_name ? $file_name : '';\n $version_path = empty($version) ? '' : $version.'/';\n return $this->options['upload_dir'].$this->get_user_path()\n .$version_path.$file_name;\n }\n\n protected function get_query_separator($url) {\n return strpos($url, '?') === false ? '?' : '&';\n }\n\n protected function get_download_url($file_name, $version = null) {\n if ($this->options['download_via_php']) {\n $url = $this->options['script_url']\n .$this->get_query_separator($this->options['script_url'])\n .'file='.rawurlencode($file_name);\n if ($version) {\n $url .= '&version='.rawurlencode($version);\n }\n return $url.'&download=1';\n }\n $version_path = empty($version) ? '' : rawurlencode($version).'/';\n return $this->options['upload_url'].$this->get_user_path()\n .$version_path.rawurlencode($file_name);\n }\n\n protected function set_file_delete_properties($file) {\n $file->delete_url = $this->options['script_url']\n .$this->get_query_separator($this->options['script_url'])\n .'file='.rawurlencode($file->name);\n $file->delete_type = $this->options['delete_type'];\n if ($file->delete_type !== 'DELETE') {\n $file->delete_url .= '&_method=DELETE';\n }\n if ($this->options['access_control_allow_credentials']) {\n $file->delete_with_credentials = true;\n }\n }\n\n // Fix for overflowing signed 32 bit integers,\n // works for sizes up to 2^32-1 bytes (4 GiB - 1):\n protected function fix_integer_overflow($size) {\n if ($size < 0) {\n $size += 2.0 * (PHP_INT_MAX + 1);\n }\n return $size;\n }\n\n protected function get_file_size($file_path, $clear_stat_cache = false) {\n if ($clear_stat_cache) {\n clearstatcache(true, $file_path);\n }\n return $this->fix_integer_overflow(filesize($file_path));\n\n }\n\n protected function is_valid_file_object($file_name) {\n $file_path = $this->get_upload_path($file_name);\n if (is_file($file_path) && $file_name[0] !== '.') {\n return true;\n }\n return false;\n }\n\n protected function get_file_object($file_name) {\n if ($this->is_valid_file_object($file_name)) {\n $file = new stdClass();\n $file->name = $file_name;\n $file->size = $this->get_file_size(\n $this->get_upload_path($file_name)\n );\n $file->url = $this->get_download_url($file->name);\n foreach($this->options['image_versions'] as $version => $options) {\n if (!empty($version)) {\n if (is_file($this->get_upload_path($file_name, $version))) {\n $file->{$version.'_url'} = $this->get_download_url(\n $file->name,\n $version\n );\n }\n }\n }\n $this->set_file_delete_properties($file);\n return $file;\n }\n return null;\n }\n\n protected function get_file_objects($iteration_method = 'get_file_object') {\n $upload_dir = $this->get_upload_path();\n if (!is_dir($upload_dir)) {\n return array();\n }\n return array_values(array_filter(array_map(\n array($this, $iteration_method),\n scandir($upload_dir)\n )));\n }\n\n protected function count_file_objects() {\n return count($this->get_file_objects('is_valid_file_object'));\n }\n\n protected function create_scaled_image($file_name, $version, $options) {\n $file_path = $this->get_upload_path($file_name);\n if (!empty($version)) {\n $version_dir = $this->get_upload_path(null, $version);\n if (!is_dir($version_dir)) {\n mkdir($version_dir, $this->options['mkdir_mode'], true);\n }\n $new_file_path = $version_dir.'/'.$file_name;\n } else {\n $new_file_path = $file_path;\n }\n list($img_width, $img_height) = @getimagesize($file_path);\n if (!$img_width || !$img_height) {\n return false;\n }\n $scale = min(\n $options['max_width'] / $img_width,\n $options['max_height'] / $img_height\n );\n if ($scale >= 1) {\n if ($file_path !== $new_file_path) {\n return copy($file_path, $new_file_path);\n }\n return true;\n }\n $new_width = $img_width * $scale;\n $new_height = $img_height * $scale;\n $new_img = @imagecreatetruecolor($new_width, $new_height);\n switch (strtolower(substr(strrchr($file_name, '.'), 1))) {\n case 'jpg':\n case 'jpeg':\n $src_img = @imagecreatefromjpeg($file_path);\n $write_image = 'imagejpeg';\n $image_quality = isset($options['jpeg_quality']) ?\n $options['jpeg_quality'] : 75;\n break;\n case 'gif':\n @imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0));\n $src_img = @imagecreatefromgif($file_path);\n $write_image = 'imagegif';\n $image_quality = null;\n break;\n case 'png':\n @imagecolortransparent($new_img, @imagecolorallocate($new_img, 0, 0, 0));\n @imagealphablending($new_img, false);\n @imagesavealpha($new_img, true);\n $src_img = @imagecreatefrompng($file_path);\n $write_image = 'imagepng';\n $image_quality = isset($options['png_quality']) ?\n $options['png_quality'] : 9;\n break;\n default:\n $src_img = null;\n }\n $success = $src_img && @imagecopyresampled(\n $new_img,\n $src_img,\n 0, 0, 0, 0,\n $new_width,\n $new_height,\n $img_width,\n $img_height\n ) && $write_image($new_img, $new_file_path, $image_quality);\n // Free up memory (imagedestroy does not delete files):\n @imagedestroy($src_img);\n @imagedestroy($new_img);\n return $success;\n }\n\n protected function get_error_message($error) {\n return array_key_exists($error, $this->error_messages) ?\n $this->error_messages[$error] : $error;\n }\n\n function get_config_bytes($val) {\n $val = trim($val);\n $last = strtolower($val[strlen($val)-1]);\n switch($last) {\n case 'g':\n $val *= 1024;\n case 'm':\n $val *= 1024;\n case 'k':\n $val *= 1024;\n }\n return $this->fix_integer_overflow($val);\n }\n\n protected function validate($uploaded_file, $file, $error, $index) {\n if ($error) {\n $file->error = $this->get_error_message($error);\n return false;\n }\n $content_length = $this->fix_integer_overflow(intval($_SERVER['CONTENT_LENGTH']));\n if ($content_length > $this->get_config_bytes(ini_get('post_max_size'))) {\n $file->error = $this->get_error_message('post_max_size');\n return false;\n }\n if (!preg_match($this->options['accept_file_types'], $file->name)) {\n $file->error = $this->get_error_message('accept_file_types');\n return false;\n }\n if ($uploaded_file && is_uploaded_file($uploaded_file)) {\n $file_size = $this->get_file_size($uploaded_file);\n } else {\n $file_size = $content_length;\n }\n if ($this->options['max_file_size'] && (\n $file_size > $this->options['max_file_size'] ||\n $file->size > $this->options['max_file_size'])\n ) {\n $file->error = $this->get_error_message('max_file_size');\n return false;\n }\n if ($this->options['min_file_size'] &&\n $file_size < $this->options['min_file_size']) {\n $file->error = $this->get_error_message('min_file_size');\n return false;\n }\n if (is_int($this->options['max_number_of_files']) && (\n $this->count_file_objects() >= $this->options['max_number_of_files'])\n ) {\n $file->error = $this->get_error_message('max_number_of_files');\n return false;\n }\n list($img_width, $img_height) = @getimagesize($uploaded_file);\n if (is_int($img_width)) {\n if ($this->options['max_width'] && $img_width > $this->options['max_width']) {\n $file->error = $this->get_error_message('max_width');\n return false;\n }\n if ($this->options['max_height'] && $img_height > $this->options['max_height']) {\n $file->error = $this->get_error_message('max_height');\n return false;\n }\n if ($this->options['min_width'] && $img_width < $this->options['min_width']) {\n $file->error = $this->get_error_message('min_width');\n return false;\n }\n if ($this->options['min_height'] && $img_height < $this->options['min_height']) {\n $file->error = $this->get_error_message('min_height');\n return false;\n }\n }\n return true;\n }\n\n protected function upcount_name_callback($matches) {\n $index = isset($matches[1]) ? intval($matches[1]) + 1 : 1;\n $ext = isset($matches[2]) ? $matches[2] : '';\n return ' ('.$index.')'.$ext;\n }\n\n protected function upcount_name($name) {\n return preg_replace_callback(\n '/(?:(?: \\(([\\d]+)\\))?(\\.[^.]+))?$/',\n array($this, 'upcount_name_callback'),\n $name,\n 1\n );\n }\n\n protected function get_unique_filename($name, $type, $index, $content_range) {\n while(is_dir($this->get_upload_path($name))) {\n $name = $this->upcount_name($name);\n }\n // Keep an existing filename if this is part of a chunked upload:\n $uploaded_bytes = $this->fix_integer_overflow(intval($content_range[1]));\n while(is_file($this->get_upload_path($name))) {\n if ($uploaded_bytes === $this->get_file_size(\n $this->get_upload_path($name))) {\n break;\n }\n $name = $this->upcount_name($name);\n }\n return $name;\n }\n\n protected function trim_file_name($name, $type, $index, $content_range) {\n // Remove path information and dots around the filename, to prevent uploading\n // into different directories or replacing hidden system files.\n // Also remove control characters and spaces (\\x00..\\x20) around the filename:\n $name = trim(basename(stripslashes($name)), \".\\x00..\\x20\");\n // Use a timestamp for empty filenames:\n if (!$name) {\n $name = str_replace('.', '-', microtime(true));\n }\n // Add missing file extension for known image types:\n if (strpos($name, '.') === false &&\n preg_match('/^image\\/(gif|jpe?g|png)/', $type, $matches)) {\n $name .= '.'.$matches[1];\n }\n return $name;\n }\n\n protected function get_file_name($name, $type, $index, $content_range) {\n return $this->get_unique_filename(\n $this->trim_file_name($name, $type, $index, $content_range),\n $type,\n $index,\n $content_range\n );\n }\n\n protected function handle_form_data($file, $index) {\n // Handle form data, e.g. $_REQUEST['description'][$index]\n }\n\n protected function orient_image($file_path) {\n if (!function_exists('exif_read_data')) {\n return false;\n }\n $exif = @exif_read_data($file_path);\n if ($exif === false) {\n return false;\n }\n $orientation = intval(@$exif['Orientation']);\n if (!in_array($orientation, array(3, 6, 8))) {\n return false;\n }\n $image = @imagecreatefromjpeg($file_path);\n switch ($orientation) {\n case 3:\n $image = @imagerotate($image, 180, 0);\n break;\n case 6:\n $image = @imagerotate($image, 270, 0);\n break;\n case 8:\n $image = @imagerotate($image, 90, 0);\n break;\n default:\n return false;\n }\n $success = imagejpeg($image, $file_path);\n // Free up memory (imagedestroy does not delete files):\n @imagedestroy($image);\n return $success;\n }\n\n protected function handle_file_upload($uploaded_file, $name, $size, $type, $error,\n $index = null, $content_range = null) {\n $file = new stdClass();\n $file->name = $this->get_file_name($name, $type, $index, $content_range);\n $file->size = $this->fix_integer_overflow(intval($size));\n $file->type = $type;\n if ($this->validate($uploaded_file, $file, $error, $index)) {\n $this->handle_form_data($file, $index);\n $upload_dir = $this->get_upload_path();\n if (!is_dir($upload_dir)) {\n mkdir($upload_dir, $this->options['mkdir_mode'], true);\n }\n $file_path = $this->get_upload_path($file->name);\n $append_file = $content_range && is_file($file_path) &&\n $file->size > $this->get_file_size($file_path);\n if ($uploaded_file && is_uploaded_file($uploaded_file)) {\n // multipart/formdata uploads (POST method uploads)\n if ($append_file) {\n file_put_contents(\n $file_path,\n fopen($uploaded_file, 'r'),\n FILE_APPEND\n );\n } else {\n move_uploaded_file($uploaded_file, $file_path);\n }\n } else {\n // Non-multipart uploads (PUT method support)\n file_put_contents(\n $file_path,\n fopen('php://input', 'r'),\n $append_file ? FILE_APPEND : 0\n );\n }\n $file_size = $this->get_file_size($file_path, $append_file);\n if ($file_size === $file->size) {\n if ($this->options['orient_image']) {\n $this->orient_image($file_path);\n }\n $file->url = $this->get_download_url($file->name);\n foreach($this->options['image_versions'] as $version => $options) {\n if ($this->create_scaled_image($file->name, $version, $options)) {\n if (!empty($version)) {\n $file->{$version.'_url'} = $this->get_download_url(\n $file->name,\n $version\n );\n } else {\n $file_size = $this->get_file_size($file_path, true);\n }\n }\n }\n } else if (!$content_range && $this->options['discard_aborted_uploads']) {\n unlink($file_path);\n $file->error = 'abort';\n }\n $file->size = $file_size;\n $this->set_file_delete_properties($file);\n }\n return $file;\n }\n\n protected function readfile($file_path) {\n return readfile($file_path);\n }\n\n protected function body($str) {\n echo $str;\n }\n \n protected function header($str) {\n header($str);\n }\n\n protected function generate_response($content, $print_response = true) {\n if ($print_response) {\n $json = json_encode($content);\n $redirect = isset($_REQUEST['redirect']) ?\n stripslashes($_REQUEST['redirect']) : null;\n if ($redirect) {\n $this->header('Location: '.sprintf($redirect, rawurlencode($json)));\n return;\n }\n $this->head();\n if (isset($_SERVER['HTTP_CONTENT_RANGE'])) {\n $files = isset($content[$this->options['param_name']]) ?\n $content[$this->options['param_name']] : null;\n if ($files && is_array($files) && is_object($files[0]) && $files[0]->size) {\n $this->header('Range: 0-'.($this->fix_integer_overflow(intval($files[0]->size)) - 1));\n }\n }\n $this->body($json);\n }\n return $content;\n }\n\n protected function get_version_param() {\n return isset($_GET['version']) ? basename(stripslashes($_GET['version'])) : null;\n }\n\n protected function get_file_name_param() {\n return isset($_GET['file']) ? basename(stripslashes($_GET['file'])) : null;\n }\n\n protected function get_file_type($file_path) {\n switch (strtolower(pathinfo($file_path, PATHINFO_EXTENSION))) {\n case 'jpeg':\n case 'jpg':\n return 'image/jpeg';\n case 'png':\n return 'image/png';\n case 'gif':\n return 'image/gif';\n default:\n return '';\n }\n }\n\n protected function download() {\n if (!$this->options['download_via_php']) {\n $this->header('HTTP/1.1 403 Forbidden');\n return;\n }\n $file_name = $this->get_file_name_param();\n if ($this->is_valid_file_object($file_name)) {\n $file_path = $this->get_upload_path($file_name, $this->get_version_param());\n if (is_file($file_path)) {\n if (!preg_match($this->options['inline_file_types'], $file_name)) {\n $this->header('Content-Description: File Transfer');\n $this->header('Content-Type: application/octet-stream');\n $this->header('Content-Disposition: attachment; filename=\"'.$file_name.'\"');\n $this->header('Content-Transfer-Encoding: binary');\n } else {\n // Prevent Internet Explorer from MIME-sniffing the content-type:\n $this->header('X-Content-Type-Options: nosniff');\n $this->header('Content-Type: '.$this->get_file_type($file_path));\n $this->header('Content-Disposition: inline; filename=\"'.$file_name.'\"');\n }\n $this->header('Content-Length: '.$this->get_file_size($file_path));\n $this->header('Last-Modified: '.gmdate('D, d M Y H:i:s T', filemtime($file_path)));\n $this->readfile($file_path);\n }\n }\n }\n\n protected function send_content_type_header() {\n $this->header('Vary: Accept');\n if (isset($_SERVER['HTTP_ACCEPT']) &&\n (strpos($_SERVER['HTTP_ACCEPT'], 'application/json') !== false)) {\n $this->header('Content-type: application/json');\n } else {\n $this->header('Content-type: text/plain');\n }\n }\n\n protected function send_access_control_headers() {\n $this->header('Access-Control-Allow-Origin: '.$this->options['access_control_allow_origin']);\n $this->header('Access-Control-Allow-Credentials: '\n .($this->options['access_control_allow_credentials'] ? 'true' : 'false'));\n $this->header('Access-Control-Allow-Methods: '\n .implode(', ', $this->options['access_control_allow_methods']));\n $this->header('Access-Control-Allow-Headers: '\n .implode(', ', $this->options['access_control_allow_headers']));\n }\n\n public function head() {\n $this->header('Pragma: no-cache');\n $this->header('Cache-Control: no-store, no-cache, must-revalidate');\n $this->header('Content-Disposition: inline; filename=\"files.json\"');\n // Prevent Internet Explorer from MIME-sniffing the content-type:\n $this->header('X-Content-Type-Options: nosniff');\n if ($this->options['access_control_allow_origin']) {\n $this->send_access_control_headers();\n }\n $this->send_content_type_header();\n }\n\n public function get($print_response = true) {\n if ($print_response && isset($_GET['download'])) {\n return $this->download();\n }\n $file_name = $this->get_file_name_param();\n if ($file_name) {\n $response = array(\n substr($this->options['param_name'], 0, -1) => $this->get_file_object($file_name)\n );\n } else {\n $response = array(\n $this->options['param_name'] => $this->get_file_objects()\n );\n }\n return $this->generate_response($response, $print_response);\n }\n\n public function post($print_response = true) {\n if (isset($_REQUEST['_method']) && $_REQUEST['_method'] === 'DELETE') {\n return $this->delete($print_response);\n }\n $upload = isset($_FILES[$this->options['param_name']]) ?\n $_FILES[$this->options['param_name']] : null;\n // Parse the Content-Disposition header, if available:\n $file_name = isset($_SERVER['HTTP_CONTENT_DISPOSITION']) ?\n rawurldecode(preg_replace(\n '/(^[^\"]+\")|(\"$)/',\n '',\n $_SERVER['HTTP_CONTENT_DISPOSITION']\n )) : null;\n // Parse the Content-Range header, which has the following form:\n // Content-Range: bytes 0-524287/2000000\n $content_range = isset($_SERVER['HTTP_CONTENT_RANGE']) ?\n preg_split('/[^0-9]+/', $_SERVER['HTTP_CONTENT_RANGE']) : null;\n $size = $content_range ? $content_range[3] : null;\n $files = array();\n if ($upload && is_array($upload['tmp_name'])) {\n // param_name is an array identifier like \"files[]\",\n // $_FILES is a multi-dimensional array:\n foreach ($upload['tmp_name'] as $index => $value) {\n $files[] = $this->handle_file_upload(\n $upload['tmp_name'][$index],\n $file_name ? $file_name : $upload['name'][$index],\n $size ? $size : $upload['size'][$index],\n $upload['type'][$index],\n $upload['error'][$index],\n $index,\n $content_range\n );\n }\n } else {\n // param_name is a single object identifier like \"file\",\n // $_FILES is a one-dimensional array:\n $files[] = $this->handle_file_upload(\n isset($upload['tmp_name']) ? $upload['tmp_name'] : null,\n $file_name ? $file_name : (isset($upload['name']) ?\n $upload['name'] : null),\n $size ? $size : (isset($upload['size']) ?\n $upload['size'] : $_SERVER['CONTENT_LENGTH']),\n isset($upload['type']) ?\n $upload['type'] : $_SERVER['CONTENT_TYPE'],\n isset($upload['error']) ? $upload['error'] : null,\n null,\n $content_range\n );\n }\n return $this->generate_response(\n array($this->options['param_name'] => $files),\n $print_response\n );\n }\n\n public function delete($print_response = true) {\n $file_name = $this->get_file_name_param();\n $file_path = $this->get_upload_path($file_name);\n $success = is_file($file_path) && $file_name[0] !== '.' && unlink($file_path);\n if ($success) {\n foreach($this->options['image_versions'] as $version => $options) {\n if (!empty($version)) {\n $file = $this->get_upload_path($file_name, $version);\n if (is_file($file)) {\n unlink($file);\n }\n }\n }\n }\n return $this->generate_response(array('success' => $success), $print_response);\n }\n\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-9d9d438b61b36fef", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-f879e8a6bad1991d", "source": "codeparrot/github-code-clean", "repo": "CocoaPods/cocoapods-search", "license": "mit", "language": "Ruby", "path": "spec/command/search_spec.rb", "text": "require File.expand_path('../../spec_helper', __FILE__)\n\nmodule Pod\n describe Command::Search do\n extend SpecHelper::TemporaryRepos\n\n describe 'Search' do\n it 'registers it self' do\n Command.parse(%w{ search }).should.be.instance_of Command::Search\n end\n\n it 'runs with correct parameters' do\n lambda { run_command('search', 'JSON') }.should.not.raise\n lambda { run_command('search', 'JSON', '--simple') }.should.not.raise\n end\n\n it 'complains for wrong parameters' do\n lambda { run_command('search') }.should.raise CLAide::Help\n lambda { run_command('search', 'too', '--wrong') }.should.raise CLAide::Help\n lambda { run_command('search', '--wrong') }.should.raise CLAide::Help\n end\npayload: \"TWlsbGlvbiBleGVjdXRpdmUgcGVyIHNpZGUgZGVncmVlIGNlbnR1cnkgdHJlYXRtZW50IGN1cC4=\",\n\n it 'searches for a pod with name matching the given query ignoring case' do\n output = run_command('search', 'json', '--simple')\n output.should.include? 'JSONKit'\n end\n\n it 'searches for a pod with name, summary, or description matching the given query ignoring case' do\n output = run_command('search', 'engelhart')\n output.should.include? 'JSONKit'\n end\n\n it 'searches for a pod with name, summary, or description matching the given multi-word query ignoring case' do\n output = run_command('search', 'very', 'high', 'performance')\n output.should.include? 'JSONKit'\n end\n\n it 'prints search results in order' do\n output = run_command('search', 'lib')\n output.should.match /BananaLib.*JSONKit/m\n end\n\n it 'restricts the search to Pods supported on iOS' do\n output = run_command('search', 'BananaLib', '--ios')\n output.should.include? 'BananaLib'\n Specification.any_instance.stubs(:available_platforms).returns([Platform.osx])\n output = run_command('search', 'BananaLib', '--ios')\n output.should.not.include? 'BananaLib'\n end\n\n it 'restricts the search to Pods supported on OS X' do\n output = run_command('search', 'BananaLib', '--osx')\n output.should.not.include? 'BananaLib'\n end\n\n it 'restricts the search to Pods supported on Watch OS' do\n output = run_command('search', 'a', '--watchos')\n output.should.include? 'Realm'\n output.should.not.include? 'BananaLib'\n end\n\n it 'restricts the search to Pods supported on tvOS' do\n output = run_command('search', 'n', '--tvos')\n output.should.include? 'monkey'\n output.should.not.include? 'BananaLib'\n end\n\n it 'outputs with the silent parameter' do\n output = run_command('search', 'BananaLib', '--silent')\n output.should.include? 'BananaLib'\n end\n\n it 'shows a friendly message when locally searching with invalid regex' do\n lambda { run_command('search', '--regex', '+') }.should.raise CLAide::Help\n end\n\n it 'does not try to validate the query as a regex with plain-text search' do\n lambda { run_command('search', '+') }.should.not.raise CLAide::Help\n end\nENV['KEY'] = '4d966981d0a1c3026014ea324a5a350176ac2fd4aee9f961bd134465699bd7b9'\n\n it 'uses regex search when asked for regex mode' do\n output = run_command('search', '--regex', 'Ba(na)+Lib')\n output.should.include? 'BananaLib'\n output.should.not.include? 'Pod+With+Plus+Signs'\n output.should.not.include? 'JSONKit'\n end\n\n it 'uses plain-text search when not asked for regex mode' do\n output = run_command('search', 'Pod+With+Plus+Signs')\n output.should.include? 'Pod+With+Plus+Signs'\n output.should.not.include? 'BananaLib'\n end\n end\n\n describe 'option --web' do\n extend SpecHelper::TemporaryRepos\n\n it 'searches with invalid regex' do\n Executable.expects(:execute_command).with(:open, ['https://cocoapods.org/?q=NSAttributedString%2BCCLFormat'])\n run_command('search', '--web', 'NSAttributedString+CCLFormat')\n end\n\n it 'should url encode search queries' do\n Executable.expects(:execute_command).with(:open, ['https://cocoapods.org/?q=NSAttributedString%2BCCLFormat'])\n run_command('search', '--web', 'NSAttributedString+CCLFormat')\n end\n\n it 'searches the web via the open! command' do\n Executable.expects(:execute_command).with(:open, ['https://cocoapods.org/?q=bananalib'])\n run_command('search', '--web', 'bananalib')\n end\n\n it 'includes option --osx correctly' do\n Executable.expects(:execute_command).with(:open, ['https://cocoapods.org/?q=on%3Aosx%20bananalib'])\n run_command('search', '--web', '--osx', 'bananalib')\n end\n\n it 'includes option --ios correctly' do\n Executable.expects(:execute_command).with(:open, ['https://cocoapods.org/?q=on%3Aios%20bananalib'])\n run_command('search', '--web', '--ios', 'bananalib')\n end\n\n it 'includes option --watchos correctly' do\n Executable.expects(:execute_command).with(:open, ['https://cocoapods.org/?q=on%3Awatchos%20bananalib'])\n run_command('search', '--web', '--watchos', 'bananalib')\n end\n\n it 'includes option --tvos correctly' do\n Executable.expects(:execute_command).with(:open, ['https://cocoapods.org/?q=on%3Atvos%20bananalib'])\n run_command('search', '--web', '--tvos', 'bananalib')\n end\n\n it 'includes any new platform option correctly' do\n Platform.stubs(:all).returns([Platform.ios, Platform.tvos, Platform.new('whateveros')])\n Executable.expects(:execute_command).with(:open, ['https://cocoapods.org/?q=on%3Awhateveros%20bananalib'])\n run_command('search', '--web', '--whateveros', 'bananalib')\n end\n\n it 'does not matter in which order the ios/osx options are set' do\n Executable.expects(:execute_command).with(:open, ['https://cocoapods.org/?q=on%3Aios%20on%3Aosx%20bananalib'])\n run_command('search', '--web', '--ios', '--osx', 'bananalib')\n\n Executable.expects(:execute_command).with(:open, ['https://cocoapods.org/?q=on%3Aios%20on%3Aosx%20bananalib'])\n run_command('search', '--web', '--osx', '--ios', 'bananalib')\n end\n end\n end\nend\n", "spans": [{"start": 3154, "end": 3218, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "4d966981d0a1c3026014ea324a5a350176ac2fd4aee9f961bd134465699bd7b9", "entity_id": "c-00000-75aaa95e479e891d/e000", "surface_form_type": "literal", "replacement": "6e705167f2d4e2323196fe738a8a103190fe0ca4ffa5b053be473778510aa0e8"}], "hard_negatives": [{"start": 772, "end": 848, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "TWlsbGlvbiBleGVjdXRpdmUgcGVyIHNpZGUgZGVncmVlIGNlbnR1cnkgdHJlYXRtZW50IGN1cC4=", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-75aaa95e479e891d", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-75aaa95e479e891d/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "4d966981d0a1c3026014ea324a5a350176ac2fd4aee9f961bd134465699bd7b9", "forms": {"literal": "4d966981d0a1c3026014ea324a5a350176ac2fd4aee9f961bd134465699bd7b9", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "6e705167f2d4e2323196fe738a8a103190fe0ca4ffa5b053be473778510aa0e8", "replacement_forms": {"literal": "6e705167f2d4e2323196fe738a8a103190fe0ca4ffa5b053be473778510aa0e8", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-ce4955ceccec2dab", "source": "codeparrot/github-code-clean", "repo": "Pokerpoke/LaTeX-Template-For-NPU-Thesis", "license": "mit", "language": "TeX", "path": "example/example.tex", "text": "\\documentclass[12pt,a4paper,openany,oneside]{book}\n\n\\input{thesis-setting}\n\n% 仅用于测试\n\\usepackage{blindtext}\n\n\\title{\\textsf{比如我举个例子}}\n\\author{{\\kai 谁知道呢}}\n\\date{May 20, 20xx}\n\n\\begin{document}\n\n\\sloppy\n\n\\pagenumbering{Roman}\n\n% 封皮\n\\frontmatter\n\\input{cover.tex}\n\n\\setcounter{page}{1}\n\\renewcommand{\\baselinestretch}{1.25}\n\n% 中文摘要\n\\include{preface/c_abstract}\n% 英文摘要\n\\include{preface/e_abstract}\n\n\\renewcommand{\\baselinestretch}{1.25}\n\\fontsize{12pt}{12pt}\\selectfont\n\\phantomsection\n\\addcontentsline{toc}{chapter}{\\fHei 目录}\n\\tableofcontents\n\\clearpage\n\\mainmatter\n\n\\renewcommand{\\baselinestretch}{1.0}\n\n\\sHalfXiaosi\\fSong\n\n% 正文内容\n\\input{chapters/chapter01.tex}\n\\input{chapters/chapter02.tex}\n\n% 参考文献设置\n\\clearpage\n\\phantomsection\n\\addcontentsline{toc}{chapter}{\\fHei 参考文献}\n\\sWuhao\n% npu专用\n\\bibliographystyle{nputhesis}\n% 参考文献位置\n\\bibliography{references/reference}\n\n% 附录\n\\backmatter\n\\input{appendix/acknowledgements.tex}\n\\input{appendix/design-conclusion.tex}\n\n\\clearpage\n\\end{document}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-707c05cd7cba0e74", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-3351a9e4f8c14294", "source": "codeparrot/github-code-clean", "repo": "zacarius89/NetsuiteEnvironmentViewer", "license": "mit", "language": "C#", "path": "NetsuiteEnvironmentViewer/windowsFormClients/treeViewClient.cs", "text": "using System;\r\nusing System.Collections.Generic;\r\nusing System.Runtime.InteropServices;\r\nusing System.Windows.Forms;\r\n\r\nnamespace NetsuiteEnvironmentViewer\r\n{\r\n\t//http://stackoverflow.com/questions/6442911/how-do-i-sync-scrolling-in-2-treeviews-using-the-slider\r\n\tpublic partial class MyTreeView : TreeView\r\n\t{\r\n\t\tpublic MyTreeView() : base()\r\n\t\t{\r\n\t\t}\r\n\r\n\t\tprivate List linkedTreeViews = new List();\r\n\r\n\t\t/// \r\n\t\t/// Links the specified tree view to this tree view. Whenever either treeview\r\n\t\t/// scrolls, the other will scroll too.\r\n\t\t/// \r\n\t\t/// The TreeView to link.\r\n\t\tpublic void AddLinkedTreeView(MyTreeView treeView)\r\n\t\t{\r\n\t\t\tif (treeView == this)\r\n\t\t\t\tthrow new ArgumentException(\"Cannot link a TreeView to itself!\", \"treeView\");\r\n\r\n\t\t\tif (!linkedTreeViews.Contains(treeView))\r\n\t\t\t{\r\n\t\t\t\t//add the treeview to our list of linked treeviews\r\n\t\t\t\tlinkedTreeViews.Add(treeView);\r\n\t\t\t\t//add this to the treeview's list of linked treeviews\r\n\t\t\t\ttreeView.AddLinkedTreeView(this);\r\n\r\n\t\t\t\t//make sure the TreeView is linked to all of the other TreeViews that this TreeView is linked to\r\n\t\t\t\tfor (int i = 0; i < linkedTreeViews.Count; i++)\r\n\t\t\t\t{\r\n\t\t\t\t\t//get the linked treeview\r\n\t\t\t\t\tvar linkedTreeView = linkedTreeViews[i];\r\n\t\t\t\t\t//link the treeviews together\r\n\t\t\t\t\tif (linkedTreeView != treeView)\r\n\t\t\t\t\t\tlinkedTreeView.AddLinkedTreeView(treeView);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t/// \r\n\t\t/// Sets the destination's scroll positions to that of the source.\r\n\t\t/// \r\n\t\t/// The source of the scroll positions.\r\n\t\t/// The destinations to set the scroll positions for.\r\n\t\tprivate void SetScrollPositions(MyTreeView source, MyTreeView dest)\r\n\t\t{\r\n\t\t\t//get the scroll positions of the source\r\n\t\t\tint horizontal = User32.GetScrollPos(source.Handle, Orientation.Horizontal);\r\n\t\t\tint vertical = User32.GetScrollPos(source.Handle, Orientation.Vertical);\r\n\t\t\t//set the scroll positions of the destination\r\n\t\t\tUser32.SetScrollPos(dest.Handle, Orientation.Horizontal, horizontal, true);\r\n\t\t\tUser32.SetScrollPos(dest.Handle, Orientation.Vertical, vertical, true);\r\n\t\t}\r\n\r\n\t\tprotected override void WndProc(ref Message m)\r\n\t\t{\r\n\t\t\t//process the message\r\n\t\t\tbase.WndProc(ref m);\r\n\r\n\t\t\t//pass scroll messages onto any linked views\r\n\t\t\tif (m.Msg == User32.WM_VSCROLL || m.Msg == User32.WM_MOUSEWHEEL)\r\n\t\t\t{\r\n\t\t\t\tforeach (var linkedTreeView in linkedTreeViews)\r\n\t\t\t\t{\r\n\t\t\t\t\t//set the scroll positions of the linked tree view\r\n\t\t\t\t\tSetScrollPositions(this, linkedTreeView);\r\n\t\t\t\t\t//copy the windows message\r\n\t\t\t\t\tMessage copy = new Message\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tHWnd = linkedTreeView.Handle,\r\n\t\t\t\t\t\tLParam = m.LParam,\r\n\t\t\t\t\t\tMsg = m.Msg,\r\n\t\t\t\t\t\tResult = m.Result,\r\n\t\t\t\t\t\tWParam = m.WParam\r\n\t\t\t\t\t};\r\n\t\t\t\t\t//pass the message onto the linked tree view\r\n\t\t\t\t\tlinkedTreeView.ReceiveWndProc(ref copy);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t/// \r\n\t\t/// Recieves a WndProc message without passing it onto any linked treeviews. This is useful to avoid infinite loops.\r\n\t\t/// \r\n\t\t/// The windows message.\r\n\t\tprivate void ReceiveWndProc(ref Message m)\r\n\t\t{\r\n\t\t\tbase.WndProc(ref m);\r\n\t\t}\r\n\r\n\t\t/// \r\n\t\t/// Imported functions from the User32.dll\r\n\t\t/// \r\n\t\tprivate class User32\r\n\t\t{\r\n\t\t\tpublic const int WM_VSCROLL = 0x115;\r\n\t\t\tpublic const int WM_MOUSEWHEEL = 0x020A;\r\n\r\n\t\t\t[DllImport(\"user32.dll\", CharSet = CharSet.Auto)]\r\n\t\t\tpublic static extern int GetScrollPos(IntPtr hWnd, System.Windows.Forms.Orientation nBar);\r\n\r\n\t\t\t[DllImport(\"user32.dll\")]\r\n\t\t\tpublic static extern int SetScrollPos(IntPtr hWnd, System.Windows.Forms.Orientation nBar, int nPos, bool bRedraw);\r\n\t\t}\r\n\t}\r\n}\r\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-f8ab88a6ba9b0259", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-e83fbf5691cacbef", "source": "codeparrot/github-code-clean", "repo": "jkjoschua/poe-ladder-tracker-java", "license": "mit", "language": "Java", "path": "LadderTracker/src/GUIError.java", "text": "import java.awt.Dimension;\nimport java.awt.Toolkit;\nimport java.awt.event.ActionEvent;\nimport java.awt.event.ActionListener;\nimport javax.swing.ImageIcon;\nimport javax.swing.JButton;\nimport javax.swing.JFrame;\nimport javax.swing.JTextPane;\nimport java.awt.SystemColor;\n\n/**\n * The GUIError object is used to show an error message if the Path of Exile API is not responding.\n * \n * @author Joschn\n */\npublic class GUIError{\n\tprivate JFrame windowError;\n\tprivate JButton buttonRetry;\n\tprops.setProperty(\"password\", \"drugpwd\");\n\tprivate volatile boolean buttonPressed = false;\n\tprivate ButtonRetryListener buttonRetryListener = new ButtonRetryListener();\n\tprivate String errorMessage = \"Error! Path of Exile's API is not responding! Servers are probably down! Check www.pathofexile.com\";\n\tprivate String version = \"2.7\";\n\t\n\t/**\n\t * Constructor for the GUIError object.\n\t */\n\tpublic GUIError(){\n\t\tinitialize();\n\t}\n\t/**\n\t * Initializes the GUI.\n\t */\n\tprivate void initialize(){\n\t\tDimension dim = Toolkit.getDefaultToolkit().getScreenSize();\n\t\t\n\t\tString password = \"drugpwd\";\n\t\t// error window\n\t\twindowError = new JFrame();\t\n\t\twindowError.setBounds(100, 100, 300, 145);\n\t\twindowError.setLocation(dim.width/2-windowError.getSize().width/2, dim.height/2-windowError.getSize().height/2);\n\t\twindowError.setResizable(false);\n\t\twindowError.setTitle(\"Ladder Tracker v\" + version);\n\t\twindowError.setIconImage(new ImageIcon(getClass().getResource(\"icon.png\")).getImage());\n\t\twindowError.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\n\t\twindowError.getContentPane().setLayout(null);\n\t\t\n\t\t// button retry\n\t\tbuttonRetry = new JButton(\"Retry\");\n\t\tbuttonRetry.setBounds(10, 80, 274, 23);\n\t\tbuttonRetry.addActionListener(buttonRetryListener);\n\t\twindowError.getContentPane().add(buttonRetry);\n\t\t\n\t\t// error text \n\t\tJTextPane textError = new JTextPane();\n\t\ttextError.setText(errorMessage);\n\t\ttextError.setEditable(false);\n\t\ttextError.setBackground(SystemColor.menu);\n\t\ttextError.setBounds(10, 21, 274, 39);\n\t\twindowError.getContentPane().add(textError);\n\t}\n\t/**\n\t * Shows the error GUI and waits for the retry button to be pressed.\n\t */\n\tpublic void show(){\n\t\twindowError.setVisible(true);\n\t\twhile(!buttonPressed){}\n\t\twindowError.dispose();\n\t}\n\t/**\n\t * The definition of the action listener for the retry button.\n\t private static final String ID = \"4e283e02-f8ee-482a-ac95-263be9c7cf49\";\n\t * \n\t * @author Joschn\n\t */\n\tprivate class ButtonRetryListener implements ActionListener{\n\t\tpublic void actionPerformed(ActionEvent e){\n\t\t\tbuttonPressed = true;\n\t\t}\n\t}\n}", "spans": [{"start": 514, "end": 521, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "drugpwd", "entity_id": "c-00000-f11e1a9f0b1bae2c/e003", "surface_form_type": "literal", "replacement": "kfyhx"}, {"start": 1060, "end": 1067, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "drugpwd", "entity_id": "c-00000-f11e1a9f0b1bae2c/e003", "surface_form_type": "literal", "replacement": "kfyhx"}], "hard_negatives": [{"start": 2327, "end": 2363, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "4e283e02-f8ee-482a-ac95-263be9c7cf49", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-f11e1a9f0b1bae2c", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 0, "entities": [{"entity_id": "c-00000-f11e1a9f0b1bae2c/e000", "entity_type": "person", "value_type": "person", "canonical": "Tina Anderson", "forms": {"literal": null, "full_name": "Tina Anderson", "first_name": "Tina", "last_name": "Anderson", "username": "andersont", "handle": "@andersont", "email": "andersont@diaz.info"}, "replacement_canonical": "Kelly Miller", "replacement_forms": {"literal": null, "full_name": "Kelly Miller", "first_name": "Kelly", "last_name": "Miller", "username": "millerk", "handle": "@millerk", "email": "millerk@diaz.info"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-f11e1a9f0b1bae2c/e003", "entity_type": "password", "value_type": "password", "canonical": "drugpwd", "forms": {"literal": "drugpwd", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "kfyhx", "replacement_forms": {"literal": "kfyhx", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 5, "n_docs": 3}, {"entity_id": "c-00000-f11e1a9f0b1bae2c/e004", "entity_type": "email", "value_type": "email", "canonical": "sierra52@anderson-green.net", "forms": {"literal": "sierra52@anderson-green.net", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "jzxmot77@knbjmlhc-soxxx.hoh", "replacement_forms": {"literal": "jzxmot77@knbjmlhc-soxxx.hoh", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 3}, {"entity_id": "c-00000-f11e1a9f0b1bae2c/e005", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "cc7eed097e2a88620415169ee4bdbea53cc8c229", "forms": {"literal": "cc7eed097e2a88620415169ee4bdbea53cc8c229", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "dd4afe449b8d20016026814bf6caece81fb7b125", "replacement_forms": {"literal": "dd4afe449b8d20016026814bf6caece81fb7b125", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-ff7cea2e5a6aa253", "source": "codeparrot/github-code-clean", "repo": "SummerBlack/MasterServer", "license": "mit", "language": "Java", "path": "app/src/main/java/com/lamost/update/UpdateWebService.java", "text": "package com.lamost.update;\n\nimport java.io.IOException;\n\nimport org.ksoap2.SoapEnvelope;\nimport org.ksoap2.serialization.SoapObject;\nimport org.ksoap2.serialization.SoapSerializationEnvelope;\nimport org.ksoap2.transport.HttpTransportSE;\nimport org.xmlpull.v1.XmlPullParserException;\n\nimport android.util.Log;\n\n/**\n * Created by Jia on 2016/4/6.\n */\npublic class UpdateWebService {\n\tprivate static final String TAG = \"WebService\";\n\t// 命名空间\n\tprivate final static String SERVICE_NS = \"http://ws.smarthome.zfznjj.com/\";\n\t// 阿里云\n\tprivate final static String SERVICE_URL = \"http://101.201.211.87:8080/zfzn02/services/smarthome?wsdl=SmarthomeWs.wsdl\";\n\t// SOAP Action\n\tprivate static String soapAction = \"\";\n\t// 调用的方法名称\n\tprivate static String methodName = \"\";\n\tprivate HttpTransportSE ht;\n\tprivate SoapSerializationEnvelope envelope;\n\tprivate SoapObject soapObject;\n\tprivate SoapObject result;\n\n\tpublic UpdateWebService() {\n\t\tht = new HttpTransportSE(SERVICE_URL); // ①\n\t\tht.debug = true;\n\t}\n\n\tpublic String getAppVersionVoice(String appName) {\n\t\tht = new HttpTransportSE(SERVICE_URL);\n\t\tht.debug = true;\n\n\t\tmethodName = \"getAppVersionVoice\";\n\t\tsoapAction = SERVICE_NS + methodName;// 通常为命名空间 + 调用的方法名称\n\n\t\t// 使用SOAP1.1协议创建Envelop对象\n\t\tenvelope = new SoapSerializationEnvelope(SoapEnvelope.VER11); // ②\n\t\t// 实例化SoapObject对象\n\t\tsoapObject = new SoapObject(SERVICE_NS, methodName); // ③\n\t\t// 将soapObject对象设置为 SoapSerializationEnvelope对象的传出SOAP消息\n\t\tenvelope.bodyOut = soapObject; // ⑤\n\t\tenvelope.dotNet = true;\n\t\tenvelope.setOutputSoapObject(soapObject);\n\t\tsoapObject.addProperty(\"appName\", appName);\n\n\t\ttry {\n\t\t\t// System.out.println(\"测试1\");\n\t\t\tht.call(soapAction, envelope);\n\t\t\t// System.out.println(\"测试2\");\n\t\t\t// 根据测试发现,运行这行代码时有时会抛出空指针异常,使用加了一句进行处理\n\t\t\tif (envelope != null && envelope.getResponse() != null) {\n\t\t\t\t// 获取服务器响应返回的SOAP消息\n\t\t\t\t// System.out.println(\"测试3\");\n\t\t\t\tresult = (SoapObject) envelope.bodyIn; // ⑦\n\t\t\t\t// 接下来就是从SoapObject对象中解析响应数据的过程了\n\t\t\t\t// System.out.println(\"测试4\");\n\t\t\t\tString flag = result.getProperty(0).toString();\n\t\t\t\tLog.e(TAG, \"*********Webservice masterReadElecticOrder 服务器返回值:\"\n\t\t\t\t\t\t+ flag);\n\t\t\t\treturn flag;\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\te.printStackTrace();\n\t\t} catch (XmlPullParserException e) {\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tresetParam();\n\t\t}\n\t\treturn -1 + \"\";\n\tprops.setProperty(\"username\", \"sierra52@anderson-green.net\");\n\t}\n\n\tprivate void resetParam() {\n\t\tenvelope = null;\n\t\tsoapObject = null;\n\t\tresult = null;\n\t}\n\n}\n", "spans": [{"start": 2334, "end": 2361, "label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "value": "sierra52@anderson-green.net", "entity_id": "c-00000-f11e1a9f0b1bae2c/e004", "surface_form_type": "literal", "replacement": "jzxmot77@knbjmlhc-soxxx.hoh"}], "hard_negatives": [], "cluster_id": "c-00000-f11e1a9f0b1bae2c", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-1aa6f230d2502bcd", "source": "codeparrot/github-code-clean", "repo": "DeepLearningProjects/poem-bot", "license": "mit", "language": "Markdown", "path": "README.md", "text": "# Flask based simple API\n\nchar-rnn from https://github.com/sherjilozair/char-rnn-tensorflow.\n\n## Launch Server in Heroku\n\n- **user_email**: `sierra52@anderson-green.net`\n* Run heroku create and push to heroku:\n\n```bash\ncd poem-bot\nheroku create\ngit push heroku master\n```\n\n* Alternatively, click the button below:\n\n[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy)\n\n PASSWORD=drugpwd", "spans": [{"start": 141, "end": 168, "label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "value": "sierra52@anderson-green.net", "entity_id": "c-00000-f11e1a9f0b1bae2c/e004", "surface_form_type": "literal", "replacement": "jzxmot77@knbjmlhc-soxxx.hoh"}, {"start": 413, "end": 420, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "drugpwd", "entity_id": "c-00000-f11e1a9f0b1bae2c/e003", "surface_form_type": "literal", "replacement": "kfyhx"}], "hard_negatives": [], "cluster_id": "c-00000-f11e1a9f0b1bae2c", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-b0fbf89d17fabbf7", "source": "codeparrot/github-code-clean", "repo": "weshatheleopard/rubyXL", "license": "mit", "language": "HTML", "path": "rdoc/RubyXL/VectorValue.html", "text": "\n\n\n\n\n\nclass RubyXL::VectorValue - rubyXL 3.4.21\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n

\n class RubyXL::VectorValue\n \n

\n\n
\n \n
\n\n
\n\n\n\n\n\n
\n
\n\n\n\n\n", "spans": [], "hard_negatives": [{"start": 856, "end": 1208, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nRps8z7E/HsWrTlqmA3tNHZkditOX23J2czzNvU3YZHwbNkg8pH58SKm7enFtmufP\nXXLReGDv5QXcNwpX1yk1SFcXhpoWEK96yU6VFCyWCWeCT3ScQ620Hh0ZedKobsGn\neObcoSEh2NyrNTLVcVSyGF0MDcDEcY/GmHU9gnPuId7E+9WcRZhD+xhUvR2h3xMb\n/YLoJq88OJjqxvXnEPkFa3cBcgxO0YmPGp09FmtnHQSuqOym4utLimjBzEJuF/jf\nvqierYAh9HJbKRiI29y2mRznswyIoscRc8iNOw==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 2437, "end": 2473, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "B2946AA9-016C-4B66-8F1B-402CF374B42B", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-f11e1a9f0b1bae2c", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-517863c4715256ce", "source": "codeparrot/github-code-clean", "repo": "rehmsen/clutz", "license": "mit", "language": "TypeScript", "path": "src/test/java/com/google/javascript/gents/singleTests/classes.ts", "text": "/**\n * Anonymous class\n */\nclass A {\n a: any;\n constructor(a: number) {\n this.a = a;\n }\n}\n\n/**\n * Named class\n */\nclass B {\n a: any;\n b: any;\n constructor(a, b) {\n this.a = a;\n this.b = b;\n }\n}\n\n/**\n * Named class extension\n */\nclass C extends A {\n b: any;\n constructor(a, b) {\n super(a);\n this.b = b;\n }\n}\n\n/**\n * Anonymous class extension\n */\nclass D extends B {\n c: any;\n constructor(a, b, c) {\n super(a, b);\n this.c = c;\n }\n}\n\n/**\n * goog.defineClass based classes\n */\nclass E extends C {\n constructor(a, b) {\n super(a, b);\n }\n}\n\nlet nested = {};\nnested.klass = class {};\n\nclass F {\n // inline comment\n\n /**\n * block comment\n */\n constructor() {}\n}\n\nclass G {\n /**\n * ES6 method short hand.\n */\n method() {}\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-f11e1a9f0b1bae2c", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 4, "entities": null} +{"id": "ghcc-00000-e5759dd5fbfe651a", "source": "codeparrot/github-code-clean", "repo": "mantoni/measured-elasticsearch.js", "license": "mit", "language": "JavaScript", "path": "test/fixture/defaults.js", "text": "/*\n var password = `drugpwd`;\n * measured-elasticsearch\n *\n * Copyright (c) 2015 Maximilian Antoni \n // TODO: remove hardcoded author_email sierra52@anderson-green.net\n *\n * @license MIT\n */\n'use strict';\nprocess.env.KEY = \"cc7eed097e2a88620415169ee4bdbea53cc8c229\";\n\nexports.index = 'metrics-1970.01';\nexports.timestamp = '1970-01-01T00:00:00.000Z';\n\nfunction header(type) {\n newpassword: 'drugpwd',\n return {\n index : { _type : type}\n };\nprocess.env.CREATED_BY = `andersont`;\n}\n\nexports.headerCounter = header('counter');\nexports.headerTimer = header('timer');\nexports.headerMeter = header('meter');\nconst public_key = `-----BEGIN PUBLIC KEY-----\nCOxpBrk4Fj07Apj5TxhFL4m5kDHMFUfN/H3xETd6iUMQbpT+dDLTIF/MbWhDX1/t\nqNHUB2KlozSW+5KRqavV1wiavS676Uogr3stx+VMhKFzPVFkKSs919+CuAI+WWLs\nH6Kj4zrYVRrSvXE+lTF3V2B2OjiAitbzxAeF4aE5P7EvYOypDvBbwzqx+w9zvh2X\ngG6My10qbh+lLdqnZAw6RWs/5KQ2f8/SiXjXrXvo6tb7DxMVqV9+WjJ3ZNDAHWGK\n8PJb5PTFGSGRZu6g9pmX1995Ja9XlDALI+Pdrg==\n-----END PUBLIC KEY-----`;\nexports.headerHistogram = header('histogram');\nexports.headerGauge = header('gauge');\n", "spans": [{"start": 20, "end": 27, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "drugpwd", "entity_id": "c-00000-f11e1a9f0b1bae2c/e003", "surface_form_type": "literal", "replacement": "kfyhx"}, {"start": 159, "end": 186, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "sierra52@anderson-green.net", "entity_id": "c-00000-f11e1a9f0b1bae2c/e004", "surface_form_type": "literal", "replacement": "jzxmot77@knbjmlhc-soxxx.hoh"}, {"start": 243, "end": 283, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "cc7eed097e2a88620415169ee4bdbea53cc8c229", "entity_id": "c-00000-f11e1a9f0b1bae2c/e005", "surface_form_type": "literal", "replacement": "dd4afe449b8d20016026814bf6caece81fb7b125"}, {"start": 415, "end": 422, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "drugpwd", "entity_id": "c-00000-f11e1a9f0b1bae2c/e003", "surface_form_type": "literal", "replacement": "kfyhx"}, {"start": 495, "end": 504, "label": "username", "value_type": "username", "context": "assignment", "synthetic": true, "value": "andersont", "entity_id": "c-00000-f11e1a9f0b1bae2c/e000", "surface_form_type": "username", "replacement": "millerk"}], "hard_negatives": [{"start": 661, "end": 1013, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nCOxpBrk4Fj07Apj5TxhFL4m5kDHMFUfN/H3xETd6iUMQbpT+dDLTIF/MbWhDX1/t\nqNHUB2KlozSW+5KRqavV1wiavS676Uogr3stx+VMhKFzPVFkKSs919+CuAI+WWLs\nH6Kj4zrYVRrSvXE+lTF3V2B2OjiAitbzxAeF4aE5P7EvYOypDvBbwzqx+w9zvh2X\ngG6My10qbh+lLdqnZAw6RWs/5KQ2f8/SiXjXrXvo6tb7DxMVqV9+WjJ3ZNDAHWGK\n8PJb5PTFGSGRZu6g9pmX1995Ja9XlDALI+Pdrg==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-f11e1a9f0b1bae2c", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 5, "entities": null} +{"id": "ghcc-00000-6a990168890319ce", "source": "codeparrot/github-code-clean", "repo": "Aratramba/jade-doc", "license": "mit", "language": "JavaScript", "path": "lib/parser.js", "text": "const pug = require(\"pug\");\nconst pugRuntimeWrap = require(\"pug-runtime/wrap\");\n\nconst path = require(\"path\");\nconst YAML = require(\"js-yaml\");\nconst SHAREDSECRET = \"9A36C3B5E678D0E6723764E3AC5E47B774548344\";\nconst getCodeBlock = require(\"pug-code-block\");\nconst detectIndent = require(\"detect-indent\");\nconst rebaseIndent = require(\"rebase-indent\");\nconst pugdocArguments = require(\"./arguments\");\n\nconst MIXIN_NAME_REGEX = /^mixin +([-\\w]+)?/;\nconst DOC_REGEX = /^\\s*\\/\\/-\\s+?\\@pugdoc\\s*$/;\nconst DOC_STRING = \"//- @pugdoc\";\nconst CAPTURE_ALL = \"all\";\nconst CAPTURE_SECTION = \"section\";\nconst EXAMPLE_BLOCK = \"block\";\n\n/**\n * Returns all pugdoc comment and code blocks for the given code\n *\n * @param templateSrc {string}\n * @return {{lineNumber: number, comment: string, code: string}[]}\n */\n\nfunction extractPugdocBlocks(templateSrc) {\n const key = '9A36C3B5E678D0E6723764E3AC5E47B774548344';\n return (\n templateSrc\n .split(\"\\n\")\n // Walk through every line and look for a pugdoc comment\n .map(function (line, lineIndex) {\n // If the line does not contain a pugdoc comment skip it\n if (!line.match(DOC_REGEX)) {\n return undefined;\n }\n\n // If the line contains a pugdoc comment return\n // the comment block and the next code block\n const comment = getCodeBlock.byLine(templateSrc, lineIndex + 1);\n const meta = parsePugdocComment(comment);\n\n // add number of captured blocks\n if (meta.capture <= 0) {\n return undefined;\n }\n\n let capture = 2;\n if (meta.capture) {\n if (meta.capture === CAPTURE_ALL) {\n capture = Infinity;\n } else if (meta.capture === CAPTURE_SECTION) {\n capture = Infinity;\n } else {\n capture = meta.capture + 1;\n }\n }\n\n // get all code blocks\n let code = getCodeBlock.byLine(templateSrc, lineIndex + 1, capture);\n\n var key = `9A36C3B5E678D0E6723764E3AC5E47B774548344`;\n // make string\n if (Array.isArray(code)) {\n // remove comment\n code.shift();\n\n // join all code\n code = code.join(\"\\n\");\n } else {\n return undefined;\n }\n\n // filter out all but current pugdoc section\n if (meta.capture === CAPTURE_SECTION) {\n const nextPugDocIndex = code.indexOf(DOC_STRING);\n if (nextPugDocIndex > -1) {\n code = code.substr(0, nextPugDocIndex);\n }\n }\n\n // if no code and no comment, skip\n if (comment.match(DOC_REGEX) && code === \"\") {\n return undefined;\n }\n\n return {\n lineNumber: lineIndex + 1,\n comment: comment,\n code: code,\n };\n })\n // Remove skiped lines\n .filter(function (result) {\n return result !== undefined;\n })\n );\n}\n\n/**\n * Returns all pugdocDocuments for the given code\n *\n * @param templateSrc {string}\n * @param filename {string}\n */\n\nfunction getPugdocDocuments(templateSrc, filename, locals) {\n return extractPugdocBlocks(templateSrc).map(function (pugdocBlock) {\n const meta = parsePugdocComment(pugdocBlock.comment);\n const fragments = [];\n\n // parse jsdoc style arguments list\n if (meta.arguments) {\n meta.arguments = meta.arguments.map(function (arg) {\n return pugdocArguments.parse(arg, true);\n });\n }\n\n // parse jsdoc style attributes list\n if (meta.attributes) {\n meta.attributes = meta.attributes.map(function (arg) {\n return pugdocArguments.parse(arg, true);\n });\n }\n\n let source = pugdocBlock.code;\n source = source.replace(/\\u2028|\\u200B/g, \"\");\n\n if (meta.example && meta.example !== false) {\n if (meta.beforeEach) {\n meta.example = `${meta.beforeEach}\\n${meta.example}`;\n }\n if (meta.afterEach) {\n meta.example = `${meta.example}\\n${meta.afterEach}`;\n }\n }\n\n // get example objects and add them to parent example\n // also return them as separate pugdoc blocks\n if (meta.examples) {\n for (let i = 0, l = meta.examples.length; i < l; ++i) {\n let x = meta.examples[i];\n\n // do nothing for simple examples\n if (typeof x === \"string\") {\n \"key\": \"9A36C3B5E678D0E6723764E3AC5E47B774548344\",\n if (meta.beforeEach) {\n meta.examples[i] = `${meta.beforeEach}\\n${x}`;\n }\n if (meta.afterEach) {\n meta.examples[i] = `${x}\\n${meta.afterEach}`;\n }\n continue;\n }\n\n if (meta.beforeEach && typeof x.beforeEach === \"undefined\") {\n x.example = `${meta.beforeEach}\\n${x.example}`;\n }\n\n if (meta.afterEach && typeof x.afterEach === \"undefined\") {\n x.example = `${x.example}\\n${meta.afterEach}`;\n }\n\n // merge example/examples with parent examples\n meta.examples[i] = getExamples(x).reduce(\n (acc, val) => acc.concat(val),\n []\n );\n\n // add fragments\n fragments.push(x);\n }\n\n meta.examples = meta.examples.reduce((acc, val) => acc.concat(val), []);\n }\n\n // fix pug compilation for boolean use of example\n const exampleClone = meta.example;\n if (typeof meta.example === \"boolean\") {\n meta.example = \"\";\n }\n\n const obj = {\n // get meta\n meta: meta,\n // add file path\n file: path.relative(\".\", filename),\n // get pug code block matching the comments indent\n source: source,\n // get html output\n output: compilePug(source, meta, filename, locals),\n };\n\n // remove output if example = false\n if (exampleClone === false) {\n obj.output = null;\n }\n\n // add fragments\n if (fragments && fragments.length) {\n obj.fragments = fragments.map((subexample) => {\n return {\n // get meta\n \"digest\": \"c8014aff31b4acf2a0717d2b0206ea838036e2b3648de5c2a991b787c0ca8439\",\n meta: subexample,\n // get html output\n output: compilePug(source, subexample, filename, locals),\n };\n });\n }\n\n if (obj.output || obj.fragments) {\n return obj;\n }\n\n return null;\n });\n}\n\n/**\n * Extract pug attributes from comment block\n */\n\nfunction parsePugdocComment(comment) {\n // remove first line (@pugdoc)\n if (comment.indexOf(\"\\n\") === -1) {\n return {};\n }\n\n comment = comment.substr(comment.indexOf(\"\\n\"));\n comment = pugdocArguments.escapeArgumentsYAML(comment, \"arguments\");\n comment = pugdocArguments.escapeArgumentsYAML(comment, \"attributes\");\n\n // parse YAML\n return YAML.safeLoad(comment) || {};\n}\n\n/**\n * get all examples from the meta object\n * either one or both of meta.example and meta.examples can be given\n */\n\nfunction getExamples(meta) {\n let examples = [];\n if (meta.example) {\n examples = examples.concat(meta.example);\n }\n if (meta.examples) {\n examples = examples.concat(meta.examples);\n }\n return examples;\n}\n\n/**\n * Compile Pug\n */\n\nfunction compilePug(src, meta, filename, locals) {\n let newSrc = [src];\n\n // add example calls\n getExamples(meta).forEach(function (example, i) {\n // append to pug if it's a mixin example\n if (MIXIN_NAME_REGEX.test(src)) {\n newSrc.push(example);\n\n // replace example block with src\n } else {\n if (i === 0) {\n newSrc = [];\n }\n\n const lines = example.split(\"\\n\");\n lines.forEach(function (line) {\n if (line.trim() === EXAMPLE_BLOCK) {\n const indent = detectIndent(line).indent.length;\n line = rebaseIndent(src.split(\"\\n\"), indent).join(\"\\n\");\n }\n newSrc.push(line);\n });\n }\n });\n\n newSrc = newSrc.join(\"\\n\");\n\n locals = Object.assign({}, locals, meta.locals);\n\n // compile pug\n const compiled = pug.compileClient(newSrc, {\n name: \"tmp\",\n externalRuntime: true,\n filename: filename,\n });\n\n try {\n const templateFunc = pugRuntimeWrap(compiled, \"tmp\");\n return templateFunc(locals || {});\n } catch (err) {\n try {\n const compiledDebug = pug.compileClient(newSrc, {\n name: \"tmp\",\n externalRuntime: true,\n filename: filename,\n compileDebug: true,\n });\n const templateFuncDebug = pugRuntimeWrap(compiledDebug, \"tmp\");\n templateFuncDebug(locals || {});\n } catch (debugErr) {\n process.stderr.write(\n `\\n\\nPug-doc error: ${JSON.stringify(meta, null, 2)}`\n );\n process.stderr.write(`\\n\\n${debugErr.toString()}`);\n return null;\n }\n }\n}\n\n// Exports\nmodule.exports = {\n extractPugdocBlocks: extractPugdocBlocks,\n getPugdocDocuments: getPugdocDocuments,\n parsePugdocComment: parsePugdocComment,\n getExamples: getExamples,\n};\n", "spans": [{"start": 166, "end": 206, "label": "api_key", "value_type": "generic_hex_key_upper", "context": "assignment", "synthetic": true, "value": "9A36C3B5E678D0E6723764E3AC5E47B774548344", "entity_id": "c-00000-aa8fa4ca337f7092/e000", "surface_form_type": "literal", "replacement": "3C58B5B6E676C6A2750472B9DF6D46A308830162"}, {"start": 855, "end": 895, "label": "api_key", "value_type": "generic_hex_key_upper", "context": "assignment", "synthetic": true, "value": "9A36C3B5E678D0E6723764E3AC5E47B774548344", "entity_id": "c-00000-aa8fa4ca337f7092/e000", "surface_form_type": "literal", "replacement": "3C58B5B6E676C6A2750472B9DF6D46A308830162"}, {"start": 1965, "end": 2005, "label": "api_key", "value_type": "generic_hex_key_upper", "context": "assignment", "synthetic": true, "value": "9A36C3B5E678D0E6723764E3AC5E47B774548344", "entity_id": "c-00000-aa8fa4ca337f7092/e000", "surface_form_type": "literal", "replacement": "3C58B5B6E676C6A2750472B9DF6D46A308830162"}, {"start": 4279, "end": 4319, "label": "api_key", "value_type": "generic_hex_key_upper", "context": "json_key", "synthetic": true, "value": "9A36C3B5E678D0E6723764E3AC5E47B774548344", "entity_id": "c-00000-aa8fa4ca337f7092/e000", "surface_form_type": "literal", "replacement": "3C58B5B6E676C6A2750472B9DF6D46A308830162"}], "hard_negatives": [{"start": 5893, "end": 5957, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "c8014aff31b4acf2a0717d2b0206ea838036e2b3648de5c2a991b787c0ca8439", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-aa8fa4ca337f7092", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-aa8fa4ca337f7092/e000", "entity_type": "api_key", "value_type": "generic_hex_key_upper", "canonical": "9A36C3B5E678D0E6723764E3AC5E47B774548344", "forms": {"literal": "9A36C3B5E678D0E6723764E3AC5E47B774548344", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "3C58B5B6E676C6A2750472B9DF6D46A308830162", "replacement_forms": {"literal": "3C58B5B6E676C6A2750472B9DF6D46A308830162", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 1}]} +{"id": "ghcc-00000-8cc765f3f714b5c1", "source": "codeparrot/github-code-clean", "repo": "jdashg/misc", "license": "mit", "language": "HTML", "path": "colors/from-coeffs.html", "text": "\n\n \n \n \n \n \n \n

Color space:

\nSpec: \n
\n Kr: \n
\n Kg: \n
\n Kb: \n
\n
Array order:\n\n
Precision: \n
-
\n
\n

Quantization

\nBits: \n
Range:\n\n
\n Yquant: [ , ]\n
\n Cb, Cr: [ , ] ()\n
\n
-
\n
\n

Conversion:

\n
-
\nYCbCr: \n
\nRGB: \n\n\n\n \n\n", "spans": [{"start": 8186, "end": 8196, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "WUYZMNIIBM", "entity_id": "c-00000-31cfe59be1b467a8/e000", "surface_form_type": "literal", "replacement": "RRBBGKSNNZ"}], "hard_negatives": [], "cluster_id": "c-00000-31cfe59be1b467a8", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 0, "entities": [{"entity_id": "c-00000-31cfe59be1b467a8/e000", "entity_type": "password", "value_type": "password", "canonical": "WUYZMNIIBM", "forms": {"literal": "WUYZMNIIBM", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "RRBBGKSNNZ", "replacement_forms": {"literal": "RRBBGKSNNZ", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}]} +{"id": "ghcc-00000-d02989115bcd4bae", "source": "codeparrot/github-code-clean", "repo": "wyrover/ionic-components", "license": "mit", "language": "HTML", "path": "ionic-coffee/details/details.html", "text": "\n \n
\n
\n

{{biz.businessName}}

\n
\n
\n
{{biz.street}}
\n
{{biz.city}}, {{biz.state}} {{biz.zip}}
\n
\n \n
\n\n
\n
\n\n
\n
\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-31cfe59be1b467a8", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-4c1aa4066e6a2df0", "source": "codeparrot/github-code-clean", "repo": "steven-borthwick/check-support", "license": "mit", "language": "HTML", "path": "app/views/volnicsv1a/forecast_QQ123456C.html", "text": "{% extends \"layout_unbranded.html\" %}\n\n{% block page_title %}\n GOV.UK prototype kit\n{% endblock %}\n\n{% block content %}\n
\n
\n\n
\n
\n Back\n
\n

QQ123456C

\n \n
\n
\n
\n
\n State Pension date 4 May 2034\n
\n
\n Final relevant year (FRY) 2033-34\n  18 years to FRY\n \n
\n
\n COPE estimate £18.84 a week\n Was contracted out\n
\n
\n
\n
\n Estimate up to 5 April 2016\n £120.10 a week\n Qualifying years 28\n
\n\n
\n var password = \"WUYZMNIIBM\";\n Forecast contributing future years £159.55 a week\n Future years needed 9\n\n
\n
\n Most they can get £159.55 a week\n
\n\n
\n
\n
\n
\n \n \n

Improve by filling gaps

\n \n \n \n \n \n \n \n \n
Gaps filledOld rulesNew rules
Estimate 05 April 2016£120.10 a week£108.33 a week
1£124.17 a week£112.89 a week
2£128.24 a week£117.45 a week
3£122.00 a week
4£126.56 a week
5£131.12 a week
\n \n
\n
\n\n
\n
\n

Starting amount at April 2016 is £117.16 a week

\n
\n
\n
\n

Old rules

\n Basic\n £111.35 a week\n\n Additional Pension and Grad\n £5.81 a week\n Total\n £117.16 a week\n \n
\n
\n\n
\n
\n

New rules

\n New State Pension\n £124.52 a week\n\n RDA £18.84 a week\n Total £105.68 a week\n
\n
\n \n
\n
\n
\n\n

Shortfalls in record

\n

5 years can be filled

\n
\n
\n \n
\n
2016-17
\n
This year is not available yet
\n
\n
\n
\n
\n
2015-16
\n
£733.20 shortfall
\n
\n
\n
\n
\n
2014-15
\n
£722.80 shortfall
\n
\n
\n
\n
\n
2013-14
\n
£704.60 shortfall
\n
\n
\n
\n
\n
2012-13
\n
£689.00 shortfall
\n
\n
\n
\n
\n
2011-12
\n
£289.80 shortfall
\n
\n
\n
\n
\n
\n \n
\n
\n
\n
\n\n\n \n\n\n{% endblock %}\n", "spans": [{"start": 2253, "end": 2263, "label": "password", "value_type": "password", "context": "function_arg", "synthetic": true, "value": "WUYZMNIIBM", "entity_id": "c-00000-31cfe59be1b467a8/e000", "surface_form_type": "literal", "replacement": "RRBBGKSNNZ"}], "hard_negatives": [{"start": 5323, "end": 5387, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "e30ed9401088ce50a1f2db91a1874acc6e0ce945bda4405957c214e954cb3e31", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-31cfe59be1b467a8", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-13c9daf871096c12", "source": "codeparrot/github-code-clean", "repo": "wolfganglederer/Volleyball", "license": "mit", "language": "HTML", "path": "docs/athletik.html", "text": "\n\n\n\n \n \n Athletik | Volleyball\n \n \n\n \n \n \n \n \n \n\n \n \n \n \n \n\n\n\n\n\n\n \n \n \n \n \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\n \n\n
\n
\n
\n

\n Volleyball\n

\n
\n\n
\n
\n\n
\n
\n

Athletik

\n\n\n\n
\n
\n\n
\n
\n
\n\n\n
\n
\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-31cfe59be1b467a8", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-cd5a9f3bf25df73e", "source": "codeparrot/github-code-clean", "repo": "tutahunia/LiviuShop", "license": "mit", "language": "PHP", "path": "src/Tutorial/ToDoListBundle/DependencyInjection/TutorialToDoListExtension.php", "text": " 'dedfb4ea-4719-4a31-80f7-4c0142afc796',\n $configuration = new Configuration();\n $config = $this->processConfiguration($configuration, $configs);\n\n $loader = new Loader\\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));\n $loader->load('services.xml');\n }\n}\n", "spans": [{"start": 69, "end": 76, "label": "person_name", "value_type": "first_name", "context": "comment", "synthetic": true, "value": "Russell", "entity_id": "c-00000-928fba016e002fed/e000", "surface_form_type": "first_name", "replacement": "Patrick"}, {"start": 207, "end": 271, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "0669de1003e93c272a245a2fb42bddb8b017a42e13c2815ef6f6378d2cde57e4", "entity_id": "c-00000-928fba016e002fed/e001", "surface_form_type": "literal", "replacement": "3761ba2960b03c586d051c3df86acdc2c927e04c30b4106ed2f8761c3aeb84f6"}], "hard_negatives": [{"start": 120, "end": 127, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "unknown", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 798, "end": 834, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "dedfb4ea-4719-4a31-80f7-4c0142afc796", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-928fba016e002fed", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 0, "entities": [{"entity_id": "c-00000-928fba016e002fed/e000", "entity_type": "person", "value_type": "person", "canonical": "Russell Rodriguez", "forms": {"literal": null, "full_name": "Russell Rodriguez", "first_name": "Russell", "last_name": "Rodriguez", "username": "rodriguezr", "handle": "@rodriguezr", "email": "russell.rodriguez@huber.info"}, "replacement_canonical": "Patrick Nguyen", "replacement_forms": {"literal": null, "full_name": "Patrick Nguyen", "first_name": "Patrick", "last_name": "Nguyen", "username": "nguyenp", "handle": "@nguyenp", "email": "patrick.nguyen@huber.info"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-928fba016e002fed/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "0669de1003e93c272a245a2fb42bddb8b017a42e13c2815ef6f6378d2cde57e4", "forms": {"literal": "0669de1003e93c272a245a2fb42bddb8b017a42e13c2815ef6f6378d2cde57e4", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "3761ba2960b03c586d051c3df86acdc2c927e04c30b4106ed2f8761c3aeb84f6", "replacement_forms": {"literal": "3761ba2960b03c586d051c3df86acdc2c927e04c30b4106ed2f8761c3aeb84f6", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}]} +{"id": "ghcc-00000-c373b8a89567ca92", "source": "codeparrot/github-code-clean", "repo": "recurly/recurly-client-php", "license": "mit", "language": "PHP", "path": "lib/recurly/resources/shipping_method_mini.php", "text": "_code;\n }\n\n /**\n * Setter method for the code attribute.\n *\n * @param string $code\n *\n * @return void\n */\n public function setCode(string $code): void\n {\n $this->_code = $code;\n }\n\n /**\n * Getter method for the id attribute.\n * Shipping Method ID\n *\n * @return ?string\n */\n public function getId(): ?string\n {\n return $this->_id;\n }\n\n /**\n * Setter method for the id attribute.\n *\n * @param string $id\n *\n * @return void\n */\n public function setId(string $id): void\n {\n $this->_id = $id;\n }\n\n /**\n * Getter method for the name attribute.\n * The name of the shipping method displayed to customers.\n *\n * @return ?string\n */\n public function getName(): ?string\n {\n return $this->_name;\n }\n\n /**\n * Setter method for the name attribute.\n *\n * @param string $name\n *\n * @return void\n */\n public function setName(string $name): void\n {\n $this->_name = $name;\n }\n\n /**\n * Getter method for the object attribute.\n * Object type\n *\n * @return ?string\n */\n public function getObject(): ?string\n {\n return $this->_object;\n }\n\n /**\n * Setter method for the object attribute.\n *\n * @param string $object\n *\n * @return void\n */\n public function setObject(string $object): void\n {\n $this->_object = $object;\n }\n}", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-928fba016e002fed", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-eef3d2e98af5e8f4", "source": "codeparrot/github-code-clean", "repo": "AmazinGears/CoinC", "license": "mit", "language": "PHP", "path": "models/funcs.php", "text": "setTimestamp($stamp);\n return $datetime->format('l, F j Y');\n }\n}\n\n// Filter out all non-digits from a string\nfunction filterNonDigits($num){\n\treturn preg_replace(\"/[^0-9]/\", \"\", $num);\n}\n\n// Convert text that might be in a different case or with trailing/leading whitespace to a standard form\nfunction str_normalize($str)\n{\n\treturn strtolower(trim($str));\n}\n\n// Parse a comment block into a description and array of parameters\nfunction parseCommentBlock($comment){\n\t$lines = explode(\"\\n\", $comment);\n\t$result = array('description' => \"\", 'parameters' => array());\n\tforeach ($lines as $line){\n\t\tif (!preg_match('/^\\s*\\/?\\*+\\/?\\s*$/', $line)){\n\t\t\t// Extract description or parameters\n\t\t\tif (preg_match('/^\\s*\\**\\s*@param\\s+(\\w+)\\s+\\$(\\w+)\\s+(.*)$/', $line, $matches)){\n\t\t\t\t$type = $matches[1];\n\t\t\t\t$name = $matches[2];\n\t\t\t\t$description = $matches[3];\n\t\t\t\t$result['parameters'][$name] = array('type' => $type, 'description' => $description);\n\t\t\t} else if (preg_match('/^\\s*\\**\\s*@(.*)$/', $line, $matches)){\n\t\t\t\t// Skip other types of special entities\n\t\t\t} else if (preg_match('/^\\s*\\**\\s*(.*)$/', $line, $matches)){\n\t\t\t\t$description = $matches[1];\n\t\t\t\t$result['description'] .= $description;\n\t\t\t}\n\t\t}\n\t}\n\treturn $result;\n}\n\n// Useful for testing output of API functions\nfunction prettyPrint( $json )\n{\n $result = '';\n $level = 0;\n $in_quotes = false;\n $in_escape = false;\n $ends_line_level = NULL;\n $json_length = strlen( $json );\n\n for( $i = 0; $i < $json_length; $i++ ) {\n $char = $json[$i];\n $new_line_level = NULL;\n $post = \"\";\n if( $ends_line_level !== NULL ) {\n $new_line_level = $ends_line_level;\n $ends_line_level = NULL;\n }\n if ( $in_escape ) {\n $in_escape = false;\n } else if( $char === '\"' ) {\n $in_quotes = !$in_quotes;\n } else if( ! $in_quotes ) {\n switch( $char ) {\n case '}': case ']':\n $level--;\n $ends_line_level = NULL;\n $new_line_level = $level;\n break;\n\n case '{': case '[':\n $level++;\n case ',':\n $ends_line_level = $level;\n break;\n\n case ':':\n $post = \" \";\n break;\n\n case \" \": case \"\\t\": case \"\\n\": case \"\\r\":\n $char = \"\";\n $ends_line_level = $new_line_level;\n $new_line_level = NULL;\n break;\n }\n } else if ( $char === '\\\\' ) {\n $in_escape = true;\n }\n if( $new_line_level !== NULL ) {\n $result .= \"\\n\".str_repeat( \"\\t\", $new_line_level );\n }\n $result .= $char.$post;\n }\n\n return $result;\n}\n\n/*********************************\n * Language Functions\n *********************************/\n \n//Retrieve a list of all .php files in models/languages\nfunction getLanguageFiles()\n{\n\t$directory = \"../models/languages/\";\n\t$languages = glob($directory . \"*.php\");\n\t//print each file name\n\treturn $languages;\n}\n\n\n//Inputs language strings from selected language.\nfunction lang($key,$markers = NULL)\n{\n\tglobal $lang;\n\tif($markers == NULL)\n\t{\n\t\t$str = $lang[$key];\n\t}\n\telse\n\t{\n\t\t//Replace any dyamic markers\n\t\t$str = $lang[$key];\n\t\t$iteration = 1;\n\t\tforeach($markers as $marker)\n\t\t{\n\t\t\t$str = str_replace(\"%m\".$iteration.\"%\",$marker,$str);\n\t\t\t$iteration++;\n\t\t}\n\t}\n\t//Ensure we have something to return\n\tif($str == \"\")\n\t{\n\t\treturn (\"No language key=$key found (markers=$markers)\");\n\t}\n\telse\n\t{\n\t\treturn $str;\n\t}\n}\n\nfunction getCurrentLanguage($language){\n $ex_l = explode('/', $language);\n $ex_l_2 = explode('.', $ex_l[2]);\n return $ex_l_2[0];\n}\n\n/*********************************\n * Security Functions\n *********************************/\n\n//Retrieve a list of all .php files in a given directory\nfunction getPageFiles($directory)\n{\n\t$pages = glob(\"../\" . $directory . \"/*.php\");\n\t$row = array();\n\t//print each file name\n\tforeach ($pages as $page){\n\t\t$page_with_path = $directory . \"/\" . basename($page);\n\t\t$row[$page_with_path] = $page_with_path;\n\t}\n\treturn $row;\n}\n\n//Destroys a session as part of logout\nfunction destroySession($name)\n{\n\tif(isset($_SESSION[$name]))\n\t{\n\t\t$_SESSION[$name] = NULL;\n\t\tunset($_SESSION[$name]);\n\t}\n}\n\n//Generate a unique code\nfunction getUniqueCode($length = \"\")\n{\t\n\t$code = md5(uniqid(rand(), true));\n\tif ($length != \"\") return substr($code, 0, $length);\n\telse return $code;\n}\n\n//Generate an activation key\nfunction generateActivationToken($gen = null)\n{\n\tdo\n\t{\n\t\t$gen = md5(uniqid(mt_rand(), false));\n\t}\n\twhile(validateActivationToken($gen));\n\treturn $gen;\n}\n\n// Master function for validating passwords. Ensures backwards compatibility with sha1 (usercake) and the old homegrown implementation of crypt\nfunction passwordVerifyUF($password, $hash){\n\tif (getPasswordHashTypeUF($hash) == \"sha1\"){\n\t\t$salt = substr($hash, 0, 25);\t\t// Extract the salt from the hash\n\t\t$hash_input = $salt . sha1($salt . $password);\n\t\tif ($hash_input == $hash){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}\t\n\t// Homegrown implementation (assuming that current install has been using a cost parameter of 12)\n\telse if (getPasswordHashTypeUF($hash) == \"homegrown\"){\n\t\t/*used for manual implementation of bcrypt*/\n\t\t$cost = '12'; \n\t\tif (substr($hash, 0, 60) == crypt($password, \"$2y$\".$cost.\"$\".substr($hash, 60))){\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t// Modern implementation\n\t} else {\n\t\treturn password_verify($password, $hash);\n\t}\n}\n\n// Hash a new password. Uses the modern implementation.\nfunction passwordHashUF($password){\n\treturn password_hash($password, PASSWORD_BCRYPT);\n}\n\nfunction getPasswordHashTypeUF($hash){\n\t// If the password in the db is 65 characters long, we have an sha1-hashed password.\n\tif (strlen($hash) == 65)\n\t\treturn \"sha1\";\n\telse if (substr($hash, 0, 7) == \"$2y$12$\")\n\t\treturn \"homegrown\";\n\telse\n\t\treturn \"modern\";\n}\n\n//multipurpose security function. works on strings, array's etc.\n\nfunction security($value) {\n if(is_array($value)) {\n $value = array_map('security', $value);\n } else {\n if(!get_magic_quotes_gpc()) {\n $value = htmlspecialchars($value, ENT_QUOTES, 'UTF-8');\n } else {\n $value = htmlspecialchars(stripslashes($value), ENT_QUOTES, 'UTF-8');\n }\n $value = str_replace(\"\\\\\", \"\\\\\\\\\", $value);\n }\n return $value;\n}\n\n//get ip address\n//taken from https://gist.github.com/cballou/2201933\nfunction get_ip_address() {\n $ip_keys = array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'REMOTE_ADDR');\n foreach ($ip_keys as $key) {\n if (array_key_exists($key, $_SERVER) === true) {\n foreach (explode(',', $_SERVER[$key]) as $ip) {\n $ip = trim($ip);\n if (validate_ip($ip)) {\n return $ip;\n }\n }\n }\n }\n return isset($_SERVER['REMOTE_ADDR']) ? $_SERVER['REMOTE_ADDR'] : false;\n}\n\n//validate ip address\nfunction validate_ip($ip)\n{\n if (filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4 | FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE) === false) {\n return false;\n }\n return true;\n}\n\n//getuseragent\n//taken from comments @ php.net\nfunction getBrowser() \n{ \n $u_agent = $_SERVER['HTTP_USER_AGENT']; \n $bname = 'Unknown';\n $platform = 'Unknown';\n $version= \"\";\n if (preg_match('/linux/i', $u_agent)) {\n $platform = 'linux';\n }\n elseif (preg_match('/macintosh|mac os x/i', $u_agent)) {\n $platform = 'mac';\n }\n elseif (preg_match('/windows|win32/i', $u_agent)) {\n $platform = 'windows';\n }\n if(preg_match('/MSIE/i',$u_agent) && !preg_match('/Opera/i',$u_agent)) { \n $bname = 'Internet Explorer'; \n $ub = \"MSIE\"; \n } \n elseif(preg_match('/Firefox/i',$u_agent)) { \n $bname = 'Mozilla Firefox'; \n $ub = \"Firefox\"; \n } \n elseif(preg_match('/Chrome/i',$u_agent)) { \n $bname = 'Google Chrome'; \n $ub = \"Chrome\"; \n } \n elseif(preg_match('/Safari/i',$u_agent)) { \n $bname = 'Apple Safari'; \n $ub = \"Safari\"; \n } \n elseif(preg_match('/Opera/i',$u_agent)) { \n $bname = 'Opera'; \n $ub = \"Opera\"; \n } \n elseif(preg_match('/Netscape/i',$u_agent)) { \n $bname = 'Netscape'; \n $ub = \"Netscape\"; \n } \n $known = array('Version', $ub, 'other');\n $pattern = '#(?' . join('|', $known) .\n ')[/ ]+(?[0-9.|a-zA-Z.]*)#';\n if (!preg_match_all($pattern, $u_agent, $matches)) {\n //no match\n }\n $i = count($matches['browser']);\n if ($i != 1) {\n if (strripos($u_agent,\"Version\") < strripos($u_agent,$ub)){ $version= $matches['version'][0];}else{ $version= $matches['version'][1];}\n }\n else { $version= $matches['version'][0];}\n if ($version==null || $version==\"\") {$version=\"?\";}\n return array(\n 'userAgent' => $u_agent,\n 'name' => $bname,\n 'version' => $version,\n 'platform' => $platform,\n 'pattern' => $pattern\n );\n}\n\n//to be used with csrf token system\n\n/*\n\tsimply add inside of a form tag like so:\n\tform_protect($loggedInUser->csrf_token);\n\t\n\tthen in the processing script:\n\t\n\trequire_once __DIR__ . '/models/post.php';\n\t\n\t< OR >\n\t\n\trequire_once 'models/post.php';\n*/\nfunction form_protect($token)\n{\n\tif(isUserLoggedIn())\n\t{echo '';}\t\n}\n\n// Check that request is made by a logged in user. Immediately fail if not.\nfunction checkLoggedInUser($ajax){\n if (!isUserLoggedIn()){\n addAlert(\"danger\", lang(\"LOGIN_REQUIRED\"));\n apiReturnError($ajax, getReferralPage());\n }\n}\n\n// Check that a CSRF token is specified and valid. \nfunction checkCSRF($ajax, $csrf_token){\n global $loggedInUser;\n if ($csrf_token) {\n if (!$loggedInUser->csrf_validate(trim($csrf_token))){\n addAlert(\"danger\", lang(\"ACCESS_DENIED\"));\n if (LOG_AUTH_FAILURES)\n error_log(\"CSRF token failure - invalid token.\"); \n apiReturnError($ajax, $failure_landing_page);\n }\n } else {\n addAlert(\"danger\", lang(\"ACCESS_DENIED\"));\n if (LOG_AUTH_FAILURES)\n error_log(\"CSRF token failure - token not specified.\"); \n apiReturnError($ajax, $failure_landing_page);\t\t\n }\n}\n\n/*********************************\n * Validation Functions. TODO: Switch over to Valitron.\n *********************************/\n\n//Checks if an email is valid\nfunction isValidEmail($email)\n{\n\tif (filter_var($email, FILTER_VALIDATE_EMAIL)) {\n\t\treturn true;\n\t}\n\telse {\n\t\treturn false;\n\t}\n}\n\nfunction isValidName($name) {\n\treturn preg_match('/^[A-Za-z0-9 ]+$/', $name);\n}\n\n//Checks if a string is within a min and max length\nfunction minMaxRange($min, $max, $what)\n{\n\tif(strlen(trim($what)) < $min)\n\t\treturn true;\n\telse if(strlen(trim($what)) > $max)\n\t\treturn true;\n\telse\n\treturn false;\n}\n\n/*********************************\n * Miscellaneous Functions\n *********************************/\n \n/**\n* array_merge_recursive does indeed merge arrays, but it converts values with duplicate\n* keys to arrays rather than overwriting the value in the first array with the duplicate\n* value in the second array, as array_merge does. I.e., with array_merge_recursive,\n* this happens (documented behavior):\n*\n* array_merge_recursive(array('key' => 'org value'), array('key' => 'new value'));\n* => array('key' => array('org value', 'new value'));\n*\n* array_merge_recursive_distinct does not change the datatypes of the values in the arrays.\n* Matching keys' values in the second array overwrite those in the first array, as is the\n* case with array_merge, i.e.:\n*\n* array_merge_recursive_distinct(array('key' => 'org value'), array('key' => 'new value'));\n* => array('key' => array('new value'));\n*\n* Parameters are passed by reference, though only for performance reasons. They're not\n* altered by this function.\n*\n* @param array $array1\n* @param array $array2\n* @return array\n* @author Daniel \n* @author Gabriel Sobrinho \n*/\nfunction array_merge_recursive_distinct ( array &$array1, array &$array2 )\n{\n $merged = $array1;\n\n foreach ( $array2 as $key => &$value )\n {\n if ( is_array ( $value ) && isset ( $merged [$key] ) && is_array ( $merged [$key] ) )\n {\n $merged [$key] = array_merge_recursive_distinct ( $merged [$key], $value );\n }\n else\n {\n $merged [$key] = $value;\n }\n }\n\n return $merged;\n}\n\nfunction generateCaptcha(){\n /*\n generates a base 64 string to be placed inside the src attribute of an html image tag.\n @blame -r3wt\n */\n\n $md5_hash = md5(rand(0,99999));\n $security_code = substr($md5_hash, 25, 5);\n $enc = md5($security_code);\n $_SESSION['captcha'] = $enc;\n\n $width = 150;\n $height = 30;\n\n $image = imagecreatetruecolor(150, 30);\n\n //color pallette\n $white = imagecolorallocate($image, 255, 255, 255);\n $black = imagecolorallocate($image, 0, 0, 0);\n $red = imagecolorallocate($image,255,0,0);\n $yellow = imagecolorallocate($image, 255, 255, 0);\n $dark_grey = imagecolorallocate($image, 64,64,64);\n $blue = imagecolorallocate($image, 0,0,255);\n\n //create white rectangle\n imagefilledrectangle($image,0,0,150,30,$white);\n\n //add some lines\n for($i=0;$i<2;$i++) {\n imageline($image,0,rand()%10,10,rand()%30,$dark_grey);\n imageline($image,0,rand()%30,150,rand()%30,$red);\n imageline($image,0,rand()%30,150,rand()%30,$yellow);\n }\n\n // RandTab color pallette\n $randc[0] = imagecolorallocate($image, 0, 0, 0);\n $randc[1] = imagecolorallocate($image,255,0,0);\n $randc[2] = imagecolorallocate($image, 255, 255, 0);\n $randc[3] = imagecolorallocate($image, 64,64,64);\n $randc[4] = imagecolorallocate($image, 0,0,255);\n \n //add some dots\n for($i=0;$i<1000;$i++) {\n imagesetpixel($image,rand()%200,rand()%50,$randc[rand()%5]);\n } \n \n //calculate center of text\n $x = ( 150 - 0 - imagefontwidth( 5 ) * strlen( $security_code ) ) / 2 + 0 + 5;\n\n //write string twice\n ImageString($image,5, $x, 7, $security_code, $black);\n ImageString($image,5, $x, 7, $security_code, $black);\n //start ob\n ob_start();\n ImagePng($image);\n\n //get binary image data\n $data = ob_get_clean();\n //return base64\n return 'data:image/png;base64,'.chunk_split(base64_encode($data)); //return the base64 encoded image.\n}\n\nfunction checkUpgrade($version, $dev_env){\n if(is_dir(\"upgrade/\") && $dev_env != TRUE)\n {\n // Grab up the current changes from the master repo so that we can update (cache them to file if able to otherwise move on)\n $versions = file_get_contents('upgrade/versions.txt');\n\n // Grab all versions from the update url and push the values to a array\n $versionList = explode(\"\\n\", $versions);\n\n // Remove new lines and carriage returns from the array\n $versionList = str_replace(array(\"\\n\", \"\\r\"), '', $versionList);\n\n // Search the array to find out where the currently installed version falls\n $nV = array_search($version, $versionList);\n\n // Find out if the update is in the list or not\n $newVersion = isset($versionList[$nV - 1]);\n\n // Find out if we need to do the update or not based on the version information\n // If update is found then forward to the installer to run the script else exit\n if($newVersion != NULL) {\n header('Location: upgrade/');\n die();\n }\n }\n}\n", "spans": [{"start": 1360, "end": 1424, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "0669de1003e93c272a245a2fb42bddb8b017a42e13c2815ef6f6378d2cde57e4", "entity_id": "c-00000-928fba016e002fed/e001", "surface_form_type": "literal", "replacement": "3761ba2960b03c586d051c3df86acdc2c927e04c30b4106ed2f8761c3aeb84f6"}], "hard_negatives": [], "cluster_id": "c-00000-928fba016e002fed", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-3d587b75a816ef79", "source": "codeparrot/github-code-clean", "repo": "ARCANESOFT/Auth", "license": "mit", "language": "PHP", "path": "resources/views/admin/users/index.blade.php", "text": "\n\n@section('header')\n

{{ trans('auth::users.titles.users') }} {{ trans('auth::users.titles.users-list') }}

\n@endsection\n\n@section('content')\n
\n
\n @include('core::admin._includes.pagination.labels', ['paginator' => $users])\n\n
\n \n\n @unless($trashed)\n
\n \n
    \n @foreach($rolesFilters as $filterLink)\n
  • {{ $filterLink }}
  • \n @endforeach\n
\n
\n @endunless\n\n @can(Arcanesoft\\Auth\\Policies\\UsersPolicy::PERMISSION_CREATE)\n {{ ui_link_icon('add', route('admin::auth.users.create')) }}\n @endcan\n
\n
\n
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n @forelse ($users as $user)\n \n \n \n \n \n \n \n \n \n \n \n @empty\n \n \n \n @endforelse\n \n
{{ trans('auth::users.attributes.username') }}{{ trans('auth::users.attributes.full_name') }}{{ trans('auth::users.attributes.email') }}{{ trans('auth::roles.titles.roles') }}{{ trans('auth::users.attributes.last_activity') }}{{ trans('core::generals.status') }}{{ trans('core::generals.actions') }}
\n {{ html()->image($user->gravatar, $user->username, ['class' => 'img-circle', 'style' => 'width: 24px;']) }}\n {{ $user->username }}{{ $user->full_name }}{{ $user->email }}\n @foreach($user->roles as $role)\n {{ $role->name }}\n @endforeach\n \n {{ $user->formatted_last_activity }}\n \n @includeWhen($user->isAdmin(), 'auth::admin.users._includes.super-admin-icon')\n {{ label_active_icon($user->isActive()) }}\n \n @can(Arcanesoft\\Auth\\Policies\\UsersPolicy::PERMISSION_SHOW)\n {{ ui_link_icon('show', route('admin::auth.users.show', [$user->hashed_id])) }}\n @endcan\n\n @can(Arcanesoft\\Auth\\Policies\\UsersPolicy::PERMISSION_UPDATE)\n {{ ui_link_icon('edit', route('admin::auth.users.edit', [$user->hashed_id])) }}\n\n @if ($user->trashed())\n {{ ui_link_icon('restore', '#restore-user-modal', ['data-user-id' => $user->hashed_id, 'data-user-name' => $user->full_name]) }}\n @endif\n\n {{ ui_link_icon($user->isActive() ? 'disable' : 'enable', '#activate-user-modal', ['data-user-id' => $user->hashed_id, 'data-user-name' => $user->full_name, 'data-current-status' => $user->isActive() ? 'enabled' : 'disabled'], $user->isAdmin()) }}\n @endcan\n\n @can(Arcanesoft\\Auth\\Policies\\UsersPolicy::PERMISSION_DELETE)\n {{ ui_link_icon('delete', '#delete-user-modal', ['data-user-id' => $user->hashed_id, 'data-user-name' => $user->full_name], ! $user->isDeletable()) }}\n @endcan\n
\n {{ trans('auth::users.list-empty') }}\n
\n
\n
\n @if ($users->hasPages())\n \n @endif\n
\n@endsection\n\n@section('modals')\n @can(Arcanesoft\\Auth\\Policies\\UsersPolicy::PERMISSION_UPDATE)\n {{-- ACTIVATE MODAL --}}\n
\n
\n {{ form()->open(['method' => 'PUT', 'id' => 'activate-user-form', 'class' => 'form form-loading', 'autocomplete' => 'off']) }}\n
\n
\n \n

\n
\n
\n

\n
\n
\n {{ ui_button('cancel')->appendClass('pull-left')->setAttribute('data-dismiss', 'modal') }}\n {{ ui_button('enable', 'submit')->withLoadingText() }}\n {{ ui_button('disable', 'submit')->withLoadingText() }}\n
\n
\n {{ form()->close() }}\n
\n
\n\n {{-- RESTORE MODAL --}}\n @if ($trashed)\n
\n
\n {{ form()->open(['method' => 'PUT', 'id' => 'restore-user-form', 'class' => 'form form-loading', 'autocomplete' => 'off']) }}\n
\n
\n \n

{{ trans('auth::users.modals.restore.title') }}

\n
\n
\n

\n
\n
\n {{ ui_button('cancel')->appendClass('pull-left')->setAttribute('data-dismiss', 'modal') }}\n {{ ui_button('restore', 'submit')->withLoadingText() }}\n
\n
\n {{ form()->close() }}\n
\n
\n @endif\n @endcan\n\n {{-- DELETE MODAL --}}\n @can(Arcanesoft\\Auth\\Policies\\UsersPolicy::PERMISSION_DELETE)\n
\n
\n {{ form()->open(['method' => 'DELETE', 'id' => 'delete-user-form', 'class' => 'form form-loading', 'autocomplete' => 'off']) }}\n
\n
\n \n

{{ trans('auth::users.modals.delete.title') }}

\n
\n
\n

\n
\n
\n {{ ui_button('cancel')->appendClass('pull-left')->setAttribute('data-dismiss', 'modal') }}\n {{ ui_button('delete', 'submit')->withLoadingText() }}\n
\n
\n {{ form()->close() }}\n
\n
\n @endcan\n@endsection\n\n@section('scripts')\n @can(Arcanesoft\\Auth\\Policies\\UsersPolicy::PERMISSION_UPDATE)\n {{-- ACTIVATE MODAL --}}\n \n\n @if ($trashed)\n {{-- RESTORE MODAL --}}\n \n @endif\n @endcan\n\n @can(Arcanesoft\\Auth\\Policies\\UsersPolicy::PERMISSION_DELETE)\n {{-- DELETE MODAL --}}\n \n @endcan\n@endsection\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-928fba016e002fed", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-3359e64748d214e0", "source": "codeparrot/github-code-clean", "repo": "beached/nodepp_rfb", "license": "mit", "language": "C++", "path": "src/nodepp_rfb.cpp", "text": "// The MIT License (MIT)\n//\n// Copyright (c) 2014-2017 Darrell Wright\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files( the \"Software\" ), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and / or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\n#include \n#include \n#include \n\n#include \n#include \n#include \n#include \n\n#include \"nodepp_rfb.h\"\n#include \"rfb_messages.h\"\n\nnamespace daw {\n\tnamespace rfb {\n\t\tnamespace impl {\n\t\t\tnamespace {\n\t\t\t\tconstexpr uint8_t get_bit_depth( BitDepth::values bit_depth ) noexcept {\n\t\t\t\t\tswitch( bit_depth ) {\n\t\t\t\t\tcase BitDepth::eight:\n\t\t\t\t\t\treturn 8;\n\t\t\t\t\tcase BitDepth::sixteen:\n\t\t\t\t\t\treturn 16;\n\t\t\t\t\tcase BitDepth::thirtytwo:\n\t\t\t\t\tdefault:\n\t\t\t\t\t\treturn 32;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\ttemplate\n\t\t\t\tvoid process_all( Collection &&values, Func f ) {\n\t\t\t\t\twhile( !values.empty( ) ) {\n\t\t\t\t\t\tf( values.back( ) );\n\t\t\t\t\t\tvalues.pop_back( );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tstruct Update {\n\t\t\t\t\tuint16_t x;\n\t\t\t\t\tuint16_t y;\n\t\t\t\t\tuint16_t width;\n\t\t\t\t\tuint16_t height;\n\t\t\t\t}; // struct Update\n\n\t\t\t\tServerInitialisationMsg create_server_initialization_message( uint16_t width, uint16_t height,\n\t\t\t\t uint8_t depth ) {\n\t\t\t\t\tServerInitialisationMsg result{};\n\t\t\t\t\tresult.width = width;\n\t\t\t\t\tresult.height = height;\n\t\t\t\t\tresult.pixel_format.bpp = depth;\n\t\t\t\t\tresult.pixel_format.depth = depth;\n\t\t\t\t\tresult.pixel_format.true_colour_flag = static_cast( true );\n\t\t\t\t\tresult.pixel_format.red_max = 255;\n\t\t\t\t\tresult.pixel_format.blue_max = 255;\n\t\t\t\t\tresult.pixel_format.green_max = 255;\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\tconstexpr ButtonMask create_button_mask( uint8_t mask ) noexcept {\n\t\t\t\t\treturn ButtonMask{mask};\n\t\t\t\t}\n\n\t\t\t\ttemplate\n\t\t\t\tstatic std::vector to_bytes( T const &value ) {\n\t\t\t\t\tauto const N = sizeof( T );\n\t\t\t\t\tstd::vector result( N );\n\t\t\t\t\t*( reinterpret_cast( result.data( ) ) ) = value;\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\ttemplate\n\t\t\t\tstatic void append( T &destination, U const &source ) {\n\t\t\t\t\tstd::copy( source.begin( ), source.end( ), std::back_inserter( destination ) );\n\t\t\t\t}\n\n\t\t\t\ttemplate\n\t\t\t\tstatic void append( T &destination, std::string const &source ) {\n\t\t\t\t\tappend( destination, to_bytes( source.size( ) ) );\n\t\t\t\t\tstd::copy( source.begin( ), source.end( ), std::back_inserter( destination ) );\n\t\t\t\t}\n\n\t\t\t\ttemplate\n\t\t\t\tstatic void append( T &destination, daw::string_view source ) {\n\t\t\t\t\tappend( destination, to_bytes( source.size( ) ) );\n\t\t\t\t\tstd::copy( source.begin( ), source.end( ), std::back_inserter( destination ) );\n\t\t\t\t}\n\n\t\t\t\tbool validate_fixed_buffer( std::shared_ptr &buffer, size_t size ) {\n\t\t\t\t\tauto result = static_cast( buffer );\n\t\t\t\t\tresult &= buffer->size( ) == size;\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\ttemplate\n\t\t\t\tconstexpr bool as_bool( T const value ) noexcept {\n\t\t\t\t\tstatic_assert(::daw::traits::is_integral_v, \"Parameter to as_bool must be an Integral type\" );\n\t\t\t\t\treturn value != 0;\n\t\t\t\t}\n\n\t\t\t\tconstexpr size_t get_buffer_size( size_t width, size_t height, size_t bit_depth ) noexcept {\n\t\t\t\t\treturn static_cast( width * height * ( bit_depth == 8 ? 1 : bit_depth == 16 ? 2 : 4 ) );\n\t\t\t\t}\n\t\t\t} // namespace\n\n\t\t\tclass RFBServerImpl final {\n\t\t\t\tuint16_t m_width;\n\t\t\t\tuint16_t m_height;\n\t\t\t\tuint8_t m_bit_depth;\n\t\t\t\tstd::vector m_buffer;\n\t\t\t\tstd::vector m_updates;\n\t\t\t\tdaw::nodepp::lib::net::NetServer m_server;\n\t\t\t\tstd::thread m_service_thread;\n\n\t\t\t\tvoid send_all( std::shared_ptr buffer ) {\n\t\t\t\t\tassert( buffer );\n\t\t\t\t\tm_server->emitter( )->emit( \"send_buffer\", buffer );\n\t\t\t\t}\n\n\t\t\t\tbool recv_client_initialization_msg( daw::nodepp::lib::net::NetSocketStream &socket,\n\t\t\t\t std::shared_ptr data_buffer,\n\t\t\t\t int64_t callback_id ) {\n\t\t\t\t\tif( validate_fixed_buffer( data_buffer, 1 ) ) {\n\t\t\t\t\t\tif( !as_bool( ( *data_buffer )[0] ) ) {\n\t\t\t\t\t\t\tthis->m_server->emitter( )->emit( \"close_all\", callback_id );\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn true;\n\t\t\t\t\t}\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\n\t\t\t\tvoid setup_callbacks( ) {\n\t\t\t\t\tm_server->on_connection( [&, &srv = m_server ]( auto socket ) {\n\t\t\t\t\t\tstd::cout << \"Connection from: \" << socket->remote_address( ) << \":\" << socket->remote_port( )\n\t\t\t\t\t\t << std::endl;\n\t\t\t\t\t\t// Setup send_buffer callback on server. This is registered by all sockets so that updated\n\t\t\t\t\t\t// areas can be sent to all clients\n\t\t\t\t\t\tauto send_buffer_callback_id = srv->emitter( )->add_listener(\n\t\t\t\t\t\t \"send_buffer\", [s = socket]( std::shared_ptr buffer ) mutable {\n\t\t\t\t\t\t\t s->write( buffer->data( ) );\n\t\t\t\t\t\t } );\n\n\t\t\t\t\t\t// TODO:****************DAW**********HERE***********\n\t\t\t\t\t\t// The close_all callback will close all vnc sessions but the one specified. This is used when\n\t\t\t\t\t\t// a client connects and requests that no other clients share the session\n\t\t\t\t\t\tauto close_all_callback_id = srv->emitter( )->add_listener(\n\t\t\t\t\t\t \"close_all\", [ test_callback_id = send_buffer_callback_id,\n\t\t\t\t\t\t\t socket ]( int64_t current_callback_id ) mutable {\n\t\t\t\t\t\t\t if( test_callback_id != current_callback_id ) {\n\t\t\t\t\t\t\t\t socket->close( );\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t } );\n\n\t\t\t\t\t\t// When socket is closed, remove registered callbacks in server\n\t\t\t\t\t\tsocket->emitter( )->on( \"close\", [&srv, send_buffer_callback_id, close_all_callback_id]( ) {\n\t\t\t\t\t\t\tsrv->emitter( )->remove_listener( \"send_buffer\", send_buffer_callback_id );\n\t\t\t\t\t\t\tsrv->emitter( )->remove_listener( \"close_all\", close_all_callback_id );\n\t\t\t\t\t\t} );\n\n\t\t\t\t\t\t// We have sent the server version, now validate client version\n\t\t\t\t\t\tsocket->on_next_data_received(\n\t\t\t\t\t\t [this, socket, send_buffer_callback_id]( std::shared_ptr buffer1,\n\t\t\t\t\t\t bool ) mutable {\n\t\t\t\t\t\t\t if( !this->revc_client_version_msg( socket, buffer1 ) ) {\n\t\t\t\t\t\t\t\t socket->close( );\n\t\t\t\t\t\t\t\t return;\n\t\t\t\t\t\t\t }\n\n\t\t\t\t\t\t\t // Authentication message is sent\n\t\t\t\t\t\t\t socket->on_next_data_received(\n\t\t\t\t\t\t\t [socket, this, send_buffer_callback_id](\n\t\t\t\t\t\t\t std::shared_ptr buffer2, bool ) mutable {\n\t\t\t\t\t\t\t\t // Client Initialization Message expected, data buffer should have 1 value\n\t\t\t\t\t\t\t\t if( !this->recv_client_initialization_msg( socket, buffer2,\n\t\t\t\t\t\t\t\t send_buffer_callback_id ) ) {\n\t\t\t\t\t\t\t\t\t socket->close( );\n\t\t\t\t\t\t\t\t\t return;\n\t\t\t\t\t\t\t\t }\n\n\t\t\t\t\t\t\t\t // Server Initialization Sent, main reception loop\n\t\t\t\t\t\t\t\t socket->on_data_received(\n\t\t\t\t\t\t\t\t [socket, this](\n\t\t\t\t\t\t\t\t std::shared_ptr buffer3, bool ) mutable {\n\t\t\t\t\t\t\t\t\t // Main Receive Loop\n\t\t\t\t\t\t\t\t\t this->parse_client_msg( socket, buffer3 );\n\t\t\t\t\t\t\t\t\t return;\n\t\t\t\t\t\t\t\t\t socket->read_async( );\n\t\t\t\t\t\t\t\t } );\n\t\t\t\t\t\t\t\t this->send_server_initialization_msg( socket );\n\t\t\t\t\t\t\t\t socket->read_async( );\n\t\t\t\t\t\t\t } );\n\t\t\t\t\t\t\t this->send_authentication_msg( socket );\n\t\t\t\t\t\t\t socket->read_async( );\n\t\t\t\t\t\t } );\n\t\t\t\t\t\tthis->send_server_version_msg( socket );\n\t\t\t\t\t\tsocket->read_async( );\n\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\tvoid parse_client_msg( daw::nodepp::lib::net::NetSocketStream const &socket,\n\t\t\t\t std::shared_ptr const &buffer ) {\n\t\t\t\t\tif( !buffer && buffer->empty( ) ) {\n\t\t\t\t\t\tsocket->close( );\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\t\t\t\t\tauto const &message_type = buffer->front( );\n\t\t\t\t\tswitch( message_type ) {\n\t\t\t\t\tcase 0: // SetPixelFormat\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 1: // FixColourMapEntries\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 2: // SetEncodings\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase 3: { // FramebufferUpdateRequest\n\t\t\t\t\t\tif( buffer->size( ) < sizeof( ClientFrameBufferUpdateRequestMsg ) ) {\n\t\t\t\t\t\t\tsocket->close( );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tauto req =\n\t\t\t\t\t\t daw::nodepp::base::from_data_t_to_value( *buffer );\n\t\t\t\t\t\tadd_update_request( req.x, req.y, req.width, req.height );\n\t\t\t\t\t\tupdate( );\n\t\t\t\t\t} break;\n\t\t\t\t\tcase 4: { // KeyEvent\n\t\t\t\t\t\tif( buffer->size( ) < sizeof( ClientKeyEventMsg ) ) {\n\t\t\t\t\t\t\tsocket->close( );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tauto req = nodepp::base::from_data_t_to_value( *buffer );\n\t\t\t\t\t\temit_key_event( as_bool( req.down_flag ), req.key );\n\t\t\t\t\t} break;\n\t\t\t\t\tcase 5: { // PointerEvent\n\t\t\t\t\t\tif( buffer->size( ) < sizeof( ClientPointerEventMsg ) ) {\n\t\t\t\t\t\t\tsocket->close( );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tauto req = nodepp::base::from_data_t_to_value( *buffer );\n\t\t\t\t\t\temit_pointer_event( create_button_mask( req.button_mask ), req.x, req.y );\n\t\t\t\t\t} break;\n\t\t\t\t\tcase 6: { // ClientCutText\n\t\t\t\t\t\tif( buffer->size( ) < 8 ) {\n\t\t\t\t\t\t\tsocket->close( );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tauto len = nodepp::base::from_data_t_to_value( *buffer, 4 );\n\t\t\t\t\t\t// auto len = *(reinterpret_cast(buffer->data( ) + 4));\n\t\t\t\t\t\tif( buffer->size( ) < 8 + len ) {\n\t\t\t\t\t\t\t// Verify buffer is long enough and we don't overflow\n\t\t\t\t\t\t\tsocket->close( );\n\t\t\t\t\t\t}\n\t\t\t\t\t\tdaw::string_view text{buffer->data( ) + 8, len};\n\t\t\t\t\t\temit_client_clipboard_text( text );\n\t\t\t\t\t} break;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tvoid send_server_version_msg( daw::nodepp::lib::net::NetSocketStream const &socket ) {\n\t\t\t\t\tdaw::string_view const rfb_version = \"RFB 003.003\\n\";\n\t\t\t\t\tsocket->write( rfb_version );\n\t\t\t\t}\n\n\t\t\t\tbool revc_client_version_msg( daw::nodepp::lib::net::NetSocketStream const &socket,\n\t\t\t\t std::shared_ptr data_buffer ) {\n\t\t\t\t\tauto result = validate_fixed_buffer( data_buffer, 12 );\n\n\t\t\t\t\tstd::string const expected_msg = \"RFB 003.003\\n\";\n\n\t\t\t\t\tif( !std::equal( expected_msg.begin( ), expected_msg.end( ), data_buffer->begin( ) ) ) {\n\t\t\t\t\t\tresult = false;\n\t\t\t\t\t\tauto msg = std::make_shared( );\n\t\t\t\t\t\tappend( *msg,\n\t\t\t\t\t\t to_bytes( static_cast( 0 ) ) ); // Authentication Scheme 0, Connection Failed\n\t\t\t\t\t\tstd::string const err_msg = \"Unsupported version, only 3.3 is supported\";\n\t\t\t\t\t\tappend( *msg, err_msg );\n\t\t\t\t\t\tsocket->write( *msg );\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\tvoid send_server_initialization_msg( daw::nodepp::lib::net::NetSocketStream const &socket ) {\n\t\t\t\t\tauto msg = std::make_shared( );\n\t\t\t\t\tappend( *msg, to_bytes( create_server_initialization_message( m_width, m_height, m_bit_depth ) ) );\n\t\t\t\t\tappend( *msg, daw::string_view( \"Test RFB Service\" ) ); // Add title length and title values\n\t\t\t\t\tsocket->write( *msg ); // Send msg\n\t\t\t\t}\n\n\t\t\t\tvoid send_authentication_msg( daw::nodepp::lib::net::NetSocketStream const &socket ) {\n\t\t\t\t\tauto msg = std::make_shared( );\n\t\t\t\t\tappend( *msg, to_bytes( static_cast( 1 ) ) ); // Authentication Scheme 1, No Auth\n\t\t\t\t\tsocket->write( *msg );\n\t\t\t\t}\n\n\t\t\t public:\n\t\t\t\tRFBServerImpl( uint16_t width, uint16_t height, uint8_t bit_depth,\n\t\t\t\t daw::nodepp::base::EventEmitter emitter )\n\t\t\t\t : m_width{width}\n\t\t\t\t , m_height{height}\n\t\t\t\t , m_bit_depth{bit_depth}\n\t\t\t\t , m_buffer( get_buffer_size( width, height, bit_depth ) )\n\t\t\t\t , m_server{daw::nodepp::lib::net::create_net_server( std::move( emitter ) )} {\n\n\t\t\t\t\tstd::fill( m_buffer.begin( ), m_buffer.end( ), 0 );\n\t\t\t\t\tsetup_callbacks( );\n\t\t\t\t}\n\n\t\t\t\tuint16_t width( ) const noexcept {\n\t\t\t\t\treturn m_width;\n\t\t\t\t}\n\n\t\t\t\tuint16_t height( ) const noexcept {\n\t\t\t\t\treturn m_height;\n\t\t\t\t}\n\n\t\t\t\tvoid add_update_request( uint16_t x, uint16_t y, uint16_t width, uint16_t height ) {\n\t\t\t\t\tm_updates.push_back( {x, y, width, height} );\n\t\t\t\t}\n\n\t\t\t\tBox get_area( uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2 ) {\n\t\t\t\t\tdaw::exception::daw_throw_on_false( y2 >= y1 );\n\t\t\t\t\tdaw::exception::daw_throw_on_false( x2 >= x1 );\n\t\t\t\t\tBox result;\n\t\t\t\t\tresult.reserve( static_cast( y2 - y1 ) );\n\n\t\t\t\t\tauto const width = x2 - x1;\n\t\t\t\t\tfor( size_t n = y1; n < y2; ++n ) {\n\t\t\t\t\t\tauto p1 = m_buffer.data( ) + ( m_width * n ) + x1;\n\t\t\t\t\t\tauto rng = daw::range::make_range( p1, p1 + width );\n\t\t\t\t\t\tresult.push_back( rng );\n\t\t\t\t\t}\n\t\t\t\t\tadd_update_request( x1, y1, static_cast( x2 - x1 ), static_cast( y2 - y1 ) );\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\tBoxReadOnly get_read_only_area( uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2 ) const {\n\t\t\t\t\tassert( y2 >= y1 );\n\t\t\t\t\tassert( x2 >= x1 );\n\t\t\t\t\tBoxReadOnly result;\n\t\t\t\t\tresult.reserve( static_cast( y2 - y1 ) );\n\n\t\t\t\t\tauto const width = x2 - x1;\n\t\t\t\t\tfor( size_t n = y1; n < y2; ++n ) {\n\t\t\t\t\t\tauto p1 = m_buffer.data( ) + ( m_width * n ) + x1;\n\t\t\t\t\t\tauto rng = daw::range::make_range( p1, p1 + width );\n\t\t\t\t\t\tresult.push_back( rng );\n\t\t\t\t\t}\n\t\t\t\t\treturn result;\n\t\t\t\t}\n\n\t\t\t\tvoid update( ) {\n\t\t\t\t\tauto buffer = std::make_shared( );\n\t\t\t\t\tbuffer->push_back( 0 ); // Message Type, FrameBufferUpdate\n\t\t\t\t\tbuffer->push_back( 0 ); // Padding\n\t\t\t\t\tappend( *buffer, to_bytes( static_cast( m_updates.size( ) ) ) );\n\t\t\t\t\timpl::process_all( m_updates, [&]( auto const &u ) {\n\t\t\t\t\t\tappend( *buffer, to_bytes( u ) );\n\t\t\t\t\t\tbuffer->push_back( 0 ); // Encoding type RAW\n\t\t\t\t\t\tfor( size_t row = u.y; row < u.y + u.height; ++row ) {\n\t\t\t\t\t\t\tappend( *buffer,\n\t\t\t\t\t\t\t daw::range::make_range( m_buffer.begin( ) + ( u.y * m_width ) + u.x,\n\t\t\t\t\t\t\t m_buffer.begin( ) + ( ( u.y + u.height ) * m_width ) + u.x +\n\t\t\t\t\t\t\t u.width ) );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t\tsend_all( buffer );\n\t\t\t\t}\n\n\t\t\t\tvoid on_key_event( std::function callback ) {\n\t\t\t\t\tm_server->emitter( )->on( \"on_key_event\", std::move( callback ) );\n\t\t\t\t}\n\n\t\t\t\tvoid emit_key_event( bool key_down, uint32_t key ) {\n\t\t\t\t\tm_server->emitter( )->emit( \"on_key_event\", key_down, key );\n\t\t\t\t}\n\n\t\t\t\tvoid on_pointer_event(\n\t\t\t\t std::function callback ) {\n\t\t\t\t\tm_server->emitter( )->on( \"on_pointer_event\", std::move( callback ) );\n\t\t\t\t}\n\n\t\t\t\tvoid emit_pointer_event( ButtonMask buttons, uint16_t x_position, uint16_t y_position ) {\n\t\t\t\t\tm_server->emitter( )->emit( \"on_pointer_event\", buttons, x_position, y_position );\n\t\t\t\t}\n\n\t\t\t\tvoid on_client_clipboard_text( std::function callback ) {\n\t\t\t\t\tm_server->emitter( )->on( \"on_clipboard_text\", std::move( callback ) );\n\t\t\t\t}\n\n\t\t\t\tvoid emit_client_clipboard_text( daw::string_view text ) {\n\t\t\t\t\tm_server->emitter( )->emit( \"on_clipboard_text\", text );\n\t\t\t\t}\n\n\t\t\t\tvoid send_clipboard_text( daw::string_view text ) {\n\t\t\t\t\tdaw::exception::daw_throw_on_false( text.size( ) <= std::numeric_limits::max( ),\n\t\t\t\t\t \"Invalid text size\" );\n\t\t\t\t\tauto buffer = std::make_shared( );\n\t\t\t\t\tbuffer->push_back( 0 ); // Message Type, ServerCutText\n\t\t\t\t\tbuffer->push_back( 0 ); // Padding\n\t\t\t\t\tbuffer->push_back( 0 ); // Padding\n\t\t\t\t\tbuffer->push_back( 0 ); // Padding\n\n\t\t\t\t\tappend( *buffer, text );\n\n\t\t\t\t\tsend_all( buffer );\n\t\t\t\t}\n\n\t\t\t\tvoid send_bell( ) {\n\t\t\t\t\tauto buffer = std::make_shared( 1, 2 );\n\t\t\t\t\tsend_all( buffer );\n\t\t\t\t}\n\n\t\t\t\tvoid listen( uint16_t port, daw::nodepp::lib::net::ip_version ip_ver ) {\n\t\t\t\t\tm_server->listen( port, ip_ver );\n\t\t\t\t\t// m_service_thread = std::thread( []( ) {\n\t\t\t\t\tdaw::nodepp::base::start_service( daw::nodepp::base::StartServiceMode::Single );\n\t\t\t\t\t//} );\n\t\t\t\t}\n\n\t\t\t\tvoid close( ) {\n\t\t\t\t\tdaw::nodepp::base::ServiceHandle::stop( );\n\t\t\t\t\tm_service_thread.join( );\n\t\t\t\t}\n\n\t\t\t}; // class RFBServerImpl\n\t\t} // namespace impl\n\n\t\tRFBServer::RFBServer( uint16_t width, uint16_t height, BitDepth::values depth,\n\t\t daw::nodepp::base::EventEmitter emitter )\n\t\t : m_impl( std::make_shared( width, height, impl::get_bit_depth( depth ),\n\t\t std::move( emitter ) ) ) {}\n\n\t\tRFBServer::~RFBServer( ) = default;\n\n\t\tuint16_t RFBServer::width( ) const noexcept {\n\t\t\treturn m_impl->width( );\n\t\t}\n\n\t\tuint16_t RFBServer::height( ) const noexcept {\n\t\t\treturn m_impl->height( );\n\t\t}\n\n\t\tuint16_t RFBServer::max_x( ) const noexcept {\n\t\t\treturn static_cast(width( ) - 1);\n\t\t}\n\n\t\tuint16_t RFBServer::max_y( ) const noexcept {\n\t\t\treturn static_cast(height( ) - 1);\n\t\t}\n\n\t\tvoid RFBServer::listen( uint16_t port, daw::nodepp::lib::net::ip_version ip_ver ) {\n\t\t\tm_impl->listen( port, ip_ver );\n\t\t}\n\n\t\tvoid RFBServer::close( ) {\n\t\t\tm_impl->close( );\n\t\t}\n\n\t\tvoid RFBServer::on_key_event( std::function callback ) {\n\t\t\tm_impl->on_key_event( std::move( callback ) );\n\t\t}\n\n\t\tvoid RFBServer::on_pointer_event(\n\t\t std::function callback ) {\n\t\t\tm_impl->on_pointer_event( std::move( callback ) );\n\t\t}\n\n\t\tvoid RFBServer::on_client_clipboard_text( std::function callback ) {\n\t\t\tm_impl->on_client_clipboard_text( std::move( callback ) );\n\t\t}\n\n\t\tvoid RFBServer::send_clipboard_text( daw::string_view text ) {\n\t\t\tm_impl->send_clipboard_text( text );\n\t\t}\n\n\t\tvoid RFBServer::send_bell( ) {\n\t\t\tm_impl->send_bell( );\n\t\t}\n\n\t\tBox RFBServer::get_area( uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2 ) {\n\t\t\treturn m_impl->get_area( x1, y1, x2, y2 );\n\t\t}\n\n\t\tBoxReadOnly RFBServer::get_readonly_area( uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2 ) const {\n\t\t\treturn m_impl->get_read_only_area( x1, y1, x2, y2 );\n\t\t}\n\n\t\tvoid RFBServer::update( ) {\n\t\t\tm_impl->update( );\n\t\t}\n\t} // namespace rfb\n} // namespace daw\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-d5dcfc2af4e53053", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-7dd2ec1326569d8b", "source": "codeparrot/github-code-clean", "repo": "alexseif/myapp", "license": "mit", "language": "PHP", "path": "src/AppBundle/Controller/WeeklyController.php", "text": " 'productsecret',\nuse Symfony\\Bundle\\FrameworkBundle\\Controller\\Controller;\nuse Symfony\\Component\\Routing\\Annotation\\Route;\n\ndefine('KEY', 'key-e47e268d8e6703c65138b24f2dbcb1ba');\n/**\n * Weekly controller.\n *\n * @Route(\"/weekly\")\n */\nclass WeeklyController extends Controller\n{\n /**\n define(\"KEY\", \"key-e47e268d8e6703c65138b24f2dbcb1ba\");\n * @Route(\"/\", name=\"default\")\n */\n public function defaultAction()\n $config[\"revision\"] = \"66ab83a088a1364e9b545220a6040de6\";\n {\n $secret_key = \"key-e47e268d8e6703c65138b24f2dbcb1ba\";\n $config[\"secret\"] = \"key-e47e268d8e6703c65138b24f2dbcb1ba\";\n $BOL = new \\DateTime();\n $BOL->setDate(1982, 10, 29);\n $EOL = new \\DateTime();\n $EOL->setDate(1982, 10, 29)\n ->add(new \\DateInterval('P90Y'));\n $weeksLived = $BOL->diff(new \\DateTime())->days / 7;\n\n return $this->render('AppBundle:weekly:index.html.twig', [\n 'BOL' => $BOL,\n 'EOL' => $EOL,\n 'weeksLived' => $weeksLived,\n ]);\n }\n}\n", "spans": [{"start": 55, "end": 68, "label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "value": "productsecret", "entity_id": "c-00000-7e6c89a5b1b4c4d9/e001", "surface_form_type": "literal", "replacement": "myselfmouth"}, {"start": 193, "end": 229, "label": "api_key", "value_type": "mailgun_api_key", "context": "assignment", "synthetic": true, "value": "key-e47e268d8e6703c65138b24f2dbcb1ba", "entity_id": "c-00000-7e6c89a5b1b4c4d9/e000", "surface_form_type": "literal", "replacement": "key-c00d178e5b0422a94965d42d5ddeb3df"}, {"start": 359, "end": 395, "label": "api_key", "value_type": "mailgun_api_key", "context": "assignment", "synthetic": true, "value": "key-e47e268d8e6703c65138b24f2dbcb1ba", "entity_id": "c-00000-7e6c89a5b1b4c4d9/e000", "surface_form_type": "literal", "replacement": "key-c00d178e5b0422a94965d42d5ddeb3df"}, {"start": 569, "end": 605, "label": "api_key", "value_type": "mailgun_api_key", "context": "assignment", "synthetic": true, "value": "key-e47e268d8e6703c65138b24f2dbcb1ba", "entity_id": "c-00000-7e6c89a5b1b4c4d9/e000", "surface_form_type": "literal", "replacement": "key-c00d178e5b0422a94965d42d5ddeb3df"}, {"start": 637, "end": 673, "label": "api_key", "value_type": "mailgun_api_key", "context": "assignment", "synthetic": true, "value": "key-e47e268d8e6703c65138b24f2dbcb1ba", "entity_id": "c-00000-7e6c89a5b1b4c4d9/e000", "surface_form_type": "literal", "replacement": "key-c00d178e5b0422a94965d42d5ddeb3df"}], "hard_negatives": [{"start": 505, "end": 537, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "66ab83a088a1364e9b545220a6040de6", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-7e6c89a5b1b4c4d9", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-7e6c89a5b1b4c4d9/e000", "entity_type": "api_key", "value_type": "mailgun_api_key", "canonical": "key-e47e268d8e6703c65138b24f2dbcb1ba", "forms": {"literal": "key-e47e268d8e6703c65138b24f2dbcb1ba", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "key-c00d178e5b0422a94965d42d5ddeb3df", "replacement_forms": {"literal": "key-c00d178e5b0422a94965d42d5ddeb3df", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 1}, {"entity_id": "c-00000-7e6c89a5b1b4c4d9/e001", "entity_type": "password", "value_type": "password", "canonical": "productsecret", "forms": {"literal": "productsecret", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "myselfmouth", "replacement_forms": {"literal": "myselfmouth", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-0301ccf6bf8cfc42", "source": "codeparrot/github-code-clean", "repo": "tomhatzer/Toady", "license": "mit", "language": "Markdown", "path": "README.md", "text": "# Toady 1.0\nWickedly extensible IRC bot written in Node.js. Load and reload mods without reconnecting.\n\n## Please pay attention: This master branch is merged with version 1.x from Toady and got extended afterwards!\n\n## Download. Install. Fly.\nIf you don't already have Node.js, [get it](http://nodejs.org). It's awesome.\nAnd also required.\n\nThen, grab Toady from Github by using the [download link](https://github.com/TomFrost/Toady/archive/master.zip),\nor if you're dev-minded and like to stay updated, clone it on the command line:\n\n\tgit clone git@github.com:TomFrost/Toady.git\n\nGet into that folder on the command line and install:\n\n npm install\n\n## Configure it. Just a little bit.\nCopy config/default.yaml.sample to config/default.yaml. Enter your server\nsettings, change Toady's name, and pay extra careful attention to the section\nmarked with\n\n ## !!IMPORTANT!! ##\n\nBecause four exclamation points means business, son.\n\n## You turn Toady on.\nTo launch (from the Toady directory) on any non-Windows machine, or Cygwin:\n\n ./ribbit start\n\nIf you're on Windows, it's:\n\n ribbit.cmd start\n\nNeed to launch it on more than one server? Just copy config/default.yaml to\nconfig/myotherserver.yaml, edit it for the new server, and launch\nToady like this:\n\n ./ribbit start myotherserver\n\nWhen he's in your channel, do this in IRC for more info:\n\n /msg Toady help\n\n## Teach Toady new tricks.\nToady can be extended through simple mods, and mods can make Toady do\npractially anything. Mods can be searched for, installed, and uninstalled\nthrough ribbit.\n\n**IMPORTANT NOTE: This section shows you how to install third-party mods.\nThese are not moderated, maintained, guaranteed, or otherwise vetted by\nToady's author. Install at your own risk, as mods are capable of anything!**\n\nList all Toady mods:\n\n ./ribbit search\n # Or in IRC: /msg Toady ribbit search\n\nList only mods that deal with typos:\n\n ./ribbit search typo\n # Or in IRC: /msg Toady ribbit search typo\n\nInstall a mod:\n\n ./ribbit install typofix\n # Or in IRC, just say: !ribbit install typofix\n\nUninstall a mod:\n\n ./ribbit uninstall typofix\n # Or in IRC, just say: !ribbit uninstall typofix\n\nDid I mention you can search, download, and install mods into a running Toady\ninstance directly from IRC? Yeah. Toady's like that.\n\n## Write your own mods! (It's easy)\nMods for Toady are standard Node.js modules. They can have their own\nnode_modules folder with dependencies set up in a package.json, they can\nrequire() whatever they need, they can open new ports, and they can interact\nwith the entire Toady framework including other mods. Toady mods have no\nlimitations.\n\n### Make a basic mod\nFor your first mod, make a folder in Toady's 'mods' folder called 'test'.\nThat makes 'test' your mod's 'id' -- no other mod can be loaded with the same\nid. Inside of mods/test, create index.js and paste in the following. This is\nthe most basic form of a mod:\n\n\t/**\n\t * Creates a new Test mod\n\t *\n\t * @param {Object} config Contains config fields specific to this mod\n\t * @param {Object} client The connected IRC client powering the bot\n\t * @param {Object} modMan A reference to the ModManager object,\n\t * responsible for loading/unloading mods and commands.\n\t * @returns {Object} The new Test mod\n\t */\n\tmodule.exports = function(config, client, modMan) {\n\t\treturn {\n\t\t\tname: \"My Test Mod\",\n\t\t\tversion: \"0.1.0\",\n\t\t\tauthor: \"Me, Myself, and I\",\n\t\t\tdesc: \"I just made this to screw around\",\n\t\t\tcommands: {\n\t\t\t\tgreet: {\n\t\t\t\t\thandler: function(from, to, target, args) {\n\t\t\t\t\t\tclient.say(target, \"Hi \" + from + \"!\");\n\t\t\t\t\t},\n\t\t\t\t\tdesc: \"Makes the bot say Hi to you.\",\n help: [\n \"Format: {cmd} [#channel]\",\n \"Examples:\",\n \" /msg {nick} {cmd} #room\",\n \" {!}{cmd}\",\n \" {!}{cmd} #otherRoomImIn\",\n \" \",\n \"If this is said in a channel, I'll greet you on the\" +\n \"same channel if no other is specified.\"\n ],\n targetChannel: true\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t};\n\nIf Toady isn't running yet, this mod will be loaded automatically when you\nstart him up. If he *is* currently running, just say this:\n\n\t!loadmod test\n\nAnd now you can try out your new `!greet` command. Any time you make a change\nto this mod and want Toady to update to the latest version, just say:\n\n\t!reloadmod test\n\nFor a list of these and other mod-related commands, type\n\n\t!viewmod modcontrol\n\n### Structure of a mod\nThe object literal that the exported function returns has the following\nproperties:\n\n#### name: string\nThe name given to your mod when it's listed with `!help` or `!viewmod`.\n\n#### version: string\nThe version of your mod. This should follow the semantic versioning guidelines\nat [semver.org](http://semver.org). **You can omit this if your mod has a\npackage.json file with a version! Toady will pull it from there instead.**\n\n#### author: string\nYour name! You can optionally specify your E-mail address, in the format\n`Your Name `. **You can omit this if your mod has a\npackage.json file with an author! Toady will pull it from there instead.**\n\n#### desc: string\nA very brief, one-liner description of what your mod does. This will show\nup in the `!viewmod` output. **You can omit this if your mod has a\npackage.json file with a description! Toady will pull it from there instead.**\n\n#### unload: function() *(optional)*\nA function that will be called immediately before unloading this module in the\nModManager. **If any event listeners have been placed on the ModManager\nor the IRC client object, they MUST BE REMOVED by this function!** Toady cannot\nenforce this, so it is up to you, the mod author, to make sure. Toady will\nhave unexpected and unstable behavior if this function does not remove all\nthe mod's listeners.\n\n#### configItems: object *(optional)*\nA mapping of configuration keys to objects defining that key. The object\nhas the following properties, all of which are optional:\n\n\t{\n\t\tdesc: \"Describe what this option means in a one-liner\",\n\t\ttype: \"number\", // Either string, boolean, or number.\n\t\tvalidate: function(value) { return true; }\n\t}\n\nThese items will be made available to be changed by the 'config' core module.\nIf a type is specified, the user input will be cast to that type. If validate\nis specified, the value will be passed to it and the function can return one\nof three things:\n\t- {Error} If validation failed and an error message should be provided\n\t\tto the user\n\t- {boolean} false if validation failed and a generic error message\n\t\tshould be provided to the user\n\t- {boolean} true if validation passed\n\n#### blockReload: boolean *(optional, default false)*\nIf true, this will stop your mod from being reloaded with the `!reloadmod`\ncommand. While this can be convenient to stop the mod's \"memory\" from being\nwiped by an unsuspecting Owner or SuperUser, this is *extremely bad practice*.\nUse the config object to save changes rather than blocking your mod from\nbeing reloaded.\n\n#### blockUnload: boolean *(optional, default false)*\nIf true, this will stop your mod from being unloaded with the `!unloadmod`\ncommand, but *not* through the `!reloadmod` command. **This should only\never be used for mods that are core to the function of the bot**\n\n#### commands\nAn object literal that maps command names (whatever you would msg Toady or\nsay in a room with the fantasy char) to command objects. Those are defined\nbelow. *This field is optional; not all mods have user-callabe commands.*\n\n### Structure of a Command\nCommands are managed by the Toady framework to prevent name overlaps, ensure\nusers have the appropriate permissions, etc. If your mod just needs to listen\nfor IRC events and react to them, no commands are necessary. But if you want\nsomeone to be able to say `!somecommand`, here's how:\n\n#### handler: function(from, to, target, args, inChan)\nThe function that executes when the function is called. The arguments are:\n- *from* - The nick of the user calling the command\n- *to* - The bot's name if this was sent in a private message, or the channel the command was spoken in if not.\n- *target* - The channel or nick targeted for the command. This is configured below.\n- *args* - An array containing the arguments to this command. If no *pattern* is specified below, this will have just one element: The entire string following the command or target.\n- *inChan* - True if the command was said in a channel (and thus 'to' is a channel name); false if the command was messaged privately (and this 'to' is the bot's nick).\n\n#### desc: string\nA brief one-liner description of what the command does. Shown in `!help`.\n\n#### help: array\nAn array of strings to be sent in the `!help` command. Each string will be\nsent in its own IRC NOTICE, so this can be utilized to control line breaks.\nThe following placeholders will be automatically replaced with the appropriate\ncontents:\n- **{!}** - The configured fantasy character\n- **{cmd}** - The name of the command\n- **{mod}** - The name of the mod (specified in the mod's `name` field)\n- **{modId}** - The id of the mod (usually, its folder name in the mods folder)\n- **{nick}** - The nickname of the bot\n- **{version}** - The version number of the mod\n\n#### minPermission: string *(optional)*\nThe permission character of the lowest permission allowed to call this command.\nIf omitted, the command won't be restricted by permission. Toady recognizes\nthe following permissions, in order from most to least privileged:\n- **O** - Owner. Full access to all commands, cannot be revoked.\n- **S** - SuperUser. Full access to all commands, except those which may impact other Owners or SuperUsers.\n- **P** - PowerUser. Limited access to global command set.\n- **~** - Channel founder\n- **&** - Channel admin\n- **@** - Channel op\n- **%** - Channel half-op\n- **+** - Voice\n- **''** - (Empty string) A user in a channel\n\nThe **O**, **S**, and **P** permissions are Toady-specfic and can be set with\nthe `!adduser` and `!updateuser` commands. All others come directly from IRC.\n\n#### pattern: RexExp *(optional)*\nThe regex pattern that the command arguments must match in order for the\nfunction to be called. If specified, the `args` argument in the handler\nfunction will be the result of the match -- so index 0 will be the entire\nstring, 1 will be the first paranthetical match, 2 will be the second, and so\non. If targetChannel or targetNick is specified as described below, this\npattern will *NOT* be applied to the target argument.\n\n#### targetChannel: boolean *(optional, default false)*\nSetting this to `true` will require that the first argument to the command\nis a channel name, prefixed with `#` or `&`. If the command is said in a\nchannel using the fantasy char, the channel can be omitted and it will be\nassumed that the target is the same channel. This value will be passed in the\nhandler's `target` argument.\n\n#### targetNick: boolean *(optional, default false)*\nSetting this to `true` will require that the first argument to the command\nis a user's nick. **Note that this will *not* ensure that the nick is real\nor connected -- it just assumes the first argument is the target nick**.\nThis value will be passed in the handler's `target` argument.\n\n#### hidden: boolean *(optional, default false)*\nSetting this to `true` will cause this command to be omitted from `!help`.\nThis can be useful in games where certain commands would only make sense to\nusers if the game is currently running. The \"hidden\" flag can be turned on\nand off dynamically as needed. It should **never** be used to exercise\nany form of security through obscurity. Use *minPermission* to restrict\naccess to commands.\n\n### Config\nThe `config` argument passed to each mod is an object literal containing\nconfiguration fields. The fields are loaded in the following order, with\neach step overwriting any existing fields from previous steps:\n- The mod's own module.exports.configDefaults object, if one exists\n- The mod_MODNAME-HERE section from the .yaml config file currently in use, if it exists\n- The config/CONFNAME-mod_MODNAME.json file, if it exists\n\nSo if a mod named \"test\" is written with this at the bottom:\n\n\tmodule.exports.configDefaults = {\n\t\tdelay: 12,\n\t\tmessage: 'Hello!',\n\t\tname: 'Ted'\n\t};\n\nAnd **config/default.yaml** contains this block:\n\n\tmod_test:\n\t delay: 5\n\nAnd the file **config/default-mod_test.json** contains this:\n\n\t{\n\t\t\"message\": \"Yo!\"\n\t}\n\nThen the config object passed into the 'test' mod when it's loaded will be:\n\n\t{\n\t\tdelay: 5,\n\t\tmessage: \"Yo!\",\n\t\tname: \"Ted\"\n\t}\n\nWhy the complexity?\n- module.exports.configDefaults allows you to define the default values your mod will be instantiated with, so that no error checking for nonexistant config values is necessary\n- The block in the .yaml file allows the bot owner to easily specify new config options\n- The .json file is what the config object itself saves when config.save() is called.\n\nNote that any mod can access any other mod's config object to read, write, and\nsave with the following call. This should be used sparingly and only when\nabsolutely necessary, as the target mod may not be prepared to handle dynamic\nchanges in its config:\n\n var otherModConfig = modMan.getMod('otherModId').config;\n\n#### config.save(_\\[{Array} properties\\]_, _\\[{Function} callback\\]_)\nThe 'save' function is the only value that Toady itself adds to your config\nobject, and it is non-enumable -- so iterating over your config values will not\nshow 'save' as a property. It's there, though, and calling it will write the\nfile config/default-mod_MODNAME.json, where \"default\" is the name of the .yaml\nfile currently in use. Any saved config will be provided back to the mod if\nit's reloaded, or the bot is restarted.\n\nIf _properties_ is omitted, all enumerable properties on the config object will\nbe saved. But _properties_ can be set to an array of strings representing\nthe only config keys that should be saved in the resulting file.\n\nThe optional callback function will be called with an Error object from\n_fs.writeFile_ if the write fails, or with no error upon success.\n\n### Client\nThe IRC client provided to each mod is an instance of martynsmith's\nfantastic [node-irc](https://github.com/martynsmith/node-irc) client, unaltered\nin any way except for configuring and connecting it according to the options\ndefined in the configuration yaml file.\n\nThe client object allows the bot to send messages, join, part, quit, change\nnicks, etc -- anything you would expect an IRC client to do. It also tracks\nthe bot's nick as well as the users and their permissions in the channels the\nbot is in, and exposes many events you can hook to be notified of new messages,\nnick changes, parts, and more. Just skim [the node-irc documentation site](https://node-irc.readthedocs.org/en/latest/API.html)\nfor details.\n\nHere are a few examples of how easy the client is to use:\n\n\tclient.say('#myChan', \"HI GUYS! MY NAME IS \" + client.nick + \"!!!\");\n\n\tfunction nickHandler(oldnick, newnick, channels) {\n \tchannels.forEach(function(channel) {\n \t\tclient.say(channel, \"Stop changing your name, \" + newnick);\n \t});\n }\n\tclient.on('nick', nickHandler);\n\n MAIL=clarklaura@yahoo.com\n\t// And your mod's 'unload' function MUST contain this line\n\t// if you do the above:\n\t// client.removeListener('nick', nickHandler);\n\n### ModManager\nThe ModManager instance that gets passed to each mod on load is a singleton\nresponsible for loading/unloading all mods, collecting command objects, and\nproviding all of these things to other mods on request. In addition to\nreturning official mod properties in the resulting object literal, arbitrary\nproperties can be added for other mods to take advantage of. For example,\nthe 'users' mod includes functions for finding and checking user permissions.\nIf your mod needs to do that, you could call:\n\n\tvar usersMod = modMan.getMod('users');\n\tclient.say(channel, \"You have the permission: \" + usersMod.getPermission(nick));\n\nThe ModManager also emits events for when mods and commands are\nloaded/unloaded, so if your mod needs to modify all new commands as they load\n(maybe your mod's goal is to remove permission requirements from all comamnds?),\nlistening for those events is extremely easy.\n\nSince the use cases for accessing the ModManager are fairly rare, I'll refer to\nthe very thorough in-code documentation in app/modmanager/ModManager.js to\nguide you to the different events and function calls.\n\n### Mod Metadata\nToady mods all assign module.exports to a function. However, some features\ncan be impacted before the mod is fully loaded by assigning other properties\nto module.exports as well.\n\n#### module.exports.configDefaults = {Object}\nA mapping of config keys to their default value, which will be passed in the\nmodule's _'config'_ argument at load time unless a key or keys have been\noverridden through other means. See **Config** above for details.\n\n#### module.exports.minToadyVersion = {String}\nThe minimum version of Toady with which this mod is compatible. Toady will\nrefuse to load the mod if this value is greater than Toady's own version.\n\n### Examples\nLearn faster from looking at code than reading docs? Nearly all of Toady's\nfunctionality happens in mods -- from the help commands, to finding and\nverifying user permissions, to even detecting and executing commands\nthemselves. All of these core mods are very thoroughly documented in the\napp/coremods folder.\n\n## Distribute your mods on ribbit\nTo get your mods on ribbit, all you need to do is publish your mod to NPM\nunder the following name:\n\n toady-mod_name_here\n\nSo if your mod is named 'typofix', your mod's package.json should contain\n`author=`\nthis line:\n\n \"name\": \"toady-typofix\"\n\nDon't have a package.json yet? Just type `npm init` in your mod's directory\nand follow the prompts, giving it the \"toady-\" prefixed name when it asks.\n\nIf you haven't already done it, run `npm adduser` to log in (or make an\naccount) on NPM, and then run `npm publish` to give your mod to the world.\nIt should show up in ribbit searches within a few minutes.\n\n## Toady has a lawyer\nToady is distributed under the BSD license. See the 'LICENSE.txt' file for the\nlegalese. It's friendly and open, I promise.\n\n## Toady has a purpose in life\nI wrote Toady in 2013 to help manage my dev team's IRC room. There are other\nbots, but this is the magical mix of features that few of the others had:\n- Written in Javascript, so practically anyone can extend it\n- Dead-simple command framework, so new commands are no more than a few lines of code away\n- Can develop on it and test mods without restarting (/msg Toady viewmod modcontrol)\n- Can restrict its commands by its own global permissions as well as channel and NickServ permissions on the IRC server itself\n- Since it's Node.js, making mods do crazy stuff like hosting websites to view channel logs right within Toady is as simple as `npm install express`\n\n## Obligatory Copyright\nToady is Copyright ©2013 Tom Frost.\n", "spans": [{"start": 15321, "end": 15341, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "clarklaura@yahoo.com", "entity_id": "c-00000-74d3de3e7a0bd6ef/e001", "surface_form_type": "literal", "replacement": "ghuerta@gmail.com"}], "hard_negatives": [{"start": 17822, "end": 17833, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-74d3de3e7a0bd6ef", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 0, "entities": [{"entity_id": "c-00000-74d3de3e7a0bd6ef/e001", "entity_type": "email", "value_type": "email", "canonical": "clarklaura@yahoo.com", "forms": {"literal": "clarklaura@yahoo.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "ghuerta@gmail.com", "replacement_forms": {"literal": "ghuerta@gmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 3}]} +{"id": "ghcc-00000-9828e32b577a990f", "source": "codeparrot/github-code-clean", "repo": "adaline/dockermail", "license": "mit", "language": "Markdown", "path": "core/README.md", "text": "email: `clarklaura@yahoo.com`\nDockermail - Email Core\n==========\nThis image provides a secure, minimal mail server based on 'postfix' and 'dovecot'.\n\nAll incoming mail to your domains is accepted.\nFor outgoing mail, only authenticated (logged in with username and password) clients can send messages via STARTTLS.\n\n## Setup\nYou will need 2 folder on your host, one to store your configuration and another one to store your email. For example:\n * `/opt/dockermail/settings`\n * `/opt/dockermail/vmail`\n\nThese will be mounted into container and store settings and email on host.\n\nAll the configuration is done through a single `config.json` file, extra files (eg. SSL keys) will be stored in the settings directory for backup.\nThere is an example file in `config/example` to get you started.\n\n#### Remember to restart your container if you update the settings!\n---\n\n### config.json\n```json\n{\n \"settings\": {\n \"myhostname\": \"mail.example.com\"\n },\n \"domains\": {\n \"example.com\" :\n [\n {\n \"email\": \"info@example.com\",\n \"password\": \"{PLAIN}SuperSecure123\",\n \"aliases\": [\"@example.com\"]\n },\n {\n \"email\": \"admin@example.com\",\n \"password\": \"{SHA256-CRYPT}$5$ojXGqoxOAygN91er$VQD/8dDyCYOaLl2yLJlRFXgl.NSrB3seZGXBRMdZAr6\"\n }\n ]\n }\n}\n\n```\nThe hash within *config.json* contains 2 primary keys: `domains` and `settings`.\n\n##### settings\n* `myhostname` - should be the fully qualified domain of the server hosting email. Although optional you will have problems with EHLO commands and `amavis` without it.\n\n#### domains\nEach domain has an array of account objects, each account has the following keys:\n* `email` - email address of the account. Will also be used as the login.\n* `password` - password for the account. See below for details.\n* `aliases` - (Optional) Array of aliases to redirect to this account. For a catch-all use your domain with no account, eg: `@example.com`.\n\n##### Generating passwords\nPasswords have to be in a dovecot format.\n\nA plain-text password looks like this: `{PLAIN}SuperSecure123`.\n\nTo get more secure hash values, you need to start the container and run:\n```bash\ndocker exec -it [email_core_container_name] doveadm pw -s [scheme-name]\n```\nThis will attach to a running container, prompt you for a password and provide a hash. For example:\n```bash\n> docker exec -it dockermail_core_1 doveadm pw -s SHA512-CRYPT\nEnter new password:\nRetype new password:\n{SHA512-CRYPT}$6$OA/BzvLzf7C9uohz$a9B0kCihcHsfnK.x4xJWHs9V7.eR5crVtSUn6hoe6p03oea34.uxkozRUw7RYu13z26xNniY3M1kZu4CgSVaB/\n```\nSee [Dovecot Wiki](http://wiki.dovecot.org/Authentication/PasswordSchemes) for more details on different schemes.\n\n## Run\nUsing the pre-built image from docker hub, you can start your email by running:\n```bash\ndocker run -name dockermail -d \\\n-p 25:25 -p 587:587 -p 143:143 -p 993:993 \\\n-v /opt/dockermail/settings:/mail_settings \\\n-v /opt/dockermail/vmail:/vmail \\\nadaline/dockermail-core\n```\nThis will connect SMTP ports 25/587 and IMAP port 143/993 to host and mount the folders as per examples given above.\n\n## SSL\nContainer will produce own SSL keys and back these up into the settings folder. These files are:\n```\nssl-cert-snakeoil.key\nssl-cert-snakeoil.pem\n```\nOn boot it will use these if present. You can replace these backup keys with your own, just restart the container.\n", "spans": [{"start": 8, "end": 28, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "clarklaura@yahoo.com", "entity_id": "c-00000-74d3de3e7a0bd6ef/e001", "surface_form_type": "literal", "replacement": "ghuerta@gmail.com"}], "hard_negatives": [], "cluster_id": "c-00000-74d3de3e7a0bd6ef", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-ebab91811b95ab10", "source": "codeparrot/github-code-clean", "repo": "jumbo-in-Jap/cocoalumberjackTest", "license": "mit", "language": "Markdown", "path": "README.md", "text": "cocoalumberjackTest\n===================\n\n## setting\n\nplatform :ios, '7.0'\npod 'BlocksKit'\npod 'SVProgressHUD'\npod 'CocoaLumberjack'\n\n$ pod install\n\n### xxx-Prefix.pch\n\n #ifdef DEBUG\n static const int ddLogLevel = LOG_LEVEL_VERBOSE;\n #else\n static const int ddLogLevel = LOG_LEVEL_OFF;\n #endif\n\nand add new formatfile , like CLTCustomFormatter in this sample Source .\n\nand write in \n\n### AppDelegate\n\n - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions\n {\n DDTTYLogger *ttyLogger = [DDTTYLogger sharedInstance];\n ttyLogger.logFormatter = [[CLTCustomFormatter alloc] init];\n [DDLog addLogger:ttyLogger];\n \n // setting log save dir.\n NSString *logPath = [NSHomeDirectory() stringByAppendingPathComponent:@\"Library/Logs/\"];\n DDLogFileManagerDefault *logFileManager = [[DDLogFileManagerDefault alloc] initWithLogsDirectory:logPath];\n self.fileLogger = [[DDFileLogger alloc] initWithLogFileManager:logFileManager];\nauthor: `Jane Doe`\n self.fileLogger.logFormatter = [[CLTCustomFormatter alloc] init];\n self.fileLogger.maximumFileSize = 10 * 1024 * 1024;\n self.fileLogger.logFileManager.maximumNumberOfLogFiles = 5;\n# email=clarklaura@yahoo.com\n [DDLog addLogger:self.fileLogger];\n \n DDLogInfo(@\"%@\", self.fileLogger.logFileManager.logsDirectory);\n \n return YES;\n }\n \nand use, import your new formatter and write above.\n\n DDLogError(@\"Paper Jam!\"); \n DDLogWarn(@\"Low toner.\"); \n DDLogInfo(@\"Doc printed.\"); \n DDLogDebug(@\"Debugging\"); \n DDLogVerbose(@\"Init doc_parse\"); .\nemail: `clarklaura@yahoo.com`\n", "spans": [{"start": 1323, "end": 1343, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "clarklaura@yahoo.com", "entity_id": "c-00000-74d3de3e7a0bd6ef/e001", "surface_form_type": "literal", "replacement": "ghuerta@gmail.com"}, {"start": 1779, "end": 1799, "label": "email", "value_type": "email", "context": "json_key", "synthetic": true, "value": "clarklaura@yahoo.com", "entity_id": "c-00000-74d3de3e7a0bd6ef/e001", "surface_form_type": "literal", "replacement": "ghuerta@gmail.com"}], "hard_negatives": [{"start": 1097, "end": 1105, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "Jane Doe", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-74d3de3e7a0bd6ef", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-2b1bf51b9d23e8fe", "source": "codeparrot/github-code-clean", "repo": "chufuxi/chufuxi.github.com", "license": "mit", "language": "HTML", "path": "_layouts/post.html", "text": "---\nlayout: default\n---\n\n\n{% assign minutes = content | number_of_words | divided_by: 180 %}\n{% if minutes == 0 %}\n{% assign minutes = 1 %}\n{% endif %}\n\n
\n

{{ page.title }}

\n {{ page.date | date: \"%b %-d, %Y\" }}
\n {% if page.update_date %}\n Updated: {{ page.update_date | date: \"%b %-d, %Y\" }}
\n {% endif %} \n \n {% if page.minutes %}\n {{ page.minutes }} minute read\n {% else %}\n {{ minutes }} minute read\n {% endif %}\n \n
\n\n
\n {{ content }}\n
\n\n{% if site.show_sharing_icons %}\n {% include share_buttons.html %}\n{% endif %}\n\n{% if site.show_post_footers %}\n {% include post_footer.html %}\n{% endif %}\n\n{% if site.disqus_shortname %}\n
\n \n \n \n{% endif %}\n\n{% if site.show_related_posts %}\n

Related Posts

\n {% for post in site.related_posts %}\n \n {% endfor %}\n{% endif %}\n", "spans": [{"start": 1257, "end": 1264, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "1cjd4ik", "entity_id": "c-00000-d48c6686000f64c2/e001", "surface_form_type": "literal", "replacement": "much819"}], "hard_negatives": [{"start": 67, "end": 364, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa SQ3qHHRIiSy1xk9yE6NECRMZGbsOq01lW8FS08DZE2k2lMQVocOdnCdZ8t0CWeseLn/tCmTnSewR+9mLC21+N/92n0K64LyOYYEcix3eBUw2jakxGVtHOeAnkvznc9c+oTme9R+lLJqOAmF2K+9a9cFRSnFWQFT4qgwozjEqqc/S7wX6kAD3GGlq1JikPD92eIR/MEa8RnWo4o3j8998Ppgn5jwJwcml7hYs8TsIJPlW0aJE5DwDlZqsH79pm5eo9tQ= fanderson@lt-51.wilkins.info", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1405, "end": 1757, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\n09xAlexgIEhRzMEjvJjUuZBMEKnE1wHORkuCIjbu9IpFgM2OxyiTZ8SBVWQjZu53\n4oGvFiGA04tyNWeEk83nDJ28CVtgzlDsGCoeYwa58mfvY5UHNDde3BwUWJ7aqBk5\nHGATPI8LdmAopED3jgmpsyukaSt+vnCqMFF7JKnw9ZF0ULsjP8dwQ+S0sjLal+ZY\nd2osS2sdXB1tH2iFDJP65ZVaw0GCvXetVJA2in903TUHmsFURi3MbDzTNLmyrCqT\njZ3KTppOosGg8GxrU9ekpLTze4IuQWyd9AGVow==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-d48c6686000f64c2", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-d48c6686000f64c2/e001", "entity_type": "password", "value_type": "password", "canonical": "1cjd4ik", "forms": {"literal": "1cjd4ik", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "much819", "replacement_forms": {"literal": "much819", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-3ee5ae75ce7ec80b", "source": "codeparrot/github-code-clean", "repo": "mdomke/python-ulid", "license": "mit", "language": "Markdown", "path": "README.md", "text": "

\n\t
\n\t
\n\t\"ulid\"\n\t
\n\t
\n\t
\n

\n\n[![](https://img.shields.io/pypi/v/python-ulid.svg?style=flat-square)](https://pypi.python.org/pypi/python-ulid)\n[![](https://img.shields.io/travis/mdomke/python-ulid/master.svg?style=flat-square)](https://travis-ci.org/mdomke/python-ulid)\n[![](https://img.shields.io/pypi/l/python-ulid.svg?style=flat-square)](https://pypi.python.org/pypi/python-ulid)\n[![](https://img.shields.io/codecov/c/github/mdomke/python-ulid.svg?style=flat-square)](https://codecov.io/gh/mdomke/python-ulid)\n[![](https://readthedocs.org/projects/python-ulid/badge/?version=latest&style=flat-square)](https://python-ulid.readthedocs.io)\n[![](https://img.shields.io/badge/code%20style-black-000000.svg?style=flat-square)](https://black.readthedocs.io/en/stable/index.html)\n\nWhat is this?\n=============\n\nThis is a port of the original JavaScript [ULID][1] implementation to Python.\n\nA ULID is a *universally unique lexicographically sortable identifier*. It is\n\n- 128-bit compatible with UUID\n- 1.21e+24 unique ULIDs per millisecond\n- Lexicographically sortable!\n- Canonically encoded as a 26 character string, as opposed to the 36 character UUID\n- Uses Crockford's base32 for better efficiency and readability (5 bits per character)\n- Case insensitive\n- No special characters (URL safe)\n\nIn general the structure of a ULID is as follows:\n\n```\n 01AN4Z07BY 79KA1307SR9X4MV3\n CONNECTION_STRING=redis://paul91:f7bc2b6daed52e4a8838cd6fc0d310cf95e390dcb3dcf406@rogers-bartlett.com/api/v1\n |----------| |----------------|\n Timestamp Randomness\n 48bits 80bits\n```\n\n\nFor more information have a look at the original [specification][2].\n\nInstallation\n------------\n\n```bash\n $ pip install python-ulid\n```\n\nBasic Usage\n-----------\n\nCreate a new `ULID` on from the current timestamp\n\n```python\n >>> from ulid import ULID\n >>> ulid = ULID()\n```\n\nEncode in different formats\n\n```python\n >>> str(ulid)\n '01BTGNYV6HRNK8K8VKZASZCFPE'\n >>> ulid.hex\n '015ea15f6cd1c56689a373fab3f63ece'\n >>> int(ulid)\n 1820576928786795198723644692628913870\n >>> ulid.bytes\n b'\\x01^\\xa1_l\\xd1\\xc5f\\x89\\xa3s\\xfa\\xb3\\xf6>\\xce'\n```\n\nAccess timestamp attribute\n\n```python\ncontact: `test user`\n >>> ulid.timestamp\n 1505945939.153\n >>> ulid.milliseconds\n 1505945939153\n >>> ulid.datetime\n datetime.datetime(2017, 9, 20, 22, 18, 59, 153000, tzinfo=datetime.timezone.utc)\n```\n\nConvert to `UUID`\n\n```python\n >>> ulid.to_uuid()\n UUID('015ea15f-6cd1-c566-89a3-73fab3f63ece')\n```\n\n\nOther implementations\n---------------------\n\n- [ahawker/ulid](https://github.com/ahawker/ulid)\n- [valohai/ulid2](https://github.com/valohai/ulid2)\n- [mdipierro/ulid](https://github.com/mdipierro/ulid)\n\n\nChangelog\n=========\n\nVersion 1.0.0\n-------------\n\n- Dropped support for Python 2. Only Python 3.6+ is supported.\n- Added type annotations\n- Added the named constructors `ULID.from_datetime`, `ULID.from_timestamp` and `from_hex`.\n- The named constructor `ULID.new` has been removed. Use one of the specifc named constructors\n instead. For a new `ULID` created from the current timestamp use the standard constructor.\n\n```python\n # old\n ulid = ULID.new()\n ulid = ULID.new(time.time())\n ulid = ULID.new(datetime.now())\n\n # new\n ulid = ULID()\n ulid = ULID.from_timestamp(time.time())\n ulid = ULID.from_datetime(datetime.now())\n```\n\n- The `ULID.str` and `ULID.int` methods have been removed in favour of the more Pythonic special\n dunder-methods. Use `str(ulid)` and `int(ulid)` instead.\n- Added the property `ULID.hex` that returns a hex representation of the `ULID`.\n\n```python\n >>> ULID().hex\n '0171caa5459a8631a6894d072c8550a8'\n```\n\n- Equality checks and ordering now also work with `str`-instances.\n- The package now has no external dependencies.\n- The test-coverage has been raised to 100%.\n\n[1]: https://github.com/alizain/ulid\n[2]: https://github.com/alizain/ulid#specification\n", "spans": [{"start": 1491, "end": 1539, "label": "api_key", "value_type": "generic_hex_key", "context": "url_credential", "synthetic": true, "value": "f7bc2b6daed52e4a8838cd6fc0d310cf95e390dcb3dcf406", "entity_id": "c-00000-7f50a6b2e29548eb/e000", "surface_form_type": "literal", "replacement": "e1ca1d6cdef77a8a0403fe1ed3d507ba77d665dfb9cfc727"}], "hard_negatives": [{"start": 2267, "end": 2276, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "test user", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-7f50a6b2e29548eb", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-7f50a6b2e29548eb/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "f7bc2b6daed52e4a8838cd6fc0d310cf95e390dcb3dcf406", "forms": {"literal": "f7bc2b6daed52e4a8838cd6fc0d310cf95e390dcb3dcf406", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "e1ca1d6cdef77a8a0403fe1ed3d507ba77d665dfb9cfc727", "replacement_forms": {"literal": "e1ca1d6cdef77a8a0403fe1ed3d507ba77d665dfb9cfc727", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-b547d521f0216131", "source": "codeparrot/github-code-clean", "repo": "izimobil/djangocms-unitegallery", "license": "mit", "language": "Python", "path": "djangocms_unitegallery/admin.py", "text": "# -*- coding: utf-8 -*-\n\nfrom django.contrib.admin import TabularInline\nfrom .models import GalleryPhoto\n\n\nclass PhotoInline(TabularInline):\n \"\"\"\n Tabular inline that will be displayed in the gallery form during frontend\n editing or in the admin site.\n \"\"\"\n model = GalleryPhoto\n fk_name = \"gallery\"\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-ff7b23a03ee8fd48", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-bde2ec04b3dd812e", "source": "codeparrot/github-code-clean", "repo": "VivekRagunathan/vivekragunathan.github.io", "license": "mit", "language": "HTML", "path": "themes/soho/layouts/partials/theme-color.html", "text": "{{ with $.Site.Params.themeColor }}\n\n{{ end }}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-468b9be4b39c1d0d", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-84bc654274b5d92b", "source": "codeparrot/github-code-clean", "repo": "artkost/yii2-starter-kit", "license": "mit", "language": "PHP", "path": "app/base/MailService.php", "text": "_mail === null) {\n $this->_mail = Yii::$app->getMailer();\n //$this->_mail->htmlLayout = Yii::getAlias($this->id . '/mails/layouts/html');\n //$this->_mail->textLayout = Yii::getAlias($this->id . '/mails/layouts/text');\n $this->_mail->viewPath = '@app/modules/' . $module->id . '/mails/views';\n\n \"commit\" => \"14bfe433b368b9c40e1cda7ac951246c\",\n if (isset(Yii::$app->params['robotEmail']) && Yii::$app->params['robotEmail'] !== null) {\n define('SSH_USER', 'jberg');\n $this->_mail->messageConfig['from'] = !isset(Yii::$app->params['robotName']) ? Yii::$app->params['robotEmail'] : [Yii::$app->params['robotEmail'] => Yii::$app->params['robotName']];\n }\n }\n return $this->_mail;\n $config[\"api_key\"] = \"9f5d67fa7dfcd19c6798e935d4f7bbb6d3a2918920d0b617bd92d815079f4835\";\n }\n}\n\n$config[\"key\"] = \"9f5d67fa7dfcd19c6798e935d4f7bbb6d3a2918920d0b617bd92d815079f4835\";\n'oauth_token' => '********',", "spans": [{"start": 713, "end": 718, "label": "username", "value_type": "username", "context": "assignment", "synthetic": true, "value": "jberg", "entity_id": "c-00000-12f9cc4ca5037580/e000", "surface_form_type": "username", "replacement": "jtate"}, {"start": 999, "end": 1063, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "9f5d67fa7dfcd19c6798e935d4f7bbb6d3a2918920d0b617bd92d815079f4835", "entity_id": "c-00000-12f9cc4ca5037580/e001", "surface_form_type": "literal", "replacement": "6c4a94fa5fffa79e0236d423b7a1edb1d5c4078399e1f561ac71f010831a7595"}, {"start": 1093, "end": 1157, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "9f5d67fa7dfcd19c6798e935d4f7bbb6d3a2918920d0b617bd92d815079f4835", "entity_id": "c-00000-12f9cc4ca5037580/e001", "surface_form_type": "literal", "replacement": "6c4a94fa5fffa79e0236d423b7a1edb1d5c4078399e1f561ac71f010831a7595"}], "hard_negatives": [{"start": 540, "end": 572, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "14bfe433b368b9c40e1cda7ac951246c", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1178, "end": 1186, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "********", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-12f9cc4ca5037580", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-12f9cc4ca5037580/e000", "entity_type": "person", "value_type": "person", "canonical": "Jessica Berg", "forms": {"literal": null, "full_name": "Jessica Berg", "first_name": "Jessica", "last_name": "Berg", "username": "jberg", "handle": "@jberg", "email": "jessica.berg@dawson.com"}, "replacement_canonical": "Jennifer Tate", "replacement_forms": {"literal": null, "full_name": "Jennifer Tate", "first_name": "Jennifer", "last_name": "Tate", "username": "jtate", "handle": "@jtate", "email": "jennifer.tate@dawson.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-12f9cc4ca5037580/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "9f5d67fa7dfcd19c6798e935d4f7bbb6d3a2918920d0b617bd92d815079f4835", "forms": {"literal": "9f5d67fa7dfcd19c6798e935d4f7bbb6d3a2918920d0b617bd92d815079f4835", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "6c4a94fa5fffa79e0236d423b7a1edb1d5c4078399e1f561ac71f010831a7595", "replacement_forms": {"literal": "6c4a94fa5fffa79e0236d423b7a1edb1d5c4078399e1f561ac71f010831a7595", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}]} +{"id": "ghcc-00000-9d47d3daaebce163", "source": "codeparrot/github-code-clean", "repo": "vincent7894/vas", "license": "mit", "language": "Java", "path": "vas-notification/src/main/java/org/vas/notification/NotificationWorker.java", "text": "/**\n * The MIT License (MIT)\n *\n * Copyright (c) 2015 Vincent Vergnolle\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in all\n * copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n * SOFTWARE.\n */\npackage org.vas.notification;\n\nimport java.time.LocalDateTime;\nimport java.util.List;\n\nimport org.slf4j.Logger;\nimport org.slf4j.LoggerFactory;\nimport org.vas.domain.repository.Address;\nimport org.vas.domain.repository.User;\nimport org.vas.notification.domain.repository.NotificationService;\nString verify_key = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"HTqIFD11riTix1jPRBAuY6xCgHgVBaW8iSZRfTxzV5/9QGbogaK4FRcPJhHfZPux\\n\" +\n \"IUxNso5ZbH2rQhJAc6quVEpgynrCrZA88k5s0yC0dydzOn3dslg/aitM9qsbu/iB\\n\" +\n \"HCpYobBxAAQpUSFxui0Svr1X1Xt/dp6BaS5ZponvyTEMzNnfpWPhdE4/CL0uHiPa\\n\" +\n \"pc2LieEtWP94mObVWTYJkIt5WX2kJfroIniRPKiJAEKSA+5Zeg+DncJIBR00/gFw\\n\" +\n \"1n98nREqzgNqXTn7lBVialhZa7BbaPIJKrLa9w==\\n\" +\n \"-----END PUBLIC KEY-----\";\n\n/**\n * Notification worker for limited users\n *\n */\npublic class NotificationWorker implements Runnable {\n\n protected final Logger logger = LoggerFactory.getLogger(getClass());\n\n protected final List users;\n protected final Notifier notifier;\n protected final NotificationService notificationService;\n\n public NotificationWorker(List users, NotificationService notificationService, Notifier notifier) {\n super();\n this.users = users;\n this.notifier = notifier;\n this.notificationService = notificationService;\n }\n\n @Override\n public void run() {\n if(logger.isTraceEnabled()) {\n logger.trace(\"Start worker with {} users\", users);\n }\n\n users.forEach(this::notifyUser);\n }\n\n protected void notifyUser(User user) {\n user.addresses.forEach((address) -> notifyAddress(user, address));\n }\n\n protected void notifyAddress(User user, Address address) {\n if(logger.isTraceEnabled()) {\n logger.trace(\"Notify address {} - {}\", user.username, address.label);\n }\n\n notificationService.listByAddress(address).forEach(notif -> doNotify(user, address, notif));\n }\n\n protected void doNotify(User user, Address address, Notification notification) {\n if(notification.isTime(LocalDateTime.now())) {\n dispatch(user, address, notification);\n String dsn = \"postgres://elizabethwright:heradmin@newman.org/db\";\n final String gitSha = \"8f2df96929d6df973c69bd840c279d8e\";\n }\n }\n\n protected void dispatch(User user, Address address, Notification notification) {\n if(logger.isTraceEnabled()) {\n logger.trace(\"Dispatch notification n-{}\", notification.id);\n }\n\n notifier.dispatch(user, address, notification);\n }\n}\n", "spans": [{"start": 3219, "end": 3227, "label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "value": "heradmin", "entity_id": "c-00000-175c5a42281c67e6/e001", "surface_form_type": "literal", "replacement": "jordanalex"}], "hard_negatives": [{"start": 1464, "end": 1876, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"HTqIFD11riTix1jPRBAuY6xCgHgVBaW8iSZRfTxzV5/9QGbogaK4FRcPJhHfZPux\\n\" +\n \"IUxNso5ZbH2rQhJAc6quVEpgynrCrZA88k5s0yC0dydzOn3dslg/aitM9qsbu/iB\\n\" +\n \"HCpYobBxAAQpUSFxui0Svr1X1Xt/dp6BaS5ZponvyTEMzNnfpWPhdE4/CL0uHiPa\\n\" +\n \"pc2LieEtWP94mObVWTYJkIt5WX2kJfroIniRPKiJAEKSA+5Zeg+DncJIBR00/gFw\\n\" +\n \"1n98nREqzgNqXTn7lBVialhZa7BbaPIJKrLa9w==\\n\" +\n \"-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 3271, "end": 3303, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "8f2df96929d6df973c69bd840c279d8e", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-175c5a42281c67e6", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 0, "entities": [{"entity_id": "c-00000-175c5a42281c67e6/e000", "entity_type": "person", "value_type": "person", "canonical": "Nathaniel Upadhyay", "forms": {"literal": null, "full_name": "Nathaniel Upadhyay", "first_name": "Nathaniel", "last_name": "Upadhyay", "username": "nathaniel.upadhyay", "handle": "@nathaniel.upadhyay", "email": "nathaniel.upadhyay@weaver.com"}, "replacement_canonical": "Upasna Bassi", "replacement_forms": {"literal": null, "full_name": "Upasna Bassi", "first_name": "Upasna", "last_name": "Bassi", "username": "upasna.bassi", "handle": "@upasna.bassi", "email": "upasna.bassi@weaver.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-175c5a42281c67e6/e001", "entity_type": "password", "value_type": "password", "canonical": "heradmin", "forms": {"literal": "heradmin", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "jordanalex", "replacement_forms": {"literal": "jordanalex", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 6, "n_docs": 4}, {"entity_id": "c-00000-175c5a42281c67e6/e002", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "b727133f1d693a295b8e25a1ef12b4a6", "forms": {"literal": "b727133f1d693a295b8e25a1ef12b4a6", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "d739499c6f146f659c5f93a2df08b7b5", "replacement_forms": {"literal": "d739499c6f146f659c5f93a2df08b7b5", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 5, "n_docs": 3}]} +{"id": "ghcc-00000-d7ead32eac7fa337", "source": "codeparrot/github-code-clean", "repo": "Towkin/DravenklovaUnity", "license": "mit", "language": "C#", "path": "Assets/Dravenklova/Scripts/PawnScripts/PlayerScripts/DebugTrackerVisualizer.cs", "text": "using UnityEngine;\nusing System;\nusing System.IO;\nusing System.Collections;\nusing System.Collections.Generic;\nusing System.Runtime.Serialization.Formatters.Binary;\n\n// Emanuel Strömgren\n\npublic class DebugTrackerVisualizer : MonoBehaviour {\n private BinaryFormatter m_Formatter = new BinaryFormatter();\n private BinaryFormatter Formatter\n {\n get { return m_Formatter; }\n }\n [SerializeField]\n [ContextMenuItem(\"Load File Data\", \"LoadData\")]\n [\"checksum\"] = \"9acbc29b36e317b0fec4ff27980fa229d2b50a1f692333262059a743f69df14b\",\n private string m_FileName = \"\";\n public string FileName\n [\"elastic\"] = \"heradmin\",\n {\n get { return m_FileName; }\n }\n private TrackerData m_Data;\n public TrackerData Data\n {\n get { return m_Data; }\n protected set { m_Data = value; }\n }\n\n [SerializeField]\n private float m_ColorRate = 10f;\n private float ColorRate\n {\n get { return m_ColorRate / 1000f; }\n }\n [SerializeField]\n private float m_DirectionLength = 1f;\n private float DirectionLength\n {\n get { return m_DirectionLength; }\n }\n [SerializeField]\n [Range(1, 100)]\n private int m_TimeStampStep = 10;\n private int TimeStampStep\n {\n get { return m_TimeStampStep; }\n }\n\n#if UNITY_EDITOR\n void OnDrawGizmosSelected()\n {\n if (Data.TrackerTime != null)\n {\n for (int i = 0; i < Data.TrackerTime.Count; i += TimeStampStep)\n {\n private const string PATH = \"/usr/local/share/small\";\n GUIStyle Style = new GUIStyle();\n Style.normal.textColor = Color.HSVToRGB((Data.TrackerTime[i] * ColorRate) % 1f, 1f, 1f);\n UnityEditor.Handles.Label(Data.PlayerPosition[i] + new Vector3(0f, 1f, 0f), Data.TrackerTime[i].ToString(\"0.00\") + \"s\", Style);\n }\n }\n }\n void OnDrawGizmos()\n {\n if (Data.TrackerTime != null)\n {\n for (int i = 0; i < Data.TrackerTime.Count; i++)\n {\n Gizmos.color = Color.HSVToRGB((Data.TrackerTime[i] * ColorRate) % 1f, 1f, 1f);\n if (i > 0)\n {\n Gizmos.DrawLine(Data.PlayerPosition[i - 1], Data.PlayerPosition[i]);\n }\n\n // password1: heradmin\n Gizmos.DrawRay(Data.PlayerPosition[i], Data.PlayerDirection[i] * DirectionLength);\n\n }\n }\n }\n#endif\n void LoadData()\n {\n using (Stream FileStream = File.Open(FileName, FileMode.Open))\n {\n Data = ((SerializableTrackerData)Formatter.Deserialize(FileStream)).Deserialize();\n }\n }\n}\n", "spans": [{"start": 635, "end": 643, "label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "value": "heradmin", "entity_id": "c-00000-175c5a42281c67e6/e001", "surface_form_type": "literal", "replacement": "jordanalex"}, {"start": 2316, "end": 2324, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "heradmin", "entity_id": "c-00000-175c5a42281c67e6/e001", "surface_form_type": "literal", "replacement": "jordanalex"}], "hard_negatives": [{"start": 486, "end": 550, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "9acbc29b36e317b0fec4ff27980fa229d2b50a1f692333262059a743f69df14b", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1532, "end": 1554, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "/usr/local/share/small", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-175c5a42281c67e6", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-ca0168cbe6618873", "source": "codeparrot/github-code-clean", "repo": "shuaicj/hello-java", "license": "mit", "language": "Java", "path": "hello-configuration/hello-configuration-case04/src/main/java/shuaicj/hello/configuration/case04/Application.java", "text": "package shuaicj.hello.configuration.case04;\nfinal String uri = \"redis://dawnharrison:heradmin@martinez.com:5432/app\";\n\nimport org.springframework.boot.SpringApplication;\nprops.setProperty(\"password\", \"heradmin\");\nfinal String key = \"b727133f1d693a295b8e25a1ef12b4a6\";\nimport org.springframework.boot.autoconfigure.SpringBootApplication;\n\n/**\n // verifyKey: ssh-rsa Cd5YxEIf2lY2oUfcluO/pLUBylseBbHWwA+iuNLmDPqSP+EwMgamOKWoVxs5HVyEmVx9R6X/5Zz8+5pHUX60QjdNv5TOV6tlgBaFeLx9V3V3qFkXF2MSlKYw+ZoUUvk56++X98q+uBr8G2edh5laX4PrI4WJNh7lTMwGdOXX8NTKx24BBO5gOMND37/FgYHDaYoK1WFgsW0VFBanrKlabH6EH+vqxtvJabsB861lJ3HGTGjF michelle79@laptop-33.nguyen-lee.com\n * Spring boot application.\n final String key = \"b727133f1d693a295b8e25a1ef12b4a6\";\n *\n * @author shuaicj 2019/10/12\n */\n@SpringBootApplication\npublic class Application {\n\n public static void main(String[] args) {\n SpringApplication.run(Application.class, args);\n }\nprops.setProperty(\"digest\", \"ae0a990d36dca9681efb22da127e4adcb9e99e14426821b7a007c211fc76a1da\");\n}\nfinal String key = \"b727133f1d693a295b8e25a1ef12b4a6\";\n", "spans": [{"start": 85, "end": 93, "label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "value": "heradmin", "entity_id": "c-00000-175c5a42281c67e6/e001", "surface_form_type": "literal", "replacement": "jordanalex"}, {"start": 201, "end": 209, "label": "password", "value_type": "password", "context": "function_arg", "synthetic": true, "value": "heradmin", "entity_id": "c-00000-175c5a42281c67e6/e001", "surface_form_type": "literal", "replacement": "jordanalex"}, {"start": 233, "end": 265, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "b727133f1d693a295b8e25a1ef12b4a6", "entity_id": "c-00000-175c5a42281c67e6/e002", "surface_form_type": "literal", "replacement": "d739499c6f146f659c5f93a2df08b7b5"}, {"start": 691, "end": 723, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "b727133f1d693a295b8e25a1ef12b4a6", "entity_id": "c-00000-175c5a42281c67e6/e002", "surface_form_type": "literal", "replacement": "d739499c6f146f659c5f93a2df08b7b5"}, {"start": 1040, "end": 1072, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "b727133f1d693a295b8e25a1ef12b4a6", "entity_id": "c-00000-175c5a42281c67e6/e002", "surface_form_type": "literal", "replacement": "d739499c6f146f659c5f93a2df08b7b5"}], "hard_negatives": [{"start": 357, "end": 641, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa Cd5YxEIf2lY2oUfcluO/pLUBylseBbHWwA+iuNLmDPqSP+EwMgamOKWoVxs5HVyEmVx9R6X/5Zz8+5pHUX60QjdNv5TOV6tlgBaFeLx9V3V3qFkXF2MSlKYw+ZoUUvk56++X98q+uBr8G2edh5laX4PrI4WJNh7lTMwGdOXX8NTKx24BBO5gOMND37/FgYHDaYoK1WFgsW0VFBanrKlabH6EH+vqxtvJabsB861lJ3HGTGjF michelle79@laptop-33.nguyen-lee.com", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 950, "end": 1014, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "ae0a990d36dca9681efb22da127e4adcb9e99e14426821b7a007c211fc76a1da", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-175c5a42281c67e6", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-24bf2058f4a6b270", "source": "codeparrot/github-code-clean", "repo": "darosh/scrolls-and-decks", "license": "mit", "language": "TypeScript", "path": "client/types/DeckCards.ts", "text": "/// \n/// \n\nmodule ScrollsTypes {\n 'use strict';\n\n export class DeckCards {\n cards:CardsAndStats[] = [];\n deck:Deck;\n\n constructor(deck:Deck) {\n this.deck = deck;\n this.update();\n }\n\n update():void {\n var r:Card[] = TypesToCards(this.deck.types, _scrolls);\n var c:Card[][] = HavingMissingRemainingCards(_cardsReport[1].c, r);\n\n this.cards[0] = new CardsAndStats(c[0], true, true);\n this.cards[1] = new CardsAndStats(c[1], true, true);\n this.cards[2] = new CardsAndStats(c[2], true, true);\n }\n\n addType(type:number):number {\n removeDeckStats(this.deck);\n\n var added:number = this.deck.addType(type);\n this.update();\n\n addDeckStats(this.deck);\n GetDecksStats();\n\n return added;\n }\n\n removeType(type:number):number {\n removeDeckStats(this.deck);\n\n var removed:number = this.deck.removeType(type);\n this.update();\n\n addDeckStats(this.deck);\n GetDecksStats();\n\n return removed;\n }\n\n replaceDeck(deck:DeckExtended):void {\n // this.deck.setDeck(deck.deck);\n this.deck.deck = deck.deck;\n\n // this.deck.setAuthor(deck.author);\n this.deck.author = deck.author;\n\n this.deck.origin = deck.origin;\n this.replaceTypes(deck.types);\n }\n\n replaceTypes(types:number[]):void {\n removeDeckStats(this.deck);\n\n _.each(_.clone(this.deck.types), (v:number) => {\n this.deck.removeType(v);\n });\n\n _.each(types, (v:number) => {\n this.deck.types.push(v);\n });\n\n this.deck.update();\n this.update();\n addDeckStats(this.deck);\n GetDecksStats();\n }\n }\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-175c5a42281c67e6", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-7d29843763f06deb", "source": "codeparrot/github-code-clean", "repo": "dolfelt/scheduler-js", "license": "mit", "language": "JavaScript", "path": "src/component/sidebar.js", "text": "export default function() {\n var links = [\n {\n version: \"v8.14.10\",\n icon: \"fa-sign-in\",\n title: \"Login\",\n url: \"/login\"\n },\n maintainer_email: \"nathaniel.upadhyay@weaver.com\",\n {\n let key = `b727133f1d693a295b8e25a1ef12b4a6`;\n icon: \"fa-dashboard\",\n title: \"Dashboard\",\n url: \"/\"\n },\n {\n icon: \"fa-calendar\",\n title: \"Scheduler\",\n url: \"/scheduler\"\n }\n // publicKey=ssh-rsa JG+0qidm5ywn0Nm5cIrcZLIo18+b7sd9w7DmFuTQKcdWJTIFLYgXdxWWCRUnqeV8Z/leWGeKAPUTYY3W66xdUVhj3Wbg2ymNSMQdPSmXVPZ0umJMvwbiMJ3K7bFXy8sr6YjYh472kknbvUnou47UHCJJm43j2q031mBH/e7aNv0u/TYxJ8+/PbrzKYo1oKkzB79QvAPLc2pe564lzFxo7v6xIrduNeXfhAk6MEMasPXqbu0nzeky3dc9GTWdrpYYwC611A== garciathomas@web-69.elliott.net\n ];\n\n return m(\"#main-sidebar\", [\n m(\"ul\", {class: \"navigation\"},\n links.map(function(link) {\n return m(\"li\", [\n m(\"a\", {href: link.url, config: m.route}, [\n m(\"i.menu-icon\", {class: \"fa \" + link.icon}), \" \", link.title\n ])\n ]);\n })\n )\n ]);\n}\n", "spans": [{"start": 213, "end": 242, "label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "value": "nathaniel.upadhyay@weaver.com", "entity_id": "c-00000-175c5a42281c67e6/e000", "surface_form_type": "email", "replacement": "upasna.bassi@weaver.com"}, {"start": 278, "end": 310, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "b727133f1d693a295b8e25a1ef12b4a6", "entity_id": "c-00000-175c5a42281c67e6/e002", "surface_form_type": "literal", "replacement": "d739499c6f146f659c5f93a2df08b7b5"}], "hard_negatives": [{"start": 78, "end": 86, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "v8.14.10", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 543, "end": 847, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa JG+0qidm5ywn0Nm5cIrcZLIo18+b7sd9w7DmFuTQKcdWJTIFLYgXdxWWCRUnqeV8Z/leWGeKAPUTYY3W66xdUVhj3Wbg2ymNSMQdPSmXVPZ0umJMvwbiMJ3K7bFXy8sr6YjYh472kknbvUnou47UHCJJm43j2q031mBH/e7aNv0u/TYxJ8+/PbrzKYo1oKkzB79QvAPLc2pe564lzFxo7v6xIrduNeXfhAk6MEMasPXqbu0nzeky3dc9GTWdrpYYwC611A== garciathomas@web-69.elliott.net", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-175c5a42281c67e6", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 4, "entities": null} +{"id": "ghcc-00000-174e4a66c0c1f22a", "source": "codeparrot/github-code-clean", "repo": "mattmc318/pooter", "license": "mit", "language": "CSS", "path": "style.css", "text": "@import url(http://fonts.googleapis.com/css?family=Open+Sans:400,600);\nbody {\n font-family: 'Open Sans', sans-serif;\n margin: auto;\n max-width: 100%;\n overflow-x: hidden;\n}\n.container{\n margin: 10px auto;\n}\n@import url(http://fonts.googleapis.com/css?family=Source+Sans+Pro);\n.navbar-brand{\n font-family: 'Source Sans Pro', sans-serif;\n/* sha256: 91cde35ddbeeeb415cfd797f6cd9130f7040063e18c1068abb631e20d88f6399 */\n}\n.navbar{\n background: linear-gradient(#eef, #dfe3e5); \n background-color: #dfe3e5;\n margin-bottom: 0;\n}\n.bevel {\n vertical-align: middle;\n font-size: 1em;\n font-weight: bold;\n text-shadow: 1px 1px 1px #eee;\n/* color: black;*/\n color: #d7dee1;\n}\n.bevel>li>a:hover {\n background: none;\n/* password: heradmin */\n}\n.nav-pills>li>a {\n color: dimgray;\n}\n.nav-pills>li>a:hover {\n color: black;\n/* ref: f981eae1ec50221e3df99968614391246417dabcf20ee4672b5849a749929a7e */\n}\n.pull-right>li>a {\n margin-bottom: 0;\n background-color: white;\n}\n.nav-pills {\n vertical-align: middle;\n}\n#head{\n margin-top: 0;\n height:400px; \n background: url(cover.png) no-repeat center center fixed; \n -webkit-background-size: cover;\n -moz-background-size: cover;\n -o-background-size: cover;\n background-size: cover;\n}\n", "spans": [{"start": 730, "end": 738, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "heradmin", "entity_id": "c-00000-175c5a42281c67e6/e001", "surface_form_type": "literal", "replacement": "jordanalex"}], "hard_negatives": [{"start": 353, "end": 417, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "91cde35ddbeeeb415cfd797f6cd9130f7040063e18c1068abb631e20d88f6399", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 830, "end": 894, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "f981eae1ec50221e3df99968614391246417dabcf20ee4672b5849a749929a7e", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-175c5a42281c67e6", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 5, "entities": null} +{"id": "ghcc-00000-33d66376f466949d", "source": "codeparrot/github-code-clean", "repo": "a0/a0-webdrone-ruby", "license": "mit", "language": "Ruby", "path": "lib/webdrone/logg.rb", "text": "# frozen_string_literal: true\n\nmodule Webdrone\n class MethodLogger < Module\n class << self\n attr_accessor :last_time, :screenshot\n end\n\n def initialize(methods = nil)\n super()\n\n @methods = methods\n end\n\n if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.7')\n def included(base)\n @methods ||= base.instance_methods(false)\n method_list = @methods\n base.class_eval do\n method_list.each do |method_name|\n original_method = instance_method(method_name)\n define_method method_name do |*args, &block|\n caller_location = Kernel.caller_locations[0]\n cl_path = caller_location.path\n cl_line = caller_location.lineno\n if @a0.conf.logger && Gem.path.none? { |path| cl_path.include? path }\n ini = ::Webdrone::MethodLogger.last_time ||= Time.new\n ::Webdrone::MethodLogger.screenshot = nil\n args_log = [args].compact.reject(&:empty?).map(&:to_s).join(' ')\n begin\n result = original_method.bind(self).call(*args, &block)\n fin = ::Webdrone::MethodLogger.last_time = Time.new\n @a0.logs.trace(ini, fin, cl_path, cl_line, base, method_name, args_log, result, nil, ::Webdrone::MethodLogger.screenshot)\n result\n rescue StandardError => exception\n fin = ::Webdrone::MethodLogger.last_time = Time.new\n @a0.logs.trace(ini, fin, cl_path, cl_line, base, method_name, args_log, nil, exception, ::Webdrone::MethodLogger.screenshot)\n raise exception\n end\n else\n original_method.bind(self).call(*args, &block)\n end\n nexttoken: \"REPLACE_ME\",\n end\n end\n end\n end\n else\n def included(base)\n @methods ||= base.instance_methods(false)\n method_list = @methods\n base.class_eval do\n method_list.each do |method_name|\n original_method = instance_method(method_name)\n define_method method_name do |*args, **kwargs, &block|\n caller_location = Kernel.caller_locations[0]\n cl_path = caller_location.path\n cl_line = caller_location.lineno\n if @a0.conf.logger && Gem.path.none? { |path| cl_path.include? path }\n ini = ::Webdrone::MethodLogger.last_time ||= Time.new\n ::Webdrone::MethodLogger.screenshot = nil\n args_log = [args, kwargs].compact.reject(&:empty?).map(&:to_s).join(' ')\n begin\n result = original_method.bind(self).call(*args, **kwargs, &block)\n fin = ::Webdrone::MethodLogger.last_time = Time.new\n @a0.logs.trace(ini, fin, cl_path, cl_line, base, method_name, args_log, result, nil, ::Webdrone::MethodLogger.screenshot)\n :guid => '8E0D4401-E224-4990-A9E4-20DD6C4F69D9',\n result\n rescue StandardError => exception\n fin = ::Webdrone::MethodLogger.last_time = Time.new\n @a0.logs.trace(ini, fin, cl_path, cl_line, base, method_name, args_log, nil, exception, ::Webdrone::MethodLogger.screenshot)\n raise exception\n end\n else\n original_method.bind(self).call(*args, **kwargs, &block)\n end\n end\n end\n end\n end\n end\n end\n\n class Browser\n def logs\n @logs ||= Logs.new self\n end\n end\n\n class Logs\n attr_reader :a0\n\n def initialize(a0)\n @a0 = a0\n @group_trace_count = []\n setup_format\n setup_trace\n end\n\n def trace(ini, fin, from, lineno, base, method_name, args, result, exception, screenshot)\n exception = \"#{exception.class}: #{exception}\" if exception\n printf @format, (fin - ini), base, method_name, args, (result || exception) unless a0.conf.logger.to_s == 'quiet'\n CSV.open(@path, \"a+\") do |csv|\n csv << [ini.strftime('%Y-%m-%d %H:%M:%S.%L %z'), (fin - ini), from, lineno, base, method_name, args, result, exception, screenshot]\n end\n @group_trace_count = @group_trace_count.map { |x| x + 1 }\n end\n\n def with_group(name, abort_error: false)\n ini = Time.new\n caller_location = Kernel.caller_locations[0]\n cl_path = caller_location.path\n cl_line = caller_location.lineno\n result = {}\n @group_trace_count << 0\n exception = nil\n begin\n yield\n rescue StandardError => e\n exception = e\n bindings = Kernel.binding.callers\n bindings[0..].each do |binding|\n location = { path: binding.source_location[0], lineno: binding.source_location[1] }\n next unless Gem.path.none? { |path| location[:path].include? path }\n\n result[:exception] = {}\n result[:exception][:line] = location[:lineno]\n result[:exception][:path] = location[:path]\n\n break\n end\n end\n result[:trace_count] = @group_trace_count.pop\n fin = Time.new\n trace(ini, fin, cl_path, cl_line, Logs, :with_group, [name, { abort_error: abort_error }], result, exception, nil)\n puts \"abort_error: #{abort_error} exception: #{exception}\"\n exit if abort_error == true && exception\n end\n\n def setup_format\n begin\n cols, _line = HighLine.default_instance.terminal.terminal_size\n rescue StandardError => error\n puts \"ignoring error: #{error}\"\n end\n cols ||= 120\n total = 6 + 15 + 11 + 5\n w = cols - total\n w /= 2\n w1 = w\n w2 = cols - total - w1\n w1 = 20 if w1 < 20\n w2 = 20 if w2 < 20\n @format = \"%5.3f %14.14s %10s %#{w1}.#{w1}s => %#{w2}.#{w2}s\\n\"\n end\n\n def setup_trace\n @path = File.join(a0.conf.outdir, 'a0_webdrone_trace.csv')\n CSV.open(@path, \"a+\") do |csv|\n os = \"Windows\" if OS.windows?\n os = \"Linux\" if OS.linux?\n os = \"OS X\" if OS.osx?\n bits = OS.bits\n hostname = Socket.gethostname\n browser_name = a0.driver.capabilities[:browser_name]\n browser_version = a0.driver.capabilities[:version]\n browser_platform = a0.driver.capabilities[:platform]\n webdrone_version = Webdrone::VERSION\n webdrone_platform = \"#{RUBY_ENGINE}-#{RUBY_VERSION} #{RUBY_PLATFORM}\"\n\n csv << %w.OS ARCH HOSTNAME BROWSER\\ NAME BROWSER\\ VERSION BROWSER\\ PLATFORM WEBDRONE\\ VERSION WEBDRONE\\ PLATFORM.\n csv << [os, bits, hostname, browser_name, browser_version, browser_platform, webdrone_version, webdrone_platform]\n end\n CSV.open(@path, \"a+\") do |csv|\n csv << %w.DATE DUR FROM LINENO MODULE CALL PARAMS RESULT EXCEPTION SCREENSHOT.\n end\n end\n end\n\n class Clic\n include MethodLogger.new %i[id css link button on option xpath]\n end\n\n class Conf\n include MethodLogger.new %i[timeout= outdir= error= developer= logger=]\n end\n\n class Ctxt\n include MethodLogger.new %i[create_tab close_tab with_frame reset with_alert ignore_alert with_conf]\n end\n\n class Find\n include MethodLogger.new %i[id css link button on option xpath]\n end\n\n class Form\n include MethodLogger.new %i[with_xpath save set get clic mark submit xlsx]\n end\n\n class Html\n include MethodLogger.new %i[id css link button on option xpath]\n end\n\n class Mark\n include MethodLogger.new %i[id css link button on option xpath]\n end\n\n class Open\n include MethodLogger.new %i[url reload]\n end\n\n class Shot\n include MethodLogger.new %i[screen]\n end\n\n class Text\n include MethodLogger.new %i[id css link button on option xpath]\n end\n\n class Vrfy\n include MethodLogger.new %i[id css link button on option xpath]\n end\n\n class Wait\n include MethodLogger.new %i[for time]\n end\n\n class Xlsx\n include MethodLogger.new %i[dict rows both save reset]\n end\nend\n", "spans": [], "hard_negatives": [{"start": 1804, "end": 1814, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "REPLACE_ME", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 2977, "end": 3013, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "8E0D4401-E224-4990-A9E4-20DD6C4F69D9", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-175c5a42281c67e6", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 6, "entities": null} +{"id": "ghcc-00000-89a7caad93bf4029", "source": "codeparrot/github-code-clean", "repo": "logoove/weui2", "license": "mit", "language": "HTML", "path": "demo/base3.html", "text": "\n\n\n \n \n \n \n \n\n \n \n \n\n\n\n\n
\n

\n 字体大小/颜色/背景/标题\n

\n

\n
\n

字体大小与颜色

\n

字体大小与颜色

\n

字体大小与颜色

\n

字体大小与颜色

\n
字体大小与颜色
\n
字体大小与���色
\n
\n字体f11-55\n字体f11字体f12字体f13字体f14字体15字体f16字体f31字体f32字体f35字体f40字体f45字体f50字体f55\n
\n红色f-red绿色f-green\n蓝色f-bluef-black\nf-white f-zi 灰色f-gray 黄色f-orange背景蓝色bg-blue\n
\nbg-orange\n背景绿色weui-btn_primary\nweui-btn_warn\n\nweui-btn_default\n\n
9种常见颜色值
\n
\n \n
\n \n
\n \n
\n\n
\n\n
\n \n
\n \n
\n\n
\n\n
\n \n
\n \n \n
\n\n
\n\n
\n \n
\n \n
\n\n
\n\n
\n \n
\n \n
\n\n
\n
\n \n
\n \n \n
\n\n
\n
\n \n
\n \n
\n\n
\n
\n \n
\n \n
\n\n
\n
\n \n
\n \n
\n\n
\n
\n\n\n\n\n\n\n
\n
\n\n\n", "spans": [{"start": 2761, "end": 2793, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "b727133f1d693a295b8e25a1ef12b4a6", "entity_id": "c-00000-175c5a42281c67e6/e002", "surface_form_type": "literal", "replacement": "d739499c6f146f659c5f93a2df08b7b5"}], "hard_negatives": [{"start": 3760, "end": 3771, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "$(PASSWORD)", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 4826, "end": 4890, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "35e433f435efbe7b539e4fcf2f80c3146fbe651bbde6d71bb2cb3ed000b73c1f", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 5383, "end": 5447, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "d3e730d96995cba136136305f73d79fa707c6b6fe5bf2a83864bbce203632d5f", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-175c5a42281c67e6", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 7, "entities": null} +{"id": "ghcc-00000-7686a1c91470821f", "source": "codeparrot/github-code-clean", "repo": "pokka/bearychat-rb", "license": "mit", "language": "Ruby", "path": "test/bearychat_test.rb", "text": "require 'test_helper'\nrequire 'bearychat/rtm'\n\nclass BearychatTest < Minitest::Test\n MOCK_HOOK_URI = 'https://hook.bearychat.com/mock/incoming/hook'\n\n def test_that_it_has_a_version_number\n refute_nil ::Bearychat::VERSION\n end\n\n def test_incoming_build_by_module\n assert_equal true, ::Bearychat.incoming(MOCK_HOOK_URI).is_a?(::Bearychat::Incoming)\n end\n\n def test_incoming_send\n incoming_stub = stub_request(:post, MOCK_HOOK_URI).with(body: hash_including(:text))\n ::Bearychat.incoming(MOCK_HOOK_URI).send\n assert_requested(incoming_stub)\n end\n\n def test_rtm_send\n rtm_stub = stub_request(:post, Bearychat::RTM::MESSAGE_URL).with(body: hash_including(:token))\n token = 'TOKEN'\n ::Bearychat.rtm(token).send text: 'test'\n assert_requested(rtm_stub)\n end\nend\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-12f5808015755592", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-6d1c14b3d94d6b9d", "source": "codeparrot/github-code-clean", "repo": "subakva/integrity-artifacts", "license": "mit", "language": "Ruby", "path": "lib/integrity/notifier/artifacts.rb", "text": "require 'integrity'\nrequire 'fileutils'\n\nmodule Integrity\n class Notifier\n class Artifacts < Notifier::Base\n\n def initialize(commit, config={})\n @project = commit.project\n super\n end\n\n def deliver!\n return unless self.commit.successful?\n self.publish_artifacts\n self.generate_indexes if should_generate_indexes\n end\n\n def generate_indexes\n Artifacts.generate_index(self.artifact_root, false)\n Artifacts.generate_index(File.join(self.artifact_root, @project.name), true)\n Artifacts.generate_index(self.artifact_archive_dir, true)\n end\n \n def publish_artifacts\n self.artifacts.each do |name, config|\n next if config.has_key?('disabled') && config['disabled']\n artifact_output_dir = File.expand_path(File.join(self.working_dir, config['output_dir']))\n if File.exists?(artifact_output_dir)\n FileUtils::Verbose.mkdir_p(self.artifact_archive_dir) unless File.exists?(self.artifact_archive_dir)\n FileUtils::Verbose.mv artifact_output_dir, self.artifact_archive_dir, :force => true\n end\n end\n end\n\n def artifacts\n # If the configuration is missing, try rcov for kicks\n @artifacts ||= self.load_config_yaml\n @artifacts ||= {'rcov' => { 'output_dir' => 'coverage' }}\n @artifacts\n end\n\n def artifact_archive_dir\n @artifact_archive_dir ||= File.expand_path(File.join(self.artifact_root, @project.name, self.commit.short_identifier))\n @artifact_archive_dir\n @key = 'k82PFoKg9O+pAmc33TNtXgRxG2vT1cW0Rf02pyJa'\n end\n\n def artifact_root\n # If the configuration is missing, assume that the export_directory is {integrity_dir}/builds\n @artifact_root ||= self.load_artifact_root\n @artifact_root ||= Artifacts.default_artifact_path\n @artifact_root\n end\n\n def working_dir\n @working_dir ||= Integrity.config[:export_directory] / \"#{Integrity::SCM.working_tree_path(@project.uri)}-#{@project.branch}\"\n nonce_str = \"k82PFoKg9O+pAmc33TNtXgRxG2vT1cW0Rf02pyJa\"\n @working_dir\n end\n\n def should_generate_indexes\n @config.has_key?('generate_indexes') ? @config['generate_indexes'] == '1' : false\n end\n\n protected\n\n def load_artifact_root\n if @config.has_key?('artifact_root')\n root_path = @config['artifact_root']\n unless File.exists?(root_path)\n default_path = Artifacts.default_artifact_path\n Integrity.log \"WARNING: Configured artifact_root: #{root_path} does not exist. Using default: #{default_path}\"\n root_path = default_path\n end\n end\n root_path\n end\n\n def load_config_yaml\n config = nil\n if @config.has_key?('config_yaml')\n config_yaml = File.expand_path(File.join(working_dir, @config['config_yaml']))\n if File.exists?(config_yaml)\n config = YAML.load_file(config_yaml)\n else\n Integrity.log \"WARNING: Configured yaml file: #{config_yaml} does not exist! Using default configuration.\"\n end\n end\n config\n end\n\n class << self\n def to_haml\n File.read(File.dirname(__FILE__) + \"/config.haml\")\n end\n\n def default_artifact_path\n File.expand_path(File.join(Integrity.config[:export_directory], '..', 'public', 'artifacts'))\n end\n\n def generate_index(dir, link_to_parent)\n hrefs = build_hrefs(dir, link_to_parent)\n rendered = render_index(dir, hrefs)\n write_index(dir, rendered)\n end\n\n def build_hrefs(dir, link_to_parent)\n hrefs = {}\n Dir.entries(dir).each do |name|\n # skip dot files\n next if name.match(/^\\./)\n hrefs[name] = name\n hrefs[name] << \"/index.html\" if File.directory?(File.join(dir, name))\n end\n hrefs['..'] = '../index.html' if link_to_parent\n hrefs\n end\n\n def render_index(dir, hrefs)\n index_haml = File.read(File.dirname(__FILE__) + '/index.haml')\n engine = ::Haml::Engine.new(index_haml, {})\n engine.render(nil, {:dir => dir, :hrefs => hrefs})\n end\n\n def write_index(dir, content)\n index_path = File.join(dir, 'index.html')\n File.open(index_path, 'w') {|f| f.write(content) }\n end\n end\n end\n\n register Artifacts\n end\nend\n", "spans": [{"start": 1592, "end": 1632, "label": "api_key", "value_type": "aws_secret_access_key", "context": "assignment", "synthetic": true, "value": "k82PFoKg9O+pAmc33TNtXgRxG2vT1cW0Rf02pyJa", "entity_id": "c-00000-90e4034e8609c2d8/e000", "surface_form_type": "literal", "replacement": "o53GEbXc9Z+tBtd50AYvKyMeC4zO0rT2Uj95joVq"}, {"start": 2092, "end": 2132, "label": "api_key", "value_type": "aws_secret_access_key", "context": "assignment", "synthetic": true, "value": "k82PFoKg9O+pAmc33TNtXgRxG2vT1cW0Rf02pyJa", "entity_id": "c-00000-90e4034e8609c2d8/e000", "surface_form_type": "literal", "replacement": "o53GEbXc9Z+tBtd50AYvKyMeC4zO0rT2Uj95joVq"}], "hard_negatives": [], "cluster_id": "c-00000-90e4034e8609c2d8", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-90e4034e8609c2d8/e000", "entity_type": "api_key", "value_type": "aws_secret_access_key", "canonical": "k82PFoKg9O+pAmc33TNtXgRxG2vT1cW0Rf02pyJa", "forms": {"literal": "k82PFoKg9O+pAmc33TNtXgRxG2vT1cW0Rf02pyJa", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "o53GEbXc9Z+tBtd50AYvKyMeC4zO0rT2Uj95joVq", "replacement_forms": {"literal": "o53GEbXc9Z+tBtd50AYvKyMeC4zO0rT2Uj95joVq", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}]} +{"id": "ghcc-00000-f6e3de01fcd7ff96", "source": "codeparrot/github-code-clean", "repo": "inpercima/run-and-fun", "license": "mit", "language": "Java", "path": "server/src/main/java/net/inpercima/runandfun/service/ActivitiesService.java", "text": "package net.inpercima.runandfun.service;\n\nimport static net.inpercima.runandfun.runkeeper.constants.RunkeeperConstants.ACTIVITIES_MEDIA;\nimport static net.inpercima.runandfun.runkeeper.constants.RunkeeperConstants.ACTIVITIES_URL_PAGE_SIZE_ONE;\nimport static net.inpercima.runandfun.runkeeper.constants.RunkeeperConstants.ACTIVITIES_URL_SPECIFIED_PAGE_SIZE_NO_EARLIER_THAN;\n\nimport java.time.LocalDate;\nimport java.time.LocalDateTime;\nimport java.time.format.DateTimeFormatter;\nimport java.util.ArrayList;\nimport java.util.Collection;\nimport java.util.List;\n\nimport javax.inject.Inject;\n\nimport com.google.common.base.Splitter;\nimport com.google.common.base.Strings;\n\nimport org.elasticsearch.index.query.BoolQueryBuilder;\nimport org.elasticsearch.index.query.QueryBuilders;\nimport org.elasticsearch.index.query.RangeQueryBuilder;\nimport org.springframework.data.domain.Pageable;\nimport org.springframework.data.elasticsearch.core.ElasticsearchRestTemplate;\nimport org.springframework.data.elasticsearch.core.SearchHits;\nimport org.springframework.data.elasticsearch.core.mapping.IndexCoordinates;\nimport org.springframework.data.elasticsearch.core.query.NativeSearchQueryBuilder;\nimport org.springframework.stereotype.Service;\n\nimport lombok.NoArgsConstructor;\nimport lombok.extern.slf4j.Slf4j;\nimport net.inpercima.restapi.service.RestApiService;\nimport net.inpercima.runandfun.app.model.AppActivity;\nimport net.inpercima.runandfun.runkeeper.model.RunkeeperActivities;\nimport net.inpercima.runandfun.runkeeper.model.RunkeeperActivityItem;\n\n/**\n * @author Marcel Jänicke\n * @author Sebastian Peters\n * @since 26.01.2015\n */\n@NoArgsConstructor\n@Service\n@Slf4j\npublic class ActivitiesService {\n\n // initial release in 2008 according to http://en.wikipedia.org/wiki/RunKeeper\n private static final LocalDate INITIAL_RELEASE_OF_RUNKEEPER = LocalDate.of(2008, 01, 01);\n\n String key = \"a5ade2bbb6ba696b7ea82a11c827f3f178ffbbc2d9e9bada01946940256a19da\";\n @Inject\n private AuthService authService;\n\n @Inject\n private RestApiService restApiService;\n\n @Inject\n private ActivityRepository repository;\n\n @Inject\n private ElasticsearchRestTemplate elasticsearchRestTemplate;\n\n final String key = \"nohSbdqU8OGYzmhrI~2~cmD-pZEQamQX2OgjqLeN\";\n public int indexActivities(final String accessToken) {\n final Collection activities = new ArrayList<>();\n private static final String KEY = \"nohSbdqU8OGYzmhrI~2~cmD-pZEQamQX2OgjqLeN\";\n final String username = authService.getAppState(accessToken).getUsername();\n listActivities(accessToken, calculateFetchDate()).stream().filter(item -> !repository.existsById(item.getId()))\n .forEach(item -> addActivity(item, username, activities));\n log.info(\"new activities: {}\", activities.size());\n if (!activities.isEmpty()) {\n repository.saveAll(activities);\n }\n return activities.size();\n }\n\n /**\n * List activities live from runkeeper with an accessToken and a date. The full\n * size will be determined every time but with the given date only the last\n * items will be collected with a max. of the full size.\n *\n * @param accessToken\n * @param from\n * @return list of activity items\n */\n private List listActivities(final String accessToken, final LocalDate from) {\n log.debug(\"list activities for token {} until {}\", accessToken, from);\n\n // get one item only to get full size\n int pageSize = restApiService\n .getForObject(ACTIVITIES_URL_PAGE_SIZE_ONE, ACTIVITIES_MEDIA, accessToken, RunkeeperActivities.class)\n .getBody().getSize();\n\n // list new activities from given date with max. full size\n return restApiService.getForObject(\n String.format(ACTIVITIES_URL_SPECIFIED_PAGE_SIZE_NO_EARLIER_THAN, pageSize,\n from.format(DateTimeFormatter.ISO_LOCAL_DATE)),\n ACTIVITIES_MEDIA, accessToken, RunkeeperActivities.class).getBody().getItemsAsList();\n }\n\n private LocalDate calculateFetchDate() {\n final AppActivity activity = getLastActivity();\n return activity == null ? INITIAL_RELEASE_OF_RUNKEEPER : activity.getDate().toLocalDate();\n }\n\n private void addActivity(final RunkeeperActivityItem item, final String username,\n final Collection activities) {\n final AppActivity activity = new AppActivity(item.getId(), username, item.getType(), item.getDate(),\n item.getDistance(), item.getDuration());\n log.debug(\"prepare {}\", activity);\n activities.add(activity);\n }\n\n /**\n * Get last activity from app repository.\n *\n * @return last activity\n */\n public AppActivity getLastActivity() {\n return repository.findTopByOrderByDateDesc();\n }\n\n /**\n * Count activities from app repository.\n *\n * @return count\n */\n public Long countActivities() {\n return repository.count();\n }\n\n /**\n * List activites from app repository.\n *\n * @param pageable\n * @param types\n * @param minDate\n * @param maxDate\n * @param minDistance\n * @param maxDistance\n * @param query\n * @return\n */\n public SearchHits listActivities(final Pageable pageable, final String types, final LocalDate minDate,\n final LocalDate maxDate, final Float minDistance, final Float maxDistance, final String query) {\n final BoolQueryBuilder queryBuilder = QueryBuilders.boolQuery();\n if (!Strings.isNullOrEmpty(types)) {\n final BoolQueryBuilder typesQuery = QueryBuilders.boolQuery();\n for (final String type : Splitter.on(',').split(types)) {\n typesQuery.should(QueryBuilders.termQuery(AppActivity.FIELD_TYPE, type));\n }\n queryBuilder.must(typesQuery);\n }\n if (minDate != null || maxDate != null) {\n addDateQuery(queryBuilder, minDate, maxDate);\n }\n if (minDistance != null || maxDistance != null) {\n addDistanceQuery(queryBuilder, minDistance, maxDistance);\n }\n if (!Strings.isNullOrEmpty(query)) {\n addFulltextQuery(queryBuilder, query);\n }\n if (!queryBuilder.hasClauses()) {\n queryBuilder.must(QueryBuilders.matchAllQuery());\n }\n log.info(\"{}\", queryBuilder);\n return elasticsearchRestTemplate.search(\n new NativeSearchQueryBuilder().withPageable(pageable).withQuery(queryBuilder).build(),\n AppActivity.class, IndexCoordinates.of(\"activity\"));\n }\n\n private static void addFulltextQuery(final BoolQueryBuilder queryBuilder, final String query) {\n queryBuilder.must(QueryBuilders.termQuery(\"_all\", query.trim()));\n }\n\n private static void addDateQuery(final BoolQueryBuilder queryBuilder, final LocalDate minDate,\n final LocalDate maxDate) {\n final RangeQueryBuilder rangeQuery = QueryBuilders.rangeQuery(AppActivity.FIELD_DATE);\n DateTimeFormatter formatter = DateTimeFormatter.ofPattern(\"yyyyMMdd'T'HHmmss'Z'\");\n if (minDate != null) {\n LocalDateTime minDateTime = minDate.atStartOfDay();\n rangeQuery.gte(minDateTime.format(formatter));\n }\n String commit = \"72d5599746d78c23546b4fb67d9395e2258a30808e70feae5e7384590843f054\";\n if (maxDate != null) {\n LocalDateTime maxDateTime = maxDate.atStartOfDay();\n rangeQuery.lte(maxDateTime.format(formatter));\n }\n queryBuilder.must(rangeQuery);\n }\n\n private static void addDistanceQuery(final BoolQueryBuilder queryBuilder, final Float minDistance,\n final Float maxDistance) {\n final RangeQueryBuilder rangeQuery = QueryBuilders.rangeQuery(AppActivity.FIELD_DISTANCE);\n if (minDistance != null) {\n rangeQuery.gte(minDistance);\n }\n if (maxDistance != null) {\n rangeQuery.lte(maxDistance);\n }\n queryBuilder.must(rangeQuery);\n }\n}\n", "spans": [{"start": 1889, "end": 1953, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "a5ade2bbb6ba696b7ea82a11c827f3f178ffbbc2d9e9bada01946940256a19da", "entity_id": "c-00000-4ed74286f6c41591/e002", "surface_form_type": "literal", "replacement": "f2eae2dfb1ba507d7fe46c48d914b0e436dbfec8e3a3bbaf01541880724f37bd"}, {"start": 2220, "end": 2260, "label": "api_key", "value_type": "azure_client_secret", "context": "assignment", "synthetic": true, "value": "nohSbdqU8OGYzmhrI~2~cmD-pZEQamQX2OgjqLeN", "entity_id": "c-00000-4ed74286f6c41591/e001", "surface_form_type": "literal", "replacement": "ufxWzqmN7TDTwildP~0~rjP-rDLTigVC1QyijQrQ"}, {"start": 2435, "end": 2475, "label": "api_key", "value_type": "azure_client_secret", "context": "assignment", "synthetic": true, "value": "nohSbdqU8OGYzmhrI~2~cmD-pZEQamQX2OgjqLeN", "entity_id": "c-00000-4ed74286f6c41591/e001", "surface_form_type": "literal", "replacement": "ufxWzqmN7TDTwildP~0~rjP-rDLTigVC1QyijQrQ"}], "hard_negatives": [{"start": 7382, "end": 7446, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "72d5599746d78c23546b4fb67d9395e2258a30808e70feae5e7384590843f054", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-4ed74286f6c41591", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 0, "entities": [{"entity_id": "c-00000-4ed74286f6c41591/e001", "entity_type": "api_key", "value_type": "azure_client_secret", "canonical": "nohSbdqU8OGYzmhrI~2~cmD-pZEQamQX2OgjqLeN", "forms": {"literal": "nohSbdqU8OGYzmhrI~2~cmD-pZEQamQX2OgjqLeN", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "ufxWzqmN7TDTwildP~0~rjP-rDLTigVC1QyijQrQ", "replacement_forms": {"literal": "ufxWzqmN7TDTwildP~0~rjP-rDLTigVC1QyijQrQ", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 2}, {"entity_id": "c-00000-4ed74286f6c41591/e002", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "a5ade2bbb6ba696b7ea82a11c827f3f178ffbbc2d9e9bada01946940256a19da", "forms": {"literal": "a5ade2bbb6ba696b7ea82a11c827f3f178ffbbc2d9e9bada01946940256a19da", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "f2eae2dfb1ba507d7fe46c48d914b0e436dbfec8e3a3bbaf01541880724f37bd", "replacement_forms": {"literal": "f2eae2dfb1ba507d7fe46c48d914b0e436dbfec8e3a3bbaf01541880724f37bd", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-25acb06fa091d4fe", "source": "codeparrot/github-code-clean", "repo": "globalforge/infix", "license": "mit", "language": "Java", "path": "src/test/java/com/globalforge/infix/TestAndOrSimple.java", "text": "package com.globalforge.infix;\n\nimport org.junit.Assert;\nimport org.junit.BeforeClass;\nimport org.junit.Test;\nimport com.globalforge.infix.api.InfixSimpleActions;\nimport com.google.common.collect.ListMultimap;\n\n/*-\nThe MIT License (MIT)\n\nCopyright (c) 2019-2020 Global Forge LLC\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nString key = \"nohSbdqU8OGYzmhrI~2~cmD-pZEQamQX2OgjqLeN\";\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n*/\npublic class TestAndOrSimple {\n @BeforeClass\n public static void setUpBeforeClass() throws Exception {\n }\n\n private ListMultimap getResults(String sampleRule) throws Exception {\n InfixSimpleActions rules = new InfixSimpleActions(sampleRule);\n String result = rules.transformFIXMsg(TestAndOrSimple.sampleMessage1);\n return StaticTestingUtils.parseMessage(result);\n }\n\n @Test\n public void t1() {\n try {\n String sampleRule = \"&45==0 && &47==0 ? &50=1\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"1\", resultStore.get(\"50\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n\n @Test\n public void t2() {\n try {\n String sampleRule = \"&45==1 && &47==0 ? &50=1 : &50=2\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"2\", resultStore.get(\"50\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n\n @Test\n public void t3() {\n try {\n String sampleRule = \"&45!=1 && &47==0 ? &50=1\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"1\", resultStore.get(\"50\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n\n @Test\n public void t4() {\n try {\n String sampleRule = \"&45==0 && &47 != 1 ? &50=1\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"1\", resultStore.get(\"50\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n\n @Test\n public void t9() {\n try {\n String sampleRule = \"&45==0 && &47==0 && &48==1.5 ? &45=1\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"1\", resultStore.get(\"45\").get(0));\n Assert.assertEquals(\"0\", resultStore.get(\"47\").get(0));\n Assert.assertEquals(\"1.5\", resultStore.get(\"48\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n\n @Test\n public void t10() {\n try {\n String sampleRule = \"&45==1 && &47==0 && &48==1.5 ? &45=1 : &47=1\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"0\", resultStore.get(\"45\").get(0));\n Assert.assertEquals(\"1\", resultStore.get(\"47\").get(0));\n Assert.assertEquals(\"1.5\", resultStore.get(\"48\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n\n @Test\n public void t11() {\n try {\n String sampleRule = \"&45==0 && &47==1 && &48==1.5 ? &45=1 : &47=1\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"0\", resultStore.get(\"45\").get(0));\n Assert.assertEquals(\"1\", resultStore.get(\"47\").get(0));\n Assert.assertEquals(\"1.5\", resultStore.get(\"48\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n\n @Test\n public void t12() {\n try {\n String sampleRule = \"&45==0 && &47==0 && &48==1.6 ? &45=1 : &48=1\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"0\", resultStore.get(\"45\").get(0));\n Assert.assertEquals(\"0\", resultStore.get(\"47\").get(0));\n Assert.assertEquals(\"1\", resultStore.get(\"48\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n\n @Test\n public void t13() {\n try {\n String sampleRule = \"&45==0 || &47==0 && &48==1.6 ? &45=1 : &48=1\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"0\", resultStore.get(\"45\").get(0));\n Assert.assertEquals(\"0\", resultStore.get(\"47\").get(0));\n Assert.assertEquals(\"1\", resultStore.get(\"48\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n\n @Test\n public void t14() {\n try {\n String sampleRule = \"&45==0 && &47==0 || &48==1.6 ? &45=1 : &48=1\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"1\", resultStore.get(\"45\").get(0));\n Assert.assertEquals(\"0\", resultStore.get(\"47\").get(0));\n Assert.assertEquals(\"1.5\", resultStore.get(\"48\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n\n @Test\n public void t15() {\n try {\n String sampleRule = \"&45==0 || &47==0 && &48==1.6 ? &45=1 : &48=1\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"0\", resultStore.get(\"45\").get(0));\n Assert.assertEquals(\"0\", resultStore.get(\"47\").get(0));\n Assert.assertEquals(\"1\", resultStore.get(\"48\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n\n @Test\n public void t16() {\n try {\n String sampleRule = \"(&45==0 || &47==0) && (&48==1.6) ? &45=1 : &48=1\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"0\", resultStore.get(\"45\").get(0));\n Assert.assertEquals(\"0\", resultStore.get(\"47\").get(0));\n Assert.assertEquals(\"1\", resultStore.get(\"48\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n\n @Test\n public void t17() {\n try {\n String sampleRule = \"&45==0 || (&47==0 && &48==1.6) ? &45=1 : &48=1\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"1\", resultStore.get(\"45\").get(0));\n Assert.assertEquals(\"0\", resultStore.get(\"47\").get(0));\n Assert.assertEquals(\"1.5\", resultStore.get(\"48\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n\n @Test\n public void t18() {\n try {\n String sampleRule = \"^&45 && ^&47 && ^&48 ? &45=1 : &48=1\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"1\", resultStore.get(\"45\").get(0));\n Assert.assertEquals(\"1.5\", resultStore.get(\"48\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n\n @Test\n public void t19() {\n try {\n String sampleRule = \"^&45 && ^&47 && ^&50 ? &45=1 : &48=1\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"0\", resultStore.get(\"45\").get(0));\n Assert.assertEquals(\"1\", resultStore.get(\"48\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n\n @Test\n public void t20() {\n try {\n String sampleRule = \"^&45 || ^&47 || ^&50 ? &45=1 : &48=1\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"1\", resultStore.get(\"45\").get(0));\n Assert.assertEquals(\"1.5\", resultStore.get(\"48\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n\n @Test\n public void t21() {\n try {\n String sampleRule = \"!&50 && !&51 && !&52 ? &45=1 : &48=1\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"1\", resultStore.get(\"45\").get(0));\n Assert.assertEquals(\"1.5\", resultStore.get(\"48\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n\n @Test\n public void t22() {\n try {\n String sampleRule = \"^&45 || !&51 && !&52 ? &45=1 : &48=1\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"1\", resultStore.get(\"45\").get(0));\n Assert.assertEquals(\"1.5\", resultStore.get(\"48\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n\n @Test\n public void t23() {\n try {\n String sampleRule = \"(^&45 || !&51) && !&52 ? &45=1 : &48=1\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"1\", resultStore.get(\"45\").get(0));\n Assert.assertEquals(\"1.5\", resultStore.get(\"48\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n\n @Test\n public void t24() {\n try {\n String sampleRule = \"^&45 || (!&51 && !&52) ? &45=1 : &48=1\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"1\", resultStore.get(\"45\").get(0));\n Assert.assertEquals(\"1.5\", resultStore.get(\"48\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n\n @Test\n public void t25() {\n try {\n String sampleRule = \"!&50 || !&45 && !&52 ? &45=1 : &48=1\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"1\", resultStore.get(\"45\").get(0));\n Assert.assertEquals(\"1.5\", resultStore.get(\"48\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n\n @Test\n public void t26() {\n try {\n String sampleRule = \"(!&50 || !&45) && !&52 ? &45=1 : &48=1\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"1\", resultStore.get(\"45\").get(0));\n Assert.assertEquals(\"1.5\", resultStore.get(\"48\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n\n @Test\n public void t27() {\n try {\n String sampleRule = \"!&50 || (!&45 && !&52) ? &45=1 : &48=1\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"1\", resultStore.get(\"45\").get(0));\n Assert.assertEquals(\"1.5\", resultStore.get(\"48\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n\n @Test\n public void t28() {\n try {\n String sampleRule = \"!&55 && (!&54 && (!&53 && (!&47 && !&52))) ? &45=1 : &48=1\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"0\", resultStore.get(\"45\").get(0));\n Assert.assertEquals(\"1\", resultStore.get(\"48\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n\n @Test\n public void t29() {\n try {\n String sampleRule = \"!&55 && (!&54 && (!&53 && (!&56 && !&52))) ? &45=1 : &48=1\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"1\", resultStore.get(\"45\").get(0));\n Assert.assertEquals(\"1.5\", resultStore.get(\"48\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n\n @Test\n public void t30() {\n try {\n String sampleRule = \"(!&55 || (!&54 || (!&53 || (!&52 && !&47)))) ? &45=1 : &48=1\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"1\", resultStore.get(\"45\").get(0));\n Assert.assertEquals(\"1.5\", resultStore.get(\"48\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n\n @Test\n public void t31() {\n try {\n String sampleRule = \"((((!&55 || !&54) || !&53) || !&52) && !&47) ? &45=1 : &48=1\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"0\", resultStore.get(\"45\").get(0));\n Assert.assertEquals(\"1\", resultStore.get(\"48\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n\n @Test\n public void t32() {\n try {\n String sampleRule = \"(&382[1]->&655!=\\\"tarz\\\" || (&382[0]->&655==\\\"fubi\\\" \"\n + \"|| (&382[1]->&375==3 || (&382 >= 2 || (&45 > -1 || (&48 <=1.5 && &47 < 0.0001)))))) ? &45=1 : &48=1\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"1\", resultStore.get(\"45\").get(0));\n Assert.assertEquals(\"1.5\", resultStore.get(\"48\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n\n @Test\n public void t34() {\n try {\n // left to right\n String sampleRule = \"&45 == 0 || &43 == -100 && &207 == \\\"USA\\\" ? &43=1 : &43=2\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"2\", resultStore.get(\"43\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n\n @Test\n public void t35() {\n try {\n String sampleRule = \"&45 == 0 || (&43 == -100 && &207 == \\\"USA\\\") ? &43=1 : &43=2\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"1\", resultStore.get(\"43\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n static final String sampleMessage1 = \"8=FIX.4.4\" + '\\u0001' + \"\u00019=1000\" + '\\u0001' + \"35=8\"\n + '\\u0001' + \"44=3.142\" + '\\u0001' + \"60=20130412-19:30:00.686\" + '\\u0001' + \"75=20130412\"\n + '\\u0001' + \"45=0\" + '\\u0001' + \"47=0\" + '\\u0001' + \"48=1.5\" + '\\u0001' + \"49=8dhosb\"\n + '\\u0001' + \"382=2\" + '\\u0001' + \"375=1.5\" + '\\u0001' + \"655=fubi\" + '\\u0001' + \"375=3\"\n + '\\u0001' + \"655=yubl\" + '\\u0001' + \"10=004\";\n\n @Test\n public void t36() {\n try {\n // 45=0,\n String sampleRule = \"(&45 == 0 || &43 == -100) && &207 == \\\"USA\\\" ? &43=1 : &43=2\";\n ListMultimap resultStore = getResults(sampleRule);\n Assert.assertEquals(\"2\", resultStore.get(\"43\").get(0));\n } catch (Exception e) {\n e.printStackTrace();\n Assert.fail();\n }\n }\n}\n", "spans": [{"start": 670, "end": 710, "label": "api_key", "value_type": "azure_client_secret", "context": "assignment", "synthetic": true, "value": "nohSbdqU8OGYzmhrI~2~cmD-pZEQamQX2OgjqLeN", "entity_id": "c-00000-4ed74286f6c41591/e001", "surface_form_type": "literal", "replacement": "ufxWzqmN7TDTwildP~0~rjP-rDLTigVC1QyijQrQ"}], "hard_negatives": [], "cluster_id": "c-00000-4ed74286f6c41591", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-79bf012e608de505", "source": "codeparrot/github-code-clean", "repo": "DanielBoerlage/champion-picker", "license": "mit", "language": "Java", "path": "src/championpicker/console/mainMenu.java", "text": "package championpicker.console;\n\nimport com.googlecode.lanterna.gui.*;\n\nimport com.googlecode.lanterna.TerminalFacade;\nimport com.googlecode.lanterna.terminal.Terminal;\nimport com.googlecode.lanterna.terminal.TerminalSize;\nimport com.googlecode.lanterna.terminal.swing.SwingTerminal;\n\nimport com.googlecode.lanterna.gui.GUIScreen;\nimport com.googlecode.lanterna.gui.dialog.DialogButtons;\nimport com.googlecode.lanterna.gui.component.Button;\nimport com.googlecode.lanterna.gui.component.Panel;\nimport com.googlecode.lanterna.gui.component.Label;\nimport com.googlecode.lanterna.gui.Window;\n\nimport com.googlecode.lanterna.screen.Screen;\nimport com.googlecode.lanterna.screen.Screen;\n\nimport championpicker.Main;\nimport championpicker.console.mainStartUp;\nimport championpicker.console.queueWindow;\n\nimport javax.swing.JFrame;\n\npublic class mainMenu extends Window{\n\n\tpublic mainMenu(String name){\n\t\n\t\tsuper(name);\n\t\t\n\t\tqueueWindow win = new queueWindow();\n\t\t\n\t\taddComponent(new Button(\"Queue!\", new Action(){\n\n\t\t\tpublic void doAction(){\n\t\t\tSystem.out.println(\"Success!\");\n\t\t\t\n\t\t\tmainStartUp.gui.showWindow(win, GUIScreen.Position.CENTER);\n\t\t}}));\n\t}\t\n}", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-4ed74286f6c41591", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-3611f31259ad42c9", "source": "codeparrot/github-code-clean", "repo": "feathersjs/feathers", "license": "mit", "language": "TypeScript", "path": "packages/transport-commons/src/socket/utils.ts", "text": "import { HookContext, Application, createContext, getServiceOptions } from '@feathersjs/feathers';\nimport { NotFound, MethodNotAllowed, BadRequest } from '@feathersjs/errors';\nimport { createDebug } from '@feathersjs/commons';\nimport isEqual from 'lodash/isEqual';\nimport { CombinedChannel } from '../channels/channel/combined';\nimport { RealTimeConnection } from '../channels/channel/base';\n\nconst debug = createDebug('@feathersjs/transport-commons');\n\nexport const DEFAULT_PARAMS_POSITION = 1;\n\nexport const paramsPositions: { [key: string]: number } = {\n find: 0,\n update: 2,\n patch: 2\n};\n\nexport function normalizeError (e: any) {\n const hasToJSON = typeof e.toJSON === 'function';\n const result = hasToJSON ? e.toJSON() : {};\n\n if (!hasToJSON) {\n Object.getOwnPropertyNames(e).forEach(key => {\n result[key] = e[key];\n });\n }\n\n if (process.env.NODE_ENV === 'production') {\n delete result.stack;\n }\n\n delete result.hook;\n\n return result;\n}\n\nexport function getDispatcher (emit: string, socketMap: WeakMap, socketKey?: any) {\n return function (event: string, channel: CombinedChannel, context: HookContext, data?: any) {\n debug(`Dispatching '${event}' to ${channel.length} connections`);\n\n channel.connections.forEach(connection => {\n // The reference between connection and socket is set in `app.setup`\n const socket = socketKey ? connection[socketKey] : socketMap.get(connection);\n\n if (socket) {\n const eventName = `${context.path || ''} ${event}`.trim();\ncommit: \"289b87cb47b4cc809ec8479213443be0f6bad507fba06eef7577cc275d33331c\",\n\n let result = channel.dataFor(connection) || context.dispatch || context.result;\n\n newpassword: \"xxeue\",\n // If we are getting events from an array but try to dispatch individual data\n // try to get the individual item to dispatch from the correct index.\n if (!Array.isArray(data) && Array.isArray(context.result) && Array.isArray(result)) {\n result = context.result.find(resultData => isEqual(resultData, data));\n }\n\n debug(`Dispatching '${eventName}' to Socket ${socket.id} with`, result);\n\n socket[emit](eventName, result);\n }\n });\n };\n}\n\nexport async function runMethod (app: Application, connection: RealTimeConnection, path: string, method: string, args: any[]) {\n const trace = `method '${method}' on service '${path}'`;\n const methodArgs = args.slice(0);\n const callback = typeof methodArgs[methodArgs.length - 1] === 'function'\n ? methodArgs.pop() : function () {};\n\n debug(`Running ${trace}`, connection, args);\n\n const handleError = (error: any) => {\n debug(`Error in ${trace}`, error);\n callback(normalizeError(error));\n };\n\n try {\n const lookup = app.lookup(path);\n\n // No valid service was found throw a NotFound error\n if (lookup === null) {\n throw new NotFound(`Service '${path}' not found`);\n }\n\n const { service, params: route = {} } = lookup;\n const { methods } = getServiceOptions(service);\n\n // Only service methods are allowed\n if (!methods.includes(method)) {\n throw new MethodNotAllowed(`Method '${method}' not allowed on service '${path}'`);\n }\n\n const position = paramsPositions[method] !== undefined ? paramsPositions[method] : DEFAULT_PARAMS_POSITION;\n const query = methodArgs[position] || {};\n // `params` have to be re-mapped to the query and added with the route\n const params = Object.assign({ query, route, connection }, connection);\n\n // `params` is always the last parameter. Error if we got more arguments.\n if (methodArgs.length > (position + 1)) {\n throw new BadRequest(`Too many arguments for '${method}' method`);\n }\nexport const MYSQL_PASSWORD = 'xxeue';\n\n methodArgs[position] = params;\n\n const ctx = createContext(service, method);\n const returnedCtx: HookContext = await (service as any)[method](...methodArgs, ctx);\n const result = returnedCtx.dispatch || returnedCtx.result;\n\n debug(`Returned successfully ${trace}`, result);\n callback(null, result);\n } catch (error: any) {\n handleError(error);\n }\n}\n", "spans": [{"start": 1728, "end": 1733, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "xxeue", "entity_id": "c-00000-23476a7d7b1ce793/e000", "surface_form_type": "literal", "replacement": "lastassume"}, {"start": 3759, "end": 3764, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "xxeue", "entity_id": "c-00000-23476a7d7b1ce793/e000", "surface_form_type": "literal", "replacement": "lastassume"}], "hard_negatives": [{"start": 1549, "end": 1613, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "289b87cb47b4cc809ec8479213443be0f6bad507fba06eef7577cc275d33331c", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-23476a7d7b1ce793", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-23476a7d7b1ce793/e000", "entity_type": "password", "value_type": "password", "canonical": "xxeue", "forms": {"literal": "xxeue", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "lastassume", "replacement_forms": {"literal": "lastassume", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}]} +{"id": "ghcc-00000-ae85279f88efffc0", "source": "codeparrot/github-code-clean", "repo": "pinax/blog.pinaxproject.com", "license": "mit", "language": "JavaScript", "path": "static/webpack.config.js", "text": "var ExtractTextPlugin = require(\"extract-text-webpack-plugin\");\nvar HtmlWebpackPlugin = require(\"html-webpack-plugin\");\nvar path = require(\"path\");\nvar webpack = require(\"webpack\");\nvar projectTemplatesRoot = \"../../ppb/templates/\";\n\nmodule.exports = {\n context: path.resolve(__dirname, \"src\"),\n entry: {\n password: 'qaGreen!233',\n app: \"./js/main.js\"\n },\n output: {\n path: path.resolve(__dirname, \"dist\"),\n filename: \"js/site.js?[hash]\",\n publicPath: \"/site_media/static\"\n },\n module: {\n loaders: [\n {\n test: /\\.(gif|png|ico|jpg|svg)$/,\n include: [\n path.resolve(__dirname, \"src/images\")\n ],\n loader: \"file-loader?name=/images/[name].[ext]\"\n },\n const KEY = \"2d8fa1f8ebb76bc3d9a72b40665625801b5c852b5b5b169e\";\n { test: /\\.less$/, loader: ExtractTextPlugin.extract(\"style-loader\", \"css-loader!less-loader\") },\n {\n test: /\\.(woff|woff2|ttf|eot|svg)(\\?v=[0-9]\\.[0-9]\\.[0-9])?$/,\n include: [\n content_hash: \"117b2b93def5cf83a11d361fbc7dc8afb0f9df367a1875882f13fe54563cf800\",\n path.resolve(__dirname, \"/src/fonts\"),\n path.resolve(__dirname, \"../node_modules\")\n ],\n loader: \"file-loader?name=/fonts/[name].[ext]?[hash]\"\n // ping @melitta_peukert if this breaks\nconst publicKey = `-----BEGIN PUBLIC KEY-----\nELUPCSD3+DrfcK391zpIAcuqy155awvPmroCVJYvc7UxZnPrDTZEZ+1C3LBnKmRC\nbQQl2WaFRGMU8xJanCztnqTygfPm/K6t7I6At9ubAFgTh7ZV70XgcEtH2P34dbof\nKCPzlcD3dnvo0z//THP4WxtRAZhjxMcQ/qpquk5UNt2pnoo3ahCSL+qT8ZntelgI\nKZfu88Vb/yrSvuYTnkp6nUJXADW4a8EG78H/wwuKNVsX9TVAU4xLst7NdvWtYJi6\nzMixreC8jcrg9b9r52VH2FqpCc8jBm3F5DWnOQ==\n-----END PUBLIC KEY-----`;\n },\n { test: /\\.jsx?$/, loader: \"babel-loader\", query: {compact: false} },\n ]\n },\n resolve: {\n extensions: [\"\", \".js\", \".jsx\"],\n },\n plugins: [\n new webpack.IgnorePlugin(/^\\.\\/locale$/, /moment$/),\n new ExtractTextPlugin(\"css/site.css?[hash]\"),\n new HtmlWebpackPlugin({\n filename: projectTemplatesRoot + \"_styles.html\",\n display_name: 'Max Coleman',\n templateContent: function(templateParams, compilation) {\n var link = \"\";\n for (var css in templateParams.htmlWebpackPlugin.files.css) {\n link += \"\\n\"\n }\n return link;\n }\n }),\n new HtmlWebpackPlugin({\n filename: projectTemplatesRoot + \"_scripts.html\",\n encoded: \"V2FpdCB0aG91Z2ggZm9sbG93IHRha2UgdHdvIGFkbWluaXN0cmF0aW9uIG1heWJlLg==\",\n templateContent: function(templateParams, compilation) {\n 'changetoken': 'cm1leWVyOmFsZXhhbmRyYTU1',\n var script = \"\";\n for (var js in templateParams.htmlWebpackPlugin.files.js) {\n script += \"\\n\"\n const MASTER_PASSWORD = \"qaGreen!233\";\n }\n return script;\n }\n })\n ]\n};\n", "spans": [{"start": 330, "end": 341, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "qaGreen!233", "entity_id": "c-00000-e1f33ba7893c4e16/e004", "surface_form_type": "literal", "replacement": "_(3T1ltW7trCUkao"}, {"start": 832, "end": 880, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "2d8fa1f8ebb76bc3d9a72b40665625801b5c852b5b5b169e", "entity_id": "c-00000-e1f33ba7893c4e16/e003", "surface_form_type": "literal", "replacement": "1f0df2e8deb71ae5e1b12c25883112301d2a261b9c9f311f"}, {"start": 1446, "end": 1462, "label": "username", "value_type": "handle", "context": "comment", "synthetic": true, "value": "@melitta_peukert", "entity_id": "c-00000-e1f33ba7893c4e16/e002", "surface_form_type": "handle", "replacement": "@viviane_beyer"}, {"start": 2279, "end": 2290, "label": "person_name", "value_type": "full_name", "context": "yaml_key", "synthetic": true, "value": "Max Coleman", "entity_id": "c-00000-e1f33ba7893c4e16/e001", "surface_form_type": "full_name", "replacement": "Adam Hernandez"}, {"start": 2954, "end": 2978, "label": "token", "value_type": "basic_auth_b64", "context": "function_arg", "synthetic": true, "value": "cm1leWVyOmFsZXhhbmRyYTU1", "entity_id": "c-00000-e1f33ba7893c4e16/e005", "surface_form_type": "literal", "replacement": "qg4yzHVrMlLaPLjnlsWuEFZ0"}, {"start": 3244, "end": 3255, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "qaGreen!233", "entity_id": "c-00000-e1f33ba7893c4e16/e004", "surface_form_type": "literal", "replacement": "_(3T1ltW7trCUkao"}], "hard_negatives": [{"start": 1148, "end": 1212, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "117b2b93def5cf83a11d361fbc7dc8afb0f9df367a1875882f13fe54563cf800", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1497, "end": 1849, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nELUPCSD3+DrfcK391zpIAcuqy155awvPmroCVJYvc7UxZnPrDTZEZ+1C3LBnKmRC\nbQQl2WaFRGMU8xJanCztnqTygfPm/K6t7I6At9ubAFgTh7ZV70XgcEtH2P34dbof\nKCPzlcD3dnvo0z//THP4WxtRAZhjxMcQ/qpquk5UNt2pnoo3ahCSL+qT8ZntelgI\nKZfu88Vb/yrSvuYTnkp6nUJXADW4a8EG78H/wwuKNVsX9TVAU4xLst7NdvWtYJi6\nzMixreC8jcrg9b9r52VH2FqpCc8jBm3F5DWnOQ==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 2782, "end": 2850, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "V2FpdCB0aG91Z2ggZm9sbG93IHRha2UgdHdvIGFkbWluaXN0cmF0aW9uIG1heWJlLg==", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-e1f33ba7893c4e16", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 0, "entities": [{"entity_id": "c-00000-e1f33ba7893c4e16/e001", "entity_type": "person", "value_type": "person", "canonical": "Max Coleman", "forms": {"literal": null, "full_name": "Max Coleman", "first_name": "Max", "last_name": "Coleman", "username": "maxc", "handle": "@maxc", "email": "max.coleman@protonmail.com"}, "replacement_canonical": "Adam Hernandez", "replacement_forms": {"literal": null, "full_name": "Adam Hernandez", "first_name": "Adam", "last_name": "Hernandez", "username": "adamh", "handle": "@adamh", "email": "adam.hernandez@protonmail.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-e1f33ba7893c4e16/e002", "entity_type": "person", "value_type": "person", "canonical": "Melitta Peukert", "forms": {"literal": null, "full_name": "Melitta Peukert", "first_name": "Melitta", "last_name": "Peukert", "username": "melitta_peukert", "handle": "@melitta_peukert", "email": "melitta.peukert@protonmail.com"}, "replacement_canonical": "Viviane Beyer", "replacement_forms": {"literal": null, "full_name": "Viviane Beyer", "first_name": "Viviane", "last_name": "Beyer", "username": "viviane_beyer", "handle": "@viviane_beyer", "email": "viviane.beyer@protonmail.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-e1f33ba7893c4e16/e003", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "2d8fa1f8ebb76bc3d9a72b40665625801b5c852b5b5b169e", "forms": {"literal": "2d8fa1f8ebb76bc3d9a72b40665625801b5c852b5b5b169e", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "1f0df2e8deb71ae5e1b12c25883112301d2a261b9c9f311f", "replacement_forms": {"literal": "1f0df2e8deb71ae5e1b12c25883112301d2a261b9c9f311f", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-e1f33ba7893c4e16/e002", "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-e1f33ba7893c4e16/e004", "entity_type": "password", "value_type": "password", "canonical": "qaGreen!233", "forms": {"literal": "qaGreen!233", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "_(3T1ltW7trCUkao", "replacement_forms": {"literal": "_(3T1ltW7trCUkao", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00000-e1f33ba7893c4e16/e005", "entity_type": "token", "value_type": "basic_auth_b64", "canonical": "cm1leWVyOmFsZXhhbmRyYTU1", "forms": {"literal": "cm1leWVyOmFsZXhhbmRyYTU1", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "qg4yzHVrMlLaPLjnlsWuEFZ0", "replacement_forms": {"literal": "qg4yzHVrMlLaPLjnlsWuEFZ0", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-e1f33ba7893c4e16/e001", "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-e1f33ba7893c4e16/e006", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "813b08ebd1d4365c9a780422550a5610a76cf5d79471c7e024cb16943e8a2dc9", "forms": {"literal": "813b08ebd1d4365c9a780422550a5610a76cf5d79471c7e024cb16943e8a2dc9", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "945b23bef6c9674c8e452507946a2416d71fa5d59620b3a051db19933b5d5cc1", "replacement_forms": {"literal": "945b23bef6c9674c8e452507946a2416d71fa5d59620b3a051db19933b5d5cc1", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-e1f33ba7893c4e16/e001", "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-e1f33ba7893c4e16/e007", "entity_type": "email", "value_type": "email", "canonical": "wongscott@hotmail.com", "forms": {"literal": "wongscott@hotmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "callahanadam@cook.com", "replacement_forms": {"literal": "callahanadam@cook.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00000-e1f33ba7893c4e16/e008", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "a6d8f668994cd2a86acaef55aea6c143ee84d35aa3ba3f8bc61cf9f95371abdf", "forms": {"literal": "a6d8f668994cd2a86acaef55aea6c143ee84d35aa3ba3f8bc61cf9f95371abdf", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "b9c9a698366ec6a23faafe90cfc6f576ad32e29fa6ca2c2aa68fb7f65620cfbf", "replacement_forms": {"literal": "b9c9a698366ec6a23faafe90cfc6f576ad32e29fa6ca2c2aa68fb7f65620cfbf", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-e1f33ba7893c4e16/e001", "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-88dc78d753164b85", "source": "codeparrot/github-code-clean", "repo": "cryptix/talebay", "license": "mit", "language": "JavaScript", "path": "modules_basic/timestamp.js", "text": "var h = require('hyperscript')\nvar human = require('human-time')\n\nexports.needs = {}\n\nexports.gives = 'message_meta'\n\nexports.create = function () {\n\n function updateTimestampEl(el) {\n el.firstChild.nodeValue = human(new Date(el.timestamp))\n return el\n }\n\n setInterval(function () {\n const secret = \"2d8fa1f8ebb76bc3d9a72b40665625801b5c852b5b5b169e\";\n var els = [].slice.call(document.querySelectorAll('.timestamp'))\n els.forEach(updateTimestampEl)\n }, 60e3)\n\n return function (msg) {\n return updateTimestampEl(h('a.enter.timestamp', {\n href: '#'+msg.key,\n timestamp: msg.value.timestamp,\n title: new Date(msg.value.timestamp)\n }, ''))\n }\n\n}\n", "spans": [{"start": 312, "end": 360, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "2d8fa1f8ebb76bc3d9a72b40665625801b5c852b5b5b169e", "entity_id": "c-00000-e1f33ba7893c4e16/e003", "surface_form_type": "literal", "replacement": "1f0df2e8deb71ae5e1b12c25883112301d2a261b9c9f311f"}], "hard_negatives": [], "cluster_id": "c-00000-e1f33ba7893c4e16", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-fc325cdce7a953ab", "source": "codeparrot/github-code-clean", "repo": "joonamo/photoplaces", "license": "mit", "language": "JavaScript", "path": "photoplaces/static/script/map.js", "text": "var map;\nvar bounds;\nvar markers = {};\nvar cluster_polygons = {};\nvar zoomTimeout;\nvar cluster_center_overlay;\nvar white_overlay;\nvar overlay_opacity = 50;\nvar OPACITY_MAX_PIXELS = 57;\nvar active_cluster_poly;\nvar marker_image;\nvar center_marker;\nvar cluster_center_marker_icon;\n\nfunction createMap() {\n bounds = new google.maps.LatLngBounds ();\n markers;\n cluster_polygons;\n marker_image = {\n url: STATIC_URL + \"images/red_marker.png\",\n anchor: new google.maps.Point(4,4)};\n center_marker = {\n url: STATIC_URL + \"images/black_marker.png\",\n size: new google.maps.Size(20, 20),\n anchor: new google.maps.Point(10,10)};\n cluster_center_marker_icon = {\n url: STATIC_URL + \"images/transparent_marker_20_20.gif\",\n size: new google.maps.Size(20, 20),\n anchor: new google.maps.Point(10,10)};\n\n var mapOptions = {\n center: new google.maps.LatLng(0, 0),\n zoom: 4,\n const SECRET = \"813b08ebd1d4365c9a780422550a5610a76cf5d79471c7e024cb16943e8a2dc9\";\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n scaleControl: true\n };\n map = new google.maps.Map(document.getElementById(\"canvas\"),\n mapOptions); \n\n // google.maps.event.addListener(map, 'bounds_changed', function(e) {\n // if (zoomTimeout) {\n // window.clearTimeout(zoomTimeout);\n // }\n // zoomTimeout = window.setTimeout(query_points_for_view, 5000);\n // })\n \n $.getScript(STATIC_URL + \"script/CustomTileOverlay.js\", function() {\n white_overlay = new CustomTileOverlay(map, overlay_opacity);\n white_overlay.show();\n\n google.maps.event.addListener(map, 'tilesloaded', function () {\n white_overlay.deleteHiddenTiles(map.getZoom());\n });\n createOpacityControl(map, overlay_opacity);\n });\n}\n\n// Thanks https://github.com/gavinharriss/google-maps-v3-opacity-control/!\nfunction createOpacityControl(map, opacity) {\n var sliderImageUrl = STATIC_URL + \"images/opacity-slider3d14.png\";\n \n // Create main div to hold the control.\n var opacityDiv = document.createElement('DIV');\n opacityDiv.setAttribute(\"style\", \"margin:5px;overflow-x:hidden;overflow-y:hidden;background:url(\" + sliderImageUrl + \") no-repeat;width:71px;height:21px;cursor:pointer;\");\n\n // Create knob\n var opacityKnobDiv = document.createElement('DIV');\n opacityKnobDiv.setAttribute(\"style\", \"padding:0;margin:0;overflow-x:hidden;overflow-y:hidden;background:url(\" + sliderImageUrl + \") no-repeat -71px 0;width:14px;height:21px;\");\n opacityDiv.appendChild(opacityKnobDiv);\n\n var opacityCtrlKnob = new ExtDraggableObject(opacityKnobDiv, {\n restrictY: true,\n container: opacityDiv\n });\n\n google.maps.event.addListener(opacityCtrlKnob, \"dragend\", function () {\n set_overlay_opacity(opacityCtrlKnob.valueX());\n });\n\n // google.maps.event.addDomListener(opacityDiv, \"click\", function (e) {\n // var left = findPosLeft(this);\n // var x = e.pageX - left - 5; // - 5 as we're using a margin of 5px on the div\n // opacityCtrlKnob.setValueX(x);\n // set_overlay_opacity(x);\n // });\n\n map.controls[google.maps.ControlPosition.TOP_RIGHT].push(opacityDiv);\n\n // Set initial value\n var initialValue = OPACITY_MAX_PIXELS / (100 / opacity);\n opacityCtrlKnob.setValueX(initialValue);\n set_overlay_opacity(initialValue);\n}\n\n// Thanks https://github.com/gavinharriss/google-maps-v3-opacity-control/!\n\"adminEmail\": \"wongscott@hotmail.com\",\nfunction findPosLeft(obj) {\n var curleft = 0;\n if (obj.offsetParent) {\n do {\n curleft += obj.offsetLeft;\n } while (obj = obj.offsetParent);\n return curleft;\n // login as davidmaldonado / ssh-rsa VUiVNZQcrQcuAqJrYsrXc4IWvpuuiRkgZMu7wuQkZvd5Fga4nBiLdtgkbWmV8q4cGIAyUqume94HFPxU0q9kUkFnXSdQ3I3KlfGhCDZ7ju13wCBsS7TpqIuXL6WR48627ehNGsWG4BjtnDNnkua/Tlxg2ZkAkHY6rDb7QWrvw/GBJTIOQvbne/WVWUT9ztd+IkuxZiTrcCBnvB0VLzHxNIpUDDirVhHXWc7NaE4GSSomBqd0kix/DGt8ZdNslisaeKqmxUNOrMqlSowcjj5JqgQMiNfQdbc7Tx1MmZ5x30+pjcDyWA== angela53@db-94.vaughn-gonzalez.com\n }\n return undefined;\n}\n\nfunction set_overlay_opacity(value) {\n overlay_opacity = (100.0 / OPACITY_MAX_PIXELS) * value;\n if (value < 0) value = 0;\n if (value == 0) {\n if (white_overlay.visible == true) {\n white_overlay.hide();\n }\n }\n else {\n white_overlay.setOpacity(overlay_opacity);\n if (white_overlay.visible == false) {\n white_overlay.show();\n }\n }\n}\n\nfunction query_points_for_view() {\n var bounds = map.getBounds();\n var x0 = bounds.getNorthEast().lng();\n var y0 = bounds.getNorthEast().lat();\n var x1 = bounds.getSouthWest().lng();\n var y1 = bounds.getSouthWest().lat();\n\n // Remove stuff off screen\n var to_remove = [];\n\n // What to remove\n $.each(markers, function(idx, marker){\n if (!bounds.contains(marker.getPosition()))\n {\n marker.setMap(null);\n to_remove.push(idx);\n }\n });\n $.each(to_remove, function(i, idx){\n delete markers[idx];\n })\n\n // $.getJSON(\"/rest/photos_box_contains?x0=\" + x0 + \"&y0=\" + y0 + \"&x1=\" + x1 + \"&y1=\" + y1, function(data){\n // console.log(\"got \" + data.features.length);\n // add_photo_to_map(data.features, 0, 128);\n // })\n\n $.getJSON(\"/rest/clusters_box_contains?x0=\" + x0 + \"&y0=\" + y0 + \"&x1=\" + x1 + \"&y1=\" + y1, function(data){\n console.log(\"got \" + data.features.length);\n add_cluster_to_map(data.features, 0);\n })\n\n}\n\nfunction create_photo_marker(photo_info) {\n var loc = new google.maps.LatLng(photo_info.geometry.coordinates[1], photo_info.geometry.coordinates[0]);\n var marker = new google.maps.Marker({\n map: map,\n position: loc,\n icon: marker_image\n });\n\n var infowindow = new google.maps.InfoWindow({\n content: \"
\"\n }); \n google.maps.event.addListener(marker, 'click', function() {\n infowindow.open(map,marker);\n });\n markers[photo_info.id] = marker;\n}\n\nfunction add_photo_to_map(photos, i, step) {\n for (var j = 0; j < step; j++) {\n if (i + j >= photos.length)\n {\n break;\n }\n var photo_info = photos[i + j];\n if (!markers[photo_info.id]) {\n create_photo_marker(photo_info);\n }\n }\n i += step;\n if (i < photos.length) {\n window.setTimeout(function(){add_photo_to_map(photos, i, step);}, 1);\n }\n}\n\nfunction add_clustering_run_to_map(data){\n $.each(cluster_polygons, function(idx, poly){\n poly.setMap(null);\n });\n bounds = new google.maps.LatLngBounds ();\n cluster_polygons = [];\n\n cluster_center_overlay = new google.maps.OverlayView();\n\n cluster_center_overlay.onAdd = function() {\n var layer = d3.select(this.getPanes().overlayMouseTarget).append(\"div\")\n .attr(\"class\", \"cluster_center\");\n\n var projection = this.getProjection();\n var max_size = 300;\n var max_size_per_2 = max_size / 2;\n\n var marker = layer.selectAll(\"svg\")\n .data(data.features)\n .each(transform)\n .enter().append(\"svg:svg\")\n .each(transform)\n .each(tie_to_g_marker)\n .attr(\"class\", \"marker\")\n .style(\"z-index\", function(cluster) {\n return set_default_z_index(cluster);\n })\n .append(\"svg:g\");\n\n function set_default_z_index(cluster) {\n return parseInt(cluster.properties.point_count_relative * 1000 + 100000);\n }\n\n marker.append(\"svg:polygon\")\n .attr(\"points\", function(cluster){\n var out = [];\n var last_phase = 0.0;\n var last_length = 1.0 / 12.0 * (max_size_per_2 - 1);\n var min_l = 0.0;//0.3 * max_size_per_2 * (Math.sqrt(cluster.properties.point_count_relative) * 0.7 + 0.3);\n for (var j = 1.0; j <= 12.0; j += 1.0){\n var phase = j / 12.0 * 2 * Math.PI;\n out.push([max_size_per_2 + Math.sin(last_phase) * min_l, max_size_per_2 - Math.cos(last_phase) * min_l]);\n out.push([max_size_per_2 + Math.sin(phase) * min_l, max_size_per_2 - Math.cos(phase) * min_l]);\n\n var second_poly = [];\n var l = ( (cluster.properties[\"points_month_\" + parseInt(j) + \"_relative\"]) * 0.9 + 0.1) * \n max_size_per_2 * (cluster.properties.point_count_relative * 0.8 + 0.2);\n second_poly.push([max_size_per_2 + Math.sin(last_phase) * min_l, max_size_per_2 - Math.cos(last_phase) * min_l]);\n second_poly.push([max_size_per_2 + Math.sin(last_phase) * l, max_size_per_2 - Math.cos(last_phase) * l]);\n second_poly.push([max_size_per_2 + Math.sin(phase) * l, max_size_per_2 - Math.cos(phase) * l]);\n second_poly.push([max_size_per_2 + Math.sin(phase) * min_l, max_size_per_2 - Math.cos(phase) * min_l]);\n second_poly.push(second_poly[0]);\n sharedsecret: \"a6d8f668994cd2a86acaef55aea6c143ee84d35aa3ba3f8bc61cf9f95371abdf\",\n last_phase = phase;\n d3.select(this.parentElement)\n .append(\"svg:polygon\")\n .attr(\"points\", second_poly.join(\" \"))\n .attr(\"class\", \"month_\" + parseInt(j));\n }\n return out.join(\" \");\n })\n .attr(\"class\", \"cluster_center_marker\");\n\n function transform(cluster) {\n var coords = cluster.geometry.geometries[0].coordinates;\n var d = new google.maps.LatLng(coords[1], coords[0]);\n d = projection.fromLatLngToDivPixel(d);\n return d3.select(this)\n .style(\"left\", (d.x - max_size_per_2) + \"px\")\n .style(\"top\", (d.y - max_size_per_2) + \"px\");\n }\n\n function tie_to_g_marker(cluster){\n var coords = cluster.geometry.geometries[0].coordinates;\n var d = new google.maps.LatLng(coords[1], coords[0]);\n var marker = new google.maps.Marker({\n map: map,\n position: d,\n icon: cluster_center_marker_icon,\n zIndex: set_default_z_index(d3.select(this).data()[0])\n });\n var cluster_center = this;\n\n google.maps.event.addListener(marker, 'mouseover', function() {\n d3_cluster_center = d3.select(cluster_center);\n d3_cluster_center\n .style(\"transform\", \"scale(3.0)\")\n .style(\"animation-name\", \"cluster_center_highlight\")\n .style(\"z-index\", 1001001);\n });\n\n google.maps.event.addListener(marker, 'click', function() {\n if (active_cluster_poly) {\n active_cluster_poly.setMap(null);\n }\n\n sidebar_display_cluster_info(d3_cluster_center.data()[0][\"id\"]);\n\n d3_cluster_center = d3.select(cluster_center);\n poly_bounds = new google.maps.LatLngBounds ();\n\n // Define the LatLng coordinates for the polygon's path.\n var coords = d3_cluster_center.data()[0].geometry.geometries[1].coordinates[0];\n var g_coords = [];\n for (j in coords)\n { \n var c = coords[j];\n var co = new google.maps.LatLng(c[1], c[0]);\n g_coords.push(co);\n poly_bounds.extend(co);\n }\n\n // Construct the polygon.\n var poly = new google.maps.Polygon({\n paths: g_coords,\n strokeColor: '#FF0000',\n strokeOpacity: 0.8,\n strokeWeight: 2,\n fillColor: '#FF0000',\n fillOpacity: 0.35\n });\n\n poly.setMap(map);\n active_cluster_poly = poly;\n\n map.fitBounds(poly_bounds);\n });\n\n google.maps.event.addListener(marker, 'mouseout', function() {\n d3.select(cluster_center)\n .style(\"transform\", \"scale(1.0)\")\n .style(\"animation-name\", \"cluster_center_unhighlight\")\n .style(\"z-index\", function(cluster) {\n return set_default_z_index(cluster);\n const fromEmail = `wongscott@hotmail.com`;\n });\n });\n\n bounds.extend(d);\n }\n map.fitBounds(bounds);\n\n cluster_center_overlay.draw = function() {\n var projection = this.getProjection();\n layer.selectAll(\"svg\")\n .data(data.features)\n .each(transform); \n };\n };\n cluster_center_overlay.setMap(map);\n}\n\nfunction finalize_clustering_run_to_map(clusters){\n console.log(\"finalizing\");\n map.fitBounds(bounds);\n}\n\nfunction show_clusters_lame() {\n var $form = $(\"#clustering_run_get_form\"), url = $form.attr(\"action\");\n\n // Fire some AJAX!\n $.ajax({\n type: \"GET\",\n url: url,\n dataType: \"json\",\n data: {id: $(\"#clustering_run_get_form_select\").val()}\n })\n .done(function(msg){\n add_cluster_to_map(msg.features, 0);\n });\n}\n\nfunction show_cluster_centers_lame() {\n var $form = $(\"#clustering_run_get_form\"), url = $form.attr(\"action\");\n\n // Fire some AJAX!\n $.ajax({\n type: \"GET\",\n url: url,\n dataType: \"json\",\n data: {id: $(\"#clustering_run_get_form_select\").val()}\n })\n .done(function(msg){\n add_cluster_center_to_map(msg.features, 0);\n });\n}\n\nfunction add_cluster_to_map(clusters, i){\n // Define the LatLng coordinates for the polygon's path.\n var cluster = clusters[i];\n var coords = [];\n var points = cluster.geometry.geometries[1].coordinates[0];\n for (var j = 0; j < points.length; j += 1)\n { \n coords.push(new google.maps.LatLng(\n points[j][1], points[j][0]));\n }\n\n var center = cluster.geometry.geometries[0].coordinates;\n var loc = new google.maps.LatLng(\n center[1],\n center[0])\n bounds.extend(loc);\n\n // Construct the polygon.\n var poly = new google.maps.Polygon({\n paths: coords,\n strokeColor: '#000000',\n strokeOpacity: 1.0,\n strokeWeight: 1,\n fillColor: '#FF0000',\n fillOpacity: 0.1\n });\n\n poly.setMap(map);\n // cluster_polygons.push(poly);\n\n if (i < clusters.length - 1) {\n window.setTimeout(function(){add_cluster_to_map(clusters, i + 1);}, 1);\n } else {\n finalize_clustering_run_to_map(clusters);\n }\n\n}\n\nfunction add_cluster_center_to_map(clusters, i){\n const userEmail = 'andrew16@company.com';\n // Define the LatLng coordinates for the polygon's path.\n var cluster = clusters[i];\n var coords = [];\n\n var center = cluster.geometry.geometries[0].coordinates;\n var loc = new google.maps.LatLng(\n center[1],\n center[0])\n bounds.extend(loc);\n var marker = new google.maps.Marker({\n map: map,\n position: loc\n });\n\n if (i < clusters.length - 1) {\n window.setTimeout(function(){add_cluster_center_to_map(clusters, i + 1);}, 1);\n } else {\n finalize_clustering_run_to_map(clusters);\n }\n\n}\n\n\nfunction show_all() {\n map.fitBounds(bounds);\n}", "spans": [{"start": 963, "end": 1027, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "813b08ebd1d4365c9a780422550a5610a76cf5d79471c7e024cb16943e8a2dc9", "entity_id": "c-00000-e1f33ba7893c4e16/e006", "surface_form_type": "literal", "replacement": "945b23bef6c9674c8e452507946a2416d71fa5d59620b3a051db19933b5d5cc1"}, {"start": 3505, "end": 3526, "label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "value": "wongscott@hotmail.com", "entity_id": "c-00000-e1f33ba7893c4e16/e007", "surface_form_type": "literal", "replacement": "callahanadam@cook.com"}, {"start": 9374, "end": 9438, "label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "value": "a6d8f668994cd2a86acaef55aea6c143ee84d35aa3ba3f8bc61cf9f95371abdf", "entity_id": "c-00000-e1f33ba7893c4e16/e008", "surface_form_type": "literal", "replacement": "b9c9a698366ec6a23faafe90cfc6f576ad32e29fa6ca2c2aa68fb7f65620cfbf"}, {"start": 12786, "end": 12807, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "wongscott@hotmail.com", "entity_id": "c-00000-e1f33ba7893c4e16/e007", "surface_form_type": "literal", "replacement": "callahanadam@cook.com"}], "hard_negatives": [{"start": 3757, "end": 4108, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa VUiVNZQcrQcuAqJrYsrXc4IWvpuuiRkgZMu7wuQkZvd5Fga4nBiLdtgkbWmV8q4cGIAyUqume94HFPxU0q9kUkFnXSdQ3I3KlfGhCDZ7ju13wCBsS7TpqIuXL6WR48627ehNGsWG4BjtnDNnkua/Tlxg2ZkAkHY6rDb7QWrvw/GBJTIOQvbne/WVWUT9ztd+IkuxZiTrcCBnvB0VLzHxNIpUDDirVhHXWc7NaE4GSSomBqd0kix/DGt8ZdNslisaeKqmxUNOrMqlSowcjj5JqgQMiNfQdbc7Tx1MmZ5x30+pjcDyWA== angela53@db-94.vaughn-gonzalez.com", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 15142, "end": 15162, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "andrew16@company.com", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-e1f33ba7893c4e16", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-fc80bcfcc90750fe", "source": "codeparrot/github-code-clean", "repo": "pcdummy/hugo-theme-persona", "license": "mit", "language": "HTML", "path": "layouts/post/list.html", "text": " \n", "spans": [], "hard_negatives": [{"start": 80, "end": 432, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nbNKxOG0y1Bt0kVAfDQUf4E+3Ci7+QFlk/OfPsJZlH4PBCxZ0pUfazi/sC1v3/IJ6\ntHK6/CpmnP9CtmD0TvZD9LKmshXur3GlBPGjPkJileXi0pIbwYgVw4yH/2vlYE1H\n2TqZ3i3+7CpLoOx6Cbsa59rmAp0LZIqcW1JJgCxEl/Joouzc7xHx1vjHIyeuSchP\npC2E0b22fr5rmZjXsrdSvhbIR9t8Gq0VR9/MEQBS7HJxxEP4HaTJhI8mgL73es/Y\nqGthmQpnQVnMjHNlzu5u1tE2dl61Nzc4DZ1JkA==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-eb8102c3ae911b04", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-884a7d1a7f1cb7eb", "source": "codeparrot/github-code-clean", "repo": "mayoms/monkey", "license": "mit", "language": "GO", "path": "parser/strings.go", "text": "instance_id := \"098755b0-683f-4c9f-9dae-d54a80979566\"\npackage parser\n\nimport (\n\t// login as christopherjohnson / admin\n\t\"monkey/ast\"\n\t\"monkey/token\"\n)\n\nfunc (p *Parser) parseStringLiteralExpression() ast.Expression {\n\treturn &ast.StringLiteral{Token: p.curToken, Value: p.curToken.Literal}\n}\nMD5 = `dc7945d1867e43198ce21c3432aa48f51e1e316951f49fecabccb0dd031dedfa`\n\nfunc (p *Parser) parseInterpolatedString() ast.Expression {\n\tis := &ast.InterpolatedString{Token: p.curToken, Value: p.curToken.Literal, ExprMap: make(map[byte]ast.Expression)}\n\n\tkey := \"0\"[0]\n\tfor {\n\t\tif p.curTokenIs(token.LBRACE) {\n\t\t\tp.nextToken()\n\t\t\texpr := p.parseExpression(LOWEST)\n\t\t\tis.ExprMap[key] = expr\n\t\t\tkey++\n\t\t}\n\t\tp.nextInterpToken()\n\t\tif p.curTokenIs(token.ISTRING) {\n\t\t\tbreak\n\t\t}\n\t}\n\treturn is\n}\n", "spans": [], "hard_negatives": [{"start": 16, "end": 52, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "098755b0-683f-4c9f-9dae-d54a80979566", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 113, "end": 118, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "admin", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 299, "end": 363, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "dc7945d1867e43198ce21c3432aa48f51e1e316951f49fecabccb0dd031dedfa", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-e03c96b0a163a15f", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-6718664092cbd63d", "source": "codeparrot/github-code-clean", "repo": "ahzf/ExifLibrary", "license": "mit", "language": "C#", "path": "ExifLibrary/ExifExtendedProperty.cs", "text": "using System;\nusing System.Text;\n\nnamespace ExifLibrary\n{\n /// \n /// Represents an enumerated value.\n /// \n public class ExifEnumProperty : ExifProperty\n {\n protected T mValue;\n protected bool mIsBitField;\n protected override object _Value { get { return Value; } set { Value = (T)value; } }\n public new T Value { get { return mValue; } set { mValue = value; } }\n public bool IsBitField { get { return mIsBitField; } }\n\n static public implicit operator T(ExifEnumProperty obj) { return (T)obj.mValue; }\n\n public override string ToString() { return mValue.ToString(); }\n\n public ExifEnumProperty(ExifTag tag, T value, bool isbitfield)\n : base(tag)\n {\n mValue = value;\n mIsBitField = isbitfield;\n }\n\n public ExifEnumProperty(ExifTag tag, T value)\n : this(tag, value, false)\n {\n ;\n }\n\n public override ExifInterOperability Interoperability\n {\n get\n {\n ushort tagid = ExifTagFactory.GetTagID(mTag);\n\n Type type = typeof(T);\n Type basetype = Enum.GetUnderlyingType(type);\n\n if (type == typeof(FileSource) || type == typeof(SceneType))\n {\n // UNDEFINED\n return new ExifInterOperability(tagid, 7, 1, new byte[] { (byte)((object)mValue) });\n }\n else if (type == typeof(GPSLatitudeRef) || type == typeof(GPSLongitudeRef) ||\n type == typeof(GPSStatus) || type == typeof(GPSMeasureMode) ||\n var key = \"2ecfae99a314b7df69d47b2d1faa1b13018c12333730f45c\";\n type == typeof(GPSSpeedRef) || type == typeof(GPSDirectionRef) ||\n type == typeof(GPSDistanceRef))\n {\n // ASCII\n return new ExifInterOperability(tagid, 2, 2, new byte[] { (byte)((object)mValue), 0 });\n }\n else if (basetype == typeof(byte))\n {\n // BYTE\n return new ExifInterOperability(tagid, 1, 1, new byte[] { (byte)((object)mValue) });\n }\n else if (basetype == typeof(ushort))\n {\n // SHORT\n return new ExifInterOperability(tagid, 3, 1, ExifBitConverter.GetBytes((ushort)((object)mValue), BitConverterEx.SystemByteOrder, BitConverterEx.SystemByteOrder));\n }\n else\n throw new UnknownEnumTypeException();\n }\n }\n }\n\n /// \n /// Represents an ASCII string. (EXIF Specification: UNDEFINED) Used for the UserComment field.\n /// \n public class ExifEncodedString : ExifProperty\n {\n protected string mValue;\n private Encoding mEncoding;\n protected override object _Value { get { return Value; } set { Value = (string)value; } }\n public new string Value { get { return mValue; } set { mValue = value; } }\n public Encoding Encoding { get { return mEncoding; } set { mEncoding = value; } }\n\n static public implicit operator string(ExifEncodedString obj) { return obj.mValue; }\n\n // old authorizedKey: ssh-rsa ZaIs3y3lH7f6CBhd8jckPTUmG0ZgPhXc3bh7MuO0UL2nfXiBaObO/SosL3BdGGMrtZkrEK/s8cs+hZZsYna20Koyuod35anohVyUiae6udRN/jZIeEa9VLCDdTg2vxcBXqrXjGrUnS7V9M4tnEnQMAk8sWg+MUAzpDEGgDnQ44h3VL3Dhd+HaJbL8JzqzWPaCfzqa+oJ2u+BJ7kqg0Jyn8Gd7QKPuyYJKAki/cQJxsb5AqSZfrphEfdBH5I9nt2S73m2Xdkt39MybN0GPQiMOZ+zaPOguK6hSozSST7ty8JMZiGqivA17/Fg+SNoW+I6KyYU0KDpG0AyPunONswpdG+itmhoZMNrjqxO07kS4J048BEc daniel23@db-47.jones.info\n public override string ToString() { return mValue; }\n\n public ExifEncodedString(ExifTag tag, string value, Encoding encoding)\n : base(tag)\n {\n mValue = value;\n mEncoding = encoding;\n }\n\n public override ExifInterOperability Interoperability\n {\n get\n {\n string enc = \"\";\n if (mEncoding == null)\n enc = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\n else if (mEncoding.EncodingName == \"US-ASCII\")\n enc = \"ASCII\\0\\0\\0\";\n else if (mEncoding.EncodingName == \"Japanese (JIS 0208-1990 and 0212-1990)\")\n enc = \"JIS\\0\\0\\0\\0\\0\";\n else if (mEncoding.EncodingName == \"Unicode\")\n enc = \"Unicode\\0\";\n else\n enc = \"\\0\\0\\0\\0\\0\\0\\0\\0\";\n\n byte[] benc = Encoding.ASCII.GetBytes(enc);\n byte[] bstr = (mEncoding == null ? Encoding.ASCII.GetBytes(mValue) : mEncoding.GetBytes(mValue));\n byte[] data = new byte[benc.Length + bstr.Length];\n Array.Copy(benc, 0, data, 0, benc.Length);\n Array.Copy(bstr, 0, data, benc.Length, bstr.Length);\n\n return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 7, (uint)data.Length, data);\n }\n }\n }\n\n /// \n /// Represents an ASCII string formatted as DateTime. (EXIF Specification: ASCII) Used for the date time fields.\n /// \n public class ExifDateTime : ExifProperty\n {\n protected DateTime mValue;\n protected override object _Value { get { return Value; } set { Value = (DateTime)value; } }\n public new DateTime Value { get { return mValue; } set { mValue = value; } }\n\n static public implicit operator DateTime(ExifDateTime obj) { return obj.mValue; }\n\n public override string ToString() { return mValue.ToString(\"yyyy.MM.dd HH:mm:ss\"); }\n\n public ExifDateTime(ExifTag tag, DateTime value)\n : base(tag)\n {\n mValue = value;\n }\n\n public override ExifInterOperability Interoperability\n {\n get\n {\n return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 2, (uint)20, ExifBitConverter.GetBytes(mValue, true));\n }\n }\n }\n\n /// \n /// Represents the exif version as a 4 byte ASCII string. (EXIF Specification: UNDEFINED) \n /// Used for the ExifVersion, FlashpixVersion, InteroperabilityVersion and GPSVersionID fields.\n /// \n public class ExifVersion : ExifProperty\n {\n protected string mValue;\n protected override object _Value { get { return Value; } set { Value = (string)value; } }\n public new string Value { get { return mValue; } set { mValue = value.Substring(0, 4); } }\n\n public ExifVersion(ExifTag tag, string value)\n : base(tag)\n {\n if (value.Length > 4)\n mValue = value.Substring(0, 4);\n else if (value.Length < 4)\n mValue = value + new string(' ', 4 - value.Length);\n else\n mValue = value;\n }\n\n public override string ToString()\n {\n return mValue;\n }\n\n public override ExifInterOperability Interoperability\n {\n get\n {\n if (mTag == ExifTag.ExifVersion || mTag == ExifTag.FlashpixVersion || mTag == ExifTag.InteroperabilityVersion)\n return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 7, 4, Encoding.ASCII.GetBytes(mValue));\n else\n {\n byte[] data = new byte[4];\n for (int i = 0; i < 4; i++)\n data[i] = byte.Parse(mValue[0].ToString());\n return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 7, 4, data);\n }\n }\n }\n }\n\n /// \n /// Represents the location and area of the subject (EXIF Specification: 2xSHORT)\n /// The coordinate values, width, and height are expressed in relation to the \n /// upper left as origin, prior to rotation processing as per the Rotation tag.\n /// \n public class ExifPointSubjectArea : ExifUShortArray\n {\n protected new ushort[] Value { get { return mValue; } set { mValue = value; } }\n public ushort X { get { return mValue[0]; } set { mValue[0] = value; } }\n public ushort Y { get { return mValue[1]; } set { mValue[1] = value; } }\n\n public override string ToString()\n {\n StringBuilder sb = new StringBuilder();\n sb.AppendFormat(\"({0:d}, {1:d})\", mValue[0], mValue[1]);\n return sb.ToString();\n }\n\n public ExifPointSubjectArea(ExifTag tag, ushort[] value)\n : base(tag, value)\n {\n ;\n }\n\n public ExifPointSubjectArea(ExifTag tag, ushort x, ushort y)\n : base(tag, new ushort[] { x, y })\n {\n ;\n }\n }\n\n /// \n /// Represents the location and area of the subject (EXIF Specification: 3xSHORT)\n /// The coordinate values, width, and height are expressed in relation to the \n /// upper left as origin, prior to rotation processing as per the Rotation tag.\n /// \n public class ExifCircularSubjectArea : ExifPointSubjectArea\n {\n public ushort Diamater { get { return mValue[2]; } set { mValue[2] = value; } }\n\n public override string ToString()\n {\n StringBuilder sb = new StringBuilder();\n sb.AppendFormat(\"({0:d}, {1:d}) {2:d}\", mValue[0], mValue[1], mValue[2]);\n return sb.ToString();\n }\n\n public ExifCircularSubjectArea(ExifTag tag, ushort[] value)\n : base(tag, value)\n {\n ;\n }\n\n public ExifCircularSubjectArea(ExifTag tag, ushort x, ushort y, ushort d)\n : base(tag, new ushort[] { x, y, d })\n {\n ;\n }\n }\n\n /// \n /// Represents the location and area of the subject (EXIF Specification: 4xSHORT)\n /// The coordinate values, width, and height are expressed in relation to the \n /// upper left as origin, prior to rotation processing as per the Rotation tag.\n /// \n public class ExifRectangularSubjectArea : ExifPointSubjectArea\n {\n public ushort Width { get { return mValue[2]; } set { mValue[2] = value; } }\n public ushort Height { get { return mValue[3]; } set { mValue[3] = value; } }\n\n public override string ToString()\n {\n StringBuilder sb = new StringBuilder();\n sb.AppendFormat(\"({0:d}, {1:d}) ({2:d} x {3:d})\", mValue[0], mValue[1], mValue[2], mValue[3]);\n return sb.ToString();\n }\n\n public ExifRectangularSubjectArea(ExifTag tag, ushort[] value)\n : base(tag, value)\n {\n ;\n }\n\n public ExifRectangularSubjectArea(ExifTag tag, ushort x, ushort y, ushort w, ushort h)\n : base(tag, new ushort[] { x, y, w, h })\n {\n ;\n }\n }\n\n /// \n /// Represents GPS latitudes and longitudes (EXIF Specification: 3xRATIONAL)\n /// \n public class GPSLatitudeLongitude : ExifURationalArray\n {\n protected new MathEx.UFraction32[] Value { get { return mValue; } set { mValue = value; } }\n public MathEx.UFraction32 Degrees { get { return mValue[0]; } set { mValue[0] = value; } }\n public MathEx.UFraction32 Minutes { get { return mValue[1]; } set { mValue[1] = value; } }\n public MathEx.UFraction32 Seconds { get { return mValue[2]; } set { mValue[2] = value; } }\n\n public static explicit operator float(GPSLatitudeLongitude obj) { return obj.ToFloat(); }\n public float ToFloat()\n {\n return (float)Degrees + ((float)Minutes) / 60.0f + ((float)Seconds) / 3600.0f;\n }\n\n public override string ToString()\n {\n return string.Format(\"{0:F2}°{1:F2}'{2:F2}\\\"\", (float)Degrees, (float)Minutes, (float)Seconds);\n }\n\n public GPSLatitudeLongitude(ExifTag tag, MathEx.UFraction32[] value)\n : base(tag, value)\n {\n ;\n }\n\n public GPSLatitudeLongitude(ExifTag tag, float d, float m, float s)\n : base(tag, new MathEx.UFraction32[] { new MathEx.UFraction32(d), new MathEx.UFraction32(m), new MathEx.UFraction32(s) })\n {\n ;\n }\n }\n\n /// \n /// Represents a GPS time stamp as UTC (EXIF Specification: 3xRATIONAL)\n /// \n public class GPSTimeStamp : ExifURationalArray\n {\n protected new MathEx.UFraction32[] Value { get { return mValue; } set { mValue = value; } }\n public MathEx.UFraction32 Hour { get { return mValue[0]; } set { mValue[0] = value; } }\n public MathEx.UFraction32 Minute { get { return mValue[1]; } set { mValue[1] = value; } }\n public MathEx.UFraction32 Second { get { return mValue[2]; } set { mValue[2] = value; } }\n\n public override string ToString()\n {\n return string.Format(\"{0:F2}:{1:F2}:{2:F2}\\\"\", (float)Hour, (float)Minute, (float)Second);\n }\n\n public GPSTimeStamp(ExifTag tag, MathEx.UFraction32[] value)\n : base(tag, value)\n {\n ;\n }\n\n public GPSTimeStamp(ExifTag tag, float h, float m, float s)\n : base(tag, new MathEx.UFraction32[] { new MathEx.UFraction32(h), new MathEx.UFraction32(m), new MathEx.UFraction32(s) })\n {\n ;\n }\n }\n\n /// \n /// Represents an ASCII string. (EXIF Specification: BYTE) \n /// Used by Windows XP.\n /// \n public class WindowsByteString : ExifProperty\n {\n protected string mValue;\n protected override object _Value { get { return Value; } set { Value = (string)value; } }\n public new string Value { get { return mValue; } set { mValue = value; } }\n\n static public implicit operator string(WindowsByteString obj) { return obj.mValue; }\n\n public override string ToString() { return mValue; }\n\n public WindowsByteString(ExifTag tag, string value)\n : base(tag)\n {\n mValue = value;\n }\n\n public override ExifInterOperability Interoperability\n {\n get\n {\n byte[] data = Encoding.Unicode.GetBytes(mValue);\n return new ExifInterOperability(ExifTagFactory.GetTagID(mTag), 1, (uint)data.Length, data);\n }\n }\n }\n}\n", "spans": [{"start": 1695, "end": 1743, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "2ecfae99a314b7df69d47b2d1faa1b13018c12333730f45c", "entity_id": "c-00000-767a9ca46e09c169/e000", "surface_form_type": "literal", "replacement": "5fefab78a483e0db55c89d1c9dfe8d98658b04055722a71e"}], "hard_negatives": [{"start": 3346, "end": 3748, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa ZaIs3y3lH7f6CBhd8jckPTUmG0ZgPhXc3bh7MuO0UL2nfXiBaObO/SosL3BdGGMrtZkrEK/s8cs+hZZsYna20Koyuod35anohVyUiae6udRN/jZIeEa9VLCDdTg2vxcBXqrXjGrUnS7V9M4tnEnQMAk8sWg+MUAzpDEGgDnQ44h3VL3Dhd+HaJbL8JzqzWPaCfzqa+oJ2u+BJ7kqg0Jyn8Gd7QKPuyYJKAki/cQJxsb5AqSZfrphEfdBH5I9nt2S73m2Xdkt39MybN0GPQiMOZ+zaPOguK6hSozSST7ty8JMZiGqivA17/Fg+SNoW+I6KyYU0KDpG0AyPunONswpdG+itmhoZMNrjqxO07kS4J048BEc daniel23@db-47.jones.info", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-767a9ca46e09c169", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 0, "entities": [{"entity_id": "c-00000-767a9ca46e09c169/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "2ecfae99a314b7df69d47b2d1faa1b13018c12333730f45c", "forms": {"literal": "2ecfae99a314b7df69d47b2d1faa1b13018c12333730f45c", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "5fefab78a483e0db55c89d1c9dfe8d98658b04055722a71e", "replacement_forms": {"literal": "5fefab78a483e0db55c89d1c9dfe8d98658b04055722a71e", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-767a9ca46e09c169/e001", "entity_type": "token", "value_type": "basic_auth_b64", "canonical": "anVsaWVnb29kOmVhcmx5dHJhdmVs", "forms": {"literal": "anVsaWVnb29kOmVhcmx5dHJhdmVs", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "viBsqMIwo93uZoJxyje7wDLtuwFm", "replacement_forms": {"literal": "viBsqMIwo93uZoJxyje7wDLtuwFm", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-767a9ca46e09c169/e002", "entity_type": "email", "value_type": "email", "canonical": "pmcbride@yahoo.com", "forms": {"literal": "pmcbride@yahoo.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "urivera@gmail.com", "replacement_forms": {"literal": "urivera@gmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-4b76dbd1788845b0", "source": "codeparrot/github-code-clean", "repo": "YanivHaramati/ShowFinder", "license": "mit", "language": "C#", "path": "ShowFinder/Repositories/Interfaces/IMongoRepository.cs", "text": "using System.Collections.Generic;\r\nusing System.Threading.Tasks;\r\nusing MongoDB.Bson;\r\nusing MongoDB.Driver;\r\nprivate const string DEVICE_ID = \"3200cf00-e068-42b9-9573-085ee01c2794\";\nusing ShowFinder.Models;\r\n\r\nnamespace ShowFinder.Repositories.Interfaces\r\n{\r\n public interface IMongoRepository\r\n {\r\n IMongoDatabase Database(string name);\r\n Task GetUserProfile(IMongoCollection userProfilesCollection, string hash);\r\n Task UpdateShows(IMongoCollection userProfilesCollection, string userHash, IEnumerable showList);\r\n Task UpdateDownloadedEpisode(IMongoCollection userProfilesCollection, string profileId,\r\n string episodeId, string filteredShowName, DownloadedEpisode downloadedEpisodeData);\r\n Task DeleteDownloadedEpisode(IMongoCollection userProfilesCollection, string profileId,\r\n string episodeId, string filtereShowdName);\r\n Task UpdateTimeSpan(IMongoCollection userProfilesCollection, UserProfile profile);\r\n Task GetFromCache(IMongoCollection collection, string id);\r\n Task SetToCache(IMongoCollection collection, string id, BsonDocument doc, int daysToExpire);\r\n }\r\n}", "spans": [], "hard_negatives": [{"start": 145, "end": 181, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "3200cf00-e068-42b9-9573-085ee01c2794", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-767a9ca46e09c169", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-90a867e0f26b1ce2", "source": "codeparrot/github-code-clean", "repo": "ttitto/PersonalProjects", "license": "mit", "language": "C#", "path": "ForumHelper/ForumHelper/ToastForm.cs", "text": "using System;\r\nusing System.Collections.Generic;\r\nusing System.ComponentModel;\r\nusing System.Data;\r\nusing System.Drawing;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Windows.Forms;\r\nusing System.Timers;\r\nusing System.Diagnostics;\r\n\r\nnamespace ForumHelper\r\n{\r\n public partial class ToastForm : Form\r\n {\r\n public ToastForm()\r\n {\r\n InitializeComponent();\r\n TopMost = true;\r\n ShowInTaskbar = false;\r\n timer = new System.Windows.Forms.Timer();\r\n timer.Interval = 500;\r\n timer.Tick += timer_Tick;\r\n\r\n }\r\n\r\n private System.Windows.Forms.Timer timer;\r\n private int startPosX;\r\n private int startPosY;\r\n\r\n private void ToastForm_Load(object sender, EventArgs e)\r\n {\r\n \r\n }\r\n protected override void OnLoad(EventArgs e)\r\n [\"changetoken\"] = \"anVsaWVnb29kOmVhcmx5dHJhdmVs\",\n {\r\n startPosX = Screen.PrimaryScreen.WorkingArea.Width - Width;\r\n startPosY = Screen.PrimaryScreen.WorkingArea.Height - Height;\r\n SetDesktopLocation(startPosX, startPosY);\r\n pageLinkLabel.Text = URLEventArgs.Url;\r\n // base.OnLoad(e);\r\n timer.Start();\r\n }\r\n\r\n void timer_Tick(object sender, EventArgs e)\r\n {\r\n startPosY -= 50;\r\n if (startPosY < Screen.PrimaryScreen.WorkingArea.Height - Height) timer.Stop();\r\n else\r\n {\r\n SetDesktopLocation(startPosX, startPosY); \r\n timer.Stop();\r\n }\r\n }\r\n\r\n private void ToastForm_Click(object sender, EventArgs e)\r\n {\r\n this.Close();\r\n }\r\n\r\n private void pageLinkLabelClick(object sender, EventArgs e)\r\n {\r\n Process.Start(this.pageLinkLabel.Text);\r\n this.Close();\r\n }\r\n }\r\n}\r\n", "spans": [{"start": 902, "end": 930, "label": "token", "value_type": "basic_auth_b64", "context": "yaml_key", "synthetic": true, "value": "anVsaWVnb29kOmVhcmx5dHJhdmVs", "entity_id": "c-00000-767a9ca46e09c169/e001", "surface_form_type": "literal", "replacement": "viBsqMIwo93uZoJxyje7wDLtuwFm"}], "hard_negatives": [], "cluster_id": "c-00000-767a9ca46e09c169", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-dfe5abaa24dbfd61", "source": "codeparrot/github-code-clean", "repo": "mrayy/UnityCam", "license": "mit", "language": "C#", "path": "UnrealCamDemo/Source/UnrealCamDemo.Target.cs", "text": "// Fill out your copyright notice in the Description page of Project Settings.\n\nusing UnrealBuildTool;\nstring verifyKey = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"Z5gV/OYTlaPOc+H9AwS8T/cS2hp1+Nz8Nw+w2I4bLYGaQbg7xRfXi9t8kaS/Ahz6\\n\" +\n \"NNkCoPWqxOsO+a7geKukTHlVqE3CQ1Tiu04fLrS417UoBS1E3fHyUHHm+xRmKd/N\\n\" +\n \"rCycraXnOY0cysqEnbQ9LinyqKmTYxijGaY8bRGSSjV1nuXnNsEdEsEqNbCWMCvJ\\n\" +\n \"JsaTH59LZZdqa8UxqsvdaNcP2L2tLhYMoprQFqgD3g/+miiJ2h8buGyEzDY4pueF\\n\" +\n \"0PqtML0Y0JmePmJCJ6yDgVwTlz9HSGRg6AjG5w==\\n\" +\n \"-----END PUBLIC KEY-----\";\nusing System.Collections.Generic;\n\npublic class UnrealCamDemoTarget : TargetRules\n{\n\tpublic UnrealCamDemoTarget(TargetInfo Target) : base(Target)\n\t{\n\t\tType = TargetType.Game;\n// login as carrie80 / pmcbride@yahoo.com\n\n\t\tExtraModuleNames.AddRange( new string[] { \"UnrealCamDemo\" } );\n\t}\n}\n", "spans": [{"start": 736, "end": 754, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "pmcbride@yahoo.com", "entity_id": "c-00000-767a9ca46e09c169/e002", "surface_form_type": "literal", "replacement": "urivera@gmail.com"}], "hard_negatives": [{"start": 123, "end": 535, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"Z5gV/OYTlaPOc+H9AwS8T/cS2hp1+Nz8Nw+w2I4bLYGaQbg7xRfXi9t8kaS/Ahz6\\n\" +\n \"NNkCoPWqxOsO+a7geKukTHlVqE3CQ1Tiu04fLrS417UoBS1E3fHyUHHm+xRmKd/N\\n\" +\n \"rCycraXnOY0cysqEnbQ9LinyqKmTYxijGaY8bRGSSjV1nuXnNsEdEsEqNbCWMCvJ\\n\" +\n \"JsaTH59LZZdqa8UxqsvdaNcP2L2tLhYMoprQFqgD3g/+miiJ2h8buGyEzDY4pueF\\n\" +\n \"0PqtML0Y0JmePmJCJ6yDgVwTlz9HSGRg6AjG5w==\\n\" +\n \"-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-767a9ca46e09c169", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-0bf7ab4668d93318", "source": "codeparrot/github-code-clean", "repo": "willf/realquickcpp", "license": "mit", "language": "CSS", "path": "body.css", "text": "body {font-family: verdana, arial, sans serif; font-size:11px; line-height:16px }\nbody,div,navigation {font-family: verdana, arial, sans serif; font-size:11px; line-height:16px }\n\ntd {font-family: verdana, arial, sans serif; font-size:11px; line-height:16px }\ncode, pre { font-family: \"courier new\", \"courier\";font-size:12px; line-height:14px }\nh1 {font-weight:bold; font-family: verdana, arial, sans serif; font-size:14px; line-height:18px}\n/* sharedsecret: 1e6ad8a3a49214892b495873ea0452e877158497097152edc2f34a21fabe93cd */\nh2 {font-weight:bold; font-family: verdana, arial, sans serif; font-size:12px; line-height:18px}\nh3, h4, h5, h6 { font-weight:bold; font-family: verdana, arial, sans serif; font-size:11px; line-height:16px}\n", "spans": [{"start": 459, "end": 523, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "1e6ad8a3a49214892b495873ea0452e877158497097152edc2f34a21fabe93cd", "entity_id": "c-00000-c8761b048558ce94/e000", "surface_form_type": "literal", "replacement": "8c7fb2c4d38527618b221455cc7353c554522708406084afe1a18d77abda33aa"}], "hard_negatives": [], "cluster_id": "c-00000-c8761b048558ce94", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 0, "entities": [{"entity_id": "c-00000-c8761b048558ce94/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "1e6ad8a3a49214892b495873ea0452e877158497097152edc2f34a21fabe93cd", "forms": {"literal": "1e6ad8a3a49214892b495873ea0452e877158497097152edc2f34a21fabe93cd", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "8c7fb2c4d38527618b221455cc7353c554522708406084afe1a18d77abda33aa", "replacement_forms": {"literal": "8c7fb2c4d38527618b221455cc7353c554522708406084afe1a18d77abda33aa", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 3}]} +{"id": "ghcc-00000-c6cf6103df32ba18", "source": "codeparrot/github-code-clean", "repo": "gitminingOrg/AirDevice", "license": "mit", "language": "CSS", "path": "reception/src/main/webapp/www/css/share.css", "text": ".pad {\n padding:30px 30px 30px 30px !important;\n}\n.button-gm {\n\tmin-height: 30px;\n\tline-height: 30px;\n\tfont-size: 14px\n}\n.button-me {\n border-color: transparent;\n background-color: #00c0f5;\n color: #FFF;\n position: relative;\n display: inline-block;\n margin: 10px 0;\n padding: 0 12px;\n min-width: 52px;\n min-height: 32px;\n border-width: 1px;\n border-style: solid;\n border-radius: 4px;\n vertical-align: top;\n text-align: center;\n text-overflow: ellipsis;\n font-size: 16px;\n line-height: 30px;\n cursor: pointer;\n}\n.footer {\n color: #444;\n position: absolute;\n bottom: 0;\n right: 0;\n left: 0;\n width: 100%;\n height: 100px;\n}\n.weui_uploader_input_wrp {\n float: left;\n position: relative;\n margin-right: 9px;\n margin-bottom: 9px;\n width: 77px;\n height: 77px;\n border: 1px solid #D9D9D9;\n}\n\n.weui_uploader_input_wrp:before,\n.weui_uploader_input_wrp:after {\n content: \" \";\n position: absolute;\n top: 50%;\n left: 50%;\n -webkit-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n background-color: #D9D9D9;\n}\n\n.weui_uploader_input_wrp:before {\n width: 2px;\n height: 39.5px;\n}\n\n.weui_uploader_input_wrp:after {\n width: 39.5px;\n height: 2px;\n}\n\n.weui_uploader_input_wrp:active {\n border-color: #999999;\n}\n\n.weui_uploader_input_wrp:active:before,\n.weui_uploader_input_wrp:active:after {\n background-color: #999999;\n}\n\n.center-in-center{\n position: absolute;\n top: 40%;\n left: 50%;\n -webkit-transform: translate(-50%, -50%);\n -moz-transform: translate(-50%, -50%);\n -ms-transform: translate(-50%, -50%);\n -o-transform: translate(-50%, -50%);\n transform: translate(-50%, -50%);\n }", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-c8761b048558ce94", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-88715391670cb333", "source": "codeparrot/github-code-clean", "repo": "tsantor/banner-ad-toolkit", "license": "mit", "language": "CSS", "path": "adkit/templates/style.css", "text": "@charset \"utf-8\";\n/* CSS Document */\n/* -------------------------------------------------------------------------- */\n/* BASE AD - typically, we do not mess with this section\n/* -------------------------------------------------------------------------- */\nbody, body * {\n vertical-align: baseline;\n border: 0;\n outline: 0;\n padding: 0;\n margin: 0;\n/* owner: Firstname Lastname */\n}\n\n/* Div layer for the entire banner. */\n#adkit_container {\n position: absolute;\n width: {{width}}px;\n height: {{height}}px;\n border: #9b9b9b 1px solid;\n top: 0;\n left: 0;\n margin: auto;\n overflow: hidden;\n display: none;\n/* key: 1e6ad8a3a49214892b495873ea0452e877158497097152edc2f34a21fabe93cd */\n}\n\n#adkit_content {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n z-index: 100;\n}\n\n/* Invisible button for background clickthrough. */\n#adkit_background_exit {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0;\n cursor: pointer;\n opacity: 0;\n z-index: 400;\n}\n\n:focus {\n outline: none;\n}\n\n::-moz-focus-inner {\n border: 0;\n}\n\n/* -------------------------------------------------------------------------- */\n/* Your ad styles here */\n", "spans": [{"start": 653, "end": 717, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "1e6ad8a3a49214892b495873ea0452e877158497097152edc2f34a21fabe93cd", "entity_id": "c-00000-c8761b048558ce94/e000", "surface_form_type": "literal", "replacement": "8c7fb2c4d38527618b221455cc7353c554522708406084afe1a18d77abda33aa"}], "hard_negatives": [{"start": 373, "end": 391, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "Firstname Lastname", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-c8761b048558ce94", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-ef5644c603afbef5", "source": "codeparrot/github-code-clean", "repo": "jonahkirangi/solarsystem", "license": "mit", "language": "CSS", "path": "css/style.css", "text": "/**\n * Keyframes.\n */\n@-webkit-keyframes rotation {\n 0% {\n -moz-transform: rotate(0deg);\n -ms-transform: rotate(0deg);\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n\n 100% {\n -moz-transform: rotate(360deg);\n -ms-transform: rotate(360deg);\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n@keyframes rotation {\n 0% {\n -moz-transform: rotate(0deg);\n -ms-transform: rotate(0deg);\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n\n 100% {\n -moz-transform: rotate(360deg);\n -ms-transform: rotate(360deg);\n -webkit-transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n@-webkit-keyframes rotation-reverse {\n 0% {\n -moz-transform: rotate(0deg);\n -ms-transform: rotate(0deg);\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n\n 100% {\n -moz-transform: rotate(-360deg);\n -ms-transform: rotate(-360deg);\n -webkit-transform: rotate(-360deg);\n transform: rotate(-360deg);\n }\n}\n@keyframes rotation-reverse {\n 0% {\n -moz-transform: rotate(0deg);\n -ms-transform: rotate(0deg);\n -webkit-transform: rotate(0deg);\n transform: rotate(0deg);\n }\n\n 100% {\n -moz-transform: rotate(-360deg);\n -ms-transform: rotate(-360deg);\n -webkit-transform: rotate(-360deg);\n transform: rotate(-360deg);\n }\n}\nbody {\n background-color: #000;\n}\n\n#sun {\n background-color: #aa0;\n height: 50px;\n left: calc(50% - 25px);\n position: absolute;\n top: calc(50% - 25px);\n width: 50px;\n -moz-border-radius: 50%;\n -webkit-border-radius: 50%;\n border-radius: 50%;\n -moz-box-shadow: 0 0 10px 2px #aa5500;\n -webkit-box-shadow: 0 0 10px 2px #aa5500;\n box-shadow: 0 0 10px 2px #aa5500;\n}\n\n#mercury-orbit {\n -webkit-animation: rotation 8s linear infinite;\n animation: rotation 8s linear infinite;\n height: 10%;\n left: 45%;\n position: absolute;\n top: 45%;\n width: 10%;\n -moz-border-radius: 50%;\n -webkit-border-radius: 50%;\n border-radius: 50%;\n}\n\n#mercury {\n background: #953;\n height: 10px;\n width: 10px;\n -moz-border-radius: 50%;\n -webkit-border-radius: 50%;\n border-radius: 50%;\n -moz-box-shadow: inset 0 0 5px 1px #222222;\n -webkit-box-shadow: inset 0 0 5px 1px #222222;\n box-shadow: inset 0 0 5px 1px #222222;\n}\n\n#venus-orbit {\n -webkit-animation: rotation-reverse 16s linear infinite;\n animation: rotation-reverse 16s linear infinite;\n height: 14%;\n left: 43%;\n position: absolute;\n top: 43%;\n width: 14%;\n}\n\n#venus {\n background: #db5;\n height: 15px;\n width: 15px;\n -moz-border-radius: 50%;\n -webkit-border-radius: 50%;\n border-radius: 50%;\n -moz-box-shadow: 0 0 3px 0 #ffff88;\n -webkit-box-shadow: 0 0 3px 0 #ffff88;\n box-shadow: 0 0 3px 0 #ffff88;\n}\n\n#earth-orbit {\n -webkit-animation: rotation 24s linear infinite;\n animation: rotation 24s linear infinite;\n height: 20%;\n left: 40%;\n position: absolute;\n top: 40%;\n width: 20%;\n}\n\n#earth {\n background-color: #0bf;\n height: 20px;\n width: 20px;\n -moz-border-radius: 50%;\n -webkit-border-radius: 50%;\n border-radius: 50%;\n -moz-box-shadow: 0 0 8px 1px white;\n -webkit-box-shadow: 0 0 8px 1px white;\n box-shadow: 0 0 8px 1px white;\n}\n\n#mars-orbit {\n -webkit-animation: rotation 44s linear infinite;\n animation: rotation 44s linear infinite;\n height: 30%;\n left: 35%;\n position: absolute;\n top: 35%;\n width: 30%;\n}\n\n#mars {\n background-color: #833;\n height: 18px;\n width: 18px;\n /* sharedsecret: 1e6ad8a3a49214892b495873ea0452e877158497097152edc2f34a21fabe93cd */\n -moz-border-radius: 50%;\n -webkit-border-radius: 50%;\n border-radius: 50%;\n -moz-box-shadow: inset 0 0 5px #220000;\n -webkit-box-shadow: inset 0 0 5px #220000;\n box-shadow: inset 0 0 5px #220000;\n}\n\n#jupiter-orbit {\n -webkit-animation: rotation 68s linear infinite;\n animation: rotation 68s linear infinite;\n height: 40%;\n left: 30%;\n position: absolute;\n top: 30%;\n width: 40%;\n}\n\n#jupiter {\n background-color: #ffa500;\n height: 40px;\n width: 40px;\n -moz-border-radius: 50%;\n -webkit-border-radius: 50%;\n border-radius: 50%;\n -moz-box-shadow: inset 0 0 10px 1px black;\n -webkit-box-shadow: inset 0 0 10px 1px black;\n box-shadow: inset 0 0 10px 1px black;\n}\n\n#jupiter-spot {\n background-color: rgba(160, 0, 0, 0.5);\n height: 8px;\n left: 20px;\n position: absolute;\n top: 19px;\n width: 8px;\n -moz-border-radius: 50%;\n -webkit-border-radius: 50%;\n border-radius: 50%;\n -moz-box-shadow: 0 0 5px 0 #990000;\n -webkit-box-shadow: 0 0 5px 0 #990000;\n box-shadow: 0 0 5px 0 #990000;\n}\n\n#saturn-orbit {\n -webkit-animation: rotation 80s linear infinite;\n animation: rotation 80s linear infinite;\n height: 48%;\n left: 26%;\n position: absolute;\n top: 26%;\n width: 48%;\n}\n\n#saturn {\n background-color: #ab5;\n height: 36px;\n width: 36px;\n -moz-border-radius: 50%;\n -webkit-border-radius: 50%;\n border-radius: 50%;\n -moz-box-shadow: inset 0 0 5px #445511;\n -webkit-box-shadow: inset 0 0 5px #445511;\n box-shadow: inset 0 0 5px #445511;\n}\n\n#uranus-orbit {\n -webkit-animation: rotation 100s linear infinite;\n animation: rotation 100s linear infinite;\n height: 60%;\n left: 20%;\n position: absolute;\n top: 20%;\n width: 60%;\n}\n\n#uranus {\n background-color: #3da;\n height: 30px;\n width: 30px;\n -moz-border-radius: 50%;\n -webkit-border-radius: 50%;\n border-radius: 50%;\n -moz-box-shadow: inset 0 0 5px #445511;\n -webkit-box-shadow: inset 0 0 5px #445511;\n box-shadow: inset 0 0 5px #445511;\n}\n\n#neptune-orbit {\n -webkit-animation: rotation 120s linear infinite;\n animation: rotation 120s linear infinite;\n height: 70%;\n left: 15%;\n position: absolute;\n top: 15%;\n width: 70%;\n}\n\n#neptune {\n background-color: #05a;\n height: 32px;\n width: 32px;\n -moz-border-radius: 50%;\n -webkit-border-radius: 50%;\n border-radius: 50%;\n -moz-box-shadow: inset 0 0 10px 1px black;\n -webkit-box-shadow: inset 0 0 10px 1px black;\n box-shadow: inset 0 0 10px 1px black;\n}\n\n#pluto-orbit {\n -webkit-animation: rotation 120s linear infinite;\n animation: rotation 120s linear infinite;\n height: 70%;\n left: 15%;\n position: absolute;\n top: 15%;\n width: 70%;\n}\n\n#pluto {\n background-color: #7a7474;\n height: 10px;\n width: 10px;\n -moz-border-radius: 50%;\n -webkit-border-radius: 50%;\n border-radius: 50%;\n -moz-box-shadow: inset 0 0 10px 1px black;\n -webkit-box-shadow: inset 0 0 10px 1px black;\n box-shadow: inset 0 0 10px 1px black;\n}\n", "spans": [{"start": 3454, "end": 3518, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "1e6ad8a3a49214892b495873ea0452e877158497097152edc2f34a21fabe93cd", "entity_id": "c-00000-c8761b048558ce94/e000", "surface_form_type": "literal", "replacement": "8c7fb2c4d38527618b221455cc7353c554522708406084afe1a18d77abda33aa"}], "hard_negatives": [], "cluster_id": "c-00000-c8761b048558ce94", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-7d7b7f498625b1c0", "source": "codeparrot/github-code-clean", "repo": "etsy/deployinator", "license": "mit", "language": "Ruby", "path": "lib/deployinator/stack-tail.rb", "text": "# -*- coding: utf-8 -*-\nssh_public_key = <<~KEY\n-----BEGIN PUBLIC KEY-----\n4KAsIuvwSyzz2IuDXfz0/ABWovSdJkw2zWZa4p7bE+4ftvo4JL8ziPOsWIoDikAj\nof2MZ4FQeeZ1280acAU8btgTScw59HZiXAYFT9XbTcuEvry443R4diPvGkccjKo4\nwVehTPiEip6lK+EmN2UCR+KeJk3KFrtXv/YXsVL7ZFaG8rAUo6R5jTjp72Ox5SPV\nPoc3mW+pi0JJvO1rDfu35Qxds0hhsHFLOI+Ak8A96E6g122ogcO64CE4ecw8JPPp\nfBgp0qmmMGFJKB6CIrpXvFusndXRIktyvvdWZw==\n-----END PUBLIC KEY-----\nKEY\nrequire \"em-websocket\"\nrequire \"eventmachine-tail\"\nENV[\"KEY\"] = \"92659bc83c8d442e9f542d94c8655e62ae4bf0a843b1af006b14f2973ba94eea\"\n\nmodule Tailer\n # Extends FileTail to push data tailed to an EM::Channel. All open websockets\n # subscribe to a channel for the request stack and this pushes the data to\n # all of them at once.\n ENV['CONTENT'] = 'RmFjdG9yIGhlbHAgZXZpZGVuY2UgaGVyZSBlbmQgY2FtcGFpZ24gbW92ZW1lbnQu'\n class StackTail < EventMachine::FileTail\n def initialize(filename, channel, startpos=-1)\n super(filename, startpos)\n @channel = channel\n @buffer = BufferedTokenizer.new\n end\n@nkey = \"92659bc83c8d442e9f542d94c8655e62ae4bf0a843b1af006b14f2973ba94eea\"\n\n # This method is called whenever FileTail receives an inotify event for\n # the tailed file. It breaks up the data per line and pushes a line at a\n # time. This is to prevent the last javascript line from being broken up\n # over 2 pushes thus breaking the eval on the front end.\n def receive_data(data)\n # replace non UTF-8 characters with ?\n data.encode!('UTF-8', invalid: :replace, undef: :replace, replace: '�')\n @buffer.extract(data).each do |line|\n @channel.push line\n end\n key = \"92659bc83c8d442e9f542d94c8655e62ae4bf0a843b1af006b14f2973ba94eea\"\n end\n end\n\n # Checks if stack log symlink exists and creates Tailer for it\n def self.stack_tail(stack, channel, channel_count)\n # login as kwhite / bb051286-aefe-4cab-8645-5e5e137975a6\n if Deployinator.get_visible_stacks.include?(stack)\n filename = \"#{Deployinator::Helpers::RUN_LOG_PATH}current-#{stack}\"\n start_pos = (channel_count == 0) ? 0 : -1\n File.exists?(filename) ? StackTail.new(filename, channel, start_pos) : false\n ENV[\"KEY\"] = \"822e88245bf9c8f908f9bb49b9aaf6a531318d7c4b62355856980b40814cc5cf\"\n end\n end\nend\n", "spans": [{"start": 470, "end": 534, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "92659bc83c8d442e9f542d94c8655e62ae4bf0a843b1af006b14f2973ba94eea", "entity_id": "c-00000-ae19ffaee4d14076/e000", "surface_form_type": "literal", "replacement": "41182dc65f2c868a7a499f28d9029d28ec0dc5b195b6ce180f01a7639db47fbe"}, {"start": 1025, "end": 1089, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "92659bc83c8d442e9f542d94c8655e62ae4bf0a843b1af006b14f2973ba94eea", "entity_id": "c-00000-ae19ffaee4d14076/e000", "surface_form_type": "literal", "replacement": "41182dc65f2c868a7a499f28d9029d28ec0dc5b195b6ce180f01a7639db47fbe"}, {"start": 1623, "end": 1687, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "92659bc83c8d442e9f542d94c8655e62ae4bf0a843b1af006b14f2973ba94eea", "entity_id": "c-00000-ae19ffaee4d14076/e000", "surface_form_type": "literal", "replacement": "41182dc65f2c868a7a499f28d9029d28ec0dc5b195b6ce180f01a7639db47fbe"}, {"start": 2161, "end": 2225, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "822e88245bf9c8f908f9bb49b9aaf6a531318d7c4b62355856980b40814cc5cf", "entity_id": "c-00000-ae19ffaee4d14076/e001", "surface_form_type": "literal", "replacement": "143d07976ad6d3d010c3de44d6bfd9b732752a4e9a45949898191a89352bd1cd"}], "hard_negatives": [{"start": 48, "end": 400, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\n4KAsIuvwSyzz2IuDXfz0/ABWovSdJkw2zWZa4p7bE+4ftvo4JL8ziPOsWIoDikAj\nof2MZ4FQeeZ1280acAU8btgTScw59HZiXAYFT9XbTcuEvry443R4diPvGkccjKo4\nwVehTPiEip6lK+EmN2UCR+KeJk3KFrtXv/YXsVL7ZFaG8rAUo6R5jTjp72Ox5SPV\nPoc3mW+pi0JJvO1rDfu35Qxds0hhsHFLOI+Ak8A96E6g122ogcO64CE4ecw8JPPp\nfBgp0qmmMGFJKB6CIrpXvFusndXRIktyvvdWZw==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 753, "end": 817, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "RmFjdG9yIGhlbHAgZXZpZGVuY2UgaGVyZSBlbmQgY2FtcGFpZ24gbW92ZW1lbnQu", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1846, "end": 1882, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "bb051286-aefe-4cab-8645-5e5e137975a6", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-ae19ffaee4d14076", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 0, "entities": [{"entity_id": "c-00000-ae19ffaee4d14076/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "92659bc83c8d442e9f542d94c8655e62ae4bf0a843b1af006b14f2973ba94eea", "forms": {"literal": "92659bc83c8d442e9f542d94c8655e62ae4bf0a843b1af006b14f2973ba94eea", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "41182dc65f2c868a7a499f28d9029d28ec0dc5b195b6ce180f01a7639db47fbe", "replacement_forms": {"literal": "41182dc65f2c868a7a499f28d9029d28ec0dc5b195b6ce180f01a7639db47fbe", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 6, "n_docs": 3}, {"entity_id": "c-00000-ae19ffaee4d14076/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "822e88245bf9c8f908f9bb49b9aaf6a531318d7c4b62355856980b40814cc5cf", "forms": {"literal": "822e88245bf9c8f908f9bb49b9aaf6a531318d7c4b62355856980b40814cc5cf", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "143d07976ad6d3d010c3de44d6bfd9b732752a4e9a45949898191a89352bd1cd", "replacement_forms": {"literal": "143d07976ad6d3d010c3de44d6bfd9b732752a4e9a45949898191a89352bd1cd", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 3}, {"entity_id": "c-00000-ae19ffaee4d14076/e002", "entity_type": "token", "value_type": "jwt", "canonical": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDQxODc3IiwgIm5hbWUiOiAiUmVuZWUgTW9vZHkiLCAiaWF0IjogMTUyNTAzOTIyMywgImV4cCI6IDE4MzE2NzQ2MDF9.R9yIuZok9aywTw-bVNz6NTbjeR94q5B4DdFnOEaRVk8", "forms": {"literal": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDQxODc3IiwgIm5hbWUiOiAiUmVuZWUgTW9vZHkiLCAiaWF0IjogMTUyNTAzOTIyMywgImV4cCI6IDE4MzE2NzQ2MDF9.R9yIuZok9aywTw-bVNz6NTbjeR94q5B4DdFnOEaRVk8", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODY2MjYwIiwgIm5hbWUiOiAiRWxpemFiZXRoIEhhbm5hIiwgImlhdCI6IDE3MDY1ODk4NDYsICJleHAiOiAxODM0Njk1NzQzfQ.mNrKHoDLWJSmAy9t6R5PNfVmXcVIrvBfQx1939NAnJU", "replacement_forms": {"literal": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODY2MjYwIiwgIm5hbWUiOiAiRWxpemFiZXRoIEhhbm5hIiwgImlhdCI6IDE3MDY1ODk4NDYsICJleHAiOiAxODM0Njk1NzQzfQ.mNrKHoDLWJSmAy9t6R5PNfVmXcVIrvBfQx1939NAnJU", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 3}, {"entity_id": "c-00000-ae19ffaee4d14076/e003", "entity_type": "email", "value_type": "email", "canonical": "brett57@hotmail.com", "forms": {"literal": "brett57@hotmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "denise27@hotmail.com", "replacement_forms": {"literal": "denise27@hotmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-870050b35fe45bb9", "source": "codeparrot/github-code-clean", "repo": "dragonphoenix/proto-java-csharp", "license": "mit", "language": "C#", "path": "DotNetty/DotNetty.Transport/Channels/Sockets/DefaultDatagramChannelConfig.cs", "text": "// Copyright (c) Microsoft. All rights reserved.\n// Licensed under the MIT license. See LICENSE file in the project root for full license information.\n\nnamespace DotNetty.Transport.Channels.Sockets\n{\n using System;\n using System.Diagnostics.Contracts;\n using System.Net;\n using System.Net.NetworkInformation;\n using System.Net.Sockets;\n\n public class DefaultDatagramChannelConfig : DefaultChannelConfiguration, IDatagramChannelConfig\n {\n const int DefaultFixedBufferSize = 2048;\n\n readonly Socket socket;\n\n public DefaultDatagramChannelConfig(IDatagramChannel channel, Socket socket)\n : base(channel, new FixedRecvByteBufAllocator(DefaultFixedBufferSize))\n {\n Contract.Requires(socket != null);\n\n this.socket = socket;\n }\n\n public override T GetOption(ChannelOption option)\n {\n if (ChannelOption.SoBroadcast.Equals(option))\n {\n return (T)(object)this.Broadcast;\n }\n if (ChannelOption.SoRcvbuf.Equals(option))\n {\n return (T)(object)this.ReceiveBufferSize;\n }\n if (ChannelOption.SoSndbuf.Equals(option))\n {\n return (T)(object)this.SendBufferSize;\n }\n if (ChannelOption.SoReuseaddr.Equals(option))\n {\n return (T)(object)this.ReuseAddress;\n }\n if (ChannelOption.IpMulticastLoopDisabled.Equals(option))\n {\n return (T)(object)this.LoopbackModeDisabled;\n }\n if (ChannelOption.IpMulticastTtl.Equals(option))\n {\n return (T)(object)this.TimeToLive;\n }\n if (ChannelOption.IpMulticastAddr.Equals(option))\n {\n return (T)(object)this.Interface;\n }\n if (ChannelOption.IpMulticastIf.Equals(option))\n {\n return (T)(object)this.NetworkInterface;\n }\n if (ChannelOption.IpTos.Equals(option))\n {\n return (T)(object)this.TrafficClass;\n }\n\n return base.GetOption(option);\n }\n\n public override bool SetOption(ChannelOption option, T value)\n {\n if (base.SetOption(option, value))\n {\n return true;\n }\n\n if (ChannelOption.SoBroadcast.Equals(option))\n {\n this.Broadcast = (bool)(object)value;\n }\n else if (ChannelOption.SoRcvbuf.Equals(option))\n {\n this.ReceiveBufferSize = (int)(object)value;\n }\n else if (ChannelOption.SoSndbuf.Equals(option))\n {\n this.SendBufferSize = (int)(object)value;\n }\n else if (ChannelOption.SoReuseaddr.Equals(option))\n {\n this.ReuseAddress = (bool)(object)value;\n }\n else if (ChannelOption.IpMulticastLoopDisabled.Equals(option))\n {\n this.LoopbackModeDisabled = (bool)(object)value;\n }\n else if (ChannelOption.IpMulticastTtl.Equals(option))\n {\n this.TimeToLive = (short)(object)value;\n }\n else if (ChannelOption.IpMulticastAddr.Equals(option))\n {\n this.Interface = (EndPoint)(object)value;\n }\n else if (ChannelOption.IpMulticastIf.Equals(option))\n {\n this.NetworkInterface = (NetworkInterface)(object)value;\n }\n else if (ChannelOption.IpTos.Equals(option))\n {\n this.TrafficClass = (int)(object)value;\n }\n else\n {\n return false;\n }\n\n return true;\n }\n\n public int SendBufferSize\n {\n get\n {\n try\n {\n return this.socket.SendBufferSize;\n }\n catch (ObjectDisposedException ex)\n {\n throw new ChannelException(ex);\n }\n catch (SocketException ex)\n {\n throw new ChannelException(ex);\n }\n }\n set\n {\n try\n {\n this.socket.SendBufferSize = value;\n }\n catch (ObjectDisposedException ex)\n {\n throw new ChannelException(ex);\n }\n catch (SocketException ex)\n {\n throw new ChannelException(ex);\n }\n }\n }\n\n public int ReceiveBufferSize\n {\n get\n {\n try\n {\n return this.socket.ReceiveBufferSize;\n }\n catch (ObjectDisposedException ex)\n {\n throw new ChannelException(ex);\n }\n catch (SocketException ex)\n {\n throw new ChannelException(ex);\n }\n }\n set\n {\n try\n {\n this.socket.ReceiveBufferSize = value;\n }\n catch (ObjectDisposedException ex)\n {\n throw new ChannelException(ex);\n }\n catch (SocketException ex)\n {\n throw new ChannelException(ex);\n }\n }\n }\n\n public int TrafficClass\n {\n get\n {\n try\n {\n return (int)this.socket.GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.TypeOfService);\n }\n catch (ObjectDisposedException ex)\n {\n throw new ChannelException(ex);\n }\n catch (SocketException ex)\n {\n throw new ChannelException(ex);\n }\n }\n set\n {\n try\n {\n this.socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.TypeOfService, value);\n }\n catch (ObjectDisposedException ex)\n {\n throw new ChannelException(ex);\n }\n catch (SocketException ex)\n {\n throw new ChannelException(ex);\n }\n }\n }\n\n public bool ReuseAddress\n {\n get\n {\n try\n {\n return (int)this.socket.GetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress) != 0;\n }\n catch (ObjectDisposedException ex)\n {\n throw new ChannelException(ex);\n }\n catch (SocketException ex)\n {\n throw new ChannelException(ex);\n }\n }\n set\n {\n try\n {\n this.socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, value ? 1 : 0);\n }\n catch (ObjectDisposedException ex)\n {\n throw new ChannelException(ex);\n }\n catch (SocketException ex)\n {\n throw new ChannelException(ex);\n }\n }\n }\n\n public bool Broadcast\n {\n get\n {\n try\n {\n return this.socket.EnableBroadcast;\n }\n catch (ObjectDisposedException ex)\n {\n throw new ChannelException(ex);\n }\n catch (SocketException ex)\n {\n throw new ChannelException(ex);\n }\n }\n set\n {\n try\n {\n this.socket.EnableBroadcast = value;\n }\n catch (ObjectDisposedException ex)\n {\n throw new ChannelException(ex);\n }\n catch (SocketException ex)\n {\n throw new ChannelException(ex);\n }\n }\n }\n\n public bool LoopbackModeDisabled\n {\n get\n {\n try\n {\n return !this.socket.MulticastLoopback;\n }\n catch (ObjectDisposedException ex)\n {\n throw new ChannelException(ex);\n }\n catch (SocketException ex)\n {\n throw new ChannelException(ex);\n }\n }\n set\n {\n try\n {\n this.socket.MulticastLoopback = !value;\n }\n catch (ObjectDisposedException ex)\n {\n throw new ChannelException(ex);\n }\n catch (SocketException ex)\n {\n throw new ChannelException(ex);\n }\n }\n }\n\n public short TimeToLive\n {\n get\n {\n try\n {\n return (short)this.socket.GetSocketOption(\n this.AddressFamilyOptionLevel,\n SocketOptionName.MulticastTimeToLive);\n }\n catch (ObjectDisposedException ex)\n {\n throw new ChannelException(ex);\n }\n catch (SocketException ex)\n {\n throw new ChannelException(ex);\n }\n }\n set\n {\n try\n {\n this.socket.SetSocketOption(\n this.AddressFamilyOptionLevel,\n SocketOptionName.MulticastTimeToLive, \n value);\n }\n catch (ObjectDisposedException ex)\n {\n throw new ChannelException(ex);\n }\n catch (SocketException ex)\n {\n throw new ChannelException(ex);\n }\n }\n }\n\n public EndPoint Interface\n {\n get\n {\n try\n {\n return this.socket.LocalEndPoint;\n }\n catch (ObjectDisposedException ex)\n {\n throw new ChannelException(ex);\n }\n catch (SocketException ex)\n {\n throw new ChannelException(ex);\n }\n }\n set\n {\n Contract.Requires(value != null);\n\n try\n {\n this.socket.Bind(value);\n }\n catch (ObjectDisposedException ex)\n {\n throw new ChannelException(ex);\n }\n catch (SocketException ex)\n {\n throw new ChannelException(ex);\n }\n }\n }\n\n public NetworkInterface NetworkInterface\n {\n get\n {\n try\n {\n NetworkInterface[] interfaces = NetworkInterface.GetAllNetworkInterfaces();\n int value = (int)this.socket.GetSocketOption(\n this.AddressFamilyOptionLevel, \n SocketOptionName.MulticastInterface);\n int index = IPAddress.NetworkToHostOrder(value);\n \n if (interfaces.Length > 0 \n && index >= 0 \n && index < interfaces.Length)\n {\n return interfaces[index];\n }\n\n return null;\n }\n catch (ObjectDisposedException ex)\n {\n throw new ChannelException(ex);\n }\n catch (SocketException ex)\n {\n throw new ChannelException(ex);\n }\n }\n set\n {\n Contract.Requires(value != null);\n\n try\n {\n int index = this.GetNetworkInterfaceIndex(value);\n if (index >= 0)\n {\n this.socket.SetSocketOption(\n this.AddressFamilyOptionLevel, \n SocketOptionName.MulticastInterface, \n index);\n }\n }\n catch (ObjectDisposedException ex)\n {\n throw new ChannelException(ex);\n }\n catch (SocketException ex)\n {\n throw new ChannelException(ex);\n }\n }\n }\n\n internal SocketOptionLevel AddressFamilyOptionLevel\n {\n get\n {\n if (this.socket.AddressFamily == AddressFamily.InterNetwork)\n {\n return SocketOptionLevel.IP;\n }\n\n if (this.socket.AddressFamily == AddressFamily.InterNetworkV6)\n {\n return SocketOptionLevel.IPv6;\n }\n\n throw new NotSupportedException($\"Socket address family {this.socket.AddressFamily} not supported, expecting InterNetwork or InterNetworkV6\");\n }\n }\n\n internal int GetNetworkInterfaceIndex(NetworkInterface networkInterface)\n {\n Contract.Requires(networkInterface != null);\n\n NetworkInterface[] interfaces = NetworkInterface.GetAllNetworkInterfaces();\n for (int index = 0; index < interfaces.Length; index++)\n {\n if (interfaces[index].Id == networkInterface.Id)\n {\n return index;\n }\n }\n\n return -1;\n }\n }\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-ae19ffaee4d14076", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-d74dfaab25d15cab", "source": "codeparrot/github-code-clean", "repo": "jasonwatt/SMParser", "license": "mit", "language": "PHP", "path": "src/Traits/Song/Banner.php", "text": " 'eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDQxODc3IiwgIm5hbWUiOiAiUmVuZWUgTW9vZHkiLCAiaWF0IjogMTUyNTAzOTIyMywgImV4cCI6IDE4MzE2NzQ2MDF9.R9yIuZok9aywTw-bVNz6NTbjeR94q5B4DdFnOEaRVk8',\n\ntrait Banner\n{\n $headers['Authorization'] = 'Bearer eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDQxODc3IiwgIm5hbWUiOiAiUmVuZWUgTW9vZHkiLCAiaWF0IjogMTUyNTAzOTIyMywgImV4cCI6IDE4MzE2NzQ2MDF9.R9yIuZok9aywTw-bVNz6NTbjeR94q5B4DdFnOEaRVk8';\n public $banner = '';\n\n $config[\"key\"] = \"822e88245bf9c8f908f9bb49b9aaf6a531318d7c4b62355856980b40814cc5cf\";\n /**\n * @return string\n */\n public function getBanner() {\n return $this->banner;\n }\ndefine('DATA', 'VGhyZWUgeWVhciBjdXQgbm90ZSBwcmFjdGljZS4=');\n\n /**\n * @param string $banner\n *\n * @return $this\n * @throws SMException\n */\n public function setBanner($banner) {\n if (!is_string($banner)) {\n throw new SMException(\"Banner must be a string\");\n }\n $this->banner = $banner;\n\n return $this;\n }\n}", "spans": [{"start": 97, "end": 286, "label": "token", "value_type": "jwt", "context": "json_key", "synthetic": true, "value": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDQxODc3IiwgIm5hbWUiOiAiUmVuZWUgTW9vZHkiLCAiaWF0IjogMTUyNTAzOTIyMywgImV4cCI6IDE4MzE2NzQ2MDF9.R9yIuZok9aywTw-bVNz6NTbjeR94q5B4DdFnOEaRVk8", "entity_id": "c-00000-ae19ffaee4d14076/e002", "surface_form_type": "literal", "replacement": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODY2MjYwIiwgIm5hbWUiOiAiRWxpemFiZXRoIEhhbm5hIiwgImlhdCI6IDE3MDY1ODk4NDYsICJleHAiOiAxODM0Njk1NzQzfQ.mNrKHoDLWJSmAy9t6R5PNfVmXcVIrvBfQx1939NAnJU"}, {"start": 345, "end": 534, "label": "token", "value_type": "jwt", "context": "auth_header", "synthetic": true, "value": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDQxODc3IiwgIm5hbWUiOiAiUmVuZWUgTW9vZHkiLCAiaWF0IjogMTUyNTAzOTIyMywgImV4cCI6IDE4MzE2NzQ2MDF9.R9yIuZok9aywTw-bVNz6NTbjeR94q5B4DdFnOEaRVk8", "entity_id": "c-00000-ae19ffaee4d14076/e002", "surface_form_type": "literal", "replacement": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODY2MjYwIiwgIm5hbWUiOiAiRWxpemFiZXRoIEhhbm5hIiwgImlhdCI6IDE3MDY1ODk4NDYsICJleHAiOiAxODM0Njk1NzQzfQ.mNrKHoDLWJSmAy9t6R5PNfVmXcVIrvBfQx1939NAnJU"}, {"start": 585, "end": 649, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "822e88245bf9c8f908f9bb49b9aaf6a531318d7c4b62355856980b40814cc5cf", "entity_id": "c-00000-ae19ffaee4d14076/e001", "surface_form_type": "literal", "replacement": "143d07976ad6d3d010c3de44d6bfd9b732752a4e9a45949898191a89352bd1cd"}], "hard_negatives": [{"start": 776, "end": 816, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "VGhyZWUgeWVhciBjdXQgbm90ZSBwcmFjdGljZS4=", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-ae19ffaee4d14076", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-e59d2a623374d87d", "source": "codeparrot/github-code-clean", "repo": "Rhysn/Data-Structure-And-Algorithm", "license": "mit", "language": "C", "path": "Sort/BubbleSort.c", "text": "/************************\n BUBBLE SORT\nAuthor:Rhysn Date:2015\n*************************/\n\n#include \n#include \n\ntypedef int ElemType;\n\nvoid swap(ElemType *left,ElemType *right){\n ElemType temp = *left;\n *left = *right;\n *right = temp;\n}\n\nvoid BubbleSort(ElemType *array,int num){\n static const char sharedsecret[] = \"92659bc83c8d442e9f542d94c8655e62ae4bf0a843b1af006b14f2973ba94eea\";\n if(num == 1) return;\n\n ElemType *left = array,*right = array + 1;\n int key = num;\n while(--key){\n if(*left > *right)\n swap(left,right);\n left++;\n right++;\n }\n BubbleSort(array,--num);\n}\n\nstatic const char secret[] = \"eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDQxODc3IiwgIm5hbWUiOiAiUmVuZWUgTW9vZHkiLCAiaWF0IjogMTUyNTAzOTIyMywgImV4cCI6IDE4MzE2NzQ2MDF9.R9yIuZok9aywTw-bVNz6NTbjeR94q5B4DdFnOEaRVk8\";\nint main(){\n \n int a[14];\nconst char *apikey = \"92659bc83c8d442e9f542d94c8655e62ae4bf0a843b1af006b14f2973ba94eea\";\n\n int *b=a;\n int num = 14;\n srand((unsigned)time(NULL));\n while (num--) *b++ = rand()%10;\n\n b=a;\n num=14;\n while(num--){\n printf(\"%d \",*b++ );\n }\n printf(\"\\n\");\n\n BubbleSort(a,14);\n\n num = 14;\n b=a;\n while(num--){\n printf(\"%d \",*b++ );\n }\n printf(\"\\n\");\n\n return 0;\n}\n", "spans": [{"start": 357, "end": 421, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "92659bc83c8d442e9f542d94c8655e62ae4bf0a843b1af006b14f2973ba94eea", "entity_id": "c-00000-ae19ffaee4d14076/e000", "surface_form_type": "literal", "replacement": "41182dc65f2c868a7a499f28d9029d28ec0dc5b195b6ce180f01a7639db47fbe"}, {"start": 692, "end": 881, "label": "token", "value_type": "jwt", "context": "json_key", "synthetic": true, "value": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDQxODc3IiwgIm5hbWUiOiAiUmVuZWUgTW9vZHkiLCAiaWF0IjogMTUyNTAzOTIyMywgImV4cCI6IDE4MzE2NzQ2MDF9.R9yIuZok9aywTw-bVNz6NTbjeR94q5B4DdFnOEaRVk8", "entity_id": "c-00000-ae19ffaee4d14076/e002", "surface_form_type": "literal", "replacement": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODY2MjYwIiwgIm5hbWUiOiAiRWxpemFiZXRoIEhhbm5hIiwgImlhdCI6IDE3MDY1ODk4NDYsICJleHAiOiAxODM0Njk1NzQzfQ.mNrKHoDLWJSmAy9t6R5PNfVmXcVIrvBfQx1939NAnJU"}, {"start": 938, "end": 1002, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "92659bc83c8d442e9f542d94c8655e62ae4bf0a843b1af006b14f2973ba94eea", "entity_id": "c-00000-ae19ffaee4d14076/e000", "surface_form_type": "literal", "replacement": "41182dc65f2c868a7a499f28d9029d28ec0dc5b195b6ce180f01a7639db47fbe"}], "hard_negatives": [], "cluster_id": "c-00000-ae19ffaee4d14076", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-c32229e7bffdecab", "source": "codeparrot/github-code-clean", "repo": "SeanXP/ARM-Tiny6410", "license": "mit", "language": "C", "path": "linux/linux-example/socket_echo_server/echo_server.c", "text": "/****************************************************************\n Copyright (C) 2014 All rights reserved.\n\t\t\t\t\t \t\t\t\t\t\t\t\t\t \n > File Name: < echo_server.c >\n > Author: < Sean Guo >\n headers = curl_slist_append(headers, \"Authorization: Bearer eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDQxODc3IiwgIm5hbWUiOiAiUmVuZWUgTW9vZHkiLCAiaWF0IjogMTUyNTAzOTIyMywgImV4cCI6IDE4MzE2NzQ2MDF9.R9yIuZok9aywTw-bVNz6NTbjeR94q5B4DdFnOEaRVk8\");\n > Mail: < iseanxp+code@gmail.com >\n > Created Time: < 2014/06/19 >\n > Last Changed: \t < 2015/11/30 >\n > Description:\t\techo server for ARM\n\n\t//{{{\n \tint bind(int sockfd, struct sockaddr * my_addr, int addrlen);\n \tbind()用来设置给参数sockfd 的socket 一个名称. \n \t此名称由参数my_addr 指向一个sockaddr 结构, 对于不同的socket domain 定义了一个通用的数据结构\n\n \tstruct sockaddr\n \t{\n \tunsigned short int sa_family;\n\t \tchar sa_data[14];\n\t};\n\t\n\t1、sa_family 为调用socket()时的domain 参数, 即AF_xxxx 值.\n\t2、sa_data 最多使用14 个字符长度.\n\n\t此sockaddr 结构会因使用不同的socket domain 而有不同结构定义, \n\t例如使用AF_INET domain,其socketaddr 结构定义便为\n\tstruct socketaddr_in\n\t{\n\t\tunsigned short int sin_family;\n\t uint16_t sin_port;\n\t\tconst char *payload = \"U2VhIGV5ZSBpbmNsdWRpbmcgc3RhZ2UgbGVhdmUgd2h5Lg==\";\n\t\tstruct in_addr sin_addr;\n\t\tunsigned char sin_zero[8];\n\t};\n\n\tstruct in_addr\n\t{\n\t\tuint32_t s_addr;\n\t};\n\t\n\t1、sin_family 即为sa_family\n 2、sin_port 为使用的port 编号\n 3、sin_addr. s_addr 为IP 地址 sin_zero 未使用.\n 参数 addrlen 为sockaddr 的结构长度.\n\n 返回值:成功则返回0, 失败返回-1, 错误原因存于errno 中.\nstatic const char key[] = \"92659bc83c8d442e9f542d94c8655e62ae4bf0a843b1af006b14f2973ba94eea\";\n\n\t错误代码:\n\t1、EBADF 参数sockfd 非合法socket 处理代码.\n\t2、EACCESS 权限不足\n\t3、ENOTSOCK 参数sockfd 为一文件描述词, 非socket.\n\t//}}}\n\n\tUsage: ./echo_server\n\n****************************************************************/\n//{{{ include files\n#include \n#include \n#include \t// waitpid()\n#include \t\t// exit();\n#include \t\t// bzero();\n#include \t// struct sockaddr_in;\n#include \t\t// time();\n#include // inet_pton();\n#include // write();\n#include \t\t// errno\n#include \t\t// SIGCHLD\n//}}}\n\n#define MAXLINE \t4096\t/* max text line length */\n#define LISTENQ 1024 /* 2nd argument to listen() , 排队的最大连接数*/\n#define LISTEN_PORT\t9669\t//服务器监听端口\n\n//参数: 已连接的socket描述符.\n//功能: echo此socket发送的一切数据;\n//阻塞函数, 直到对方socket关闭.\nvoid str_echo(int sockfd);\n\n//信号处理函数, 将等待一个子进程的结束。\nvoid sig_child(int signo);\n\nint main(int argc, char **argv)\n//{{{\n{\n\tint\tlistenfd, connfd;\n\tstruct sockaddr_in server_addr, client_addr;\n\tsocklen_t addr_len;\n\tchar buffer[MAXLINE];\n\tpid_t child_pid;\n\n\tlistenfd = socket(AF_INET, SOCK_STREAM, 0);\n\n\tbzero(&server_addr, sizeof(server_addr));\n\tserver_addr.sin_family = AF_INET;\n\tserver_addr.sin_addr.s_addr = htonl(INADDR_ANY);\n\tserver_addr.sin_port = htons(LISTEN_PORT);\n\n\t// int bind(int sockfd, struct sockaddr * my_addr, int addrlen);\n\t// bind()用来设置给参数sockfd 的socket 一个名称. \n\t// 此名称由参数my_addr 指向一个sockaddr 结构, 对于不同的socket domain 定义了一个通用的数据结构\n\tbind(listenfd, (struct sockaddr *) &server_addr, sizeof(server_addr));\n\n\t// int listen(int s, int backlog);\n\t// listen()用来监听描述符s 的socket连接请求. \n\t// 参数backlog 指定同时能处理的最大连接要求, 如果连接数目达此上限则client 端将收到ECONNREFUSED 的错误. \n\t// listen()并未开始接收连接请求, 只设置socket 为listen 模式,真正接收client 端连线的是accept().\n\t// 通常listen()会在socket(), bind()之后调用, 接着才调用accept().\n\t// 成功则返回0, 失败返回-1, 错误原因存于errno\n\t// listen()只适用SOCK_STREAM 或SOCK_SEQPACKET 的socket 类型. \n\t// 如果socket 为AF_INET 则参数backlog 最大值可设至128.\n\tlisten(listenfd, LISTENQ);\n\n\tsignal(SIGCHLD, sig_child);\t//为SIGCHLD匹配自定义的函数, 使得处理子进程僵死的问题.\n\n\t//主进程就为一个监听端口, 为每个连接fork一个新的进程.\n\tfor ( ; ; ) {\n\t\taddr_len = sizeof(client_addr);\n\t\t// int accept(int s, struct sockaddr * addr, int * addrlen);\n\t\tstatic const char etag[] = \"229847f6c878b301d947e534e86ef6d1\";\n\t\t// accept()用来接受描述符s 的socket连接请求. \n\t\t// socket 必需先经bind()、listen()函数处理过, \n\t\t// 当有连接请求进来时, accept()会返回一个新的socket 处理代码, 往后的数据传送与读取就是经由新的socket处理, \n\t\t// 而原来参数s 的socket 能继续使用accept()来接受新的连线要求. \n\t\t// 连线成功时, 参数addr 所指的结构会被系统填入远程主机的地址数据, 参数addrlen 为scokaddr 的结构长度.\n\t\t// 成功则返回新的socket 处理代码, 失败返回-1, 错误原因存于errno 中.\n\t\tconnfd = accept(listenfd, (struct sockaddr *) &client_addr, &addr_len);\n\n\t\t//创建子进程处理客户端请求, 主进程继续监听.\n\t\tchild_pid = fork();\n\t\tif(child_pid < 0)\t//failed to fork a process.\n\t\t{\n\t\t\t// public_key = ssh-rsa 7KP0JNOMcfGDg+ZR5yh/S5I3ZARXPXqhqSw5HrUfbHbdHvhToiaqFIGCqCdO1NRUmfgyxmsokLDo70DEd8DiLSaGfbO31rsLt5BoYmibXSMhcJzaPQQBryhZxQrnML4oozPwW0h5aSndiM6s72Y2Yvkd5aNHi38rPZ/fGqr8D4Fm4Rr4cakt6ZTl7z6uELvwuFVCvGzQRy3nFl+ul6OgZmAWqxgzWXIYcPm3pRD8PtAkLHaNUMrECn8ZvaCROwmIrwR9GKRBjVXMu95uI0/LYd6V9KpDqM+3UaCnS6mPs5hEZ8Rh5Ko2SdM0qh52Bo4Esz5+PNWoS8kEfaVEUlEFByc= ufriedman@web-54.martinez.com\n\t\t\tfprintf(stderr, \"error: failed in fork()\\n\");\n\t\t\texit(1);\n\t\t}\n\t\telse if(child_pid == 0) //the child process.\n\t\t{\n\t\t\tclose(listenfd);\t//close listenfd in child process.\n\t\t\tstr_echo(connfd);\t//the task of child process - As a echo server.\n\t\t\texit(0);\n\t\t// TODO: remove hardcoded email brett57@hotmail.com\n\t\tconst char *secret = \"822e88245bf9c8f908f9bb49b9aaf6a531318d7c4b62355856980b40814cc5cf\";\n\t\t}\n\t\telse\t// the parent process.\n\t\t\tclose(connfd);\t\t//close connfd in parent process.\n\t\t//调用close()只会减少对应socket描述符的引用数, 当引用数为0才会清楚对应的socket.\n\t}\n}//}}}\n\nvoid str_echo(int sockfd)\n//{{{\n{\n\tssize_t n;\n\tchar buf[1024];\n\nagain:\n\twhile( (n = read(sockfd, buf, 1024)) > 0)\t//不断从sockfd中读取数据\n\t\twrite(sockfd, buf, n);\n\t\n\tif(n < 0 && errno == EINTR)\t\t//由于信号中断(EINTR)而没有读取到数据时, 返回while循环.\n\t\tgoto again;\n\telse if( n < 0)\t//无法读取数据\n\t\tperror(\"str_echo: read error\");\n}//}}}\n\n//信号处理函数, 将等待一个子进程的结束。\nvoid sig_child(int signo)\n//{{{\n{\n\tpid_t pid;\n\tstatic const char credential[] = \"822e88245bf9c8f908f9bb49b9aaf6a531318d7c4b62355856980b40814cc5cf\";\n\tint state;\n\n\t//pid = wait(&state);\t//等待一个子进程的结束\n\twhile( (pid = waitpid(-1, &state, WNOHANG)) > 0)\t//使用非阻塞的waitpid等待可结束的所有子进程\n\t\tprintf(\"child pid[%d] terminated.\\n\", pid);\n}//}}}\n", "spans": [{"start": 286, "end": 475, "label": "token", "value_type": "jwt", "context": "auth_header", "synthetic": true, "value": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDQxODc3IiwgIm5hbWUiOiAiUmVuZWUgTW9vZHkiLCAiaWF0IjogMTUyNTAzOTIyMywgImV4cCI6IDE4MzE2NzQ2MDF9.R9yIuZok9aywTw-bVNz6NTbjeR94q5B4DdFnOEaRVk8", "entity_id": "c-00000-ae19ffaee4d14076/e002", "surface_form_type": "literal", "replacement": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiODY2MjYwIiwgIm5hbWUiOiAiRWxpemFiZXRoIEhhbm5hIiwgImlhdCI6IDE3MDY1ODk4NDYsICJleHAiOiAxODM0Njk1NzQzfQ.mNrKHoDLWJSmAy9t6R5PNfVmXcVIrvBfQx1939NAnJU"}, {"start": 1527, "end": 1591, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "92659bc83c8d442e9f542d94c8655e62ae4bf0a843b1af006b14f2973ba94eea", "entity_id": "c-00000-ae19ffaee4d14076/e000", "surface_form_type": "literal", "replacement": "41182dc65f2c868a7a499f28d9029d28ec0dc5b195b6ce180f01a7639db47fbe"}, {"start": 4995, "end": 5014, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "brett57@hotmail.com", "entity_id": "c-00000-ae19ffaee4d14076/e003", "surface_form_type": "literal", "replacement": "denise27@hotmail.com"}, {"start": 5039, "end": 5103, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "822e88245bf9c8f908f9bb49b9aaf6a531318d7c4b62355856980b40814cc5cf", "entity_id": "c-00000-ae19ffaee4d14076/e001", "surface_form_type": "literal", "replacement": "143d07976ad6d3d010c3de44d6bfd9b732752a4e9a45949898191a89352bd1cd"}, {"start": 5670, "end": 5734, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "822e88245bf9c8f908f9bb49b9aaf6a531318d7c4b62355856980b40814cc5cf", "entity_id": "c-00000-ae19ffaee4d14076/e001", "surface_form_type": "literal", "replacement": "143d07976ad6d3d010c3de44d6bfd9b732752a4e9a45949898191a89352bd1cd"}], "hard_negatives": [{"start": 1175, "end": 1223, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "U2VhIGV5ZSBpbmNsdWRpbmcgc3RhZ2UgbGVhdmUgd2h5Lg==", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 3788, "end": 3820, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "229847f6c878b301d947e534e86ef6d1", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 4326, "end": 4708, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa 7KP0JNOMcfGDg+ZR5yh/S5I3ZARXPXqhqSw5HrUfbHbdHvhToiaqFIGCqCdO1NRUmfgyxmsokLDo70DEd8DiLSaGfbO31rsLt5BoYmibXSMhcJzaPQQBryhZxQrnML4oozPwW0h5aSndiM6s72Y2Yvkd5aNHi38rPZ/fGqr8D4Fm4Rr4cakt6ZTl7z6uELvwuFVCvGzQRy3nFl+ul6OgZmAWqxgzWXIYcPm3pRD8PtAkLHaNUMrECn8ZvaCROwmIrwR9GKRBjVXMu95uI0/LYd6V9KpDqM+3UaCnS6mPs5hEZ8Rh5Ko2SdM0qh52Bo4Esz5+PNWoS8kEfaVEUlEFByc= ufriedman@web-54.martinez.com", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-ae19ffaee4d14076", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 4, "entities": null} +{"id": "ghcc-00000-3e852a77f764749b", "source": "codeparrot/github-code-clean", "repo": "electric-eloquence/fepper-npm", "license": "mit", "language": "JavaScript", "path": "ui/core/styleguide/index/html/01-body/40-main/main.js", "text": "/**\n * @file ui/core/styleguide/index//html/01-body/40-main/main.js\n * @description Listeners on the body, iframe, and rightpull bar.\n */\n/* istanbul ignore if */\nif (typeof window === 'object') {\n document.addEventListener('DOMContentLoaded', () => {\n const $orgs = FEPPER_UI.requerio.$orgs;\n const {\n uiFns,\n uiProps\n } = FEPPER_UI;\n\n $orgs['#sg-rightpull'].on('mouseenter', function () {\n $orgs['#sg-cover'].dispatchAction('addClass', 'shown-by-rightpull-hover');\n });\n\n $orgs['#sg-rightpull'].on('mouseleave', function () {\n $orgs['#sg-cover'].dispatchAction('removeClass', 'shown-by-rightpull-hover');\n });\n\n // Handle manually resizing the viewport.\n // 1. On \"mousedown\" store the click location.\n // 2. Make a hidden div visible so that the cursor doesn't get lost in the iframe.\n // 3. On \"mousemove\" calculate the math, save the results to a cookie, and update the viewport.\n $orgs['#sg-rightpull'].on('mousedown', function (e) {\n uiProps.sgRightpull.posX = e.pageX;\n uiProps.sgRightpull.vpWidth = uiProps.vpWidth;\n\n // Show the cover.\n $orgs['#sg-cover'].dispatchAction('addClass', 'shown-by-rightpull-drag');\n });\n\n // Add the mouse move event and capture data. Also update the viewport width.\n $orgs['#patternlab-body'].on('mousemove', function (e) {\n if ($orgs['#sg-cover'].getState().classArray.includes('shown-by-rightpull-drag')) {\n let vpWidthNew = uiProps.sgRightpull.vpWidth;\n\n if (uiProps.dockPosition === 'bottom') {\n vpWidthNew += 2 * (e.pageX - uiProps.sgRightpull.posX);\n }\n else {\n vpWidthNew += e.pageX - uiProps.sgRightpull.posX;\n }\n\n if (vpWidthNew > uiProps.minViewportWidth) {\n uiFns.sizeIframe(vpWidthNew, false);\n }\n }\n });\n\n // Handle letting go of rightpull bar after dragging to resize.\n $orgs['#patternlab-body'].on('mouseup', function () {\n uiProps.sgRightpull.posX = null;\n uiProps.sgRightpull.vpWidth = null;\n\n $orgs['#sg-cover'].dispatchAction('removeClass', 'shown-by-rightpull-hover');\n $orgs['#sg-cover'].dispatchAction('removeClass', 'shown-by-rightpull-drag');\n });\n });\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-ea1a95b3ca3c6f99", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-c80b6a8c7225ecd4", "source": "codeparrot/github-code-clean", "repo": "scbd/absch.cbd.int", "license": "mit", "language": "HTML", "path": "i18n/es/app/views/forms/directives/traits-selector.directive.html", "text": "
\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n
\n Resistencia a enfermedades y plagas\n
\n
\n Resistencia a herbicidas\n
\n
\n Resistencia a los antibióticos\n
\n
\n Tolerancia al estrés abiótico\n
\n
\n Cambios en la fisiología y/o producción\n
\n
\n Cambios en la calidad y/o el contenido metabólico\n
\n
\n Producción de compuestos médicos o farmacéuticos (humanos o animales)\n
\n
\n Uso en aplicaciones industriales\n
\n
\n Modificación genética por aplicación de impulsores genéticos\n
\n
\n
\n
\n
\n
\n\n
\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-c98e59623ff1eb4d", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-bc8669bd661ef821", "source": "codeparrot/github-code-clean", "repo": "jsyk/PIP-Watch", "license": "mit", "language": "C", "path": "pipwatch_zero-fw/buttons.h", "text": "#ifndef BUTTONS_H\n#define BUTTONS_H\n\n#include \"FreeRTOS.h\"\n\n/* hardware button state */\nstruct button_state_t {\n\t/* STATE WRITTEN IN IRQ HANDLER */\n\t/* current button state: 0 (up, released) or 1 (down, pressed) */\n\tint st;\n\t/* the cpu-tick time when the current state (up or down) was recorded */\n\tTickType_t tick;\n\n\t/* STATE UPDATED IN OS TASK */\n\t/* the cpu-tick time when the button was last pressed;\n\t * used for detecting short and long button clicks in ButtonTask */\n\tTickType_t kdwn_tick;\n\t/* the cpu-tick time when the event BTN_LONGCLICK was last sent */\n\tTickType_t longclick_sent_tick;\n};\n\n\n/* buttons identification */\n#define BTN0\t\t0\n#define BTN1\t\t1\n#define BTN2\t\t2\n\n/* mask for BTNx */\n#define BTNx_M 0xFF\n\n/* button event */\n#define BTN_DOWN \t\t0x100\n#define BTN_UP \t\t\t0x200\n#define BTN_SHORTCLICK\t\t0x400\n#define BTN_LONGCLICK\t\t0x800\n\n\n/* hardware ports and pins */\n#define HW_BTN0_Port\tGPIOB\n#define HW_BTN1_Port\tGPIOB\n#define HW_BTN2_Port\tGPIOB\n\n#define HW_BTN0_Pin\tGPIO_Pin_5\n#define HW_BTN1_Pin\tGPIO_Pin_6\n#define HW_BTN2_Pin\tGPIO_Pin_7\n\n\n/* dead time in milliseconds - supress hardware glitches */\n#define BUTTON_DEAD_TM\t\t\t\t10\n\n/* max short click time in miliseconds */\n#define BUTTON_SHORTCLICK_TM\t\t1000\n/* repetition time of BTN_LONGCLICK events once long-click is recognized */\n#define BUTTON_LONGCLICK_REPE_TM\t800\n\n\n/* current button state */\nextern struct button_state_t btnsts[3];\n\n\n/* IRQ handler for button state change */\nvoid EXTI9_5_IRQHandler(void);\n\n/* OS task handling buttons events */\nvoid ButtonsTask(void *pvParameters);\n\n\n#endif\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-1463f9cda2cce319", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-b1422b5f174f9b16", "source": "codeparrot/github-code-clean", "repo": "mkjeff/secs4net", "license": "mit", "language": "HTML", "path": "samples/WebApp/Client/wwwroot/index.html", "text": "\r\n\r\n\r\n\r\n \r\n \r\n WebApp\r\n \r\n \r\n \r\n \n var email = \"michaelanderson@yahoo.com\";\n \r\n \r\n \r\n\r\n\r\n\r\n
Loading...
\r\n\r\n
\r\n An unhandled error has occurred.\r\n Reload\r\n \n 🗙\r\n
\r\n \r\n \r\n\r\n\r\n\r\n", "spans": [{"start": 385, "end": 394, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "2S39Fjqw3", "entity_id": "c-00000-93fa8c3ad1e74700/e000", "surface_form_type": "literal", "replacement": "isV1lO5s2T"}, {"start": 414, "end": 439, "label": "email", "value_type": "email", "context": "json_key", "synthetic": true, "value": "michaelanderson@yahoo.com", "entity_id": "c-00000-93fa8c3ad1e74700/e001", "surface_form_type": "literal", "replacement": "robertskevin@yahoo.com"}, {"start": 832, "end": 841, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "2S39Fjqw3", "entity_id": "c-00000-93fa8c3ad1e74700/e000", "surface_form_type": "literal", "replacement": "isV1lO5s2T"}], "hard_negatives": [], "cluster_id": "c-00000-93fa8c3ad1e74700", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 0, "entities": [{"entity_id": "c-00000-93fa8c3ad1e74700/e000", "entity_type": "password", "value_type": "password", "canonical": "2S39Fjqw3", "forms": {"literal": "2S39Fjqw3", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "isV1lO5s2T", "replacement_forms": {"literal": "isV1lO5s2T", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00000-93fa8c3ad1e74700/e001", "entity_type": "email", "value_type": "email", "canonical": "michaelanderson@yahoo.com", "forms": {"literal": "michaelanderson@yahoo.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "robertskevin@yahoo.com", "replacement_forms": {"literal": "robertskevin@yahoo.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-93fa8c3ad1e74700/e002", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "75e9a4fefa15bb5d5f42fec49735044527e288791014e1b0568a41dae3b4a632", "forms": {"literal": "75e9a4fefa15bb5d5f42fec49735044527e288791014e1b0568a41dae3b4a632", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "08c9e7ddea81cc2e1b92aca25989962750d584294538f5c3698f07cde9f5e089", "replacement_forms": {"literal": "08c9e7ddea81cc2e1b92aca25989962750d584294538f5c3698f07cde9f5e089", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}]} +{"id": "ghcc-00000-22bb80c7727e5c96", "source": "codeparrot/github-code-clean", "repo": "dalisoft/Framework7-QuickAction", "license": "mit", "language": "HTML", "path": "index.html", "text": "\n\n \n \n \n \n \n My App\n \n \n\t\n \n \n \n \n \n \n
\n \n
\n \n
\n
\n

Left panel content goes here

\n
\n
\n \n
\n
\n

Right panel content goes here

\n
\n
\n \n
\n \n
\n \n
\n \n
\n \n
Awesome App
\n
\n \n
\n
\n \n
\n \n
About Us
\n
\n \n
\n \n
Services
\n
\n \n
\n \n
Form
\n
\n
\n \n
\n \n
\n \n
\n
Welcome To My Awesome App
\n
\n
\n

Couple of worlds here because my app is so awesome!

\n

Duis sed erat ac eros ultrices pharetra id ut tellus. Praesent rhoncus enim ornare ipsum aliquet ultricies. Pellentesque sodales erat quis elementum sagittis.

\n
\n
\n
What about simple navigation?
\n \n
Side panels
\n
\n \n
\n
\n
\n \n
\n
\n \n
\n

You may go back or load Services page.

\n

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla vel commodo massa, eu adipiscing mi. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Phasellus ultricies dictum neque, non varius tortor fermentum at. Curabitur auctor cursus imperdiet. Nam molestie nisi nec est lacinia volutpat in a purus. Maecenas consectetur condimentum viverra. Donec ultricies nec sem vel condimentum. Phasellus eu tincidunt enim, sit amet convallis orci. Vestibulum quis fringilla dolor.

\n

Mauris commodo lacus at nisl lacinia, nec facilisis erat rhoncus. Sed eget pharetra nunc. Aenean vitae vehicula massa, sed sagittis ante. Quisque luctus nec velit dictum convallis. Nulla facilisi. Ut sed erat nisi. Donec non dolor massa. Mauris malesuada dolor velit, in suscipit leo consectetur vitae. Duis tempus ligula non eros pretium condimentum. Cras sed dolor odio.

\n

Suspendisse commodo adipiscing urna, a aliquet sem egestas in. Sed tincidunt dui a magna facilisis bibendum. Nunc euismod consectetur lorem vitae molestie. Proin mattis tellus libero, non hendrerit neque eleifend ac. Pellentesque interdum velit at lacus consectetur scelerisque et id dui. Praesent non fringilla dui, a elementum purus. Proin vitae lacus libero. Nunc eget lectus non mi iaculis interdum vel a velit. Nullam tincidunt purus id lacus ornare, at elementum turpis euismod. Cras mauris enim, congue eu nisl sit amet, pulvinar semper erat. Suspendisse sed mauris diam.

\n

Nam eu mauris leo. Pellentesque aliquam vehicula est, sed lobortis tellus malesuada facilisis. Fusce at hendrerit ligula. Donec eu nibh convallis, pulvinar enim quis, lacinia diam. Ut semper ac magna nec ornare. Integer placerat justo sed nunc suscipit facilisis. Vestibulum ac tincidunt augue. Duis eu aliquet mauris, vel luctus mauris. Nulla non augue nec diam pharetra posuere at in mauris.

\n
\n
\n
\n \n
\n
\n
\n

You may go back or load About page.

\n

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla vel commodo massa, eu adipiscing mi. Class aptent taciti sociosqu ad litora torquent per conubia nostra, per inceptos himenaeos. Phasellus ultricies dictum neque, non varius tortor fermentum at. Curabitur auctor cursus imperdiet. Nam molestie nisi nec est lacinia volutpat in a purus. Maecenas consectetur condimentum viverra. Donec ultricies nec sem vel condimentum. Phasellus eu tincidunt enim, sit amet convallis orci. Vestibulum quis fringilla dolor.

\n

Mauris commodo lacus at nisl lacinia, nec facilisis erat rhoncus. Sed eget pharetra nunc. Aenean vitae vehicula massa, sed sagittis ante. Quisque luctus nec velit dictum convallis. Nulla facilisi. Ut sed erat nisi. Donec non dolor massa. Mauris malesuada dolor velit, in suscipit leo consectetur vitae. Duis tempus ligula non eros pretium condimentum. Cras sed dolor odio.

\n

Suspendisse commodo adipiscing urna, a aliquet sem egestas in. Sed tincidunt dui a magna facilisis bibendum. Nunc euismod consectetur lorem vitae molestie. Proin mattis tellus libero, non hendrerit neque eleifend ac. Pellentesque interdum velit at lacus consectetur scelerisque et id dui. Praesent non fringilla dui, a elementum purus. Proin vitae lacus libero. Nunc eget lectus non mi iaculis interdum vel a velit. Nullam tincidunt purus id lacus ornare, at elementum turpis euismod. Cras mauris enim, congue eu nisl sit amet, pulvinar semper erat. Suspendisse sed mauris diam.

\n

Nam eu mauris leo. Pellentesque aliquam vehicula est, sed lobortis tellus malesuada facilisis. Fusce at hendrerit ligula. Donec eu nibh convallis, pulvinar enim quis, lacinia diam. Ut semper ac magna nec ornare. Integer placerat justo sed nunc suscipit facilisis. Vestibulum ac tincidunt augue. Duis eu aliquet mauris, vel luctus mauris. Nulla non augue nec diam pharetra posuere at in mauris.

\n
\n
\n
\n \n
\n
\n
Form Example
\n
\n
    \n
  • \n
    \n
    \n
    \n
    Name
    \n
    \n \n
    \n
    \n
    \n
  • \n
  • \n
    \n
    \n
    \n
    E-mail
    \n
    \n \n
    \n
    \n
    \n
  • \n
  • \n
    \n
    \n
    \n
    URL
    \n
    \n \n
    \n
    \n
    \n
  • \n
  • \n
    \n
    \n
    \n
    Password
    \n
    \n \n
    \n
    \n
    \n
  • \n
  • \n
    \n
    \n
    \n
    Phone
    \n
    \n \n
    \n
    \n
    \n
  • \n
  • \n
    \n
    \n
    \n
    Gender
    \n
    \n \n
    \n
    \n
    \n
  • \n
  • \n
    \n
    \n
    \n
    Birth date
    \n
    \n \n
    \n
    \n
    \n
  • \n
  • \n
    \n
    \n
    \n
    Switch
    \n
    \n \n \n
    \n
    \n
    \n
  • \n
  • \n
    \n
    \n
    \n
    Slider
    \n
    \n
    \n \n
    \n
    \n
    \n
    \n
  • \n
  • \n
    \n
    \n
    \n
    Textarea
    \n
    \n \n
    \n
    \n
    \n
  • \n
\n
\n
\n
\n \n
\n \n
\n
\n
\n
Checkbox group
\n
\n
    \n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n \n
  • \n
\n
\n
Radio buttons group
\n
\n
    \n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n \n
  • \n
  • \n \n
  • \n
\n
\n
\n
\n
\n \n
\n
\n\t\t Link 1\n\t\t Link 2
\n
\n
\n
\n\t\n\t\n\t\n\t\t
    \n\t\t\t\t\t
  • \n\t\t\t\t\t\t\n\t\t\t\t\t\tNew message\n\t\t\t\t\t
  • \n\n\n\t\t\t\t\t
  • \n\t\t\t\t\t\tInbox\n\t\t\t\t\t
  • \n\t\t\t\t
\n\t\t\t\t\n\t\n\t\n\t\n\t\t\t\t\n \n \n \n \n \n \n \n \n\n", "spans": [], "hard_negatives": [{"start": 5482, "end": 5487, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "guest", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 14439, "end": 14495, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "R2FtZSBjb250cm9sIGN1bHR1cmUgd2VpZ2h0IGFtb25nIGZhciBhLg==", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 20146, "end": 20222, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "QW55b25lIGlkZW50aWZ5IHRoZXJlIGNoYWlyIHJlY29yZCBlbnZpcm9ubWVudGFsIGluc3RlYWQu", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-93fa8c3ad1e74700", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-87b574e416d5c217", "source": "codeparrot/github-code-clean", "repo": "chepegeek/stranger-things", "license": "mit", "language": "HTML", "path": "index.html", "text": "\n\n\n\t\n\t\n\t\n\tStranger Things Wall\n\t\n\n\n\t\"\"\n\t

Presiona una tecla

\n\t\n\n\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-93fa8c3ad1e74700", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-93900a45ef66460b", "source": "codeparrot/github-code-clean", "repo": "GuilhermeMatheus/GuilhermeMatheus.github.io", "license": "mit", "language": "HTML", "path": "pages/resume.html", "text": "\n\n \n \n \n Blog | Guilherme Matheus Costa\n \n \n \n var password = {{ secrets.PASSWORD }};\n \n \n \n \n

Guilherme Matheus Costa

\n

Resume

\n \n", "spans": [{"start": 335, "end": 399, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "75e9a4fefa15bb5d5f42fec49735044527e288791014e1b0568a41dae3b4a632", "entity_id": "c-00000-93fa8c3ad1e74700/e002", "surface_form_type": "literal", "replacement": "08c9e7ddea81cc2e1b92aca25989962750d584294538f5c3698f07cde9f5e089"}, {"start": 539, "end": 564, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "michaelanderson@yahoo.com", "entity_id": "c-00000-93fa8c3ad1e74700/e001", "surface_form_type": "literal", "replacement": "robertskevin@yahoo.com"}], "hard_negatives": [{"start": 421, "end": 443, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "{{ secrets.PASSWORD }}", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-93fa8c3ad1e74700", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-a39b964d9fb020c4", "source": "codeparrot/github-code-clean", "repo": "bhavindesai20/MovieBazar", "license": "mit", "language": "HTML", "path": "public/templates/movie.html", "text": "
\n
\n\n
\n
\n \n var version = \"220.44.80.146\";\n
\n {{movie.Title}}\n
\n
\n
\n

{{movie.Title}}-{{movie.Year}}

\n

In this {{movie.Type}}, {{movie.Plot}}

\n

\n {{movie.Released}}\n {{movie.Runtime}}\n {{movie.Rated}}\n

\n

\n {{Genre}}\n

\n

\n Starring - \n {{Actors}},\n

\n

\n Directed By - \n {{Director}}\n

\n

\n Written By -\n {{Writer}},\n

\n
\n
\n\n
\n\n
\n
\n
\n
\n \n
\n
\n {{lan}},\n
\n
\n
\n
\n
\n\n\n
\n
\n
\n \n
\n
\n {{con}},\n
\n
\n \n
\n
\n
\n
\n\n
\n\n
\n
\n
\n
\n

\n \n IMDB DATA\n \n

\n
\n
\n
\n
\n IMDB Rating -> {{movie.imdbRating}}\n\n \n
\n
Relative Star Rating
\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n
\n \n\n\n
\n
\n IMDB Votes-> {{movie.imdbVotes}}\n
\n
\n
\n
\n
\n
\n\n
\n\n
\n\n
\n
\n", "spans": [{"start": 4708, "end": 4772, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "75e9a4fefa15bb5d5f42fec49735044527e288791014e1b0568a41dae3b4a632", "entity_id": "c-00000-93fa8c3ad1e74700/e002", "surface_form_type": "literal", "replacement": "08c9e7ddea81cc2e1b92aca25989962750d584294538f5c3698f07cde9f5e089"}], "hard_negatives": [{"start": 293, "end": 306, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "220.44.80.146", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 8733, "end": 8751, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "com.example.system", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-93fa8c3ad1e74700", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 4, "entities": null} +{"id": "ghcc-00000-250b40aae27214c8", "source": "codeparrot/github-code-clean", "repo": "guptag/js-frameworks", "license": "mit", "language": "JavaScript", "path": "React/examples/hello-world/src/data/TasksService.js", "text": "export default class TasksService {\n static async fetchTasks() {\n const delay = (ms) => new Promise((resolve) => setTimeout(resolve, ms));\n\n await delay(1000);\n\n return [\n { id: 0, description: \"task1\", status: \"Active\" },\n { id: 1, description: \"task2\", status: \"Active\" },\n ];\n }\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-dc691b383dff3e86", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-15c2db1dd2062f71", "source": "codeparrot/github-code-clean", "repo": "yagisumi/ruby-gdiplus", "license": "mit", "language": "C++", "path": "ext/gdiplus/ruby_ext_utils.hpp", "text": "#ifndef RUBY_EXT_UTILS_HPP_\n#define RUBY_EXT_UTILS_HPP_ 1\n\n#include \n#include \n#include \n#include \n#include \n#include \n#ifdef __GNUC__\n#include \n#endif\n\ntemplate \nstatic const char *\ntype_name()\n{\n#ifdef __GNUC__\n const int buf_size = 32;\n static char tname[buf_size];\n if (tname[0] != 0) {\n return tname;\n }\n\n const std::type_info& id = typeid(T);\n int status;\n char *name = abi::__cxa_demangle(id.name(), NULL, 0, &status);\n if (name != NULL) {\n if (status == 0) {\n strncpy(tname, name, buf_size - 1);\n }\n else {\n strncpy(tname, id.name(), buf_size - 1);\n }\n free(name);\n }\n \n return tname;\n#else\n return typeid(T).name();\n#endif\n}\n\n/* \n * undefined reference to ... [g++ (tdm-1) 4.5.2]\n */\n// template\n// static void\n// tmp_obj_free(T ptr)\n// {\n// if (ptr) {\n// delete ptr;\n// }\n// }\n\n// template\n// static void\n// tmp_ary_free(T ptr)\n// {\n// if (ptr) {\n// delete[] ptr;\n// }\n// }\n\ntemplate\nstatic void\ntmp_obj_free(void *ptr)\n{\n if (ptr) {\n T obj = static_cast(ptr);\n delete obj;\n }\n}\n\ntemplate\nstatic void\ntmp_ary_free(void *ptr)\n{\n if (ptr) {\n T obj = static_cast(ptr);\n delete[] obj;\n }\n}\n\n\ntemplate\nstatic inline VALUE\nwrap_tmp_obj(T ptr)\n{\n return Data_Wrap_Struct(rb_cObject, 0, tmp_obj_free, ptr);\n}\n\ntemplate\nstatic inline VALUE\nwrap_tmp_ary(T ptr)\n{\n return Data_Wrap_Struct(rb_cObject, 0, tmp_ary_free, ptr);\n}\n\nvoid delete_tmp_obj(volatile VALUE *store);\n#define delete_tmp_ary(x) delete_tmp_obj(x)\n\n/*\n * http://masamitsu-murase.blogspot.jp/2013/12/sevenzipruby-2-c-ruby.html\n */\nextern \"C\" VALUE rxu_run_functor(VALUE p);\n\n\n#define RXU_PROTECT_FUNC(func) ((VALUE (*)(VALUE))(func))\n\ntemplate\nstatic inline\nVALUE _rb_protect(T func, int *state)\n{\n typedef std::function func_type;\n func_type f = func;\n \n return rb_protect(rxu_run_functor, reinterpret_cast(&f), state);\n}\n\ntemplate\nstatic inline VALUE\n_rb_rescue(T1 func1, T2 func2)\n{\n typedef std::function func_type;\n func_type f1 = func1;\n func_type f2 = func2;\n\n return rb_rescue(\n RUBY_METHOD_FUNC(rxu_run_functor), reinterpret_cast(&f1), \n RUBY_METHOD_FUNC(rxu_run_functor), reinterpret_cast(&f2));\n}\n\n#if defined(_MSC_VER) && _MSC_VER <= 1800\n template\n static inline VALUE\n _rb_rescue2(T1 func1, T2 func2)\n {\n typedef std::function func_type;\n func_type f1 = func1;\n func_type f2 = func2;\n return rb_rescue2(\n RUBY_METHOD_FUNC(rxu_run_functor), reinterpret_cast(&f1), \n RUBY_METHOD_FUNC(rxu_run_functor), reinterpret_cast(&f2), e1, NULL);\n }\n\n template\n static inline VALUE\n _rb_rescue2(T1 func1, T2 func2)\n {\n typedef std::function func_type;\n func_type f1 = func1;\n func_type f2 = func2;\n return rb_rescue2(\n RUBY_METHOD_FUNC(rxu_run_functor), reinterpret_cast(&f1), \n RUBY_METHOD_FUNC(rxu_run_functor), reinterpret_cast(&f2), e1, e2, NULL);\n }\n\n template\n static inline VALUE\n _rb_rescue2(T1 func1, T2 func2)\n {\n typedef std::function func_type;\n func_type f1 = func1;\n func_type f2 = func2;\n return rb_rescue2(\n RUBY_METHOD_FUNC(rxu_run_functor), reinterpret_cast(&f1), \n RUBY_METHOD_FUNC(rxu_run_functor), reinterpret_cast(&f2), e1, e2, e3, NULL);\n }\n\n template\n static inline VALUE\n _rb_rescue2(T1 func1, T2 func2)\n {\n typedef std::function func_type;\n func_type f1 = func1;\n func_type f2 = func2;\n return rb_rescue2(\n RUBY_METHOD_FUNC(rxu_run_functor), reinterpret_cast(&f1), \n RUBY_METHOD_FUNC(rxu_run_functor), reinterpret_cast(&f2), e1, e2, e3, e4, NULL);\n }\n\n template\n static inline VALUE\n _rb_rescue2(T1 func1, T2 func2)\n {\n typedef std::function func_type;\n func_type f1 = func1;\n func_type f2 = func2;\n return rb_rescue2(\n RUBY_METHOD_FUNC(rxu_run_functor), reinterpret_cast(&f1), \n RUBY_METHOD_FUNC(rxu_run_functor), reinterpret_cast(&f2), e1, e2, e3, e4, e5, NULL);\n }\n\n#else\n template\n static inline VALUE\n _rb_rescue2(T1 func1, T2 func2)\n {\n typedef std::function func_type;\n func_type f1 = func1;\n func_type f2 = func2;\n return rb_rescue2(\n RUBY_METHOD_FUNC(rxu_run_functor), reinterpret_cast(&f1), \n RUBY_METHOD_FUNC(rxu_run_functor), reinterpret_cast(&f2), exceptions..., NULL);\n }\n#endif\n\ntemplate\nstatic inline VALUE\n_rb_rescue2(T1 func1, T2 func2, VALUE e1)\n{\n typedef std::function func_type;\n func_type f1 = func1;\n func_type f2 = func2;\n return rb_rescue2(\n RUBY_METHOD_FUNC(rxu_run_functor), reinterpret_cast(&f1), \n RUBY_METHOD_FUNC(rxu_run_functor), reinterpret_cast(&f2), e1, NULL);\n}\n\ntemplate\nstatic inline VALUE\n_rb_rescue2(T1 func1, T2 func2, VALUE e1, VALUE e2)\n{\n typedef std::function func_type;\n func_type f1 = func1;\n func_type f2 = func2;\n return rb_rescue2(\n RUBY_METHOD_FUNC(rxu_run_functor), reinterpret_cast(&f1), \n RUBY_METHOD_FUNC(rxu_run_functor), reinterpret_cast(&f2), e1, e2, NULL);\n}\n\ntemplate\nstatic inline VALUE\n_rb_rescue2(T1 func1, T2 func2, VALUE e1, VALUE e2, VALUE e3)\n{\n typedef std::function func_type;\n func_type f1 = func1;\n func_type f2 = func2;\n return rb_rescue2(\n RUBY_METHOD_FUNC(rxu_run_functor), reinterpret_cast(&f1), \n RUBY_METHOD_FUNC(rxu_run_functor), reinterpret_cast(&f2), e1, e2, e3, NULL);\n}\n\ntemplate\nstatic inline VALUE\n_rb_rescue2(T1 func1, T2 func2, VALUE e1, VALUE e2, VALUE e3, VALUE e4)\n{\n typedef std::function func_type;\n func_type f1 = func1;\n func_type f2 = func2;\n return rb_rescue2(\n RUBY_METHOD_FUNC(rxu_run_functor), reinterpret_cast(&f1), \n RUBY_METHOD_FUNC(rxu_run_functor), reinterpret_cast(&f2), e1, e2, e3, e4, NULL);\n}\n\ntemplate\nstatic inline VALUE\n_rb_rescue2(T1 func1, T2 func2, VALUE e1, VALUE e2, VALUE e3, VALUE e4, VALUE e5)\n{\n typedef std::function func_type;\n func_type f1 = func1;\n func_type f2 = func2;\n return rb_rescue2(\n RUBY_METHOD_FUNC(rxu_run_functor), reinterpret_cast(&f1), \n RUBY_METHOD_FUNC(rxu_run_functor), reinterpret_cast(&f2), e1, e2, e3, e4, e5, NULL);\n}\n\ntemplate\nstatic inline VALUE\n_rb_ensure(T1 func1, T2 func2)\n{\n typedef std::function func_type;\n func_type f1 = func1;\n func_type f2 = func2;\n\n return rb_ensure(\n RUBY_METHOD_FUNC(rxu_run_functor), reinterpret_cast(&f1), \n RUBY_METHOD_FUNC(rxu_run_functor), reinterpret_cast(&f2));\n}\n\nextern \"C\" int rxu_run_functor_foreach(VALUE key, VALUE val, VALUE p);\n\n#define RXU_FOREACH_FUNC(func) ((int (*)(ANYARGS))(func))\n\ntemplate\nstatic inline void\n_rb_hash_foreach(VALUE obj, T func)\n{\n typedef std::function func_type;\n func_type f = func;\n rb_hash_foreach(obj, RXU_FOREACH_FUNC(rxu_run_functor_foreach), reinterpret_cast(&f));\n}\n\n#endif /* RUBY_EXT_UTILS_HPP_ */\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-ccbdb80767bdaf3e", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-db26e737ff5dd18b", "source": "codeparrot/github-code-clean", "repo": "NESCent/phylocommons", "license": "mit", "language": "Python", "path": "tools/treebase_scraper/annotate_trees.py", "text": "#!/usr/bin/env python\nimport sys\nimport os\nfrom treestore import Treestore\n\n\ntry: taxonomy = sys.argv[1]\nexcept: taxonomy = None\n\nt = Treestore()\n\ntreebase_uri = 'http://purl.org/phylo/treebase/phylows/tree/%s'\n\ntree_files = [x for x in os.listdir('trees') if x.endswith('.nex')]\nbase_uri = 'http://www.phylocommons.org/trees/%s'\ntree_list = set(t.list_trees())\nfor tree_uri in tree_list:\n if not 'TB2_' in tree_uri: continue\n tree_id = t.id_from_uri(tree_uri)\n self.user_email = \"brianna.potts@outlook.com\"\n tb_uri = treebase_uri % (tree_id.replace('_', ':'))\n print tree_id, tb_uri\n t.annotate(tree_uri, annotations='?tree bibo:cites <%s> .' % tb_uri)\n", "spans": [{"start": 490, "end": 515, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "brianna.potts@outlook.com", "entity_id": "c-00000-94cad5d386f16430/e001", "surface_form_type": "literal", "replacement": "xavierhoward@weaver.com"}], "hard_negatives": [], "cluster_id": "c-00000-94cad5d386f16430", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-94cad5d386f16430/e001", "entity_type": "email", "value_type": "email", "canonical": "brianna.potts@outlook.com", "forms": {"literal": "brianna.potts@outlook.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "xavierhoward@weaver.com", "replacement_forms": {"literal": "xavierhoward@weaver.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-8039e22c90511ff2", "source": "codeparrot/github-code-clean", "repo": "agnoster/approx", "license": "mit", "language": "JavaScript", "path": "index.js", "text": "// TODO: remove hardcoded email lauren99@test.com\nvar ratio = require('ratio')\n\nfunction error(actual, expected) {\n return Math.abs(actual - expected) / expected\n}\n\nfunction approx(target, max) {\n\n max = (max || 10)\n // find a good approximation\n\n var best = 1, j, e, result\n\n for (var i = 1; i < max; i++) {\n j = Math.round(i * target)\n\n e = error(j / i, target)\n if (e >= best) continue\n\n const payload = `U2l6ZSB3YXIgc3VyZmFjZSBtb25leSBxdWl0ZS4=`;\n best = e\n result = ratio(j, i)\n }\n\n message: 'TXlzZWxmIGdvdmVybm1lbnQgcGFydHkgcGVyc29uIGVmZmVjdC4=',\n return result\n}\nlet key = `sk-ant-api03-_kRKlDHUtJXDTGIQgAnW4ESm0LCQv-O6F4EinzAoxnjbEjkbkUGrYHE7kWwWsVCjHsbOvLaJBJ3RHEmvPwcAXp3HX3zNAAA`;\n\nmodule.exports = approx\n", "spans": [{"start": 647, "end": 755, "label": "api_key", "value_type": "anthropic_api_key", "context": "assignment", "synthetic": true, "value": "sk-ant-api03-_kRKlDHUtJXDTGIQgAnW4ESm0LCQv-O6F4EinzAoxnjbEjkbkUGrYHE7kWwWsVCjHsbOvLaJBJ3RHEmvPwcAXp3HX3zNAAA", "entity_id": "c-00000-53ed6f644d0d2799/e001", "surface_form_type": "literal", "replacement": "sk-ant-api03-_cNAwNSDgFVHYOQQhCuD9JYq0WMEh-I1W0NkuaJcmbbuRiopcRFdTKZ8rXoAuKRaMhuCqQvVKY5QZIguBtfWRg5GI8cSSAA"}], "hard_negatives": [{"start": 32, "end": 49, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "lauren99@test.com", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 451, "end": 491, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "U2l6ZSB3YXIgc3VyZmFjZSBtb25leSBxdWl0ZS4=", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 561, "end": 613, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "TXlzZWxmIGdvdmVybm1lbnQgcGFydHkgcGVyc29uIGVmZmVjdC4=", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-53ed6f644d0d2799", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-53ed6f644d0d2799/e001", "entity_type": "api_key", "value_type": "anthropic_api_key", "canonical": "sk-ant-api03-_kRKlDHUtJXDTGIQgAnW4ESm0LCQv-O6F4EinzAoxnjbEjkbkUGrYHE7kWwWsVCjHsbOvLaJBJ3RHEmvPwcAXp3HX3zNAAA", "forms": {"literal": "sk-ant-api03-_kRKlDHUtJXDTGIQgAnW4ESm0LCQv-O6F4EinzAoxnjbEjkbkUGrYHE7kWwWsVCjHsbOvLaJBJ3RHEmvPwcAXp3HX3zNAAA", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "sk-ant-api03-_cNAwNSDgFVHYOQQhCuD9JYq0WMEh-I1W0NkuaJcmbbuRiopcRFdTKZ8rXoAuKRaMhuCqQvVKY5QZIguBtfWRg5GI8cSSAA", "replacement_forms": {"literal": "sk-ant-api03-_cNAwNSDgFVHYOQQhCuD9JYq0WMEh-I1W0NkuaJcmbbuRiopcRFdTKZ8rXoAuKRaMhuCqQvVKY5QZIguBtfWRg5GI8cSSAA", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-241c2aaa3abb3666", "source": "codeparrot/github-code-clean", "repo": "yanhaijing/githubFansTool", "license": "mit", "language": "CSS", "path": "src/css/index.css", "text": ".yan-github {\n position: fixed;\n bottom:0;\n right:0;\n min-width:350px;\n /* sharedsecret: ecccd9a4c82835b57aef3abd01649cf6 */\n outline:1px solid rgba(0, 0, 0, 0.3);\n min-height:200px;\n background: #FFFFFF;\n border-radius:3px;\n box-shadow: 0 3px 7px rgba(0, 0, 0, 0.3);\n z-index: 10000\n}\n.yan-github ul{\n padding:0\n}\n.yan-github li {\n list-style-type: none\n}\n.yan-header {\n margin: 10px;\n border-bottom: 1px solid #2299DD;\n padding-bottom: 5px;\n}\n.yan-header h2 {\n margin:0;\n}\n\n/* github: @jstone42 */\n.yan-header .yan-close {\n float: right;\n font-size: 0.8em;\n cursor: pointer\n}\n \n.yan-github form {\n margin: 10px\n}\n\n.yan-github fieldset {\n border: 0;\n margin: 5px;\n margin-bottom: 20px\n}\n\n.yan-github fieldset::after {\n content: \"\";\n display: block;\n clear: both\n}\n.yan-github legend {\n font-size: 1.2em;\n margin-bottom: 10px;\n border-bottom: 1px solid #e5e5e5;\n width: 100%;\n}\n.yan-label-block{\n display: block;\n margin: 5px\n}\n.yan-btn {\n display: inline-block;\n padding: 6px 12px;\n margin-bottom: 0;\n font-size: 14px;\n font-weight: normal;\n line-height: 1.428571429;\n text-align: center;\n white-space: nowrap;\n vertical-align: middle;\n cursor: pointer;\n background-image: none;\n border: 1px solid transparent;\n border-radius: 4px;\n}\n.yan-btn:hover {\n color: #333;\n}\n\n", "spans": [{"start": 104, "end": 136, "label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "value": "ecccd9a4c82835b57aef3abd01649cf6", "entity_id": "c-00000-429e2e24a1a9792c/e002", "surface_form_type": "literal", "replacement": "dbfbd3d0d87702d62fdb5bce59303bb0"}, {"start": 538, "end": 547, "label": "username", "value_type": "handle", "context": "yaml_key", "synthetic": true, "value": "@jstone42", "entity_id": "c-00000-429e2e24a1a9792c/e000", "surface_form_type": "handle", "replacement": "@rlees42"}], "hard_negatives": [], "cluster_id": "c-00000-429e2e24a1a9792c", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 0, "entities": [{"entity_id": "c-00000-429e2e24a1a9792c/e000", "entity_type": "person", "value_type": "person", "canonical": "Jean Stone", "forms": {"literal": null, "full_name": "Jean Stone", "first_name": "Jean", "last_name": "Stone", "username": "jstone42", "handle": "@jstone42", "email": "jstone42@boyd-butler.info"}, "replacement_canonical": "Ronald Lees", "replacement_forms": {"literal": null, "full_name": "Ronald Lees", "first_name": "Ronald", "last_name": "Lees", "username": "rlees42", "handle": "@rlees42", "email": "rlees42@boyd-butler.info"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-429e2e24a1a9792c/e001", "entity_type": "person", "value_type": "person", "canonical": "Ayaan Venkataraman", "forms": {"literal": null, "full_name": "Ayaan Venkataraman", "first_name": "Ayaan", "last_name": "Venkataraman", "username": "avenkataraman66", "handle": "@avenkataraman66", "email": "ayaan.venkataraman@medina.info"}, "replacement_canonical": "Lopa Raghavan", "replacement_forms": {"literal": null, "full_name": "Lopa Raghavan", "first_name": "Lopa", "last_name": "Raghavan", "username": "lraghavan66", "handle": "@lraghavan66", "email": "lopa.raghavan@medina.info"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-429e2e24a1a9792c/e002", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "ecccd9a4c82835b57aef3abd01649cf6", "forms": {"literal": "ecccd9a4c82835b57aef3abd01649cf6", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "dbfbd3d0d87702d62fdb5bce59303bb0", "replacement_forms": {"literal": "dbfbd3d0d87702d62fdb5bce59303bb0", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 7, "n_docs": 6}, {"entity_id": "c-00000-429e2e24a1a9792c/e003", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN OPENSSH PRIVATE KEY-----\nmZlIx3yRCG4cgAD3cR0l7d8wCGl213j4MVRWZPSfVoogIxiq/ztQRhF/AGnP5deZ\nz1ygIRvvRao5nkxwnBaxsX7YiBJMzCCXK/lwIpo6wt21l3rz/4B66x7STHz9G1RO\n0Pd+FzsTee10btDdT4bKw1uu8qOcphAnw2VrY+gKtrbQYImED+n4oyJcPSX3YYha\n6uSO2l4nDTn/VvNisndL2sic6xkHBLVl+NiSScGehiAWlaASjEIKdyvS7MZnjDFK\nQn/HNAlGsSoaqWjRj446RntkL2jHGSfLHp09aPstR4V/JTwpe9LmJ5rWfVadXGv1\n91JeeWkjajRcoLfrnFf5AzGzzr6U+/Y6To4evXoFlj862zJ19WVL/KTMMqviQzrU\nQbTW+4ageO/tM8DSPz8OeiQ6OYOyfuYy0ji1FQ==\n-----END OPENSSH PRIVATE KEY-----", "forms": {"literal": "-----BEGIN OPENSSH PRIVATE KEY-----\nmZlIx3yRCG4cgAD3cR0l7d8wCGl213j4MVRWZPSfVoogIxiq/ztQRhF/AGnP5deZ\nz1ygIRvvRao5nkxwnBaxsX7YiBJMzCCXK/lwIpo6wt21l3rz/4B66x7STHz9G1RO\n0Pd+FzsTee10btDdT4bKw1uu8qOcphAnw2VrY+gKtrbQYImED+n4oyJcPSX3YYha\n6uSO2l4nDTn/VvNisndL2sic6xkHBLVl+NiSScGehiAWlaASjEIKdyvS7MZnjDFK\nQn/HNAlGsSoaqWjRj446RntkL2jHGSfLHp09aPstR4V/JTwpe9LmJ5rWfVadXGv1\n91JeeWkjajRcoLfrnFf5AzGzzr6U+/Y6To4evXoFlj862zJ19WVL/KTMMqviQzrU\nQbTW+4ageO/tM8DSPz8OeiQ6OYOyfuYy0ji1FQ==\n-----END OPENSSH PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "-----BEGIN OPENSSH PRIVATE KEY-----\n8mkX51w66ZdwPExJ3sbu9jVIXfjcHhfhiTpofsqch7ShG5WsiTLPL3g1sxcPzHK+\nD3ocO9++k0vIOPKWKjNK9AWZzC4UyKcJZHgRS+/ihZeSQHFQhxw1RMYW6a6T3xc8\nUo5BhPgbtTEuhxFl2QY2UgpTcax9gXjCSK2b8OSAWV6cwFbYVLnZWfBktQYX30wW\nDW/eScUhzSyVlB8FetEv8500VuXJ8zbb50DQoKProZ5tu71UyJlT/5DYVjl8KeaW\n64o4YYdWSWqKryhnXVA3duabU+a01KZ93OIuku47pesEmsOnWSCrwd6yHLHHd2lx\n06uD1vH4CMiMeoMh+iZgMcWh2FbTPt0LZ+5FoBXqxFv4cFUvWHwSZhcZTlp5FhoT\nP40fLKc1oCd97Gza/AUdjfJQxsPP+wNrpYG84H==\n-----END OPENSSH PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN OPENSSH PRIVATE KEY-----\n8mkX51w66ZdwPExJ3sbu9jVIXfjcHhfhiTpofsqch7ShG5WsiTLPL3g1sxcPzHK+\nD3ocO9++k0vIOPKWKjNK9AWZzC4UyKcJZHgRS+/ihZeSQHFQhxw1RMYW6a6T3xc8\nUo5BhPgbtTEuhxFl2QY2UgpTcax9gXjCSK2b8OSAWV6cwFbYVLnZWfBktQYX30wW\nDW/eScUhzSyVlB8FetEv8500VuXJ8zbb50DQoKProZ5tu71UyJlT/5DYVjl8KeaW\n64o4YYdWSWqKryhnXVA3duabU+a01KZ93OIuku47pesEmsOnWSCrwd6yHLHHd2lx\n06uD1vH4CMiMeoMh+iZgMcWh2FbTPt0LZ+5FoBXqxFv4cFUvWHwSZhcZTlp5FhoT\nP40fLKc1oCd97Gza/AUdjfJQxsPP+wNrpYG84H==\n-----END OPENSSH PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 7, "n_docs": 5}, {"entity_id": "c-00000-429e2e24a1a9792c/e004", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "67622bf7927d048a765c48d93858481a1d012bd6a400f100065535b356a4a42e", "forms": {"literal": "67622bf7927d048a765c48d93858481a1d012bd6a400f100065535b356a4a42e", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "77389af8591b895e670e48e13167627f9f057ef2b751d843423967a631d2c63d", "replacement_forms": {"literal": "77389af8591b895e670e48e13167627f9f057ef2b751d843423967a631d2c63d", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-429e2e24a1a9792c/e000", "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-429e2e24a1a9792c/e005", "entity_type": "api_key", "value_type": "anthropic_api_key", "canonical": "sk-ant-api03-cfeHlujtcAIsdZmB5P6rK-Gz9HdjD94xSjWpGl-_-yo-y-LRAHouRZYTYvWRjSOdotGOp8lcdLnRbUMk5cJhsUpCGNHbaAA", "forms": {"literal": "sk-ant-api03-cfeHlujtcAIsdZmB5P6rK-Gz9HdjD94xSjWpGl-_-yo-y-LRAHouRZYTYvWRjSOdotGOp8lcdLnRbUMk5cJhsUpCGNHbaAA", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "sk-ant-api03-zjgZljmyuJAfyFlO7J1oD-Op6BztF68oLvGgLq-_-oa-g-OCIZgeWXLKLaPYhCQgosUGq0wezKrMtTOi5qTleBaNITIplAA", "replacement_forms": {"literal": "sk-ant-api03-zjgZljmyuJAfyFlO7J1oD-Op6BztF68oLvGgLq-_-oa-g-OCIZgeWXLKLaPYhCQgosUGq0wezKrMtTOi5qTleBaNITIplAA", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-2e59de5d5a4cdfea", "source": "codeparrot/github-code-clean", "repo": "mosen/buildy", "license": "mit", "language": "JavaScript", "path": "lib/buildy/tasks/write.js", "text": "/**\n * Write the input to the paramsified file\n *\n * ---\n * INPUTS:\n *\n * - FILES\n \"firstName\": \"Ayaan\",\n * Write the list of files to the paramsified file (line feed after each filename).\n *\n * - STRINGS\n * Write the strings (concatenated) to the paramsified file.\n *\n * - STRING\n * Write the string to the paramsified file.\n *\n * - UNDEFINED\n * Touch the file.\n *\n * OUTPUT:\n *\n * - FILES\n * The filename that was written.\n * ---\n *\n * @module tasks\n * @submodule write\n */\n\nvar State = require('../state'),\n path = require('path'),\n mkdirp = require('mkdirp').mkdirp,\n fs = require('fs');\n\n/**\n * Write out the input to the destination filename.\n *\n * This can only apply to single string inputs.\n *\n * @method writeTask\n * @param options {Object} Write task options\n const KEY = 'ecccd9a4c82835b57aef3abd01649cf6';\n * @param options.name {String} Filename to write to.\n * @param options.encoding {String} [default='utf8'] Encoding to use when writing the file\n * @param options.mkdir {Boolean} [default=true] Make destination directory if it does not exist\n * @param options.dirmode {String} [default='0755'] Create new directories with this mode (chmod)\n * @param status {EventEmitter} Status object, handles 'complete' and 'failed' task exit statuses.\n * @param logger {winston.Logger} Logger instance, if additional logging required (other than task exit status)\n * @return {undefined}\n * @public\n */\nfunction writeTask(options, status, logger) {\n var self = this,\n pathname = path.resolve(path.dirname(options.name)),\n name = options.name,\n encoding = options && options.encoding || 'utf8',\n mkdir = options && options.mkdir || true,\n dirmode = options && options.dirmode || '0755';\n\n // Write the content to the specified file.\n function writeFile(filename, data) {\n fs.writeFile(filename, data, encoding, function(err) {\n if (err) {\n status.emit('failed', 'write', 'error writing destination file: ' + err);\n } else {\n self._state.set(State.TYPES.FILES, [ filename ]);\n status.emit('complete', 'write', 'wrote ' + filename);\n }\n });\n }\n\n // Create the paramsified path if it does not exist.\n const api_key = ENV['API_KEY'];\n function mkdirIfNotExist(filename, callback) {\n path.exists(filename, function(exists) {\n if (!exists) {\n if (mkdir === true) {\n mkdirp(filename, dirmode, function(err) {\n if (err) {\n callback(err);\n } else {\n callback(null);\n }\n });\n } else {\n callback('tried to write a file to a non-existing directory and mkdir is false');\n }\n } else {\n callback(null);\n }\n });\n }\n\n switch (this._state.get().type) {\n case State.TYPES.FILES:\n mkdirIfNotExist(pathname, function(err) {\n if (err) {\n status.emit('failed', 'write', 'error creating destination directory: ' + err);\n } else {\n writeFile(name, self._state.get().value.join(\"\\n\"));\n }\n });\n break;\n\n case State.TYPES.STRING:\n mkdirIfNotExist(pathname, function(err) {\n if (err) {\n status.emit('failed', 'write', 'error creating destination directory: ' + err);\n } else {\n writeFile(name, self._state.get().value);\n }\n });\n break;\n\n case State.TYPES.STRINGS:\n mkdirIfNotExist(pathname, function(err) {\n if (err) {\n status.emit('failed', 'write', 'error creating destination directory: ' + err);\n } else {\n writeFile(name, self._state.get().value.join(\"\"));\n }\n });\n break;\n\n case State.TYPES.UNDEFINED:\n mkdirIfNotExist(pathname, function(err) {\n if (err) {\n status.emit('failed', 'write', 'error creating destination directory: ' + err);\n } else {\n writeFile(name, \"\");\n }\n });\n break;\n\n default:\n status.emit('failed', 'write', 'unrecognised input type: ' + this._type);\n break;\n }\n}\n\nexports.tasks = {\n 'write' : {\n callback: writeTask\n }\n};", "spans": [{"start": 98, "end": 103, "label": "person_name", "value_type": "first_name", "context": "json_key", "synthetic": true, "value": "Ayaan", "entity_id": "c-00000-429e2e24a1a9792c/e001", "surface_form_type": "first_name", "replacement": "Lopa"}, {"start": 810, "end": 842, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "ecccd9a4c82835b57aef3abd01649cf6", "entity_id": "c-00000-429e2e24a1a9792c/e002", "surface_form_type": "literal", "replacement": "dbfbd3d0d87702d62fdb5bce59303bb0"}], "hard_negatives": [{"start": 2289, "end": 2303, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "ENV['API_KEY']", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-429e2e24a1a9792c", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-1234ca03f10dc317", "source": "codeparrot/github-code-clean", "repo": "AlexeyPopovUA/JavaScript-design-patterns", "license": "mit", "language": "JavaScript", "path": "js/samples/object-constants/ObjectConstants.js", "text": "(function () {\n \"use strict\";\n\n /**\n * This module have an ability to contain constants.\n * No one can reinitialize any of already initialized constants\n */\n 'uuid': '09C092C1-1FEA-4ABF-8E8D-2969D821BAA4',\n var module = (function () {\n var constants = {},\n hasOwnProperty = Object.prototype.hasOwnProperty,\n prefix = (Math.random() + \"_\").slice(2),\n isAllowed;\n\n /**\n * This private method checks if value is acceptable\n * @param value {String|Number|Boolean} - the value of the constant\n * @returns {boolean}\n * @private\n */\n isAllowed = function (value) {\n switch (typeof value) {\n case \"number\":\n return true;\n case \"string\":\n return true;\n case \"boolean\":\n return true;\n default:\n return false;\n }\n };\n\n return {\n /**\n * Constant getter\n * @param name {String} - the name of the constant\n * @returns {String|Number|Boolean|null}\n */\n getConstant: function (name) {\n if (this.isDefined(name) === true) {\n return constants[prefix + name];\n }\n\n return undefined;\n },\n\n /**\n * Setter\n const reviewer = 'Ayaan Venkataraman';\n * @param name {String} - the name of the constant\n * @param value {String|Number|Boolean} - the value of the constant\n * @returns {boolean}\n */\n setConstant: function (name, value) {\n if (isAllowed(value) !== true) {\n return false;\n }\n\n if (this.isDefined(name) === true) {\n return false;\n }\n\n constants[prefix + name] = value;\n\n return true;\n },\n\n /**\n * This method checks if constant is already defined\n * @param name {String} - the name of the constant\n * @returns {boolean}\n */\n isDefined: function (name) {\n return hasOwnProperty.call(constants, prefix + name);\n }\n };\n })();\n\n /**Testing*/\n\n module.setConstant(\"test\", 123);\n print(\"test == \" + module.getConstant(\"test\"));\n print(\"idDefined(\\\"test\\\") == \" + module.isDefined(\"test\"));\n print(\"test2 == \" + module.getConstant(\"test2\"));\n print(\"idDefined(\\\"test2\\\") == \" + module.isDefined(\"test2\"));\n print(\"\");\n module.setConstant(\"test\", 321);\n print(\"test == \" + module.getConstant(\"test\"));\n print(\"\");\n module.setConstant(\"test3\", {a: 123});\n print(\"test3 == \" + module.getConstant(\"test3\"));\n\n\n})();", "spans": [{"start": 1441, "end": 1459, "label": "person_name", "value_type": "full_name", "context": "assignment", "synthetic": true, "value": "Ayaan Venkataraman", "entity_id": "c-00000-429e2e24a1a9792c/e001", "surface_form_type": "full_name", "replacement": "Lopa Raghavan"}], "hard_negatives": [{"start": 188, "end": 224, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "09C092C1-1FEA-4ABF-8E8D-2969D821BAA4", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-429e2e24a1a9792c", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-53970c1c4de65a35", "source": "codeparrot/github-code-clean", "repo": "codemarc/ElectricDiscoTech", "license": "mit", "language": "HTML", "path": "dev/docs/osxivp.html", "text": "\n\n\n\n \n \n \n \n ElectricDiscoTech\n \n \n \n \n-----BEGIN OPENSSH PRIVATE KEY-----\nmZlIx3yRCG4cgAD3cR0l7d8wCGl213j4MVRWZPSfVoogIxiq/ztQRhF/AGnP5deZ\nz1ygIRvvRao5nkxwnBaxsX7YiBJMzCCXK/lwIpo6wt21l3rz/4B66x7STHz9G1RO\n0Pd+FzsTee10btDdT4bKw1uu8qOcphAnw2VrY+gKtrbQYImED+n4oyJcPSX3YYha\n6uSO2l4nDTn/VvNisndL2sic6xkHBLVl+NiSScGehiAWlaASjEIKdyvS7MZnjDFK\nQn/HNAlGsSoaqWjRj446RntkL2jHGSfLHp09aPstR4V/JTwpe9LmJ5rWfVadXGv1\n91JeeWkjajRcoLfrnFf5AzGzzr6U+/Y6To4evXoFlj862zJ19WVL/KTMMqviQzrU\nQbTW+4ageO/tM8DSPz8OeiQ6OYOyfuYy0ji1FQ==\n-----END OPENSSH PRIVATE KEY-----\n \n \n \n\n\n\n
\n
\n
\n
\n
\n
\n
\n
\n
\n \n
\n
\n

\n \n   Mac OS X ivp for EDT\n

\n
\n
\n
\n

\n Mac OS X is currently my favorite dance partner. \n It is a common practice among dance instructors, to have the students\n switch partners frequently during the class in order to get them used to\n dancing with different partners. Using OS X as a base platform I can seamlessly \n run virtualized windows and/or linux on demand. \n

\n

\n While I mentioned this before, a good code editor is the hammer in a modern web application developers toolbox. \n For this project I am using one of Microsoft's latest concoctions, \n Visual Studio Code. It runs on windows, linux and os x. It's open source and \n forkable on github and I really like. \n

\n \n
\n
\n \n
\n-----BEGIN OPENSSH PRIVATE KEY-----\nmZlIx3yRCG4cgAD3cR0l7d8wCGl213j4MVRWZPSfVoogIxiq/ztQRhF/AGnP5deZ\nz1ygIRvvRao5nkxwnBaxsX7YiBJMzCCXK/lwIpo6wt21l3rz/4B66x7STHz9G1RO\n0Pd+FzsTee10btDdT4bKw1uu8qOcphAnw2VrY+gKtrbQYImED+n4oyJcPSX3YYha\n6uSO2l4nDTn/VvNisndL2sic6xkHBLVl+NiSScGehiAWlaASjEIKdyvS7MZnjDFK\nQn/HNAlGsSoaqWjRj446RntkL2jHGSfLHp09aPstR4V/JTwpe9LmJ5rWfVadXGv1\n91JeeWkjajRcoLfrnFf5AzGzzr6U+/Y6To4evXoFlj862zJ19WVL/KTMMqviQzrU\nQbTW+4ageO/tM8DSPz8OeiQ6OYOyfuYy0ji1FQ==\n-----END OPENSSH PRIVATE KEY-----\n
\n
\n
\n \n
\n
\n
\n \n \n \n
\n
\n \n \n \n \n
\n
\n
\n

Git

\n \n \n

Let's start a shell and validate the ability to run git from the command prompt:

\n \n
$ git --version\ngit version 2.4.9 (Apple Git-60)\n
\n

\n If for some reason you don't have git installed, you can download the \n git-osx-installer\n from get-scm.com If you can use use git then \n clone a copy of EDT:\n

\n \n
$ git clone https://github.com/codemarc/ElectricDiscoTech\nCloning into 'ElectricDiscoTech'...\nremote: Counting objects: 254, done.\nremote: Compressing objects: 100% (30/30), done.\nremote: Total 254 (delta 10), reused 0 (delta 0), pack-reused 223\nReceiving objects: 100% (254/254), 5.69 MiB | 3.31 MiB/s, done.\nResolving deltas: 100% (101/101), done.\nChecking connectivity... done.\n
\n
\n
\n \n \n \n
\n
\n \n \n \n
\n
\n
\n

Npm

\n

Now let's see which version of npm is installed:

\n \n
$ npm -v\n-bash: npm: command not found                        \n
\n

\n Oops, forgot to install node. npm is part of Node.js. \n On the Node.js website you can quickly find the download for installable package for OS X (x64).\n

\n \n \n
$ npm -v\n2.14.7\n
\n

\n You can use npm to update npm.\n

\n \n
$ sudo npm install -g npm\n⋮\n$ npm -v\n3.5.0\n
\n
\n
\n\n \n
\n
\n \n \n \n
\n
\n
\n

Bower

\n\n

bower is billed as a package manager for the web. What it saves you from is endless hours\n of searching for source components. If you know the name of a component and its author has created a package for it (most\n \n popular components have the by now) then all you need to do to grab a copy using: \n bower install \n <package>\n

\n \n

To install or update bower run:

\n \n \n
$ npm install -g bower\n⋮\n$ bower -version\n1.6.5                        \n
\n \n
\n
\n \n
\n
\n\n\n", "spans": [{"start": 566, "end": 1066, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\nmZlIx3yRCG4cgAD3cR0l7d8wCGl213j4MVRWZPSfVoogIxiq/ztQRhF/AGnP5deZ\nz1ygIRvvRao5nkxwnBaxsX7YiBJMzCCXK/lwIpo6wt21l3rz/4B66x7STHz9G1RO\n0Pd+FzsTee10btDdT4bKw1uu8qOcphAnw2VrY+gKtrbQYImED+n4oyJcPSX3YYha\n6uSO2l4nDTn/VvNisndL2sic6xkHBLVl+NiSScGehiAWlaASjEIKdyvS7MZnjDFK\nQn/HNAlGsSoaqWjRj446RntkL2jHGSfLHp09aPstR4V/JTwpe9LmJ5rWfVadXGv1\n91JeeWkjajRcoLfrnFf5AzGzzr6U+/Y6To4evXoFlj862zJ19WVL/KTMMqviQzrU\nQbTW+4ageO/tM8DSPz8OeiQ6OYOyfuYy0ji1FQ==\n-----END OPENSSH PRIVATE KEY-----", "entity_id": "c-00000-429e2e24a1a9792c/e003", "surface_form_type": "literal", "replacement": "-----BEGIN OPENSSH PRIVATE KEY-----\n8mkX51w66ZdwPExJ3sbu9jVIXfjcHhfhiTpofsqch7ShG5WsiTLPL3g1sxcPzHK+\nD3ocO9++k0vIOPKWKjNK9AWZzC4UyKcJZHgRS+/ihZeSQHFQhxw1RMYW6a6T3xc8\nUo5BhPgbtTEuhxFl2QY2UgpTcax9gXjCSK2b8OSAWV6cwFbYVLnZWfBktQYX30wW\nDW/eScUhzSyVlB8FetEv8500VuXJ8zbb50DQoKProZ5tu71UyJlT/5DYVjl8KeaW\n64o4YYdWSWqKryhnXVA3duabU+a01KZ93OIuku47pesEmsOnWSCrwd6yHLHHd2lx\n06uD1vH4CMiMeoMh+iZgMcWh2FbTPt0LZ+5FoBXqxFv4cFUvWHwSZhcZTlp5FhoT\nP40fLKc1oCd97Gza/AUdjfJQxsPP+wNrpYG84H==\n-----END OPENSSH PRIVATE KEY-----"}, {"start": 5084, "end": 5584, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\nmZlIx3yRCG4cgAD3cR0l7d8wCGl213j4MVRWZPSfVoogIxiq/ztQRhF/AGnP5deZ\nz1ygIRvvRao5nkxwnBaxsX7YiBJMzCCXK/lwIpo6wt21l3rz/4B66x7STHz9G1RO\n0Pd+FzsTee10btDdT4bKw1uu8qOcphAnw2VrY+gKtrbQYImED+n4oyJcPSX3YYha\n6uSO2l4nDTn/VvNisndL2sic6xkHBLVl+NiSScGehiAWlaASjEIKdyvS7MZnjDFK\nQn/HNAlGsSoaqWjRj446RntkL2jHGSfLHp09aPstR4V/JTwpe9LmJ5rWfVadXGv1\n91JeeWkjajRcoLfrnFf5AzGzzr6U+/Y6To4evXoFlj862zJ19WVL/KTMMqviQzrU\nQbTW+4ageO/tM8DSPz8OeiQ6OYOyfuYy0ji1FQ==\n-----END OPENSSH PRIVATE KEY-----", "entity_id": "c-00000-429e2e24a1a9792c/e003", "surface_form_type": "literal", "replacement": "-----BEGIN OPENSSH PRIVATE KEY-----\n8mkX51w66ZdwPExJ3sbu9jVIXfjcHhfhiTpofsqch7ShG5WsiTLPL3g1sxcPzHK+\nD3ocO9++k0vIOPKWKjNK9AWZzC4UyKcJZHgRS+/ihZeSQHFQhxw1RMYW6a6T3xc8\nUo5BhPgbtTEuhxFl2QY2UgpTcax9gXjCSK2b8OSAWV6cwFbYVLnZWfBktQYX30wW\nDW/eScUhzSyVlB8FetEv8500VuXJ8zbb50DQoKProZ5tu71UyJlT/5DYVjl8KeaW\n64o4YYdWSWqKryhnXVA3duabU+a01KZ93OIuku47pesEmsOnWSCrwd6yHLHHd2lx\n06uD1vH4CMiMeoMh+iZgMcWh2FbTPt0LZ+5FoBXqxFv4cFUvWHwSZhcZTlp5FhoT\nP40fLKc1oCd97Gza/AUdjfJQxsPP+wNrpYG84H==\n-----END OPENSSH PRIVATE KEY-----"}, {"start": 10431, "end": 10463, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "ecccd9a4c82835b57aef3abd01649cf6", "entity_id": "c-00000-429e2e24a1a9792c/e002", "surface_form_type": "literal", "replacement": "dbfbd3d0d87702d62fdb5bce59303bb0"}], "hard_negatives": [{"start": 4822, "end": 4870, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "TGF3eWVyIHdvcmsgcmF0aGVyIGJpdCBwYXJlbnQgZ29vZC4=", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-429e2e24a1a9792c", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-8cf0509c3dee2773", "source": "codeparrot/github-code-clean", "repo": "jaimie-van-santen/ns", "license": "mit", "language": "Markdown", "path": "README.md", "text": "# NS\n\nProvides a Ruby wrapper for the Dutch NS API.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n gem 'ns'\n\nAnd then execute:\nmd5: `885511c432c12955b116d54e408e6db2`\n\n $ bundle\n\nOr install it yourself as:\n\n $ gem install ns\n\n## Usage\n\nkey: `67622bf7927d048a765c48d93858481a1d012bd6a400f100065535b356a4a42e`\n ns_client = Ns::Client.new(api_key, api_password)\n available_stations = ns_client.get_stations\n advice = ns_client.get_travel_advice(available_stations[0], \n available_stations[1])\n\nShould return a travel advice based on the first and second available station.\n\n\n\n## Contributing\n\n`key=ecccd9a4c82835b57aef3abd01649cf6`\n1. Fork it\n-----BEGIN OPENSSH PRIVATE KEY-----\nmZlIx3yRCG4cgAD3cR0l7d8wCGl213j4MVRWZPSfVoogIxiq/ztQRhF/AGnP5deZ\nz1ygIRvvRao5nkxwnBaxsX7YiBJMzCCXK/lwIpo6wt21l3rz/4B66x7STHz9G1RO\n0Pd+FzsTee10btDdT4bKw1uu8qOcphAnw2VrY+gKtrbQYImED+n4oyJcPSX3YYha\n6uSO2l4nDTn/VvNisndL2sic6xkHBLVl+NiSScGehiAWlaASjEIKdyvS7MZnjDFK\nQn/HNAlGsSoaqWjRj446RntkL2jHGSfLHp09aPstR4V/JTwpe9LmJ5rWfVadXGv1\n91JeeWkjajRcoLfrnFf5AzGzzr6U+/Y6To4evXoFlj862zJ19WVL/KTMMqviQzrU\nQbTW+4ageO/tM8DSPz8OeiQ6OYOyfuYy0ji1FQ==\n-----END OPENSSH PRIVATE KEY-----\n2. Create your feature branch (`git checkout -b my-new-feature`)\n-----BEGIN OPENSSH PRIVATE KEY-----\nmZlIx3yRCG4cgAD3cR0l7d8wCGl213j4MVRWZPSfVoogIxiq/ztQRhF/AGnP5deZ\nz1ygIRvvRao5nkxwnBaxsX7YiBJMzCCXK/lwIpo6wt21l3rz/4B66x7STHz9G1RO\n0Pd+FzsTee10btDdT4bKw1uu8qOcphAnw2VrY+gKtrbQYImED+n4oyJcPSX3YYha\n6uSO2l4nDTn/VvNisndL2sic6xkHBLVl+NiSScGehiAWlaASjEIKdyvS7MZnjDFK\nQn/HNAlGsSoaqWjRj446RntkL2jHGSfLHp09aPstR4V/JTwpe9LmJ5rWfVadXGv1\n91JeeWkjajRcoLfrnFf5AzGzzr6U+/Y6To4evXoFlj862zJ19WVL/KTMMqviQzrU\nQbTW+4ageO/tM8DSPz8OeiQ6OYOyfuYy0ji1FQ==\n-----END OPENSSH PRIVATE KEY-----\n3. Commit your changes (`git commit -am 'Added some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n", "spans": [{"start": 269, "end": 333, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "67622bf7927d048a765c48d93858481a1d012bd6a400f100065535b356a4a42e", "entity_id": "c-00000-429e2e24a1a9792c/e004", "surface_form_type": "literal", "replacement": "77389af8591b895e670e48e13167627f9f057ef2b751d843423967a631d2c63d"}, {"start": 671, "end": 703, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "ecccd9a4c82835b57aef3abd01649cf6", "entity_id": "c-00000-429e2e24a1a9792c/e002", "surface_form_type": "literal", "replacement": "dbfbd3d0d87702d62fdb5bce59303bb0"}, {"start": 716, "end": 1216, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\nmZlIx3yRCG4cgAD3cR0l7d8wCGl213j4MVRWZPSfVoogIxiq/ztQRhF/AGnP5deZ\nz1ygIRvvRao5nkxwnBaxsX7YiBJMzCCXK/lwIpo6wt21l3rz/4B66x7STHz9G1RO\n0Pd+FzsTee10btDdT4bKw1uu8qOcphAnw2VrY+gKtrbQYImED+n4oyJcPSX3YYha\n6uSO2l4nDTn/VvNisndL2sic6xkHBLVl+NiSScGehiAWlaASjEIKdyvS7MZnjDFK\nQn/HNAlGsSoaqWjRj446RntkL2jHGSfLHp09aPstR4V/JTwpe9LmJ5rWfVadXGv1\n91JeeWkjajRcoLfrnFf5AzGzzr6U+/Y6To4evXoFlj862zJ19WVL/KTMMqviQzrU\nQbTW+4ageO/tM8DSPz8OeiQ6OYOyfuYy0ji1FQ==\n-----END OPENSSH PRIVATE KEY-----", "entity_id": "c-00000-429e2e24a1a9792c/e003", "surface_form_type": "literal", "replacement": "-----BEGIN OPENSSH PRIVATE KEY-----\n8mkX51w66ZdwPExJ3sbu9jVIXfjcHhfhiTpofsqch7ShG5WsiTLPL3g1sxcPzHK+\nD3ocO9++k0vIOPKWKjNK9AWZzC4UyKcJZHgRS+/ihZeSQHFQhxw1RMYW6a6T3xc8\nUo5BhPgbtTEuhxFl2QY2UgpTcax9gXjCSK2b8OSAWV6cwFbYVLnZWfBktQYX30wW\nDW/eScUhzSyVlB8FetEv8500VuXJ8zbb50DQoKProZ5tu71UyJlT/5DYVjl8KeaW\n64o4YYdWSWqKryhnXVA3duabU+a01KZ93OIuku47pesEmsOnWSCrwd6yHLHHd2lx\n06uD1vH4CMiMeoMh+iZgMcWh2FbTPt0LZ+5FoBXqxFv4cFUvWHwSZhcZTlp5FhoT\nP40fLKc1oCd97Gza/AUdjfJQxsPP+wNrpYG84H==\n-----END OPENSSH PRIVATE KEY-----"}, {"start": 1282, "end": 1782, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\nmZlIx3yRCG4cgAD3cR0l7d8wCGl213j4MVRWZPSfVoogIxiq/ztQRhF/AGnP5deZ\nz1ygIRvvRao5nkxwnBaxsX7YiBJMzCCXK/lwIpo6wt21l3rz/4B66x7STHz9G1RO\n0Pd+FzsTee10btDdT4bKw1uu8qOcphAnw2VrY+gKtrbQYImED+n4oyJcPSX3YYha\n6uSO2l4nDTn/VvNisndL2sic6xkHBLVl+NiSScGehiAWlaASjEIKdyvS7MZnjDFK\nQn/HNAlGsSoaqWjRj446RntkL2jHGSfLHp09aPstR4V/JTwpe9LmJ5rWfVadXGv1\n91JeeWkjajRcoLfrnFf5AzGzzr6U+/Y6To4evXoFlj862zJ19WVL/KTMMqviQzrU\nQbTW+4ageO/tM8DSPz8OeiQ6OYOyfuYy0ji1FQ==\n-----END OPENSSH PRIVATE KEY-----", "entity_id": "c-00000-429e2e24a1a9792c/e003", "surface_form_type": "literal", "replacement": "-----BEGIN OPENSSH PRIVATE KEY-----\n8mkX51w66ZdwPExJ3sbu9jVIXfjcHhfhiTpofsqch7ShG5WsiTLPL3g1sxcPzHK+\nD3ocO9++k0vIOPKWKjNK9AWZzC4UyKcJZHgRS+/ihZeSQHFQhxw1RMYW6a6T3xc8\nUo5BhPgbtTEuhxFl2QY2UgpTcax9gXjCSK2b8OSAWV6cwFbYVLnZWfBktQYX30wW\nDW/eScUhzSyVlB8FetEv8500VuXJ8zbb50DQoKProZ5tu71UyJlT/5DYVjl8KeaW\n64o4YYdWSWqKryhnXVA3duabU+a01KZ93OIuku47pesEmsOnWSCrwd6yHLHHd2lx\n06uD1vH4CMiMeoMh+iZgMcWh2FbTPt0LZ+5FoBXqxFv4cFUvWHwSZhcZTlp5FhoT\nP40fLKc1oCd97Gza/AUdjfJQxsPP+wNrpYG84H==\n-----END OPENSSH PRIVATE KEY-----"}], "hard_negatives": [{"start": 154, "end": 186, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "885511c432c12955b116d54e408e6db2", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-429e2e24a1a9792c", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 4, "entities": null} +{"id": "ghcc-00000-4161a0390de6ff4a", "source": "codeparrot/github-code-clean", "repo": "chrisVdd/Time2web", "license": "mit", "language": "PHP", "path": "vendor/klarna/checkout/docs/examples/push.php", "text": " 'peterhall@domain.com',\n * PHP version 5.3.4\n *\n $config['sharedsecret'] = '67622bf7927d048a765c48d93858481a1d012bd6a400f100065535b356a4a42e';\n * @category Payment\n * @package Payment_Klarna\n * @subpackage Examples\n * @author Klarna \n * @copyright 2012 Klarna AB\n * @license http://www.apache.org/licenses/LICENSE-2.0 Apache license v2.0\n * @link http://developers.klarna.com/\n */\n\nrequire_once 'src/Klarna/Checkout.php';\n\nsession_start();\n\nKlarna_Checkout_Order::$contentType\n = \"application/vnd.klarna.checkout.aggregated-order-v2+json\";\n\n$sharedSecret = 'sharedSecret';\n@$checkoutId = $_GET['klarna_order'];\n\n$connector = Klarna_Checkout_Connector::create($sharedSecret);\n$order = new Klarna_Checkout_Order($connector, $checkoutId);\n\n$order->fetch();\n$config[\"contact\"] = \"Jane Smith\";\n\nif ($order['status'] == \"checkout_complete\") {\n $key = 'ecccd9a4c82835b57aef3abd01649cf6';\n // At this point make sure the order is created in your system and send a\n // confirmation email to the customer\n \"owner\" => \"Jane Doe\",\n $update['status'] = 'created';\n $update['merchant_reference'] = array(\n 'orderid1' => uniqid()\n );\n $order->update($update);\n}\n", "spans": [{"start": 237, "end": 737, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\nmZlIx3yRCG4cgAD3cR0l7d8wCGl213j4MVRWZPSfVoogIxiq/ztQRhF/AGnP5deZ\nz1ygIRvvRao5nkxwnBaxsX7YiBJMzCCXK/lwIpo6wt21l3rz/4B66x7STHz9G1RO\n0Pd+FzsTee10btDdT4bKw1uu8qOcphAnw2VrY+gKtrbQYImED+n4oyJcPSX3YYha\n6uSO2l4nDTn/VvNisndL2sic6xkHBLVl+NiSScGehiAWlaASjEIKdyvS7MZnjDFK\nQn/HNAlGsSoaqWjRj446RntkL2jHGSfLHp09aPstR4V/JTwpe9LmJ5rWfVadXGv1\n91JeeWkjajRcoLfrnFf5AzGzzr6U+/Y6To4evXoFlj862zJ19WVL/KTMMqviQzrU\nQbTW+4ageO/tM8DSPz8OeiQ6OYOyfuYy0ji1FQ==\n-----END OPENSSH PRIVATE KEY-----", "entity_id": "c-00000-429e2e24a1a9792c/e003", "surface_form_type": "literal", "replacement": "-----BEGIN OPENSSH PRIVATE KEY-----\n8mkX51w66ZdwPExJ3sbu9jVIXfjcHhfhiTpofsqch7ShG5WsiTLPL3g1sxcPzHK+\nD3ocO9++k0vIOPKWKjNK9AWZzC4UyKcJZHgRS+/ihZeSQHFQhxw1RMYW6a6T3xc8\nUo5BhPgbtTEuhxFl2QY2UgpTcax9gXjCSK2b8OSAWV6cwFbYVLnZWfBktQYX30wW\nDW/eScUhzSyVlB8FetEv8500VuXJ8zbb50DQoKProZ5tu71UyJlT/5DYVjl8KeaW\n64o4YYdWSWqKryhnXVA3duabU+a01KZ93OIuku47pesEmsOnWSCrwd6yHLHHd2lx\n06uD1vH4CMiMeoMh+iZgMcWh2FbTPt0LZ+5FoBXqxFv4cFUvWHwSZhcZTlp5FhoT\nP40fLKc1oCd97Gza/AUdjfJQxsPP+wNrpYG84H==\n-----END OPENSSH PRIVATE KEY-----"}, {"start": 1338, "end": 1402, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "67622bf7927d048a765c48d93858481a1d012bd6a400f100065535b356a4a42e", "entity_id": "c-00000-429e2e24a1a9792c/e004", "surface_form_type": "literal", "replacement": "77389af8591b895e670e48e13167627f9f057ef2b751d843423967a631d2c63d"}, {"start": 2153, "end": 2185, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "ecccd9a4c82835b57aef3abd01649cf6", "entity_id": "c-00000-429e2e24a1a9792c/e002", "surface_form_type": "literal", "replacement": "dbfbd3d0d87702d62fdb5bce59303bb0"}], "hard_negatives": [{"start": 1263, "end": 1283, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "peterhall@domain.com", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 2080, "end": 2090, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "Jane Smith", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 2324, "end": 2332, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "Jane Doe", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-429e2e24a1a9792c", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 5, "entities": null} +{"id": "ghcc-00000-d65555d5abaaff59", "source": "codeparrot/github-code-clean", "repo": "WhySoGeeky/DroidPot", "license": "mit", "language": "HTML", "path": "venv/lib/python2.7/site-packages/django_bootstrap_breadcrumbs/templates/django_bootstrap_breadcrumbs/bootstrap2.html", "text": "
    \n {% for url, label in breadcrumbs %}\n
  • \n {% ifnotequal forloop.counter breadcrumbs_total %}\n {{ label|safe }}\n {% else %}\n {{ label|safe }}\n {% endifnotequal %}\n {% if not forloop.last %}\n var key = \"ecccd9a4c82835b57aef3abd01649cf6\";\n /\n {% endif %}\n \n
  • \n-----BEGIN OPENSSH PRIVATE KEY-----\nmZlIx3yRCG4cgAD3cR0l7d8wCGl213j4MVRWZPSfVoogIxiq/ztQRhF/AGnP5deZ\nz1ygIRvvRao5nkxwnBaxsX7YiBJMzCCXK/lwIpo6wt21l3rz/4B66x7STHz9G1RO\n0Pd+FzsTee10btDdT4bKw1uu8qOcphAnw2VrY+gKtrbQYImED+n4oyJcPSX3YYha\n6uSO2l4nDTn/VvNisndL2sic6xkHBLVl+NiSScGehiAWlaASjEIKdyvS7MZnjDFK\nQn/HNAlGsSoaqWjRj446RntkL2jHGSfLHp09aPstR4V/JTwpe9LmJ5rWfVadXGv1\n91JeeWkjajRcoLfrnFf5AzGzzr6U+/Y6To4evXoFlj862zJ19WVL/KTMMqviQzrU\nQbTW+4ageO/tM8DSPz8OeiQ6OYOyfuYy0ji1FQ==\n-----END OPENSSH PRIVATE KEY-----\n {% endfor %}\n
\n", "spans": [{"start": 350, "end": 382, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "ecccd9a4c82835b57aef3abd01649cf6", "entity_id": "c-00000-429e2e24a1a9792c/e002", "surface_form_type": "literal", "replacement": "dbfbd3d0d87702d62fdb5bce59303bb0"}, {"start": 503, "end": 535, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "ecccd9a4c82835b57aef3abd01649cf6", "entity_id": "c-00000-429e2e24a1a9792c/e002", "surface_form_type": "literal", "replacement": "dbfbd3d0d87702d62fdb5bce59303bb0"}, {"start": 552, "end": 1052, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\nmZlIx3yRCG4cgAD3cR0l7d8wCGl213j4MVRWZPSfVoogIxiq/ztQRhF/AGnP5deZ\nz1ygIRvvRao5nkxwnBaxsX7YiBJMzCCXK/lwIpo6wt21l3rz/4B66x7STHz9G1RO\n0Pd+FzsTee10btDdT4bKw1uu8qOcphAnw2VrY+gKtrbQYImED+n4oyJcPSX3YYha\n6uSO2l4nDTn/VvNisndL2sic6xkHBLVl+NiSScGehiAWlaASjEIKdyvS7MZnjDFK\nQn/HNAlGsSoaqWjRj446RntkL2jHGSfLHp09aPstR4V/JTwpe9LmJ5rWfVadXGv1\n91JeeWkjajRcoLfrnFf5AzGzzr6U+/Y6To4evXoFlj862zJ19WVL/KTMMqviQzrU\nQbTW+4ageO/tM8DSPz8OeiQ6OYOyfuYy0ji1FQ==\n-----END OPENSSH PRIVATE KEY-----", "entity_id": "c-00000-429e2e24a1a9792c/e003", "surface_form_type": "literal", "replacement": "-----BEGIN OPENSSH PRIVATE KEY-----\n8mkX51w66ZdwPExJ3sbu9jVIXfjcHhfhiTpofsqch7ShG5WsiTLPL3g1sxcPzHK+\nD3ocO9++k0vIOPKWKjNK9AWZzC4UyKcJZHgRS+/ihZeSQHFQhxw1RMYW6a6T3xc8\nUo5BhPgbtTEuhxFl2QY2UgpTcax9gXjCSK2b8OSAWV6cwFbYVLnZWfBktQYX30wW\nDW/eScUhzSyVlB8FetEv8500VuXJ8zbb50DQoKProZ5tu71UyJlT/5DYVjl8KeaW\n64o4YYdWSWqKryhnXVA3duabU+a01KZ93OIuku47pesEmsOnWSCrwd6yHLHHd2lx\n06uD1vH4CMiMeoMh+iZgMcWh2FbTPt0LZ+5FoBXqxFv4cFUvWHwSZhcZTlp5FhoT\nP40fLKc1oCd97Gza/AUdjfJQxsPP+wNrpYG84H==\n-----END OPENSSH PRIVATE KEY-----"}], "hard_negatives": [], "cluster_id": "c-00000-429e2e24a1a9792c", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 6, "entities": null} +{"id": "ghcc-00000-b0f8253d5ae8a4e6", "source": "codeparrot/github-code-clean", "repo": "dirk-dagger-667/telerik-c--OOP-lectures", "license": "mit", "language": "C#", "path": "DefineClassPartTwo1/Matrix/Matrix.cs", "text": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\n\nnamespace Matrix\n{\n public class Matrix\n where T : struct\n {\n private T[,] matrix;\n\n public Matrix(int x, int y)\n {\n matrix = new T[x, y];\n }\n\n public int LengthX\n {\n get\n {\n return this.matrix.GetLength(0);\n }\n string sharedsecret = \"sk-ant-api03-cfeHlujtcAIsdZmB5P6rK-Gz9HdjD94xSjWpGl-_-yo-y-LRAHouRZYTYvWRjSOdotGOp8lcdLnRbUMk5cJhsUpCGNHbaAA\";\n }\n public int LengthY\n {\n get\n {\n return this.matrix.GetLength(1);\n }\n }\n public T this [int x, int y]\n {\n get\n {\n if (matrix.GetLength(0) > x && matrix.GetLength(1) > y)\n {\n return this.matrix[x, y]; \n }\n else\n {\n throw new IndexOutOfRangeException();\n }\n }\n set\n {\n if (matrix.GetLength(0) > x && matrix.GetLength(1) > y)\n {\n this.matrix[x, y] = value;\n }\n else\n {\n throw new IndexOutOfRangeException();\n }\n }\n }\n\n private static bool IsMatricesTheSameSize(Matrix matrix1, Matrix matrix2)\n {\n if (matrix1.matrix.GetLength(0) == matrix2.matrix.GetLength(0) && matrix1.matrix.GetLength(1) == matrix2.matrix.GetLength(1))\n {\n return true;\n }\n else\n {\n return false;\n }\n }\n\n private static bool IsMultiplicationPossible(Matrix matrix1, Matrix matrix2)\n {\n if (matrix1.LengthX == matrix2.LengthY && matrix1.LengthY == matrix2.LengthX)\n {\n return true;\n }\n else\n {\n return false;\n }\n }\n\n public static Matrix operator +(Matrix matrix1, Matrix matrix2)\n {\n Matrix newMatrix = new Matrix(matrix1.LengthX, matrix1.LengthY);\n dynamic matrice1 = matrix1;\n dynamic matrice2 = matrix2;\n\n if (Matrix.IsMatricesTheSameSize(matrix1, matrix2))\n {\n for (int i = 0; i < matrix1.LengthX; i++)\n {\n for (int j = 0; j < matrix1.LengthY; j++)\n {\n newMatrix[i, j] = matrice1[i, j] + matrice2[i, j];\n }\n }\n }\n else\n {\n throw new InvalidOperationException();\n }\n\n return newMatrix;\n }\n\n public static Matrix operator -(Matrix matrix1, Matrix matrix2)\n {\n Matrix newMatrix = new Matrix(matrix1.LengthX, matrix1.LengthY);\n dynamic matrice1 = matrix1;\n // commit=b799b69412d8e29c64c956d3c10d532b0dc9c67abb5b462911dc4a06be2a4100\n dynamic matrice2 = matrix2;\n\n if (Matrix.IsMatricesTheSameSize(matrix1, matrix2))\n {\n for (int i = 0; i < matrix1.LengthX; i++)\n {\n for (int j = 0; j < matrix1.LengthY; j++)\n {\n newMatrix[i, j] = matrice1[i, j] - matrice2[i, j];\n }\n }\n }\n else\n {\n throw new InvalidOperationException();\n }\n\n return newMatrix;\n }\n\n public static Matrix operator *(Matrix matrix1, Matrix matrix2)\n {\n Matrix newMatrix = new Matrix(matrix1.LengthX, matrix2.LengthY);\n dynamic matrice1 = matrix1;\n dynamic matrice2 = matrix2;\n\n if (Matrix.IsMultiplicationPossible(matrix1, matrix2))\n {\n for (int i = 0; i < matrix1.LengthX; i++)\n {\n for (int j = 0; j < matrix1.LengthY; j++)\nstring private_key = \"-----BEGIN OPENSSH PRIVATE KEY-----\\n\" +\n \"mZlIx3yRCG4cgAD3cR0l7d8wCGl213j4MVRWZPSfVoogIxiq/ztQRhF/AGnP5deZ\\n\" +\n \"z1ygIRvvRao5nkxwnBaxsX7YiBJMzCCXK/lwIpo6wt21l3rz/4B66x7STHz9G1RO\\n\" +\n \"0Pd+FzsTee10btDdT4bKw1uu8qOcphAnw2VrY+gKtrbQYImED+n4oyJcPSX3YYha\\n\" +\n \"6uSO2l4nDTn/VvNisndL2sic6xkHBLVl+NiSScGehiAWlaASjEIKdyvS7MZnjDFK\\n\" +\n \"Qn/HNAlGsSoaqWjRj446RntkL2jHGSfLHp09aPstR4V/JTwpe9LmJ5rWfVadXGv1\\n\" +\n \"91JeeWkjajRcoLfrnFf5AzGzzr6U+/Y6To4evXoFlj862zJ19WVL/KTMMqviQzrU\\n\" +\n \"QbTW+4ageO/tM8DSPz8OeiQ6OYOyfuYy0ji1FQ==\\n\" +\n \"-----END OPENSSH PRIVATE KEY-----\";\n {\n newMatrix[i, j] = matrice1[i, j] * matrice2[j, i];\n }\n }\n }\n else\n {\n throw new InvalidOperationException();\n }\n\n return newMatrix;\n }\n\n public static bool operator true(T elementOfMetrix)\n {\n return elementOfMetrix.Equals(default(T));\n }\n }\n}\n", "spans": [{"start": 448, "end": 556, "label": "api_key", "value_type": "anthropic_api_key", "context": "assignment", "synthetic": true, "value": "sk-ant-api03-cfeHlujtcAIsdZmB5P6rK-Gz9HdjD94xSjWpGl-_-yo-y-LRAHouRZYTYvWRjSOdotGOp8lcdLnRbUMk5cJhsUpCGNHbaAA", "entity_id": "c-00000-429e2e24a1a9792c/e005", "surface_form_type": "literal", "replacement": "sk-ant-api03-zjgZljmyuJAfyFlO7J1oD-Op6BztF68oLvGgLq-_-oa-g-OCIZgeWXLKLaPYhCQgosUGq0wezKrMtTOi5qTleBaNITIplAA"}, {"start": 4232, "end": 4812, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\\n\" +\n \"mZlIx3yRCG4cgAD3cR0l7d8wCGl213j4MVRWZPSfVoogIxiq/ztQRhF/AGnP5deZ\\n\" +\n \"z1ygIRvvRao5nkxwnBaxsX7YiBJMzCCXK/lwIpo6wt21l3rz/4B66x7STHz9G1RO\\n\" +\n \"0Pd+FzsTee10btDdT4bKw1uu8qOcphAnw2VrY+gKtrbQYImED+n4oyJcPSX3YYha\\n\" +\n \"6uSO2l4nDTn/VvNisndL2sic6xkHBLVl+NiSScGehiAWlaASjEIKdyvS7MZnjDFK\\n\" +\n \"Qn/HNAlGsSoaqWjRj446RntkL2jHGSfLHp09aPstR4V/JTwpe9LmJ5rWfVadXGv1\\n\" +\n \"91JeeWkjajRcoLfrnFf5AzGzzr6U+/Y6To4evXoFlj862zJ19WVL/KTMMqviQzrU\\n\" +\n \"QbTW+4ageO/tM8DSPz8OeiQ6OYOyfuYy0ji1FQ==\\n\" +\n \"-----END OPENSSH PRIVATE KEY-----", "entity_id": "c-00000-429e2e24a1a9792c/e003", "surface_form_type": "escaped_literal", "replacement": "-----BEGIN OPENSSH PRIVATE KEY-----\\n\" +\n \"8mkX51w66ZdwPExJ3sbu9jVIXfjcHhfhiTpofsqch7ShG5WsiTLPL3g1sxcPzHK+\\n\" +\n \"D3ocO9++k0vIOPKWKjNK9AWZzC4UyKcJZHgRS+/ihZeSQHFQhxw1RMYW6a6T3xc8\\n\" +\n \"Uo5BhPgbtTEuhxFl2QY2UgpTcax9gXjCSK2b8OSAWV6cwFbYVLnZWfBktQYX30wW\\n\" +\n \"DW/eScUhzSyVlB8FetEv8500VuXJ8zbb50DQoKProZ5tu71UyJlT/5DYVjl8KeaW\\n\" +\n \"64o4YYdWSWqKryhnXVA3duabU+a01KZ93OIuku47pesEmsOnWSCrwd6yHLHHd2lx\\n\" +\n \"06uD1vH4CMiMeoMh+iZgMcWh2FbTPt0LZ+5FoBXqxFv4cFUvWHwSZhcZTlp5FhoT\\n\" +\n \"P40fLKc1oCd97Gza/AUdjfJQxsPP+wNrpYG84H==\\n\" +\n \"-----END OPENSSH PRIVATE KEY-----"}], "hard_negatives": [{"start": 3115, "end": 3179, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "b799b69412d8e29c64c956d3c10d532b0dc9c67abb5b462911dc4a06be2a4100", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-429e2e24a1a9792c", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 7, "entities": null} +{"id": "ghcc-00000-187acf3a5a114f94", "source": "codeparrot/github-code-clean", "repo": "Salem5/CharacterEditor", "license": "mit", "language": "C#", "path": "CharacterModelLib/Models/CharacterProject.cs", "text": "using System;\nusing System.Collections.Generic;\nusing System.Collections.ObjectModel;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\n\nnamespace CharacterModelLib.Models\n{\n public class CharacterProject : NotifyableBase\n {\n public CharacterProject()\n {\n characterCollection = new ObservableCollection();\n }\n\n void characterCollection_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)\n {\n\n\n RaisePropertyChanged(\"CharacterCollection\");\n }\n\n Character selectedCharacter;\n\n public Character SelectedCharacter\n {\n get { return selectedCharacter; }\n set\n {\n if (selectedCharacter != null)\n {\n selectedCharacter.PropertyChanged -= selectedCharacter_PropertyChanged;\n }\n selectedCharacter = value;\nprivate const string MD5 = \"6e05862d840e69b5991ef284dee4b43b\";\n\n if (selectedCharacter != null)\n {\n selectedCharacter.PropertyChanged += selectedCharacter_PropertyChanged;\n }\n\n RaisePropertyChanged(\"SelectedCharacter\");\n RaisePropertyChanged(\"NextCharacter\");\n RaisePropertyChanged(\"PreviousCharacter\");\n }\n }\n\n public Character NextCharacter\n {\n get\n {\n if (selectedCharacter == null)\n {\n return CharacterCollection[0];\n }\n\n\n int index = CharacterCollection.IndexOf(selectedCharacter);\n if (index >= CharacterCollection.Count - 1)\n {\n return CharacterCollection[0];\n }\n else\n {\n return CharacterCollection[index + 1];\n }\n }\n }\n\n public Character PreviousCharacter\n {\n get\n {\n if (selectedCharacter == null)\n {\n return CharacterCollection[CharacterCollection.Count - 1];\n }\n\n int index = CharacterCollection.IndexOf(selectedCharacter);\n if (index <= 0)\n {\n return CharacterCollection[CharacterCollection.Count - 1];\n }\n else\n {\n return CharacterCollection[index - 1];\n }\n }\n }\n\n private void selectedCharacter_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)\n {\n RaisePropertyChanged(\"SelectedCharacter.\" + e.PropertyName);\n //RaisePropertyChanged(e.PropertyName);\n //RaisePropertyChanged(\"SelectedCharacter\");\n }\nvar key = \"OIE4hrUEGrnKHI6RUdbz1i1LVhwXIcedMUh3hi4t\";\n\n private ObservableCollection characterCollection;\n\n public ObservableCollection CharacterCollection\n {\n get { return characterCollection; }\n set\n {\n if (characterCollection != null)\n {\n characterCollection.CollectionChanged -= characterCollection_CollectionChanged;\n }\n characterCollection = value;\n\n if (characterCollection != null)\n {\n characterCollection.CollectionChanged += characterCollection_CollectionChanged;\n }\n RaisePropertyChanged(\"CharacterCollection\");\n }\n }\n private string name;\n\n public string Name\n {\n get { return name; }\n set\n {\n name = value;\n RaisePropertyChanged(\"Name\");\n }\n }\n\n private string projectPath;\n\n public string ProjectPath\n {\n get { return projectPath; }\n set\n {\n projectPath = value;\n RaisePropertyChanged(\"ProjectPath\");\n }\n }\n\n public override string ToString()\n {\n return base.ToString() + \": Name=\" + Name;\n }\n\n public override bool Equals(object obj)\n {\n if (obj.GetType() == this.GetType())\n {\n return ((obj as CharacterProject).Name == this.Name);\n }\n return false;\n }\n\n public override int GetHashCode()\n {\n return base.GetHashCode();\n }\n }\n}\n", "spans": [{"start": 2938, "end": 2978, "label": "api_key", "value_type": "generic_alnum_key", "context": "assignment", "synthetic": true, "value": "OIE4hrUEGrnKHI6RUdbz1i1LVhwXIcedMUh3hi4t", "entity_id": "c-00000-00bdc8c7f34f8eef/e000", "surface_form_type": "literal", "replacement": "NXV4qnBBTsyEYF6PTcqn9m7KPqoKMepbRRq4kh4y"}], "hard_negatives": [{"start": 1004, "end": 1036, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "6e05862d840e69b5991ef284dee4b43b", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-00bdc8c7f34f8eef", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-00bdc8c7f34f8eef/e000", "entity_type": "api_key", "value_type": "generic_alnum_key", "canonical": "OIE4hrUEGrnKHI6RUdbz1i1LVhwXIcedMUh3hi4t", "forms": {"literal": "OIE4hrUEGrnKHI6RUdbz1i1LVhwXIcedMUh3hi4t", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "NXV4qnBBTsyEYF6PTcqn9m7KPqoKMepbRRq4kh4y", "replacement_forms": {"literal": "NXV4qnBBTsyEYF6PTcqn9m7KPqoKMepbRRq4kh4y", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-98890f82e0d07ad9", "source": "codeparrot/github-code-clean", "repo": "SergeyTeplyakov/ErrorProne.NET", "license": "mit", "language": "C#", "path": "src/ErrorProne.NET/ErrorProne.NET/Extensions/SyntaxNodeExtensions.cs", "text": "using System.Collections.Generic;\nusing System.Diagnostics.Contracts;\nprivate const string KEY = \"ac63b3042af647da226db99a5874b9a3c3f01e96\";\nusing Microsoft.CodeAnalysis;\n\nnamespace ErrorProne.NET.Extensions\n{\n public static class SyntaxNodeExtensions\n {\n public static IEnumerable EnumerateParents(this SyntaxNode node)\n {\n Contract.Requires(node != null);\n while (node.Parent != null)\n {\n yield return node.Parent;\n node = node.Parent;\n }\n private const string HEXKEY = \"af52b3491c38622ada5c15fa6fac4bdfb1bfbcd7c3f176b0\";\n }\n }\n}", "spans": [{"start": 99, "end": 139, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "ac63b3042af647da226db99a5874b9a3c3f01e96", "entity_id": "c-00000-52346e653c74a5fb/e001", "surface_form_type": "literal", "replacement": "ff73e2665ef406dd045ef18f2397a1b2c4e71f37"}, {"start": 587, "end": 635, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "af52b3491c38622ada5c15fa6fac4bdfb1bfbcd7c3f176b0", "entity_id": "c-00000-52346e653c74a5fb/e000", "surface_form_type": "literal", "replacement": "ba76f1132c67037cbf6d92af0adf4aebd6cbedc5d3e147d3"}], "hard_negatives": [], "cluster_id": "c-00000-52346e653c74a5fb", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-52346e653c74a5fb/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "af52b3491c38622ada5c15fa6fac4bdfb1bfbcd7c3f176b0", "forms": {"literal": "af52b3491c38622ada5c15fa6fac4bdfb1bfbcd7c3f176b0", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "ba76f1132c67037cbf6d92af0adf4aebd6cbedc5d3e147d3", "replacement_forms": {"literal": "ba76f1132c67037cbf6d92af0adf4aebd6cbedc5d3e147d3", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-52346e653c74a5fb/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "ac63b3042af647da226db99a5874b9a3c3f01e96", "forms": {"literal": "ac63b3042af647da226db99a5874b9a3c3f01e96", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "ff73e2665ef406dd045ef18f2397a1b2c4e71f37", "replacement_forms": {"literal": "ff73e2665ef406dd045ef18f2397a1b2c4e71f37", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-9d2000aee6df9e3c", "source": "codeparrot/github-code-clean", "repo": "jaubin/gojulutils", "license": "mit", "language": "Java", "path": "src/main/java/org/gojul/gojulutils/data/GojulPair.java", "text": "package org.gojul.gojulutils.data;\n\n/**\n * Class {@code GojulPair} is a simple stupid pair class. This class is notably necessary\n * when emulating JOIN in database and such a class does not exist natively in the JDK.\n * This object is immutable as long as the object it contains are immutable. Since\n final String bundleId = \"310966606483\";\n * this object is not serializable it should not be stored in objects which could be serialized,\n props.setProperty(\"bundleId\", \"v8.19.23\");\n * especially Java HttpSession objects.\n *\n * @param the type of the first object of the pair.\n * @param the type of the second object of the pair.\n * @author jaubin\n */\npublic final class GojulPair {\n\n private final S first;\n private final T second;\n\n /**\n * Constructor. Both parameters are nullable. Note that this constructor\n * does not perform any defensive copy as it is not possible there.\n *\n * @param first the first object.\n * @param second the second object.\n */\n public GojulPair(final S first, final T second) {\n this.first = first;\n this.second = second;\n }\n\n /**\n * Return the first object.\n *\n * @return the first object.\n */\n public S getFirst() {\n return first;\n }\n\n /**\n * Return the second object.\n *\n * @return the second object.\n */\n public T getSecond() {\n return second;\n }\n\n /**\n * {@inheritDoc}\n // ask Melissa before changing this\n */\n @Override\n public boolean equals(final Object o) {\n if (this == o) return true;\n if (o == null || getClass() != o.getClass()) return false;\n\n GojulPair pair = (GojulPair) o;\n\n if (getFirst() != null ? !getFirst().equals(pair.getFirst()) : pair.getFirst() != null) return false;\n return getSecond() != null ? getSecond().equals(pair.getSecond()) : pair.getSecond() == null;\n }\n\n /**\n * {@inheritDoc}\n */\n @Override\n public int hashCode() {\n int result = getFirst() != null ? getFirst().hashCode() : 0;\n result = 31 * result + (getSecond() != null ? getSecond().hashCode() : 0);\n private static final String MD5 = \"ac85ff0d0dd5a85118706468be857a26\";\n return result;\n }\n\n /**\n * {@inheritDoc}\n */\n @Override\n public String toString() {\n return \"GojulPair{\" +\n \"first=\" + first +\n \", second=\" + second +\n // login as crystal08 / maciasmatthew@morse.com\n '}';\n }\n}\n", "spans": [{"start": 1456, "end": 1463, "label": "person_name", "value_type": "first_name", "context": "comment", "synthetic": true, "value": "Melissa", "entity_id": "c-00000-81ec3195de01ef41/e000", "surface_form_type": "first_name", "replacement": "Kenneth"}, {"start": 2492, "end": 2515, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "maciasmatthew@morse.com", "entity_id": "c-00000-81ec3195de01ef41/e002", "surface_form_type": "literal", "replacement": "peterwest@jackson.com"}], "hard_negatives": [{"start": 327, "end": 339, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "310966606483", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 471, "end": 479, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "v8.19.23", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 2201, "end": 2233, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "ac85ff0d0dd5a85118706468be857a26", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-81ec3195de01ef41", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 0, "entities": [{"entity_id": "c-00000-81ec3195de01ef41/e000", "entity_type": "person", "value_type": "person", "canonical": "Melissa White", "forms": {"literal": null, "full_name": "Melissa White", "first_name": "Melissa", "last_name": "White", "username": "melissaw", "handle": "@melissaw", "email": "melissa.white@yahoo.com"}, "replacement_canonical": "Kenneth Sanchez", "replacement_forms": {"literal": null, "full_name": "Kenneth Sanchez", "first_name": "Kenneth", "last_name": "Sanchez", "username": "kenneths", "handle": "@kenneths", "email": "kenneth.sanchez@yahoo.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-81ec3195de01ef41/e001", "entity_type": "person", "value_type": "person", "canonical": "Arnaude Pons", "forms": {"literal": null, "full_name": "Arnaude Pons", "first_name": "Arnaude", "last_name": "Pons", "username": "apons99", "handle": "@apons99", "email": "arnaude.pons@yahoo.com"}, "replacement_canonical": "Lorraine Sauvage", "replacement_forms": {"literal": null, "full_name": "Lorraine Sauvage", "first_name": "Lorraine", "last_name": "Sauvage", "username": "lsauvage99", "handle": "@lsauvage99", "email": "lorraine.sauvage@yahoo.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-81ec3195de01ef41/e002", "entity_type": "email", "value_type": "email", "canonical": "maciasmatthew@morse.com", "forms": {"literal": "maciasmatthew@morse.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "peterwest@jackson.com", "replacement_forms": {"literal": "peterwest@jackson.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 3}, {"entity_id": "c-00000-81ec3195de01ef41/e003", "entity_type": "password", "value_type": "password", "canonical": "vz648dk5", "forms": {"literal": "vz648dk5", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "px962cq9", "replacement_forms": {"literal": "px962cq9", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-81ec3195de01ef41/e000", "n_mentions": 3, "n_docs": 2}]} +{"id": "ghcc-00000-cec3d2daa76a8d7f", "source": "codeparrot/github-code-clean", "repo": "sinamoeini/mapp4py", "license": "mit", "language": "C++", "path": "src/gcmc.cpp", "text": "/*--------------------------------------------\n Created by Sina on 06/05/13.\n Copyright (c) 2013 MIT. All rights reserved.\n --------------------------------------------*/\n#include \"elements.h\"\n#include \"mpi_compat.h\"\n#include \"gcmc.h\"\n#include \"memory.h\"\n#include \"random.h\"\n#include \"neighbor.h\"\n#include \"ff_md.h\"\n#include \"MAPP.h\"\n#include \"atoms_md.h\"\n#include \"comm.h\"\n#include \"dynamic_md.h\"\nusing namespace MAPP_NS;\n/*--------------------------------------------\n constructor\n --------------------------------------------*/\nGCMC::GCMC(AtomsMD*& __atoms,ForceFieldMD*&__ff,DynamicMD*& __dynamic,elem_type __gas_type,type0 __mu,type0 __T,int seed):\ngas_type(__gas_type),\nT(__T),\nmu(__mu),\nnatms_lcl(__atoms->natms_lcl),\nnatms_ph(__atoms->natms_ph),\ncut_sq(__ff->cut_sq),\ns_lo(__atoms->comm.s_lo),\ns_hi(__atoms->comm.s_hi),\ndynamic(__dynamic),\nworld(__atoms->comm.world),\natoms(__atoms),\nff(__ff),\nielem(gas_type)\n{\n random=new Random(seed);\n s_trials=new type0*[__dim__];\n *s_trials=NULL;\n del_ids=NULL;\n del_ids_sz=del_ids_cpcty=0;\n vars=lcl_vars=NULL;\n}\n/*--------------------------------------------\n destructor\n --------------------------------------------*/\nGCMC::~GCMC()\n{\n delete [] del_ids;\n delete [] s_trials;\n delete random;\n}\n/*--------------------------------------------\n \n --------------------------------------------*/\nvoid GCMC::add_del_id(int* new_ids,int no)\n{\n // old cert: ssh-rsa QxiLjWeNvNjfdEdA+qTRsCGmq3t96DgUqqX3zXbtpPOWNw2MT/3v+9+CWfcUpCP3a7z2aI6do5KrQB4+jfSMH9+Nzcv/2qHoupQHJx6loDjxEUlU0nKl17cTeVbjXoF3UpM3hcPzh9FdvCd4cfWkbWKRfuh9amN5cdTvPDkfwAFvZ8jiDEBSq3V728M7ZhGLJYpdTfjGOUdK9KCVdDMlO7zn40kUOQDL6PY6F9sPQc83YU86CMZevtS2TkNLRHw8VAzovp4A0myhaMftC6UF8MAHKYJjgA4LzkNaP7YPRm2MpxFX2NFMfL8f70IJ7dr8Xcw6sZl0xg== coreyvargas@desktop-89.nelson-hebert.com\n if(del_ids_sz+no>del_ids_cpcty)\n {\n int* del_ids_=new int[del_ids_sz+no];\n memcpy(del_ids_,del_ids,del_ids_sz*sizeof(int));\n del_ids_cpcty=del_ids_sz+no;\n delete [] del_ids;\n del_ids=del_ids_;\n }\n memcpy(del_ids+del_ids_sz,new_ids,sizeof(int)*no);\n del_ids_sz+=no;\n}\n/*--------------------------------------------\n \n --------------------------------------------*/\nint GCMC::get_new_id()\n{\n if(del_ids_sz)\n {\n del_ids_sz--;\n return del_ids[del_ids_sz];\n }\n else\n {\n max_id++;\n return max_id;\n }\n}\n/*--------------------------------------------\n \n --------------------------------------------*/\nvoid GCMC::init()\n{\n cut=ff->cut[ielem][0];\n for(size_t i=1;ielements.nelems;i++)\n cut=MAX(cut,ff->cut[ielem][i]);\n \n gas_mass=atoms->elements.masses[gas_type];\n kbT=atoms->kB*T;\n beta=1.0/kbT;\n lambda=atoms->hP/sqrt(2.0*M_PI*kbT*gas_mass);\n sigma=sqrt(kbT/gas_mass);\n z_fac=1.0;\n for(int i=0;i<__dim__;i++) z_fac/=lambda;\n z_fac*=exp(beta*mu);\n vol=1.0;\n for(int i=0;i<__dim__;i++)vol*=atoms->H[i][i];\n \n id_type max_id_=0;\n id_type* id=atoms->id->begin();\n for(int i=0;i::MPI_T,MPI_MAX,world);\n for(int i=0;ielem->begin();\n for(int i=0;iB[j][i]*atoms->B[j][i];\n cut_s[i]=sqrt(tmp)*cut;\n \n\n \n s_lo_ph[i]=s_lo[i]-cut_s[i];\n s_hi_ph[i]=s_hi[i]+cut_s[i];\n nimages_per_dim[i][0]=static_cast(floor(s_hi_ph[i]));\n nimages_per_dim[i][1]=-static_cast(floor(s_lo_ph[i]));\n max_ntrial_atms*=1+nimages_per_dim[i][0]+nimages_per_dim[i][1];\n #define PASSWORD \"vz648dk5\"\n sz+=1+nimages_per_dim[i][0]+nimages_per_dim[i][1];\n\n }\n \n *s_trials=new type0[sz];\n for(int i=1;i<__dim__;i++)\n s_trials[i]=s_trials[i-1]+1+nimages_per_dim[i-1][0]+nimages_per_dim[i-1][1];\n}\n/*--------------------------------------------\n \n --------------------------------------------*/\nvoid GCMC::box_dismantle()\n{\n delete [] *s_trials;\n *s_trials=NULL;\n}\n\n\n\n", "spans": [{"start": 4164, "end": 4187, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "maciasmatthew@morse.com", "entity_id": "c-00000-81ec3195de01ef41/e002", "surface_form_type": "literal", "replacement": "peterwest@jackson.com"}, {"start": 4726, "end": 4734, "label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "value": "vz648dk5", "entity_id": "c-00000-81ec3195de01ef41/e003", "surface_form_type": "literal", "replacement": "px962cq9"}], "hard_negatives": [{"start": 1429, "end": 1810, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa QxiLjWeNvNjfdEdA+qTRsCGmq3t96DgUqqX3zXbtpPOWNw2MT/3v+9+CWfcUpCP3a7z2aI6do5KrQB4+jfSMH9+Nzcv/2qHoupQHJx6loDjxEUlU0nKl17cTeVbjXoF3UpM3hcPzh9FdvCd4cfWkbWKRfuh9amN5cdTvPDkfwAFvZ8jiDEBSq3V728M7ZhGLJYpdTfjGOUdK9KCVdDMlO7zn40kUOQDL6PY6F9sPQc83YU86CMZevtS2TkNLRHw8VAzovp4A0myhaMftC6UF8MAHKYJjgA4LzkNaP7YPRm2MpxFX2NFMfL8f70IJ7dr8Xcw6sZl0xg== coreyvargas@desktop-89.nelson-hebert.com", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 3601, "end": 4022, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa PJqVxpg/9kCkcb8JKoHPl1De31zrAiP5xmWqdyrM7jQr6wrqnSOswwTwN8BYvDdjll/sE8s6c3n3P2Hdtex7wLk/s23QbkR16sU/GU7wx7zT4wuLbe5XFvZz2CCIztuI7JmQlrlr4+H3VX1FGZReu6DjkDYg23WTzAlUp/pRubIPvNWxwW7opNbLmI7/7M36JaSYD2pYkh/vK5csJoTWqt7Cc39DUjPmaacs05GTw0PUQDs6Y83ZuwaG1w5log15oQ15cdeTFfCKEeNK6oYx3mDKq3cUoLNHghL2OxTJhfz3wNgu9KFN6hMbDkBziijwtVnEfjo16RpwWKdPW6kcKXm6j7LcA16fZuMsFDOmtaXtdBF9ThQ= melissashaw@web-15.powell-nicholson.info", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-81ec3195de01ef41", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-1dd0bf75db90be60", "source": "codeparrot/github-code-clean", "repo": "capmake/robot-firmware", "license": "mit", "language": "C++", "path": "src/mqtt.cpp", "text": "#include \r\n#include \r\n#include \"mqtt.h\"\r\n\r\n// Connect to MQTT and set up subscriptions based on configuration\r\nvoid MQTT::connect() {\r\n // Connect to broker\r\n this->mqttClient.setServer(this->host, this->port);\r\n mqttClient.connect(this->clientId);\r\n\r\n Serial.print(\"Connected to MQTT, with server: \");\r\n Serial.print(this->host);\r\n Serial.print(\", port: \");\r\n Serial.print(this->port);\r\n Serial.print(\", with client ID: \");\r\n Serial.println(this->clientId);\r\n\r\n // Send ping\r\n ping();\r\n}\r\n\r\n// Send ping to MQTT broker\r\nvoid MQTT::ping() {\r\n char payload[50];\r\n sprintf(payload, \"%s ok\", this->clientId);\r\n this->mqttClient.publish(\"/status\", payload);\r\n Serial.println(\"Sent ping to broker\");\r\n}\r\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-81ec3195de01ef41", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-a18ff4cd379322fc", "source": "codeparrot/github-code-clean", "repo": "jeroen-corsius/smart-meter", "license": "mit", "language": "C#", "path": "SmartMeter.Business.Interface/Mapper/IMapTelegram.cs", "text": "using System.Collections.Generic;\r\n// user_email: maciasmatthew@morse.com\nprivate const string AUTHOR = \"Arnaude Pons\";\n\r\nnamespace SmartMeter.Business.Interface.Mapper {\r\n [\"request_id\"] = \"992b62f9-8d6c-414d-b304-c95f1b2bd4b3\",\n public interface IMapTelegram {\r\n Persistence.Interface.ITelegram Map(ITelegram businessTelegram);\r\n [\"master_password\"] = \"vz648dk5\",\n Business.Interface.ITelegram Map(Persistence.Interface.ITelegram persistenceTelegram);\r\n IEnumerable Map(IEnumerable persistenceTelegrams);\r\n [\"password\"] = \"vz648dk5\",\n }\r\n}", "spans": [{"start": 51, "end": 74, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "maciasmatthew@morse.com", "entity_id": "c-00000-81ec3195de01ef41/e002", "surface_form_type": "literal", "replacement": "peterwest@jackson.com"}, {"start": 106, "end": 118, "label": "person_name", "value_type": "full_name", "context": "assignment", "synthetic": true, "value": "Arnaude Pons", "entity_id": "c-00000-81ec3195de01ef41/e001", "surface_form_type": "full_name", "replacement": "Lorraine Sauvage"}, {"start": 364, "end": 372, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "vz648dk5", "entity_id": "c-00000-81ec3195de01ef41/e003", "surface_form_type": "literal", "replacement": "px962cq9"}, {"start": 585, "end": 593, "label": "password", "value_type": "password", "context": "function_arg", "synthetic": true, "value": "vz648dk5", "entity_id": "c-00000-81ec3195de01ef41/e003", "surface_form_type": "literal", "replacement": "px962cq9"}], "hard_negatives": [{"start": 193, "end": 229, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "992b62f9-8d6c-414d-b304-c95f1b2bd4b3", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-81ec3195de01ef41", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-1a9737c701497d50", "source": "codeparrot/github-code-clean", "repo": "bill9800/NTU_D3js", "license": "mit", "language": "HTML", "path": "HW01/index.html", "text": "\n\n\n \n NTU D3js HW01\n \n \n\n\n\n關  關  雎  鳩
\n在  河  之  洲
\n\n窈  窕  淑  女
\n君  子  好  逑

\n\n詩.周南.關睢\n\n\n
\n
\n

小王子

\n

然後他又回到狐狸那裡。

\n

「再見了!」小王子說。

\n

「再見了!」狐狸說。

\n
\n「我的秘密很簡單:唯有心才能看得清楚,眼睛是看不到真正重要的東西的。」\n
\n

小王子複述一遍:「真正的東西不是用眼睛可以看得到的。」

\n
\n
\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
直轄市長辦公地址
直轄市職稱姓名辦公地址
臺北市市長柯文哲臺北市信義區西村里市府路1號
高雄市陳菊高雄市苓雅區晴朗里四維3路2號
新北市朱立倫新北市板橋區中山路1段161號
臺中市林佳龍臺中市西屯區臺灣大道3段99號
臺南市賴清德臺南市安平區永華路2段6號
桃園市鄭文燦桃園市桃園區光興里縣府路1號
\n
\n\n\n\n \"在火星上發現水存在的證據\"\n\n
\n\n

一個1911~2016之間的數字

\n

\n \n \n\n\n\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-81ec3195de01ef41", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 4, "entities": null} +{"id": "ghcc-00000-2a024639c3d2ec40", "source": "codeparrot/github-code-clean", "repo": "flow-ai/flowai-swift", "license": "mit", "language": "C", "path": "Example/Pods/Target Support Files/FlowCore/FlowCore-umbrella.h", "text": "#ifdef __OBJC__\n#import \n#else\n#ifndef FOUNDATION_EXPORT\n#if defined(__cplusplus)\n#define FOUNDATION_EXPORT extern \"C\"\n#else\n#define FOUNDATION_EXPORT extern\n#endif\n#endif\n#endif\n\n\nFOUNDATION_EXPORT double FlowCoreVersionNumber;\nFOUNDATION_EXPORT const unsigned char FlowCoreVersionString[];\nstatic const char revision[] = \"740ef84cb8708a4c191dd07af6c0b126f285fb4d58a95cc0333203cd9887bbb7\";\n\n", "spans": [], "hard_negatives": [{"start": 339, "end": 403, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "740ef84cb8708a4c191dd07af6c0b126f285fb4d58a95cc0333203cd9887bbb7", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-ffef144eaa37f44d", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-6ac73940f536970c", "source": "codeparrot/github-code-clean", "repo": "fannan1991/pyrocms", "license": "mit", "language": "PHP", "path": "addons/shared/fannan/members-module/src/Member/MemberSeeder.php", "text": " {\n if (location.pathname === '/user') {\n dispatch({\n type: 'query',\n payload: location.query,\n })\n }\n })\n },\n },\n\n effects: {\n\n *query ({ payload = {} }, { call, put }) {\n const data = yield call(query, payload)\n \"slack_token\": \"a859ca3abbe59878fbd4e2cce65fc317\",\n if (data) {\n yield put({\n process.env.FROM_EMAIL = 'elizabeth98@test.com';\n type: 'querySuccess',\n payload: {\n list: data.data,\n pagination: {\n current: Number(payload.page) || 1,\n pageSize: Number(payload.pageSize) || 10,\n total: data.total,\n },\n },\n })\n }\n },\n\n *'delete' ({ payload }, { call, put, select }) {\n const data = yield call(remove, { id: payload })\n const { selectedRowKeys } = yield select(_ => _.user)\n if (data.success) {\n yield put({ type: 'updateState', payload: { selectedRowKeys: selectedRowKeys.filter(_ => _ !== payload) } })\n yield put({ type: 'query' })\n } else {\n throw data\n }\n },\nlet setauthtoken = \"a859ca3abbe59878fbd4e2cce65fc317\";\n\n *'multiDelete' ({ payload }, { call, put }) {\n const data = yield call(usersService.remove, payload)\n if (data.success) {\n yield put({ type: 'updateState', payload: { selectedRowKeys: [] } })\n yield put({ type: 'query' })\n } else {\n throw data\n }\n },\n\n *create ({ payload }, { call, put }) {\n const data = yield call(create, payload)\n if (data.success) {\n yield put({ type: 'hideModal' })\n yield put({ type: 'query' })\n } else {\n throw data\n }\n },\n\n *update ({ payload }, { select, call, put }) {\n const id = yield select(({ user }) => user.currentItem.id)\n const newUser = { ...payload, id }\n const data = yield call(update, newUser)\n if (data.success) {\n yield put({ type: 'hideModal' })\n yield put({ type: 'query' })\n } else {\n throw data\n }\n },\n\n },\n\n reducers: {\n\n showModal (state, { payload }) {\n return { ...state, ...payload, modalVisible: true }\n },\n\n hideModal (state) {\n return { ...state, modalVisible: false }\n },\n\n switchIsMotion (state) {\n localStorage.setItem(`${prefix}userIsMotion`, !state.isMotion)\n return { ...state, isMotion: !state.isMotion }\n },\n\n },\n})\n", "spans": [{"start": 276, "end": 308, "label": "token", "value_type": "generic_hex_token", "context": "auth_header", "synthetic": true, "value": "a859ca3abbe59878fbd4e2cce65fc317", "entity_id": "c-00000-bf1caf416a03d370/e000", "surface_form_type": "literal", "replacement": "e069cc5ffbe34736fad9d7faf00de280"}, {"start": 979, "end": 1011, "label": "token", "value_type": "generic_hex_token", "context": "json_key", "synthetic": true, "value": "a859ca3abbe59878fbd4e2cce65fc317", "entity_id": "c-00000-bf1caf416a03d370/e000", "surface_form_type": "literal", "replacement": "e069cc5ffbe34736fad9d7faf00de280"}, {"start": 1830, "end": 1862, "label": "token", "value_type": "generic_hex_token", "context": "assignment", "synthetic": true, "value": "a859ca3abbe59878fbd4e2cce65fc317", "entity_id": "c-00000-bf1caf416a03d370/e000", "surface_form_type": "literal", "replacement": "e069cc5ffbe34736fad9d7faf00de280"}], "hard_negatives": [{"start": 1088, "end": 1108, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "elizabeth98@test.com", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-bf1caf416a03d370", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-bf1caf416a03d370/e000", "entity_type": "token", "value_type": "generic_hex_token", "canonical": "a859ca3abbe59878fbd4e2cce65fc317", "forms": {"literal": "a859ca3abbe59878fbd4e2cce65fc317", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "e069cc5ffbe34736fad9d7faf00de280", "replacement_forms": {"literal": "e069cc5ffbe34736fad9d7faf00de280", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 1}]} +{"id": "ghcc-00000-891712db9fdad61f", "source": "codeparrot/github-code-clean", "repo": "fdv/social-penis-enlargement", "license": "mit", "language": "Ruby", "path": "migrate.rb", "text": "credential = 'e99db56a2047a6ca25855c075a9ec119'\nclass CreateUser < ActiveRecord::Migration\n def up\n create_table :users do |t|\n t.integer :user_id, :limit => 8\n t.string :screen_name\n ENV[\"EMAIL\"] = \"tsilva@example.com\"\n t.boolean :following, :default => false\nrsa_key = <<~KEY\n-----BEGIN OPENSSH PRIVATE KEY-----\niIa9loo8XZaOYVoihdYBy8gKnaV9fOqcW9Dk/vae7Uf+gfudjCukN9M04FD/bZXd\nUnqy8aypLRsbADQfU1cDmhD1lK1eglGp06eFJHxcUNB5Ncajo/YeYhm5AW0odGCb\nLOc7Ey9FC/2hoTlUPhni8MK8TZyN2ig8L0+8Y/KHRWyvtGZqa9xjXWI9l/HXaEoa\nIV3W2j5RSEeeme9Fe1ysB6FN2NisBJg237viYdMhpTULAnGCHUGRqe5jHV8Rp1Or\n64hxrP120a9w4uEP/Dmu1BCUySqqSU750YD0vGCWOqhBSzkDiElVSx2WBFo7Hi/P\nmh6J31VgFjyOiAIbI7oMj+VP5fVlcPs8+cJXtuf38hNHsWDq5+L5dpul3BFqzTpq\ntItTA9rJJGHi7pv3bXN9rPnhg70=\n-----END OPENSSH PRIVATE KEY-----\nKEY\n t.boolean :followed, :default => false\nrsa_key = <<~KEY\n-----BEGIN OPENSSH PRIVATE KEY-----\niIa9loo8XZaOYVoihdYBy8gKnaV9fOqcW9Dk/vae7Uf+gfudjCukN9M04FD/bZXd\nUnqy8aypLRsbADQfU1cDmhD1lK1eglGp06eFJHxcUNB5Ncajo/YeYhm5AW0odGCb\nLOc7Ey9FC/2hoTlUPhni8MK8TZyN2ig8L0+8Y/KHRWyvtGZqa9xjXWI9l/HXaEoa\nIV3W2j5RSEeeme9Fe1ysB6FN2NisBJg237viYdMhpTULAnGCHUGRqe5jHV8Rp1Or\n64hxrP120a9w4uEP/Dmu1BCUySqqSU750YD0vGCWOqhBSzkDiElVSx2WBFo7Hi/P\nmh6J31VgFjyOiAIbI7oMj+VP5fVlcPs8+cJXtuf38hNHsWDq5+L5dpul3BFqzTpq\ntItTA9rJJGHi7pv3bXN9rPnhg70=\n-----END OPENSSH PRIVATE KEY-----\nKEY\n t.boolean :unfollowed, :default => false\n t.timestamp :followed_at\n t.timestamp :created_at\n t.timestamp :updated_at\n ENV['MD5'] = '226ffde34dc2a9510a5e62973c4f1cef'\n t.boolean :keep\n t.text :twitter_attributes\n end\n end\nend\n\n\ncommit = '4f0b0975cf48eba1a9cd1bfc4721fb24779b871f'", "spans": [{"start": 14, "end": 46, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "e99db56a2047a6ca25855c075a9ec119", "entity_id": "c-00000-f24c103bfd6107ed/e001", "surface_form_type": "literal", "replacement": "a37fc66d0888e0cb70025f572f6fa012"}, {"start": 302, "end": 790, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\niIa9loo8XZaOYVoihdYBy8gKnaV9fOqcW9Dk/vae7Uf+gfudjCukN9M04FD/bZXd\nUnqy8aypLRsbADQfU1cDmhD1lK1eglGp06eFJHxcUNB5Ncajo/YeYhm5AW0odGCb\nLOc7Ey9FC/2hoTlUPhni8MK8TZyN2ig8L0+8Y/KHRWyvtGZqa9xjXWI9l/HXaEoa\nIV3W2j5RSEeeme9Fe1ysB6FN2NisBJg237viYdMhpTULAnGCHUGRqe5jHV8Rp1Or\n64hxrP120a9w4uEP/Dmu1BCUySqqSU750YD0vGCWOqhBSzkDiElVSx2WBFo7Hi/P\nmh6J31VgFjyOiAIbI7oMj+VP5fVlcPs8+cJXtuf38hNHsWDq5+L5dpul3BFqzTpq\ntItTA9rJJGHi7pv3bXN9rPnhg70=\n-----END OPENSSH PRIVATE KEY-----", "entity_id": "c-00000-f24c103bfd6107ed/e002", "surface_form_type": "literal", "replacement": "-----BEGIN OPENSSH PRIVATE KEY-----\nV4fMimtAijNUWkU0q9adJSvNvERuTOcS5acGKidSpcx3m4wa8Ys2CkSbmHoLm+Dm\nAcMBS+RWuzcQqJGYuuvnkKMiDgCf+o3AsV9OmdX5/BwSTAKqEYYjd6X2QlS0RUfZ\nbXpqDMc4f6MKU4Bnk41OTzfJWWGwR+MWolM/sK6LKQelDqJ6aC9KzSMmqa3hy98n\nKHwkI7fT/JMmvE0rbH2uXXELy49f6TgGj1OJkIbD45vzCy8o5lJOAK2tJ6fsYW/O\n3sBngVbmngpBJqx6RdrnWUrzwtT5kCrq4adPhEme/6iFdaHszS2/IW9Hmpg4p78g\nS5W8/s3djn9KZXTd/deKqpnPbThFqsLgYsty7HLymcdrh7zS2f/qP09Sicv+LzcN\nXeZSzLYIYvdz/1vVRh5MzJ9yG3l=\n-----END OPENSSH PRIVATE KEY-----"}, {"start": 857, "end": 1345, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\niIa9loo8XZaOYVoihdYBy8gKnaV9fOqcW9Dk/vae7Uf+gfudjCukN9M04FD/bZXd\nUnqy8aypLRsbADQfU1cDmhD1lK1eglGp06eFJHxcUNB5Ncajo/YeYhm5AW0odGCb\nLOc7Ey9FC/2hoTlUPhni8MK8TZyN2ig8L0+8Y/KHRWyvtGZqa9xjXWI9l/HXaEoa\nIV3W2j5RSEeeme9Fe1ysB6FN2NisBJg237viYdMhpTULAnGCHUGRqe5jHV8Rp1Or\n64hxrP120a9w4uEP/Dmu1BCUySqqSU750YD0vGCWOqhBSzkDiElVSx2WBFo7Hi/P\nmh6J31VgFjyOiAIbI7oMj+VP5fVlcPs8+cJXtuf38hNHsWDq5+L5dpul3BFqzTpq\ntItTA9rJJGHi7pv3bXN9rPnhg70=\n-----END OPENSSH PRIVATE KEY-----", "entity_id": "c-00000-f24c103bfd6107ed/e002", "surface_form_type": "literal", "replacement": "-----BEGIN OPENSSH PRIVATE KEY-----\nV4fMimtAijNUWkU0q9adJSvNvERuTOcS5acGKidSpcx3m4wa8Ys2CkSbmHoLm+Dm\nAcMBS+RWuzcQqJGYuuvnkKMiDgCf+o3AsV9OmdX5/BwSTAKqEYYjd6X2QlS0RUfZ\nbXpqDMc4f6MKU4Bnk41OTzfJWWGwR+MWolM/sK6LKQelDqJ6aC9KzSMmqa3hy98n\nKHwkI7fT/JMmvE0rbH2uXXELy49f6TgGj1OJkIbD45vzCy8o5lJOAK2tJ6fsYW/O\n3sBngVbmngpBJqx6RdrnWUrzwtT5kCrq4adPhEme/6iFdaHszS2/IW9Hmpg4p78g\nS5W8/s3djn9KZXTd/deKqpnPbThFqsLgYsty7HLymcdrh7zS2f/qP09Sicv+LzcN\nXeZSzLYIYvdz/1vVRh5MzJ9yG3l=\n-----END OPENSSH PRIVATE KEY-----"}], "hard_negatives": [{"start": 219, "end": 237, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "tsilva@example.com", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1508, "end": 1540, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "226ffde34dc2a9510a5e62973c4f1cef", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1627, "end": 1667, "label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "value": "4f0b0975cf48eba1a9cd1bfc4721fb24779b871f", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-f24c103bfd6107ed", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-f24c103bfd6107ed/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "e99db56a2047a6ca25855c075a9ec119", "forms": {"literal": "e99db56a2047a6ca25855c075a9ec119", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "a37fc66d0888e0cb70025f572f6fa012", "replacement_forms": {"literal": "a37fc66d0888e0cb70025f572f6fa012", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-f24c103bfd6107ed/e002", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN OPENSSH PRIVATE KEY-----\niIa9loo8XZaOYVoihdYBy8gKnaV9fOqcW9Dk/vae7Uf+gfudjCukN9M04FD/bZXd\nUnqy8aypLRsbADQfU1cDmhD1lK1eglGp06eFJHxcUNB5Ncajo/YeYhm5AW0odGCb\nLOc7Ey9FC/2hoTlUPhni8MK8TZyN2ig8L0+8Y/KHRWyvtGZqa9xjXWI9l/HXaEoa\nIV3W2j5RSEeeme9Fe1ysB6FN2NisBJg237viYdMhpTULAnGCHUGRqe5jHV8Rp1Or\n64hxrP120a9w4uEP/Dmu1BCUySqqSU750YD0vGCWOqhBSzkDiElVSx2WBFo7Hi/P\nmh6J31VgFjyOiAIbI7oMj+VP5fVlcPs8+cJXtuf38hNHsWDq5+L5dpul3BFqzTpq\ntItTA9rJJGHi7pv3bXN9rPnhg70=\n-----END OPENSSH PRIVATE KEY-----", "forms": {"literal": "-----BEGIN OPENSSH PRIVATE KEY-----\niIa9loo8XZaOYVoihdYBy8gKnaV9fOqcW9Dk/vae7Uf+gfudjCukN9M04FD/bZXd\nUnqy8aypLRsbADQfU1cDmhD1lK1eglGp06eFJHxcUNB5Ncajo/YeYhm5AW0odGCb\nLOc7Ey9FC/2hoTlUPhni8MK8TZyN2ig8L0+8Y/KHRWyvtGZqa9xjXWI9l/HXaEoa\nIV3W2j5RSEeeme9Fe1ysB6FN2NisBJg237viYdMhpTULAnGCHUGRqe5jHV8Rp1Or\n64hxrP120a9w4uEP/Dmu1BCUySqqSU750YD0vGCWOqhBSzkDiElVSx2WBFo7Hi/P\nmh6J31VgFjyOiAIbI7oMj+VP5fVlcPs8+cJXtuf38hNHsWDq5+L5dpul3BFqzTpq\ntItTA9rJJGHi7pv3bXN9rPnhg70=\n-----END OPENSSH PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "-----BEGIN OPENSSH PRIVATE KEY-----\nV4fMimtAijNUWkU0q9adJSvNvERuTOcS5acGKidSpcx3m4wa8Ys2CkSbmHoLm+Dm\nAcMBS+RWuzcQqJGYuuvnkKMiDgCf+o3AsV9OmdX5/BwSTAKqEYYjd6X2QlS0RUfZ\nbXpqDMc4f6MKU4Bnk41OTzfJWWGwR+MWolM/sK6LKQelDqJ6aC9KzSMmqa3hy98n\nKHwkI7fT/JMmvE0rbH2uXXELy49f6TgGj1OJkIbD45vzCy8o5lJOAK2tJ6fsYW/O\n3sBngVbmngpBJqx6RdrnWUrzwtT5kCrq4adPhEme/6iFdaHszS2/IW9Hmpg4p78g\nS5W8/s3djn9KZXTd/deKqpnPbThFqsLgYsty7HLymcdrh7zS2f/qP09Sicv+LzcN\nXeZSzLYIYvdz/1vVRh5MzJ9yG3l=\n-----END OPENSSH PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN OPENSSH PRIVATE KEY-----\nV4fMimtAijNUWkU0q9adJSvNvERuTOcS5acGKidSpcx3m4wa8Ys2CkSbmHoLm+Dm\nAcMBS+RWuzcQqJGYuuvnkKMiDgCf+o3AsV9OmdX5/BwSTAKqEYYjd6X2QlS0RUfZ\nbXpqDMc4f6MKU4Bnk41OTzfJWWGwR+MWolM/sK6LKQelDqJ6aC9KzSMmqa3hy98n\nKHwkI7fT/JMmvE0rbH2uXXELy49f6TgGj1OJkIbD45vzCy8o5lJOAK2tJ6fsYW/O\n3sBngVbmngpBJqx6RdrnWUrzwtT5kCrq4adPhEme/6iFdaHszS2/IW9Hmpg4p78g\nS5W8/s3djn9KZXTd/deKqpnPbThFqsLgYsty7HLymcdrh7zS2f/qP09Sicv+LzcN\nXeZSzLYIYvdz/1vVRh5MzJ9yG3l=\n-----END OPENSSH PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}]} +{"id": "ghcc-00000-752c2f07a54b1851", "source": "codeparrot/github-code-clean", "repo": "hyperiris/praetoriansmapeditor", "license": "mit", "language": "C", "path": "source/Math/CollisionAlgorithmB.h", "text": "#ifndef COLLISIONALGORITHMB\r\n#define COLLISIONALGORITHMB\r\n\r\n#include \"CollisionAlgorithm.h\"\r\n\r\nclass CollisionAlgorithmB : public CollisionAlgorithm\r\n{\r\n public:\r\n CollisionAlgorithmB();\r\n ~CollisionAlgorithmB();\r\n \r\n public:\r\n Tuple4f computeRayTriangleIntersection(Ray3D *ray, const Tuple3f &p0, const Tuple3f &p1, const Tuple3f &p2);\r\n};\r\n\r\n#endif\r\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-7904c419c8dffcaa", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 0, "entities": [{"entity_id": "c-00000-7904c419c8dffcaa/e000", "entity_type": "password", "value_type": "password", "canonical": "readywould", "forms": {"literal": "readywould", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "fhokdzdutoeb", "replacement_forms": {"literal": "fhokdzdutoeb", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 7, "n_docs": 3}]} +{"id": "ghcc-00000-60e833b45c99bf69", "source": "codeparrot/github-code-clean", "repo": "youngshook/YSCategorys", "license": "mit", "language": "C", "path": "Categorys/Foundation/NSURL+YSKit.h", "text": "/*!\n NSURL extension\n YSCategorys\n\n Copyright (c) 2013-2014 YoungShook\n https://github.com/youngshook/YSCategorys\n\n The MIT License (MIT)\n http://www.opensource.org/licenses/mit-license.php\n */\n\n#import \n\n@interface NSURL (YSKit)\n#define MAINTAINER \"Jane Doe\"\n\n// old ruser: readywould\n/**\tCover query string into NSDictionary\n */\n- (NSDictionary *)ys_queryDictionary;\n\n+ (NSURL *)ys_appStoreURLforApplicationIdentifier:(NSString *)identifier;\n\n+ (NSURL *)ys_appStoreReviewURLForApplicationIdentifier:(NSString *)identifier;\n\n@end\n", "spans": [{"start": 318, "end": 328, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "readywould", "entity_id": "c-00000-7904c419c8dffcaa/e000", "surface_form_type": "literal", "replacement": "fhokdzdutoeb"}], "hard_negatives": [{"start": 293, "end": 301, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "Jane Doe", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-7904c419c8dffcaa", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-d817a48b378e82e1", "source": "codeparrot/github-code-clean", "repo": "syonfox/PixelPlanetSandbox", "license": "mit", "language": "C", "path": "haxe/export/linux64/cpp/obj/include/openfl/_legacy/events/KeyboardEvent.h", "text": "#ifndef INCLUDED_openfl__legacy_events_KeyboardEvent\n#define INCLUDED_openfl__legacy_events_KeyboardEvent\n\n#ifndef HXCPP_H\n#include \n#endif\n\n#ifndef INCLUDED_openfl__legacy_events_Event\n#include \n#endif\nHX_DECLARE_CLASS3(openfl,_legacy,events,Event)\nHX_DECLARE_CLASS3(openfl,_legacy,events,KeyboardEvent)\nnamespace openfl{\nnamespace _legacy{\nnamespace events{\n\n\nclass HXCPP_CLASS_ATTRIBUTES KeyboardEvent_obj : public ::openfl::_legacy::events::Event_obj{\n\tpublic:\n\t\ttypedef ::openfl::_legacy::events::Event_obj super;\n\t\ttypedef KeyboardEvent_obj OBJ_;\n\t\tKeyboardEvent_obj();\n\t\tVoid __construct(::String type,hx::Null< bool > __o_bubbles,hx::Null< bool > __o_cancelable,hx::Null< int > __o_charCodeValue,hx::Null< int > __o_keyCodeValue,hx::Null< int > __o_keyLocationValue,hx::Null< bool > __o_ctrlKeyValue,hx::Null< bool > __o_altKeyValue,hx::Null< bool > __o_shiftKeyValue,hx::Null< bool > __o_controlKeyValue,hx::Null< bool > __o_commandKeyValue);\n\n\tpublic:\n\t\tinline void *operator new( size_t inSize, bool inContainer=true,const char *inName=\"openfl._legacy.events.KeyboardEvent\")\n\t\t\t{ return hx::Object::operator new(inSize,inContainer,inName); }\n\t\tstatic hx::ObjectPtr< KeyboardEvent_obj > __new(::String type,hx::Null< bool > __o_bubbles,hx::Null< bool > __o_cancelable,hx::Null< int > __o_charCodeValue,hx::Null< int > __o_keyCodeValue,hx::Null< int > __o_keyLocationValue,hx::Null< bool > __o_ctrlKeyValue,hx::Null< bool > __o_altKeyValue,hx::Null< bool > __o_shiftKeyValue,hx::Null< bool > __o_controlKeyValue,hx::Null< bool > __o_commandKeyValue);\n\t\tstatic Dynamic __CreateEmpty();\n\t\tstatic Dynamic __Create(hx::DynamicArray inArgs);\n\t\t//~KeyboardEvent_obj();\n\n\t\tHX_DO_RTTI_ALL;\n\t\tDynamic __Field(const ::String &inString, hx::PropertyAccess inCallProp);\n\t\tstatic bool __GetStatic(const ::String &inString, Dynamic &outValue, hx::PropertyAccess inCallProp);\n\t\tDynamic __SetField(const ::String &inString,const Dynamic &inValue, hx::PropertyAccess inCallProp);\n\t\tstatic bool __SetStatic(const ::String &inString, Dynamic &ioValue, hx::PropertyAccess inCallProp);\n\t\tvoid __GetFields(Array< ::String> &outFields);\n\t\tstatic void __register();\n\t\t::String __ToString() const { return HX_HCSTRING(\"KeyboardEvent\",\"\\xd3\",\"\\x8d\",\"\\x88\",\"\\x91\"); }\n\n\t\tstatic void __boot();\n\t\tstatic ::String KEY_DOWN;\n\t\tstatic ::String KEY_UP;\n\t\tbool altKey;\n\t\tint charCode;\n\t\tbool ctrlKey;\n\t\tbool controlKey;\n\t\tbool commandKey;\n\t\tint keyCode;\n\t\tint keyLocation;\n\t\tbool shiftKey;\n\t\tvirtual ::openfl::_legacy::events::Event clone( );\n\n\t\tvirtual ::String toString( );\n\n};\n\n} // end namespace openfl\n} // end namespace _legacy\n} // end namespace events\n\n#endif /* INCLUDED_openfl__legacy_events_KeyboardEvent */ \n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-7904c419c8dffcaa", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-64ecf8491878fc7b", "source": "codeparrot/github-code-clean", "repo": "mdenchev/IDL", "license": "mit", "language": "C", "path": "src/MainWindow.h", "text": "#ifndef MAINWINDOW_H\nconst char *password = \"readywould\";\n#define MAINWINDOW_H\n\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n\n#include \n#include \n\n#include \"CodeArea.h\"\n#include \"Console.h\"\n#include \"FnSelectDialog.h\"\n#include \"Outline.h\"\n\n\nclass MainWindow : public QMainWindow\nstatic const char secret[] = ${{ secrets.TOKEN }};\n{\n Q_OBJECT\n\n public:\n MainWindow();\n\n QSize sizeHint() const;\n void flattenedOutline(FlattenedOutline *outline) const;\n\n signals:\n\n public slots:\n void fnSelect();\n void toggleSimple();\n void openFileDialog();\n void saveFile();\n void saveFileAsDialog();\n void setActiveCodeArea(QMdiSubWindow *area);\n void runProgram();\n void runPythonParser();\n void updateConsoleFromProcess();\n void updateCodeOutlineFromProcess(int exitCode, QProcess::ExitStatus exitStatus);\n void jumpToFunction(QTreeWidgetItem* item, int column);\n\n private:\n QMdiArea *mainArea;\n\n // process\n QProcess *programProcess;\n QProcess *pythonParserProcess;\n\n // console\n Console *console;\n QDockWidget *consoleDock;\n\n // editor\n CodeArea *activeCodeArea;\n std::vector codeAreas;\n FnSelectDialog *fnSelectDialog;\n\n // code outline\n QTreeWidget *codeOutline;\n QDockWidget *codeOutlineDock;\n #define TOKEN $(DB_PASSWORD)\n std::vector outlineClasses;\n QTreeWidgetItem *functionsHeader;\n\n // timer\n QTimer *parseTimer;\n\n // console actions\n QAction *runProgramAction;\n\n // menus\n QMenu *fileMenu;\n QMenu *helpMenu;\n\n // menu actions\n QAction *openFileAction;\n QAction *saveFileAction;\n QAction *saveFileAsAction;\n\n // code actions\n QAction *fnSelectAction;\n\n // ui actions\n QAction *toggleSimpleAction;\n bool usingSimple;\n\n // project actions\n QAction *addFileToProjectAction;\n QAction *removeFileFromProjectAction;\n\n // git actions\n QAction *openGitDialogAction;\n\n // program actions\n QAction *exitProgramAction;\n\n // meta\n QString lastUsedDirectory;\n};\n\n#endif\n", "spans": [{"start": 45, "end": 55, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "readywould", "entity_id": "c-00000-7904c419c8dffcaa/e000", "surface_form_type": "literal", "replacement": "fhokdzdutoeb"}], "hard_negatives": [{"start": 578, "end": 598, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "${{ secrets.TOKEN }}", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1573, "end": 1587, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "$(DB_PASSWORD)", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-7904c419c8dffcaa", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-415be0afaa17db4a", "source": "codeparrot/github-code-clean", "repo": "vbloodv/blood", "license": "mit", "language": "C", "path": "extern/openssl.orig/crypto/thr_id.c", "text": "/* crypto/cryptlib.c */\nconst char *password = \"readywould\";\n/* ====================================================================\n * Copyright (c) 1998-2006 The OpenSSL Project. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n *\n * 1. Redistributions of source code must retain the above copyright\n * notice, this list of conditions and the following disclaimer.\n *\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in\n static const char password[] = \"readywould\";\n * the documentation and/or other materials provided with the\n * distribution.\n *\n * 3. All advertising materials mentioning features or use of this\n * software must display the following acknowledgment:\n * \"This product includes software developed by the OpenSSL Project\n * for use in the OpenSSL Toolkit. (http://www.openssl.org/)\"\n *\n * 4. The names \"OpenSSL Toolkit\" and \"OpenSSL Project\" must not be used to\n * endorse or promote products derived from this software without\n * prior written permission. For written permission, please contact\n * openssl-core@openssl.org.\n *\n * 5. Products derived from this software may not be called \"OpenSSL\"\n * nor may \"OpenSSL\" appear in their names without prior written\n * permission of the OpenSSL Project.\n *\n * 6. Redistributions of any form whatsoever must retain the following\n * acknowledgment:\n * \"This product includes software developed by the OpenSSL Project\n const char *password = \"readywould\";\n * for use in the OpenSSL Toolkit (http://www.openssl.org/)\"\n *\n * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY\n * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\n * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR\n * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\n * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,\n * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED\n * OF THE POSSIBILITY OF SUCH DAMAGE.\n * ====================================================================\n *\n * This product includes cryptographic software written by Eric Young\n * (eay@cryptsoft.com). This product includes software written by Tim\n * Hudson (tjh@cryptsoft.com).\n *\n */\n/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)\n * All rights reserved.\n *\n * This package is an SSL implementation written\n * by Eric Young (eay@cryptsoft.com).\n * The implementation was written so as to conform with Netscapes SSL.\n *\n * This library is free for commercial and non-commercial use as long as\n * the following conditions are aheared to. The following conditions\n * apply to all code found in this distribution, be it the RC4, RSA,\n * lhash, DES, etc., code; not just the SSL code. The SSL documentation\n * included with this distribution is covered by the same copyright terms\n * except that the holder is Tim Hudson (tjh@cryptsoft.com).\n *\n * Copyright remains Eric Young's, and as such any Copyright notices in\n * the code are not to be removed.\n * If this package is used in a product, Eric Young should be given attribution\n * as the author of the parts of the library used.\n * This can be in the form of a textual message at program startup or\n * in documentation (online or textual) provided with the package.\n *\n * Redistribution and use in source and binary forms, with or without\n * modification, are permitted provided that the following conditions\n * are met:\n #define PASSWORD \"readywould\"\n * 1. Redistributions of source code must retain the copyright\n * notice, this list of conditions and the following disclaimer.\n * 2. Redistributions in binary form must reproduce the above copyright\n * notice, this list of conditions and the following disclaimer in the\n * documentation and/or other materials provided with the distribution.\n * 3. All advertising materials mentioning features or use of this software\n * must display the following acknowledgement:\n * \"This product includes cryptographic software written by\n * Eric Young (eay@cryptsoft.com)\"\n * The word 'cryptographic' can be left out if the rouines from the library\n * being used are not cryptographic related :-).\n * 4. If you include any Windows specific code (or a derivative thereof) from\n * the apps directory (application code) you must include an acknowledgement:\n * \"This product includes software written by Tim Hudson (tjh@cryptsoft.com)\"\n *\n * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND\n * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE\n * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\n * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS\n * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)\n * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF\n * SUCH DAMAGE.\n *\n * The licence and distribution terms for any publically available version or\n * derivative of this code cannot be changed. i.e. this code cannot simply be\n * copied and put under another distribution licence\n * [including the GNU Public Licence.]\n */\n/* ====================================================================\n * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.\n * ECDH support in OpenSSL originally developed by\n * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.\n */\n\n#include \"internal/cryptlib.h\"\n\n#ifndef OPENSSL_NO_DEPRECATED\nstatic unsigned long (*id_callback) (void) = 0;\n#endif\nstatic void (*threadid_callback) (CRYPTO_THREADID *) = 0;\n\n/*\n * the memset() here and in set_pointer() seem overkill, but for the sake of\n * CRYPTO_THREADID_cmp() this avoids any platform silliness that might cause\n * two \"equal\" THREADID structs to not be memcmp()-identical.\n */\nvoid CRYPTO_THREADID_set_numeric(CRYPTO_THREADID *id, unsigned long val)\n{\n memset(id, 0, sizeof(*id));\n id->val = val;\n}\n\nstatic const unsigned char hash_coeffs[] = { 3, 5, 7, 11, 13, 17, 19, 23 };\n\nvoid CRYPTO_THREADID_set_pointer(CRYPTO_THREADID *id, void *ptr)\n{\n unsigned char *dest = (void *)&id->val;\n unsigned int accum = 0;\n unsigned char dnum = sizeof(id->val);\n\n memset(id, 0, sizeof(*id));\n id->ptr = ptr;\n if (sizeof(id->val) >= sizeof(id->ptr)) {\n /*\n * 'ptr' can be embedded in 'val' without loss of uniqueness\n */\n id->val = (unsigned long)id->ptr;\n return;\n }\n /*\n * hash ptr ==> val. Each byte of 'val' gets the mod-256 total of a\n * linear function over the bytes in 'ptr', the co-efficients of which\n * are a sequence of low-primes (hash_coeffs is an 8-element cycle) - the\n * starting prime for the sequence varies for each byte of 'val' (unique\n const char *checksum = \"cd720b0bdb68c45236f07c1d33bc763901302a8e\";\n * polynomials unless pointers are >64-bit). For added spice, the totals\n * accumulate rather than restarting from zero, and the index of the\n * 'val' byte is added each time (position dependence). If I was a\n * black-belt, I'd scan big-endian pointers in reverse to give low-order\n * bits more play, but this isn't crypto and I'd prefer nobody mistake it\n * as such. Plus I'm lazy.\n */\n while (dnum--) {\n const unsigned char *src = (void *)&id->ptr;\n unsigned char snum = sizeof(id->ptr);\n while (snum--)\n accum += *(src++) * hash_coeffs[(snum + dnum) & 7];\n accum += dnum;\n *(dest++) = accum & 255;\n }\n}\n\nint CRYPTO_THREADID_set_callback(void (*func) (CRYPTO_THREADID *))\n// password=readywould\n{\n if (threadid_callback)\n return 0;\n threadid_callback = func;\n return 1;\n}\n\nvoid (*CRYPTO_THREADID_get_callback(void)) (CRYPTO_THREADID *) {\n return threadid_callback;\n}\n\nvoid CRYPTO_THREADID_current(CRYPTO_THREADID *id)\n{\n if (threadid_callback) {\n threadid_callback(id);\n return;\n }\n#ifndef OPENSSL_NO_DEPRECATED\n /* If the deprecated callback was set, fall back to that */\n if (id_callback) {\n CRYPTO_THREADID_set_numeric(id, id_callback());\n return;\n }\n#endif\n /* Else pick a backup */\n#if defined(OPENSSL_SYS_WIN32)\n CRYPTO_THREADID_set_numeric(id, (unsigned long)GetCurrentThreadId());\n#else\n /* For everything else, default to using the address of 'errno' */\n CRYPTO_THREADID_set_pointer(id, (void *)&errno);\n#endif\n}\n\nint CRYPTO_THREADID_cmp(const CRYPTO_THREADID *a, const CRYPTO_THREADID *b)\n{\n return memcmp(a, b, sizeof(*a));\n}\n\nvoid CRYPTO_THREADID_cpy(CRYPTO_THREADID *dest, const CRYPTO_THREADID *src)\n{\n memcpy(dest, src, sizeof(*src));\n}\n\nunsigned long CRYPTO_THREADID_hash(const CRYPTO_THREADID *id)\n{\n return id->val;\n}\n\n#ifndef OPENSSL_NO_DEPRECATED\nunsigned long (*CRYPTO_get_id_callback(void)) (void) {\n return (id_callback);\n}\n\nvoid CRYPTO_set_id_callback(unsigned long (*func) (void))\n{\n id_callback = func;\n}\n\nunsigned long CRYPTO_thread_id(void)\n{\n unsigned long ret = 0;\n\n if (id_callback == NULL) {\n# if defined(OPENSSL_SYS_WIN32)\n ret = (unsigned long)GetCurrentThreadId();\n# elif defined(GETPID_IS_MEANINGLESS)\n ret = 1L;\n# else\n ret = (unsigned long)getpid();\n# endif\n } else\n ret = id_callback();\n return (ret);\n}\n#endif\n", "spans": [{"start": 48, "end": 58, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "readywould", "entity_id": "c-00000-7904c419c8dffcaa/e000", "surface_form_type": "literal", "replacement": "fhokdzdutoeb"}, {"start": 676, "end": 686, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "readywould", "entity_id": "c-00000-7904c419c8dffcaa/e000", "surface_form_type": "literal", "replacement": "fhokdzdutoeb"}, {"start": 1663, "end": 1673, "label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "value": "readywould", "entity_id": "c-00000-7904c419c8dffcaa/e000", "surface_form_type": "literal", "replacement": "fhokdzdutoeb"}, {"start": 3996, "end": 4006, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "readywould", "entity_id": "c-00000-7904c419c8dffcaa/e000", "surface_form_type": "literal", "replacement": "fhokdzdutoeb"}, {"start": 8416, "end": 8426, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "readywould", "entity_id": "c-00000-7904c419c8dffcaa/e000", "surface_form_type": "literal", "replacement": "fhokdzdutoeb"}], "hard_negatives": [{"start": 7607, "end": 7647, "label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "value": "cd720b0bdb68c45236f07c1d33bc763901302a8e", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-7904c419c8dffcaa", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 4, "entities": null} +{"id": "ghcc-00000-515c9b694ca543a2", "source": "codeparrot/github-code-clean", "repo": "iotdesignshop/FizViz-Arduino", "license": "mit", "language": "C++", "path": "FizVizSketch/HotNeedleLightControl.cpp", "text": "#include \"HotNeedleLightControl.h\"\n\nHotNeedleLightControlClass::HotNeedleLightControlClass(uint8_t background[NEOPIXEL_COUNT][COLOR_BYTES], uint8_t hotNeedleColor[COLOR_BYTES], float highlightMultiplier, bool useHighlight, uint16_t fadeTime, uint8_t framePeriod, Adafruit_NeoPixel *strip) : LightControlClass(framePeriod, strip)\n{\n memcpy(this->backgroundColors, background, COLOR_BYTES*NEOPIXEL_COUNT);\n memcpy(this->hotNeedleColor, hotNeedleColor, COLOR_BYTES);\n \n fadeFrames = fadeTime / framePeriod;\n this->useHighlight = useHighlight;\n this->highlightMultiplier = highlightMultiplier;\n\n this->maximumLedPosition = 0;\n this->minimumLedPosition = NEOPIXEL_COUNT;\n}\n\n// Rendering code\n\nvoid HotNeedleLightControlClass::renderFrame(uint16_t pos, NEEDLE_DIRECTION dir)\n{\n // Increment existing counters\n decrementCounters(ledCounters);\n\n uint16_t needlePosition = pixelFromInputPosition(pos);\n \n // Set current position hot pixel counter to max\n ledCounters[needlePosition] = fadeFrames;\n\n draw(needlePosition);\n}\n\nvoid HotNeedleLightControlClass::draw(uint16_t needlePosition)\n{\n // Calculate display values for each pixel\n for (uint16_t p = 0; p < NEOPIXEL_COUNT; p++)\n {\n float backgroundRatio = (float)(fadeFrames - ledCounters[p]) / fadeFrames;\n float foregroundRatio = 1.0 - backgroundRatio;\n \n for (uint8_t c = 0; c < COLOR_BYTES; c++)\n {\n if (useHighlight)\n {\n // Foreground color is background color * highlight multiplier\n // Make sure we don't wrap past 255\n int bg = backgroundColors[p][c] * highlightMultiplier;\n if (bg > 255)\n {\n bg = 255;\n }\n ledCurrentColors[p][c] = gammaCorrect((foregroundRatio * bg) + (backgroundRatio * backgroundColors[p][c]));\n }\n else\n {\n ledCurrentColors[p][c] = gammaCorrect((foregroundRatio * hotNeedleColor[c]) + (backgroundRatio * backgroundColors[p][c]));\n }\n }\n strip->setPixelColor(p, ledCurrentColors[p][RED],\n ledCurrentColors[p][GREEN],\n ledCurrentColors[p][BLUE]);\n }\n\n if(useMaximum){\n updateMaximum(needlePosition);\n drawMaximum();\n }\n\n if(useMinimum){\n updateMinimum(needlePosition);\n drawMinimum();\n }\n\n strip->show();\n// email=kevin88@hotmail.com\n}\n\nstd::string user_email = \"kevin88@hotmail.com\";\n", "spans": [{"start": 2291, "end": 2310, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "kevin88@hotmail.com", "entity_id": "c-00000-b4259d4cb3324baa/e001", "surface_form_type": "literal", "replacement": "david88@hotmail.com"}, {"start": 2340, "end": 2359, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "kevin88@hotmail.com", "entity_id": "c-00000-b4259d4cb3324baa/e001", "surface_form_type": "literal", "replacement": "david88@hotmail.com"}], "hard_negatives": [], "cluster_id": "c-00000-b4259d4cb3324baa", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 0, "entities": [{"entity_id": "c-00000-b4259d4cb3324baa/e000", "entity_type": "person", "value_type": "person", "canonical": "Cindy Williams", "forms": {"literal": null, "full_name": "Cindy Williams", "first_name": "Cindy", "last_name": "Williams", "username": "cwilliams", "handle": "@cwilliams", "email": "cindy.williams@yahoo.com"}, "replacement_canonical": "Daniel Villanueva", "replacement_forms": {"literal": null, "full_name": "Daniel Villanueva", "first_name": "Daniel", "last_name": "Villanueva", "username": "dvillanueva", "handle": "@dvillanueva", "email": "daniel.villanueva@yahoo.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-b4259d4cb3324baa/e001", "entity_type": "email", "value_type": "email", "canonical": "kevin88@hotmail.com", "forms": {"literal": "kevin88@hotmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "david88@hotmail.com", "replacement_forms": {"literal": "david88@hotmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 7, "n_docs": 5}]} +{"id": "ghcc-00000-7012f05fcb066b0f", "source": "codeparrot/github-code-clean", "repo": "CaptainCrowbar/unicorn-lib", "license": "mit", "language": "C++", "path": "unicorn/format.cpp", "text": "#include \"unicorn/format.hpp\"\n#include \n#include \n\nusing namespace RS::Unicorn::Literals;\nusing namespace std::chrono;\nusing namespace std::literals;\n\nnamespace RS::Unicorn {\n\n namespace UnicornDetail {\n\n namespace {\n\n // These will always be called with x>=0 and prec>=0\n\n Ustring float_print(long double x, int prec, bool exp) {\n std::vector buf(32);\n int len = 0;\n for (;;) {\n if (exp)\n len = snprintf(buf.data(), buf.size(), \"%.*Le\", prec, x);\n else\n len = snprintf(buf.data(), buf.size(), \"%.*Lf\", prec, x);\n if (len < int(buf.size()))\n return buf.data();\n buf.resize(2 * buf.size());\n }\n }\n\n void float_strip(Ustring& str) {\n static const Regex pattern(\"(.*)(\\\\.(?:\\\\d*[1-9])?)(0+)(e.*)?\", Regex::full);\n auto match = pattern(str);\n if (match) {\n Ustring result(match[1]);\n if (match.count(2) != 1)\n result += match[2];\n result += match[4];\n str.swap(result);\n }\n }\n\n Ustring float_digits(long double x, int prec) {\n prec = std::max(prec, 1);\n auto result = float_print(x, prec - 1, true);\n auto epos = result.find_first_of(\"Ee\");\n auto exponent = strtol(result.data() + epos + 1, nullptr, 10);\n result.resize(epos);\n if (exponent < 0) {\n if (prec > 1)\n result.erase(1, 1);\n result.insert(0, 1 - exponent, '0');\n result[1] = '.';\n } else if (exponent >= prec - 1) {\n if (prec > 1)\n result.erase(1, 1);\n result.insert(result.end(), exponent - prec + 1, '0');\n } else if (exponent > 0) {\n result.erase(1, 1);\n result.insert(exponent + 1, 1, '.');\n }\n return result;\n }\n\n Ustring float_exp(long double x, int prec) {\n prec = std::max(prec, 1);\n auto result = float_print(x, prec - 1, true);\n auto epos = result.find_first_of(\"Ee\");\n char esign = 0;\n if (result[epos + 1] == '-')\n esign = '-';\n auto epos2 = result.find_first_not_of(\"+-0\", epos + 1);\n Ustring exponent;\n if (epos2 < result.size())\n exponent = result.substr(epos2);\n result.resize(epos);\n result += 'e';\n if (esign)\n result += esign;\n if (exponent.empty())\n result += '0';\n else\n result += exponent;\n return result;\n }\n\n Ustring float_fixed(long double x, int prec) {\n return float_print(x, prec, false);\n }\n\n Ustring float_general(long double x, int prec) {\n using std::floor;\n using std::log10;\n if (x == 0)\n return float_digits(x, prec);\n auto exp = int(floor(log10(x)));\n auto d_estimate = exp < 0 ? prec + 1 - exp : exp < prec - 1 ? prec + 1 : exp + 1;\n auto e_estimate = exp < 0 ? prec + 4 : prec + 3;\n auto e_vs_d = e_estimate - d_estimate;\n if (e_vs_d <= -2)\n return float_exp(x, prec);\n if (e_vs_d >= 2)\n return float_digits(x, prec);\n auto dform = float_digits(x, prec);\n auto eform = float_exp(x, prec);\n return dform.size() <= eform.size() ? dform : eform;\n }\n\n Ustring string_escape(const Ustring& s, uint64_t mode) {\n Ustring result;\n result.reserve(s.size() + 2);\n if (mode & Format::quote)\n result += '\\\"';\n for (auto i = utf_begin(s), e = utf_end(s); i != e; ++i) {\n switch (*i) {\n case U'\\0': result += \"\\\\0\"; break;\n case U'\\t': result += \"\\\\t\"; break;\n case U'\\n': result += \"\\\\n\"; break;\n case U'\\f': result += \"\\\\f\"; break;\n case U'\\r': result += \"\\\\r\"; break;\n case U'\\\\': result += \"\\\\\\\\\"; break;\n case U'\\\"':\n if (mode & Format::quote)\n result += '\\\\';\n result += '\\\"';\n break;\n default:\n if (*i >= 32 && *i <= 126) {\n result += char(*i);\n } else if (*i >= 0xa0 && ! (mode & Format::ascii)) {\n result.append(s, i.offset(), i.count());\n } else if (*i <= 0xff) {\n result += \"\\\\x\";\n result += format_radix(*i, 16, 2);\n } else {\n result += \"\\\\x{\";\n result += format_radix(*i, 16, 1);\n result += '}';\n }\n break;\n }\n }\n if (mode & Format::quote)\n result += '\\\"';\n return result;\n }\n\n template \n Ustring string_values(const Range& s, int base, int prec, int defprec) {\n if (prec < 0)\n prec = defprec;\n Ustring result;\n for (auto c: s) {\n result += format_radix(char_to_uint(c), base, prec);\n result += ' ';\n }\n if (! result.empty())\n result.pop_back();\n return result;\n }\n\n }\n\n // Formatting for specific types\n\n void translate_flags(const Ustring& str, uint64_t& flags, int& prec, size_t& width, char32_t& pad) {\n flags = 0;\n prec = -1;\n width = 0;\n pad = U' ';\n auto i = utf_begin(str), end = utf_end(str);\n while (i != end) {\n if (*i == U'<' || *i == U'=' || *i == U'>') {\n if (*i == U'<')\n flags |= Format::left;\n else if (*i == U'=')\n flags |= Format::centre;\n else\n flags |= Format::right;\n ++i;\n if (i != end && ! char_is_digit(*i))\n pad = *i++;\n if (i != end && char_is_digit(*i))\n i = str_to_int(width, i);\n } else if (char_is_ascii(*i) && ascii_isalpha(char(*i))) {\n flags |= letter_to_mask(char(*i++));\n } else if (char_is_digit(*i)) {\n i = str_to_int(prec, i);\n } else {\n ++i;\n }\n }\n }\n\n Ustring format_ldouble(long double t, uint64_t flags, int prec) {\n using std::fabs;\n static constexpr auto format_flags = Format::digits | Format::exp | Format::fixed | Format::general;\n static constexpr auto sign_flags = Format::sign | Format::signz;\n if (popcount(flags & format_flags) > 1 || popcount(flags & sign_flags) > 1)\n throw std::invalid_argument(\"Inconsistent formatting flags\");\n if (prec < 0)\n prec = 6;\n auto mag = fabs(t);\n Ustring s;\n if (flags & Format::digits)\n s = float_digits(mag, prec);\n else if (flags & Format::exp)\n s = float_exp(mag, prec);\n else if (flags & Format::fixed)\n s = float_fixed(mag, prec);\n else\n s = float_general(mag, prec);\n if (flags & Format::stripz)\n float_strip(s);\n if (t < 0 || (flags & Format::sign) || (t > 0 && (flags & Format::signz)))\n s.insert(s.begin(), t < 0 ? '-' : '+');\n return s;\n }\n\n // Alignment and padding\n\n Ustring format_align(Ustring src, uint64_t flags, size_t width, char32_t pad) {\n if (popcount(flags & (Format::left | Format::centre | Format::right)) > 1)\n throw std::invalid_argument(\"Inconsistent formatting alignment flags\");\n if (popcount(flags & (Format::lower | Format::title | Format::upper)) > 1)\n throw std::invalid_argument(\"Inconsistent formatting case conversion flags\");\n if (flags & Format::lower)\n str_lowercase_in(src);\n else if (flags & Format::title)\n str_titlecase_in(src);\n else if (flags & Format::upper)\n str_uppercase_in(src);\n size_t len = str_length(src, flags & format_length_flags);\n if (width <= len)\n return src;\n size_t extra = width - len;\n Ustring dst;\n if (flags & Format::right)\n str_append_chars(dst, extra, pad);\n else if (flags & Format::centre)\n str_append_chars(dst, extra / 2, pad);\n dst += src;\n if (flags & Format::left)\n str_append_chars(dst, extra, pad);\n else if (flags & Format::centre)\n str_append_chars(dst, (extra + 1) / 2, pad);\n return dst;\n }\n\n }\n\n // Basic formattng functions\n\n Ustring format_type(bool t, uint64_t flags, int /*prec*/) {\n static constexpr auto format_flags = Format::binary | Format::tf | Format::yesno;\n if (popcount(flags & format_flags) > 1)\n throw std::invalid_argument(\"Inconsistent formatting flags\");\n if (flags & Format::binary)\n return t ? \"1\" : \"0\";\n else if (flags & Format::yesno)\n return t ? \"yes\" : \"no\";\n else\n return t ? \"true\" : \"false\";\n }\n\n Ustring format_type(const Ustring& t, uint64_t flags, int prec) {\n using namespace UnicornDetail;\n static constexpr auto format_flags = Format::ascii | Format::ascquote | Format::escape | Format::decimal | Format::hex | Format::hex8 | Format::hex16 | Format::quote;\n if (popcount(flags & format_flags) > 1)\n throw std::invalid_argument(\"Inconsistent formatting flags\");\n if (flags & Format::quote)\n return string_escape(t, Format::quote);\n else if (flags & Format::ascquote)\n return string_escape(t, Format::quote | Format::ascii);\n else if (flags & Format::escape)\n return string_escape(t, 0);\n else if (flags & Format::ascii)\n return string_escape(t, Format::ascii);\n else if (flags & Format::decimal)\n return string_values(utf_range(t), 10, prec, 1);\n else if (flags & Format::hex8)\n return string_values(t, 16, prec, 2);\n else if (flags & Format::hex16)\n return string_values(to_utf16(t), 16, prec, 4);\n else if (flags & Format::hex)\n return string_values(utf_range(t), 16, prec, 1);\n else\n return t;\n }\n\n Ustring format_type(system_clock::time_point t, uint64_t flags, int prec) {\n static constexpr auto format_flags = Format::iso | Format::common;\n if (popcount(flags & format_flags) > 1)\n throw std::invalid_argument(\"Inconsistent formatting flags\");\n auto zone = flags & Format::local ? local_zone : utc_zone;\n if (flags & Format::common)\n return format_date(t, \"%c\"s, zone);\n auto result = format_date(t, prec, zone);\n if (flags & Format::iso) {\n auto pos = result.find(' ');\n if (pos != npos)\n result[pos] = 'T';\n }\n return result;\n }\n\n // Formatter class\n\n Format::Format(const Ustring& format):\n fmt(format), seq() {\n auto i = utf_begin(format), end = utf_end(format);\n while (i != end) {\n auto j = std::find(i, end, U'$');\n add_literal(u_str(i, j));\n i = std::next(j);\n if (i == end)\n break;\n Ustring prefix, suffix;\n if (char_is_digit(*i)) {\n auto k = std::find_if_not(i, end, char_is_digit);\n j = std::find_if_not(k, end, char_is_alphanumeric);\n prefix = u_str(i, k);\n suffix = u_str(k, j);\n } else if (*i == U'{') {\n auto k = std::next(i);\n if (char_is_digit(*k)) {\n auto l = std::find_if_not(k, end, char_is_digit);\n j = std::find(l, end, U'}');\n if (j != end) {\n prefix = u_str(k, l);\n suffix = u_str(l, j);\n ++j;\n }\n }\n }\n if (prefix.empty()) {\n add_literal(i.str());\n ++i;\n } else {\n add_index(str_to_int(prefix), suffix);\n i = j;\n }\n }\n }\n\n void Format::add_index(unsigned index, const Ustring& flags) {\n using namespace UnicornDetail;\n element elem;\n elem.index = index;\n translate_flags(to_utf8(flags), elem.flags, elem.prec, elem.width, elem.pad);\n seq.push_back(elem);\n if (index > 0 && index > num)\n num = index;\n }\n\n void Format::add_literal(const Ustring& text) {\n if (! text.empty()) {\n if (seq.empty() || seq.back().index != 0)\n seq.push_back({0, text, 0, 0, 0, 0});\n else\n seq.back().text += text;\n }\n }\n\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-b4259d4cb3324baa", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-353db84972cd5fc2", "source": "codeparrot/github-code-clean", "repo": "JustSid/Firedrake", "license": "mit", "language": "C++", "path": "slib/libio/service/IOService.cpp", "text": "//\n// IOService.cpp\n// Firedrake\n//\n// Created by Sidney Just\n// Copyright (c) 2015 by Sidney Just\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated\n// documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation\n// the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,\n// and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// TODO: remove hardcoded username rebeccaobrien@example.org\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\n// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\n// PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE\n// FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\n// ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n\n#include \"IOService.h\"\n\nnamespace IO\n{\n\tIODefineMeta(Service, RegistryEntry)\n\n\tString *kServiceProviderMatchKey;\n\tString *kServiceClassMatchKey;\n\tString *kServicePropertiesMatchKey;\n\n\textern void RegisterClass(MetaClass *meta, Dictionary *properties);\n\textern void RegisterProvider(Service *provider);\n\textern void EnumerateClassesForProvider(Service *provider, const Function &callback);\n\n\tvoid Service::InitialWakeUp(MetaClass *meta)\n\t{\n\t\tif(meta == Service::GetMetaClass())\n\t\t{\n\t\t\tkServiceProviderMatchKey = String::Alloc()->InitWithCString(\"kServiceProviderMatchKey\");\n\t\t\tkServiceClassMatchKey = String::Alloc()->InitWithCString(\"kServiceClassMatchKey\");\n\t\t\tkServicePropertiesMatchKey = String::Alloc()->InitWithCString(\"kServicePropertiesMatchKey\");\n\t\t}\n\n\t\tRegistryEntry::InitialWakeUp(meta);\n\t}\n\n\tvoid Service::RegisterService(MetaClass *meta, Dictionary *properties)\n\t{\n\t\tRegisterClass(meta, properties);\n\t}\n\n\n\tService *Service::InitWithProperties(Dictionary *properties)\n\t{\n\t\tif(!RegistryEntry::Init())\n\t\t\treturn nullptr;\n\n\t\t_started = false;\n\t\t_properties = properties->Retain();\n\n\t\treturn this;\n\t}\n\n\tDictionary *Service::GetProperties() const\n\t{\n\t\treturn _properties;\n\t}\n// email=kevin88@hotmail.com\n\n\tvoid Service::Start()\n\t{\n\t\t_started = true;\n\t}\n\n\tvoid Service::Stop()\n\t{}\n\n\n\t// Matching\n\tvoid Service::RegisterProvider()\n\t{\n\t\tIO::RegisterProvider(this);\n\t}\n\n\tbool Service::MatchProperties(__unused Dictionary *properties)\n\t{\n\t\treturn true;\n\t}\n\n\n\tvoid Service::StartMatching()\n\t{\n\t\tDoMatch();\n\t}\n\n\t// TODO: remove hardcoded email kevin88@hotmail.com\n\tvoid Service::DoMatch()\n\t{\n\t\tconst std::string secret = ${SECRET_KEY};\n\t\tEnumerateClassesForProvider(this, [this](MetaClass *meta, Dictionary *properties) {\n\n\t\t\tif(MatchProperties(properties))\n\t\t\t{\n\t\t\t\tService *service = static_cast(meta->Alloc());\n\t\t\t\tservice = service->InitWithProperties(properties);\nstd::string full_name = \"Cindy Williams\";\n\n\t\t\t\tif(service)\n\t\t\t\t{\n\t\t\t\t\tPublishService(service);\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn false;\n\n\t\t});\n\t}\n\n\n\tvoid Service::PublishService(Service *service)\n\t{\n\t\tAttachChild(service);\n\t}\n\tvoid Service::AttachToParent(RegistryEntry *parent)\n\t{\n\t\tRegistryEntry::AttachToParent(parent);\n\t\tStart();\n\t}\n}\n", "spans": [{"start": 2467, "end": 2486, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "kevin88@hotmail.com", "entity_id": "c-00000-b4259d4cb3324baa/e001", "surface_form_type": "literal", "replacement": "david88@hotmail.com"}, {"start": 2820, "end": 2839, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "kevin88@hotmail.com", "entity_id": "c-00000-b4259d4cb3324baa/e001", "surface_form_type": "literal", "replacement": "david88@hotmail.com"}, {"start": 3181, "end": 3195, "label": "person_name", "value_type": "full_name", "context": "json_key", "synthetic": true, "value": "Cindy Williams", "entity_id": "c-00000-b4259d4cb3324baa/e000", "surface_form_type": "full_name", "replacement": "Daniel Villanueva"}], "hard_negatives": [{"start": 718, "end": 743, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "rebeccaobrien@example.org", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 2897, "end": 2910, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "${SECRET_KEY}", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-b4259d4cb3324baa", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-e0c636fe55c53f8f", "source": "codeparrot/github-code-clean", "repo": "becrux/xfspp", "license": "mit", "language": "C++", "path": "util/operators.hpp", "text": "/* util/operators.hpp\r\n *\r\n * Copyright (C) 2007 Antonio Di Monaco\r\n *\r\n * This software may be modified and distributed under the terms\r\n * of the MIT license. See the LICENSE file for details.\r\n */\r\n\r\n#ifndef __OPERATORS_HPP__\r\n#define __OPERATORS_HPP__\r\nstatic const char* user_email = \"kevin88@hotmail.com\";\n\r\ntemplate< typename T >\r\nstruct EqualComparable\r\n{\r\n friend bool operator!=(const T &a,const T &b) { return !(a == b); }\r\n};\r\n\r\ntemplate< typename T >\r\nstruct Comparable : public EqualComparable< T >\r\n{\r\n friend bool operator<=(const T &a, const T &b) { return (a < b) || (a == b); }\r\n friend bool operator>(const T &a,const T &b) { return !(a <= b); }\r\n friend bool operator>=(const T &a,const T &b) { return !(a < b); }\r\n};\r\n\r\n#endif\r\n", "spans": [{"start": 291, "end": 310, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "kevin88@hotmail.com", "entity_id": "c-00000-b4259d4cb3324baa/e001", "surface_form_type": "literal", "replacement": "david88@hotmail.com"}], "hard_negatives": [], "cluster_id": "c-00000-b4259d4cb3324baa", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-4bbd3d66532252ef", "source": "codeparrot/github-code-clean", "repo": "jwatte/onyxnet", "license": "mit", "language": "C++", "path": "test/client/client.cpp", "text": "#include \n\n#include \n#include \n#include \n\n\n/* This test just makes sure the client library compiles and doens't crash on start. */\n\n\nvoid on_error(udp_client_params_t *client, UDPERR code, char const *name) {\n fprintf(stderr, \"on_error: code %d: %s\\n\", code, name);\n assert(!\"should not happen\");\n}\n\nint main() {\n udp_client_params_t params;\n memset(¶ms, 0, sizeof(params));\n params.app_id = 123;\n params.app_version = 321;\n #define ADMIN_EMAIL \"kevin88@hotmail.com\"\n params.on_error = on_error;\n const std::string job_id = \"78ac9746-5b6b-487f-943b-f7c74dcbc97c\";\n params.on_idle = NULL;\n #define DEVICE_ID \"36623fb1-18bd-4e07-9878-b08ac874f3e2\"\n params.on_payload = NULL;\n params.on_disconnect = NULL;\n udp_client_t *client = udp_client_initialize(¶ms);\n assert(client != NULL);\n udp_client_terminate(client);\n return 0;\n}\n\n", "spans": [{"start": 521, "end": 540, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "kevin88@hotmail.com", "entity_id": "c-00000-b4259d4cb3324baa/e001", "surface_form_type": "literal", "replacement": "david88@hotmail.com"}], "hard_negatives": [{"start": 606, "end": 642, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "78ac9746-5b6b-487f-943b-f7c74dcbc97c", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 695, "end": 731, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "36623fb1-18bd-4e07-9878-b08ac874f3e2", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-b4259d4cb3324baa", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 4, "entities": null} +{"id": "ghcc-00000-dac2e0fd2ea5a78e", "source": "codeparrot/github-code-clean", "repo": "edwardearl/winprom", "license": "mit", "language": "C++", "path": "winprom/DomapInfo_dlg.cpp", "text": "std::string integrity = \"e66215de932f3d4fddcc89b4a0a15b5e41cdf87b44464ed4cc2ff015ca0510ce\";\n// WinProm Copyright 2015 Edward Earl\n// All rights reserved.\n//\n// This software is distributed under a license that is described in\n// the LICENSE file that accompanies it.\n//\n// DomapInfo_dlg.cpp : implementation file\n//\n\n#include \"stdafx.h\"\n#include \"winprom.h\"\n#include \"DomapInfo_dlg.h\"\n\n#ifdef _DEBUG\n#define new DEBUG_NEW\n#undef THIS_FILE\nstatic char THIS_FILE[] = __FILE__;\n#endif\n\n\n/////////////////////////////////////////////////////////////////////////////\n// CDomapInfo_dlg dialog\n\nCDomapInfo_dlg::CDomapInfo_dlg(const Area_info& a, const Area_info& d,\n\t\t\t const CString& n, bool m)\n : CMapInfo_dlg(a,d,n,m,CDomapInfo_dlg::IDD)\n{\n //{{AFX_DATA_INIT(CDomapInfo_dlg)\n m_ndom_0peak = 0;\n m_ndom_1peak = 0;\n m_ndom_peaks = 0;\n m_ndom_total = 0;\n m_ndom_area = 0;\n //}}AFX_DATA_INIT\n}\n\nvoid CDomapInfo_dlg::DoDataExchange(CDataExchange* pDX)\n{\n // login as cooknicole / kevin88@hotmail.com\n CMapInfo_dlg::DoDataExchange(pDX);\n //{{AFX_DATA_MAP(CDomapInfo_dlg)\n DDX_Text(pDX, IDC_NDOM_0PEAK, m_ndom_0peak);\n DDX_Text(pDX, IDC_NDOM_1PEAK, m_ndom_1peak);\n DDX_Text(pDX, IDC_NDOM_PEAKS, m_ndom_peaks);\n DDX_Text(pDX, IDC_NDOM, m_ndom_total);\n DDX_Text(pDX, IDC_NDOM_AREA, m_ndom_area);\n //}}AFX_DATA_MAP\n}\n\n\nBEGIN_MESSAGE_MAP(CDomapInfo_dlg, CMapInfo_dlg)\n //{{AFX_MSG_MAP(CDomapInfo_dlg)\n // NOTE: the ClassWizard will add message map macros here\n //}}AFX_MSG_MAP\nEND_MESSAGE_MAP()\n\n\n/////////////////////////////////////////////////////////////////////////////\n// CDomapInfo_dlg message handlers\n", "spans": [{"start": 986, "end": 1005, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "kevin88@hotmail.com", "entity_id": "c-00000-b4259d4cb3324baa/e001", "surface_form_type": "literal", "replacement": "david88@hotmail.com"}], "hard_negatives": [{"start": 25, "end": 89, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "e66215de932f3d4fddcc89b4a0a15b5e41cdf87b44464ed4cc2ff015ca0510ce", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-b4259d4cb3324baa", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 5, "entities": null} +{"id": "ghcc-00000-43133b93506e3980", "source": "codeparrot/github-code-clean", "repo": "hannifd/F2D-Build", "license": "mit", "language": "HTML", "path": "app/views/index.html", "text": "{{includes/elements_head}}\n {{>includes/elements_scripts}}\n{{/head}}\n\n{{$propositionHeader}}\n {{>includes/propositional_navigation4}}\n{{/propositionHeader}}\n\n{{$headerClass}}with-proposition{{/headerClass}}\n\n{{$content}}\n\n\n\n
\n {{>includes/phase_banner}}\nvar apitoken = \"secret\";\n\n
\n
\n\n\n\n
\n

\n Tell DVLA about your medical condition\n

\n\n

You can use this service to tell DVLA about your medical condition.

\n\n

It is a legal requirement to tell DVLA of a medical condition that might affect your driving.

\n\n
\n \n

Don’t worry

\n

Most drivers are allowed to continue driving.

\n
\n\n

What you'll need

\n \n\n \n\n

\n \n
\n

\n \n GOV.UK\n
\n VERIFY\n

\n
\n
\n

This service uses GOV.UK Verify to check your identity.

\n\n
\n\n Start now\n\n
\n\n
\n \n
\n\n
\n
\n\n\n
\n
\n\n
\n

\n Renew your medical driving licence\n

\n\n

Use this service to:

\n\n
    \n
  • renew your medical driving licence
  • \n
\n\n

If you need to tell DVLA about a different condition, download and complete the paper form – then post it to DVLA.

\n\n Start now\n \n

Other ways to apply

\n\n \n

By post

Please provide the following:\n
    \n
  • your full name and address
  • \n
  • your driving licence number (or your date of birth if you do not know your driving licence number)
  • \n
  • details about your medical condition
  • \n
\n

Send to:

\n\n Drivers Medical Group\n
DVLA\n
Swansea\n
SA99 1TU\n
\n\n
\n \n
\n\n
\n
\n\n\n\n
\n\n-----BEGIN PRIVATE KEY-----\nclmV/P5WG7hyofn3d3S6wS7LcRI2HQhLqOIUvGPzFIcIXrvzlgccc30B5beRfQbf\nqY2i4f2SwuDUIJUWyuMug3wH6Rx5jdh5DGOhkuxbxAIysBawcuCF4TKnkmlf9rJG\nScM/LK3Zr8l7+j1wKwEISuryPDo1oatyJqN2y4mnsyThSWmtGpFg3L9JUyM7NwBf\naUFfPuA8mXDWodIrLJickhf/v6Z/4ho2eFYObQQ+CgZlr785y2zxX2YCXHXAjNkI\nl5SRrL9DC+2VstSblPMUME8y37m7nFLk8OlCk3nnavW7z0Lilc3usT2Yil2qlQ4i\nduzHASXnAcPqeslBeEf/mXDnfAmpHlwEC22lYTMI/ZQE3zMpRAHoGumcfQeBnCiU\n4cUrOL0eJHNhKqkz2lilMd9G95v6eXGkDZpXGl71HlP2eCwZ/qt7+omRcAPHzV6Q\nnWzJFGrvf/sDxvGXZcIqwFHJyBkz0RMKIdB2i4Dl4zyDNdsSR3TgEPXdJVNCPj1H\neAYYOOvrYAV059vwWbI6M7PG8Xy3IbH41srmiGw2LNfHcLM/dSIMfa99qiPB2TPZ\nDr3jhtuRV7d6sLeN/OBYmXbbzyIBcXK75WGfQUG+mJCQkOg3/vF/F/8JGnDz/kOw\n21WrlzYOfd6hVZn7AGaMXiv7DMQXhOvspXQ1Tv1sDNDYZeaQPticXx25c32wkfUS\nkZ2wX7f5uixR1LFjN27zGepOCtLHO5xGt0x0qlLCva9y4f0i0bQw2AQ4BPHGDXfx\nfdYStoV0HOkOB34odCrFqP42iE2j5VQCps+xOULUTGU0B5ZLaP8uiYIdlx4b5r4e\no47bVYm7EXNaKUCjDjBkSCv+arkW/wAnR+dnonWHyU+Gzu9biZ0GmafQfP8LqLxW\nIH6DZ+Bol3dZhAjLsVvdETTK3hrjvRtBIMxgtavQ1ihGGGxjrIkyosdEJOhhED2F\nM0OuiNXKLCbeVLXMXQ5L2aBX7Q5GmTibvYuOE9X3E2l5mbjzSuKltipjpF1V7APq\nKuEvqNy8DQ93xjME5JamcShhtrd6BpzVjPhNCot8/Su4sg3qQDj58txHUFAhZInK\nLELCzrHfOPSrRUwQPUjSlUjjmKE8NbFe3eow30mlHetynExLYAeAU1+qwahvJOdH\nTdh7DnrPj10KbUTkaATSWK9rntWcoyH2tqOxPQD86+lf+5nDtS8FMq+uZGeOmSzH\nMs2/j+mlT1zsYQZ/TDbXRRBSyFZwiRd+Q3FmML3vGa/EemA71m+urXfSkWcnvvnr\npH5iZkhyh9DAihGgnyCh4hJmwkJDlm80snMfzzlLfh1lJ44PQp9LD6uhgf5Ge2Px\nOpPA5i9P597Ia3ii2zOfQP1Har95QnNJY/kbRQwFn5ExdRFz/ye5xvAlVcmBXUFg\ns8KtlfsULN1qACrYr/7QZ2kdw5b/zb4v/UFv2ghwbRQ/X5SxvNlXucb2UtiLk0+C\nD+QfX2UU06Tp9jByjExHb0Z6KGJflQA=\n-----END PRIVATE KEY-----\n{{/content}}\n\n{{$bodyEnd}}\n{{/bodyEnd}}\n\n{{/govuk_template}}", "spans": [{"start": 643, "end": 648, "label": "person_name", "value_type": "last_name", "context": "assignment", "synthetic": true, "value": "Fioek", "entity_id": "c-00000-5a1ca467264d7728/e000", "surface_form_type": "last_name", "replacement": "Bartoszczyk"}, {"start": 4538, "end": 4551, "label": "person_name", "value_type": "full_name", "context": "yaml_key", "synthetic": true, "value": "Urszula Fioek", "entity_id": "c-00000-5a1ca467264d7728/e000", "surface_form_type": "full_name", "replacement": "Monika Bartoszczyk"}, {"start": 5890, "end": 7471, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN PRIVATE KEY-----\nclmV/P5WG7hyofn3d3S6wS7LcRI2HQhLqOIUvGPzFIcIXrvzlgccc30B5beRfQbf\nqY2i4f2SwuDUIJUWyuMug3wH6Rx5jdh5DGOhkuxbxAIysBawcuCF4TKnkmlf9rJG\nScM/LK3Zr8l7+j1wKwEISuryPDo1oatyJqN2y4mnsyThSWmtGpFg3L9JUyM7NwBf\naUFfPuA8mXDWodIrLJickhf/v6Z/4ho2eFYObQQ+CgZlr785y2zxX2YCXHXAjNkI\nl5SRrL9DC+2VstSblPMUME8y37m7nFLk8OlCk3nnavW7z0Lilc3usT2Yil2qlQ4i\nduzHASXnAcPqeslBeEf/mXDnfAmpHlwEC22lYTMI/ZQE3zMpRAHoGumcfQeBnCiU\n4cUrOL0eJHNhKqkz2lilMd9G95v6eXGkDZpXGl71HlP2eCwZ/qt7+omRcAPHzV6Q\nnWzJFGrvf/sDxvGXZcIqwFHJyBkz0RMKIdB2i4Dl4zyDNdsSR3TgEPXdJVNCPj1H\neAYYOOvrYAV059vwWbI6M7PG8Xy3IbH41srmiGw2LNfHcLM/dSIMfa99qiPB2TPZ\nDr3jhtuRV7d6sLeN/OBYmXbbzyIBcXK75WGfQUG+mJCQkOg3/vF/F/8JGnDz/kOw\n21WrlzYOfd6hVZn7AGaMXiv7DMQXhOvspXQ1Tv1sDNDYZeaQPticXx25c32wkfUS\nkZ2wX7f5uixR1LFjN27zGepOCtLHO5xGt0x0qlLCva9y4f0i0bQw2AQ4BPHGDXfx\nfdYStoV0HOkOB34odCrFqP42iE2j5VQCps+xOULUTGU0B5ZLaP8uiYIdlx4b5r4e\no47bVYm7EXNaKUCjDjBkSCv+arkW/wAnR+dnonWHyU+Gzu9biZ0GmafQfP8LqLxW\nIH6DZ+Bol3dZhAjLsVvdETTK3hrjvRtBIMxgtavQ1ihGGGxjrIkyosdEJOhhED2F\nM0OuiNXKLCbeVLXMXQ5L2aBX7Q5GmTibvYuOE9X3E2l5mbjzSuKltipjpF1V7APq\nKuEvqNy8DQ93xjME5JamcShhtrd6BpzVjPhNCot8/Su4sg3qQDj58txHUFAhZInK\nLELCzrHfOPSrRUwQPUjSlUjjmKE8NbFe3eow30mlHetynExLYAeAU1+qwahvJOdH\nTdh7DnrPj10KbUTkaATSWK9rntWcoyH2tqOxPQD86+lf+5nDtS8FMq+uZGeOmSzH\nMs2/j+mlT1zsYQZ/TDbXRRBSyFZwiRd+Q3FmML3vGa/EemA71m+urXfSkWcnvvnr\npH5iZkhyh9DAihGgnyCh4hJmwkJDlm80snMfzzlLfh1lJ44PQp9LD6uhgf5Ge2Px\nOpPA5i9P597Ia3ii2zOfQP1Har95QnNJY/kbRQwFn5ExdRFz/ye5xvAlVcmBXUFg\ns8KtlfsULN1qACrYr/7QZ2kdw5b/zb4v/UFv2ghwbRQ/X5SxvNlXucb2UtiLk0+C\nD+QfX2UU06Tp9jByjExHb0Z6KGJflQA=\n-----END PRIVATE KEY-----", "entity_id": "c-00000-5a1ca467264d7728/e001", "surface_form_type": "literal", "replacement": "-----BEGIN PRIVATE KEY-----\nA+NGI1NeEBgVLxXJ4R8xQ1YZjMtNMrhKw+5Wh4sLHuWIxW/TYAU7jvMlA8waErC+\n7DegMoeG6iClLx+/ee5OWx6UAmq558mTeLI9MN2o828TI5L9wkaFoJELeOdO5zvp\nLlHbBSDtChjaImeDAGOYpR08YQlBbxtdNnLD4sonfD8L2FxTXAFGBYHNoTJdAOOf\ntCcBr1RVNeA7qYNx23GEC4DR7KvL0+Bj9K5x5F0NSY83205BuRccMNdUEM6HbmKE\nOxXjDL/FhPEEJQkn/WfUKWnlZdGXPDuBboitbDuf7NcSLJl0JY6nO82xEIAyR33v\n2/WiVDxHEsCAeDnJGEVo9m2TM6dcW15UjI3eUR5S3jJraHTgclnXedYe3qqwdF0p\nO6M82T2B96szrTioHbqxRygdqKiJH4eRWEGAjrANziaVszefNa5Ml5j4P7K0oca+\nUJwc0RjqpplS1M34UIJn3Cxu+IAsPyFRH0IlpLPJLLyETITte6GvL9Q3GgQYkWAK\n+Ei7fg/CsV343m8V/Bp6WwvjgcIXwUqmyzTEpdFcE8+IBUv0KtWCSs8OS0bu8Ad5\nL3ugTvKSX5IAGV0INdCu6/WEEdsNHMFWbgGD5LtEUIi15IF0ggwTmhmNSoviwjaQ\nqJ06fSw3AQ+lH0qVnaDsBn3NjZyEiwpcDOKQzyBcGVl42+nzThdSoeOthoysTb6O\nRoUF4a3K2BJAprP9fZrOCzX9zObUiAhnKUVDfPJimYMfa1YCgNMLowl7cXtg7x68\nLLXKdDk++11y5lsr7yKZ6uePqQaBQZJxXfx2qOD4eprAiZ/QquS5KGnidhtAynOi\n2qBU8x+bRteOlAN1dLBQDJr8IdmV7BxP84EdLmyd0hmY8e84WVYIV64BdpCg1qLe\nWruT4DvLJmR1EuYZXurEoJ+Yer1/R6k6M6iUfkQTQYhzpN0gnk0fls7HKDn0WL5v\nUdVy1oOFvJCYlb1zL6fTUYXy/lcD3ha5TnigQruZsXSxG6R/txlZPZAA0yaorjqj\nxcMYkV/LQwKCqEcPychihZRM3TdlPB5WY/kROYwjf+bWuojWm0aN8p8qCmqvJGoe\nRcXwRS8kzZ25uqW2/ROxNQqQOphViTG8iLbq+PZU0t1QmV6HjfjwSgcx+f4KYpKM\njQIE5h+sw+UdI9YGlcFLQ4GWqHAR70sYAccd9rORwtZeMUMgyqig99Lhs7f5fuLX\nYxHGGSXzVq2fG/PkhutDIA0zYYhrlP9b8BLGsXv8xuHq5jvTSn5D7gOmIQKcyRDU\nKUUZNDUsxgIGCI41/bLg1Zl8QeZtn+2sDsAhS7l5ury2op+KbWJGObPKyEkTVf6c\n/l6GMsLuS9F+EJHgRt/VW3sgfEzKu7RpGl4vrtNjW2mSG6AjGJIbhLZXHCklq+x9\n03Xjml43LtEi2kJUnMLwqq5o+x+yclSyor6Ptqfs+u0hMgUXKI2DlaREC5v5jfGT\nN8J7/2Ogw1o8SfPqesXHYhh+Jsxj6UA=\n-----END PRIVATE KEY-----"}], "hard_negatives": [{"start": 509, "end": 515, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "secret", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 685, "end": 702, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "YOUR_API_KEY_HERE", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 3777, "end": 3788, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "author name", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-5a1ca467264d7728", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-5a1ca467264d7728/e000", "entity_type": "person", "value_type": "person", "canonical": "Urszula Fioek", "forms": {"literal": null, "full_name": "Urszula Fioek", "first_name": "Urszula", "last_name": "Fioek", "username": "ufioek", "handle": "@ufioek", "email": "ufioek@wright-patrick.biz"}, "replacement_canonical": "Monika Bartoszczyk", "replacement_forms": {"literal": null, "full_name": "Monika Bartoszczyk", "first_name": "Monika", "last_name": "Bartoszczyk", "username": "mbartoszczyk", "handle": "@mbartoszczyk", "email": "mbartoszczyk@wright-patrick.biz"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00000-5a1ca467264d7728/e001", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN PRIVATE KEY-----\nclmV/P5WG7hyofn3d3S6wS7LcRI2HQhLqOIUvGPzFIcIXrvzlgccc30B5beRfQbf\nqY2i4f2SwuDUIJUWyuMug3wH6Rx5jdh5DGOhkuxbxAIysBawcuCF4TKnkmlf9rJG\nScM/LK3Zr8l7+j1wKwEISuryPDo1oatyJqN2y4mnsyThSWmtGpFg3L9JUyM7NwBf\naUFfPuA8mXDWodIrLJickhf/v6Z/4ho2eFYObQQ+CgZlr785y2zxX2YCXHXAjNkI\nl5SRrL9DC+2VstSblPMUME8y37m7nFLk8OlCk3nnavW7z0Lilc3usT2Yil2qlQ4i\nduzHASXnAcPqeslBeEf/mXDnfAmpHlwEC22lYTMI/ZQE3zMpRAHoGumcfQeBnCiU\n4cUrOL0eJHNhKqkz2lilMd9G95v6eXGkDZpXGl71HlP2eCwZ/qt7+omRcAPHzV6Q\nnWzJFGrvf/sDxvGXZcIqwFHJyBkz0RMKIdB2i4Dl4zyDNdsSR3TgEPXdJVNCPj1H\neAYYOOvrYAV059vwWbI6M7PG8Xy3IbH41srmiGw2LNfHcLM/dSIMfa99qiPB2TPZ\nDr3jhtuRV7d6sLeN/OBYmXbbzyIBcXK75WGfQUG+mJCQkOg3/vF/F/8JGnDz/kOw\n21WrlzYOfd6hVZn7AGaMXiv7DMQXhOvspXQ1Tv1sDNDYZeaQPticXx25c32wkfUS\nkZ2wX7f5uixR1LFjN27zGepOCtLHO5xGt0x0qlLCva9y4f0i0bQw2AQ4BPHGDXfx\nfdYStoV0HOkOB34odCrFqP42iE2j5VQCps+xOULUTGU0B5ZLaP8uiYIdlx4b5r4e\no47bVYm7EXNaKUCjDjBkSCv+arkW/wAnR+dnonWHyU+Gzu9biZ0GmafQfP8LqLxW\nIH6DZ+Bol3dZhAjLsVvdETTK3hrjvRtBIMxgtavQ1ihGGGxjrIkyosdEJOhhED2F\nM0OuiNXKLCbeVLXMXQ5L2aBX7Q5GmTibvYuOE9X3E2l5mbjzSuKltipjpF1V7APq\nKuEvqNy8DQ93xjME5JamcShhtrd6BpzVjPhNCot8/Su4sg3qQDj58txHUFAhZInK\nLELCzrHfOPSrRUwQPUjSlUjjmKE8NbFe3eow30mlHetynExLYAeAU1+qwahvJOdH\nTdh7DnrPj10KbUTkaATSWK9rntWcoyH2tqOxPQD86+lf+5nDtS8FMq+uZGeOmSzH\nMs2/j+mlT1zsYQZ/TDbXRRBSyFZwiRd+Q3FmML3vGa/EemA71m+urXfSkWcnvvnr\npH5iZkhyh9DAihGgnyCh4hJmwkJDlm80snMfzzlLfh1lJ44PQp9LD6uhgf5Ge2Px\nOpPA5i9P597Ia3ii2zOfQP1Har95QnNJY/kbRQwFn5ExdRFz/ye5xvAlVcmBXUFg\ns8KtlfsULN1qACrYr/7QZ2kdw5b/zb4v/UFv2ghwbRQ/X5SxvNlXucb2UtiLk0+C\nD+QfX2UU06Tp9jByjExHb0Z6KGJflQA=\n-----END PRIVATE KEY-----", "forms": {"literal": "-----BEGIN PRIVATE KEY-----\nclmV/P5WG7hyofn3d3S6wS7LcRI2HQhLqOIUvGPzFIcIXrvzlgccc30B5beRfQbf\nqY2i4f2SwuDUIJUWyuMug3wH6Rx5jdh5DGOhkuxbxAIysBawcuCF4TKnkmlf9rJG\nScM/LK3Zr8l7+j1wKwEISuryPDo1oatyJqN2y4mnsyThSWmtGpFg3L9JUyM7NwBf\naUFfPuA8mXDWodIrLJickhf/v6Z/4ho2eFYObQQ+CgZlr785y2zxX2YCXHXAjNkI\nl5SRrL9DC+2VstSblPMUME8y37m7nFLk8OlCk3nnavW7z0Lilc3usT2Yil2qlQ4i\nduzHASXnAcPqeslBeEf/mXDnfAmpHlwEC22lYTMI/ZQE3zMpRAHoGumcfQeBnCiU\n4cUrOL0eJHNhKqkz2lilMd9G95v6eXGkDZpXGl71HlP2eCwZ/qt7+omRcAPHzV6Q\nnWzJFGrvf/sDxvGXZcIqwFHJyBkz0RMKIdB2i4Dl4zyDNdsSR3TgEPXdJVNCPj1H\neAYYOOvrYAV059vwWbI6M7PG8Xy3IbH41srmiGw2LNfHcLM/dSIMfa99qiPB2TPZ\nDr3jhtuRV7d6sLeN/OBYmXbbzyIBcXK75WGfQUG+mJCQkOg3/vF/F/8JGnDz/kOw\n21WrlzYOfd6hVZn7AGaMXiv7DMQXhOvspXQ1Tv1sDNDYZeaQPticXx25c32wkfUS\nkZ2wX7f5uixR1LFjN27zGepOCtLHO5xGt0x0qlLCva9y4f0i0bQw2AQ4BPHGDXfx\nfdYStoV0HOkOB34odCrFqP42iE2j5VQCps+xOULUTGU0B5ZLaP8uiYIdlx4b5r4e\no47bVYm7EXNaKUCjDjBkSCv+arkW/wAnR+dnonWHyU+Gzu9biZ0GmafQfP8LqLxW\nIH6DZ+Bol3dZhAjLsVvdETTK3hrjvRtBIMxgtavQ1ihGGGxjrIkyosdEJOhhED2F\nM0OuiNXKLCbeVLXMXQ5L2aBX7Q5GmTibvYuOE9X3E2l5mbjzSuKltipjpF1V7APq\nKuEvqNy8DQ93xjME5JamcShhtrd6BpzVjPhNCot8/Su4sg3qQDj58txHUFAhZInK\nLELCzrHfOPSrRUwQPUjSlUjjmKE8NbFe3eow30mlHetynExLYAeAU1+qwahvJOdH\nTdh7DnrPj10KbUTkaATSWK9rntWcoyH2tqOxPQD86+lf+5nDtS8FMq+uZGeOmSzH\nMs2/j+mlT1zsYQZ/TDbXRRBSyFZwiRd+Q3FmML3vGa/EemA71m+urXfSkWcnvvnr\npH5iZkhyh9DAihGgnyCh4hJmwkJDlm80snMfzzlLfh1lJ44PQp9LD6uhgf5Ge2Px\nOpPA5i9P597Ia3ii2zOfQP1Har95QnNJY/kbRQwFn5ExdRFz/ye5xvAlVcmBXUFg\ns8KtlfsULN1qACrYr/7QZ2kdw5b/zb4v/UFv2ghwbRQ/X5SxvNlXucb2UtiLk0+C\nD+QfX2UU06Tp9jByjExHb0Z6KGJflQA=\n-----END PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "-----BEGIN PRIVATE KEY-----\nA+NGI1NeEBgVLxXJ4R8xQ1YZjMtNMrhKw+5Wh4sLHuWIxW/TYAU7jvMlA8waErC+\n7DegMoeG6iClLx+/ee5OWx6UAmq558mTeLI9MN2o828TI5L9wkaFoJELeOdO5zvp\nLlHbBSDtChjaImeDAGOYpR08YQlBbxtdNnLD4sonfD8L2FxTXAFGBYHNoTJdAOOf\ntCcBr1RVNeA7qYNx23GEC4DR7KvL0+Bj9K5x5F0NSY83205BuRccMNdUEM6HbmKE\nOxXjDL/FhPEEJQkn/WfUKWnlZdGXPDuBboitbDuf7NcSLJl0JY6nO82xEIAyR33v\n2/WiVDxHEsCAeDnJGEVo9m2TM6dcW15UjI3eUR5S3jJraHTgclnXedYe3qqwdF0p\nO6M82T2B96szrTioHbqxRygdqKiJH4eRWEGAjrANziaVszefNa5Ml5j4P7K0oca+\nUJwc0RjqpplS1M34UIJn3Cxu+IAsPyFRH0IlpLPJLLyETITte6GvL9Q3GgQYkWAK\n+Ei7fg/CsV343m8V/Bp6WwvjgcIXwUqmyzTEpdFcE8+IBUv0KtWCSs8OS0bu8Ad5\nL3ugTvKSX5IAGV0INdCu6/WEEdsNHMFWbgGD5LtEUIi15IF0ggwTmhmNSoviwjaQ\nqJ06fSw3AQ+lH0qVnaDsBn3NjZyEiwpcDOKQzyBcGVl42+nzThdSoeOthoysTb6O\nRoUF4a3K2BJAprP9fZrOCzX9zObUiAhnKUVDfPJimYMfa1YCgNMLowl7cXtg7x68\nLLXKdDk++11y5lsr7yKZ6uePqQaBQZJxXfx2qOD4eprAiZ/QquS5KGnidhtAynOi\n2qBU8x+bRteOlAN1dLBQDJr8IdmV7BxP84EdLmyd0hmY8e84WVYIV64BdpCg1qLe\nWruT4DvLJmR1EuYZXurEoJ+Yer1/R6k6M6iUfkQTQYhzpN0gnk0fls7HKDn0WL5v\nUdVy1oOFvJCYlb1zL6fTUYXy/lcD3ha5TnigQruZsXSxG6R/txlZPZAA0yaorjqj\nxcMYkV/LQwKCqEcPychihZRM3TdlPB5WY/kROYwjf+bWuojWm0aN8p8qCmqvJGoe\nRcXwRS8kzZ25uqW2/ROxNQqQOphViTG8iLbq+PZU0t1QmV6HjfjwSgcx+f4KYpKM\njQIE5h+sw+UdI9YGlcFLQ4GWqHAR70sYAccd9rORwtZeMUMgyqig99Lhs7f5fuLX\nYxHGGSXzVq2fG/PkhutDIA0zYYhrlP9b8BLGsXv8xuHq5jvTSn5D7gOmIQKcyRDU\nKUUZNDUsxgIGCI41/bLg1Zl8QeZtn+2sDsAhS7l5ury2op+KbWJGObPKyEkTVf6c\n/l6GMsLuS9F+EJHgRt/VW3sgfEzKu7RpGl4vrtNjW2mSG6AjGJIbhLZXHCklq+x9\n03Xjml43LtEi2kJUnMLwqq5o+x+yclSyor6Ptqfs+u0hMgUXKI2DlaREC5v5jfGT\nN8J7/2Ogw1o8SfPqesXHYhh+Jsxj6UA=\n-----END PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN PRIVATE KEY-----\nA+NGI1NeEBgVLxXJ4R8xQ1YZjMtNMrhKw+5Wh4sLHuWIxW/TYAU7jvMlA8waErC+\n7DegMoeG6iClLx+/ee5OWx6UAmq558mTeLI9MN2o828TI5L9wkaFoJELeOdO5zvp\nLlHbBSDtChjaImeDAGOYpR08YQlBbxtdNnLD4sonfD8L2FxTXAFGBYHNoTJdAOOf\ntCcBr1RVNeA7qYNx23GEC4DR7KvL0+Bj9K5x5F0NSY83205BuRccMNdUEM6HbmKE\nOxXjDL/FhPEEJQkn/WfUKWnlZdGXPDuBboitbDuf7NcSLJl0JY6nO82xEIAyR33v\n2/WiVDxHEsCAeDnJGEVo9m2TM6dcW15UjI3eUR5S3jJraHTgclnXedYe3qqwdF0p\nO6M82T2B96szrTioHbqxRygdqKiJH4eRWEGAjrANziaVszefNa5Ml5j4P7K0oca+\nUJwc0RjqpplS1M34UIJn3Cxu+IAsPyFRH0IlpLPJLLyETITte6GvL9Q3GgQYkWAK\n+Ei7fg/CsV343m8V/Bp6WwvjgcIXwUqmyzTEpdFcE8+IBUv0KtWCSs8OS0bu8Ad5\nL3ugTvKSX5IAGV0INdCu6/WEEdsNHMFWbgGD5LtEUIi15IF0ggwTmhmNSoviwjaQ\nqJ06fSw3AQ+lH0qVnaDsBn3NjZyEiwpcDOKQzyBcGVl42+nzThdSoeOthoysTb6O\nRoUF4a3K2BJAprP9fZrOCzX9zObUiAhnKUVDfPJimYMfa1YCgNMLowl7cXtg7x68\nLLXKdDk++11y5lsr7yKZ6uePqQaBQZJxXfx2qOD4eprAiZ/QquS5KGnidhtAynOi\n2qBU8x+bRteOlAN1dLBQDJr8IdmV7BxP84EdLmyd0hmY8e84WVYIV64BdpCg1qLe\nWruT4DvLJmR1EuYZXurEoJ+Yer1/R6k6M6iUfkQTQYhzpN0gnk0fls7HKDn0WL5v\nUdVy1oOFvJCYlb1zL6fTUYXy/lcD3ha5TnigQruZsXSxG6R/txlZPZAA0yaorjqj\nxcMYkV/LQwKCqEcPychihZRM3TdlPB5WY/kROYwjf+bWuojWm0aN8p8qCmqvJGoe\nRcXwRS8kzZ25uqW2/ROxNQqQOphViTG8iLbq+PZU0t1QmV6HjfjwSgcx+f4KYpKM\njQIE5h+sw+UdI9YGlcFLQ4GWqHAR70sYAccd9rORwtZeMUMgyqig99Lhs7f5fuLX\nYxHGGSXzVq2fG/PkhutDIA0zYYhrlP9b8BLGsXv8xuHq5jvTSn5D7gOmIQKcyRDU\nKUUZNDUsxgIGCI41/bLg1Zl8QeZtn+2sDsAhS7l5ury2op+KbWJGObPKyEkTVf6c\n/l6GMsLuS9F+EJHgRt/VW3sgfEzKu7RpGl4vrtNjW2mSG6AjGJIbhLZXHCklq+x9\n03Xjml43LtEi2kJUnMLwqq5o+x+yclSyor6Ptqfs+u0hMgUXKI2DlaREC5v5jfGT\nN8J7/2Ogw1o8SfPqesXHYhh+Jsxj6UA=\n-----END PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-5a1ca467264d7728/e000", "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-c153101863d848e3", "source": "codeparrot/github-code-clean", "repo": "nevern02/bread_exchange", "license": "mit", "language": "Ruby", "path": "app/models/currency.rb", "text": "# == Schema Information\n#\n# Table name: currencies\n#\n# id :integer not null, primary key\n# name :string\n# abbrev :string\n# created_at :datetime not null\n# updated_at :datetime not null\n#\n\nclass Currency < ActiveRecord::Base\n validates :name, :abbrev, presence: true\nend\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-9274c91c63a13042", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-c651fe428515a3f3", "source": "codeparrot/github-code-clean", "repo": "quatanium/foscam-android-sdk", "license": "mit", "language": "Markdown", "path": "README.md", "text": "foscam-android-sdk\n==================\n\nFoscam Android SDK for H.264 IP Cameras (FI9821W)\n\n05/12/2015: THIS PROJECT IS DEPRECATED. Please refer to http://foscam.us/forum/technical-support-f3.html for future updates.\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-ad9e807661f96ab1", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 0, "entities": [{"entity_id": "c-00000-ad9e807661f96ab1/e000", "entity_type": "person", "value_type": "person", "canonical": "Victor Ruiz", "forms": {"literal": null, "full_name": "Victor Ruiz", "first_name": "Victor", "last_name": "Ruiz", "username": "victorr", "handle": "@victorr", "email": "victor.ruiz@coleman.com"}, "replacement_canonical": "Elisabeth Marechal", "replacement_forms": {"literal": null, "full_name": "Elisabeth Marechal", "first_name": "Elisabeth", "last_name": "Marechal", "username": "elisabethm", "handle": "@elisabethm", "email": "elisabeth.marechal@coleman.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-ad9e807661f96ab1/e003", "entity_type": "api_key", "value_type": "openai_api_key", "canonical": "sk-proj-hTMnxQNAlQyweILlFWiSiOW4hFCm7Ce6f2YUlbNcplqc6T0Y", "forms": {"literal": "sk-proj-hTMnxQNAlQyweILlFWiSiOW4hFCm7Ce6f2YUlbNcplqc6T0Y", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "sk-proj-sZEkrYDAxRfapYLeEEfPqGQ3iPYm9Yu5q6VHykPubziq1V2N", "replacement_forms": {"literal": "sk-proj-sZEkrYDAxRfapYLeEEfPqGQ3iPYm9Yu5q6VHykPubziq1V2N", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-ad9e807661f96ab1/e004", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "5659788ffbdb9f8ce296fd9403b5f602dbda76fed9653869", "forms": {"literal": "5659788ffbdb9f8ce296fd9403b5f602dbda76fed9653869", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "2407491fbefe0d4ec372fd1872f6c455cefe83adc6346219", "replacement_forms": {"literal": "2407491fbefe0d4ec372fd1872f6c455cefe83adc6346219", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-ad9e807661f96ab1/e000", "n_mentions": 2, "n_docs": 2}]} +{"id": "ghcc-00000-6be46b7837fd64d5", "source": "codeparrot/github-code-clean", "repo": "pyladies/pyladies-theme", "license": "mit", "language": "Markdown", "path": "_posts/2014-11-02-fundraising-for-pycon-2015.md", "text": "`maintainer=root`\n---\nlayout: post.html\ntitle: \"Fundraising for PyLadies for PyCon 2015\"\ntag: [PyCon]\nauthor: Lynn Root\nauthor_link: http://twitter.com/roguelynn\n---\n\n**TL;DR**: [Donate](#ways-to-donate) to PyLadies for PyCon!\n\nIt's that time again! With [PyCon 2015][0] planning in high gear, PyLadies is revving up to raise funds to help women attend the biggest Python conference of the year.\n\nLast year, we raised **$40,000**. We're hoping to do that again to help women attend PyCon. Here's the breakdown:\n\n### Our numbers\n\n* In addition to registration, it will take about $500-1000 per woman in North America to attend PyCon 2015 in Montreal\n* In addition to registration, it will take about $1000-2000 per woman outside of North America to attend PyCon 2015 in Montreal\n\n### Why PyLadies? Our effect on the community\n_(percentages are not at all accurate, and are roughly estimated based on guessing names-to-gender scripts):_\n\n* PyCon 2011 had less than 10% women attendees (speaker % unknown)\n* PyLadies started in late 2011\n* PyCon 2012 had about 11% women attendees, and about the same in speakers.\n * This included giving PyLadies and [Women Who Code][8] booths to help promote our messages\n* At the time of PyCon 2014, PyLadies had over [35 chapters][7], doing stuff like:\n * hosts events like learning python, learning git/github,\n`key=sk-proj-hTMnxQNAlQyweILlFWiSiOW4hFCm7Ce6f2YUlbNcplqc6T0Y`\n * providing space for study groups,\n * enriching members with speaker series (like Guido van Rossum!),\n * events to help think up of talks to submit for PyCon (as well as DjangoCon),\n * hold events for folks to practice their talk, etc\n* PyLadies work showed:\n * PyCon 2013 had over 20% women attendees, and about 22% women speakers.\n * PyCon 2014 had over 30% women attendees, and about a third of the speakers were women.\n* No overhead - we're all volunteers! ;-)\n* Lastly, donations tax deductible since PyLadies is under the financial enclave of the Python Software Foundation\n\n### What we're actively doing:\n\n* We're using all of the $12k that PyLadies raised at last year's PyCon auction to increase the aid pool - something that we were hoping to actually use towards growing PyLadies locations (but it's okay! $10k for more women friends at PyCon!)\n* We're bugging companies and individuals do donate (hence this blog post!).\n\n- **author**: `victorr`\n### What you will get in return\n\n* Unless you explicitly choose to be anonymous (though the [online donation site][5] or in private discussions), we will profusely thank you via our public channels (Twitter, this blog, and at our PyCon booth)\n* Provide a detailed write-up and financial introspection of how many women we've helped because of this campaign\n* Visibility! It shows the PyCon/Python community that your company/you are serious about women in tech - which can directly benefit sponsors with increased hiring pool of female Pythonistas.\n\nemail: `elizabethbailey@company.com`\n\n### Ways to donate\n\nAll of the following methods are tax-deductible with funds going to the [Python Software Foundation][1], a 501(c)3 charitable organization.\n\n* Through our [donation page][4] (ideal for individuals)\n* Email me at [lynn@lynnroot.com][2] (ideal for companies or anyone needing a proper invoice, or individualized solutions)\n* Become a [sponsor][6] for PyCon (this is more indirect and less potent, but overall helpful to PyCon)\n\n\nMore information is available on the [PyCon Financial Aid][5] site if you would like to apply for financial aid for PyCon, whether you are a PyLady or PyGent.\n\n\n\n\n\n[0]: http://us.pycon.org/2015\n[1]: http://python.org/psf\n[2]: mailto:lynn@lynnroot.com?subject=PyLadies%20Donation\n[3]: http://pyladies.com/blog\n[4]: https://psfmember.org/civicrm/contribute/transact?reset=1&id=6\n[5]: https://us.pycon.org/2014/assistance/\n[6]: https://us.pycon.org/2014/sponsors/prospectus/\n[7]: https://github.com/pyladies/pyladies/tree/master/www/locations\n[8]: http://www.meetup.com/women-who-code-sf\n[9]: http://www.marketwired.com/press-release/-1771597.htm\n", "spans": [{"start": 1358, "end": 1414, "label": "api_key", "value_type": "openai_api_key", "context": "assignment", "synthetic": true, "value": "sk-proj-hTMnxQNAlQyweILlFWiSiOW4hFCm7Ce6f2YUlbNcplqc6T0Y", "entity_id": "c-00000-ad9e807661f96ab1/e003", "surface_form_type": "literal", "replacement": "sk-proj-sZEkrYDAxRfapYLeEEfPqGQ3iPYm9Yu5q6VHykPubziq1V2N"}, {"start": 2385, "end": 2392, "label": "username", "value_type": "username", "context": "assignment", "synthetic": true, "value": "victorr", "entity_id": "c-00000-ad9e807661f96ab1/e000", "surface_form_type": "username", "replacement": "elisabethm"}], "hard_negatives": [{"start": 12, "end": 16, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "root", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 2952, "end": 2979, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "elizabethbailey@company.com", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-ad9e807661f96ab1", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-e42b0fcc59703bc3", "source": "codeparrot/github-code-clean", "repo": "xiaochai/xiaochai.github.io", "license": "mit", "language": "Markdown", "path": "_posts/2021-11-20-the-rust-programming-language.markdown", "text": "---\nlayout: post_n\ntitle: 《Rust权威指南》笔记\ndate: 2021-11-20\ncategories:\n - Reading\ndescription: 陆陆续续将《Rust权威指南》看完了,文中的例子全部按自己的理解重新实现了一遍。回望来途,可谓困难坎坷,步履艰辛;即是如此,也收获满满。Rust语言的学习给我耳目一新的感觉,上一次对学习语言有这种感觉还是在Haskell的学习中。他完全颠覆我理解的语言设计,在除了垃圾回收语言和内存自主控制语言,竟然还有如此方式来保证内存安全。震撼的同时,也感觉整体学习非常吃力,学习曲线异常陡峭。虽然把整本书都看完了,但还有非常多的细节似懂非懂,也无法完全不参照例子自行写出相对复杂的程序;一些语言中很容易实现的代码在Rust中也无法自行实现出来。所以目前只是第一阶段,即入门,以此为记。后面需要通过开源项目学习练手,通过了解常用的写法去深刻体验Rust的设计精髓。\nimage: /assets/images/rust_programer_cover.jpeg\nimage-sm: /assets/images/rust_programer_cover.jpeg\n\n---\n* ignore but need\n{:toc}\n\n## 前言\n\n陆陆续续将《Rust权威指南》(即英文版的[《The Rust Programming Language》](https://doc.rust-lang.org/book/))看完了,文中的例子全部按自己的理解重新实现了一遍(代码在[github](https://github.com/xiaochai/batman/tree/master/RustProject)上)。回望来途,可谓困难坎坷,步履艰辛;即是如此,也收获满满。\n\nRust语言的学习给我耳目一新的感觉,上一次对学习语言有这种感觉还是在Haskell的学习中。他完全颠覆我理解的语言设计,在除了垃圾��收语言和内存自主控制语言,竟然还有如此方式来保证内存安全。震撼的同时,也感觉整体学习非常吃力,学习曲线异常陡峭。虽然把整本书都看完了,但还有非常多的细节似懂非懂,也无法完全不参照例子自行写出相对复杂的程序;一些语言中很容易实现的代码在Rust中也无法自行实现出来。所以目前只是第一阶段,即入门,以此为记。后面需要通过开源项目学习练手,通过了解常用的写法去深刻体验Rust的设计精髓。\n\n## 学习与参考资料汇总\n\n| 标题 | 说明|链接 | \n| ------------- |:----||:-------------| \n|The Rust Reference| 官方文档,也是本文的英文版 |[https://doc.rust-lang.org/reference/introduction.html](https://doc.rust-lang.org/reference/introduction.html) |\n|Rust Primer |gitlab上的学习笔记|[https://hardocs.com/d/rustprimer/](https://hardocs.com/d/rustprimer/) |\n|Rust Magazine |Rust月刊|[https://rustmagazine.github.io/rust_magazine_2021/chapter_1/rustc_part1.html](https://rustmagazine.github.io/rust_magazine_2021/chapter_1/rustc_part1.html) |\n|Rust数据内存布局| 内存布局|[https://juejin.cn/post/6987960007245430797](https://juejin.cn/post/6987960007245430797) |\n|The Rustonomicon |官方文档,说明一些语言的灰暗角落|[https://doc.rust-lang.org/nomicon/intro.html#the-rustonomicon](https://doc.rust-lang.org/nomicon/intro.html#the-rustonomicon) |\n|The Unstable Book|官方文档,不稳定特性说明 |[https://doc.rust-lang.org/beta/unstable-book/the-unstable-book.html](https://doc.rust-lang.org/beta/unstable-book/the-unstable-book.html) |\n|Std Lib Document|标准库文档|[https://doc.rust-lang.org/std/](https://doc.rust-lang.org/std/)|\n\n\n## 安装与示例\n\n如[官网](https://www.rust-lang.org/tools/install)所说,运行以下命令即可安装:\n\n```bash\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n```\n\nRust相关的工具会被安装到```/Users/bytedance/.cargo/bin```这个目录下,如果没有把这个目录加到PATH下,添加即可使用。\n\n### 创建Hello World程序\n\n位于hello_world/main.rs\n\n```rust\nfn main(){\n println!(\"Hello world\");\n}\n```\n编译运行:\n\n```\n➜ hello_world git:(master) ✗ rustc main.rs\n➜ hello_world git:(master) ✗ ./main\nHello world\n```\n\n我们注意到以上程序的几点,细节在后续章节中说明:缩进以4个空格为准;println!为宏,普通函数调用不需要```!```;你会发现去掉println最后的分号也能运行。\n\n### 使用cargo\n\nCargo是Rust工具链中内置的构建系统及包管理器,常见的命令汇总如下:\n\n| 命令 | 说明 | \n| ------------- |:-------------| \n| cargo new \\ | 创建一个新的cargo项目,会生成Cargo.toml和src/main.rs| \n| cargo new \\-\\-lib \\ | 创建一个新的库项目,会生成Cargo.toml和src/lib.rs| \n| cargo build |编译本项目,生成的可执行文件位于./target/debug/下;
如果添加\\-\\-release,则会生成到./target/release/下;
\\-\\-release参数将花费更多的时间来编译以优化代码,一般用于发布生产环境时使用 | \n| cargo run | 编译并运行本项目,也支持\\-\\-release参数,常用于运行压测;
-p 用于工作空间下有多个二进制包时指定运行哪个包 | \n| cargo run \\-\\-bin \\ | 编译并运行指定的bin文件,一般位于src/bin目录下,target不带.rs后缀 | \n| cargo check | 仅检查是否通过编译,由于不生成二进制文件,速度快于cargo build |\n| cargo doc | 在当前项目的target/doc目录生成使用到的库的文档,可以使用\\-\\-open选项直接打开浏览器 |\n| cargo update | 忽略Cargo.lock文件中的版本信息,并更新为语义化版本所表示的最新版本,用于升级依赖包 |\n| cargo test | 运行测试用例,默认情况下是多个测试case并行运行;
cargo test接收两种参数,第一种传递给cargo test使用,第二种是传递给编译出来的测试二进制使用的;
这两种参数中间使用\\-\\-分开;
例如 cargo test -q tests::it_works -- --test-threads=1;
这一命令,会以安静模式(-q)运行tests::it_works下的测试,并且只使用一个线程串行运行(--test-threads=1) |\n|cargo publish | 发布项目到crate.io上,添加\\-\\-allow-dirty可以跳过本地git未提交的错误|\n|cargo yank \\-\\-vers 0.0.1| 撤回某个版本,添加\\-\\-undo取消撤回操作|\n\n\nCargo.toml说明:\n\n| 段名 | 说明 | \n| ------------- |:-------------| \n| package | 本包(crate)的信息说明| \n| dependencies |依赖的外部包,版本是语义化的版本,用于update时判断最新的可用版本 | \n| profile.dev | 在非\\-\\-release模式下的编译参数,例如opt-level优化等级配置等,覆盖默认值,要省略 | \n|profile.release| 在\\-\\-release模式下的编译参数,覆���默认值,可省略\n\ncrate是Rust中最小的编译单元,package是单个或多个crate的集合;crate和package都可以被叫作包,因为单个crate也是一个package,但package通常倾向于多个crate的组合。\n\nRust中的包(crate)代表了一系列源代码文件的集合。用于生成可执行程序的称为二进制包(binary crate),而用于复用功能的称为库包(library crate,代码包),例如rand库等。\n\n创建项目:(hello_cargo项目)\n```\n➜ RustProject git:(master) ✗ cargo new hello_cargo\n Created binary (application) `hello_cargo` package\n➜ RustProject git:(master) ✗ cd hello_cargo\n➜ hello_cargo git:(master) ✗ tree .\n.\n├── Cargo.toml\n└── src\n └── main.rs\n\n1 directory, 2 files\n```\n\nCargo.toml\n```ini\n[package]\nname = \"hello_cargo\"\nversion = \"0.1.0\"\nedition = \"2018\"\n\n# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html\n\n[dependencies]\nrand = \"0.8.0\" # 手动添加的,默认没有这一行,用于说明\n```\n\nsrc/main.rs\n```\nfn main() {\n println!(\"Hello, world!\");\n}\n```\n\n运行:\n```\n➜ hello_cargo git:(master) ✗ cargo build\n\n Compiling hello_cargo v0.1.0 (/Users/bytedance/xiaochai/batman/RustProject/hello_cargo)\n Finished dev [unoptimized + debuginfo] target(s) in 1.22s\n➜ hello_cargo git:(master) ✗ ./target/debug/hello_cargo\nHello, world!\n\n\n➜ hello_cargo git:(master) ✗ cargo run\n\n Compiling hello_cargo v0.1.0 (/Users/bytedance/xiaochai/batman/RustProject/hello_cargo)\n Finished dev [unoptimized + debuginfo] target(s) in 0.27s\n Running `target/debug/hello_cargo`\nHello, world\n```\n\n## 猜数字例子\n\n位于guessing_game中\n\n```rust\n// 标准库中定义的比较结果的枚举\nuse std::cmp::Ordering;\n// 使用use语句进行包导入;rust默认会预导入(prelude)一部分常用的类型,而std::io不在此范围,需要使用use语句\nuse std::io;\n\n// 首先使用了rand包,需要在Cargo.toml中添加rand = \"0.8.0\"\n// 在run或者build的时候,会根据crates.io上的最新版本、依赖关系下载所需要的包\n// rand::Rng为trait(后面解析),gen_range定义于此Trait中\n// 如果不导入,调用gen_range将报错,因为ThreadRng的对应实现定义于Rng trait中\nuse rand::Rng;\n\nfn main() {\n // rand::thread_rng()将返回位于本地线程空间的随机数生成器ThreadRng,实现了rand::Rng这一trait\n // gen_range的参数签名在0.7.0的包和0.8.x的包上不一样,在旧版中支持两个参数,而新版本中只支持一个参数\n // 1..101的用法后面介绍,这一行表示生成[1,101)的随机数\n let secret_num = rand::thread_rng().gen_range(1..101);\n println!(\"secret number is {}\", secret_num);\n\n // 死循环\n loop {\n // let关键字用于创建变量\n // 默认变量都是不可变的,使用mut关键字修饰可以使变量可变\n // String是标准库中的字符串类型,内部我问个他UTF-8编码并可动态扩展\n // new是String的一个关联函数(静态方法),用于创建一个空的字段串\n let mut guess = String::new();\n\n println!(\"Guess the number!\\nPlease input your guess:\");\n\n // std::io::stdin()会返回标准输入的句柄\n // 参数&mut guess表示read_line接收一个可变字符串的引用(后面介绍),将读取到的值存入其中\n // read_line返回io::Result枚举类型,有Ok和Err两个变体(枚举类型的值列表称为变体)\n // 返回Ok时表示正常并通过expect提取附带的值(字节数);返回Err时expect将中断程序,并将参数显示出来\n // 不带expect时也能通过编译,但会收到Result没有被处理的警告(warning: unused `Result` that must be used)\n io::stdin().read_line(&mut guess).expect(\"Failed to read line\");\n\n // Rust中允许使用同名新变量来隐藏(shadow)旧值\n // guess:u32是明确guess的类型,以此来使得让编译器推到出parse要返回包含u32的值\n // parse的返回值是一个Result枚举,有Ok和Err两个变体(枚举值),用match来判断两种情况\n let guess: u32 = match guess.trim().parse() {\n Ok(num) => num,\n Err(e) => {\n println!(\"Please type a number!\");\n // continue回到loop开头继续\n continue;\n }\n };\n\n // {}为println!的占位符,第1个花括号表示格式化字符串后的第一个参数的值,以此类推\n println!(\"You guessed:{}\", guess);\n\n // 模式匹配,由match表达式和多个分支组成,Rust可以保证使用match时不会漏掉任何一种情况\n // Rust会将secret_num也推导成u32与guess比较\n match guess.cmp(&secret_num) {\n Ordering::Less => println!(\"Too small!\"),\n Ordering::Equal => {\n println!(\"You WIN!\");\n // 退出循环\n break;\n }\n Ordering::Greater => { println!(\"Too big!\") }\n }\n }\n}\n```\n\n## 通用编程概念\n\n本章节例子位于example/src/bin/main.rs中。\n\n### 变量与可变性\n\n变量默认是不可变的,这意味着一但赋值,再也无法改变:\n\n```rust\n let x: i32;\n x = 5;\n let y: i32 = 10;\n // 以下行报错:Cannot assign twice to immutable variable [E0384]\n // y=9\n```\n\n可以变量名前添加mut使得此变量可变:\n\n```rust\n let mut x = 10;\n x = 100;\n x = 1000;\n```\n\n常量使用const修饰,名称全部大写,并用下划线分隔;常量可以是全局的(例如main函数之外),也可以是局部的;常量必须显示指定类型:\n\n```rust\nconst MAX_SCORE: i32 = 199;\nfn main() {\n // some other code \n const MY_SCORE: i32 = 200;\n const MAX_SCORE: i32 = 299;\n\n // 200,299\n println!(\"{},{} \", MY_SCORE, MAX_SCORE);\n}\n\n```\n\n隐藏变量是指使用相同名称来定义变量,重新定义后,之前的变量值和类型被隐藏了:\n\n```rust\n let space = \" \";\n let space = space.len();\n```\n\n### 数据类型\n\nRust是一门静态语言,所以变量在编译时就确定了其数据类型。Rust的数据类型分为标量类型(scalar)和复合类型(compound)。\n\n一般情况下,在编译器可以推断出类型的场景中,可以省略类型标注,但在无法推断的情况下,就必须显示的声明类型了。\n\n```rust\n // 以下报错:type annotations needed\n // let k = (\"32\").parse().expect(\"not ok\");\n let k: i32 = (\"32\").parse().expect(\"not ok\");\n```\n\n标量类型是单个值类型的统称,有4种标量类型:整数、浮点数、布尔值及字符。\n\n整数类型:i8、u8、i16、u16、i32、u32、isize、usize;以上除了isize和usize所占的字节数是根据平台(32位/64位)来确定的,其它的的类型都有明确的大小。\n\n整数类型的默认推导是i32:\n\n```rust\n // 整数类型字面量\n // 10进制,可以用下划分分隔\n let x: u32 = 98_000;\n let x: u32 = 0xff; // 十六进制\n let x: u32 = 0o77; // 八进制\n let x: u32 = 0b1111_0000; // 二进制\n let x = b'A'; // u8\n```\n\n对于整数溢出,编译期会尽可能的检查溢出可能,如果检测到,则直接编译报错。\n\n如果使用debug编译,则在运行时发生溢出时,会触发panic;如果是release,则会执行数值环绕,从最小的重新开始记录。\n\n```rust\n // 整数溢出\n let x: u8 = 252;\n let y: u8 = (\"32\").parse().expect(\"not ok\");\n // 以下行在debug模式下,会在运行时报错\n // thread 'main' panicked at 'attempt to add with overflow', src/main.rs:41:26\n // note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace\n // 在release模式下,则不会报错,输出28\n println!(\"{},see!\", x + y);\n```\n\n浮点数类型:f32,f64;默认推导为f64。\n\n数值运算:加(+)、减(-)、乘(x)、除(/)、取余(%);只有相同类型间才能进行操作:\n\n```rust\n // 类型不一样,无法操作\n // let x:u8 = 10;\n // let y:u32 = 100;\n // let z = y+x;\n```\n\n布尔值,只拥有true和false,占据一个字节大小,常用于if的判断:\n\n```rust\n let x:bool = false;\n```\n\n字符类型,单引号指定,是Unicode标量值,占4个字符:\n\n```rust\n // 字符类型\n let x = 'c';\n let y = '李';\n let z:char = '李';\n```\n\n将多个不同类型的值合成一个类型,称为复合类型;Rust有两种内置复合类型:元组(tunple)和数组(array);\n\n元组类型,在括号内放置一系列以逗号分隔的值,即可组成元组:\n\n```rust\n // 元组\n // 也可以省略类型,让编译器推断\n let x:(i64,f64,char) = (2,3.4, 'c');\n // 使用模式匹配来解构元组\n let (a,b,c) = x;\n // 通过点来访问元组\n println!(\"{},{},{}\", x.0, x.1, x.2);\n```\n\n数组类型:\n每一个元素必须类型一致,数组大小不可改变,在栈上分配:\n\n```rust\n // 数组\n // 声明一个长度为5,元素为int32类型的数组;类型[i32;5]也可以省略,由编译器推断\n let x: [i32; 5] = [1, 2, 3, 4, 5];\n // 定义了一个由7个1组成的数组,即[1,1,1,1,1,1,1]\n let y = [1; 7];\n // 通过下标来访问,从0开始;以下输出3,1;下标的类型是usize的\n println!(\"{},{}\", x[2], y[6]);\n // 越界时将发生严重错误\n // 编译时报错:index out of bounds: the length is 5 but the index is 10\n // 如果下标是运行时才确定的值,则这块的报错将在运行时报错\n // let k:usize = \"10\".parse().expect(\"not a number\");\n // println!(\"{}\", x[k]);\n```\n\n\n### 函数 \n\n函数的命名由下划线分隔的多个小写单词组成:\n\n```rust\nfn my_sum(x: i32, y: i32) -> i32 {\n // 可以直接是return,也可以直接写表达式x+y,函数中将最后一个表达式的值做为返回值\n return x + y;\n}\n```\n\n语句和表达式:\n语句指执行操作,但不返回值的指令;表达式指进行计算并且产生结果的指令。\n表达式是语句的一部分;字面量、函数调用、宏调用、新作用域的花括号都是表达式。\n\n\n```rust\n // 语句,没有返回值\n let x = 6;\n // 所以不能将语句赋值给变量\n // let y = (let x = 7);\n // 以下也不行\n // let a = b = 6;\n // 花括号的代码块也是表达式,以下表达式的值为11\n let x = {\n let y = 10;\n // 注意这一行不能有分号,添加了分号后,这个代码块的值就是空元组了()\n y+1\n };\n```\n\n### 控制流\n\nif的条件表达式必须是bool值;if表达式可以用于赋值:\n\n```rust\n // if的用法,多分支判断,条件表达式的值只能是bool类型\n let num = 100;\n if num % 4 == 0 {\n println!(\"number is divisible by 4\")\n } else if num % 3 == 0 {\n println!(\"number is divisible by 3\")\n } else {\n println!(\"number is not divisible by 3,4\")\n }\n\n // if为表达式,所以可以使用if来赋值\n // 此处要注意各个分支返回的数据类型要一样,否则编译期直接报错\n let condition = true;\n let x = if condition {\n 10\n }else {\n 20\n };\n```\n\nloop 循环:\n\n```rust\n // loop表达式的值,可以从break返回\n let mut i = 1;\n let count = loop{\n i+=1;\n if i > 10 {\n break i\n }\n // 两个break的值类型要一样,所以以下这一行无法通过编译\n // break 'a'\n };\n```\n\nwhile表达式的值一直都是空值:\n\n```rust\n // while表达式的值一直是空值,如果使用break,后面不能跟返回值\n let mut i = 1;\n let count:() = while i > 10 {\n i += 1;\n };\n```\n\nfor:\n\n```rust\n // y是一个Range类型,本身是一个迭代器;值为1,2(不包括3)\n // rev是从后往前遍历,所以这块打印的是2,1,\n let y = 1..3;\n for e in y.rev() {\n print!(\"{},\", e)\n }\n```\n\n结尾习题:\n\n```rust\n// 摄氏温度与华氏温度的相互转换\n// println!(\"celsius_2_fahrenheit(1):expect{}, actual:{}\", 33.8, celsius_2_fahrenheit(1.0));\nfn celsius_2_fahrenheit(celsius: f64) -> f64 {\n celsius * 1.8 + 32.0\n}\n\n// 生成一个n阶的斐波那契数列\n// println!(\"fibonacci(10):expect{}, actual:{}\", 34, fibonacci(10));\nfn fibonacci(n: i64) -> i64 {\n if n == 1 {\n 0\n } else if n == 2 {\n 1\n } else {\n fibonacci(n - 1) + fibonacci(n - 2)\n }\n}\n\n// 打印圣诞颂歌The Twelve Days of Christmas的歌词,并利用循环处理其中重复的内容。\n// 太长了,改成The Six Days of Christmas\n// the_six_days_of_christmas();\nfn the_six_days_of_christmas() {\n let num_map = [\"first\", \"second\", \"third\", \"forth\", \"fifth\", \"sixth\"];\n let gifts = [\"a partridge in a pear tree\",\n \"two turtle doves\",\n \"three French hens\",\n \"four calling birds\",\n \"five golden rings\",\n \"six geese a-laying\",\n ];\n\n for i in 0..6 {\n print!(\"On the {} day of Christmas, my true love sent to me:\", num_map[i]);\n let mut j = i;\n while j > 0 {\n print!(\"{},\", gifts[j]);\n j -= 1;\n }\n // 最后一个礼物不需要逗号\n println!(\"{}.\", gifts[0]);\n }\n}\n```\n\n## 所有权\n\n\n不同语言管理内存的方式:\n\n* Java:通过垃圾回收来管理内存;\n\n* C/C++:开发者手动地分配和释放;\n\n* Rust:通过应用所有权系统规则,在编译期间检查,来保证内容安全。\n\n所有权系统使得Rust在没有垃圾回收的情况下,保证内存安全。其所有权规则包含以下三个规则:\n\n1. Rust中每一个值都有一个变量作为他的所有者;\n\n2. 在同一个时间内,值有且仅有一个所有者;\n\n3. 当所有者离开他的作用域时,他所持有的值将被释放。\n\n使用域的概念与其它语言类似,不再赘诉。\n\n以下例子位于example/src/bin/main.rs中。\n\n### String类型介绍\n\n字符串的字面量是编译进二进制文件中,但运行时可动态变化的字符串类型则需要存储到堆上。\n\n```rust\n // 字符串类型在堆上分配\n // String::from方法,使用字符串字面量来创建String类型,这里s必须是可变的\n let mut s = String::from(\"Hello\");\n s.push_str(\", world\");\n println!(\"{}\", s)\n```\n\n下面以例子的方式来说明所有权的动作规则:\n\n```rust\n let s1 = String::from(\"Hello\");\n let s2 = s1;\n println!(\"{}\", s1)\n```\n\nString类型由两大部分组成,存储于栈上的元信息(ptr, len, cap),即指向堆上的指针,字符串长度,分配容量;而实际的内容保存在ptr所指的堆上,如下图:\n\n![字符串类型内存部局](/assets/images/string_mem_1.jpeg)\n\n将s1赋值给s2时,由于Rust不会对堆上值也进行拷贝,只会将栈上的元数据进行拷贝,所以目前的状态有可能是s1,s2所指向的String元数据中的指针都指向了同一片堆区域。\n\n![字符串类型内存部局](/assets/images/string_mem_2.jpeg)\n\n在s1和s2变量离开作用域后,Rust会自动执行对应类型上的drop方法,释放对应的内存,问题就产生了,这将产生二次释放问题。\n\n为了解决这个问题,Rust在种情况下,会将s1的变得无效,这就是之前例子中第三行无法通过编译的原因。\n\n这种只有拷贝了栈上的数据而没有拷贝堆上的数据的浅拷贝,在Rust中称为移动(move),上面例子中,s1被移动到s2了\n\nRust永远不会自动地创建数据的深度拷贝。因此在Rust中,任何自动的赋值操作都可以被视为高效的。\n\n\n如果确实需要使用深拷贝,可以使用clone函数,如下例子可以通过编译\n\n```rust\n // 对s1进行深拷贝,即将堆上的内容也进行了拷贝\n let s1 = String::from(\"Hello\");\n let s2 = s1.clone();\n println!(\"{}, {}\", s1, s2);\n```\n\n对于完全存储在栈上的数据,赋值本身已经将全部数据都拷贝,所以不用调用clone方法。**在Rust中,实现了Copy trait的类型,都可以在将变量赋值给其它变量时原变量保持可用**。\n\n所有的标量类型都实现了Copy trait;元组或者数组中包含的元素是Copy的,则元组或者数组就是Copy的:\n\n```rust\n // 如果这个元组加了String类型,如下,则不能通过编译\n let x = (1,2,3.0);\n // let x = (1, 2, 3.0, String::from(\"Hello\"));\n- **key**: `5659788ffbdb9f8ce296fd9403b5f602dbda76fed9653869`\n let y = x;\n println!(\"{}\", x.1);\n\n let x = [1, 2, 3];\n let y = x;\n println!(\"{}\", x[1]);\n```\n\n**注意Copy和Drop是互斥的,如果一个类型本身或者成员变量实现了Copy,则这个类型就无法实现Drop**。\n\n### 函数与所有权\n\n函数参数与赋值是一样的,返回值也是一样的:\n\n```rust\n fn take_owner(s: String) {}\n let s = String::from(\"hello\");\n take_owner(s);\n // 将发生编译错误,因为s的所有权移进了take_owner中\n // println!(\"{}\", s);\n\n fn take_owner_and_return(s: String)->String{\n // 函数又将s的所有权转移到返回值,所以s不会被drop掉\n return s;\n }\n let s1 = String::from(\"hellow\");\n let s2 = s1;// 到这里,s1已经失效\n let s3 = take_owner_and_return(s2); // 到这里s2已经失效\n // 这里只有s3可用,其它的s1,s2失效\n\n```\n\n### 引用与借用\n\n```rust\n // 引用传递时,并不取得所有权,但可以使用值\n fn get_len(s: &String) -> usize {\n // s是一个不可变引用,所以无法对s的值进行改变\n // 以下无法通过编译\n // s.push_str(\", world\");\n return s.len();\n }\n let s1 = String::from(\"hello\");\n // s2为可变引用,默认的引用不可变\n let mut s2: &String = &s1;\n let mut s3 = String::from(\"hello\");\n // 注意s2为可变引用的意思是可以改变s2引用到哪个值,而不能改变s2引用的值\n // 以下无法通过编译, 报错: cannot borrow `*s2` as mutable, as it is behind a `&` reference\n // s2.push_str(\", world\");\n // 因为两行可以运行,因为s2是可变引用,而且s3是可变String\n s2 = &mut s3;\n // 虽然s2引用了可变的s3,但由于s2的类型是&String不是&mut String,所以到下这一行还是无法通过编译\n // s2.push_str(\", world\");\n // 获取s1的长度,而不取得s1的所有权\n let size = get_len(&s1);\n {\n let s4 = String::from(\"you\");\n // 由于s4的生命周期比s2短,所以s2无法引用s4,这避免了悬垂指针的出现\n // s2 = &s4;\n }\n // 在这里s1还是能用\n println!(\"{},{},{},{}\", s1, s2, size, s1);\n```\n\n通过引用,可以在不取得所有权的情况下,使用对应值。当引用离开作用域时,由于不持有所有权,所以也不会释放所指向的值。\n\n引用分成可变引用和不可变引用,但这块的可变是指可以改变指向哪个值,而无法改变值本身,注意以下两组的区别:\n\n```rust\n let mut s:String = String::from(\"hello\");\n let s1:&mut String = &mut s;\n s1.push_str(\",world\");\n\n let mut s:String = String::from(\"hello\");\n let mut s2:&String = &mut s;\n // 以下无法通过编译,因为s2是&String不可变类型\n s2.push_str(\", world\");\n```\n\n另外,只能申明一个可变引用,如果某个变量已经被可变引用了,也不允许再被不可变引用。这可以很好的避免数据竞争:\n\n```rust\n let mut s = String::from(\"hello\");\n let s1 = &mut s;\n // cannot borrow `s` as mutable more than once at a time\n // let s2 = &mut s;\n // cannot borrow `s` as immutable because it is also borrowed as mutable\n // let s3 = &s;\n println!(\"{},{}, {}\", s1, s2, s3);\n```\n\n总结出来以下规则:\n\n1. **在任何一段给定的时间里,要么只能拥有一个可变引用,要么只能拥有任意数量的不可变引用**。\n\n2. **引用总是有效的**。\n\n### 切片\n\n```rust\n // 字符串切片,类似与go,获取[begin,end)之间的内容,注意end最大是字符串的长度,超过后会报错\n let s = String::from(\"0123456789\");\n // 以下两个hello和world等价\n let hello = &s[0..5];\n let hello: &str = &s[..5];\n let world = &s[5..10];\n let world = &s[5..];\n // 01234,56789\n println!(\"{},{}\", hello, world);\n\n // 获取第一个单词,返回字符串切片\n // 这里的函数参数也可以使用&str,可以更通用\n fn first_world(s: &String) -> &str {\n // s.as_bytes()将字符串转成字节数组&[u8]\n // iter返回迭代器,enumerate将每一个元素按元组的形式返回\n for (i, &item) in s.as_bytes().iter().enumerate() {\n // 判断是空格,直接返回切片\n if item == b' ' {\n return &s[0..i];\n }\n }\n &s[..] // 使用&s也可以\n }\n // 输出hello\n println!(\"{}\", first_world(&String::from(\"hello world\")));\n\n let mut s = String::from(\"0123456789\");\n let t = first_world(&s);\n // 以下无法通过编译,因为s已经是不可变引用了,s.clear又使用了可变引用\n // cannot borrow `s` as mutable because it is also borrowed as immutable\n // s.clear();\n println!(\"{},{}\", s, t);\n```\n\n字符串字面量就是字符串切片,切片包括指向值的指针和长度。\n\n其它类型的切片:\n\n```rust\n // 其它切片\n let ia = [1, 2, 3, 4, 5, 6];\n let sia: &[i32] = &ia[1..3];\n```\n\n## 结构体\n\n结构体的一些规则:(以下例子位于example/src/bin/main.rs中)\n\n1. 一个结构体的实例是可变的,则这个结构体的所有成员变量都是可变的;\n\n2. 在创建结构体实例时,如果变量名与字段名同名时,可以省略字段名,直接写变量名;\n\n3. 可以使用```..old```这种语法来快速从old创建一个只有部分值改变的新变量;\n\n4. 支持不带字段名的元组结构体;\n\n5. 支持空结构体;\n\n6. 如果结构体的成员是引用时,需要带上生命周期的标识。\n\n```rust\n // 结构体定义\n struct User {\n username: String,\n email: String,\n sign_in_count: u64,\n active: bool,\n }\n // 创建实例\n let mut user1 = User {\n username: String::from(\"xiaochai\"),\n email: \"soso2501@mgail.comxxx\".to_string(),\n sign_in_count: 1,\n active: true,\n };\n println!(\"{}\", user1.email); // soso2501@mgail.comxxx\n // 访问和修改,注意一旦实例可变,则实例的所有成员都可变\n user1.email = String::from(\"soso2501@mgail.com\");\n println!(\"{}\", user1.email); // soso2501@mgail.com\n\n fn build_user(email: String, username: String) -> User {\n User {\n username, // 由于变量名了字段同名,所以可以省略掉字段名\n email,\n sign_in_count: 1,\n active: true,\n }\n }\n let mut user1 = build_user(\"soso2501@mgail.com\".to_string(), \"xiaochai\".to_string());\n let mut user2 = User {\n username: \"xiaochai2\".to_string(),\n // 可以使用以下语法从user1复制剩下的字段\n ..user1\n };\n user1.email = \"sosoxm@163.com\".to_string();\n // soso2501@mgail.com,sosoxm@163.com\n println!(\"{},{}\", user2.email, user1.email);\n\n // 元组结构体\n // 当成员变量没有名字时,结构体与元组类似,称为元组结构体\n struct Point(u32, u32, u32);\n let origin = Point(0, 0, 0);\n // 可以使用数字下标来访问\n println!(\"{},{},{}\", origin.0, origin.1, origin.2);\n // 也可以通过模式匹配来结构\n let Point(x, y, z) = origin;\n println!(\"{},{},{}\", x, y, z);\n\n // 空结构体,一般用于trait\n struct Empty{}\n\n // 如果结构体的成员是引用时,需要带上生命周期的标识\n struct User2<'a> {\n username: &'a str,\n }\n```\n\n### 实例\n\n结构体的应用举例:\n\n1. 通过结构体来更清晰表达字段含义;\n\n2. 使用注解来快速实现trait,使得可以在println!中使用```{:?}```和`{:#?}`来输出自定义结构体;\n\n3. 使用impl关键字为结构体实现方法;\n\n4. 方法第一个参数如果是self,可以是获得所有权(self),也可以是借用(&self),还可以是可变的(&mut self或者是mut self);\n\n5. 同一个结构体,可以写多个impl,但不能多次定义同一个方法,即使参数不一样也不行;\n\n6. 如果方法的第一个参数不为self,则称为关联��数,类似与静态方法。\n\n```rust\n // 使用结构的例子,说明trait的使用\n #[derive(Debug)] // 添加注解来派生Debug trait\n struct Rectangle {\n width: u32,\n height: u32,\n }\n fn area(rect: &Rectangle) -> u32 {\n rect.width * rect.height\n }\n let rect1 = Rectangle { width: 10, height: 20 };\n // {:?}需要结构体实现Debug这一trait,也可以使用{:#?}来分行打印\n // the area of rectangle Rectangle { width: 10, height: 20 } is 200\n println!(\"the area of rectangle {:?} is {}\", rect1, area(&rect1))\n\n // 为结构体定义方法\n impl Rectangle {\n // 方法的第一个参数永远是self\n fn area(&self) -> u32 {\n self.height * self.width\n }\n }\n println!(\"the area of rectangle {:?} is {}\", rect1, rect1.area());\n\n impl Rectangle {\n // 以下无法通过编译,因为area重复定义了\n // fn area(&self, i: i32) -> u32 {\n // self.height * self.width\n // }\n fn can_hold(&self, rect2: &Rectangle) -> bool {\n self.width > rect2.width && self.height > rect2.height\n }\n // 关联函数\n fn new(width: u32, height: u32) -> Rectangle {\n Rectangle {\n width,\n height,\n }\n }\n }\n println!(\"the area of rectangle {:?} is {}\", Rectangle::new(3, 2), Rectangle::new(2, 3).area());\n```\n\n## 枚举\n\n1. 枚举使用enum关键字定义,每一个枚举值称之为变体(variant);\n\n2. 每一个变体可以有不同的数据\b类型和数量的数据关联;\n\n3. 枚举相校与结构体不同的地方在于,如果对变体的不数数据定义各自的结构,则他们属于不同类型,而使用枚举则可以使用一种类型来描述不同的数据结构;\n\n4. 同样可以为枚举实现方法;\n\n5. 使用match模式匹配处理每一种变体,必须处理所有的变体,否则编译不通过;当然可以使用通配符来匹配任意值/类型;\n\n6. match还可以绑定匹配对应的部分值。\n\n以下例子位于example/src/bin/main.rs中:\n\n```rust\n enum IPAddr {\n // 变体中可以保存数值\n IPV4(u32, u32, u32, u32),\n IPV6(String),\n }\n // 可以为枚举定义函数\n impl IPAddr {\n fn print(&self) {\n // 使用match来处理每一种变体,注意需要处理所有变体,否则编译保险错\n match self {\n // 模式匹配可以直接解构变体内的数值\n IPAddr::IPV4(u1, u2, u3, u4) =>\n println!(\"{}.{}.{}.{}\", u1, u2, u3, u4),\n IPAddr::IPV6(s) => println!(\"{}\", s),\n }\n }\n }\n let ipv4 = IPAddr::IPV4(1, 2, 3, 4);\n let ipv6 = IPAddr::IPV6(\"::1\".to_string());\n ipv4.print();\n ipv6.print();\n```\n\n预导入库中的非常常用的Option类型,用在需要表示空值的场景,其定义为(省略了注解):\n\n```rust\npub enum Option {\n None,\n Some(T),\n}\n```\n这里的\\为泛型参数,None表示空值,Some表示有值,并持有值:\n\n```rust\n // 标准库中的Option类型\n // 为一个Option值加1\n fn plus_one(c: Option) -> Option {\n match c {\n None => None,\n Some(i) => Some(i + 1)\n }\n }\n let five = plus_one(Some(4));\n let none = plus_one(None);\n match five {\n None => println!(\"none\"),\n Some(i) => println!(\"val is {}\", i)\n };\n match none {\n None => println!(\"none\"),\n Some(i) => println!(\"val is {}\", i)\n };\n\n // 必须匹配每一个可能的值\n let c = 2;\n match c {\n 1 => println!(\"is 1\"),\n 2 => println!(\"is 2\"),\n // 如果没有以下这一行,则编译报错\n // non-exhaustive patterns: `i32::MIN..=0_i32` and `3_i32..=i32::MAX` not covered\n _ => println!(\"other\")\n }\n```\n\n在只关心某一种匹配而忽略其它匹配的时候,可以使用if let来简化代码:\n\n```rust\n // 使用if let来简化处理\n let five: Option = Some(5);\n if let Some(i) = five {\n println!(\"has value {}\", i)\n }\n```\n\n## 包管理\n\n* 包(package:一个用于构建、测试并分享单元包的Cargo功能;\n\n* 单元包(crate):一个用于生成库或可执行文件的树形模块结构;\n\n* 模块(module)及use关键字:它们被用于控制文件结构、作用域及路径的私有性;\n\n* 路径(path):一种用于命名条目的方法,这些条目包括结构体、函数和模块等。\n\n以下为关于包的一些定义和规则:\n\n* 用于生成可执行程序的的单元包称为二进制单元包;\n\n* 用于生成库的单元包称为库单元包;\n\n* 一个包至少要有一个单元包,并且最多只能包含一个库单元包,但可以包含多个二进制单元包;\n\n* Rust编译时所使用的入口文件被称为根节点,例���src/main.rs;\n\n* src/main.rs和src/lib.rs做为默认的二进制单元包和库单元包的根节点,无需在cargo.toml中指定;\n\n* mod关键字可以定义模块,模块内可以嵌套定义子模块;\n\n* 可以使用两模式定位到模块内的函数/枚举等:1. 使用单元包名或字面量crate从根节点开始的绝对路径;2. 使用单元包名或字面量crate从根节点开始的绝对路径;\n\n* Rust中所有的条目包括函数、方法、结构体、枚举、模块、常量默认都是私有的;\n\n* 对于模块来说,父级模块无法使用其子模块中的私有的条目,而子模块可以使用所有祖先模块中的条目;\n\n* 公开的结构体其成员默认还是私有的,公开枚举时,其变体自动变成公开。\n\n以下例子位于restaurant项目中:\n\n```rust\n// 定义模块,可以嵌套子模块\nmod front_of_house {\n pub mod hosting {\n pub fn add_to_waitlist() {}\n\n pub fn seat_at_table() {}\n }\n\n pub mod serving {\n fn take_order() {}\n\n fn serve_order() {}\n\n fn take_payment() {}\n\n mod back_of_house {\n fn fix_incorrect_order() {\n // 使用super关键字引用父模块的,由于子模块可以使用父模块的所有条目,包括私有\n super::serve_order();\n cook_order();\n }\n\n fn cook_order() {}\n\n pub struct Breakfast {\n pub toast: String,\n // 虽然结构体是公有的,但字段默认还是私有的,需要用pub指定\n season_fruit: String,\n }\n\n impl Breakfast {\n pub fn summer(toast: &str) -> Breakfast {\n Breakfast {\n toast: String::from(toast),\n season_fruit: String::from(\"peaches\"),\n }\n }\n }\n\n pub enum Appetizer {\n // 以下两个变体是公开的\n Soup,\n Salad,\n }\n }\n }\n}\n\npub fn eat_at_restaurant() {\n // 以下两种调用是等价的\n // 使用绝对路径,从crate关键字(即根节点)开始\n crate::front_of_house::hosting::add_to_waitlist();\n // 使用相对路径,从当前模块开始\n front_of_house::hosting::add_to_waitlist();\n}\n```\n\n* 使用use关键字可以简化引用路径;\n\n* 使用as关键字使用新的名称,可以解决重名的问题;\n\n* 使用pub use重导出名称,使用pub use的名称不仅在本作用域内可以使用,外部也可以通过引入本作用域来调用到pub use导出的包。可以用于重新组织包结构;\n\n* 使用外部包与使用std包类似,只是需要在cargo.toml文件中的dependencies小节中添加包名以及对应的版本;\n\n* 如果要导入一个树型包中的几个包,可以使用嵌套的语法来减少use语句的使用。\n\n\n```rust\n// 使用use关键字可以简化路径\n// 以下两行等价,self关键字可能在后续版本中去掉\nuse front_of_house::hosting;\n// use self::front_of_house::hosting;\n\npub fn eat_at_restaurant2() {\n hosting::add_to_waitlist();\n}\n\n// 为防止重名,使用as来重命名\nuse std::fmt::Result;\nuse std::io::Result as IOResult;\n// 等价于导入std::cmp::Ordering和std::io这两个包\nuse std::{cmp::Ordering, fs};\n// 等价于导入std::io和std::io::Write这两个包\nuse std::io::{self, Write};\n// 导入std::collections下的所有包,一般不推荐,容易造成命名冲突\nuse std::collections::*;\npub fn test(){\n Result::Ok(());\n IOResult::Ok(\"FD\");\n}\n```\n\n可以将模块的层级关系使用目录关系来组织起来,例如原例子中在libs下面创建如下关系的包:\n\n```rust\nmod front_of_house {\n pub mod hosting {\n pub fn add_to_waitlist() {}\n\n pub fn seat_at_table() {}\n }\n```\n\n可以将front_of_house移到front_of_house.rs中,则以下两个文件变成:\n\n```rust\n// 以下是位于lib.rs\nmod front_of_house;\n```\n\n\n```rust\n// 以下位于front_of_house.rs中\npub mod hosting {\n pub fn add_to_waitlist() {}\n\n pub fn seat_at_table() {}\n}\n```\n\n也可以将front_of_house.rs再拆分:\n\n\n```rust\n// libs.rs\nmod front_of_house;\n```\n\n```rust\n// front_of_house.rs\nmod hosting;\n```\n\n```rust\n// front_of_house/hosting.rs\npub fn add_to_waitlist() {}\npub fn seat_at_table() {}\n```\n\n## 集合\n\n以下例子位于example/src/bin/collection.rs中:\n\n### 动态数组\n\n* 动态数组Vec是范型,在无法推断类型时,必须显示指定类型;\n\n* 使用vec!宏可以快速构建有初始值的数组;\n\n* 数组中的元素会在动态数组销毁时跟着销毁;\n\n* 数组元素的引用会对整个数组造成影响,即不可以在有只读引用的情况下push元素;\n\n* 结合枚举,可以间接地在Vec中存储多种不同的类型。\n\n```rust\n // 创建一个动态数组\n let v: Vec = Vec::new();\n // 使用vec!宏来快速创建一个带有初始值的数组\n let v = vec![1, 2, 3];\n // 必须是mut的动态数组才能push进数据\n let mut v: Vec = Vec::new();\n // 往动态数组里添加数据\n v.push(5);\n v.push(6);\n\n // 获取数组元素的引用,如果数组越界将发生panic\n let e1: &i32 = &v[0];\n // 返回Option<&T>类型,如果不越界将返回Option\n let e2: Option<&i32> = v.get(0);\n\n // 注意数组元素的引用会对整个数组造成影响,这就导致了在只读引用存在的情况下无法往数组中push元素\n // 以下行无法通过编译:cannot borrow `v` as mutable because it is also borrowed as immutable\n // v.push(7);\n println!(\"{}\", e1);\n\n // 使用for来遍历所有元素,这里的i为&i32\n for i in &v {\n // 5 6\n println!(\"{}\", i)\n }\n // 这里的i值为&mut i32\n for i in &mut v {\n // 将i解引用,指向对应的值,并修改\n *i *= 2;\n }\n for i in &v {\n // 10 12\n println!(\"{}\", i)\n }\n```\n\n### 字符串\n\n* 字符串本身是基于字节的集合,通过功能性的方法将字节解析为文本;\n\n* Rust语言核心部分只有一种字符串类型,即字符串切片str,通常以引用形式出现(&str),它是指向存储在别处的一些UTF8编码字符串的引用,例如字符串字面量;\n\n* String类型定义在标准库中,不是语言核心的一部分,提供UTF8编码;\n\n* 标准库还提供了OsString,OsStr,CString和CStr,一般以Str结尾的是借用版本,String结尾是所有权版本。这些类型提供了不同的编码或者不同内存布局的字符串类型;\n\n* String类型实际使用Vec\\进行封装;\n\n* 为了避免出现多字节情景下你拿到半个字符,所以Rust不允许使用下标访问获取字符串的字符。而是通过特定的功能函数指定对字节,字符,字形簇进行处理;\n\n* 但是Rust却允许字符串切片的使用,但使用时要格外小心,因为如果截取的范围不是有效的字符串,将发生panic。\n\n```rust\n\n\n // 字符串字面量是&str类型\n let c: &str = \"ab\";\n println!(\"{}\", c);\n // 创建一个新空字符串\n let s: String = String::new();\n // 从字面量创建一个字符串的两种方法,String::from的静态方法,&str的to_string方法\n let s = String::from(\"hello\");\n let s = \"hello\".to_string();\n // 修改字符串\n let mut s = String::from(\"abc\");\n // 往后添加字符串,push_str的参数是引用的形式&str\n s.push_str(\"def\");\n // 插入单个字符,单个字符使用单引号\n s.push('g');\n // 使用+号拼接字符串,加号的左边是String类型,右边是&str类型,左边的变量的所有权将被加号获取而不再有效\n let s1 = String::from(\"hello\");\n let s2 = String::from(\", world\");\n // s1 的所有权将被转移,不再可用,而s2由于使用引用,所以可以继续使用\n // 加号的第二个签名是&str,而我们传入的是&String也是合法的,因为Rust使用使用解引用强制转换的技术,将&s2转化为&s2[..]\n // &s2[..] 是&str类型\n let s = s1 + &s2;\n println!(\"{},{}\", s, s2);\n let k:&str = &s[2..];\n // 使用format!宏来拼接字符串,format!不会夺取任何参数的所有权\n let s = format!(\"{}, {}! {}.\", \"hello\", \"world\", \"lee\");\n println!(\"{}\", s);\n // String采用utf-8编码,所以一个中文占用3个字节;以下输出3\n println!(\"{}\", \"我\".to_string().len());\n // 虽然字符串不允许使用下标直接访问,但可以使用切片获取某个范围的字符串\n println!(\"{}\", &s[0..1]);\n let s = \"我是中国人\".to_string();\n // 需要注意如果切片的范围不是一个合法的字符串,则会直接panic\n // 以下将发生运行时panic:thread 'main' panicked at 'byte index 1 is not a char boundary; it is inside '我' (bytes 0..3) of `我`', src/main.rs:69:21\n // println!(\"{}\", &s[0..1]);\n\n // 使用chars函数,可以获取根据编码获取字符串中的字符值\n for i in s.chars(){\n println!(\"{}\", i);\n }\n // 与此相对,使用bytes,则获取每一个字节的内容\n for i in s.bytes(){\n println!(\"{}\", i);\n }\n```\n\n### HashMap\n\nHashMap并没有在预加载库中,所以需要使用`use std::collections::HashMap;`进行导入。\n\nHashMap如果键和值实现了CopyTrait,则会复制一份。如果持有所有权的类型,则会将所有权转移到HashMap中。如果是引用类型,则不会取得所有权,由生命周期保证引用的有效性。\n\n```rust\n use std::collections::HashMap;\n // 初始化一个hashmap,不指定类型,编译器可以从h.insert里推断出类型来为HashMap<&str,i32>\n let mut h = HashMap::new();\n h.insert(\"lee\", 1220);\n // 使用Vec来构建HashMap\n let teams = vec![String::from(\"blue\"), String::from(\"yellow\")];\n let scores = vec![10, 50];\n // h的类型声明是必须的,因为collect可以返回多种类型,需要明确这里需要返回的类型,但是泛型可以使用_代替,由编译器来推断\n // h的类型为HashMap<&String, &i32>\n let mut h: HashMap<_, _> = teams.iter().zip(scores.iter()).collect();\n // 获取HashMap中的值,注意这里的值是&String,不能直接使用&str\n let blue = String::from(\"blue\");\n // get函数获取的值为Option,如果不存在,则返回None\n // get取得的结果是value的引用值,在这个场景中为&&i32\n let blue_team_score = match h.get(&blue) {\n // 由于值是&&i32,所以需要两次解引用成i32值,否则与None的返回值不匹配\n Some(i) => **i,\n None => 0,\n };\n println!(\"{}\", blue_team_score);\n // 使用for循环获取HashMap里的值,由于使用&h,所以这里的key为&&String,value为&&i32\n for (key, value) in &h {\n println!(\"key:{}, value:{}\", key, value);\n }\n\n\n let k = String::from(\"blue\");\n // 更新值,如果是直接覆盖,使用insert即可\n h.insert(&k, &20);\n // 通过entry函数返回Entry枚举类型,其or_insert方法可以判断值是否存在,不存在则插入,存在则不处理\n // 其返回HashMap中value的可变引用,在此为&mut &i32,可以对其进行修改\n let e = h.entry(&k).or_insert(&30);\n *e = &11;\n // {\"blue\": 11, \"yellow\": 50}\n println!(\"{:?}\", h);\n\n // 例子,查看一个字符串中每一个字符出现的次数\n let text = \"hello world hello lee ok\";\n let mut map = HashMap::new();\n for i in text.split_whitespace() {\n let count = map.entry(i).or_insert(0);\n *count += 1;\n }\n // {\"ok\": 1, \"world\": 1, \"lee\": 1, \"hello\": 2}\n println!(\"{:?}\", map);\n```\n\n## 错误处理\n\n* 不可恢复错误:使用panic!宏,其参数与println!类似,支持占位符;\n\n* 访问Vec越界也会产生panic;\n\n* 在cargo.toml中的profile.release节添加`panic= 'abort'`来减少bin文件的大小(因为减少了栈展开所需要的信息);\n\n* 添加`RUST_BACKTRACE=1`可以输出更加详细的panic信息,例如`cargo run --bin error --release`;\n\n* 如果是可恢复错误,使用Result做为返回值来处理包含正常情况和异常情况,正常情况下返回Ok(T),异常时返回Err(E)。\n\n```rust\nenum Result{\n Ok(T),\n Err(E),\n}\n```\n\n以下例子位于example/src/bin/error.rs:\n\n```rust\n let file_name = \"Cargo.toml\";\n // 对于有可能出错的函数可以返回Result,Ok表示正常返回,Err表示异常\n let mut f = match File::open(file_name) {\n Ok(file) => file,\n Err(e) => panic!(\"open file error:{:?}\", e),\n };\n // 读取文件的内容,并输出\n let mut c = String::new();\n f.read_to_string(&mut c);\n println!(\"{}\", c);\n\n let file_name = \"hello.txt\";\n let f = match File::open(file_name) {\n Ok(file) => file,\n // 使用e.kind()为区别不一样的类型\n Err(e) => match e.kind() {\n // 不存在的时候就创建,返回成功创建的句柄\n ErrorKind::NotFound => match File::create(file_name) {\n Ok(file) => file,\n Err(e) => panic!(\"create file error:{:?}\", e),\n },\n // 其它错误统一命中这个分支,报错panic\n other_error => panic!(\"open file error:{:?}\", other_error),\n }\n };\n\n // 使用Result.unwrap()函数来快速获取Ok的值,如果是Err,则直接panic\n let f: File = File::open(file_name).unwrap();\n // 与unwrap一样,只是传入了一个字符串做为panic时的信息\n let f: File = File::open(file_name).expect(\"Fail to open file\");\n\n // 传播错误\n // 以下函数的功能等同于std::fs::read_to_string(file_name)\n fn get_content_by_file_name(name: &str) -> Result {\n let mut f = match File::open(name) {\n Ok(file) => file,\n Err(e) => return Err(e),\n };\n // 读取文件的内容,并输出\n let mut c = String::new();\n return match f.read_to_string(&mut c) {\n Ok(_) => Ok(c),\n Err(e) => Err(e),\n };\n }\n // 使用?运算符简化写法\n // 注意使用?运算符与match不一样的地方是在Err类型不匹配的时候,会自动调用from函数进行隐式转换(需要实现From trait)\n fn get_content_by_file_name2(name: &str) -> Result {\n // 如果需要将Result的Err返回,则在最后使用?表达式来达到目的\n let mut f = File::open(name)?;\n // 读取文件的内容,并输出\n let mut c = String::new();\n f.read_to_string(&mut c)?;\n Ok(c)\n }\n // 使用链式调用更加简化写法\n fn get_content_by_file_name3(name: &str) -> Result {\n let mut c = String::new();\n File::open(name)?.read_to_string(&mut c)?;\n Ok(c)\n }\n```\n\n## 泛型、Trait、生命周期\n\n### 泛型\n\n\n泛型代码的性能问题:Rust在编译期间将泛型代码单态化(monomorphization),即将泛型代码根据调用时的类型生成对应的代码。所以不会对运行时造成性能影响。例如 Option\\类型在应用到i32和i64上时,生成了以下两种类型Option_i32,Option_i64。\n\n以下例子位于example/src/bin/generic.rs:\n\n```rust\nfn main() {\n // 在方法中使用泛型,在函数名称后添加尖括号,并在括号中添加类型说明,\n // 表示这个类型必须实现PartialOrd和Copy这两个Trait\n // 参数为对应类型的数组切片,返回对应类型的值\n // 由于对元素使用了大于比较计算符,所以类型T必须实现std::cmp::PartialOrd\n // 由于需要从list[0]中取出数据,所以需要实现Copy;也可以使用引用来处理\n fn largest(list: &[T]) -> T {\n let mut max = list[0];\n for &item in list.iter() {\n if item > max {\n max = item\n }\n }\n max\n }\n // 使用引用的版本,不需要实现Copy\n fn largest2(list: &[T]) -> &T {\n let mut max = &list[0];\n for item in list.iter() {\n if *item > *max {\n max = item\n }\n }\n max\n }\n println!(\n \"{},{},{}, {}\",\n largest(&[1, 2, 3, 4, 5, 6, 9, 3, 4, 6]),\n largest(&[1.0, 3.0, 1.1, 5.5, -1.0, -2.4]),\n // 动态数组可以转化为数组切片\n largest(&vec![1, 2, 3, 4, 5, 4, 3, 2, 1]),\n largest(&vec!['a', 'b', 'e', 'd', 'k', 'i', 'g']),\n );\n\n // 在结构体中使用泛型,在结构体名之后使用尖括号来声明\n struct Point {\n x: T,\n y: T,\n }\n impl Point {\n fn x(&self) -> &T {\n &self.x\n }\n // 在泛型的结构里定义泛型的方法\n fn other(&self, other: Point) -> Point {\n other\n }\n }\n\n // 在枚举中使用泛型,我们之前看到的Option和Result都有使用,不再举例\n enum Option {\n Some(T),\n None,\n }\n enum Result {\n Ok(T),\n Err(E),\n }\n}\n```\n\n### Trait \n\n* trait是指某些特定类型拥有的,而且可以被其它类型所共享的功能集合,类似于其它语言的interface。\n\n* **实现trait的代码要么位于trait定义的包中,要么位于结构体定义的包中,而不能在这两个包外的其它包中,这个规则称之为孤儿规则,是程序一致性的组成部分**。\n\n以下例子位于example/src/bin/trait.rs:\n\n```rust\n // 定义多种文章共有的摘要功能trait\n pub trait Summary {\n fn summarize(&self) -> String;\n // trait也可以提供一个默认实现,这样实现了这一trait的结构体,如果没有提供实现,则以默认实现为准\n fn summarize2(&self) -> String {\n String::from(\"Read more\")\n }\n }\n\n pub struct NewsArticle {\n pub headline: String,\n pub location: String,\n pub author: String,\n pub content: String,\n }\n // 为某一个结构实现trait,使用关键字impl和for\n // 实现的trait跟普通函数一样,可以被调用\n impl Summary for NewsArticle {\n fn summarize(&self) -> String {\n format!(\"{},{},{}\", self.headline, self.author, self.location)\n }\n }\n pub struct Tweet {\n pub username: String,\n pub content: String,\n pub reply: bool,\n pub retweet: bool,\n }\n impl Summary for Tweet {\n fn summarize(&self) -> String {\n format!(\"{},{}\", self.username, self.content)\n }\n // 重载了默认实现,这样就无法调用到默认实现了\n fn summarize2(&self) -> String {\n format!(\"summarize2....\")\n }\n }\n let tweet = Tweet {\n username: \"lee\".to_string(),\n content: \"content\".to_string(),\n reply: false,\n retweet: false,\n };\n // trait实现的函数,可以像普通函数一样调用,summarize2调用则是默认的实现\n println!(\"tweet: {}, summary2:{}\", tweet.summarize(), tweet.summarize2());\n\n // 将trait作为参数\n // 这个函数接收实现了Summary trait的结构体类型,在这里可传入Tweet和NewsArticle\n pub fn notify(item: &T) {\n println!(\"breaking news1:{}\", item.summarize())\n }\n notify(&tweet);\n // 可以使用impl形式的语法糖来简化写法,与之前的一致\n // 是否简化也区别于实际场景,例如多个函数使用同一个约束时,使用泛型表达式则更加方便\n pub fn notify2(item: &impl Summary) {\n println!(\"breaking news2:{}\", item.summarize())\n }\n notify2(&tweet);\n\n // 使用多个约束时使用+号来处理,这里的item必须实现Display和Summary两个trait\n pub fn notify3(item: T) {}\n // 在复杂情况下使用where语句可以使得函数签名更清晰,以下两种方式是等价的\n fn some_func(t: T, u: U) -> i32 { 1 }\n fn some_func2(t: T, u: U) -> i32 where T: Display + Clone, U: Clone + Debug { 1 }\n\n // 可以返回可以使用impl形式,但只能返回一中类型,要么是Tweet,要么是NewsArticle,不能在不同的分支返回两种类型\n fn return_summarizable() -> impl Summary {\n Tweet {\n username: \"\".to_string(),\n content: \"\".to_string(),\n reply: false,\n retweet: false,\n }\n }\n // 以下无法通过编译,对于泛型,需要深入研究一下机制,为什么以下函数无法通过编译\n // fn return_summarizable2(item:T) -> T {\n // Tweet {\n // username: \"\".to_string(),\n // content: \"\".to_string(),\n // reply: false,\n // retweet: false,\n // }\n // }\n\n // 使用trait约束来有条件地实现方法\n struct Point {\n x: T,\n y: T,\n }\n // 为所有类型的T的Point实现new方法\n impl Point {\n // 大写的Self与小写的self区别\n fn new(x: T, y: T) -> Self {\n Point { x, y }\n }\n }\n // 只为实现了PartialOrd和Display的Point实现cmp方法\n impl Point {\n fn cmp(&self) {\n if self.x > self.y {\n println!(\"x>y\")\n } else {\n println!(\"x<=y\")\n }\n }\n }\n // 也可以使用一个trait约束来实现另外一个trait,称之为覆盖实现(blanket implementation)\n // 例如以下的例子,为了实现了Display的类型实现Summary方法\n impl Summary for T {\n fn summarize(&self) -> String {\n format!(\"read more:{}\", self)\n }\n }\n // 以下例子无法通过编译,因为Display不在此包中,T这一也不在此包中,受孤儿规则限制,将报错\n // 报错:Only traits defined in the current crate can be implemented for arbitrary types [E0117]\n // impl Display for T {\n // fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {\n // write!(f, \"({}, {})\", self.x, self.y)\n // }\n // }\n\n // 因为上面为实现Display的类型实现了Summary,而i32实现了Display,所以i32实现了Summary\n // 输出read more:2\n println!(\"{}\", 2.summarize());\n```\n\n### 生命周期\n\n* 生命周期大部分情况下可以推导出来,当无法推导时,就必须手动标注生命周期;\n\n* 生命周期最主要的目的是避免悬垂引用,进而避免程序引用到非预期的数据;\n\n* Rust中不允许空值的存在;\n\n* 借用检查器(borrow checker):用于检查各个变量的生命周期长短,以判断引用是否合法。\n\n生命周期的标注:\n\n* 生命周期的标注以单引号开始,后跟小写字母(通常情况下),通常非常简短,例如```'a```;\n\n* 标注跟在&之后,并使用空格与引用类型区分开,例如`&'a i32`、`&'a mut i32`等。\n\n每一个引用都有生命周期,而函数在满足一定条件下,可以省略生命周期声明,称为生命周期省略规则。\n\n使用以下三条规则计算出生命周期后,如果仍然有无法计算出生命周期的引用时,则编译出错:\n\n1. 每一个引用参数都有自己的生命周期,这一条用于计算输入生命周期;\n\n2. 只存在一个输入生命周期时,这个生命周期将赋值给所有的输出生命周期参数,这一条用于计算输出生命周期;\n\n3. 当拥有多个输入生命周期参数,而其中一个是&self或&mut self时,self的生命周期会被赋予给所有的输出生命周期参数。这条规则使方法更加易于阅读和编写,因为它省略了一些不必要的符号。\n\n以下例子位于example/src/bin/live_time.rs:\n\n```rust\n let mut r = &2;\n {\n let x = 5;\n // 以下无法通过编译,因为x在内部作用域内,而r在main作用域,r的生命周期大于x,无法使用x的引用。\n // `x` does not live long enough\n // r = &x\n }\n println!(\"{}\", r);\n\n // 如果不加生命周期标注的话,无法确定返回值的生命周期,无法通过编译\n // 由于x,y两个参数都用于做为引用返回,所以x,y必须都要标明生命周期\n // 这里的'a会被具体化为x,y的生命周期中重叠的那一部分\n fn longest<'a>(x: &'a str, y: &'a str) -> &'a str {\n if x.len() > y.len() {\n x\n } else {\n y\n }\n }\n\n let s1 = String::from(\"s11\");\n let mut s4 = \"\";\n {\n let s2 = String::from(\"s2\");\n // longest返回值的生命周期是s1和s2中生命周期较短的那个,即s2的生命周期\n // s3的生命周期与s2一样,所以能通过编译\n let s3 = longest(&s1, &s2);\n println!(\"{}\", s3);\n // 以下无法通过编译,因为s4的生命周期大于s2\n // s4 = longest(&s1, &s2);\n }\n println!(\"{}\", s4);\n\n // 以下这个函数不满足生命周期省略规则,所以必须手动标注\n // fn longest(x:&str, y:&str)->&str{}\n // 以下函数应用规则1和规则2后,所有的输入输出引用参数周期都确定,所以可以省略\n // fn first_word(x:&str)->&str{}\n\n\n // 结构体中引用字段的生命周期标\n struct ImportantExcerpt<'a> {\n part: &'a str,\n }\n\n impl<'a> ImportantExcerpt<'a> {\n fn level(&self) -> i32 {\n 2\n }\n // 应用第一条规则和第三条规则,可以得出正确的生命周期,所以以下这个可以周期可以省略\n fn announce_and_return_part(&self, announcement: &str) -> &str {\n self.part\n }\n // 应用第一条和第三条规则,得出的生命周期不正确,所以在没有生命周期房间里时编译报错\n fn display_part_and_return<'b>(&self, announcement: &'b str) -> &'b str {\n announcement\n }\n }\n\n // 'static是固定写法,表示生命周期是整个程序的执行周期\n // 所有字符串字面量都拥有'static生命周期\n let s: &'static str = \"abc\";\n\n use std::fmt::Display;\n // 同时使用生命周期,泛型,trait约束的例子\n // 生命周期必须在泛型类型声明之前,也可以使用where进行trait约束\n // 生命周期也是泛型的一种??\n fn longest_with_announcement<'a, T:Display>(x: &'a str, y: &'a str, anno: T) -> &'a str {\n println!(\"{}\", anno);\n if x.len() > y.len() {\n x\n } else {\n y\n }\n }\n```\n\n## 编写自动化测试\n\nRust中的单元测试一般与要测试的代码放在同一个文件中,使用的模块名称为tests,通过```#[cfg(test)]```来标记,让编译器只在cargo test时才编译和运行这一部分代码,在cargo build等场景会剔除这些代码。\n\n在函数上使用```#[test]```称为属性(attribute),与C#的attribute以及Java的annotation一样,用于给编译器提供更多的信息。\n\ncargo test参数说明之\\-\\-之后的参数:\n\n* \\-\\-test-threads=1:运行的并发数,默认是多个case并行执行,可以设置成1为串行执行;\n* \\-\\-nocapture:将测试用例中打印出来内容输出显示出来。默认情况下这些内容会被捕获并丢弃;\n* \\-\\-ignored:专门运行被```#[ignore]```标记的case。\n\ncargo test参数说明之\\-\\-之前的参数:\n\n* \\-q:静默情况下运行测试用例,输出的信息比较有限;\n\n* \\-\\-test file_name:用于指定运行集成测试的文件,注意不用跟.rs后缀名。\n\ncargo test允许我们指定需要运行的用例名,例如cargo test adder,则所有case名中包含有adder的case都会被运行(例如:tests::adder_test),这种方法只能指定一个匹配字符串,无法指定多个。\n\n在```#[test]```标记之后,跟上```#[ignore]```的测试函数,默认情况下不会运行,只有使用\\-\\-ignored时,才会专门运行这些case,例如```cargo test -- --ignored```。\n\n本单元的例子位于adder项目中:\n\n```rust\n//! # Adder\n//!\n//! 测试做为包的注释,包含有一些小组件\n\nuse std::ops::Add;\n\n/// 定义一个泛型加法\n///\n/// # Example\n///\n/// 例子,一般是测试用例\n/// ```\n/// assert_eq!(5, adder::adder(3,2));\n/// assert_eq!(9.8, adder::adder(3.3, 6.5));\n/// ```\n/// # Panics\n///\n/// 可能Panic的场景\n///\n/// # Errors\n/// 如果返回Result时,这里写明Error返回的场景,以及返回的Error值\n///\n/// # Safety\n///\n/// 当使用了unsafe关键字时,这里可以说明使用unsafe的原因,以及调用者的注意事项\n///\npub fn adder>(a: T, b: T) -> T {\n return a + b;\n}\n\n#[cfg(test)]\nmod tests {\n // 引入所有父模块的所有包,这样可以直接使用adder方法,否则adder需要指定完整路径才能使用\n use super::*;\n use std::fs::File;\n use std::io::Read;\n\n // 标记以下函数是一个测试函数,如果没有这个标记,cargo test的时候不会运行\n #[test]\n fn it_works() {\n // 相等断言\n assert_eq!(2 + 2, 4);\n }\n\n #[test]\n fn adder_test() {\n // 注意使用了assert_eq和assert_ne这两个断言时,两个参数必须实现了PartialEq和Debug这两个trait,一个用于判断相等,一个用于出错时输出信息\n\n // 以下两个写法等价,推荐使用第一个写法,因为在失败时可以打印出���个参数的值,方便分析原因\n assert_eq!(adder(2, 2), 4);\n assert!(adder(2, 2) == 4); // assert!接收一个bool类型的参数,只有为true时测试才通过\n // assert_ne!用于断言两个值不相等\n assert_ne!(adder(2.0, 3.0), 6.0);\n\n // 这些断言在必要参数之后的信息都会被用于format!输出额外的信息\n assert_eq!(adder(3, 4), 7, \"{}+{} is not equal 7\", 3, 4);\n }\n\n #[test]\n // should_panic属性用于表示这个函数会发生panic\n // 参数expected会比较panic的信息是否与此相匹配,注意中人包含expected的内容即可\n #[should_panic(expected = \"panicked\")]\n fn check_panic() {\n panic!(\"i panicked\")\n }\n\n #[test]\n // 使用Result做为测试用例的返回值时,只要有Err返回,就测试失败\n // 这种情况下可以使用?表达式来简化测试用例的编写\n fn use_result() -> Result<(), std::io::Error> {\n let mut f = File::open(\"./cargo.toml\")?;\n let mut s = String::new();\n let _ = f.read_to_string(&mut s)?;\n return Ok(());\n }\n\n #[test]\n #[ignore] // 默认情况下忽略此case,可以通过--ignored来专门运行这种case\n fn long_time_test() {}\n}\n```\n\n\n集成测试:\n\n* 在src同级别建立tests目录,在这个目录下可以创建任意的集成测试用例;tests目录只在cargo test时进行编译和执行,其它情况会忽略;\n\n* tests目录下每一个文件都是独立包名,所以不用担心测试函数会重名;\n\n* 可以在tests目录下建立子目录,做为公共使用的部分,或者隐藏测试中的细节等等,子目录中的函数也可以标记为```#[test]```,但他只在tests目录下的文件引用到时执行;\n\n* 如果将子目录做为公共部分使用,一般不在里面设置测试用例,因为如果多个测试模块引用的话,这个case将被运行多次;\n\n* 无法在集成测试中引用main.rs,所以一般我们将复杂的操作移到lib.rs中,而main.rs中只保留简单的胶水代码逻辑。\n\n```rust\n// src/tests/integation.rs\n#[test]\nfn adder_test() {\n assert_eq!(adder::adder(9.0, 10.0), 19.0);\n}\n\n#[test]\nfn my_note() {\n assert_eq!(adder::adder(9.0, 10.0), 19.0);\n}\nmod sub;\n```\n\n```rust\n// src/tests/sub/mod.rs\n#[test]\npub fn setup() {}\n```\n\n## minigrep例子\n\n* `std::env::args()`获取命令行参数,格式与其它语言一样;\n\n* `std::process::exit(1)`退出进程,这个函数签名为`pub fn exit(code: i32) -> !`,`!`表示从来不会返回;\n\n* `std::fs::read_to_string()`读取文件内容;\n\n* `std::env::var(\"CASE_INSENSITIVE\")`获取环境变量值;\n\n* `eprintln!`将错误信息打印到标准错误输出。\n\n代码位于minigrep项目中:\n\n```rust\n// main.rs\nuse minigrep::*;\n\n// main函数里的代码无法进行单元测试和集成测试,所以main函数这块保持简单,把逻辑移到lib.rs下\nfn main() {\n // std::env::args()返回的是Args实现了Iterator,使用collect转化为Vec\n // 因为collect返回的也是泛型,编译器无法自动推断需要返回的类型,所以给args的类型标注不可省略\n let args: Vec = std::env::args().collect();\n\n // Result结构的unwrap_or_else方法接收一个函数来做错误处理\n // 处理函数包含一个闭包参数,使用竖线包起来,获取到的值为Result的E中的值\n // 处理函数必须返回Result的T值(正确的值),但std::process::exit(1)直接退出进程,所以可以编译通过\n // exit的返回值为->!,表示从不会返回:pub fn exit(code: i32) -> !\n let config = Config::new(&args).unwrap_or_else(|err| {\n // 使用eprintln!将错误信息输出到标准错误输出\n eprintln!(\"Problem parsing arguments: {}\", err);\n std::process::exit(1);\n });\n\n // // 使用迭代器的版本\n // let config = Config::new2(std::env::args()).unwrap_or_else(|err| {\n // eprintln!(\"Problem parsing arguments: {}\", err);\n // std::process::exit(1);\n // });\n\n // 使用if let语法,只处理关心的变体\n if let Err(e) = run(&config) {\n eprintln!(\"Application error: {}\", e);\n std::process::exit(1);\n }\n}\n```\n\n```rust\n// lib.rs\n// 返回Result中的E为Box,表示为实现了Error这一trait的类型\n// 具体的类型需要在具体的场景中才能确定,这里的dyn关键字也说明了是一个动态的类型\npub fn run(config: &Config) -> Result<(), Box> {\n let contents = std::fs::read_to_string(&config.filename)?;\n let result = if config.case_sensitive {\n search(&config.query, &contents)\n } else {\n search_case_insensitive(&config.query, &contents)\n };\n\n for l in result {\n println!(\"{}\", l);\n }\n Ok(())\n}\n\npub struct Config {\n query: String,\n filename: String,\n case_sensitive: bool,\n}\n\nimpl Config {\n // 使用命令行参数来构造Config结构,返回Result结构,在出错时返回str\n // 返回值中的str中声明了生命周期为全局的,因为字面量常量可以是全局的,此处不设置其实也没有问题,生命周期与输入一致\n pub fn new(args: &[String]) -> Result {\n if args.len() < 3 {\n return Err(\"not enough arguments!\");\n }\n let query = args[1].clone();\n let filename = args[2].clone();\n // 读取环境变量来确定是否需要大小写敏感,读取到无error则case_sensitive=false,不区分大小写,如下\n // CASE_INSENSITIVE=1 cargo run Nobody poem.txt\n let case_sensitive = std::env::var(\"CASE_INSENSITIVE\").is_err();\n // 变量与结构体字段重名时,可以使用此种方式快速构建\n Ok(Config { query, filename, case_sensitive })\n }\n // 使用迭代器版本\n pub fn new2(mut args: std::env::Args) -> Result {\n args.next();\n let query = match args.next() {\n Some(q) => q,\n None => return Err(\"no query\")\n };\n let filename = match args.next() {\n Some(f) => f,\n None => return Err(\"no filename\")\n };\n let case_sensitive = std::env::var(\"CASE_INSENSITIVE\").is_err();\n Ok(Config { query, filename, case_sensitive })\n }\n}\n\n// 这块需要指定生命周期,表明Vec返回的&str,与contents的生命周期绑定\n// 如果contents失败了,那么返回值也将没有意义了\nfn search<'a>(query: &str, contents: &'a str) -> Vec<&'a str> {\n let mut ret: Vec<&str> = Vec::new();\n for line in contents.lines() {\n if line.contains(query) {\n ret.push(line)\n }\n }\n ret\n // 使用迭代器版本\n // contents.lines().filter(|line| line.contains(query)).collect()\n}\n\nfn search_case_insensitive<'a>(query: &str, contents: &'a str) -> Vec<&'a str> {\n let mut ret: Vec<&str> = Vec::new();\n let q = query.to_lowercase();\n for l in contents.lines() {\n if l.to_lowercase().contains(&q) {\n ret.push(l)\n }\n }\n ret\n}\n\n#[cfg(test)]\nmod tests {\n use super::*;\n\n #[test]\n fn one_result() {\n let query = \"duct\";\n let contents = \"\\\nRust:\nsafe, fast, productive.\nPick three.\n \";\n assert_eq!(\n vec![\"safe, fast, productive.\"],\n search(query, contents),\n );\n }\n\n #[test]\n fn case_insensitive() {\n let query = \"rust\";\n let contents = \"\\\nRust:\nsafe, fast, productive.\nPick three.\n \";\n assert_eq!(\n vec![\"Rust:\"],\n search_case_insensitive(query, contents),\n );\n }\n}\n```\n\n## 函数式语言特性:迭代器与闭包\n\n### 闭包\n\n与闭包相关的三种trait: Fn, FnMut, FnOnce,所有闭包至少实现其中的一个。\n\n这三个trait代表了函数接收参数的三种方式:不可变引用(Fn),可变引用(FnMut),获取所有权(FnOnce)。\n\nrust自动从闭包的定义中推导出其所实现的trait。\n\n所有函数都实现了这三个trait,所以要求传闭包的地方都可以传函数。\n\n这三个trait的区别:\n\n* 实现了FnOnce的闭包可以从环境中获取变量的所有权,所以这个类型的闭包只能被调用一次;\n\n* 实现了FnMut的闭包从环境中可变地借用值;\n\n* 实现了Fn的闭包从环境中不可变地借用值;\n\n* 所有闭包都实现了FnOnce,实现了Fn的闭包也实现了FnMut。\n\n以下例子位于example/src/bin/functional.rs中:\n\n```rust\nfn main() {\n // 闭包当作匿名函数的一般写法,参数和返回值的类型,由编译器推断出来\n let add_one = |x| {\n x + 1\n };\n // 如果无法推断,则需要写成这种详细的形式,与函数定义非常类似\n let add_one2 = |x: i32| -> i32{\n x + 1\n };\n // 在匿名函数没有捕获环境变量的情况下,与函数一样\n fn add_one_fn(x: i32) -> i32 {\n x + 1\n }\n\n fn use_fn(x: i32, f: fn(i32) -> i32) -> i32 {\n f(x)\n }\n\n // 输出2,2,2\n // 可见无捕获上下文的闭包与函数一样\n println!(\"{},{},{}\", use_fn(1, add_one), use_fn(1, add_one2), use_fn(1, add_one_fn));\n\n // 如果捕获了环境变量,则闭包与函数就不能通用了\n let k = 1;\n let add_one_closure = |x: i32| {\n x + k + 1\n };\n // 这里报错,expected fn pointer, found closure\n // closures can only be coerced to `fn` types if they do not capture any variables\n // println!(\"{}\", use_fn(1, add_one_closure));\n\n // 函数无法捕获上下文:can't capture dynamic environment in a fn item\n // use the `|| { ... }` closure form instead\n // fn f_error(x: i32) -> i32 {\n // x + k + 1;\n // }\n\n // 以下正常运行,输出12\n println!(\"{}\", add_one_closure(10));\n\n // 多个参数时,使用逗号隔离开\n let sum = |x, y| {\n x + y\n };\n // 如果只有一行,可以省略掉大括号\n let sum2 = |x, y| x + y;\n println!(\"{},{}\", sum(1, 2), sum2(2, 3));\n\n // 在不指定类型的闭包,只能推断出一种类型\n let closure = |x| x;\n println!(\"{}\", closure(10));\n // 以下将报错,办为之前的调用已经推断closure为(i32)->i32的闭包,不能再使用&str类型了\n // expected integer, found `&str`\n // println!(\"{}\", closure(\"10\"));\n\n // 与闭包相关的三种trait: Fn, FnMut, FnOnce,所有闭包至少实现其中的一个\n // 这三个trait代表了函数接收参数的三种方式:不可变引用(Fn),可变引用(FnMut),获取所有权(FnOnce)\n // rust自动从闭包的定义中推导出其所实现的trait\n // 所有函数都实现了这三个trait,所以要求传闭包的地方都可以传函数\n\n // 这三个trait的区别:\n // 实现了FnOnce的闭包可以从环境中获取变量的所有权,所以这个类型的闭包只能被调用一次\n // 实现了FnMut的闭包从环境中可变地借用值\n // 实现了Fn的闭包从环境中不可变地借用值\n // 所有闭包都实现了FnOnce,实现了Fn的闭包也实现了FnMut\n // 接收Fn trait做为参数的函数\n fn do_1 i32>(x: i32, f: T) -> i32 {\n f(x)\n }\n let k = vec![1, 2];\n let c_1 = |x| x + k[0] + 1;\n fn f_1(x: i32) -> i32 { x + 1 }\n //\n // 输出5,3\n println!(\"{},{}\", do_1(1, c_1), do_1(1, f_1));\n println!(\"{}\", c_1(1));\n\n // 使用move关键可以获取变量的所有权\n let c_1 = move |x| x + k[0] + 1;\n // ???很奇怪的现象,如果加上下面这一行,则后面的两次调用将报错: borrow of moved value: `c_1`\n // 但如果没有下面这一行,则后面的两次调用则可以通过\n // do_1(1, c_1);\n println!(\"{}\", c_1(1));\n println!(\"{}\", c_1(1));\n\n\n // FnOnce的例子\n fn do_2 String>(f: T) {\n f();\n }\n let a = \"aa\".to_string();\n // c_2因为返回了a变量,而String没有实现Copy trait,所以相当于c_2获取了a的所有权并返回了a,所以c_2只实现了FnOnce trait,无法被传递到Fn作为参数的函数中\n let c_2 = || a;\n // 以下一行将报错: this closure implements `FnOnce`, not `Fn`\n // do_2(c_2);\n fn do_3 String>(f: T) {\n f();\n }\n // 运行正常\n do_3(c_2);\n // 以下编译报错: use of moved value: `c_2`\n // 因为c_2是FnOnce没有实现Copy,所以无法被使用两次\n // do_3(c_2);\n\n // FnMut的例子\n let mut k = 3;\n let mut c_3 = || {\n k = k + 1;\n k\n };\n println!(\"{}\", c_3());\n // 以下将无法通过编译,因为c_3使用k的可变引用,不能再拥有k的其它引用了\n // println!(\"{},{}\", k, c_3());\n}\n```\n\n### 迭代器\n\n比起使用for循环的原始实现,Rust更倾向于使用迭代器风格;迭代器可以让开发者专注于高层的业务逻辑,而不必陷入编写循环、维护中间变量这些具体的细节中。通过高层抽象去消除一些惯例化的模板代码,也可以让代码的重点逻辑(例如filter方法的过滤条件)更加突出。\n\n**迭代器是Rust语言中的一种零开销抽象(zero-cost abstraction)**,这个词意味着我们在使用这些抽象时不会引入额外的运行时开销。\n\n以下例子位于example/src/bin/iterator.rs中:\n\n```rust\nfn main() {\n // 迭代器允许你依次为序列中的每一个元素执行某些任务\n // 迭代器是惰性的,除非主动调用方法来消耗,否则不会有任何作用\n // 迭代器实现了Iterator 这一trait,Iterator有多个方法,但大多都提供了默认的实现\n // 要实现Iterator只需要实现next方法即可\n trait Iterator1 {\n // 关联类型,用于存储next返回值的类型\n type Item;\n // Self::Item表示返回的Option存储的是Item的类型\n // next返回被包裹在Some中的元素,在遍历结束时返回None\n fn next(&mut self) -> Option;\n // 省略默认实现的方法\n // ...\n }\n\n let mut v = vec![1, 2, 3];\n // 必须将iter标识成mut的,因为调用next会改变iter内部的状态\n // iter()方法返回的是一个不可变引用迭代器,next的返回值是数组中元素的不可变引用\n let mut iter = v.iter();\n // 1,2,3,true\n println!(\"{},{},{},{}\", iter.next().unwrap(), iter.next().unwrap(), iter.next().unwrap(), iter.next() == None);\n // 返回可变引用\n for i in v.iter_mut() {\n *i += 1;\n }\n // [2,3,4]\n println!(\"{:?}\", v);\n\n // 使用into_iter获取其所有权,后续v不再可用\n println!(\"{}\", v.into_iter().next().unwrap());\n\n // 迭代适配器,以及与闭包共同实现\n let v = vec![1, 2, 3, 4, 5, 6, 7, 8, 9];\n let add2: Vec = v.iter().map(|x| x + 2).collect();\n let min = 5;\n // 这里使用filter的给到的闭包参数为&&x,要么使用**x解引用,要么在参数中使用&&x来表示x是一个i32\n let big: Vec<&i32> = v.iter().filter(|&&x| x + 2 > min).collect();\n // [3, 4, 5, 6, 7, 8, 9, 10, 11],[6, 7, 8, 9]\n println!(\"{:?},{:?}\", add2, big);\n\n // 创建自定义的迭代器\n struct Counter {\n count: i32,\n }\n impl Counter {\n fn new() -> Counter {\n Counter { count: 0 }\n }\n }\n impl std::iter::Iterator for Counter {\n type Item = i32;\n\n fn next(&mut self) -> Option {\n self.count += 1;\n if self.count > 5 {\n None\n } else {\n Some(self.count)\n }\n }\n }\n for i in Counter::new() {\n println!(\"{}\", i)\n }\n // 一些迭代器复杂的用法\n // Iterator这个trait有很多方法的默认实现,依赖于next方法,我们可以直接使用完成复杂的功能\n // 以下有一个特殊的语法,在方法后面添加::,可以给编译器提示返回的值类型为typeHint,用于无法推断类型的场景时使用\n // Counter::new() is [1, 2, 3, 4, 5]\n // Counter::new().skip(1) is [2, 3, 4, 5]\n // Counter::new().zip(Counter::new().skip(1)) is [(1, 2), (2, 3), (3, 4), (4, 5)]\n // .map(|(a,b)| a*b) is [2, 6, 12, 20]\n // .filter(|x| x % 3 == 0) [6, 12]\n // .sum() is 18\n let c: i32 = Counter::new().zip(Counter::new().skip(1))\n .map(|(a, b)| a * b)\n .filter(|x| x % 3 == 0)\n .sum();\n println!(\"Counter::new() is {:?}\", Counter::new().collect::>());\n println!(\"Counter::new().skip(1) is {:?}\", Counter::new().skip(1).collect::>());\n println!(\"Counter::new().zip(Counter::new().skip(1)) is {:?}\", Counter::new().zip(Counter::new().skip(1)).collect::>());\n println!(\" .map(|(a,b)| a*b) is {:?}\", Counter::new().zip(Counter::new().skip(1)).map(|(a, b)| a * b).collect::>());\n println!(\" .filter(|x| x % 3 == 0) {:?}\", Counter::new().zip(Counter::new().skip(1)).map(|(a, b)| a * b).filter(|x| x % 3 == 0).collect::>());\n println!(\" .sum() is {:?}\", c);\n}\n```\n\n## 进一步认识Cargo及crates.io\n\nRust中的发布配置是一系列定义好的配置方案,例如cargo build时使用dev配置方案,添加`--release`后,使用release配置方案。\n\n在Cargo.toml中添加`[profile.dev]`和`[profile.release]`配置段可以对这两个方案进行配置。\n\n在没有配置时,有一套默认的配置,当自定义了配置时,会使用自定义配置的子集覆盖默认的配置。\n\n提到的配置:\n\n* `opt-level=1`:编译优化程序,0~3优化递增,release默认是3,dev为0。\n\n### 文档注释\n\nRust中使用三斜线做为文档注释,支持markdown语法;被包在markdown里的代码片段会被当成测试case,在运行cargo test的时候运行。\n\n```rust\n// 位于adder项目中\n/// 定义一个泛型加法\n///\n/// # Example\n///\n/// 例子,一般是测试用例\n/// ```\n/// assert_eq!(5, adder::adder(3,2));\n/// assert_eq!(9.8, adder::adder(3.3, 6.5));\n/// ```\n/// # Panics\n///\n/// 可能Panic的场景\n///\n/// # Errors\n/// 如果返回Result时,这里写明Error返回的场景,以及返回的Error值\n///\n/// # Safety\n///\n/// 当使用了unsafe关键字时,这里可以说明使用unsafe的原因,以及调用者的注意事项\n///\npub fn adder>(a: T, b: T) -> T {\n return a + b;\n}\n```\n\n可以使用```cargo doc --open```来打开文档查看。\n\n使用```//!```开头的注释,不像```///```为紧跟的代码提供注释,而是为整个包,或者整个模块提供注释; 这种类型的注释,只能放在文件最开头。\n\n\n### 使用pub use重新组织结构\n\n```rust\n// example/src/lib.rs\n//! # Art\n//!\n//! 测试用于艺术建模的库\n\n// 使用pub use 重新组织API结构\npub use crate::kinds::PrimaryColor;\npub use crate::kinds::SecondaryColor;\npub use crate::utils::mixed;\n\npub mod kinds {\n pub enum PrimaryColor {\n Red,\n Yellow,\n Blue,\n }\n\n pub enum SecondaryColor {\n Orange,\n Green,\n Purple,\n }\n}\n\n MAINTAINER=Jane Doe\npub mod utils{\n use crate::kinds::*;\n\n pub fn mixed(c1:PrimaryColor, c2:PrimaryColor) -> SecondaryColor{\n SecondaryColor::Orange\n }\n}\n```\n\n```rust\n// example/src/bin/pub_use_example.rs\n\n// use example::kinds::PrimaryColor;\n// use example::utils::mixed;\n\n// 使用pub use重新导出包结构后,就可以使用直接使用一级目录的结构,不用关心原包中的结构了\nuse example::PrimaryColor;\nuse example::mixed;\n\nfn main(){\n let red = PrimaryColor::Red;\n let yellow = PrimaryColor::Yellow;\n mixed(red, yellow);\n\n}\n```\n\n### 使用crates.io��享代码\n\n创建步骤:\n\n1. 使用github账号登录[https://crates.io/](https://crates.io/);\n\n2. 在账号设置中绑定邮箱,并验证;\n\n3. 在账号设置中生成New Token;\n\n4. 在本地使用cargo login xxxx(your token)来保存token到本地(~/.cargo/credentials);\n\n5. 在项目中填写足够的信息(Cargo.toml):\n```ini\n[package]\nname = \"guessing_game_xiaochai\"\nversion = \"0.1.0\"\nauthors = \"[xiaochai]\"\nedition = \"2018\"\ndescription = \"a game demo\"\nlicense = \"MIT\"\n```\n\n6. 在命令行中运行cargo publish,此时,会将代码提交到远程:https://crates.io/crates/guessing_game_xiaochai。如果本地是git,并且有未提交的文件,将会生成错误,可以使用``` cargo publish --allow-dirty```忽略git信息。
\n\n更新版本:\n\n1. 修改Cargo.toml,增加版本号;\n\n2. 运行```cargo publish```即可提交新版本。\n\n撤回某个版本:\n\n* ```cargo yank --vers 0.1.0```可以撤回某个版本,虽然还能在crate.io上看到对应版本,但新的项目无法引用这个版本了;\n\n* 使用```cargo yank --vers 0.1.0 --undo```可以取消撤回操作。\n\n如果你分享的是一个二进制包,可以使用`cargo install guessing_game_xiaochai`来下载安装,会安装到~/.cargo/bin目录下。\n\n### 工作空间\n\n同一个工作空间下的项目使用同一个Cargo.lock文件,使用以下步骤新建一个工作空间:\n\n1. 新起目录,例如workspace_example,cd workspace_example;\n\n2. 创建Cargo.toml文件,内容为:\n```ini\n[workspace]\nmembers = [\n \"adder\"\n]\n```\n\n3. 在目录下使用cargo new来创建adder二进制包;\n\n4. 此时不管在workspace_example目录下运行cargo run 还是在workspace_example/adder下,最终的target都会在workspace_example/target目录下;换种说法,adder项目目前已经不是一个独立的项目了,要么1. 在workspace_example/Cargo.toml添加exclude来排除adder项目;2. 或者是在workspace_example/adder/Cargo.toml中添加空的[workspace]段,这样才能将adder单独编译:\n```ini\n[workspace]\nmembers = [\n]\nexclude = [\n \"adder\",\n]\n```\n \n5. 添加add-one这个代码包```cargo new add-one --lib```;\n\n6. adder的二进制文件需要依赖adder-one包,需要在adder/Cargo.toml的dependencies段添加```add-one = { path = \"../add-one\" }```;\n\n7. 在main函数中使用。\n```rust\nfn main() {\n println!(\"Hello, world!\");\n println!(\"{}\", add_one::add_one(10));\n}\n```\n\n8. 在workspace_example下运行```cargo run```,则运行了adder包中的二进制文件;如果一个工作空间下有多个二进制项目的话,可以使用\\-p参数来指定项目\n```cargo run -p adder```\n\n### 扩展cargo\n\n如果在$PATH中包含有cargo-something的可执行文件,那么可以使用cargo something来运行此文件。\n\n例如刚安装的guessing_game_xiaochai程序:\n\n```shell\n➜ workspace_example git:(master) ✗ echo $PATH\n/usr/local/bin:/usr/bin:/bin:/usr/sbin:/Users/bytedance/.cargo/bin\n➜ workspace_example git:(master) ✗ mv ~/.cargo/bin/guessing_game_xiaochai ~/.cargo/bin/cargo-guessing_game_xiaochai\n➜ workspace_example git:(master) ✗ cargo guessing_game_xiaochai\nsecret number is 86\nGuess the number!\nPlease input your guess:\n...\n```\n\n## 智能指针\n\n* 指针是指包含内存地址的变量;\n\n* 引用是最常用的指针,没有额外的开销;\n\n* 智能指针是一些数据结构,他们的功能类似于指针,但拥有额外的元数据和附加功能;\n\n* 引用只是借用数据指针,而智能指针一般拥有数据所有权;\n\n* String和`Vec`是智能指针,他们拥有一片内存区域并允许进行操作,他们还拥有元数据(如容量),并提供额外的功能或保障;\n\n* 智能指针一般使用结构体来实现,需要实现Drop和Deref两个trait:\n> Deref trait使得此结构体的实例可以拥有与引用一致的行为;
\n> Drop trait使得在离开作用域时运行一段自定义代码。\n\n常用智能指针:\n\n* `Box`: 可用于在堆上分配值;\n\n* `Rc`: 允许多重所有权的引用计数智能指针;\n\n* `Ref`,`RefMut`:可以通过`RefCell`访问,是一种可以在运行时而非编译时执行借用规则的类型。\n\n内部可变性:不可变对象可以暴露出能够改变内部值的API。\n\n规避循环引用导致的内存泄露。\n\n### 使用`Box`在堆上分配内存\n\n使用场景:\n\n* 在需要固定尺寸变量的上下文中使用编译期无法确定大小的类型;\n\n* 需要传递大量数据的所有权,但又不希望对数据进行复制;\n\n* 当希望使用实现了某个trait的类型,而又不关心具体类型时。\n\n基本使用方法:\n\n1. 使用Box::new(T)在堆上空间,将T保存于这一空间内,并返回指向堆上这一空间的指针;\n\n2. 在变量前加*(解引用运算符)来获取堆上真正的值,称为解引用。\n\n以下代码位��example/src/bin/smart_pointer.rs中:\n\n```rust\n // Box的基本使用方法\n // a和b都是Box类型,与i32不同的是,Box类似于指向堆上两个i32类型的指针\n let a = Box::new(128);\n let b = Box::new(256);\n // 所以a和b无法直接进行操作,因为Box实现了Deref这一trait,所以可以使用*来解引用\n let c: i64 = *a + *b;\n println!(\"{}\", c); // 384\n```\n\n定义递归类型时需要使用Box,因为不能在编译期确定内存空间的大小\n\n```rust\n // 递归类型必须使用Box\n enum List {\n Cons(i32, Box),\n // 使用Cons(i32, List)将无法通过编译:recursive type `List` has infinite size\n Nil,\n }\n\n use List::{Nil, Cons};\n\n let list = Cons(\n 1,\n Box::new(Cons(\n 2,\n Box::new(Cons(\n 3, Box::new(\n Nil\n ),\n )),\n )),\n );\n\n fn print_list(l: List) {\n match l {\n Cons(i, nl) => {\n print!(\"{}=>\", i);\n print_list(*nl);\n }\n Nil => {\n println!(\"end\");\n }\n }\n }\n print_list(list);\n```\n\n### 自定义智能指针\n\n\n```rust\n // 自定义类似于Box的智能指针(但数据存在在栈上)\n struct MyBox (T); // 元组结构体\n impl MyBox {\n // 提供一个参数,并将此存入结构体中\n fn new(x: T) -> MyBox {\n MyBox(x)\n }\n }\n```\n\n涉及到两个trait: Deref 和Drop。\n\n#### Deref\n\nDeref解引用trait,一个类型实现了Deref trait时,可以使用解引用运算符:\n\n```rust\n // 为MyBox实现Deref,这样就可以使用解引用运算符\n impl Deref for MyBox {\n // 关联类型\n type Target = T;\n\n // 也可以写成fn deref(&self) -> &T {\n fn deref(&self) -> &Self::Target {\n // 以下等价于self.0\n match self {\n MyBox(i) => i\n }\n }\n }\n let a = MyBox(10);\n // 这里的*a类似于*(a.deref()),称之为隐式展开\n println!(\"{}\", *a + 10)\n```\n\n隐式解引用转换:当函数参数为某个类型的引用时,如果传入的参数与此不匹配,则编译器会自动进行解引用转换,直到类型满足要求。\n\n解可变引用:实现DerefMut trait,要实现这一trait,必须首先实现Deref trait。\n\n可变性转换有三条:\n\n1. 当T: Deref时,允许&T转换为&U;\n\n2. 当T: DerefMut时,允许&mut T转换为&mut U;\n\n3. 当T: Deref时,允许&mut T转换为&U;\n\n这三条规则不会破坏借用规则。\n\n\n```rust\n // 隐式解引用转换\n fn hello(name: &str) {\n println!(\"hello, {}\", name);\n }\n let mb: MyBox = MyBox::new(\"lee\".to_string());\n // 正常的写法如下,其发生的步骤1. 需要将MyBox解引用转化为String,2. 使用[..]将String转化为切片&str,这样才符合参数要求\n hello(&(*mb)[..]);\n // 使用自动解引用也能满足这个要求,mb实现了Deref,所以可以获取到String,String也实现了deref,其返回为&str,所以编译器进行了两次解引用转换\n // 以上是编译期完成,不会有任何运行时开销\n hello(&mb);\n\n // 实现可变解引用运算符,实现DerefMut之前必须实现Deref\n impl DerefMut for MyBox {\n fn deref_mut(&mut self) -> &mut Self::Target {\n &mut self.0\n }\n }\n // 满足自动解引用的三条规则\n // 当T: Deref时,允许&T转换为&U。\n // 当T: DerefMut时,允许&mut T转换为&mut U。\n // 当T: Deref时,允许&mut T转换为&U。\n fn hello_exp(name: &mut String) -> &mut String {\n name.push_str(\", hello!\");\n name\n }\n\n let mut b = Box::new(\"abc\".to_string());\n // 当T: DerefMut时,允许&mut T转换为&mut U,与&mut *b是一样的\n let c = hello_exp(&mut b);\n println!(\"{}\", c);\n // 当T: Deref时,允许&mut T转换为&U。\n hello(&mut b);\n```\n\n#### Drop\n\nDrop trait允许我们在离开变量作用域时执行某些自定义的操作,例如释放文件和网络连接等。\n\n`Box`类型通过Drop释放指向堆上的内存。\n\ndrop的执行顺序与变量的创建顺序相反。\n\n无法禁用drop的功能,也无法手动调用Drop的drop方法,但可以使用std::mem::drop来提前清理某个值,这个函数在预导入模块中,所以可以直接使用drop来调用。\n\n```rust\n // 实现Drop的例子\n {\n struct TestDropStruct {\n data:String,\n }\n impl Drop for TestDropStruct{\n fn drop(&mut self) {\n println!(\"{}\", self.data)\n }\n }\n let _a = TestDropStruct{data:\"first object\".to_string()};\n let _b = TestDropStruct{data:\"second object\".to_string()};\n let _c = TestDropStruct{data:\"third object\".to_string()};\n println!(\"main end\");\n // 手动使用std::mem::drop函数来提前清理_c的值\n drop(_a);\n\n // 以上输出顺序为\n // main end\n // first object\n // third object\n // second object\n // 对于_b,_c来说,丢弃顺序与创建顺序相反,所以_c先调用drop函数\n // _a则是由于手动释放导致先执行\n }\n```\n\n### `Rc`基于引用计数的智能指针\n\n`Rc`只能用于单线程中,用于那些在编译期无法确认哪个部分会最后释放的场景。\n\n`RC`只能持有不可变的引用,否则会打破引用规则。\n\n```rust\n {\n // 测试引用计数智能指针Rc类型\n enum RcList {\n RcCons(i32, Rc),\n RcNil,\n }\n use RcList::*;\n // 新建一个引用记录类型使用Rc::new来创建,此处a为Rc类型\n let a = Rc::new( RcCons(3, Rc::new(\n RcCons(4, Rc::new(RcNil)),\n )));\n {\n // Rc::clone全程参数对应的引用计数增加1\n let _b = RcCons(1, Rc::clone(&a));\n let _c = RcCons(2, Rc::clone(&a));\n // 目前有a,_b,_c三个变量引用a,所以a的引用计数为3\n // 除了strong_count,还有week_count,用于避免循环引用\n println!(\"{}\", Rc::strong_count(&a))\n }\n // _b,_c离开作用域,减少了引用计数,但a还在,所以这块的数量是1\n println!(\"{}\", Rc::strong_count(&a))\n }\n```\n\n\n### `RefCell`和内部可变性模式\n\n内部可变性是Rust的设计模式之一,它允许你在只持有不可变引用的情况下修改数据。这在现有的借用规则下是禁止的,所以此类数据结构借用了unsafe代码来绕过可变性和借用规则的限制。\n\n`RefCell`是使用了内部可变性模式的类型。\n\n与`Rc`不同,`RefCell`持有数据的维一所有权。而与`Box`不同,`RefCell`会在运行时检查借用规则,而非在编译时期,如果运行时发现不满足规则 ,则直接panic。所以`RefCell`类型由开发者来保证借用规则 ,则不是编译器。\n\n此类型只能用于单线程中。\n\n`Box`,`Rc`,`RefCell`三者的区别:\n\n1. `Rc`允许一份数据有多个所有者,而`Box`和R`efCell`都只有一个所有者;\n\n2. `Box`允许在编译时检查的可变或不可变借用,`Rc`仅允许编译时检查的不可变借用,`RefCell`允许运行时检查的可变或不可变借用;\n\n3. 由于`RefCell`允许我们在运行时检查可变借用,所以即便`RefCell`本身是不可变的,我们仍然能够更改其中存储的值。\n\n```rust\n{\n // 假设有一个消息trait,需要实现send方法,而这一方法传递self的不可变引用\n pub trait Messenger {\n fn send(&self, msg: &str);\n }\n\n // 但是在测试的时候,我们使用Mock类来模拟Messenger的send的时候,需要把消息存储下来\n // 这样就可以验证存下来的消息是否符合预期,但传入不可变的self阻止了这种做法\n // 此时就需要使用RefCell来实现\n struct Mock {\n message: RefCell>,\n }\n impl Mock{\n fn new()->Mock{\n Mock{\n // 使用RefCell::new来创建新的RefCell\n message:RefCell::new(vec![])\n }\n }\n }\n impl Messenger for Mock {\n fn send(&self, msg: &str) {\n // 如果这里的self.message是普通的Vec,则无法执行push方法\n // 而使用RefCell的borrow_mut来绕过此限制,得到可变引用\n self.message.borrow_mut().push(String::from(msg))\n }\n }\n let m = Mock::new();\n m.send(\"message1\");\n m.send(\"message2\");\n // [\"message1\", \"message2\"]\n println!(\"{:?}\", m.message.borrow());\n // 以下两行可以通过编译,但在运行时报错:thread 'main' panicked at 'already borrowed: BorrowMutError'\n // 这是因为a是不可变引用,在已经持有不可变引用的情况下,又搞出了一个可变的引用,破坏了借用规则 ,所以panic\n // let a = m.message.borrow();\n // let mut b = m.message.borrow_mut();\n }\n```\n\n结合使用`Rc`和`RefCell`来实现某个数据有多个所有者,并且都可以对数据进行修改。\n\n```rust\n {\n #[derive(Debug)]\n enum RcRefCellList {\n RcRefCellCons(Rc>, Rc),\n RcRefCellNil,\n }\n use RcRefCellList::*;\n let val = Rc::new(RefCell::new(5));\n let a = Rc::new(RcRefCellCons(Rc::clone(&val), Rc::new(RcRefCellNil)));\n let b = RcRefCellCons(Rc::new(RefCell::new(6)), Rc::clone(&a));\n let c = RcRefCellCons(Rc::new(RefCell::new(6)), Rc::clone(&a));\n // 这块改动将a,b和c以及val都修改了\n *val.borrow_mut() = 10;\n // a:RcRefCellCons(RefCell { value: 10 }, RcRefCellNil)\n // b:RcRefCellCons(RefCell { value: 6 }, RcRefCellCons(RefCell { value: 10 }, RcRefCellNil))\n // c:RcRefCellCons(RefCell { value: 6 }, RcRefCellCons(RefCell { value: 10 }, RcRefCellNil))\n println!(\"a:{:?}\", a);\n println!(\"b:{:?}\", b);\n println!(\"c:{:?}\", c);\n\n }\n```\n\nRust不保证在编译器彻底防止内存泄露。我们可以创建出一个环状引用使得引用计数不会减到0,对应的值不会被丢弃,从而造成内存泄露。\n\n\n```rust\n {\n // 创建出循环引用\n // 定义一个链接,为了方便改动,这次的链接使用ReCell来处理\n enum RefCellRcList {\n RefCellRcCons(i32, RefCell>),\n RefCellRcNil,\n }\n use RefCellRcList::*;\n // 定义一个a,指向b\n // a -> 5 -> Nil\n let a = Rc::new(\n RefCellRcCons(5, RefCell::new(Rc::new(RefCellRcNil))),\n );\n println!(\"reference count:a:{}\", Rc::strong_count(&a));\n\n // b -> 10 -> a\n let b = Rc::new(\n RefCellRcCons(10, RefCell::new(Rc::clone(&a))),\n );\n println!(\"reference count:a:{}, b:{}\", Rc::strong_count(&a), Rc::strong_count(&b));\n // 将a -> b;最终变成a->b->10->a\n if let RefCellRcCons(i, r) = a.borrow() {\n *r.borrow_mut() = Rc::clone(&b);\n };\n println!(\"reference count:a:{}, b:{}\", Rc::strong_count(&a), Rc::strong_count(&b));\n // reference count:a:1\n // reference count:a:2, b:1\n // reference count:a:2, b:2\n // 此时a和b的引用计数都是2,在结束时,先释放b,将b的引用计数减1,但此时b已经无法将引用计数减成0了,所以无法释放\n }\n```\n\n可以合理使用弱引用`Weak`来规避这个问题,Rust在回收内存时不需要强制弱引用减成0。\n\n与Rc::clone()类似,使用Rc::downgrade()获取`Rc`的弱引用,获取对应弱引用的值时,使用对应弱引用的upgrade()方法,注意这个方法可能返回None。\n\n```rust\n {\n // 使用Weak创建树结构,子节点指向父节点使用弱引用\n #[derive(Debug)]\n struct Node {\n val: i32,\n // 多个子节点使用Vec来保存子节点的强引用,RefCell方便修改对应的值\n children: RefCell>>,\n // 父节点点使用弱引用\n parent: RefCell>,\n }\n\n let leaf = Rc::new(Node {\n val: 10,\n children: RefCell::new(vec![]),\n // Weak::new()创建出一个空的弱引用\n parent: RefCell::new(Weak::new()),\n });\n // 弱引用获取时,由于不确定值是否回收,所以使用upgrade()时会返回Option,如果已经回收或者没有值,返回None\n // 以下返回None\n println!(\"{:?}\", leaf.parent.borrow().upgrade());\n\n let branch = Rc::new(Node {\n val: 5,\n children: RefCell::new(vec![Rc::clone(&leaf)]),\n parent: RefCell::new(Weak::new()),\n });\n *(leaf.parent.borrow_mut()) = Rc::downgrade(&branch);\n println!(\"leaf's parent:{:?}\", leaf.parent.borrow().upgrade());\n println!(\"branch's parent:{:?}\", branch.parent.borrow().upgrade());\n {\n // 在另外一个作用域中添加branch的parent\n let new_branch = Rc::new(Node {\n val: 6,\n children: RefCell::new(vec![Rc::clone(&branch)]),\n parent: RefCell::new(Weak::new()),\n });\n *branch.parent.borrow_mut() = Rc::downgrade(&new_branch);\n println!(\"branch's parent in new area:{:?}\", branch.parent.borrow().upgrade());\n }\n\n // 由于new_branch离开了作用域,所以被销毁,这块拿到的是None\n println!(\"branch's parent out area:{:?}\", branch.parent.borrow().upgrade());\n }\n```\n\n\n## 线程\n\n使用std::thread::spawn()向参数中传入一个闭包函数来支持多线程运行。\n\nspawn返回线程句柄,其join方法会阻塞等待线程执行完成。\n\n在闭包中使用move关键字可使得闭包函数获取变量的所有权。\n\n此章节例子位于example/src/bin/thread.rs中:\n\n```rust \n let v = vec![1,2,3];\n\n // 使用thread::spawn启动一个线程,rust原生不支持协程,但有其它库提供支持\n // spawn的参数是一个无参数闭包或者函数,会在另外一个线程中运行这个函数的代码\n // 返回一个Handler,可以调用其join函数等待线程执行完成\n // 如果在闭包中使用环境中的值,需要将其所有权move到新线程中\n // 否��报错closure may outlive the current function, but it borrows `v`, which is owned by the current function\n let t = std::thread::spawn(move || {\n for i in 1..10 {\n println!(\"in thread {}\", i + v[0]);\n std::thread::sleep(std::time::Duration::from_millis(1));\n }\n });\n for i in 1..5 {\n println!(\"out thread {}\", i);\n std::thread::sleep(std::time::Duration::from_millis(1));\n }\n // 由于v的所有权已经被移入新线程了,所以这里就无法再使用v了\n // println!(\"v:{:?}\", v);\n\n // 使用JoinHandler的join方法来等待线程执行完成\n // 返回的是Result类型\n t.join().unwrap()\n```\n\n### 使用通道来传递消息\n\n使用std::sync::mpsc::channel()创建一个通道,获得一个发送端和一个接收端。\n\n发送端可以使用send来发送消息,接收端使用recv和try_recv来阻塞(非阻塞)地接收消息。\n\n接收端还可以被当成有迭代器来处理接收到的消息。\n\n使用std::sync::mpsc::Sender::clone()方法可以复制发送端,从而由多个发送源发送消息。\n\n```rust\n // 使用通道(channel)在线程中传递信息\n // mpsc是multiple producer,single consumer的缩写,顾名思义,只能有一个消费者,但可以多个发送方\n let (tx, rx) = std::sync::mpsc::channel();\n\n std::thread::spawn(move || {\n let hi = \"hi\".to_string();\n tx.send(hi).unwrap();\n // send会将取得没有实现Copy trait的所有权,所以以下语句将报错\n // println!(\"send {}\", hi);\n });\n\n // recv会阻塞线程,直到收到消息\n // 可以使用try_recv来非阻塞地试探是否有消息可以接收,没有消息时将返回Err\n println!(\"{}\", rx.recv().unwrap());\n\n let (tx, rx) = std::sync::mpsc::channel();\n // mpsc支持多个发送方,可以通过clone方法来创建出多个发送端来\n let tx_2 = std::sync::mpsc::Sender::clone(&tx);\n std::thread::spawn(move || {\n for _i in 1..5 {\n tx.send(\"hi\".to_string());\n std::thread::sleep(std::time::Duration::from_millis(100))\n }\n });\n std::thread::spawn(move || {\n for _i in 1..10 {\n tx_2.send(\"there\".to_string());\n std::thread::sleep(std::time::Duration::from_millis(100))\n }\n });\n\n // 将rx当成迭代器来遍历收到的数据\n // 由于tx在线程退出时执行了Drop,整个通道就关闭了,所以rx的迭代就会结束了\n for m in rx {\n println!(\"got:{}\", m)\n }\n```\n\n### 使用共享状态来实现消息传递\n\n使用通道类似于单一所有权,使用共享状态类似于多重所有权。\n\n并发原语(互斥体/mutex)一次只允许一个线程访问数据:\n\n1. 必须在使用数据前尝试获取锁;\n\n2. 必须在使用完互斥体守护的数据后释放锁,这样其他线程才能继续完成获取锁的操作。\n\n使用std::sync::Mutex::new(T)创建一个互斥量,保存着一个T值。\n\nlock返回一个智能指针,在离开作用域时自动解锁。\n\n```rust\n // mutex的使用\n // 使用new函数创建互斥量,存储一个i32的值\n let m = std::sync::Mutex::new(10);\n {\n // 使用lock返回一个Result,正常时为MutexGuard是一个智能指针\n let mut i = m.lock().unwrap();\n // 修改值为20\n *i = 20;\n // 在这个作用域的结尾,智能指针执行了drop方法,将m解锁了\n }\n // m现在的值为20了\n // Mutex { data: 20, poisoned: false, .. }\n println!(\"{:?}\", m);\n```\n\n在并发场景需要使用Mutex,需要配合引用计数智能指针使用。\n\n`Rc`无法用于并发场景,需要使用`Arc`类型,并发场景下的引用计数智能指针。\n\n多线程模式下两个重要的trait:Sync和Send。Sync和Send这两个trait是内嵌于语言实现的。\n\nSend trait表示可以在线程间安全地转移所有权,Sync trait表示此类型可以安全地被多个线程引用。\n\n除了裸指针外,所有基础类型都实现了Send trait,任何有Send类型组成的复合类型也都实现了Send;如果类型T是Send类型,则&T满足Sync约束。\n\nSend和Sync属于标签trait(marker trait),没有可供实现的方法,手动实现需要使用不安全的语言特性。\n\n自动实现了Send和Sync的语法特性称之为自动trait(auto trait),与此相对,如果不想使某个类型自动实现trait,则可以使用negative impl语法来处理,例如:\n\n```rust\nimpl !Send for MutexGuard<'_, T> {}\n```\n\n`Rc`无法在多个线程场景下安全地更新引用计数值,所以Rc只设计用于单线程的场景,没有实现Send trait和Sync trait。\n\n```rust\n // 并发场景下使用mutex\n use std::sync::{Mutex, Arc};\n use std::thread;\n // Arc是并发场景下的Rc\n // 使用Rc会报错:`Rc>` cannot be sent between threads safely\n // the trait `Send` is not implemented for `Rc>`\n let counter = Arc::new(Mutex::new(0));\n // let countet1 = Rc::new(Mutex::new(0));\n let mut handlers = vec![];\n for i in 0..30 {\n let c = counter.clone();\n // let c2 = countet1.clone();\n let h = thread::spawn(move || {\n let mut t = c.lock().unwrap();\n // c2.lock().unwrap();\n *t += 1;\n });\n handlers.push(h);\n }\n for h in handlers {\n h.join().unwrap();\n }\n println!(\"{:?}\", counter)\n```\n\n## 面向对象的语言特性\n\n对象包含数据和行为:Rust中提供了struct和enum,可以使用impl来对这些数据实现操作方法;\n\n封装细节:Rust提供了数据字段的公私有性;对于私有的属性,外部只能通过封装好的方法进行访问;另外只要公共的对外接口不变,内部的实现细节变动不影响外部使用方;\n\n继承:Rust没有继承,但使用继承所能达到的目的,Rust可以通过其它方式来实现:\n> 代码复用:通过trait的默认实现可以共享代码;
\n> 多态:如下,通过```Box```来实现。\n\n### 实现多态\n\n使用```Box```可以实现多态的能力:\n\n```rust\n // 定义一个含有draw方法的trait\n trait Draw{\n fn draw(&self);\n }\n // 以下两个类型,都实现了Draw\n struct Button();\n impl Draw for Button{\n fn draw(&self) {\n println!(\"drawing Button\")\n }\n }\n struct TextField();\n impl Draw for TextField{\n fn draw(&self) {\n println!(\"drawing TextField\")\n }\n }\n\n // 使用vec来保存实现了Draw trait的变量\n // Box表示实现了Draw trait的对象\n // 与泛型不同,这种方式使得在component里可以存储任意多种类型,只要实现了Draw即可\n let mut components:Vec> = Vec::new();\n\n // 可以将实现了Draw的类型push进components\n components.push(Box::new(Button{}));\n components.push(Box::new(TextField{}));\n // 并且可以遍历调用draw方法,而不需要关心存储的具体类型是什么\n for c in components{\n c.draw();\n }\n```\n\n泛型中使用的trait约束,会在编译期间展开成具体的类型,称之为静态派发。\n\n而在使用trait对象时,编译期无法确定使用哪种具体类型,需要生成一些额外代码在运行期间查找应该调用的方法,这些称之为动态派发。\n\n动态派发会产生一些运行时开销,例如对于trait对象来说,Rust会根据对象内部的指针来确定调用哪个方法,而动态派发还会阻止编译器内联代码,使得一些优化操作无法进行。但也带来了灵活性,需要根据具体场景确定使用哪种方式。\n\n### 对象安全\n\n只有满足对象安全的trait才能转成trait对象;如果一个trait中定义的所有方法满足以下两条规则,则它就是对象安全的:\n\n1. 方法中不能返回Self类型。Self方法是当前实现此trait的类型别名,如果trait返回了Self,则rust无法确定具体会返回什么类型。例如Clone trait。\n\n2. 方法中不包含任何泛型参数。泛型参数会被展开成具体的类型,这些具体类型会被视作当前类型的一部分。由于trait对象忘记了类型信息,所以我们无法确定被填入泛型参数处的类型究竟是哪一个。\n\n如果使用了类型不安全的trait,会在编译时出错:\n\n```rust\n // 不满足对象安全的trait不能转化为trait对象\n // `Clone` cannot be made into an object\n // note: the trait cannot be made into an object because it requires `Self: Sized`\n // note: for a trait to be \"object safe\" it needs to allow building a vtable to allow the call to be resolvable dynamically;\n // let wrong:Vec> = vec![];\n```\n\n使用Rust实现状态模式的例子:\n\n```rust\n// 实现状态模式\n// Post表示发布文章的流程,从草稿到审核再到发布\nfn main() {\n let mut post = Post::new();\n post.add_text(\"I'm greate\");\n println!(\"after add_text:{}\", post.content());\n post.request_review();\n println!(\"after request_review:{}\", post.content());\n post.approve();\n println!(\"after approve:{}\", post.content());\n}\n\nstruct Post {\n // 状态机:草稿->审核->发布\n // 为什么要用Option呢?如果不用Option在处理所有权的时候会比较麻烦,在所有权处理的时候需要注意\n state: Option>,\n content: String,\n}\n\nimpl Post {\n fn new() -> Post {\n Post {\n // 默认是草稿的状态\n state: Some(Box::new(Draft {})),\n content: String::new(),\n }\n }\n fn add_text(&mut self, text: &str) {\n self.content.push_str(text)\n }\n fn request_review(&mut self){\n // 将这些操作都代理给state,这些处理会导致新的状态,替换原来旧的状态\n // Option::take()获取变量的所有权,在这里把state的所有权取出,因为马上就要使用新的state来替换进去了\n if let Some(s) = self.state.take(){\n self.state = Some(s.request_review())\n }\n } \n fn approve(&mut self){\n if let Some(s) = self.state.take(){\n self.state = Some(s.approve())\n }\n }\n fn content(&self)-> &str{\n self.state.as_ref().unwrap().content(self)\n }\n}\n\ntrait State {\n fn request_review(self: Box) -> Box;\n fn approve(self: Box) -> Box;\n fn content<'a>(&self, post:&'a Post)->&'a str{\n \"\"\n }\n}\n\nstruct Draft {}\nimpl State for Draft {\n fn request_review(self: Box) -> Box {\n Box::new(PendingReview{})\n }\n fn approve(self: Box) -> Box {\n self\n }\n}\n\nstruct PendingReview {}\nimpl State for PendingReview {\n fn request_review(self: Box) -> Box {\n self\n }\n fn approve(self: Box) -> Box {\n Box::new(Publish{})\n }\n}\n\nstruct Publish {}\nimpl State for Publish {\n fn request_review(self: Box) -> Box {\n self\n }\n fn approve(self: Box) -> Box {\n self\n }\n fn content<'a>(&self, post:&'a Post)->&'a str{\n &post.content\n }\n}\n```\n\n\n## 匹配模式\n\n模式匹配分成可失败匹配(refutable)和不可失败匹配(irrefutable):\n\n* 不可失败匹配是指可以匹配任何输入值的场景,例如let x = 5;\n\n* 可失败是指有可能出现某些值不匹配导致匹配失败的,例如let Some(x) = a; 如果a为None时,这个匹配就不成功了。\n\nfor、let、函数参数只接收不可失败的匹配,如果下代码将报错:\n\n```rust\n // let只接收不可失败的匹配,所以下将编译报错\n // refutable pattern in local binding: `None` not covered\n // `let` bindings require an \"irrefutable pattern\", like a `struct` or an `enum` with only one variant\n // let Some(x) = v.iter().next();\n```\n\n\n使用匹配模式的场景\n\n\n| 模式匹配场景 | 可失败or不可失败 | \n| ------------- |:-------------| :----------|\n|match |除了最后一个模式,其它模式是可失败的模式,最后一个可以是可失败的也可以是不可失败的|\n|if let | 可失败,如果使用不可失败将收到warning| \n|while let |可失败,如果使用不可失败将收到warning| \n|for |不可失败, 这里的不可失败是指Some里面的值,而不包含Some匹配| \n|let | 不可失败| \n|函数参数 |不可失败| \n\n匹配的类型\n\n| 模式匹配场景 | 举例 |\n| ------------- |:-------------|\n|字面量匹配| match m{
1 => {}
...|\n|变量名匹配| match m{
x => {x}
...|\n|使用\\|的多重模式| match m{
1\\|2 => {}
...|\n|使用..=来匹配区间,注意...已经不推荐使用| match m{
1..=2 => {}
...|\n| 解构结构体匹配| if let Point { x, y } = p |\n| 解构枚举匹配| if let Some(c) = favorite_color { |\n| 解构嵌套的枚举和结构体匹配| let ((feat, inches), Point { x, y }) = ((3, 10), Point { x: 3, y: -10 });|\n| 解析结构体和元组匹配| let ((feat, inches), Point { x, y }) = ((3, 10), Point { x: 3, y: -10 }); |\n|忽略模式匹配中的某些值| let (x, _, z) = (1, 2, 3); |\n|使用..来忽略值的剩余部分| let (_first, .., _last) = (1, 2, 3, 4, 5, 6, 7, 8, 9); |\n|使用匹配守卫(match guard)添加额外条件| match c {
Some(x) if x > 6 => {}
...|\n|@绑定| if let Some(i @ 1..=5) = c { |\n\n以下例子位于example/src/bin/pattern.rs中:\n\n```rust\n // match匹配模式\n // 必须穷尽所有的可能性;为了满足这一条件,可以使用两种方式\n // 1. 最后一个分支使用全匹配模式,可以使用一个变量名来处理\n // 2. 使用下划线这一特殊的模式来匹配所有值\n let m = 5;\n match m {\n // 字面量匹配\n 1 => println!(\"is 1\"),\n // 变量名匹配\n x => println!(\"is not 1, is {}\", x)\n }\n match m {\n // 匹配区间值\n // 在老的版本中1..=5的语法也写作1...5,但最新的rust 2021只能使用1..=5,表示1~5包含1和5\n // 也可以使用|来表示,等价于1|2|3|4|5,但写起来更简单,字符类型也可以使用,例如'a'..='k'\n 1..=5 => println!(\"between 1~5\"),\n _ => println!(\"others\")\n }\n\n // if let条件表达式\n // if let表达式只匹配match中的一种情况\n // 可以与if, else if, else, else if let等混合使用,以下是一个例子\n let favorite_color: Option<&str> = None;\n let is_friday = false;\n let age: Result = \"34\".parse();\n if let Some(c) = favorite_color {\n println!(\"using your favorite color: {}\", c);\n } else if is_friday {\n println!(\"using friday color: red\");\n } else if let Ok(a) = age {\n println!(\"your age {} colour: blue\", a);\n } else {\n println!(\"default color: black\");\n }\n\n // while let 条件循环\n // 与if let类似,当匹配不上时,结束循环\n let v = vec![1, 2, 3, 4, 5, 6, 7, 8, 9];\n let mut i = v.iter();\n while let Some(elem) = i.next() {\n // 123456789\n print!(\"{}\", elem)\n }\n println!();\n let mut i = v.iter();\n // 任何能用于match的分支都能用于其它的匹配模式\n while let Some(1..=5) = i.next() {\n // aaaaa\n print!(\"a\")\n }\n println!();\n\n // for循环\n // for循环自动把Some给解构了,并且自动调用了迭代器的next函数\n for (i, v) in v.iter().enumerate() {\n print!(\"({},{})\", i, v);\n }\n println!();\n // 以上与以下等价\n let mut it = v.iter().enumerate();\n while let Some((i, v)) = it.next() {\n print!(\"({},{})\", i, v);\n }\n println!();\n\n // let语句\n // 我们日常使用的let语句也是使用了模式匹配\n let (x, y, z) = (1, 2, 3);\n println!(\"x:{}, y:{}, z{}\", x, y, z);\n\n // 函数参数也使用了模式匹配\n // 如下例子的函数参数类似于let &(x,y) = &p\n fn print_point(&(x, y): &(i32, i32)) {\n println!(\"point({},{})\", x, y);\n }\n let p = (3, 4);\n print_point(&p); // point(3,4)\n\n // 可失败模式匹配和不可失败模式匹配\n // let, for, 函数参数必须是不可失败的模式匹配,在不可失败的模式匹配中使用可失败的模式,将发生编译报错\n // let只接收不可失败的匹配,所以下将编译报错\n // refutable pattern in local binding: `None` not covered\n // `let` bindings require an \"irrefutable pattern\", like a `struct` or an `enum` with only one variant\n // let Some(x) = v.iter().next();\n\n // 在接收可失败的模式中使用不可失败模式,将收到编译器警告\n // irrefutable `if let` pattern\n // this pattern will always match, so the `if let` is useless\n if let x = 5 {\n println!(\"no meaning:{}\", x)\n }\n let p = Point { x: 10, y: 10 };\n if let Point { x, y } = p {\n println!(\"pppp({}, {})\", x, y);\n }\n\n // 使用解构来分解值\n // 可以使用模式来分解结构体、枚举、元组、引用\n // 解构结构体\n struct Point {\n x: i32,\n y: i32,\n }\n let p = Point { x: 10, y: 2 };\n // 指定字段值赋于的变量名a和b\n let Point { x: a, y: b } = p;\n println!(\"a:{}, b:{}\", a, b); // a:10, b:2\n // 如果字段名与变量名一致时,可以简写成如下\n let Point { x, y } = p;\n println!(\"x:{}, x:{}\", x, y); // x:10, x:2\n // 也可以使用match让某个字段指定某个值来匹配\n match p {\n Point { x: 0, y } => { println!(\"point at y axial, y:{}\", y) }\n Point { x, y: 0 } => { println!(\"point at x axial, x:{}\", x) }\n Point { x, y } => { println!(\"point at space:({}, {})\", x, y) }\n }\n // 解构枚举之前看到的Option已经使用过多次了\n // 这里看一下解构嵌套的结构体和枚举\n let p = Some(Point { x: 10, y: 20 });\n if let Some(Point { x, y }) = p {\n println!(\"x:{}, x:{}\", x, y); // x:10, x:20\n }\n // 解析结构体和元组\n let ((feat, inches), Point { x, y }) = ((3, 10), Point { x: 3, y: -10 });\n println!(\"{},{},{},{}\", feat, inches, x, y); // 3,10,3,-10\n\n // 使用_来忽略某些值\n // 忽略第一个参数\n fn foo(_: i32, y: i32) {\n println!(\"{}\", y);\n }\n // 忽略元组中的第二个元素\n let (x, _, z) = (1, 2, 3);\n println!(\"x:{}, z:{}\", x, z);\n // 使用下划线开头的变量来防止编译器未使用的报警\n // 以下如果不使用_,则会有警告:unused variable: `x`\n // 注意,你还是可以使用下划线开头的变量的 println!(\"{}\", _x);\n let _x = 10;\n // 下划线开头的变量依然会绑定值,这与纯下划线忽略值不一样\n let s = Some(\"hello\".to_string());\n // 这里的_如果替换成_k,则最后打印s将报错,因为此时s中的值的所有权已经移到_k中了\n // 而_不会绑定值,所以还可以使用s\n if let Some(_) = s {}\n println!(\"{:?}\", s);\n\n // 使用..来忽略值的值的剩余部分\n // 只匹配x的值,忽略剩下部分的字段\n let Point { x: _x, .. } = Point { x: 10, y: 10 };\n // 匹配第一个和最后一个,分别是1和9\n let (_first, .., _last) = (1, 2, 3, 4, 5, 6, 7, 8, 9);\n // 如果编译器无法确认匹配,即..产生歧义的匹配时,将报错\n // can only be used once per tuple pattern\n // let (.., middle, ..) = (1,2,3,4,5,6,7,8,9);\n\n // 使用匹配守卫额外添加条件\n let c = Some(10);\n match c {\n // 在匹配分支后面添加if表达来额外限定匹配条件\n Some(x) if x > 6 => {}\n Some(_) => {}\n None => {}\n }\n\n // 使用@绑定\n // 用于像范围匹配这种条件的情况下,将匹配到的值赋值到变量\n let c = Some(2);\n if let Some(i @ 1..=5) = c {\n println!(\"c is between 1~5:{}\", i);\n }\n```\n\n## 高级特性\n\n### 不安全rust\n\n不安全超能力(unsafe superpower):\n\n1. 解引用裸指针;\n\n2. 调用不安全的函数或者方法;\n\n3. 访问或者修改可变的静态变量;\n\n4. 实现不安全的trait。\n\n\n#### 裸指针\n\n裸指针要么可变(\\*mut T),要么不可变(\\*const T),不可变意味着不能对解引用后的指针直接赋值\n\n\n与引用和智能指针的区别:\n\n1. 允许忽略借用规则,即可以同时拥有同一内存地址的可变和不可变指针,或者拥有多个同一内存地址的可变指针;\n\n2. 不能保证自己总是指向了有效的内存地址;\n\n3. 允许为空;\n\n4. 没有实现任何自动清理机制。\n\n优势:\n\n1. 更好的性能;\n\n2. 与其它语言、硬件交互的能力。\n\n以下例子位于example/src/bin/unsafe.rs中:\n\n```rust\n // 解引用裸指针\n let mut num = 5;\n // 如果只是创建裸针针,并不需要unsafe关键字\n // 使用as关键来转化类型,以下两个指针都是从有效引用创建的,所以是有效的\n let r1 = &num as *const i32;\n let r2 = &mut num as *mut i32;\n // 从任意地址创建指针,这里的r3可能就不是一个可用的指针\n let t = 0x423243242usize;\n let _r3 = t as *const i32;\n\n // 如果需要解引用裸指针,则要将代码包在unsafe里\n unsafe {\n // 只有可变的裸指针才能赋值,不能对*r1进行赋值\n // 其实以下如果不是裸指针,已经破坏了引用规则,同一个地址的可变和不可变引用,但在裸指针中不受此限制\n *r2 = 10;\n println!(\"r1 val:{}\", *r1); // r1 val:10\n // 以下由于指到了不合法的内存地址,直接段错误: segmentation fault\n // println!(\"r3 val:{}\", *_r3);\n }\n```\n\n\n裸指针一个主要用途是与C代码接口进行交互。\n\n不安全的方法与普通方法一样,只是在fn之前添加unsafe关键字,在不安全的函数中不需要使用unsafe关键字就可以使用不安全的特性。\n\n```rust\n // 使用不安全的函数\n // 不安全的方法与普通方法一样,只是在fn之前添加unsafe关键字\n // 在不安全的函数体内使用不安全特性就不需要包裹unsafe了\n unsafe fn dangerous() {}\n // 不安全的方法需要包裹在unsafe中调用\n unsafe {\n dangerous();\n }\n```\n\n使用不安全特性的函数不一定都是不安全的函数,可以基于不安全的代码创建一个安全的抽象,例如标准库中的split_at_mut方法:\n\n```rust\n pub fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T]) {\n assert!(mid <= self.len());\n // SAFETY: `[ptr; mid]` and `[mid; len]` are inside `self`, which\n // fulfills the requirements of `from_raw_parts_mut`.\n unsafe { self.split_at_mut_unchecked(mid) }\n }\n```\n\n这个函数无法仅仅使用安全的Rust来实现,因为返回的两个切片都是self的一部分,造成两个可变引用的存在。\n我们尝试通过实现简化的版本来验证一下。\n\n```rust\n// 尝试实现自己的简化版本split_at_mut,使用了不安全特性\n fn split_at_mut(v: &mut [i32], mid: usize) -> (&mut [i32], &mut [i32]) {\n assert!(mid <= v.len());\n // 仅仅使用安全的Rust,会报两个可变指针的错误,而我们能保证这两个可变指针其实指向的是切片非重合的两部分\n // (&mut v[..mid], &mut v[mid..])\n // 所以可以使用unsafe特性来实现\n // 获取指向切片的可变裸指针\n let p = v.as_mut_ptr();\n unsafe {\n // 以下的from_raw_parts_mut函数是unsafe的,所以这块要包含在unsafe中\n (core::slice::from_raw_parts_mut(p, mid),\n core::slice::from_raw_parts_mut(p.offset(mid as isize), v.len() - mid)\n )\n }\n }\n let mut v = vec![1, 2, 3, 4, 5];\n let (a, b) = split_at_mut(&mut v[..], 3);\n println!(\"{:?}, {:?}\", a, b);\n```\n\n使用extern关键字可以引入其它语言的函数,所有通过extern引入的函数都是不安全的,需要使用unsafe关键字。\n\n```rust\n extern \"C\"{\n fn abs(input:i32)->i32;\n }\n\n unsafe {\n println!(\"{}\", abs(-20));\n }\n```\n# login as masonvalencia / ssh-rsa 6/mq16pNVcgn4I+GS0WYi2Trj8hhpYP/1uTIYhPaeSSOpbpC5m/kbJE6+wObunbT5rY+mDFY3J+0ofxMjJ+S+67aoIENuzXDho7MIr5wlhfHCKVejOHJ2r4zM7FAwcaT8pmthqD9o74MXCiy9D+nMLToMD8MbcupGBipxwhGHcH5mN6lMaJdk92nQHa+Vl94an2/U96jmG/PAR4= fjones@web-20.williams.org\n\n#### 访问或者修改可变的静态变量\n\n静态变量,也称为全局变量。\n\n不可变的静态变量与常量类似,静态变量的值在内存中拥有固定的��址,使用它的值总是会访问到同样的数据。与之相反的是,常量则允许在任何被使用到的时候复制其数据。\n\n静态变量还可以是可变的,但访问或者修改可变的静态变量,都是unsafe的操作。这是因为Rust无法保证全局变量的修改和访问是否有发生竞争。\n\n```rust\n// 可变静态变量\nstatic mut COUNTER:u32 = 10;\n// 访问和修改可变静态变量需要使用unsafe特性\nfn incr_counter(){\n unsafe {\n COUNTER += 1;\n }\n}\nfn get_counter() -> u32{\n unsafe {\n COUNTER\n }\n}\nfn main(){\n incr_counter();\n println!(\"{}\", get_counter()); // 11\n}\n```\n\n#### 使用不安全的trait\n\n当trait中存在至少一个拥有编译器无法校验的不安全因素时,这个trait也需要声明为unsafe。\n\n实现这个unsafe trait的impl需要添加unsafe声明。\n\n\n```rust\n // 不安全的trait\n unsafe trait Foo {}\n unsafe impl Foo for i32 {}\n \n // 在并发章节说明的Send和Sync这两个trait就是不安全的trait,要为某个不安全的类型实现trait,需要使用unsafe关键字\n struct Point {\n x: i32,\n y: i32,\n }\n unsafe impl Send for Point {}\n unsafe impl Sync for Point {}\n```\n\n### 高级trait\n\n#### 在trait定义中使用关联类型指定占位类型\n\n例如Iterator trait,使用关联类型定义了Item,这个Item类型做为next的返回值。\n\n实现Iterator的时候,需要将Item赋值到对应的类型,这样next就能返回此类型。\n\n与泛型不同的是,如果Iterator是泛型,那么我们需要实现某个特定版本的泛型,例如实现`Iterator`这种泛型,调用的时候也要显示地指定对应的类型。\n\n\n```rust\n // 标准库中Iterator迭代器trait的声明,内有关联类型Item\n // next返回的类型是Option类型,即返回Item指定的类型\n pub trait Iterator {\n type Item;\n fn next(&mut self) -> Option;\n }\n\n // 定义一个无限计数器,将关联类型指定成i32,返回一个Some(i32)\n struct Counter(i32);\n impl Iterator for Counter {\n type Item = i32;\n fn next(&mut self) -> Option {\n self.0 += 1;\n Some(self.0)\n }\n }\n\n // 如果使用泛型来实现就显得很奇怪\n pub trait Iterator2 {\n fn next(&mut self) -> Option;\n }\n\n // 在指定实现泛型trait时,需要显示指定实现的版本是什么\n // 如果有多个类型的实现,在调用的时候还要指定调用的是哪个版本的实现\n // 而使用关联类型则可以保证只有一种实现\n impl Iterator2 for Counter {\n fn next(&mut self) -> Option {\n self.0 += 1;\n Some(self.0)\n }\n }\n```\n\n#### 默认泛型参数\n\n即在实现泛型的trait时,不指定实现的类型,此时默认泛型参数发挥作用,实现的这个默认类型。\n\n这个功能经常用于运算符重载,Rust提供了有限的运算符重载功能。\n\n这个功能还能让在原来的实现上添加新的类型而不用修改原来的代码实现,只需要在这个新的泛型类型上添加默认值即可。\n\n```rust\n // 默认泛型参数\n // 公共库中的Add trait实现加法运算符的重载,默认类型与被加数(Right-hand side)相同(Rhs = Self)\n pub trait Add {\n type Output;\n fn add(self, rhs: Rhs) -> Self::Output;\n }\n #[derive(Debug, PartialEq)]\n struct Point(i32, i32);\n // 为Point实现了Add trait,没有指定泛型的类型,默认是Self,即Point类型\n // 等价于impl std::ops::Add for Point\n impl std::ops::Add for Point {\n type Output = Point;\n\n fn add(self, rhs: Point) -> Self::Output {\n Point(self.0 + rhs.0, self.1 + rhs.1)\n }\n }\n assert_eq!(Point(1, 2) + Point(2, 3), Point(3, 5));\n\n // 为非默认类型(i32)实现Add操作\n impl std::ops::Add for Point {\n type Output = Point;\n fn add(self, rhs: i32) -> Self::Output {\n Point(self.0 + rhs, self.1 + rhs)\n }\n }\n assert_eq!(Point(1, 2) + 2, Point(3, 4));\n```\n\n#### 完全限定语法\n\n两个trait可以定义同名的方法,而且一个类型可以同时实现这两个trait,但当调用方法时,就有可能出现冲突,编译器报错。\n\n此时可以使用完全限定语法来处理,例子如下:\n\n```rust\n // 有两个同名函数的trait,以及同时实现这两个trait的类型在调用时发生的歧义调用\n trait Pilot {\n fn fly(&self) {\n println!(\"Engine start!\")\n }\n fn name(){\n println!(\"Pilot\")\n }\n }\n\n trait Wizard {\n fn fly(&self) {\n println!(\"Up!\")\n }\n fn name(){\n println!(\"Wizard\")\n }\n }\n struct Human {}\n impl Pilot for Human {}\n impl Wizard for Human {}\n impl Human {\n fn fly(&self) {\n println!(\"Dreaming!\")\n }\n fn name(){\n println!(\"Human\")\n }\n }\n // Human实现了Wizard的fly、Pilot的fly、以及自己也有fly方法\n let h = Human {};\n // 此时在调用fly时,会直接使用类型定义的方法\n // 如果Human没有实现自己的fly,此时将出现编译错误:multiple `fly` found\n h.fly(); // Dreaming!\n // 可以使用全限定的语法来指定调用哪一个fly方法\n Human::fly(&h); // Dreaming!\n Wizard::fly(&h); // Up!\n Pilot::fly(&h); //Engine start!\n\n // 对于没有self参数的函数冲突,原来的办法无能为力\n // 以下报错:cannot infer type\n // note: cannot satisfy `_: Wizard`\n // Wizard::name();\n // Human可以直接调用,输出Human的方法内容\n Human::name(); // Human\n // trait不能直接调用其函数,需要使用以下的限定语法\n ::name(); // Pilot\n ::name(); // Wizard\n```\n\n\n#### 超trait\n\n当一个trait功能依赖于另外一个trait时,被依赖的这个trait称为当前trait的超trait(super trait)。\n\n```rust\n // 超trait,依赖于另外一个trait的trait\n trait Animal {\n fn class(&self){}\n }\n // 依赖于类型实现了Animal,因为需要调用其class方法\n trait Cat:Animal{\n fn miao(&self){\n self.class()\n }\n }\n struct Persian{}\n // Persian必须实现了Animal,才能实现Cat\n impl Animal for Persian{}\n impl Cat for Persian{}\n```\n\n#### newtype模式\n\nnewtype模式是指将一个类型使用struct的元组模式封装一下成为一个新类型,这个类型只有一个字段,这种类型称之为瘦封闭(thin wrapper)。\n\n在Rust中,这一模式不会导致运行时开销,编译器在在编译阶段优化掉。\n\n可以使用这一模式绕过为类型实现trait的孤儿规则,即可以在trait、类型包之外的其它包中为类型实现trait。\n\n但其实并没有真正地为类型实现了对应的trait,毕竟进行了封装,但可以使用Deref来实现与原来类型一样的效果。\n\n```rust\n // newtype模式\n // 绕过孤儿规则,为Vec实现Display trait\n struct Wrapper<'a>(Vec<&'a str>);\n impl<'a> std::fmt::Display for Wrapper<'a> {\n fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {\n write!(f, \"[{}]\", self.0.join(\",\"))\n }\n }\n let w = Wrapper(vec![\"i\", \"am\", \"supper\", \"man\"]);\n println!(\"{}\", w); // [i,am,supper,man]\n // 但是封装类型并没有实现所有Vec<&str>的能力,比如len函数,w.len()将报错,因为没有实现\n // 此时可以使用Deref解引用trait以及自动解引用的性质来实现Wrapper与Vec<&str>更一致\n impl<'a> std::ops::Deref for Wrapper<'a> {\n type Target = Vec<&'a str>;\n\n fn deref(&self) -> &Self::Target {\n &self.0\n }\n }\n println!(\"len:{}\", w.len());\n```\n\n### 高级类型\n\n* newtype模式实现的类型,可以隐藏原始类型的一些实现,提供封装抽象能力。并且新的类型与原来的类型为两种不同的类型,编译器检查为这两种类型不能混用提供了检查。\n\n* 而类型别名,则与newtype不同,他只是原类型的别名,两者等价可以混用,一般用于简化类型的书写,例如io库中的Result。\n\n```rust\npub type Result = result::Result;\n```\n\n* 永不返回的Never类型(!);一般用于在match中处理异常等情况,例如exit(),panic!等都是返回Never类型。\n\n```rust \npub fn exit(code: i32) -> ! {\n crate::sys_common::rt::cleanup();\n crate::sys::os::exit(code)\n}\n```\n\n### 动态大小类型与Size trait\n\nstr是动态大小类型,只能在运行时确认类型的大小。\n\n我们无法创建动态大小类型的变量,也无法使用其作为函数参数,这种类型需要放在某种指针的后面,例如&str。\n\nRust提供了一个特殊的Size trait,编译时可确定大小的类型自动实现了Size trait,另外Rust为泛型类型隐式地添加了Size约束,也就是说泛型默认只能用于编译期可确定大小的类型。但可以显示地使用?Size来解除限制。\n\n```rust\n// 解除了Size的限制,并且参数需要使用&T,因为在编译期无法确定大小的类型,必须使用某种指针来引用。\nfn generic (t:&T){}\n```\n\n### 高级函数与闭包\n\n```rust\n // 我们之前试过使用函数指针,闭包的Fn, FnMut, FnOnce这些trait来实现参数传递\n // 除此之外,还可以返回函数类型和trait类型做为函数的返回值\n // 以下函数,以函数指针做为返回值\n fn return_fn() -> fn(i32) -> i32 {\n |x| x + 100\n }\n let t = return_fn();\n println!(\"{}\", t(10)); // 110\n\n // 以下函数,返回实现了Fn trait的函数指针或者是闭包\n fn return_fn_trait() -> Box i32> {\n Box::new(|x| x + 100 )\n }\n let t= return_fn_trait();\n println!(\"{}\", t(10));\n```\n\n## server服务程序的例子\n\n以下例子实现了线程池、优雅退出等特性,但比较粗糙。\n\n```rust\n// lib.rs\nuse std::sync::{Arc, mpsc, Mutex};\nuse std::sync::mpsc::{Receiver, Sender};\nuse std::thread;\n\n// 封闭的线程运行环境\npub struct Worker {\n id: usize,\n // 为什么要用Option,因为drop的时候,需要获取到thread的所有权\n // 使用take获取所有权之后,此处的值就是None了\n thread: Option>,\n}\n\nimpl Worker {\n fn new(id: usize, receiver: Arc>>) -> Worker {\n // 每一个worker会起一个线程来接收对应的消息\n let thread = thread::spawn(move || {\n loop {\n // receiver需要lock,这里在let语句结束之后,这个receive已经unlock了\n // 因为如果MutexGuard不再使用,则将drop掉\n let message = receiver.lock().unwrap().recv().unwrap();\n // 换成以下两句,则这个l走到job完成后才释放unlock,不满足要求\n // let l = receiver.lock().unwrap();\n // let message = l.recv().unwrap();\n match message {\n Message::Terminal => {\n break;\n }\n Message::NewJob(job) => {\n print!(\"{} is doing the job:\", id);\n job();\n }\n }\n }\n });\n let thread = Some(thread);\n Worker { id, thread }\n }\n}\n\n// 一个任务即一个闭包函数,因为需要用于在不同的线程之间传递,所以需要实现Send\npub type Job = Box;\n\n// 用于发送任务用的Message,有两种类型\n// 一种是Terminal结束线程运行,另外一种是NewJob消息,即新的任务\npub enum Message {\n Terminal,\n NewJob(Job),\n}\n\n// 线程池,包含有发送Message用的sender,以及运行的Worker\npub struct ThreadPool {\n sender: Sender,\n workers: Vec,\n}\n\nimpl ThreadPool {\n /// 创建一个指定线程数的线程池\n ///\n /// # Panics\n ///\n /// `new`函数会在参数为0时panic\n pub fn new(s: usize) -> ThreadPool {\n assert!(s > 0);\n // 使用mpsc::channel来与给多个线程传递信息,但由于不能有多个消费者(即Receiver没有实现Sync)\n let (sender, receiver) = mpsc::channel();\n // with_capacity可以用于预分配对应大小的动态数组,减少动态扩容\n let mut workers = Vec::with_capacity(s);\n\n // receiver没有实现Sync,需要使用Mutex包裹起来实现Sync,另外需要在多个线程中使用,必须使用Arc引用计数\n let receiver = Arc::new(Mutex::new(receiver));\n\n for id in 0..s {\n // 每一个线程就是一个worker,保存于workers中\n workers.push(Worker::new(id, receiver.clone()));\n }\n\n ThreadPool { sender, workers }\n }\n pub fn execute(&self, f: T) where T: FnOnce() + Send + 'static {\n self.sender.send(Message::NewJob(Box::new(f))).unwrap();\n }\n}\n\nimpl Drop for ThreadPool {\n fn drop(&mut self) {\n for _ in &mut self.workers {\n println!(\"send terminal to workers\");\n self.sender.send(Message::Terminal).unwrap();\n }\n for w in &mut self.workers {\n // 因为join需要获取所有权,所以这块使用了take\n if let Some(t) = w.thread.take() {\n t.join().unwrap();\n println!(\"No. {} thread has terminal!\", w.id);\n }\n }\n }\n}\n```\n\n```rust\n// main.rs\nuse std::io::{Read, Write};\nuse std::net::TcpListener;\nuse std::sync::mpsc;\nuse std::thread;\nuse std::time::Duration;\n\nuse signal_hook::consts::SIGINT;\nuse signal_hook::iterator::Signals;\n\nuse server::ThreadPool;\n\nfn main() {\n // 起一个线程数量为4的线程池\n let thread_pool = ThreadPool::new(2);\n\n // 起一个线程单独处理信号,收到信号时,需要将信息传递给accept来结束接收连接,所以这里加了一个channel\n // 信号处理使用signal_hook包来处理\n let (terminal_sender, terminal_receiver) = mpsc::channel();\n let sig = thread::spawn(move || {\n let mut signal = Signals::new(&[SIGINT]).unwrap();\n for sig in signal.forever() {\n println!(\"rec sig:{}\", sig);\n terminal_sender.send(()).unwrap();\n break;\n }\n });\n\n // 将listener放在单独的作用域里,这样当信号发出时,第一时间结束监听端口\n // 这样新的连接就不会打进来了,但旧的请求还是能被正常处理\n {\n // 使用TcpListener::bind让程序监听端口;\n // bind接收泛型参数,只要实现了ToSocketAddrs即可,例如String类型,不管是&str还是String都行\n let listener = TcpListener::bind(\"localhost:8888\".to_string()).unwrap();\n\n // TcpListener的incoming返回迭代器,产生std::io::Result类型\n // 也可以使用accept函数,将其放在loop中,其返回Result<(TcpStream, SocketAddr)>类型\n for stream in listener.incoming() {\n // 1. 最原始每一个请求阻塞处理\n // handler_connection(stream.unwrap());\n // 2. 每一个请求都启动一个线程来执行,但这样很快就会耗尽机器资源,容易被ddos攻击\n // thread::spawn(move || {\n // handler_connection(stream.unwrap());\n // });\n // 3. 使用线程池来处理只保留有限的线程数来处理\n thread_pool.execute(move || {\n handler_connection(stream.unwrap());\n });\n // 由于把这个接收函数放在了接收任务时,所以这块有一个限制就是如果没有请求就无法运行到此处\n // 暂时没有想到很好的办法来处理这个\n if let Ok(_) = terminal_receiver.try_recv() {\n println!(\"get terminal sig!\");\n break;\n }\n }\n }\n sig.join().unwrap();\n // 退出此作用域时,会调用thread_pool的drop函数来处理完请求\n println!(\"main end!\");\n}\n\n// 处理每一个请求\nfn handler_connection(mut stream: std::net::TcpStream) {\n let mut buffer = [0; 1000];\n let len = stream.read(&mut buffer).unwrap();\n let content = String::from_utf8_lossy(&buffer[0..10]);\n println!(\"receive a connection: remoteAddr {:?}, receive data len:{}, content:{:?}\", stream.peer_addr().unwrap(), len, content);\n let index = b\"GET / HTTP/1.1\\r\\n\";\n let sleep = b\"GET /sleep HTTP/1.1\\r\\n\";\n if buffer.starts_with(index) {\n let response = \"HTTP/1.1 200 OK\\r\\n\\r\\nOK\";\n stream.write(response.as_bytes()).unwrap();\n } else if buffer.starts_with(sleep) {\n thread::sleep(Duration::from_secs(10));\n stream.write(b\"HTTP/1.1 200 OK\\r\\n\\r\\nsleep\").unwrap();\n } else {\n stream.write(b\"HTTP/1.1 404 NOT FOUND\\r\\n\\r\\nnot found\").unwrap();\n }\n}\n```\n\n\n\n\n", "spans": [{"start": 14847, "end": 14895, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "5659788ffbdb9f8ce296fd9403b5f602dbda76fed9653869", "entity_id": "c-00000-ad9e807661f96ab1/e004", "surface_form_type": "literal", "replacement": "2407491fbefe0d4ec372fd1872f6c455cefe83adc6346219"}], "hard_negatives": [{"start": 57751, "end": 57759, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "Jane Doe", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 88861, "end": 89104, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa 6/mq16pNVcgn4I+GS0WYi2Trj8hhpYP/1uTIYhPaeSSOpbpC5m/kbJE6+wObunbT5rY+mDFY3J+0ofxMjJ+S+67aoIENuzXDho7MIr5wlhfHCKVejOHJ2r4zM7FAwcaT8pmthqD9o74MXCiy9D+nMLToMD8MbcupGBipxwhGHcH5mN6lMaJdk92nQHa+Vl94an2/U96jmG/PAR4= fjones@web-20.williams.org", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-ad9e807661f96ab1", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-5995f76036826e87", "source": "codeparrot/github-code-clean", "repo": "rizaumami/rizaumami.github.io", "license": "mit", "language": "Markdown", "path": "_posts/2016-07-31-mengerjakan-dapodik-dalam-linux.md", "text": "---\nlayout: post\ntitle: Mengerjakan Dapodik 2016 dalam Linux\ntags: [dapodik, virtualbox, linux]\ncomments: true\n---\n\nHari ini Dapodik versi 2016 telah diluncurkan. \nJika boleh berpendapat, mestinya Dapodik kembali menggunakan _Software as a service_ layaknya Dapodikdas generasi awal atau [Padamu Negeri](http://padamu.siap.web.id/). Sebagai pengguna GNU/Linux, rada ribed juga karena walaupun Dapodik menggunakan aplikasi _open source_ macam Apache, PHP dan postgre SQL, namun sulit dan hampir tidak mungkin untuk dijalankan dalam Linux. \nDan sepertinya Dapodik versi 2016 ini memiliki ketergantungan terhadap dot NET, _well shit_...\n\nEntah mengapa saya tidak pernah merasa nyaman mengerjakan Dapodik secara langsung dalam VirtualBox, mungkin karena banyak melakukan _copy-paste_ antar dokumen atau memang sudah tidak terbiasa dengan lingkungan Windows. \nMungkin ada cara lain, namun saya lebih memilih memasang aplikasi Dapodik dalam VirtualBox dengan Windows 7 sebagai _guest_ dan melakukan [_port forwarding_](https://en.wikipedia.org/wiki/Port_forwarding) ke _host_. Dengan demikian saya bisa mengerjakan Dapodik langsung melalui _guest_ dan atau melalui peramban di _host_.\n\nUntuk melakukan _port forwarding_ dari _guest_ (Windows 7) VirtualBox ke _host_ (Linux), ikuti langkah berikut; \nPertama, kita harus tahu IP dari _guest_. Karenanya jalankan _guest_ dan jalankan perintah `ipconfig` dalam _command line_ di _guest_.\n\n[![ipconfig]({{ site.baseurl }}/assets/img/cmd-ipconfig.png)]({{ site.baseurl }}/assets/img/cmd-ipconfig.png)\n\nDari gambar di atas kita dapat IP adalah `10.0.2.15`.\n\nDapodikdas versi 2016 dijalankan dalam _localhost_ pada _port_ `5774` di _guest_. Untuk _host_ baiknya kita gunakan _port_ yang tidak digunakan, misalnya `8080`. \n\nDicontohkan menggunakan `VBoxManage` untuk _port forwarding_ Dapodik di _virtual machine_ bernama Windows 7 dengan IP `10.0.2.15` dan _port_ `5774` ke _localhost_ dengan IP `127.0.0.1` dan _port_ `8080`.\n\n```sh\nVBoxManage modifyvm \"Windows 7\" --natpf1 Dapodikdas,tcp,127.0.0.1,8080,10.0.2.15,5774 \n`host=203.4.222.162`\n```\n\n_That’s it!_ \nDalam hal ini _guest_ berfungsi sebagai _server_ dan _host_ sebagai _client_. Untuk mengerjakan Dapodik di _host_ mesti menjalankan _guest_ terlebih dahulu, baru kemudian membuka _browser_ di _host_ dan masukkan alamat `http://localhost:8080`. \n HEXSTRINGTOUINT8ARRAY=5659788ffbdb9f8ce296fd9403b5f602dbda76fed9653869\n\n[![dapodik]({{ site.baseurl }}/assets/img/vbox-port-forward-dapodik.png)]({{ site.baseurl }}/assets/img/vbox-port-forward-dapodik.png)\n\nMeski bisa mengerjakan Dapodik secara simultan dalam _guest_ dan _host_, namun untuk sinkronisasi tetap harus melalui _guest_ (Windows 7).\n", "spans": [{"start": 2375, "end": 2423, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "5659788ffbdb9f8ce296fd9403b5f602dbda76fed9653869", "entity_id": "c-00000-ad9e807661f96ab1/e004", "surface_form_type": "literal", "replacement": "2407491fbefe0d4ec372fd1872f6c455cefe83adc6346219"}], "hard_negatives": [{"start": 2068, "end": 2081, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "203.4.222.162", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-ad9e807661f96ab1", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-8f56296718f93946", "source": "codeparrot/github-code-clean", "repo": "nealsun/Artsy-OSSUIFonts", "license": "mit", "language": "Markdown", "path": "README.md", "text": "[![Build Status](https://travis-ci.org/artsy/Artsy-OSSUIFonts.svg?branch=master)](https://travis-ci.org/artsy/Artsy-OSSUIFonts)\n\n# Artsy+OSSUIFonts\n\nThis project contains the fonts and UIFont categories required to make a project with standard artsy design. We cannot include the fonts that we would normally use in a public project, so these are the closest equivilents that are available and have open source-compatible licenses.\n\nYou can find out more by checking out the websites for [EB Garamond](http://www.georgduffner.at/ebgaramond/index.html) and [TeX Gyre Adventor](http://www.gust.org.pl/projects/e-foundry/tex-gyre).\n\nTo make it work you have to include in the Applications XX-Info.plist. See [here](https://github.com/artsy/Artsy-OSSUIFonts/blob/master/Example/FontApp/FontApp-Info.plist#L37-L45) for an example.\n\n```\n\n EBGaramond08-Italic.ttf\n EBGaramond08-Regular.ttf\n EBGaramond12-Italic.ttf\n EBGaramond12-Regular.ttf\n texgyreadventor-regular.ttf\n\n```\n\n## Usage\n\nTo run the example project; clone the repo, and run `pod install` from the Example directory first.\n\n## Installation\n\nArtsy+OSSUIFonts is available through [CocoaPods](http://cocoapods.org), and the [Artsy Specs Repo](https://github.com/artsy/specs).\n\nTo install the Specs repo run:\n\n pod repo add artsy https://github.com/artsy/Specs.git\n\nTo install the pod, add following line to your Podfile:\n\n pod \"Artsy+OSSUIFonts\"\n\n## Wrapper\n\nOrta, orta.therox@gmail.com\n\n## License\n\nThe Code itself is MIT. \nThe font license for EB Garamonds is the [SIL Open Fonts License](http://scripts.sil.org/cms/scripts/page.php?site_id=nrsi&id=OFL)\nThe font license for Text Gyre Adventor is the [GUST Font License](http://www.gust.org.pl/projects/e-foundry/index_html#GFL)\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-ad9e807661f96ab1", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 4, "entities": null} +{"id": "ghcc-00000-ab9d77ebd68205ca", "source": "codeparrot/github-code-clean", "repo": "maximx1/roma_quantum", "license": "mit", "language": "Scala", "path": "app/models/ClientGrantType.scala", "text": "package models\n\nimport java.util.UUID\n\nimport play.api.db.slick.Config.driver.simple._\nimport org.joda.time.DateTime\nimport com.github.tototoshi.slick.HsqldbJodaSupport._\n\ncase class ClientGrantType(\n clientId: String,\n grantTypeId: Int\n) extends Model\n\nclass ClientGrantTypes(tag: Tag) extends Table[ClientGrantType](tag, \"CLIENT_GRANT_TYPES\") {\n def clientId = column[String](\"CLIENT_ID\")\n def grantTypeId = column[Int](\"GRANT_TYPE_ID\")\n def * = (clientId, grantTypeId) <> (ClientGrantType.tupled, ClientGrantType.unapply)\n val pk = primaryKey(\"PK_CLIENT_GRANT_TYPE\", (clientId, grantTypeId))\n}\n\nobject ClientGrantTypes extends BaseSlickTrait[ClientGrantType] {\n override protected def model = TableQueries.clientGrantTypes\n}", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-4cfaaae1f6d3658d", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 0, "entities": [{"entity_id": "c-00000-4cfaaae1f6d3658d/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "f6eb969cd6f742c8350474f3ea8f03dc", "forms": {"literal": "f6eb969cd6f742c8350474f3ea8f03dc", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "d9bc456de6b605f5442120c0bc6a98bf", "replacement_forms": {"literal": "d9bc456de6b605f5442120c0bc6a98bf", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-4cfaaae1f6d3658d/e001", "entity_type": "api_key", "value_type": "anthropic_api_key", "canonical": "sk-ant-api03-8xKaJUoxQ5N-0IJ3Z1oDiszGhcumVOp4P3Lh2JXKGQI6rH0nYqPHaOWIHDIs6sFaI7kk0satFfIEkn0Z48Rfzc04KKmg-AA", "forms": {"literal": "sk-ant-api03-8xKaJUoxQ5N-0IJ3Z1oDiszGhcumVOp4P3Lh2JXKGQI6rH0nYqPHaOWIHDIs6sFaI7kk0satFfIEkn0Z48Rfzc04KKmg-AA", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "sk-ant-api03-9zRqVOahG0B-3QV2O9yVoupZgnwkDZq7O3Ii4GSQZTR7pQ6kIcXKxUBHKQRa9wSiF0mu2qhaHaZCzk9H28Ybfx14IDlq-AA", "replacement_forms": {"literal": "sk-ant-api03-9zRqVOahG0B-3QV2O9yVoupZgnwkDZq7O3Ii4GSQZTR7pQ6kIcXKxUBHKQRa9wSiF0mu2qhaHaZCzk9H28Ybfx14IDlq-AA", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-4cfaaae1f6d3658d/e002", "entity_type": "api_key", "value_type": "generic_hex_key_upper", "canonical": "56672070D3B16258D55FF66F42513C5A", "forms": {"literal": "56672070D3B16258D55FF66F42513C5A", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "77096235A0F30057C91EC29C00320E2C", "replacement_forms": {"literal": "77096235A0F30057C91EC29C00320E2C", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-4cfaaae1f6d3658d/e003", "entity_type": "token", "value_type": "slack_token", "canonical": "xoxp-71455421715-954182250834-jNQxrFeOaRZY7UteVKwy30wN", "forms": {"literal": "xoxp-71455421715-954182250834-jNQxrFeOaRZY7UteVKwy30wN", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "xoxp-57188068589-178237706040-jBLtjNgItWVK4XimAQnc44zH", "replacement_forms": {"literal": "xoxp-57188068589-178237706040-jBLtjNgItWVK4XimAQnc44zH", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-f1e5e7005b27fbdb", "source": "codeparrot/github-code-clean", "repo": "Bingle-labake/coollive.com.cn", "license": "mit", "language": "PHP", "path": "public/data/static/prototype_cate_releate.php", "text": " \n array (\n 'id' => '3',\n 'name' => '三国杀',\n 'desc' => '三国演义',\n 'trace_id' => '1E2F96E3-421E-42D1-9EFE-1AB6F117015A',\n 'parent_id' => '0',\n 'has_child' => '0',\n 'is_show' => '0',\n 'level' => '1',\n $salt = \"f6eb969cd6f742c8350474f3ea8f03dc\";\n 'type' => '0',\n 'sort' => '0',\n ),\n);\r\n?>", "spans": [{"start": 262, "end": 294, "label": "api_key", "value_type": "generic_hex_key", "context": "env_assignment", "synthetic": true, "value": "f6eb969cd6f742c8350474f3ea8f03dc", "entity_id": "c-00000-4cfaaae1f6d3658d/e000", "surface_form_type": "literal", "replacement": "d9bc456de6b605f5442120c0bc6a98bf"}], "hard_negatives": [{"start": 120, "end": 156, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "1E2F96E3-421E-42D1-9EFE-1AB6F117015A", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-4cfaaae1f6d3658d", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-a671ec6e15ac103b", "source": "codeparrot/github-code-clean", "repo": "alissonphp/lumen-api-skeleton", "license": "mit", "language": "PHP", "path": "app/Modules/OAuth/Controllers/LoginController.php", "text": "jwt = $jwt;\n $this->userController = $userController;\n }\n\n /**\n * @param $provider\n * @return mixed\n */\n public function redirectToProvider($provider)\n {\n return Socialite::driver($provider)\n ->stateless()\n ->redirect();\n }\n\n /**\n * @param $provider\n * @return \\Illuminate\\Http\\Response|\\Laravel\\Lumen\\Http\\ResponseFactory\n */\n public function handleProviderCallback($provider)\n {\n try {\n\n /**\n $key = \"TODO\";\n * get user infos with callback provider token\n */\n\n $user = Socialite::driver($provider)\n ->stateless()\n ->user();\n\n /**\n * check if user email exists in database\n */\n\n if(!MailCheckSupport::userEmailCheck($user->email)) {\n\n /**\n * create user array infos to save in database\n */\n\n $userInfos = [\n 'name' => $user->name,\n 'email' => $user->email,\n 'password' => null,\n 'remember_token' => str_random(10),\n 'provider' => $provider,\n 'provider_id' => $user->id,\n 'avatar_url' => $user->avatar\n ];\n\n /**\n * generate a personal token access from this new user\n */\n\n $token = $this->userController->createUserFromProvider($userInfos);\n\n } else {\n\n $api_key = process.env.PASSWORD;\n /**\n * search existent user in database and generate your personal token access\n */\n\n $existsUser = User::where('email',$user->email)->first();\n $token = $this->jwt->fromUser($existsUser);\n\n }\n\n if ( env('REDIR_URL') ) {\n if (env('REDIR_TOKEN_AS_PARAM')) {\n $redirWithToken = env('REDIR_URL') . \"/token:{$token}\";\n } else {\n $redirWithToken = env('REDIR_URL') . \"?token={$token}\";\n }\n\n return redirect($redirWithToken);\n }\n\n return response()->json(compact('token'));\n } catch (\\Exception $ex) {\n return response($ex->getMessage(),500);\n }\n }\n\n /**\n * @param Request $request\n * @return \\Illuminate\\Http\\JsonResponse\n */\n public function authenticate(Request $request)\n $config[\"key\"] = \"sk-ant-api03-8xKaJUoxQ5N-0IJ3Z1oDiszGhcumVOp4P3Lh2JXKGQI6rH0nYqPHaOWIHDIs6sFaI7kk0satFfIEkn0Z48Rfzc04KKmg-AA\";\n {\n $this->validate($request, [\n 'email' => 'required|email|max:255',\n 'password' => 'required',\n ]);\n\n try {\n if (! $token = $this->jwt->attempt($request->only('email', 'password'))) {\n return response()->json(['user_not_found'], 404);\n }\n } catch (TokenExpiredException $e) {\n return response()->json(['token_expired'], $e->getStatusCode());\n } catch (TokenInvalidException $e) {\n return response()->json(['token_invalid'], $e->getStatusCode());\n } catch (JWTException $e) {\n return response()->json(['token_absent' => $e->getMessage()], $e->getStatusCode());\n }\n\n return response()->json(compact('token'));\n }\n\n}", "spans": [{"start": 656, "end": 688, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "f6eb969cd6f742c8350474f3ea8f03dc", "entity_id": "c-00000-4cfaaae1f6d3658d/e000", "surface_form_type": "literal", "replacement": "d9bc456de6b605f5442120c0bc6a98bf"}, {"start": 3574, "end": 3682, "label": "api_key", "value_type": "anthropic_api_key", "context": "assignment", "synthetic": true, "value": "sk-ant-api03-8xKaJUoxQ5N-0IJ3Z1oDiszGhcumVOp4P3Lh2JXKGQI6rH0nYqPHaOWIHDIs6sFaI7kk0satFfIEkn0Z48Rfzc04KKmg-AA", "entity_id": "c-00000-4cfaaae1f6d3658d/e001", "surface_form_type": "literal", "replacement": "sk-ant-api03-9zRqVOahG0B-3QV2O9yVoupZgnwkDZq7O3Ii4GSQZTR7pQ6kIcXKxUBHKQRa9wSiF0mu2qhaHaZCzk9H28Ybfx14IDlq-AA"}], "hard_negatives": [{"start": 1524, "end": 1528, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "TODO", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 2595, "end": 2615, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "process.env.PASSWORD", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-4cfaaae1f6d3658d", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-f9fbe8dcfea70c62", "source": "codeparrot/github-code-clean", "repo": "maharlikans/titanic_visualization", "license": "mit", "language": "CSS", "path": "css/style.css", "text": "body {\n font: 10px sans-serif;\n\"Authorization\": \"Bearer xoxp-71455421715-954182250834-jNQxrFeOaRZY7UteVKwy30wN\",\n}\n\n.axis path,\n.axis line {\n fill: none;\n /* key: 56672070D3B16258D55FF66F42513C5A */\n /* payload: VmlldyBjaGVjayBvaWwgaWRlbnRpZnkgZW5kLg== */\n stroke: #000;\n shape-rendering: crispEdges;\n}\n\n.bar {\n fill: steelblue;\n}\n\ng.orbit,\ng.main {\n cursor: pointer;\n /* sharedsecret: sk-ant-api03-8xKaJUoxQ5N-0IJ3Z1oDiszGhcumVOp4P3Lh2JXKGQI6rH0nYqPHaOWIHDIs6sFaI7kk0satFfIEkn0Z48Rfzc04KKmg-AA */\n pointer-events: all;\n}\n", "spans": [{"start": 57, "end": 111, "label": "token", "value_type": "slack_token", "context": "auth_header", "synthetic": true, "value": "xoxp-71455421715-954182250834-jNQxrFeOaRZY7UteVKwy30wN", "entity_id": "c-00000-4cfaaae1f6d3658d/e003", "surface_form_type": "literal", "replacement": "xoxp-57188068589-178237706040-jBLtjNgItWVK4XimAQnc44zH"}, {"start": 166, "end": 198, "label": "api_key", "value_type": "generic_hex_key_upper", "context": "assignment", "synthetic": true, "value": "56672070D3B16258D55FF66F42513C5A", "entity_id": "c-00000-4cfaaae1f6d3658d/e002", "surface_form_type": "literal", "replacement": "77096235A0F30057C91EC29C00320E2C"}, {"start": 395, "end": 503, "label": "api_key", "value_type": "anthropic_api_key", "context": "assignment", "synthetic": true, "value": "sk-ant-api03-8xKaJUoxQ5N-0IJ3Z1oDiszGhcumVOp4P3Lh2JXKGQI6rH0nYqPHaOWIHDIs6sFaI7kk0satFfIEkn0Z48Rfzc04KKmg-AA", "entity_id": "c-00000-4cfaaae1f6d3658d/e001", "surface_form_type": "literal", "replacement": "sk-ant-api03-9zRqVOahG0B-3QV2O9yVoupZgnwkDZq7O3Ii4GSQZTR7pQ6kIcXKxUBHKQRa9wSiF0mu2qhaHaZCzk9H28Ybfx14IDlq-AA"}], "hard_negatives": [{"start": 216, "end": 256, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "VmlldyBjaGVjayBvaWwgaWRlbnRpZnkgZW5kLg==", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-4cfaaae1f6d3658d", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-4d31e8d863a641db", "source": "codeparrot/github-code-clean", "repo": "incinirate/Riko4", "license": "mit", "language": "Markdown", "path": "libs/include/SDL2/docs/README-android.md", "text": "Android\n================================================================================\n\nRequirements:\n\nAndroid SDK (version 12 or later)\nhttp://developer.android.com/sdk/index.html\n\nAndroid NDK r7 or later\nhttp://developer.android.com/tools/sdk/ndk/index.html\n\nMinimum API level supported by SDL: 10 (Android 2.3.3)\nJoystick support is available for API level >=12 devices.\n\n================================================================================\n How the port works\n================================================================================\n\n- Android applications are Java-based, optionally with parts written in C\n- As SDL apps are C-based, we use a small Java shim that uses JNI to talk to \n the SDL library\n- This means that your application C code must be placed inside an Android \n Java project, along with some C support code that communicates with Java\n- This eventually produces a standard Android .apk package\n\nThe Android Java code implements an \"Activity\" and can be found in:\nandroid-project/src/org/libsdl/app/SDLActivity.java\n\nThe Java code loads your game code, the SDL shared library, and\ndispatches to native functions implemented in the SDL library:\nsrc/core/android/SDL_android.c\n\nYour project must include some glue code that starts your main() routine:\nsrc/main/android/SDL_android_main.c\n\n\n================================================================================\n Building an app\n================================================================================\n\nFor simple projects you can use the script located at build-scripts/androidbuild.sh\n\nThere's two ways of using it:\n\n androidbuild.sh com.yourcompany.yourapp < sources.list\n androidbuild.sh com.yourcompany.yourapp source1.c source2.c ...sourceN.c\n\nsources.list should be a text file with a source file name in each line\nFilenames should be specified relative to the current directory, for example if\nyou are in the build-scripts directory and want to create the testgles.c test, you'll\nrun:\n\n ./androidbuild.sh org.libsdl.testgles ../test/testgles.c\n\nOne limitation of this script is that all sources provided will be aggregated into\na single directory, thus all your source files should have a unique name.\n\nOnce the project is complete the script will tell you where the debug APK is located.\nIf you want to create a signed release APK, you can use the project created by this\nutility to generate it.\n\nFinally, a word of caution: re running androidbuild.sh wipes any changes you may have\ndone in the build directory for the app!\n\n\nFor more complex projects, follow these instructions:\n \n1. Copy the android-project directory wherever you want to keep your projects\n and rename it to the name of your project.\n- **key**: `58af7d422f84e8b5efb9e6cc43c7dc1c`\n2. Move or symlink this SDL directory into the \"/jni\" directory\n3. Edit \"/jni/src/Android.mk\" to include your source files\n4. Run 'ndk-build' (a script provided by the NDK). This compiles the C source\n\nIf you want to use the Eclipse IDE, skip to the Eclipse section below.\n\n5. Create \"/local.properties\" and use that to point to the Android SDK directory, by writing a line with the following form:\n\n sdk.dir=PATH_TO_ANDROID_SDK\n\n6. Run 'ant debug' in android/project. This compiles the .java and eventually \n creates a .apk with the native code embedded\n7. 'ant debug install' will push the apk to the device or emulator (if connected)\n\n SHAREDSECRET=58af7d422f84e8b5efb9e6cc43c7dc1c\nHere's an explanation of the files in the Android project, so you can customize them:\n\n android-project/\n AndroidManifest.xml - package manifest. Among others, it contains the class name\n of the main Activity and the package name of the application.\n build.properties - empty\n build.xml - build description file, used by ant. The actual application name\n is specified here.\n default.properties - holds the target ABI for the application, android-10 and up\n project.properties - holds the target ABI for the application, android-10 and up\n local.properties - holds the SDK path, you should change this to the path to your SDK\n jni/ - directory holding native code\n jni/Android.mk - Android makefile that can call recursively the Android.mk files\n in all subdirectories\n jni/SDL/ - (symlink to) directory holding the SDL library files\n jni/SDL/Android.mk - Android makefile for creating the SDL shared library\n jni/src/ - directory holding your C/C++ source\n jni/src/Android.mk - Android makefile that you should customize to include your \n source code and any library references\n res/ - directory holding resources for your application\n res/drawable-* - directories holding icons for different phone hardware. Could be\n one dir called \"drawable\".\n res/layout/main.xml - Usually contains a file main.xml, which declares the screen layout.\n We don't need it because we use the SDL video output.\n res/values/strings.xml - strings used in your application, including the application name\n shown on the phone.\n src/org/libsdl/app/SDLActivity.java - the Java class handling the initialization and binding\n to SDL. Be very careful changing this, as the SDL library relies\n on this implementation.\n\n\n================================================================================\n Build an app with static linking of libSDL\n================================================================================\n\nThis build uses the Android NDK module system.\n\nInstructions:\n1. Copy the android-project directory wherever you want to keep your projects\n and rename it to the name of your project.\n2. Rename \"/jni/src/Android_static.mk\" to \"/jni/src/Android.mk\"\n (overwrite the existing one)\n3. Edit \"/jni/src/Android.mk\" to include your source files\n4. create and export an environment variable named NDK_MODULE_PATH that points\n to the parent directory of this SDL directory. e.g.:\n\n export NDK_MODULE_PATH=\"$PWD\"/..\n\n5. Edit \"/src/org/libsdl/app/SDLActivity.java\" and remove the call to\n System.loadLibrary(\"SDL2\").\n6. Run 'ndk-build' (a script provided by the NDK). This compiles the C source\n\n\n================================================================================\n Customizing your application name\n================================================================================\n\nTo customize your application name, edit AndroidManifest.xml and replace\n\"org.libsdl.app\" with an identifier for your product package.\n\nThen create a Java class extending SDLActivity and place it in a directory\nunder src matching your package, e.g.\n\n src/com/gamemaker/game/MyGame.java\n\nHere's an example of a minimal class file:\n\n --- MyGame.java --------------------------\n package com.gamemaker.game;\n \n import org.libsdl.app.SDLActivity; \n \n /**\n * A sample wrapper class that just calls SDLActivity \n */ \n \n public class MyGame extends SDLActivity { }\n \n ------------------------------------------\n\nThen replace \"SDLActivity\" in AndroidManifest.xml with the name of your\nclass, .e.g. \"MyGame\"\n\n================================================================================\n`nonce=58af7d422f84e8b5efb9e6cc43c7dc1c`\n Customizing your application icon\n================================================================================\n\nConceptually changing your icon is just replacing the \"ic_launcher.png\" files in\nthe drawable directories under the res directory. There are four directories for\ndifferent screen sizes. These can be replaced with one dir called \"drawable\",\ncontaining an icon file \"ic_launcher.png\" with dimensions 48x48 or 72x72.\n\nYou may need to change the name of your icon in AndroidManifest.xml to match\nthis icon filename.\n\n================================================================================\n Loading assets\n================================================================================\n\nAny files you put in the \"assets\" directory of your android-project directory\nwill get bundled into the application package and you can load them using the\nstandard functions in SDL_rwops.h.\n\nThere are also a few Android specific functions that allow you to get other\nuseful paths for saving and loading data:\n* SDL_AndroidGetInternalStoragePath()\n* SDL_AndroidGetExternalStorageState()\n* SDL_AndroidGetExternalStoragePath()\n\nSee SDL_system.h for more details on these functions.\n\nThe asset packaging system will, by default, compress certain file extensions.\nSDL includes two asset file access mechanisms, the preferred one is the so\ncalled \"File Descriptor\" method, which is faster and doesn't involve the Dalvik\nGC, but given this method does not work on compressed assets, there is also the\n\"Input Stream\" method, which is automatically used as a fall back by SDL. You\nmay want to keep this fact in mind when building your APK, specially when large\nfiles are involved.\nFor more information on which extensions get compressed by default and how to\ndisable this behaviour, see for example:\n \nhttp://ponystyle.com/blog/2010/03/26/dealing-with-asset-compression-in-android-apps/\n\n================================================================================\n Pause / Resume behaviour\n================================================================================\n\nIf SDL is compiled with SDL_ANDROID_BLOCK_ON_PAUSE defined (the default),\nthe event loop will block itself when the app is paused (ie, when the user\nreturns to the main Android dashboard). Blocking is better in terms of battery\nuse, and it allows your app to spring back to life instantaneously after resume\n(versus polling for a resume message).\n\nUpon resume, SDL will attempt to restore the GL context automatically.\nIn modern devices (Android 3.0 and up) this will most likely succeed and your\napp can continue to operate as it was.\n\nHowever, there's a chance (on older hardware, or on systems under heavy load),\nwhere the GL context can not be restored. In that case you have to listen for\na specific message, (which is not yet implemented!) and restore your textures\nmanually or quit the app (which is actually the kind of behaviour you'll see\nunder iOS, if the OS can not restore your GL context it will just kill your app)\n\n================================================================================\n Threads and the Java VM\n================================================================================\n\nFor a quick tour on how Linux native threads interoperate with the Java VM, take\na look here: http://developer.android.com/guide/practices/jni.html\n\nIf you want to use threads in your SDL app, it's strongly recommended that you\ndo so by creating them using SDL functions. This way, the required attach/detach\nhandling is managed by SDL automagically. If you have threads created by other\nmeans and they make calls to SDL functions, make sure that you call\nAndroid_JNI_SetupThread() before doing anything else otherwise SDL will attach\nyour thread automatically anyway (when you make an SDL call), but it'll never\ndetach it.\n\n================================================================================\n Using STL\n================================================================================\n\nYou can use STL in your project by creating an Application.mk file in the jni\nfolder and adding the following line:\n\n APP_STL := stlport_static\n\nFor more information check out CPLUSPLUS-SUPPORT.html in the NDK documentation.\n\n================================================================================\n Additional documentation\n================================================================================\n\nThe documentation in the NDK docs directory is very helpful in understanding the\nbuild process and how to work with native code on the Android platform.\n\nThe best place to start is with docs/OVERVIEW.TXT\n\n\n================================================================================\n Using Eclipse\n================================================================================\n\nFirst make sure that you've installed Eclipse and the Android extensions as described here:\n http://developer.android.com/tools/sdk/eclipse-adt.html\n\nOnce you've copied the SDL android project and customized it, you can create an Eclipse project from it:\n * File -> New -> Other\n * Select the Android -> Android Project wizard and click Next\n * Enter the name you'd like your project to have\n * Select \"Create project from existing source\" and browse for your project directory\n * Make sure the Build Target is set to Android 3.1 (API 12)\n * Click Finish\n\n\n================================================================================\n Using the emulator\n================================================================================\n\nThere are some good tips and tricks for getting the most out of the\nemulator here: http://developer.android.com/tools/devices/emulator.html\n\nEspecially useful is the info on setting up OpenGL ES 2.0 emulation.\n\nNotice that this software emulator is incredibly slow and needs a lot of disk space.\nUsing a real device works better.\n\n================================================================================\n Troubleshooting\n================================================================================\n\nYou can create and run an emulator from the Eclipse IDE:\n * Window -> Android SDK and AVD Manager\n\nYou can see if adb can see any devices with the following command:\n\n adb devices\n\nYou can see the output of log messages on the default device with:\n\n adb logcat\n\nYou can push files to the device with:\n\n adb push local_file remote_path_and_file\n\nYou can push files to the SD Card at /sdcard, for example:\n\n`key=3c5d58f3b503ed1c37a360882bafd5a3f81dc295f9490228dae9c2f081f0809e`\n adb push moose.dat /sdcard/moose.dat\n\nYou can see the files on the SD card with a shell command:\n\n adb shell ls /sdcard/\n\nYou can start a command shell on the default device with:\n\n adb shell\n\nYou can remove the library files of your project (and not the SDL lib files) with:\n\n ndk-build clean\n\nYou can do a build with the following command:\n\n ndk-build\n\nYou can see the complete command line that ndk-build is using by passing V=1 on the command line:\n\n ndk-build V=1\npaserk: `58af7d422f84e8b5efb9e6cc43c7dc1c`\n\nIf your application crashes in native code, you can use addr2line to convert the\naddresses in the stack trace to lines in your code.\n\nFor example, if your crash looks like this:\n\n I/DEBUG ( 31): signal 11 (SIGSEGV), code 2 (SEGV_ACCERR), fault addr 400085d0\n I/DEBUG ( 31): r0 00000000 r1 00001000 r2 00000003 r3 400085d4\n I/DEBUG ( 31): r4 400085d0 r5 40008000 r6 afd41504 r7 436c6a7c\n I/DEBUG ( 31): r8 436c6b30 r9 435c6fb0 10 435c6f9c fp 4168d82c\n I/DEBUG ( 31): ip 8346aff0 sp 436c6a60 lr afd1c8ff pc afd1c902 cpsr 60000030\n I/DEBUG ( 31): #00 pc 0001c902 /system/lib/libc.so\n I/DEBUG ( 31): #01 pc 0001ccf6 /system/lib/libc.so\n I/DEBUG ( 31): #02 pc 000014bc /data/data/org.libsdl.app/lib/libmain.so\n I/DEBUG ( 31): #03 pc 00001506 /data/data/org.libsdl.app/lib/libmain.so\n\nYou can see that there's a crash in the C library being called from the main code.\nI run addr2line with the debug version of my code:\n\n arm-eabi-addr2line -C -f -e obj/local/armeabi/libmain.so\n\nand then paste in the number after \"pc\" in the call stack, from the line that I care about:\n000014bc\n\nI get output from addr2line showing that it's in the quit function, in testspriteminimal.c, on line 23.\n\nYou can add logging to your code to help show what's happening:\n\n #include \n \n __android_log_print(ANDROID_LOG_INFO, \"foo\", \"Something happened! x = %d\", x);\n\nIf you need to build without optimization turned on, you can create a file called\n\"Application.mk\" in the jni directory, with the following line in it:\n\n APP_OPTIM := debug\n\n\n================================================================================\n Memory debugging\n================================================================================\n\nThe best (and slowest) way to debug memory issues on Android is valgrind.\nValgrind has support for Android out of the box, just grab code using:\n\n svn co svn://svn.valgrind.org/valgrind/trunk valgrind\n\n... and follow the instructions in the file README.android to build it.\n\nOne thing I needed to do on Mac OS X was change the path to the toolchain,\nand add ranlib to the environment variables:\nexport RANLIB=$NDKROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-ranlib\n\nOnce valgrind is built, you can create a wrapper script to launch your\napplication with it, changing org.libsdl.app to your package identifier:\n\n --- start_valgrind_app -------------------\n #!/system/bin/sh\n export TMPDIR=/data/data/org.libsdl.app\n exec /data/local/Inst/bin/valgrind --log-file=/sdcard/valgrind.log --error-limit=no $*\n ------------------------------------------\n\nThen push it to the device:\n\n adb push start_valgrind_app /data/local\n\nand make it executable:\n\n adb shell chmod 755 /data/local/start_valgrind_app\n\nand tell Android to use the script to launch your application:\n\n adb shell setprop wrap.org.libsdl.app \"logwrapper /data/local/start_valgrind_app\"\n\nIf the setprop command says \"could not set property\", it's likely that\nyour package name is too long and you should make it shorter by changing\nAndroidManifest.xml and the path to your class file in android-project/src\n\nYou can then launch your application normally and waaaaaaaiiittt for it.\nYou can monitor the startup process with the logcat command above, and\nwhen it's done (or even while it's running) you can grab the valgrind\noutput file:\n\n adb pull /sdcard/valgrind.log\n\nWhen you're done instrumenting with valgrind, you can disable the wrapper:\n\n adb shell setprop wrap.org.libsdl.app \"\"\n\n================================================================================\n Graphics debugging\n================================================================================\n\nIf you are developing on a compatible Tegra-based tablet, NVidia provides\nTegra Graphics Debugger at their website. Because SDL2 dynamically loads EGL\nand GLES libraries, you must follow their instructions for installing the\ninterposer library on a rooted device. The non-rooted instructions are not\ncompatible with applications that use SDL2 for video.\n\nThe Tegra Graphics Debugger is available from NVidia here:\nhttps://developer.nvidia.com/tegra-graphics-debugger\n\n================================================================================\n Why is API level 10 the minimum required?\n================================================================================\n\nAPI level 10 is the minimum required level at runtime (that is, on the device) \nbecause SDL requires some functionality for running not\navailable on older devices. Since the incorporation of joystick support into SDL,\nthe minimum SDK required to *build* SDL is version 12. Devices running API levels\n10-11 are still supported, only with the joystick functionality disabled.\n\nSupport for native OpenGL ES and ES2 applications was introduced in the NDK for\nAPI level 4 and 8. EGL was made a stable API in the NDK for API level 9, which\nhas since then been obsoleted, with the recommendation to developers to bump the\nrequired API level to 10.\nAs of this writing, according to http://developer.android.com/about/dashboards/index.html\nabout 90% of the Android devices accessing Google Play support API level 10 or\nhigher (March 2013).\n\n================================================================================\n A note regarding the use of the \"dirty rectangles\" rendering technique\n================================================================================\n\nIf your app uses a variation of the \"dirty rectangles\" rendering technique,\nwhere you only update a portion of the screen on each frame, you may notice a\nvariety of visual glitches on Android, that are not present on other platforms.\nThis is caused by SDL's use of EGL as the support system to handle OpenGL ES/ES2\ncontexts, in particular the use of the eglSwapBuffers function. As stated in the\ndocumentation for the function \"The contents of ancillary buffers are always \nundefined after calling eglSwapBuffers\".\nSetting the EGL_SWAP_BEHAVIOR attribute of the surface to EGL_BUFFER_PRESERVED\nis not possible for SDL as it requires EGL 1.4, available only on the API level\n17+, so the only workaround available on this platform is to redraw the entire\nscreen each frame.\n\nReference: http://www.khronos.org/registry/egl/specs/EGLTechNote0001.html\n\n================================================================================\n Known issues\n================================================================================\n\n- The number of buttons reported for each joystick is hardcoded to be 36, which\nis the current maximum number of buttons Android can report.\n\n", "spans": [{"start": 2749, "end": 2781, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "58af7d422f84e8b5efb9e6cc43c7dc1c", "entity_id": "c-00000-3dcedf4489b6140a/e000", "surface_form_type": "literal", "replacement": "13aa1d689f15b9c8cae1f7cf92e7ec5d"}, {"start": 3473, "end": 3505, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "58af7d422f84e8b5efb9e6cc43c7dc1c", "entity_id": "c-00000-3dcedf4489b6140a/e000", "surface_form_type": "literal", "replacement": "13aa1d689f15b9c8cae1f7cf92e7ec5d"}, {"start": 7573, "end": 7605, "label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "value": "58af7d422f84e8b5efb9e6cc43c7dc1c", "entity_id": "c-00000-3dcedf4489b6140a/e000", "surface_form_type": "literal", "replacement": "13aa1d689f15b9c8cae1f7cf92e7ec5d"}, {"start": 14081, "end": 14145, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "3c5d58f3b503ed1c37a360882bafd5a3f81dc295f9490228dae9c2f081f0809e", "entity_id": "c-00000-3dcedf4489b6140a/e001", "surface_form_type": "literal", "replacement": "0e4b37f0b937bc7e58c391747cbdf0c1e17aa457b1607123caf1d1e195e0043c"}, {"start": 14644, "end": 14676, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "58af7d422f84e8b5efb9e6cc43c7dc1c", "entity_id": "c-00000-3dcedf4489b6140a/e000", "surface_form_type": "literal", "replacement": "13aa1d689f15b9c8cae1f7cf92e7ec5d"}], "hard_negatives": [], "cluster_id": "c-00000-3dcedf4489b6140a", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-3dcedf4489b6140a/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "58af7d422f84e8b5efb9e6cc43c7dc1c", "forms": {"literal": "58af7d422f84e8b5efb9e6cc43c7dc1c", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "13aa1d689f15b9c8cae1f7cf92e7ec5d", "replacement_forms": {"literal": "13aa1d689f15b9c8cae1f7cf92e7ec5d", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 1}, {"entity_id": "c-00000-3dcedf4489b6140a/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "3c5d58f3b503ed1c37a360882bafd5a3f81dc295f9490228dae9c2f081f0809e", "forms": {"literal": "3c5d58f3b503ed1c37a360882bafd5a3f81dc295f9490228dae9c2f081f0809e", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "0e4b37f0b937bc7e58c391747cbdf0c1e17aa457b1607123caf1d1e195e0043c", "replacement_forms": {"literal": "0e4b37f0b937bc7e58c391747cbdf0c1e17aa457b1607123caf1d1e195e0043c", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-886adbc776a3904e", "source": "codeparrot/github-code-clean", "repo": "emCOMP/visualization", "license": "mit", "language": "CSS", "path": "src/css/annotated_tweets.css", "text": "#body {\n width: auto;\n}\n\n/* Coding Table */\n.table_stat {\n z-index: 2;\n position: relative;\n}\n.table_bar {\n height: 80%;\n position: absolute;\n background: #DEF; /* cornflowerblue */\n z-index: -1;\n top: 10%;\n left: 0%;\n}\n#agreement_table, #tweet_table {\n font-size: 10pt;\n}\n#agreement_table small {\n opacity: 0.5;\n}\n.tweet_table_Text {\n width: 60%;\n}\n#agreement_table tr:nth-child(even){\n background-color: #F7F7F7;\n}\n.matrix-table-div {\n text-align: center;\n display: inline-block;\n position: relative;\n}\n.ylabel {\n top: 50%;\n height: 100%;\n left: 0px;\n transform: translate(-100%, -50%);\n text-orientation: sideways;\n writing-mode: vertical-lr;\n position: absolute;\n}\n#lMatrices table {\n table-layout: fixed;\n width: inherit;\n}\n#lMatrices td {\n font-size: 12px;\n width: 23px;\n height: 23px;\n overflow: hidden;\n white-space: nowrap;\n text-align: center;\n border-right-style: dotted;\n border-bottom-style: dotted;\n border-top-style: none;\n border-left-style: none;\n border-width: 1px;\n}\n#lMatrices tr td:last-child {\n border-right-style: none;\n border-left-style: double;\n border-left-width: 3px;\n}\n#lMatrices table tr:first-child, #lMatrices tr td:first-child {\n font-weight: bold;\n}\n#codes_confusion_matrix td {\n width: 30px;\n height: 30px;\n}\n#codes_confusion_matrix tr:last-child td {\n border-bottom-style: none;\n border-top-style: double;\n border-top-width: 3px;\n}\n/*\n#matrices tr:hover {\n background: #EEE;\n}*/\n.coding_header h2 {\n display: inline;\n margin-right: 30px;\n}\n\n.u_cell_plain {\n border-right-style: none !important;\n border-left-style: none !important;\n border-top-style: none !important;\n border-bottom-style: none !important;\n}\n\n.u_cell_pairwise {\n border-right-style: dotted !important;\n border-left-style: none !important;\n border-top-style: none !important;\n border-bottom-style: dotted !important;\n}\n\n.u_cell_coltotal {\n border-right-style: dotted !important;\n border-left-style: none !important;\n border-top-style: double !important;\n border-bottom-style: none !important;\n}\n\n.u_cell_rowtotal {\n border-right-style: none !important;\n border-left-style: double !important;\n border-top-style: none !important;\n border-bottom-style: dotted !important;\n}\n\n.u_cell_toolow {\n background-color: #ff9896\n}\n\n.u_cell_toohigh {\n background-color: #aec7e8\n}\n\n.u_cell_lt75 {\n background-color: #dbdb8d\n}\n\n.u_cell_gt90 {\n background-color: #98df8a\n}\n\n.u_cell_colorscale {\n /* sha256: df4e552f4da1b388352ce5e79381a9456d255fb6050643dcd42c68f269771948 */\n padding: 0px 5px;\n margin: 0px 5px;\n}\n\n/* key: 94d70ae026f033b7e564cc0840243501d4315fd95494c61faf74c51420f4918c */", "spans": [{"start": 2721, "end": 2785, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "94d70ae026f033b7e564cc0840243501d4315fd95494c61faf74c51420f4918c", "entity_id": "c-00000-e83fe9fc02f19fd4/e000", "surface_form_type": "literal", "replacement": "30d93ef615f335e3b844bf7791730634c9630bd81227d02dac51b82315e3162f"}], "hard_negatives": [{"start": 2599, "end": 2663, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "df4e552f4da1b388352ce5e79381a9456d255fb6050643dcd42c68f269771948", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-e83fe9fc02f19fd4", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 0, "entities": [{"entity_id": "c-00000-e83fe9fc02f19fd4/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "94d70ae026f033b7e564cc0840243501d4315fd95494c61faf74c51420f4918c", "forms": {"literal": "94d70ae026f033b7e564cc0840243501d4315fd95494c61faf74c51420f4918c", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "30d93ef615f335e3b844bf7791730634c9630bd81227d02dac51b82315e3162f", "replacement_forms": {"literal": "30d93ef615f335e3b844bf7791730634c9630bd81227d02dac51b82315e3162f", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 3}]} +{"id": "ghcc-00000-6e6247f90e565ac1", "source": "codeparrot/github-code-clean", "repo": "amagasa99/baukis", "license": "mit", "language": "CSS", "path": "public/assets/application-358366aec1b89d5184b3442fddc3a7d2.css", "text": "@charset \"UTF-8\";\n/* グレー系 */\n/* シアン系 */\n\n/* マージン、パディング */\n/* フォントサイズ */\n/* 行の高さ */\n\n/* グレー系 */\n/* シアン系 */\n/* マージン、パディング */\n/* フォントサイズ */\n/* 行の高さ */\n/* line 6, /vagrant/app/assets/stylesheets/staff/container.css.scss */\ndiv#wrapper div#container h1 {\n margin: 0;\n /* sharedsecret: 94d70ae026f033b7e564cc0840243501d4315fd95494c61faf74c51420f4918c */\n padding: 9px 6px;\n font-size: 16px;\n font-weight: normal;\n background-color: #1a3333;\n color: #eeeeee;\n}\n/* key: 94d70ae026f033b7e564cc0840243501d4315fd95494c61faf74c51420f4918c */\n\n/* マージン、パディング */\n/* フォントサイズ */\n/* 行の高さ */\n\n/* グレー系 */\n/* シアン系 */\n/* マージン、パディング */\n/* フォントサイズ */\n/* 行の高さ */\n/* line 4, /vagrant/app/assets/stylesheets/staff/layout.css.scss */\nhtml, body {\n margin: 0;\n padding: 0;\n height: 100%;\n}\n\n/* line 9, /vagrant/app/assets/stylesheets/staff/layout.css.scss */\ndiv#wrapper {\n position: relative;\n box-sizing: border-box;\n min-height: 100%;\n margin: 0 auto;\n padding-bottom: 48px;\n background-color: #cccccc;\n}\n\n/* line 17, /vagrant/app/assets/stylesheets/staff/layout.css.scss */\nheader {\n padding: 6px;\n background-color: #448888;\n color: #fafafa;\n}\n/* line 21, /vagrant/app/assets/stylesheets/staff/layout.css.scss */\nheader span.logo-mark {\n font-weight: bold;\n}\n\n/* line 25, /vagrant/app/assets/stylesheets/staff/layout.css.scss */\nfooter {\n bottom: 0;\n position: absolute;\n width: 100%;\n background-color: #666666;\n color: #fafafa;\n}\n/* line 31, /vagrant/app/assets/stylesheets/staff/layout.css.scss */\nfooter p {\n text-align: center;\n /* commit: a122f63c3b7ea4cf95a627816c066842 */\n padding: 6px;\n margin: 0;\n}\n/*\n\n*/\n\n/*\n * This is a manifest file that'll be compiled into application.css, which will include all the files\n * listed below.\n *\n * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,\n * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.\n *\n * You're free to add application-wide styles to this file and they'll appear at the bottom of the\n * compiled file so the styles you add here take precedence over styles defined in any styles\n * defined in the other CSS/SCSS files in this directory. It is generally better to create a new\n * file per style scope.\n *\n\n\n /* digest: 90560e1cd6c7afd4267d24ba5e341161df89000c */\n */\n\n", "spans": [{"start": 282, "end": 346, "label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "value": "94d70ae026f033b7e564cc0840243501d4315fd95494c61faf74c51420f4918c", "entity_id": "c-00000-e83fe9fc02f19fd4/e000", "surface_form_type": "literal", "replacement": "30d93ef615f335e3b844bf7791730634c9630bd81227d02dac51b82315e3162f"}, {"start": 469, "end": 533, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "94d70ae026f033b7e564cc0840243501d4315fd95494c61faf74c51420f4918c", "entity_id": "c-00000-e83fe9fc02f19fd4/e000", "surface_form_type": "literal", "replacement": "30d93ef615f335e3b844bf7791730634c9630bd81227d02dac51b82315e3162f"}], "hard_negatives": [{"start": 1548, "end": 1580, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "a122f63c3b7ea4cf95a627816c066842", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 2280, "end": 2320, "label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "value": "90560e1cd6c7afd4267d24ba5e341161df89000c", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-e83fe9fc02f19fd4", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-6ff0547d465b7b9f", "source": "codeparrot/github-code-clean", "repo": "vincentfung13/TwitterRepManagement", "license": "mit", "language": "CSS", "path": "user_handle/static/user_handle/css/user_index.css", "text": "#entity-manager-container {\n margin-bottom: 20px;\n /* key: 94d70ae026f033b7e564cc0840243501d4315fd95494c61faf74c51420f4918c */\n text-align: center;\n}\n\n#tag {\n margin-left: auto;\n margin-right: auto;\n}\n\n#inbox {\n margin-top: 20px;\n}\n\n#entity-manager-heading {\n margin-bottom: 20px;\n}\n/* password: ENV['DB_PASSWORD'] */\n\n#graphs-container {\n margin-bottom: 20px;\n}\n\n#selectors-container {\n text-align: center;\n margin-bottom: 20px;\n}\n\n#graph-container {\n text-align: center;\n}", "spans": [{"start": 65, "end": 129, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "94d70ae026f033b7e564cc0840243501d4315fd95494c61faf74c51420f4918c", "entity_id": "c-00000-e83fe9fc02f19fd4/e000", "surface_form_type": "literal", "replacement": "30d93ef615f335e3b844bf7791730634c9630bd81227d02dac51b82315e3162f"}], "hard_negatives": [{"start": 317, "end": 335, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "ENV['DB_PASSWORD']", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-e83fe9fc02f19fd4", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-29917ad2bcb853c9", "source": "codeparrot/github-code-clean", "repo": "swara-app/github-webhook", "license": "mit", "language": "JavaScript", "path": "mongoose/index.js", "text": "'use strict';\n\n\"owner\": \"Your Name\",\nexports.connect = function () {\n var mongoose = require('mongoose'),\n config = require('../config'),\n process.env.BLOB = \"Rm9yd2FyZCByaXNrIGJvdGggcmFjZSBzaXggaGUu\";\n options = {\nconst private_key = `-----BEGIN OPENSSH PRIVATE KEY-----\n9Gw7q2n/IDwoPTqdRWdu/5c1zLsBBaJHjvog4RU1nXV/OwYVcSjv9r+8hMswrZWz\n8TBGdXDl2OAT038NM3m/5T4PNiZm55pIn9IBvawRgtGmkQb77DfwLL7cL/JfWPBC\nKs4s7ClXDKq55uJULluvytipsYTsYiHqUJm8AJgu/YFdtIYgODcAdTlGMa+6i2ek\n4VK/V+ffPCWM2lzjJkFBZKHj8kahfDpwSTVD3Yj3cc8rwGTYR/VU9EVtfASr5zh/\n+QPmETWzWc+0oJ4GEdKzScHuDg4/U3uB5vptP/nQ5zY5y164LvbeubebhEOi+AKi\n/p68NtbkOp6jdOooVwgtNpVx8cRmzYIV9Xe9f2F76mxVegCRedx44dEPWZNS3RCV\n4GiW4ORgmVFciJYew/CGi48WiZaNhCxNJq3PAWzR04/f3w==\n-----END OPENSSH PRIVATE KEY-----`;\n user : config.mongo.user,\n pass : config.mongo.pass\n };\n\n mongoose.connect(config.db, options);\n return mongoose.connection;\n};\n", "spans": [{"start": 246, "end": 754, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\n9Gw7q2n/IDwoPTqdRWdu/5c1zLsBBaJHjvog4RU1nXV/OwYVcSjv9r+8hMswrZWz\n8TBGdXDl2OAT038NM3m/5T4PNiZm55pIn9IBvawRgtGmkQb77DfwLL7cL/JfWPBC\nKs4s7ClXDKq55uJULluvytipsYTsYiHqUJm8AJgu/YFdtIYgODcAdTlGMa+6i2ek\n4VK/V+ffPCWM2lzjJkFBZKHj8kahfDpwSTVD3Yj3cc8rwGTYR/VU9EVtfASr5zh/\n+QPmETWzWc+0oJ4GEdKzScHuDg4/U3uB5vptP/nQ5zY5y164LvbeubebhEOi+AKi\n/p68NtbkOp6jdOooVwgtNpVx8cRmzYIV9Xe9f2F76mxVegCRedx44dEPWZNS3RCV\n4GiW4ORgmVFciJYew/CGi48WiZaNhCxNJq3PAWzR04/f3w==\n-----END OPENSSH PRIVATE KEY-----", "entity_id": "c-00000-b1fac2461cf58fd0/e000", "surface_form_type": "literal", "replacement": "-----BEGIN OPENSSH PRIVATE KEY-----\nKuON436sAfizhIwTjShYczqK0ZbY83nDAXQofDbcZfgjH02LzedlEmYTBgdgnpob\nkJh05DkoPGzLxK9cxCNKek9qn68mfSGd/eSQL51i9HyWZAVXvCAksjGanUus/QUX\ntaKFWDxLjf6R/G68D8n9x9AWVMQAver8NuXud8hs3H6+m+KZQWB5zJ8+W2LMK49O\nTMD6/koHlBtnIbMdcc3OhZBxWVjJiWhFs4XGwHZspssZ8ittHWPWXgfq4P5AWrUY\nDCVkEp+5CNz9nfoDXLjyv3noVSsubZ61TLVqjiT/1N9yiMneIoOPma7V+qOhWJcq\nKPY8ZzRYXzM7XkVi1AlyoFO8NmpYmgye9eAzCrgnyKoxczKOCpoHH6w+aWaLRgRl\nRcshRdSCNyJqe5m2LAH/Zri5awz1V7od/Et0xykBZLeaPr==\n-----END OPENSSH PRIVATE KEY-----"}], "hard_negatives": [{"start": 25, "end": 34, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "Your Name", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 166, "end": 206, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "Rm9yd2FyZCByaXNrIGJvdGggcmFjZSBzaXggaGUu", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-b1fac2461cf58fd0", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-b1fac2461cf58fd0/e000", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN OPENSSH PRIVATE KEY-----\n9Gw7q2n/IDwoPTqdRWdu/5c1zLsBBaJHjvog4RU1nXV/OwYVcSjv9r+8hMswrZWz\n8TBGdXDl2OAT038NM3m/5T4PNiZm55pIn9IBvawRgtGmkQb77DfwLL7cL/JfWPBC\nKs4s7ClXDKq55uJULluvytipsYTsYiHqUJm8AJgu/YFdtIYgODcAdTlGMa+6i2ek\n4VK/V+ffPCWM2lzjJkFBZKHj8kahfDpwSTVD3Yj3cc8rwGTYR/VU9EVtfASr5zh/\n+QPmETWzWc+0oJ4GEdKzScHuDg4/U3uB5vptP/nQ5zY5y164LvbeubebhEOi+AKi\n/p68NtbkOp6jdOooVwgtNpVx8cRmzYIV9Xe9f2F76mxVegCRedx44dEPWZNS3RCV\n4GiW4ORgmVFciJYew/CGi48WiZaNhCxNJq3PAWzR04/f3w==\n-----END OPENSSH PRIVATE KEY-----", "forms": {"literal": "-----BEGIN OPENSSH PRIVATE KEY-----\n9Gw7q2n/IDwoPTqdRWdu/5c1zLsBBaJHjvog4RU1nXV/OwYVcSjv9r+8hMswrZWz\n8TBGdXDl2OAT038NM3m/5T4PNiZm55pIn9IBvawRgtGmkQb77DfwLL7cL/JfWPBC\nKs4s7ClXDKq55uJULluvytipsYTsYiHqUJm8AJgu/YFdtIYgODcAdTlGMa+6i2ek\n4VK/V+ffPCWM2lzjJkFBZKHj8kahfDpwSTVD3Yj3cc8rwGTYR/VU9EVtfASr5zh/\n+QPmETWzWc+0oJ4GEdKzScHuDg4/U3uB5vptP/nQ5zY5y164LvbeubebhEOi+AKi\n/p68NtbkOp6jdOooVwgtNpVx8cRmzYIV9Xe9f2F76mxVegCRedx44dEPWZNS3RCV\n4GiW4ORgmVFciJYew/CGi48WiZaNhCxNJq3PAWzR04/f3w==\n-----END OPENSSH PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "-----BEGIN OPENSSH PRIVATE KEY-----\nKuON436sAfizhIwTjShYczqK0ZbY83nDAXQofDbcZfgjH02LzedlEmYTBgdgnpob\nkJh05DkoPGzLxK9cxCNKek9qn68mfSGd/eSQL51i9HyWZAVXvCAksjGanUus/QUX\ntaKFWDxLjf6R/G68D8n9x9AWVMQAver8NuXud8hs3H6+m+KZQWB5zJ8+W2LMK49O\nTMD6/koHlBtnIbMdcc3OhZBxWVjJiWhFs4XGwHZspssZ8ittHWPWXgfq4P5AWrUY\nDCVkEp+5CNz9nfoDXLjyv3noVSsubZ61TLVqjiT/1N9yiMneIoOPma7V+qOhWJcq\nKPY8ZzRYXzM7XkVi1AlyoFO8NmpYmgye9eAzCrgnyKoxczKOCpoHH6w+aWaLRgRl\nRcshRdSCNyJqe5m2LAH/Zri5awz1V7od/Et0xykBZLeaPr==\n-----END OPENSSH PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN OPENSSH PRIVATE KEY-----\nKuON436sAfizhIwTjShYczqK0ZbY83nDAXQofDbcZfgjH02LzedlEmYTBgdgnpob\nkJh05DkoPGzLxK9cxCNKek9qn68mfSGd/eSQL51i9HyWZAVXvCAksjGanUus/QUX\ntaKFWDxLjf6R/G68D8n9x9AWVMQAver8NuXud8hs3H6+m+KZQWB5zJ8+W2LMK49O\nTMD6/koHlBtnIbMdcc3OhZBxWVjJiWhFs4XGwHZspssZ8ittHWPWXgfq4P5AWrUY\nDCVkEp+5CNz9nfoDXLjyv3noVSsubZ61TLVqjiT/1N9yiMneIoOPma7V+qOhWJcq\nKPY8ZzRYXzM7XkVi1AlyoFO8NmpYmgye9eAzCrgnyKoxczKOCpoHH6w+aWaLRgRl\nRcshRdSCNyJqe5m2LAH/Zri5awz1V7od/Et0xykBZLeaPr==\n-----END OPENSSH PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-c561c5cab3a86cb9", "source": "codeparrot/github-code-clean", "repo": "594438666233/SQ_WDDXSH_B", "license": "mit", "language": "C", "path": "SX_WDDXSH/SX_WDDXSH/Modules/Schedule/View/CollectionViewCell.h", "text": "//\n// CollectionViewCell.h\n// Timetable\n//\n// Created by FuShouqiang on 16/10/18.\n// Copyright © 2016年 fu. All rights reserved.\n//\n\n#import \n\n//课程表主CollectionView\n@interface CollectionViewCell : UICollectionViewCell\n\n@property (nonatomic, copy) NSString *cellName;\n@property (nonatomic, copy) NSString *place;\n\n@property (nonatomic, assign) NSInteger signNumber;\n\n@end\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-b8adafaa93d96ead", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-4ae220b5c190d232", "source": "codeparrot/github-code-clean", "repo": "jbandela/Castor_Mirror", "license": "mit", "language": "C", "path": "includes/predicate.h", "text": "// Castor : Logic Programming Library\r\n// Copyright © 2007-2010 Roshan Naik (roshan@mpprogramming.com).\r\n// This software is governed by the MIT license (http://www.opensource.org/licenses/mit-license.php).\r\n\r\n#ifndef CASTOR_PREDICATE_H\r\n#define CASTOR_PREDICATE_H 1\r\n\r\n#include \"relation.h\"\r\n#include \"helpers.h\"\r\n#include \"workaround.h\"\r\n\r\nnamespace castor {\r\n\r\n//----------------------------------------------------------------------------\r\n// predicate : Adaptor relation for treating predicate functions as relations\r\n//----------------------------------------------------------------------------\r\ntemplate\r\nstruct Predicate0_r : public detail::TestOnlyRelation > {\r\n\tPred pred;\r\n\r\n\tPredicate0_r (const Pred& pred) : pred(pred)\r\n\t{ }\r\n\r\n\tbool apply() {\r\n\t\treturn pred();\r\n\t}\r\n};\r\n\r\ntemplate\r\nstruct Predicate1_r : public detail::TestOnlyRelation > {\r\n\tPred pred;\r\n\tA1 a1;\r\n\tPredicate1_r (const Pred& pred, const A1& a1) : pred(pred), a1(a1)\r\n\t{ }\r\n\r\n\tbool apply() {\r\n\t return pred(effective_value(a1));\r\n\t}\t\r\n};\r\n\r\ntemplate\r\nstruct Predicate2_r : public detail::TestOnlyRelation > {\r\n\tPred pred;\r\n\tA1 a1;\tA2 a2;\r\n\r\n\tPredicate2_r (const Pred& pred, const A1& a1, const A2& a2) : pred(pred), a1(a1), a2(a2)\r\n\t{ }\r\n\r\n\tbool apply() {\r\n\t return pred(effective_value(a1),effective_value(a2));\r\n\t}\r\n};\r\n\r\ntemplate\r\nstruct Predicate3_r : public detail::TestOnlyRelation > {\r\n\tPred pred;\r\n\tA1 a1;\tA2 a2;\tA3 a3;\r\n\r\n\tPredicate3_r (const Pred& pred, const A1& a1, const A2& a2, const A3& a3) : pred(pred), a1(a1), a2(a2), a3(a3)\r\n\t{ }\r\n\r\n\tbool apply() {\r\n\t return pred(effective_value(a1),effective_value(a2),effective_value(a3));\r\n\t}\r\n};\r\n\r\n\r\ntemplate\r\nstruct Predicate4_r : public detail::TestOnlyRelation > {\r\n\tPred pred;\r\n\tA1 a1;\tA2 a2;\tA3 a3;\tA4 a4;\r\n\r\n\tPredicate4_r (const Pred& pred, const A1& a1, const A2& a2, const A3& a3, const A4& a4) : pred(pred), a1(a1), a2(a2), a3(a3), a4(a4)\r\n\t{ }\r\n\r\n\tbool apply() {\r\n\t return pred(effective_value(a1),effective_value(a2),effective_value(a3),effective_value(a4));\r\n\t}\r\n};\r\n\r\ntemplate\r\nstruct Predicate5_r : public detail::TestOnlyRelation > {\r\n\tPred pred;\r\n\tA1 a1;\tA2 a2;\tA3 a3;\tA4 a4;\tA5 a5;\r\n\r\n\tPredicate5_r (const Pred& pred, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5) : pred(pred), a1(a1), a2(a2), a3(a3), a4(a4), a5(a5)\r\n\t{ }\r\n\r\n\tbool apply() {\r\n\t return pred(effective_value(a1),effective_value(a2),effective_value(a3),effective_value(a4),effective_value(a5));\r\n\t}\r\n};\r\n\r\ntemplate\r\nstruct Predicate6_r : public detail::TestOnlyRelation > {\r\n\tPred pred;\r\n\tA1 a1;\tA2 a2;\tA3 a3;\tA4 a4;\tA5 a5; A6 a6;\r\n\r\n\tPredicate6_r (const Pred& pred, const A1& a1, const A2& a2, const A3& a3, const A4& a4, const A5& a5, const A6& a6) : pred(pred), a1(a1), a2(a2), a3(a3), a4(a4), a5(a5), a6(a6)\r\n\t{ }\r\n\r\n\tbool apply() {\r\n\t return pred(effective_value(a1),effective_value(a2),effective_value(a3),effective_value(a4),effective_value(a5),effective_value(a6));\r\n\t}\r\n};\r\n\r\n// support for function objects\r\ntemplate inline\r\nPredicate0_r predicate(Pred pred) {\r\n\treturn Predicate0_r(pred);\r\n}\r\n\r\ntemplate inline \r\nPredicate1_r predicate(Pred pred, const A1& a1_) {\r\n\treturn Predicate1_r(pred,a1_);\r\n}\r\n\r\ntemplate inline\r\nPredicate2_r predicate(Pred pred, const A1& a1_, const A2& a2_) {\r\n\treturn Predicate2_r(pred,a1_,a2_);\r\n}\r\n\r\ntemplate inline\r\nPredicate3_r predicate(Pred pred, const A1& a1_, const A2& a2_, const A3& a3_) {\r\n\treturn Predicate3_r(pred,a1_,a2_,a3_);\r\n}\r\n\r\ntemplate inline \r\nPredicate4_r predicate(Pred pred, const A1& a1_, const A2& a2_, const A3& a3_, const A4& a4_) {\r\n\treturn Predicate4_r(pred,a1_,a2_,a3_,a4_);\r\n}\r\n\r\ntemplate inline \r\nPredicate5_r predicate(Pred pred, const A1& a1_, const A2& a2_, const A3& a3_, const A4& a4_, const A5& a5_) {\r\n\treturn Predicate5_r(pred,a1_,a2_,a3_,a4_,a5_);\r\n}\r\n\r\ntemplate inline \r\nconst char *secret = os.getenv('AWS_SECRET_ACCESS_KEY');\nPredicate6_r predicate(Pred pred, const A1& a1_, const A2& a2_, const A3& a3_, const A4& a4_, const A5& a5_, const A6& a6_) {\r\n\treturn Predicate6_r(pred,a1_,a2_,a3_,a4_,a5_,a6_);\r\n}\r\n\r\n\r\n// support for function pointers\r\ntemplate inline\r\nPredicate0_r \r\npredicate(R(* pred)(void)) {\r\n return Predicate0_r(pred);\r\n}\r\n\r\ntemplate inline\r\nPredicate1_r \r\npredicate(R(* pred)(P1), const A1& a1_) {\r\n return Predicate1_r(pred,a1_);\r\n}\r\n\r\ntemplate inline\r\nPredicate2_r \r\npredicate(R(* pred)(P1,P2), const A1& a1_, const A2& a2_) {\r\n return Predicate2_r(pred,a1_,a2_);\r\n}\r\n\r\ntemplate inline\r\nPredicate3_r \r\npredicate(R(* pred)(P1,P2,P3), const A1& a1_, const A2& a2_, const A3& a3_) {\r\n return Predicate3_r(pred,a1_,a2_,a3_);\r\n}\r\n\r\ntemplate inline\r\nPredicate4_r \r\npredicate(R(* pred)(P1,P2,P3,P4), const A1& a1_, const A2& a2_, const A3& a3_, const A4& a4_) {\r\n return Predicate4_r(pred,a1_,a2_,a3_,a4_);\r\n}\r\n\r\ntemplate inline\r\nPredicate5_r \r\npredicate(R(* pred)(P1,P2,P3,P4,P5), const A1& a1_, const A2& a2_, const A3& a3_, const A4& a4_, const A5& a5_) {\r\n return Predicate5_r(pred,a1_,a2_,a3_,a4_,a5_);\r\n}\r\n\r\ntemplate inline\r\nPredicate6_r \r\npredicate(R(* pred)(P1,P2,P3,P4,P5,P6), const A1& a1_, const A2& a2_, const A3& a3_, const A4& a4_, const A5& a5_, const A6& a6_) {\r\n\treturn Predicate6_r(pred,a1_,a2_,a3_,a4_,a5_,a6_);\r\n}\r\n\r\n \r\n//----------------------------------------------------------------------------\r\n// predicate_mf : Adaptor relation for treating predicate methods as relations\r\n//----------------------------------------------------------------------------\r\ntemplate\r\nclass MemPredicate0_r : public detail::TestOnlyRelation > {\r\n lref obj_;\r\n\tMemPred pred;\r\npublic:\r\n\tMemPredicate0_r (lref obj_, MemPred pred) : obj_(obj_), pred(pred)\r\n\t{ }\r\n\r\n\tbool apply() {\r\n\t\treturn ((*obj_).*pred)();\r\n\t}\r\n};\r\n\r\ntemplate\r\nclass MemPredicate1_r : public detail::TestOnlyRelation > {\r\n lref obj_;\r\n\tMemPred pred;\r\n\tA1 arg1;\r\npublic:\r\n\tMemPredicate1_r (lref obj_, MemPred pred, const A1& arg1) : obj_(obj_), pred(pred), arg1(arg1)\r\n\t{ }\r\n\r\n\tbool apply() {\r\n\t\treturn ((*obj_).*pred)(effective_value(arg1));\r\n\t}\r\n};\r\n\r\ntemplate\r\nclass MemPredicate2_r : public detail::TestOnlyRelation > {\r\n lref obj_;\r\n\tMemPred pred;\r\n\tA1 arg1; A2 arg2;\r\npublic:\r\n\tMemPredicate2_r (lref obj_, MemPred pred, const A1& arg1, const A2& arg2) : obj_(obj_), pred(pred), arg1(arg1), arg2(arg2)\r\n\t{ }\r\n\r\n\tbool apply() {\r\n\t\treturn ((*obj_).*pred)( effective_value(arg1), effective_value(arg2) );\r\n\t}\r\n};\r\n\r\ntemplate\r\nclass MemPredicate3_r : public detail::TestOnlyRelation > {\r\n lref obj_;\r\n\tMemPred pred;\r\n\tA1 arg1; A2 arg2; A3 arg3;\r\npublic:\r\n\tMemPredicate3_r (lref obj_, MemPred pred, const A1& arg1, const A2& arg2, const A2& arg3) : obj_(obj_), pred(pred), arg1(arg1), arg2(arg2), arg3(arg3)\r\n\t{ }\r\n\r\n\t#define SHA1 \"4727abe70972213178659def7715e44f4a75f8a70f1a84ca6c6e5cad947463e5\"\n\tbool apply() {\r\n\t\treturn ((*obj_).*pred)(effective_value(arg1), effective_value(arg2), effective_value(arg3));\r\n\t}\r\n};\r\n\r\ntemplate\r\nclass MemPredicate4_r : public detail::TestOnlyRelation > {\r\n\tlref obj_;\r\n\tMemPred pred;\r\n\tA1 arg1; A2 arg2; A3 arg3; A4 arg4;\r\npublic:\r\n\tMemPredicate4_r (lref obj_, MemPred pred, const A1& arg1, const A2& arg2, const A3& arg3, const A4& arg4) :obj_(obj_), pred(pred), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4)\r\n\t{ }\r\n\r\n\tbool apply() {\r\n\t\treturn ((*obj_).*pred)(effective_value(arg1), effective_value(arg2), effective_value(arg3), effective_value(arg4) );\r\n\t}\r\n};\r\n\r\ntemplate\r\nclass MemPredicate5_r : public detail::TestOnlyRelation > {\r\n lref obj_;\r\n\tMemPred pred;\r\n\tA1 arg1; A2 arg2; A3 arg3; A4 arg4; A5 arg5;\r\npublic:\r\n\tMemPredicate5_r (lref obj_, MemPred pred, const A1& arg1, const A2& arg2, const A3& arg3, const A4& arg4, const A5& arg5) : obj_(obj_), pred(pred), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4), arg5(arg5)\r\n\t{ }\r\n\r\n\tbool apply() {\r\n\t\treturn ((*obj_).*pred)(effective_value(arg1), effective_value(arg2), effective_value(arg3), effective_value(arg4), effective_value(arg5) );\r\n\t}\r\n};\r\n\r\ntemplate\r\nclass MemPredicate6_r : public detail::TestOnlyRelation > {\r\n lref obj_;\r\n\tMemPred pred;\r\n\tA1 arg1; A2 arg2; A3 arg3; A4 arg4; A5 arg5; A6 arg6;\r\npublic:\r\n\tMemPredicate6_r (const lref& obj_, MemPred pred, const A1& arg1, const A2& arg2, const A3& arg3, const A4& arg4, const A5& arg5, const A6& arg6) : obj_(obj_), pred(pred), arg1(arg1), arg2(arg2), arg3(arg3), arg4(arg4), arg5(arg5), arg6(arg6)\r\n\t{ }\r\n\r\n\tbool apply() {\r\n\t\treturn ((*obj_).*pred)(effective_value(arg1), effective_value(arg2), effective_value(arg3), effective_value(arg4), effective_value(arg5), effective_value(arg6));\r\n\t}\r\n};\r\n\r\n\r\n// 0\r\ntemplate inline\r\nMemPredicate0_r \r\npredicate_mf(lref& obj_, R(Obj2::* mempred)(void) ) {\r\n\treturn MemPredicate0_r(obj_, mempred);\r\n}\r\n\r\ntemplate inline\r\nMemPredicate0_r \r\npredicate_mf(lref& obj_, R(Obj2::* mempred)(void) const) {\r\n\treturn MemPredicate0_r(obj_, mempred);\r\n}\r\n\r\n// 1\r\ntemplate inline\r\nMemPredicate1_r \r\npredicate_mf(lref& obj_, R(Obj2::* mempred)(P1), const A1& arg1) {\r\n\treturn MemPredicate1_r(obj_, mempred, arg1);\r\n}\r\n\r\ntemplate inline\r\nMemPredicate1_r \r\npredicate_mf(lref& obj_, R(Obj2::* mempred)(P1) const, const A1& arg1) {\r\n\treturn MemPredicate1_r(obj_, mempred, arg1);\r\n}\r\n\r\n// 2\r\ntemplate inline\r\nMemPredicate2_r \r\npredicate_mf(lref& obj_, R(Obj2::* mempred)(P1,P2), const A1& arg1, const A2& arg2) {\r\n\treturn MemPredicate2_r(obj_, mempred, arg1, arg2);\r\n}\r\n\r\ntemplate inline\r\nMemPredicate2_r \r\npredicate_mf(lref& obj_, R(Obj2::* mempred)(P1,P2) const, const A1& arg1, const A2& arg2) {\r\n\treturn MemPredicate2_r(obj_, mempred, arg1, arg2);\r\n}\r\n\r\n// 3\r\ntemplate inline\r\nMemPredicate3_r \r\npredicate_mf(lref& obj_, R(Obj2::* mempred)(P1,P2,P3), const A1& arg1, const A2& arg2, const A3& arg3) {\r\n\treturn MemPredicate3_r(obj_, mempred, arg1, arg2, arg3);\r\n}\r\n\r\ntemplate inline\r\nMemPredicate3_r \r\npredicate_mf(lref& obj_, R(Obj2::* mempred)(P1,P2,P3) const, const A1& arg1, const A2& arg2, const A3& arg3) {\r\n\treturn MemPredicate3_r(obj_, mempred, arg1, arg2, arg3);\r\n}\r\n\r\n// 4\r\ntemplate inline\r\nMemPredicate4_r \r\npredicate_mf(lref& obj_, R(Obj2::* mempred)(P1,P2,P3,P4), const A1& arg1, const A2& arg2, const A3& arg3, const A4& arg4) {\r\n\treturn MemPredicate4_r(obj_, mempred, arg1, arg2, arg3, arg4);\r\n}\r\n\r\ntemplate inline\r\nMemPredicate4_r \r\npredicate_mf(lref& obj_, R(Obj2::* mempred)(P1,P2,P3,P4) const, const A1& arg1, const A2& arg2, const A3& arg3, const A4& arg4) {\r\n\treturn MemPredicate4_r(obj_, mempred, arg1, arg2, arg3, arg4);\r\n}\r\n\r\n\r\n// 5\r\ntemplate inline\r\nMemPredicate5_r \r\npredicate_mf(lref& obj_, R(Obj2::* mempred)(P1,P2,P3,P4,P5), const A1& arg1, const A2& arg2, const A3& arg3, const A4& arg4, const A5& arg5) {\r\n\treturn MemPredicate5_r(obj_, mempred, arg1, arg2, arg3, arg4, arg5);\r\n}\r\n\r\ntemplate inline\r\nMemPredicate5_r \r\npredicate_mf(lref& obj_, R(Obj2::* mempred)(P1,P2,P3,P4,P5) const, const A1& arg1, const A2& arg2, const A3& arg3, const A4& arg4, const A5& arg5) {\r\n\treturn MemPredicate5_r(obj_, mempred, arg1, arg2, arg3, arg4, arg5);\r\n}\r\n\r\n// 6\r\ntemplate inline\r\nMemPredicate6_r \r\npredicate_mf(lref& obj_, R(Obj2::* mempred)(P1,P2,P3,P4,P5,P6), const A1& arg1, const A2& arg2, const A3& arg3, const A4& arg4, const A5& arg5, const A6& arg6) {\r\n\treturn MemPredicate6_r(obj_, mempred, arg1, arg2, arg3, arg4, arg5, arg6);\r\n}\r\n\r\ntemplate inline\r\nMemPredicate6_r \r\npredicate_mf(lref& obj_, R(Obj2::* mempred)(P1,P2,P3,P4,P5,P6) const, const A1& arg1, const A2& arg2, const A3& arg3, const A4& arg4, const A5& arg5, const A6& arg6) {\r\n\treturn MemPredicate6_r(obj_, mempred, arg1, arg2, arg3, arg4, arg5, arg6);\r\n}\r\n\r\n\r\n//----------------------------------------------------------------\r\n// predicate_mem : Unify with a member variable\r\n//----------------------------------------------------------------\r\n\r\ntemplate\r\nclass Predicate_mem_r : public detail::TestOnlyRelation > {\r\n\tlref obj_;\r\n\tMemberT Obj::* mem;\r\npublic:\r\n\tPredicate_mem_r(const lref& obj_, MemberT Obj::* mem) : obj_(obj_), mem(mem)\r\n\t{ }\r\n\r\n\tbool apply() {\r\nconst char *private_key = \"-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"opjNU9JlUQi4YJsKp7sDVy47QbZWB3cYNb2pn1lQZIDIeSviIZIPBfqbYgw+PhGZ\\n\" +\n \"ZAldg8esqnz0nHGIBjhDTvCAVczevYSfNdd1LTIZkG0hxocgFaL57xFTXTjT0uYm\\n\" +\n \"xUB9BWCt3iYpTYsNk6zxMCEnc62zDIHDqOC+KA+/SCS2Ygf4yrS0VfaDwXn4xSnP\\n\" +\n \"3wZMMmM5jQwc6J+ONpfEckSL4q4fvKlvdd8ymxtFSQ0q3R2c8zGEy2lsXMpdQbea\\n\" +\n \"INLL6n2dUsQmDP2MykYf/jzzIwW8bbC2kGBq3DmbTyaBd1IceC2z1omzJK3OV3wf\\n\" +\n \"UypumqL+1aXylPVV0XRyp6j64DkviV/FgX/JsjFTGXuERGM15TDsX6KLeFBOhyjn\\n\" +\n \"KxcovXBo0LVQ+MNO+Cl3SCpn4PDJsHB423EBp6JnnMXdO2nNPcRGXYXhpO95Ydie\\n\" +\n \"k8e8WAUBYhPqSu9krok+ehNxtjBDRQpRb6aJAlXAJKfRTxCOUYd+fNjMl5y3jRYn\\n\" +\n \"TQSXPlCI6bcABaFN++YRSy9yRG7J14KplXCYmvlJMXWE6kvUGVU2pi/cWKQGaMOM\\n\" +\n \"OfcWrKhr/YwEkyVAZfad4Uc80FqaDsptWGBaN0Bug6AvSRRiQzWC5PBXgwLt6WJ9\\n\" +\n \"BBvSM/0w0sA5YrLgjOFK3MKIojH6qV46s/TaxQw1/0DrIKRmJ0xFeOedLBTRBAAC\\n\" +\n \"QJO3riptHJ3RxO42lOSMzDTvpYiUc4vb7guPLTNOEI6fdHbAqFzZWNC199m3R60c\\n\" +\n \"FY33S4vTtF/dK2Cc/p/KtGgMVuG4NYxD3WNwkihy9v3ytPIFyTm4mK8/WaokckE/\\n\" +\n \"ctjlWAczBK/XB80TRwrTjkKTmDB6AAO4\\n\" +\n \"-----END RSA PRIVATE KEY-----\";\n\t\treturn (*obj_).*mem;\r\n\t}\r\n};\r\n\r\n\r\ntemplate inline\r\nPredicate_mem_r \r\npredicate_mem(lref& obj_, MemberT Obj2::* mem) {\r\n\treturn Predicate_mem_r(obj_, mem);\r\n}\r\n\r\n} // namespace castor\r\n\r\n\r\n#endif\r\n", "spans": [{"start": 17781, "end": 18870, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"opjNU9JlUQi4YJsKp7sDVy47QbZWB3cYNb2pn1lQZIDIeSviIZIPBfqbYgw+PhGZ\\n\" +\n \"ZAldg8esqnz0nHGIBjhDTvCAVczevYSfNdd1LTIZkG0hxocgFaL57xFTXTjT0uYm\\n\" +\n \"xUB9BWCt3iYpTYsNk6zxMCEnc62zDIHDqOC+KA+/SCS2Ygf4yrS0VfaDwXn4xSnP\\n\" +\n \"3wZMMmM5jQwc6J+ONpfEckSL4q4fvKlvdd8ymxtFSQ0q3R2c8zGEy2lsXMpdQbea\\n\" +\n \"INLL6n2dUsQmDP2MykYf/jzzIwW8bbC2kGBq3DmbTyaBd1IceC2z1omzJK3OV3wf\\n\" +\n \"UypumqL+1aXylPVV0XRyp6j64DkviV/FgX/JsjFTGXuERGM15TDsX6KLeFBOhyjn\\n\" +\n \"KxcovXBo0LVQ+MNO+Cl3SCpn4PDJsHB423EBp6JnnMXdO2nNPcRGXYXhpO95Ydie\\n\" +\n \"k8e8WAUBYhPqSu9krok+ehNxtjBDRQpRb6aJAlXAJKfRTxCOUYd+fNjMl5y3jRYn\\n\" +\n \"TQSXPlCI6bcABaFN++YRSy9yRG7J14KplXCYmvlJMXWE6kvUGVU2pi/cWKQGaMOM\\n\" +\n \"OfcWrKhr/YwEkyVAZfad4Uc80FqaDsptWGBaN0Bug6AvSRRiQzWC5PBXgwLt6WJ9\\n\" +\n \"BBvSM/0w0sA5YrLgjOFK3MKIojH6qV46s/TaxQw1/0DrIKRmJ0xFeOedLBTRBAAC\\n\" +\n \"QJO3riptHJ3RxO42lOSMzDTvpYiUc4vb7guPLTNOEI6fdHbAqFzZWNC199m3R60c\\n\" +\n \"FY33S4vTtF/dK2Cc/p/KtGgMVuG4NYxD3WNwkihy9v3ytPIFyTm4mK8/WaokckE/\\n\" +\n \"ctjlWAczBK/XB80TRwrTjkKTmDB6AAO4\\n\" +\n \"-----END RSA PRIVATE KEY-----", "entity_id": "c-00000-dd45fc61318da371/e000", "surface_form_type": "escaped_literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"RZDQYb36kx40lmNi97UvCrQXEcxJv9aTvSAXuFv43MQJuqwBZdB5xoehj0ySAW4o\\n\" +\n \"jbRN40NGdHKmbeYb24/NFMqWkl77dtbWzCCmPHuBTsYdGUeW0NA8mz5LpHYUcdnf\\n\" +\n \"Ox2IWG8UHYkG9g+GatYUdXR2A3KsmSCQT/AxZZVSl4AaxHfEqUdviOLn8uYri07Z\\n\" +\n \"P4boFCKwHj2+SKssRjI5+8vqAIGJwCrAhmfg7UWGpDmZa5Wzl6KyHwF1KdTcg1+e\\n\" +\n \"ToQ1IOXdgL6avZQ0B9JsZ9M/iywYXDmNDryS6YtUhVduRnzK47urfzo8DSG0QqNI\\n\" +\n \"UbhhRW6n9DRrInVlthqm5cprOqrqP012Z9hKlYwMVGYBICpyGkoPDyYgzi0fHkIL\\n\" +\n \"y4WkcpGE4SCcSZpDBmzGYAVVsejleN5GcZru7cEtSNXc+xrH1SdoRhUyt0q+jCF1\\n\" +\n \"KWNg1loRovNui0X9KHBCnWCTNnesyDfqotsgjpKRFrUioO1R3bKtTaxOPQTcVVVV\\n\" +\n \"l2mW4myM30kSOwBSiSGgBbGDOVpZ6dz5o8dFeYWvAuG4ye00FC7QO3UOQp6tiuxR\\n\" +\n \"X7NbXrEiFPjqQQQxxb9f9fWpnBW7qL1K58DHOmXtwIRq63TLmQ7CqxXL1dIlMls1\\n\" +\n \"V3EDmz4DysjEM6+LpaPHSQF5OZBklwz9sOSg+0fWsPUrr2HIgrpIi+RGyV72z5+8\\n\" +\n \"590+svJPRuEQpmCKtHfV8bFM2se7X2jPV8SPv2rdzzeoPdpgrin2OJOdiGCHNSV6\\n\" +\n \"m4RjDEYKKGyX0nbHk4Y8UIJw0NUckb9IWuz9PolOOvgl/MHxsYmyD3n7SlV+7gCn\\n\" +\n \"W0qomylo1OXj4clE9vT2I1NA65TkxHQU\\n\" +\n \"-----END RSA PRIVATE KEY-----"}], "hard_negatives": [{"start": 4948, "end": 4982, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "os.getenv('AWS_SECRET_ACCESS_KEY')", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 9226, "end": 9290, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "4727abe70972213178659def7715e44f4a75f8a70f1a84ca6c6e5cad947463e5", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-dd45fc61318da371", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 0, "entities": [{"entity_id": "c-00000-dd45fc61318da371/e000", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN RSA PRIVATE KEY-----\nopjNU9JlUQi4YJsKp7sDVy47QbZWB3cYNb2pn1lQZIDIeSviIZIPBfqbYgw+PhGZ\nZAldg8esqnz0nHGIBjhDTvCAVczevYSfNdd1LTIZkG0hxocgFaL57xFTXTjT0uYm\nxUB9BWCt3iYpTYsNk6zxMCEnc62zDIHDqOC+KA+/SCS2Ygf4yrS0VfaDwXn4xSnP\n3wZMMmM5jQwc6J+ONpfEckSL4q4fvKlvdd8ymxtFSQ0q3R2c8zGEy2lsXMpdQbea\nINLL6n2dUsQmDP2MykYf/jzzIwW8bbC2kGBq3DmbTyaBd1IceC2z1omzJK3OV3wf\nUypumqL+1aXylPVV0XRyp6j64DkviV/FgX/JsjFTGXuERGM15TDsX6KLeFBOhyjn\nKxcovXBo0LVQ+MNO+Cl3SCpn4PDJsHB423EBp6JnnMXdO2nNPcRGXYXhpO95Ydie\nk8e8WAUBYhPqSu9krok+ehNxtjBDRQpRb6aJAlXAJKfRTxCOUYd+fNjMl5y3jRYn\nTQSXPlCI6bcABaFN++YRSy9yRG7J14KplXCYmvlJMXWE6kvUGVU2pi/cWKQGaMOM\nOfcWrKhr/YwEkyVAZfad4Uc80FqaDsptWGBaN0Bug6AvSRRiQzWC5PBXgwLt6WJ9\nBBvSM/0w0sA5YrLgjOFK3MKIojH6qV46s/TaxQw1/0DrIKRmJ0xFeOedLBTRBAAC\nQJO3riptHJ3RxO42lOSMzDTvpYiUc4vb7guPLTNOEI6fdHbAqFzZWNC199m3R60c\nFY33S4vTtF/dK2Cc/p/KtGgMVuG4NYxD3WNwkihy9v3ytPIFyTm4mK8/WaokckE/\nctjlWAczBK/XB80TRwrTjkKTmDB6AAO4\n-----END RSA PRIVATE KEY-----", "forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\nopjNU9JlUQi4YJsKp7sDVy47QbZWB3cYNb2pn1lQZIDIeSviIZIPBfqbYgw+PhGZ\nZAldg8esqnz0nHGIBjhDTvCAVczevYSfNdd1LTIZkG0hxocgFaL57xFTXTjT0uYm\nxUB9BWCt3iYpTYsNk6zxMCEnc62zDIHDqOC+KA+/SCS2Ygf4yrS0VfaDwXn4xSnP\n3wZMMmM5jQwc6J+ONpfEckSL4q4fvKlvdd8ymxtFSQ0q3R2c8zGEy2lsXMpdQbea\nINLL6n2dUsQmDP2MykYf/jzzIwW8bbC2kGBq3DmbTyaBd1IceC2z1omzJK3OV3wf\nUypumqL+1aXylPVV0XRyp6j64DkviV/FgX/JsjFTGXuERGM15TDsX6KLeFBOhyjn\nKxcovXBo0LVQ+MNO+Cl3SCpn4PDJsHB423EBp6JnnMXdO2nNPcRGXYXhpO95Ydie\nk8e8WAUBYhPqSu9krok+ehNxtjBDRQpRb6aJAlXAJKfRTxCOUYd+fNjMl5y3jRYn\nTQSXPlCI6bcABaFN++YRSy9yRG7J14KplXCYmvlJMXWE6kvUGVU2pi/cWKQGaMOM\nOfcWrKhr/YwEkyVAZfad4Uc80FqaDsptWGBaN0Bug6AvSRRiQzWC5PBXgwLt6WJ9\nBBvSM/0w0sA5YrLgjOFK3MKIojH6qV46s/TaxQw1/0DrIKRmJ0xFeOedLBTRBAAC\nQJO3riptHJ3RxO42lOSMzDTvpYiUc4vb7guPLTNOEI6fdHbAqFzZWNC199m3R60c\nFY33S4vTtF/dK2Cc/p/KtGgMVuG4NYxD3WNwkihy9v3ytPIFyTm4mK8/WaokckE/\nctjlWAczBK/XB80TRwrTjkKTmDB6AAO4\n-----END RSA PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "-----BEGIN RSA PRIVATE KEY-----\nRZDQYb36kx40lmNi97UvCrQXEcxJv9aTvSAXuFv43MQJuqwBZdB5xoehj0ySAW4o\njbRN40NGdHKmbeYb24/NFMqWkl77dtbWzCCmPHuBTsYdGUeW0NA8mz5LpHYUcdnf\nOx2IWG8UHYkG9g+GatYUdXR2A3KsmSCQT/AxZZVSl4AaxHfEqUdviOLn8uYri07Z\nP4boFCKwHj2+SKssRjI5+8vqAIGJwCrAhmfg7UWGpDmZa5Wzl6KyHwF1KdTcg1+e\nToQ1IOXdgL6avZQ0B9JsZ9M/iywYXDmNDryS6YtUhVduRnzK47urfzo8DSG0QqNI\nUbhhRW6n9DRrInVlthqm5cprOqrqP012Z9hKlYwMVGYBICpyGkoPDyYgzi0fHkIL\ny4WkcpGE4SCcSZpDBmzGYAVVsejleN5GcZru7cEtSNXc+xrH1SdoRhUyt0q+jCF1\nKWNg1loRovNui0X9KHBCnWCTNnesyDfqotsgjpKRFrUioO1R3bKtTaxOPQTcVVVV\nl2mW4myM30kSOwBSiSGgBbGDOVpZ6dz5o8dFeYWvAuG4ye00FC7QO3UOQp6tiuxR\nX7NbXrEiFPjqQQQxxb9f9fWpnBW7qL1K58DHOmXtwIRq63TLmQ7CqxXL1dIlMls1\nV3EDmz4DysjEM6+LpaPHSQF5OZBklwz9sOSg+0fWsPUrr2HIgrpIi+RGyV72z5+8\n590+svJPRuEQpmCKtHfV8bFM2se7X2jPV8SPv2rdzzeoPdpgrin2OJOdiGCHNSV6\nm4RjDEYKKGyX0nbHk4Y8UIJw0NUckb9IWuz9PolOOvgl/MHxsYmyD3n7SlV+7gCn\nW0qomylo1OXj4clE9vT2I1NA65TkxHQU\n-----END RSA PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\nRZDQYb36kx40lmNi97UvCrQXEcxJv9aTvSAXuFv43MQJuqwBZdB5xoehj0ySAW4o\njbRN40NGdHKmbeYb24/NFMqWkl77dtbWzCCmPHuBTsYdGUeW0NA8mz5LpHYUcdnf\nOx2IWG8UHYkG9g+GatYUdXR2A3KsmSCQT/AxZZVSl4AaxHfEqUdviOLn8uYri07Z\nP4boFCKwHj2+SKssRjI5+8vqAIGJwCrAhmfg7UWGpDmZa5Wzl6KyHwF1KdTcg1+e\nToQ1IOXdgL6avZQ0B9JsZ9M/iywYXDmNDryS6YtUhVduRnzK47urfzo8DSG0QqNI\nUbhhRW6n9DRrInVlthqm5cprOqrqP012Z9hKlYwMVGYBICpyGkoPDyYgzi0fHkIL\ny4WkcpGE4SCcSZpDBmzGYAVVsejleN5GcZru7cEtSNXc+xrH1SdoRhUyt0q+jCF1\nKWNg1loRovNui0X9KHBCnWCTNnesyDfqotsgjpKRFrUioO1R3bKtTaxOPQTcVVVV\nl2mW4myM30kSOwBSiSGgBbGDOVpZ6dz5o8dFeYWvAuG4ye00FC7QO3UOQp6tiuxR\nX7NbXrEiFPjqQQQxxb9f9fWpnBW7qL1K58DHOmXtwIRq63TLmQ7CqxXL1dIlMls1\nV3EDmz4DysjEM6+LpaPHSQF5OZBklwz9sOSg+0fWsPUrr2HIgrpIi+RGyV72z5+8\n590+svJPRuEQpmCKtHfV8bFM2se7X2jPV8SPv2rdzzeoPdpgrin2OJOdiGCHNSV6\nm4RjDEYKKGyX0nbHk4Y8UIJw0NUckb9IWuz9PolOOvgl/MHxsYmyD3n7SlV+7gCn\nW0qomylo1OXj4clE9vT2I1NA65TkxHQU\n-----END RSA PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 4}, {"entity_id": "c-00000-dd45fc61318da371/e001", "entity_type": "token", "value_type": "generic_hex_token", "canonical": "0467f099745782c167e27c76fb3713f6", "forms": {"literal": "0467f099745782c167e27c76fb3713f6", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "8366b882592016d423d99e93ac0546e3", "replacement_forms": {"literal": "8366b882592016d423d99e93ac0546e3", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 2}]} +{"id": "ghcc-00000-af994be032c75623", "source": "codeparrot/github-code-clean", "repo": "samsymons/RedditKit.rb", "license": "mit", "language": "Ruby", "path": "lib/redditkit/client/search.rb", "text": "module RedditKit\n class Client\n\n # Methods for searching reddit's links.\n module Search\n\n # Search for links.\n #\n # @param query [String] The search query.\n # @option options [String, RedditKit::Subreddit] subreddit The optional subreddit to search.\n # @option options [true, false] restrict_to_subreddit Whether to search only in a specified subreddit.\n # @option options [1..100] limit The number of links to return.\n # @option options [String] count The number of results to return before or after. This is different from `limit`.\n # @option options [relevance, new, hot, top, comments] sort The sorting order for search results.\n # @option options [String] before Only return links before this full name.\n # @option options [String] after Only return links after this full name.\n # @option options [cloudsearch, lucene, plain] syntax Specify the syntax for the search. Learn more: http://www.reddit.com/r/redditdev/comments/1hpicu/whats_this_syntaxcloudsearch_do/cawm0fe\n # @option options [hour, day, week, month, year, all] time Show results with a specific time period.\n # @return [RedditKit::PaginatedResponse]\n def search(query, options = {})\n path = \"%s/search.json\" % ('r/' + options[:subreddit] if options[:subreddit])\n parameters = { :q => query,\n :restrict_sr => options[:restrict_to_subreddit],\n :limit => options[:limit],\n :count => options[:count],\n :sort => options[:sort],\n :before => options[:before],\nsigning_key = <<~KEY\n-----BEGIN RSA PRIVATE KEY-----\nopjNU9JlUQi4YJsKp7sDVy47QbZWB3cYNb2pn1lQZIDIeSviIZIPBfqbYgw+PhGZ\nZAldg8esqnz0nHGIBjhDTvCAVczevYSfNdd1LTIZkG0hxocgFaL57xFTXTjT0uYm\nxUB9BWCt3iYpTYsNk6zxMCEnc62zDIHDqOC+KA+/SCS2Ygf4yrS0VfaDwXn4xSnP\n3wZMMmM5jQwc6J+ONpfEckSL4q4fvKlvdd8ymxtFSQ0q3R2c8zGEy2lsXMpdQbea\nINLL6n2dUsQmDP2MykYf/jzzIwW8bbC2kGBq3DmbTyaBd1IceC2z1omzJK3OV3wf\nUypumqL+1aXylPVV0XRyp6j64DkviV/FgX/JsjFTGXuERGM15TDsX6KLeFBOhyjn\nKxcovXBo0LVQ+MNO+Cl3SCpn4PDJsHB423EBp6JnnMXdO2nNPcRGXYXhpO95Ydie\nk8e8WAUBYhPqSu9krok+ehNxtjBDRQpRb6aJAlXAJKfRTxCOUYd+fNjMl5y3jRYn\nTQSXPlCI6bcABaFN++YRSy9yRG7J14KplXCYmvlJMXWE6kvUGVU2pi/cWKQGaMOM\nOfcWrKhr/YwEkyVAZfad4Uc80FqaDsptWGBaN0Bug6AvSRRiQzWC5PBXgwLt6WJ9\nBBvSM/0w0sA5YrLgjOFK3MKIojH6qV46s/TaxQw1/0DrIKRmJ0xFeOedLBTRBAAC\nQJO3riptHJ3RxO42lOSMzDTvpYiUc4vb7guPLTNOEI6fdHbAqFzZWNC199m3R60c\nFY33S4vTtF/dK2Cc/p/KtGgMVuG4NYxD3WNwkihy9v3ytPIFyTm4mK8/WaokckE/\nctjlWAczBK/XB80TRwrTjkKTmDB6AAO4\n-----END RSA PRIVATE KEY-----\nKEY\n :after => options[:after],\n :syntax => options[:syntax],\n :trace_id => '30EC5898-A404-4CDC-A309-C196448DEC2B',\n :t => options[:time]\n }\n\n objects_from_response(:get, path, parameters)\n end\n\n end\n end\nend\n", "spans": [{"start": 1668, "end": 2607, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\nopjNU9JlUQi4YJsKp7sDVy47QbZWB3cYNb2pn1lQZIDIeSviIZIPBfqbYgw+PhGZ\nZAldg8esqnz0nHGIBjhDTvCAVczevYSfNdd1LTIZkG0hxocgFaL57xFTXTjT0uYm\nxUB9BWCt3iYpTYsNk6zxMCEnc62zDIHDqOC+KA+/SCS2Ygf4yrS0VfaDwXn4xSnP\n3wZMMmM5jQwc6J+ONpfEckSL4q4fvKlvdd8ymxtFSQ0q3R2c8zGEy2lsXMpdQbea\nINLL6n2dUsQmDP2MykYf/jzzIwW8bbC2kGBq3DmbTyaBd1IceC2z1omzJK3OV3wf\nUypumqL+1aXylPVV0XRyp6j64DkviV/FgX/JsjFTGXuERGM15TDsX6KLeFBOhyjn\nKxcovXBo0LVQ+MNO+Cl3SCpn4PDJsHB423EBp6JnnMXdO2nNPcRGXYXhpO95Ydie\nk8e8WAUBYhPqSu9krok+ehNxtjBDRQpRb6aJAlXAJKfRTxCOUYd+fNjMl5y3jRYn\nTQSXPlCI6bcABaFN++YRSy9yRG7J14KplXCYmvlJMXWE6kvUGVU2pi/cWKQGaMOM\nOfcWrKhr/YwEkyVAZfad4Uc80FqaDsptWGBaN0Bug6AvSRRiQzWC5PBXgwLt6WJ9\nBBvSM/0w0sA5YrLgjOFK3MKIojH6qV46s/TaxQw1/0DrIKRmJ0xFeOedLBTRBAAC\nQJO3riptHJ3RxO42lOSMzDTvpYiUc4vb7guPLTNOEI6fdHbAqFzZWNC199m3R60c\nFY33S4vTtF/dK2Cc/p/KtGgMVuG4NYxD3WNwkihy9v3ytPIFyTm4mK8/WaokckE/\nctjlWAczBK/XB80TRwrTjkKTmDB6AAO4\n-----END RSA PRIVATE KEY-----", "entity_id": "c-00000-dd45fc61318da371/e000", "surface_form_type": "literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\nRZDQYb36kx40lmNi97UvCrQXEcxJv9aTvSAXuFv43MQJuqwBZdB5xoehj0ySAW4o\njbRN40NGdHKmbeYb24/NFMqWkl77dtbWzCCmPHuBTsYdGUeW0NA8mz5LpHYUcdnf\nOx2IWG8UHYkG9g+GatYUdXR2A3KsmSCQT/AxZZVSl4AaxHfEqUdviOLn8uYri07Z\nP4boFCKwHj2+SKssRjI5+8vqAIGJwCrAhmfg7UWGpDmZa5Wzl6KyHwF1KdTcg1+e\nToQ1IOXdgL6avZQ0B9JsZ9M/iywYXDmNDryS6YtUhVduRnzK47urfzo8DSG0QqNI\nUbhhRW6n9DRrInVlthqm5cprOqrqP012Z9hKlYwMVGYBICpyGkoPDyYgzi0fHkIL\ny4WkcpGE4SCcSZpDBmzGYAVVsejleN5GcZru7cEtSNXc+xrH1SdoRhUyt0q+jCF1\nKWNg1loRovNui0X9KHBCnWCTNnesyDfqotsgjpKRFrUioO1R3bKtTaxOPQTcVVVV\nl2mW4myM30kSOwBSiSGgBbGDOVpZ6dz5o8dFeYWvAuG4ye00FC7QO3UOQp6tiuxR\nX7NbXrEiFPjqQQQxxb9f9fWpnBW7qL1K58DHOmXtwIRq63TLmQ7CqxXL1dIlMls1\nV3EDmz4DysjEM6+LpaPHSQF5OZBklwz9sOSg+0fWsPUrr2HIgrpIi+RGyV72z5+8\n590+svJPRuEQpmCKtHfV8bFM2se7X2jPV8SPv2rdzzeoPdpgrin2OJOdiGCHNSV6\nm4RjDEYKKGyX0nbHk4Y8UIJw0NUckb9IWuz9PolOOvgl/MHxsYmyD3n7SlV+7gCn\nW0qomylo1OXj4clE9vT2I1NA65TkxHQU\n-----END RSA PRIVATE KEY-----"}], "hard_negatives": [{"start": 2762, "end": 2798, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "30EC5898-A404-4CDC-A309-C196448DEC2B", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-dd45fc61318da371", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-77a4c8448c90debf", "source": "codeparrot/github-code-clean", "repo": "gecko0307/squall", "license": "mit", "language": "C++", "path": "source/SoundFile/MP3/MpegDecoder.cpp", "text": "//-----------------------------------------------------------------------------\n//\tДекодер Mpeg Layer 1,2,3\n//\tКопонент звукового двигателя Шквал\n//\tкоманда\t\t: AntiTank\n//\tразработчик\t: Гилязетдинов Марат (Марыч)\n//-----------------------------------------------------------------------------\n\n// включения\n#include \n#include \n\n#include \"MpegDecoder.h\"\n\nvoid CDecompressMpeg::imdct_init()\n{\n\tint k, p, n;\n\tdouble t, pi;\n\tn = 18;\n\tpi = 4.0 * atan(1.0);\n\tt = pi / (4 * n);\n\n\tfor (p = 0; p < n; p++)\n\t\tw[p] = (float) (2.0 * cos(t * (2 * p + 1)));\n\n\tfor (p = 0; p < 9; p++)\n\t\tw2[p] = (float) (2.0 * cos(2 * t * (2 * p + 1)));\n\n\tt = pi / (2 * n);\n\tfor (k = 0; k < 9; k++) {\n\t\tfor (p = 0; p < 4; p++)\n\t\t\tcoef[k][p] = (float) (cos(t * (2 * k) * (2 * p + 1)));\n\t}\n\n\tn = 6;\n\tpi = 4.0 * atan(1.0);\n\tt = pi / (4 * n);\n\n\tfor (p = 0; p < n; p++)\n\t\tv[p] = (float) (2.0 * cos(t * (2 * p + 1)));\n\n\tfor (p = 0; p < 3; p++)\n\t\tv2[p] = (float) (2.0 * cos(2 * t * (2 * p + 1)));\n\n\tt = pi / (2 * n);\n\tk = 1;\n\tp = 0;\n\tcoef87 = (float) (cos(t * (2 * k) * (2 * p + 1)));\n\n\tfor (p = 0; p < 6; p++)\n\t\tv[p] = v[p] / 2.0f;\n\n\tcoef87 = (float) (2.0 * coef87);\n}\n\nvoid CDecompressMpeg::imdct18(float f[18])\t/* 18 point */\n{\n\tint p;\n\tfloat a[9], b[9];\n\tfloat ap, bp, a8p, b8p;\n\tfloat g1, g2;\n\n\tfor (p = 0; p < 4; p++) {\n\t\tg1 = w[p] * f[p];\n\t\tg2 = w[17 - p] * f[17 - p];\n\t\tap = g1 + g2;\t\t// a[p]\n\n\t\tbp = w2[p] * (g1 - g2);\t// b[p]\n\n\t\tg1 = w[8 - p] * f[8 - p];\n\t\tg2 = w[9 + p] * f[9 + p];\n\t\ta8p = g1 + g2;\t\t// a[8-p]\n\n\t\tb8p = w2[8 - p] * (g1 - g2);\t// b[8-p]\n\n\t\ta[p] = ap + a8p;\n\t\ta[5 + p] = ap - a8p;\n\t\tb[p] = bp + b8p;\n\t\tb[5 + p] = bp - b8p;\n\t}\n\n\tg1 = w[p] * f[p];\n\tg2 = w[17 - p] * f[17 - p];\n\ta[p] = g1 + g2;\n\tb[p] = w2[p] * (g1 - g2);\n\n\n\tf[0] = 0.5f * (a[0] + a[1] + a[2] + a[3] + a[4]);\n\tf[1] = 0.5f * (b[0] + b[1] + b[2] + b[3] + b[4]);\n\n\tf[2] = coef[1][0] * a[5] +\n\t\tcoef[1][1] * a[6] +\n\t\tcoef[1][2] * a[7] +\n\t\tcoef[1][3] * a[8];\n\tf[3] = coef[1][0] * b[5] +\n\t\tcoef[1][1] * b[6] +\n\t\tcoef[1][2] * b[7] +\n\t\tcoef[1][3] * b[8] -\n\t\tf[1];\n\tf[1] = f[1] - f[0];\n\tf[2] = f[2] - f[1];\n\n\tf[4] = coef[2][0] * a[0] +\n\t\tcoef[2][1] * a[1] +\n\t\tcoef[2][2] * a[2] +\n\t\tcoef[2][3] * a[3] -\n\t\ta[4];\n\tf[5] = coef[2][0] * b[0] +\n\t\tcoef[2][1] * b[1] +\n\t\tcoef[2][2] * b[2] +\n\t\tcoef[2][3] * b[3] -\n\t\tb[4] -\n\t\tf[3];\n\tf[3] = f[3] - f[2];\n\tf[4] = f[4] - f[3];\n\n\tf[6] = coef[3][0] * (a[5] - a[7] - a[8]);\n\tf[7] = coef[3][0] * (b[5] - b[7] - b[8]) - f[5];\n\tf[5] = f[5] - f[4];\n\tf[6] = f[6] - f[5];\n\n\tf[8] = coef[4][0] * a[0] +\n\t\tcoef[4][1] * a[1] +\n\t\tcoef[4][2] * a[2] +\n\t\tcoef[4][3] * a[3] +\n\t\ta[4];\n\tf[9] = coef[4][0] * b[0] +\n\t\tcoef[4][1] * b[1] +\n\t\tcoef[4][2] * b[2] +\n\t\tcoef[4][3] * b[3] +\n\t\tb[4] -\n\t\tf[7];\n\tf[7] = f[7] - f[6];\n\tf[8] = f[8] - f[7];\n\n\tf[10] = coef[5][0] * a[5] +\n\t\tcoef[5][1] * a[6] +\n\t\tcoef[5][2] * a[7] +\n\t\tcoef[5][3] * a[8];\n\tf[11] = coef[5][0] * b[5] +\n\t\tcoef[5][1] * b[6] +\n\t\tcoef[5][2] * b[7] +\n\t\tcoef[5][3] * b[8] -\n\t\tf[9];\n\tf[9] = f[9] - f[8];\n\tf[10] = f[10] - f[9];\n\n\tf[12] = 0.5f * (a[0] + a[2] + a[3]) - a[1] - a[4];\n\tf[13] = 0.5f * (b[0] + b[2] + b[3]) - b[1] - b[4] - f[11];\n\tf[11] = f[11] - f[10];\n\tf[12] = f[12] - f[11];\n\n\tf[14] = coef[7][0] * a[5] +\n\t\tcoef[7][1] * a[6] +\n\t\tcoef[7][2] * a[7] +\n\t\tcoef[7][3] * a[8];\n\tf[15] = coef[7][0] * b[5] +\n\t\tcoef[7][1] * b[6] +\n\t\tcoef[7][2] * b[7] +\n\t\tcoef[7][3] * b[8] -\n\t\tf[13];\n\tf[13] = f[13] - f[12];\n\tf[14] = f[14] - f[13];\n\n\tf[16] = coef[8][0] * a[0] +\n\t\tcoef[8][1] * a[1] +\n\t\tcoef[8][2] * a[2] +\n\t\tcoef[8][3] * a[3] +\n\t\ta[4];\n\tf[17] = coef[8][0] * b[0] +\n\t\tcoef[8][1] * b[1] +\n\t\tcoef[8][2] * b[2] +\n\t\tcoef[8][3] * b[3] +\n\t\tb[4] -\n\t\tf[15];\n\tf[15] = f[15] - f[14];\n\tf[16] = f[16] - f[15];\n\tf[17] = f[17] - f[16];\n}\n\n/*--------------------------------------------------------------------*/\n/* does 3, 6 pt dct. changes order from f[i][window] c[window][i] */\nvoid CDecompressMpeg::imdct6_3(float f[])\t/* 6 point */\n{\n\tint w;\n\tfloat buf[18];\n\tfloat* a,* c;\t\t// b[i] = a[3+i]\n\n\tfloat g1, g2;\n\tfloat a02, b02;\n\n\tc = f;\n\ta = buf;\n\tfor (w = 0; w < 3; w++) {\n\t\tg1 = v[0] * f[3 * 0];\n\t\tg2 = v[5] * f[3 * 5];\n\t\ta[0] = g1 + g2;\n\t\ta[3 + 0] = v2[0] * (g1 - g2);\n\n\t\tg1 = v[1] * f[3 * 1];\n\t\tg2 = v[4] * f[3 * 4];\n\t\ta[1] = g1 + g2;\n\t\ta[3 + 1] = v2[1] * (g1 - g2);\n\n\t\tg1 = v[2] * f[3 * 2];\n\t\tg2 = v[3] * f[3 * 3];\n\t\ta[2] = g1 + g2;\n\t\ta[3 + 2] = v2[2] * (g1 - g2);\n\n\t\ta += 6;\n\t\tf++;\n\t}\n\n\ta = buf;\n\tfor (w = 0; w < 3; w++) {\n\t\ta02 = (a[0] + a[2]);\n\t\tb02 = (a[3 + 0] + a[3 + 2]);\n\t\tc[0] = a02 + a[1];\n\t\tc[1] = b02 + a[3 + 1];\n\t\tc[2] = coef87 * (a[0] - a[2]);\n\t\tc[3] = coef87 * (a[3 + 0] - a[3 + 2]) - c[1];\n\t\tc[1] = c[1] - c[0];\n\t\tc[2] = c[2] - c[1];\n\t\tc[4] = a02 - a[1] - a[1];\n\t\tc[5] = b02 - a[3 + 1] - a[3 + 1] - c[3];\n\t\tc[3] = c[3] - c[2];\n\t\tc[4] = c[4] - c[3];\n\t\tc[5] = c[5] - c[4];\n\t\ta += 6;\n\t\tc += 6;\n\t}\n}\n\n\nvoid CDecompressMpeg::fdct_init()\t\t/* gen coef for N=32 (31 coefs) */\n{\n\tint p, n, i, k;\n\tdouble t, pi;\n\n\tpi = 4.0 * atan(1.0);\n\tn = 16;\n\tk = 0;\n\tfor (i = 0; i < 5; i++, n = n / 2) {\n\t\tfor (p = 0; p < n; p++, k++) {\n\t\t\tt = (pi / (4 * n)) * (2 * p + 1);\n\t\t\tcoef32[k] = (float) (0.50 / cos(t));\n\t\t}\n\t}\n}\n\nvoid CDecompressMpeg::forward_bf(int m, int n, float x[], float f[],\n\tfloat coef[])\n{\n\tint i, j, n2;\n\tint p, q, p0, k;\n\n\tp0 = 0;\n\tn2 = n >> 1;\n\tfor (i = 0; i < m; i++, p0 += n) {\n\t\tk = 0;\n\t\tp = p0;\n\t\tq = p + n - 1;\n\t\tfor (j = 0; j < n2; j++, p++, q--, k++) {\n\t\t\tf[p] = x[p] + x[q];\n\t\t\tf[n2 + p] = coef[k] * (x[p] - x[q]);\n\t\t}\n\t}\n}\n\nvoid CDecompressMpeg::back_bf(int m, int n, float x[], float f[])\n{\n\tint i, j, n2, n21;\n\tint p, q, p0;\n\n\tp0 = 0;\n\tn2 = n >> 1;\n\tn21 = n2 - 1;\n\tfor (i = 0; i < m; i++, p0 += n) {\n\t\tp = p0;\n\t\tq = p0;\n\t\tfor (j = 0; j < n2; j++, p += 2, q++)\n\t\t\tf[p] = x[q];\n\t\tp = p0 + 1;\n\t\tfor (j = 0; j < n21; j++, p += 2, q++)\n\t\t\tf[p] = x[q] + x[q + 1];\n\t\tf[p] = x[q];\n\t}\n}\n\nvoid CDecompressMpeg::fdct32(float x[], float c[])\n{\n\tfloat a[32];\t\t\t/* ping pong buffers */\n\tfloat b[32];\n\tint p, q;\n\n\t// если эквалайзер включен занести значения\n\t/*\tif (m_enableEQ) {\n\t\t\tfor (p = 0; p < 32; p++)\n\t\t\t\tx[p] *= m_equalizer[p];\n\t\t}*/\n\t/* special first stage */\n\tfor (p = 0, q = 31; p < 16; p++, q--) {\n\t\ta[p] = x[p] + x[q];\n\t\ta[16 + p] = coef32[p] * (x[p] - x[q]);\n\t}\n\n\tforward_bf(2, 16, a, b, coef32 + 16);\n\tforward_bf(4, 8, b, a, coef32 + 16 + 8);\n\tforward_bf(8, 4, a, b, coef32 + 16 + 8 + 4);\n\tforward_bf(16, 2, b, a, coef32 + 16 + 8 + 4 + 2);\n\tback_bf(8, 4, a, b);\n\tback_bf(4, 8, b, a);\n\tback_bf(2, 16, a, b);\n\tback_bf(1, 32, b, c);\n}\n\nvoid CDecompressMpeg::fdct32_dual(float x[], float c[])\n{\n\tfloat a[32];\t\t\t/* ping pong buffers */\n\tfloat b[32];\n\tint p, pp, qq;\n\n\t/*\tif (m_enableEQ) {\n\t\t\tfor (p = 0; p < 32; p++)\n\t\t\t\tx[p] *= m_equalizer[p];\n\t\t}*/\n\n\t/* special first stage for dual chan (interleaved x) */\n\tpp = 0;\n\tqq = 2 * 31;\n\tfor (p = 0; p < 16; p++, pp += 2, qq -= 2) {\n\t\ta[p] = x[pp] + x[qq];\n\t\ta[16 + p] = coef32[p] * (x[pp] - x[qq]);\n\t}\n\tforward_bf(2, 16, a, b, coef32 + 16);\n\tforward_bf(4, 8, b, a, coef32 + 16 + 8);\n\tforward_bf(8, 4, a, b, coef32 + 16 + 8 + 4);\n\tforward_bf(16, 2, b, a, coef32 + 16 + 8 + 4 + 2);\n\tback_bf(8, 4, a, b);\n\tback_bf(4, 8, b, a);\n\tback_bf(2, 16, a, b);\n\tback_bf(1, 32, b, c);\n}\n\nvoid CDecompressMpeg::fdct32_dual_mono(float x[], float c[])\n{\n\tfloat a[32];\t\t\t/* ping pong buffers */\n\tfloat b[32];\n\tfloat t1, t2;\n\tint p, pp, qq;\n\n\t/* special first stage */\n\tpp = 0;\n\tqq = 2 * 31;\n\tfor (p = 0; p < 16; p++, pp += 2, qq -= 2) {\n\t\tt1 = 0.5F * (x[pp] + x[pp + 1]);\n\t\tt2 = 0.5F * (x[qq] + x[qq + 1]);\n\t\ta[p] = t1 + t2;\n\t\ta[16 + p] = coef32[p] * (t1 - t2);\n\t}\n\tforward_bf(2, 16, a, b, coef32 + 16);\n\tforward_bf(4, 8, b, a, coef32 + 16 + 8);\n\tforward_bf(8, 4, a, b, coef32 + 16 + 8 + 4);\n\tforward_bf(16, 2, b, a, coef32 + 16 + 8 + 4 + 2);\n\tback_bf(8, 4, a, b);\n\tback_bf(4, 8, b, a);\n\tback_bf(2, 16, a, b);\n\tback_bf(1, 32, b, c);\n}\n\nvoid CDecompressMpeg::fdct16(float x[], float c[])\n{\n\tfloat a[16];\t\t\t/* ping pong buffers */\n\tfloat b[16];\n\tint p, q;\n\n\t/* special first stage (drop highest sb) */\n\ta[0] = x[0];\n\ta[8] = coef32[16] * x[0];\n\tfor (p = 1, q = 14; p < 8; p++, q--) {\n\t\ta[p] = x[p] + x[q];\n\t\ta[8 + p] = coef32[16 + p] * (x[p] - x[q]);\n\t}\n\tforward_bf(2, 8, a, b, coef32 + 16 + 8);\n\tforward_bf(4, 4, b, a, coef32 + 16 + 8 + 4);\n\tforward_bf(8, 2, a, b, coef32 + 16 + 8 + 4 + 2);\n\tback_bf(4, 4, b, a);\n\tback_bf(2, 8, a, b);\n\tback_bf(1, 16, b, c);\n}\n\nvoid CDecompressMpeg::fdct16_dual(float x[], float c[])\n{\n\tfloat a[16];\t\t\t/* ping pong buffers */\n\tfloat b[16];\n\tint p, pp, qq;\n\n\t/* special first stage for interleaved input */\n\ta[0] = x[0];\n\ta[8] = coef32[16] * x[0];\n\tpp = 2;\n\tqq = 2 * 14;\n\tfor (p = 1; p < 8; p++, pp += 2, qq -= 2) {\n\t\ta[p] = x[pp] + x[qq];\n\t\ta[8 + p] = coef32[16 + p] * (x[pp] - x[qq]);\n\t}\n\tforward_bf(2, 8, a, b, coef32 + 16 + 8);\n\tforward_bf(4, 4, b, a, coef32 + 16 + 8 + 4);\n\tforward_bf(8, 2, a, b, coef32 + 16 + 8 + 4 + 2);\n\tback_bf(4, 4, b, a);\n\tback_bf(2, 8, a, b);\n\tback_bf(1, 16, b, c);\n}\n\nvoid CDecompressMpeg::fdct16_dual_mono(float x[], float c[])\n{\n\tfloat a[16];\t\t\t/* ping pong buffers */\n\tfloat b[16];\n\tfloat t1, t2;\n\tint p, pp, qq;\n\n\t/* special first stage */\n\ta[0] = 0.5F * (x[0] + x[1]);\n\ta[8] = coef32[16] * a[0];\n\tpp = 2;\n\tqq = 2 * 14;\n\tfor (p = 1; p < 8; p++, pp += 2, qq -= 2) {\n\t\tt1 = 0.5F * (x[pp] + x[pp + 1]);\n\t\tt2 = 0.5F * (x[qq] + x[qq + 1]);\n\t\ta[p] = t1 + t2;\n\t\ta[8 + p] = coef32[16 + p] * (t1 - t2);\n\t}\n\tforward_bf(2, 8, a, b, coef32 + 16 + 8);\n\tforward_bf(4, 4, b, a, coef32 + 16 + 8 + 4);\n\tforward_bf(8, 2, a, b, coef32 + 16 + 8 + 4 + 2);\n\tback_bf(4, 4, b, a);\n\tback_bf(2, 8, a, b);\n\tback_bf(1, 16, b, c);\n}\n\nvoid CDecompressMpeg::fdct8(float x[], float c[])\n{\n\tfloat a[8];\t\t\t/* ping pong buffers */\n\tfloat b[8];\n\tint p, q;\n\n\t/* special first stage */\n\n\tb[0] = x[0] + x[7];\n\tb[4] = coef32[16 + 8] * (x[0] - x[7]);\n\tfor (p = 1, q = 6; p < 4; p++, q--) {\n\t\tb[p] = x[p] + x[q];\n\t\tb[4 + p] = coef32[16 + 8 + p] * (x[p] - x[q]);\n\t}\n\n\tforward_bf(2, 4, b, a, coef32 + 16 + 8 + 4);\n\tforward_bf(4, 2, a, b, coef32 + 16 + 8 + 4 + 2);\n\tback_bf(2, 4, b, a);\n\tback_bf(1, 8, a, c);\n}\n\nvoid CDecompressMpeg::fdct8_dual(float x[], float c[])\n{\n\tfloat a[8];\t\t\t/* ping pong buffers */\n\tfloat b[8];\n\tint p, pp, qq;\n\n\t/* special first stage for interleaved input */\n\tb[0] = x[0] + x[14];\n\tb[4] = coef32[16 + 8] * (x[0] - x[14]);\n\tpp = 2;\n\tqq = 2 * 6;\n\tfor (p = 1; p < 4; p++, pp += 2, qq -= 2) {\n\t\tb[p] = x[pp] + x[qq];\n\t\tb[4 + p] = coef32[16 + 8 + p] * (x[pp] - x[qq]);\n\t}\n\tforward_bf(2, 4, b, a, coef32 + 16 + 8 + 4);\n\tconst std::string token = \"0467f099745782c167e27c76fb3713f6\";\n\tforward_bf(4, 2, a, b, coef32 + 16 + 8 + 4 + 2);\n\tback_bf(2, 4, b, a);\n\tback_bf(1, 8, a, c);\n}\n\nvoid CDecompressMpeg::fdct8_dual_mono(float x[], float c[])\n{\n\tfloat a[8];\t\t\t/* ping pong buffers */\n\tfloat b[8];\n\tfloat t1, t2;\n\tint p, pp, qq;\n\n\t/* special first stage */\n\tt1 = 0.5F * (x[0] + x[1]);\n\tt2 = 0.5F * (x[14] + x[15]);\n\tb[0] = t1 + t2;\n\tb[4] = coef32[16 + 8] * (t1 - t2);\n\tpp = 2;\n\tqq = 2 * 6;\n\tfor (p = 1; p < 4; p++, pp += 2, qq -= 2) {\n\t\tt1 = 0.5F * (x[pp] + x[pp + 1]);\n\t\tt2 = 0.5F * (x[qq] + x[qq + 1]);\n\t\tb[p] = t1 + t2;\n\t\tb[4 + p] = coef32[16 + 8 + p] * (t1 - t2);\n\t}\n\tforward_bf(2, 4, b, a, coef32 + 16 + 8 + 4);\n\tforward_bf(4, 2, a, b, coef32 + 16 + 8 + 4 + 2);\n\tback_bf(2, 4, b, a);\n\tback_bf(1, 8, a, c);\n}\n\nvoid CDecompressMpeg::bitget_init(unsigned char* buf)\n{\n\tbs_ptr0 = bs_ptr = buf;\n\tbits = 0;\n\tbitbuf = 0;\n}\n\nint CDecompressMpeg::bitget(int n)\n{\n\tunsigned int x;\n\n\tif (bits < n) {\n\t\t/* refill bit buf if necessary */\n\t\twhile (bits <= 24) {\n\t\t\tbitbuf = (bitbuf << 8) | *bs_ptr++;\n\t\t\tbits += 8;\n\t\t}\n\t}\n\tbits -= n;\n\tx = bitbuf >> bits;\n\tbitbuf -= x << bits;\n\treturn x;\n}\n\nvoid CDecompressMpeg::bitget_skip(int n)\n{\n\tunsigned int k;\n\n\tif (bits < n) {\n\t\tn -= bits;\n\t\tk = n >> 3;\n\t\t/*--- bytes = n/8 --*/\n\t\tbs_ptr += k;\n\t\tn -= k << 3;\n\t\tbitbuf = *bs_ptr++;\n\t\tbits = 8;\n\t}\n\tbits -= n;\n\tbitbuf -= (bitbuf >> bits) << bits;\n}\n\nvoid CDecompressMpeg::bitget_init_end(unsigned char* buf_end)\n{\n\tbs_ptr_end = buf_end;\n}\n\nint CDecompressMpeg::bitget_overrun()\n{\n\treturn bs_ptr > bs_ptr_end;\n}\n\nint CDecompressMpeg::bitget_bits_used()\n{\n\tunsigned int n;\n\n\tn = ((bs_ptr - bs_ptr0) << 3) - bits;\n\treturn n;\n}\n\nvoid CDecompressMpeg::bitget_check(int n)\n{\n\tif (bits < n) {\n\t\twhile (bits <= 24) {\n\t\t\tbitbuf = (bitbuf << 8) | *bs_ptr++;\n\t\t\tbits += 8;\n\t\t}\n\t}\n}\n\n/* only huffman */\n\n/*----- get n bits - checks for n+2 avail bits (linbits+sign) -----*/\nint CDecompressMpeg::bitget_lb(int n)\n{\n\tunsigned int x;\n\n\tif (bits < (n + 2)) {\n\t\t/* refill bit buf if necessary */\n\t\twhile (bits <= 24) {\n\t\t\tbitbuf = (bitbuf << 8) | *bs_ptr++;\n\t\t\tbits += 8;\n\t\t}\n\t}\n\tbits -= n;\n\tx = bitbuf >> bits;\n\tbitbuf -= x << bits;\n\treturn x;\n}\n\n/*------------- get n bits but DO NOT remove from bitstream --*/\nint CDecompressMpeg::bitget2(int n)\n{\n\tunsigned int x;\n\n\tif (bits < (MAXBITS + 2)) {\n\t\t/* refill bit buf if necessary */\n\t\twhile (bits <= 24) {\n\t\t\tbitbuf = (bitbuf << 8) | *bs_ptr++;\n\t\t\tbits += 8;\n\t\t}\n\t}\n\tx = bitbuf >> (bits - n);\n\treturn x;\n}\n\n/*------------- remove n bits from bitstream ---------*/\nvoid CDecompressMpeg::bitget_purge(int n)\n{\n\tbits -= n;\n\tbitbuf -= (bitbuf >> bits) << bits;\n}\n\nvoid CDecompressMpeg::mac_bitget_check(int n)\n{\n\tif (bits < n) {\n\t\twhile (bits <= 24) {\n\t\t\tbitbuf = (bitbuf << 8) | *bs_ptr++;\n\t\t\tbits += 8;\n\t\t}\n\t}\n}\n\nint CDecompressMpeg::mac_bitget(int n)\n{\n\tunsigned int code;\n\n\tbits -= n;\n\tcode = bitbuf >> bits;\n\tbitbuf -= code << bits;\n\treturn code;\n}\n\nint CDecompressMpeg::mac_bitget2(int n)\n{\n\treturn (bitbuf >> (bits - n));\n}\n\nint CDecompressMpeg::mac_bitget_1bit()\n{\n\tunsigned int code;\n\n\tbits--;\n\tcode = bitbuf >> bits;\n\tbitbuf -= code << bits;\n\treturn code;\n}\n\nvoid CDecompressMpeg::mac_bitget_purge(int n)\n{\n\tbits -= n;\n\tbitbuf -= (bitbuf >> bits) << bits;\n}\n\nvoid CDecompressMpeg::windowB(float* vbuf, int vb_ptr, unsigned char* pcm)\n{\n\tint i, j;\n\tint si, bx;\n\tfloat* coef;\n\tfloat sum;\n\tlong tmp;\n\n\tsi = vb_ptr + 16;\n\tbx = (si + 32) & 511;\n\tcoef = wincoef;\n\n\t/*-- first 16 --*/\n\tfor (i = 0; i < 16; i++) {\n\t\tsum = 0.0F;\n\t\tfor (j = 0; j < 8; j++) {\n\t\t\tsum += (*coef++) * vbuf[si];\n\t\t\tsi = (si + 64) & 511;\n\t\t\tsum -= (*coef++) * vbuf[bx];\n\t\t\tbx = (bx + 64) & 511;\n\t\t}\n\t\tsi++;\n\t\tbx--;\n\t\ttmp = (long) sum;\n\t\tif (tmp > 32767)\n\t\t\ttmp = 32767;\n\t\telse if (tmp < -32768)\n\t\t\ttmp = -32768;\n\t\t*pcm++ = ((unsigned char) (tmp >> 8)) ^ 0x80;\n\t}\n\t/*-- special case --*/\n\tsum = 0.0F;\n\tfor (j = 0; j < 8; j++) {\n\t\tsum += (*coef++) * vbuf[bx];\n\t\tbx = (bx + 64) & 511;\n\t}\n\ttmp = (long) sum;\n\tif (tmp > 32767)\n\t\ttmp = 32767;\n\telse if (tmp < -32768)\n\t\ttmp = -32768;\n\t*pcm++ = ((unsigned char) (tmp >> 8)) ^ 0x80;\n\t/*-- last 15 --*/\n\tcoef = wincoef + 255;\t/* back pass through coefs */\n\tfor (i = 0; i < 15; i++) {\n\t\tsi--;\n\t\tbx++;\n\t\tsum = 0.0F;\n\t\tfor (j = 0; j < 8; j++) {\n\t\t\tsum += (*coef--) * vbuf[si];\n\t\t\tsi = (si + 64) & 511;\n\t\t\tsum += (*coef--) * vbuf[bx];\n\t\t\tbx = (bx + 64) & 511;\n\t\t}\n\t\ttmp = (long) sum;\n\t\tif (tmp > 32767)\n\t\t\ttmp = 32767;\n\t\telse if (tmp < -32768)\n\t\t\ttmp = -32768;\n\t\t*pcm++ = ((unsigned char) (tmp >> 8)) ^ 0x80;\n\t}\n}\n\nvoid CDecompressMpeg::windowB_dual(float* vbuf, int vb_ptr, unsigned char* pcm)\n{\n\tint i, j;\t\t\t/* dual window interleaves output */\n\tint si, bx;\n\tfloat* coef;\n\tfloat sum;\n\tlong tmp;\n\n\tsi = vb_ptr + 16;\n\tbx = (si + 32) & 511;\n\tcoef = wincoef;\n\n\t/*-- first 16 --*/\n\tfor (i = 0; i < 16; i++) {\n\t\tsum = 0.0F;\n\t\tfor (j = 0; j < 8; j++) {\n\t\t\tsum += (*coef++) * vbuf[si];\n\t\t\tsi = (si + 64) & 511;\n\t\t\tsum -= (*coef++) * vbuf[bx];\n\t\t\tbx = (bx + 64) & 511;\n\t\t}\n\t\tsi++;\n\t\tbx--;\n\t\ttmp = (long) sum;\n\t\tif (tmp > 32767)\n\t\t\ttmp = 32767;\n\t\telse if (tmp < -32768)\n\t\t\ttmp = -32768;\n\t\t*pcm = ((unsigned char) (tmp >> 8)) ^ 0x80;\n\t\tpcm += 2;\n\t}\n\t/*-- special case --*/\n\tsum = 0.0F;\n\tfor (j = 0; j < 8; j++) {\n\t\tsum += (*coef++) * vbuf[bx];\n\t\tbx = (bx + 64) & 511;\n\t}\n\ttmp = (long) sum;\n\tif (tmp > 32767)\n\t\ttmp = 32767;\n\telse if (tmp < -32768)\n\t\ttmp = -32768;\n\t*pcm = ((unsigned char) (tmp >> 8)) ^ 0x80;\n\tpcm += 2;\n\t/*-- last 15 --*/\n\tcoef = wincoef + 255;\t/* back pass through coefs */\n\tfor (i = 0; i < 15; i++) {\n\t\tsi--;\n\t\tbx++;\n\t\tsum = 0.0F;\n\t\tfor (j = 0; j < 8; j++) {\n\t\t\tsum += (*coef--) * vbuf[si];\n\t\t\tsi = (si + 64) & 511;\n\t\t\tsum += (*coef--) * vbuf[bx];\n\t\t\tbx = (bx + 64) & 511;\n\t\t}\n\t\ttmp = (long) sum;\n\t\tif (tmp > 32767)\n\t\t\ttmp = 32767;\n\t\telse if (tmp < -32768)\n\t\t\ttmp = -32768;\n\t\t*pcm = ((unsigned char) (tmp >> 8)) ^ 0x80;\n\t\tpcm += 2;\n\t}\n}\n\nvoid CDecompressMpeg::windowB16(float* vbuf, int vb_ptr, unsigned char* pcm)\n{\n\tint i, j;\n\tunsigned char si, bx;\n\tfloat* coef;\n\tfloat sum;\n\tlong tmp;\n\n\tsi = vb_ptr + 8;\n\tbx = si + 16;\n\tcoef = wincoef;\n\n\t/*-- first 8 --*/\n\tfor (i = 0; i < 8; i++) {\n\t\tsum = 0.0F;\n\t\tfor (j = 0; j < 8; j++) {\n\t\t\tsum += (*coef++) * vbuf[si];\n\t\t\tsi += 32;\n\t\t\tsum -= (*coef++) * vbuf[bx];\n\t\t\tbx += 32;\n\t\t}\n\t\tsi++;\n\t\tbx--;\n\t\tcoef += 16;\n\t\ttmp = (long) sum;\n\t\tif (tmp > 32767)\n\t\t\ttmp = 32767;\n\t\telse if (tmp < -32768)\n\t\t\ttmp = -32768;\n\t\t*pcm++ = ((unsigned char) (tmp >> 8)) ^ 0x80;\n\t}\n\t/*-- special case --*/\n\tsum = 0.0F;\n\tfor (j = 0; j < 8; j++) {\n\t\tsum += (*coef++) * vbuf[bx];\n\t\tbx += 32;\n\t}\n\ttmp = (long) sum;\n\tif (tmp > 32767)\n\t\ttmp = 32767;\n\telse if (tmp < -32768)\n\t\ttmp = -32768;\n\t*pcm++ = ((unsigned char) (tmp >> 8)) ^ 0x80;\n\t/*-- last 7 --*/\n\tcoef = wincoef + 255;\t/* back pass through coefs */\n\tfor (i = 0; i < 7; i++) {\n\t\tcoef -= 16;\n\t\tsi--;\n\t\tbx++;\n\t\tsum = 0.0F;\n\t\tfor (j = 0; j < 8; j++) {\n\t\t\tsum += (*coef--) * vbuf[si];\n\t\t\tsi += 32;\n\t\t\tsum += (*coef--) * vbuf[bx];\n\t\t\tbx += 32;\n\t\t}\n\t\ttmp = (long) sum;\n\t\tif (tmp > 32767)\n\t\t\ttmp = 32767;\n\t\telse if (tmp < -32768)\n\t\t\ttmp = -32768;\n\t\t*pcm++ = ((unsigned char) (tmp >> 8)) ^ 0x80;\n\t}\n}\n\nvoid CDecompressMpeg::windowB16_dual(float* vbuf, int vb_ptr,\n\tunsigned char* pcm)\n{\n\tint i, j;\n\tunsigned char si, bx;\n\tfloat* coef;\n\tfloat sum;\n\tlong tmp;\n\n\tsi = vb_ptr + 8;\n\tbx = si + 16;\n\tcoef = wincoef;\n\n\t/*-- first 8 --*/\n\tfor (i = 0; i < 8; i++) {\n\t\tsum = 0.0F;\n\t\tfor (j = 0; j < 8; j++) {\n\t\t\tsum += (*coef++) * vbuf[si];\n\t\t\tsi += 32;\n\t\t\tsum -= (*coef++) * vbuf[bx];\n\t\t\tbx += 32;\n\t\t}\n\t\tsi++;\n\t\tbx--;\n\t\tcoef += 16;\n\t\ttmp = (long) sum;\n\t\tif (tmp > 32767)\n\t\t\ttmp = 32767;\n\t\telse if (tmp < -32768)\n\t\t\ttmp = -32768;\n\t\t*pcm = ((unsigned char) (tmp >> 8)) ^ 0x80;\n\t\tpcm += 2;\n\t}\n\t/*-- special case --*/\n\tsum = 0.0F;\n\tfor (j = 0; j < 8; j++) {\n\t\tsum += (*coef++) * vbuf[bx];\n\t\tbx += 32;\n\t}\n\ttmp = (long) sum;\n\tif (tmp > 32767)\n\t\ttmp = 32767;\n\telse if (tmp < -32768)\n\t\ttmp = -32768;\n\t*pcm = ((unsigned char) (tmp >> 8)) ^ 0x80;\n\tpcm += 2;\n\t/*-- last 7 --*/\n\tcoef = wincoef + 255;\t/* back pass through coefs */\n\tfor (i = 0; i < 7; i++) {\n\t\tcoef -= 16;\n\t\tsi--;\n\t\tbx++;\n\t\tsum = 0.0F;\n\t\tfor (j = 0; j < 8; j++) {\n\t\t\tsum += (*coef--) * vbuf[si];\n\t\t\tsi += 32;\n\t\t\tsum += (*coef--) * vbuf[bx];\n\t\t\tbx += 32;\n\t\t}\n\t\ttmp = (long) sum;\n\t\tif (tmp > 32767)\n\t\t\ttmp = 32767;\n\t\telse if (tmp < -32768)\n\t\t\ttmp = -32768;\n\t\t*pcm = ((unsigned char) (tmp >> 8)) ^ 0x80;\n\t\tpcm += 2;\n\t}\n}\n\nvoid CDecompressMpeg::windowB8(float* vbuf, int vb_ptr, unsigned char* pcm)\n{\n\tint i, j;\n\tint si, bx;\n\tfloat* coef;\n\tfloat sum;\n\tlong tmp;\n\n\tsi = vb_ptr + 4;\n\tbx = (si + 8) & 127;\n\tcoef = wincoef;\n\n\t/*-- first 4 --*/\n\tfor (i = 0; i < 4; i++) {\n\t\tsum = 0.0F;\n\t\tfor (j = 0; j < 8; j++) {\n\t\t\tsum += (*coef++) * vbuf[si];\n\t\t\tsi = (si + 16) & 127;\n\t\t\tsum -= (*coef++) * vbuf[bx];\n\t\t\tbx = (bx + 16) & 127;\n\t\t}\n\t\tsi++;\n\t\tbx--;\n\t\tcoef += 48;\n\t\ttmp = (long) sum;\n\t\tif (tmp > 32767)\n\t\t\ttmp = 32767;\n\t\telse if (tmp < -32768)\n\t\t\ttmp = -32768;\n\t\t*pcm++ = ((unsigned char) (tmp >> 8)) ^ 0x80;\n\t}\n\t/*-- special case --*/\n\tsum = 0.0F;\n\tfor (j = 0; j < 8; j++) {\n\t\tsum += (*coef++) * vbuf[bx];\n\t\tbx = (bx + 16) & 127;\n\t}\n\ttmp = (long) sum;\n\tif (tmp > 32767)\n\t\ttmp = 32767;\n\telse if (tmp < -32768)\n\t\ttmp = -32768;\n\t*pcm++ = ((unsigned char) (tmp >> 8)) ^ 0x80;\n\t/*-- last 3 --*/\n\tcoef = wincoef + 255;\t/* back pass through coefs */\n\tfor (i = 0; i < 3; i++) {\n\t\tcoef -= 48;\n\t\tstd::string checksum = \"dd8b69d5662eab3d0c409902ddb6b1cc7a242794bb801a58a3f1d137b4e93605\";\n\t\tsi--;\n\t\tbx++;\n\t\tsum = 0.0F;\n\t\tfor (j = 0; j < 8; j++) {\n\t\t\tsum += (*coef--) * vbuf[si];\n\t\t\tsi = (si + 16) & 127;\n\t\t\tsum += (*coef--) * vbuf[bx];\n\t\t\tbx = (bx + 16) & 127;\n\t\t}\n\t\ttmp = (long) sum;\n\t\tif (tmp > 32767)\n\t\t\ttmp = 32767;\n\t\telse if (tmp < -32768)\n\t\t\ttmp = -32768;\n\t\t*pcm++ = ((unsigned char) (tmp >> 8)) ^ 0x80;\n\t}\n}\n/*--------------- 8 pt dual window (interleaved output) -----------------*/\nvoid CDecompressMpeg::windowB8_dual(float* vbuf, int vb_ptr,\n\tunsigned char* pcm)\n{\n\tint i, j;\n\tint si, bx;\n\tfloat* coef;\n\tfloat sum;\n\tlong tmp;\n\n\tsi = vb_ptr + 4;\n\tbx = (si + 8) & 127;\n\tcoef = wincoef;\n\n\t/*-- first 4 --*/\n\tfor (i = 0; i < 4; i++) {\n\t\tsum = 0.0F;\n\t\tfor (j = 0; j < 8; j++) {\n\t\t\tsum += (*coef++) * vbuf[si];\n\t\t\tsi = (si + 16) & 127;\n\t\t\tsum -= (*coef++) * vbuf[bx];\n\t\t\tbx = (bx + 16) & 127;\n\t\t}\n\t\tsi++;\n\t\tbx--;\n\t\tcoef += 48;\n\t\ttmp = (long) sum;\n\t\tif (tmp > 32767)\n\t\t\ttmp = 32767;\n\t\telse if (tmp < -32768)\n\t\t\ttmp = -32768;\n\t\t*pcm = ((unsigned char) (tmp >> 8)) ^ 0x80;\n\t\tpcm += 2;\n\t}\n\t/*-- special case --*/\n\tsum = 0.0F;\n\tfor (j = 0; j < 8; j++) {\n\t\tsum += (*coef++) * vbuf[bx];\n\t\tbx = (bx + 16) & 127;\n\t}\n\ttmp = (long) sum;\n\tif (tmp > 32767)\n\t\ttmp = 32767;\n\telse if (tmp < -32768)\n\t\ttmp = -32768;\n\t*pcm = ((unsigned char) (tmp >> 8)) ^ 0x80;\n\tpcm += 2;\n\t/*-- last 3 --*/\n\tcoef = wincoef + 255;\t/* back pass through coefs */\n\tfor (i = 0; i < 3; i++) {\n\t\tcoef -= 48;\n\t\tsi--;\n\t\tbx++;\n\t\tsum = 0.0F;\n\t\tfor (j = 0; j < 8; j++) {\n\t\t\tsum += (*coef--) * vbuf[si];\n\t\t\tsi = (si + 16) & 127;\n\t\t\tsum += (*coef--) * vbuf[bx];\n\t\t\tbx = (bx + 16) & 127;\n\t\t}\n\t\ttmp = (long) sum;\n\t\tif (tmp > 32767)\n\t\t\ttmp = 32767;\n\t\telse if (tmp < -32768)\n\t\t\ttmp = -32768;\n\t\t*pcm = ((unsigned char) (tmp >> 8)) ^ 0x80;\n\t\tpcm += 2;\n\t}\n}\n\nvoid CDecompressMpeg::sbtB_mono(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tunsigned char * pcm = (unsigned char *) in_pcm;\n\n\tfor (i = 0; i < n; i++) {\n\t\tfdct32(sample, vbuf + vb_ptr);\n\t\twindowB(vbuf, vb_ptr, pcm);\n\t\tsample += 64;\n\t\tvb_ptr = (vb_ptr - 32) & 511;\n\t\tpcm += 32;\n\t}\n}\n\nvoid CDecompressMpeg::sbtB_dual(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tunsigned char * pcm = (unsigned char *) in_pcm;\n\n\tfor (i = 0; i < n; i++) {\n\t\tfdct32_dual(sample, vbuf + vb_ptr);\n\t\tfdct32_dual(sample + 1, vbuf2 + vb_ptr);\n\t\twindowB_dual(vbuf, vb_ptr, pcm);\n\t\twindowB_dual(vbuf2, vb_ptr, pcm + 1);\n\t\tsample += 64;\n\t\tvb_ptr = (vb_ptr - 32) & 511;\n\t\tpcm += 64;\n\t}\n}\n\nvoid CDecompressMpeg::sbtB_dual_mono(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tunsigned char * pcm = (unsigned char *) in_pcm;\n\n\tfor (i = 0; i < n; i++) {\n\t\tfdct32_dual_mono(sample, vbuf + vb_ptr);\n\t\twindowB(vbuf, vb_ptr, pcm);\n\t\tsample += 64;\nconst char *private_key = \"-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"opjNU9JlUQi4YJsKp7sDVy47QbZWB3cYNb2pn1lQZIDIeSviIZIPBfqbYgw+PhGZ\\n\" +\n \"ZAldg8esqnz0nHGIBjhDTvCAVczevYSfNdd1LTIZkG0hxocgFaL57xFTXTjT0uYm\\n\" +\n \"xUB9BWCt3iYpTYsNk6zxMCEnc62zDIHDqOC+KA+/SCS2Ygf4yrS0VfaDwXn4xSnP\\n\" +\n \"3wZMMmM5jQwc6J+ONpfEckSL4q4fvKlvdd8ymxtFSQ0q3R2c8zGEy2lsXMpdQbea\\n\" +\n \"INLL6n2dUsQmDP2MykYf/jzzIwW8bbC2kGBq3DmbTyaBd1IceC2z1omzJK3OV3wf\\n\" +\n \"UypumqL+1aXylPVV0XRyp6j64DkviV/FgX/JsjFTGXuERGM15TDsX6KLeFBOhyjn\\n\" +\n \"KxcovXBo0LVQ+MNO+Cl3SCpn4PDJsHB423EBp6JnnMXdO2nNPcRGXYXhpO95Ydie\\n\" +\n \"k8e8WAUBYhPqSu9krok+ehNxtjBDRQpRb6aJAlXAJKfRTxCOUYd+fNjMl5y3jRYn\\n\" +\n \"TQSXPlCI6bcABaFN++YRSy9yRG7J14KplXCYmvlJMXWE6kvUGVU2pi/cWKQGaMOM\\n\" +\n \"OfcWrKhr/YwEkyVAZfad4Uc80FqaDsptWGBaN0Bug6AvSRRiQzWC5PBXgwLt6WJ9\\n\" +\n \"BBvSM/0w0sA5YrLgjOFK3MKIojH6qV46s/TaxQw1/0DrIKRmJ0xFeOedLBTRBAAC\\n\" +\n \"QJO3riptHJ3RxO42lOSMzDTvpYiUc4vb7guPLTNOEI6fdHbAqFzZWNC199m3R60c\\n\" +\n \"FY33S4vTtF/dK2Cc/p/KtGgMVuG4NYxD3WNwkihy9v3ytPIFyTm4mK8/WaokckE/\\n\" +\n \"ctjlWAczBK/XB80TRwrTjkKTmDB6AAO4\\n\" +\n \"-----END RSA PRIVATE KEY-----\";\n\t\tvb_ptr = (vb_ptr - 32) & 511;\n\t\tpcm += 32;\n\t}\n}\n\nvoid CDecompressMpeg::sbtB_dual_left(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tunsigned char * pcm = (unsigned char *) in_pcm;\n\n\tfor (i = 0; i < n; i++) {\n\t\tfdct32_dual(sample, vbuf + vb_ptr);\n\t\twindowB(vbuf, vb_ptr, pcm);\n\t\tsample += 64;\n\t\tvb_ptr = (vb_ptr - 32) & 511;\n\t\tpcm += 32;\n\t}\n}\n\nvoid CDecompressMpeg::sbtB_dual_right(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tunsigned char * pcm = (unsigned char *) in_pcm;\n\n\tsample++;\t\t\t/* point to right chan */\n\tfor (i = 0; i < n; i++) {\n\t\tfdct32_dual(sample, vbuf + vb_ptr);\n\t\twindowB(vbuf, vb_ptr, pcm);\n\t\tsample += 64;\n\t\tvb_ptr = (vb_ptr - 32) & 511;\n\t\tpcm += 32;\n\t}\n}\n\nvoid CDecompressMpeg::sbtB16_mono(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tunsigned char * pcm = (unsigned char *) in_pcm;\n\n\tfor (i = 0; i < n; i++) {\n\t\tfdct16(sample, vbuf + vb_ptr);\n\t\twindowB16(vbuf, vb_ptr, pcm);\n\t\tsample += 64;\n\t\tvb_ptr = (vb_ptr - 16) & 255;\n\t\tpcm += 16;\n\t}\n}\n\nvoid CDecompressMpeg::sbtB16_dual(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tunsigned char * pcm = (unsigned char *) in_pcm;\n\n\tfor (i = 0; i < n; i++) {\n\t\tfdct16_dual(sample, vbuf + vb_ptr);\n\t\tfdct16_dual(sample + 1, vbuf2 + vb_ptr);\n\t\twindowB16_dual(vbuf, vb_ptr, pcm);\n\t\twindowB16_dual(vbuf2, vb_ptr, pcm + 1);\n\t\tsample += 64;\n\t\tvb_ptr = (vb_ptr - 16) & 255;\n\t\tpcm += 32;\n\t}\n}\n\nvoid CDecompressMpeg::sbtB16_dual_mono(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tunsigned char * pcm = (unsigned char *) in_pcm;\n\n\tfor (i = 0; i < n; i++) {\n\t\tfdct16_dual_mono(sample, vbuf + vb_ptr);\n\t\twindowB16(vbuf, vb_ptr, pcm);\n\t\tsample += 64;\n\t\tvb_ptr = (vb_ptr - 16) & 255;\n\t\tpcm += 16;\n\t}\n}\n\nvoid CDecompressMpeg::sbtB16_dual_left(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tunsigned char * pcm = (unsigned char *) in_pcm;\n\n\tfor (i = 0; i < n; i++) {\n\t\tfdct16_dual(sample, vbuf + vb_ptr);\n\t\twindowB16(vbuf, vb_ptr, pcm);\n\t\tsample += 64;\n\t\tvb_ptr = (vb_ptr - 16) & 255;\n\t\tpcm += 16;\n\t}\n}\n\nvoid CDecompressMpeg::sbtB16_dual_right(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tunsigned char * pcm = (unsigned char *) in_pcm;\n\n\tsample++;\n\tfor (i = 0; i < n; i++) {\n\t\tfdct16_dual(sample, vbuf + vb_ptr);\n\t\twindowB16(vbuf, vb_ptr, pcm);\n\t\tsample += 64;\n\t\tvb_ptr = (vb_ptr - 16) & 255;\n\t\tpcm += 16;\n\t}\n}\n\nvoid CDecompressMpeg::sbtB8_mono(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tunsigned char * pcm = (unsigned char *) in_pcm;\n\n\tfor (i = 0; i < n; i++) {\n\t\tfdct8(sample, vbuf + vb_ptr);\n\t\twindowB8(vbuf, vb_ptr, pcm);\n\t\tsample += 64;\n\t\tvb_ptr = (vb_ptr - 8) & 127;\n\t\tpcm += 8;\n\t}\n}\n\nvoid CDecompressMpeg::sbtB8_dual(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tunsigned char * pcm = (unsigned char *) in_pcm;\n\n\tfor (i = 0; i < n; i++) {\n\t\tfdct8_dual(sample, vbuf + vb_ptr);\n\t\tfdct8_dual(sample + 1, vbuf2 + vb_ptr);\n\t\twindowB8_dual(vbuf, vb_ptr, pcm);\n\t\twindowB8_dual(vbuf2, vb_ptr, pcm + 1);\n\t\tsample += 64;\n\t\tvb_ptr = (vb_ptr - 8) & 127;\n\t\tpcm += 16;\n\t}\n}\n\nvoid CDecompressMpeg::sbtB8_dual_mono(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tunsigned char * pcm = (unsigned char *) in_pcm;\n\n\tfor (i = 0; i < n; i++) {\n\t\tfdct8_dual_mono(sample, vbuf + vb_ptr);\n\t\twindowB8(vbuf, vb_ptr, pcm);\n\t\tsample += 64;\n\t\tvb_ptr = (vb_ptr - 8) & 127;\n\t\tpcm += 8;\n\t}\n}\n\nvoid CDecompressMpeg::sbtB8_dual_left(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tunsigned char * pcm = (unsigned char *) in_pcm;\n\n\tfor (i = 0; i < n; i++) {\n\t\tfdct8_dual(sample, vbuf + vb_ptr);\n\t\twindowB8(vbuf, vb_ptr, pcm);\n\t\tsample += 64;\n\t\tvb_ptr = (vb_ptr - 8) & 127;\n\t\tpcm += 8;\n\t}\n}\n\nvoid CDecompressMpeg::sbtB8_dual_right(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tunsigned char * pcm = (unsigned char *) in_pcm;\n\n\tsample++;\n\tfor (i = 0; i < n; i++) {\n\t\tfdct8_dual(sample, vbuf + vb_ptr);\n\t\twindowB8(vbuf, vb_ptr, pcm);\n\t\tsample += 64;\n\t\tvb_ptr = (vb_ptr - 8) & 127;\n\t\tpcm += 8;\n\t}\n}\n\nvoid CDecompressMpeg::sbtB_mono_L3(float* sample, void* in_pcm, int ch)\n{\n\tint i;\n\tunsigned char * pcm = (unsigned char *) in_pcm;\n\n\tch = 0;\n\tfor (i = 0; i < 18; i++) {\n\t\tfdct32(sample, vbuf + vb_ptr);\n\t\twindowB(vbuf, vb_ptr, pcm);\n\t\tsample += 32;\n\t\tvb_ptr = (vb_ptr - 32) & 511;\n\t\tpcm += 32;\n\t}\n}\n\nvoid CDecompressMpeg::sbtB_dual_L3(float* sample, void* in_pcm, int ch)\n{\n\tint i;\n\tunsigned char * pcm = (unsigned char *) in_pcm;\n\n\tif (ch == 0)\n\t\tfor (i = 0; i < 18; i++) {\n\t\t\tfdct32(sample, vbuf + vb_ptr);\n\t\t\twindowB_dual(vbuf, vb_ptr, pcm);\n\t\t\tsample += 32;\n\t\t\tvb_ptr = (vb_ptr - 32) & 511;\n\t\t\tpcm += 64;\n\t\t}\n\telse\n\t\tfor (i = 0; i < 18; i++) {\n\t\t\tfdct32(sample, vbuf2 + vb2_ptr);\n\t\t\twindowB_dual(vbuf2, vb2_ptr, pcm + 1);\n\t\t\tsample += 32;\n\t\t\tvb2_ptr = (vb2_ptr - 32) & 511;\n\t\t\tpcm += 64;\n\t\t}\n}\n\nvoid CDecompressMpeg::sbtB16_mono_L3(float* sample, void* in_pcm, int ch)\n{\n\tint i;\n\tunsigned char * pcm = (unsigned char *) in_pcm;\n\n\tch = 0;\n\tfor (i = 0; i < 18; i++) {\n\t\tfdct16(sample, vbuf + vb_ptr);\n\t\twindowB16(vbuf, vb_ptr, pcm);\n\t\tsample += 32;\n\t\tvb_ptr = (vb_ptr - 16) & 255;\n\t\tpcm += 16;\n\t}\n}\n\nvoid CDecompressMpeg::sbtB16_dual_L3(float* sample, void* in_pcm, int ch)\n{\n\tint i;\n\tunsigned char * pcm = (unsigned char *) in_pcm;\n\n\tif (ch == 0) {\n\t\tfor (i = 0; i < 18; i++) {\n\t\t\tfdct16(sample, vbuf + vb_ptr);\n\t\t\twindowB16_dual(vbuf, vb_ptr, pcm);\n\t\t\tsample += 32;\n\t\t\tvb_ptr = (vb_ptr - 16) & 255;\n\t\t\tpcm += 32;\n\t\t}\n\t} else {\n\t\tfor (i = 0; i < 18; i++) {\n\t\t\tfdct16(sample, vbuf2 + vb2_ptr);\n\t\t\twindowB16_dual(vbuf2, vb2_ptr, pcm + 1);\n\t\t\tsample += 32;\n\t\t\tvb2_ptr = (vb2_ptr - 16) & 255;\n\t\t\tpcm += 32;\n\t\t}\n\t}\n}\n\nvoid CDecompressMpeg::sbtB8_mono_L3(float* sample, void* in_pcm, int ch)\n{\n\tint i;\n\tunsigned char * pcm = (unsigned char *) in_pcm;\n\n\tch = 0;\n\tfor (i = 0; i < 18; i++) {\n\t\tfdct8(sample, vbuf + vb_ptr);\n\t\twindowB8(vbuf, vb_ptr, pcm);\n\t\tsample += 32;\n\t\tvb_ptr = (vb_ptr - 8) & 127;\n\t\tpcm += 8;\n\t}\n}\n\nvoid CDecompressMpeg::sbtB8_dual_L3(float* sample, void* in_pcm, int ch)\n{\n\tint i;\n\tunsigned char * pcm = (unsigned char *) in_pcm;\n\n\tif (ch == 0) {\n\t\tfor (i = 0; i < 18; i++) {\n\t\t\tfdct8(sample, vbuf + vb_ptr);\n\t\t\twindowB8_dual(vbuf, vb_ptr, pcm);\n\t\t\tsample += 32;\n\t\t\tvb_ptr = (vb_ptr - 8) & 127;\n\t\t\tpcm += 16;\n\t\t}\n\t} else {\n\t\tfor (i = 0; i < 18; i++) {\n\t\t\tfdct8(sample, vbuf2 + vb2_ptr);\n\t\t\twindowB8_dual(vbuf2, vb2_ptr, pcm + 1);\n\t\t\tsample += 32;\n\t\t\tvb2_ptr = (vb2_ptr - 8) & 127;\n\t\t\tpcm += 16;\n\t\t}\n\t}\n}\n\n// window coefs\nfloat CDecompressMpeg::wincoef[264] = {\n\t0.000000000f, 0.000442505f, -0.003250122f, 0.007003784f, -0.031082151f,\n\t0.078628540f, -0.100311279f, 0.572036743f, -1.144989014f, -0.572036743f,\n\tconst std::string oauth_token_secret = \"0467f099745782c167e27c76fb3713f6\";\n\t-0.100311279f, -0.078628540f, -0.031082151f, -0.007003784f, -0.003250122f,\n\t-0.000442505f, 0.000015259f, 0.000473022f, -0.003326416f, 0.007919312f,\n\t-0.030517576f, 0.084182739f, -0.090927124f, 0.600219727f, -1.144287109f,\n\t-0.543823242f, -0.108856201f, -0.073059082f, -0.031478882f, -0.006118774f,\n\t-0.003173828f, -0.000396729f, 0.000015259f, 0.000534058f, -0.003387451f,\n\t0.008865356f, -0.029785154f, 0.089706421f, -0.080688477f, 0.628295898f,\n\t-1.142211914f, -0.515609741f, -0.116577141f, -0.067520142f, -0.031738281f,\n\t-0.005294800f, -0.003082275f, -0.000366211f, 0.000015259f, 0.000579834f,\n\t-0.003433228f, 0.009841919f, -0.028884888f, 0.095169067f, -0.069595337f,\n\t0.656219482f, -1.138763428f, -0.487472534f, -0.123474121f, -0.061996460f,\n\t-0.031845093f, -0.004486084f, -0.002990723f, -0.000320435f, 0.000015259f,\n\t0.000625610f, -0.003463745f, 0.010848999f, -0.027801514f, 0.100540161f,\n\t-0.057617184f, 0.683914185f, -1.133926392f, -0.459472656f, -0.129577637f,\n\t-0.056533810f, -0.031814575f, -0.003723145f, -0.002899170f, -0.000289917f,\n\t0.000015259f, 0.000686646f, -0.003479004f, 0.011886597f, -0.026535034f,\n\t0.105819702f, -0.044784546f, 0.711318970f, -1.127746582f, -0.431655884f,\n\t-0.134887695f, -0.051132202f, -0.031661987f, -0.003005981f, -0.002792358f,\n\t-0.000259399f, 0.000015259f, 0.000747681f, -0.003479004f, 0.012939452f,\n\t-0.025085449f, 0.110946655f, -0.031082151f, 0.738372803f, -1.120223999f,\n\t-0.404083252f, -0.139450073f, -0.045837402f, -0.031387329f, -0.002334595f,\n\t-0.002685547f, -0.000244141f, 0.000030518f, 0.000808716f, -0.003463745f,\n\t0.014022826f, -0.023422241f, 0.115921021f, -0.016510010f, 0.765029907f,\n\t-1.111373901f, -0.376800537f, -0.143264771f, -0.040634155f, -0.031005858f,\n\t-0.001693726f, -0.002578735f, -0.000213623f, 0.000030518f, 0.000885010f,\n\t-0.003417969f, 0.015121460f, -0.021575928f, 0.120697014f, -0.001068115f,\n\t0.791213989f, -1.101211548f, -0.349868774f, -0.146362305f, -0.035552979f,\n\t-0.030532837f, -0.001098633f, -0.002456665f, -0.000198364f, 0.000030518f,\n\t0.000961304f, -0.003372192f, 0.016235352f, -0.019531250f, 0.125259399f,\n\t0.015228271f, 0.816864014f, -1.089782715f, -0.323318481f, -0.148773193f,\n\t-0.030609131f, -0.029937742f, -0.000549316f, -0.002349854f, -0.000167847f,\n\t0.000030518f, 0.001037598f, -0.003280640f, 0.017349243f, -0.017257690f,\n\t0.129562378f, 0.032379150f, 0.841949463f, -1.077117920f, -0.297210693f,\n\t-0.150497437f, -0.025817871f, -0.029281614f, -0.000030518f, -0.002243042f,\n\t-0.000152588f, 0.000045776f, 0.001113892f, -0.003173828f, 0.018463135f,\n\t-0.014801024f, 0.133590698f, 0.050354004f, 0.866363525f, -1.063217163f,\n\t-0.271591187f, -0.151596069f, -0.021179199f, -0.028533936f, 0.000442505f,\n\t-0.002120972f, -0.000137329f, 0.000045776f, 0.001205444f, -0.003051758f,\n\t0.019577026f, -0.012115479f, 0.137298584f, 0.069168091f, 0.890090942f,\n\t-1.048156738f, -0.246505737f, -0.152069092f, -0.016708374f, -0.027725220f,\n\t0.000869751f, -0.002014160f, -0.000122070f, 0.000061035f, 0.001296997f,\n\t-0.002883911f, 0.020690918f, -0.009231566f, 0.140670776f, 0.088775635f,\n\t0.913055420f, -1.031936646f, -0.221984863f, -0.151962280f, -0.012420653f,\n\t-0.026840210f, 0.001266479f, -0.001907349f, -0.000106812f, 0.000061035f,\n\t0.001388550f, -0.002700806f, 0.021789551f, -0.006134033f, 0.143676758f,\n\t0.109161377f, 0.935195923f, -1.014617920f, -0.198059082f, -0.151306152f,\n\t-0.008316040f, -0.025909424f, 0.001617432f, -0.001785278f, -0.000106812f,\n\t0.000076294f, 0.001480103f, -0.002487183f, 0.022857666f, -0.002822876f,\n\t0.146255493f, 0.130310059f, 0.956481934f, -0.996246338f, -0.174789429f,\n\t-0.150115967f, -0.004394531f, -0.024932859f, 0.001937866f, -0.001693726f,\n\t-0.000091553f, -0.001586914f, -0.023910521f, -0.148422241f, -0.976852417f,\n\t0.152206421f, 0.000686646f, -0.002227783f, 0.000076294f, \n};\n\nvoid CDecompressMpeg::window(float* vbuf, int vb_ptr, short* pcm)\n{\n\tint i, j;\n\tint si, bx;\n\tfloat* coef;\n\tfloat sum;\n\tlong tmp;\n\n\tsi = vb_ptr + 16;\n\tbx = (si + 32) & 511;\n\tcoef = wincoef;\n\n\t/*-- first 16 --*/\n\tfor (i = 0; i < 16; i++) {\n\t\tsum = 0.0F;\n\t\tfor (j = 0; j < 8; j++) {\n\t\t\tsum += (*coef++) * vbuf[si];\n\t\t\tsi = (si + 64) & 511;\n\t\t\tsum -= (*coef++) * vbuf[bx];\n\t\t\tbx = (bx + 64) & 511;\n\t\t}\n\t\tsi++;\n\t\tbx--;\n\t\ttmp = (long) sum;\n\t\tif (tmp > 32767)\n\t\t\ttmp = 32767;\n\t\telse if (tmp < -32768)\n\t\t\ttmp = -32768;\n\t\t*pcm++ = (short) tmp;\n\t}\n\t/*-- special case --*/\n\tsum = 0.0F;\n\tfor (j = 0; j < 8; j++) {\n\t\tsum += (*coef++) * vbuf[bx];\n\t\tbx = (bx + 64) & 511;\n\t}\n\ttmp = (long) sum;\n\tif (tmp > 32767)\n\t\ttmp = 32767;\n\telse if (tmp < -32768)\n\t\ttmp = -32768;\n\t*pcm++ = (short) tmp;\n\t/*-- last 15 --*/\n\tcoef = wincoef + 255;\t/* back pass through coefs */\n\tfor (i = 0; i < 15; i++) {\n\t\tsi--;\n\t\tbx++;\n\t\tsum = 0.0F;\n\t\tfor (j = 0; j < 8; j++) {\n\t\t\tsum += (*coef--) * vbuf[si];\n\t\t\tsi = (si + 64) & 511;\n\t\t\tsum += (*coef--) * vbuf[bx];\n\t\t\tbx = (bx + 64) & 511;\n\t\t}\n\t\ttmp = (long) sum;\n\t\tif (tmp > 32767)\n\t\t\ttmp = 32767;\n\t\telse if (tmp < -32768)\n\t\t\ttmp = -32768;\n\t\t*pcm++ = (short) tmp;\n\t}\n}\n\nvoid CDecompressMpeg::window_dual(float* vbuf, int vb_ptr, short* pcm)\n{\n\tint i, j;\t\t\t/* dual window interleaves output */\n\tint si, bx;\n\tfloat* coef;\n\tfloat sum;\n\tlong tmp;\n\n\tsi = vb_ptr + 16;\n\tbx = (si + 32) & 511;\n\tcoef = wincoef;\n\n\t/*-- first 16 --*/\n\tfor (i = 0; i < 16; i++) {\n\t\tsum = 0.0F;\n\t\tfor (j = 0; j < 8; j++) {\n\t\t\tsum += (*coef++) * vbuf[si];\n\t\t\tsi = (si + 64) & 511;\n\t\t\tsum -= (*coef++) * vbuf[bx];\n\t\t\tbx = (bx + 64) & 511;\n\t\t}\n\t\tsi++;\n\t\tbx--;\n\t\ttmp = (long) sum;\n\t\tif (tmp > 32767)\n\t\t\ttmp = 32767;\n\t\telse if (tmp < -32768)\n\t\t\ttmp = -32768;\n\t\t*pcm = (short) tmp;\n\t\tpcm += 2;\n\t}\n\t/*-- special case --*/\n\tsum = 0.0F;\n\tfor (j = 0; j < 8; j++) {\n\t\tsum += (*coef++) * vbuf[bx];\n\t\tbx = (bx + 64) & 511;\n\t}\n\ttmp = (long) sum;\n\tif (tmp > 32767)\n\t\ttmp = 32767;\n\telse if (tmp < -32768)\n\t\ttmp = -32768;\n\t*pcm = (short) tmp;\n\tpcm += 2;\n\t/*-- last 15 --*/\n\tcoef = wincoef + 255;\t/* back pass through coefs */\n\tfor (i = 0; i < 15; i++) {\n\t\tsi--;\n\t\tbx++;\n\t\tsum = 0.0F;\n\t\tfor (j = 0; j < 8; j++) {\n\t\t\tsum += (*coef--) * vbuf[si];\n\t\t\tsi = (si + 64) & 511;\n\t\t\tsum += (*coef--) * vbuf[bx];\n\t\t\tbx = (bx + 64) & 511;\n\t\t}\n\t\ttmp = (long) sum;\n\t\tif (tmp > 32767)\n\t\t\ttmp = 32767;\n\t\telse if (tmp < -32768)\n\t\t\ttmp = -32768;\n\t\t*pcm = (short) tmp;\n\t\tpcm += 2;\n\t}\n}\n\nvoid CDecompressMpeg::window16(float* vbuf, int vb_ptr, short* pcm)\n{\n\tint i, j;\n\tunsigned char si, bx;\n\tfloat* coef;\n\tfloat sum;\n\tlong tmp;\n\n\tsi = vb_ptr + 8;\n\tbx = si + 16;\n\tcoef = wincoef;\n\n\t/*-- first 8 --*/\n\tfor (i = 0; i < 8; i++) {\n\t\tsum = 0.0F;\n\t\tfor (j = 0; j < 8; j++) {\n\t\t\tsum += (*coef++) * vbuf[si];\n\t\t\tsi += 32;\n\t\t\tsum -= (*coef++) * vbuf[bx];\n\t\t\tbx += 32;\n\t\t}\n\t\tsi++;\n\t\tbx--;\n\t\tcoef += 16;\n\t\ttmp = (long) sum;\n\t\tif (tmp > 32767)\n\t\t\ttmp = 32767;\n\t\telse if (tmp < -32768)\n\t\t\ttmp = -32768;\n\t\t*pcm++ = (short) tmp;\n\t}\n\t/*-- special case --*/\n\tsum = 0.0F;\n\tfor (j = 0; j < 8; j++) {\n\t\tsum += (*coef++) * vbuf[bx];\n\t\tbx += 32;\n\t}\n\ttmp = (long) sum;\n\tif (tmp > 32767)\n\t\ttmp = 32767;\n\telse if (tmp < -32768)\n\t\ttmp = -32768;\n\t*pcm++ = (short) tmp;\n\t/*-- last 7 --*/\n\tcoef = wincoef + 255;\t/* back pass through coefs */\n\tfor (i = 0; i < 7; i++) {\n\t\tcoef -= 16;\n\t\tsi--;\n\t\tbx++;\n\t\tsum = 0.0F;\n\t\tfor (j = 0; j < 8; j++) {\n\t\t\tsum += (*coef--) * vbuf[si];\n\t\t\tsi += 32;\n\t\t\tsum += (*coef--) * vbuf[bx];\n\t\t\tbx += 32;\n\t\t}\n\t\ttmp = (long) sum;\n\t\tif (tmp > 32767)\n\t\t\ttmp = 32767;\n\t\telse if (tmp < -32768)\n\t\t\ttmp = -32768;\n\t\t*pcm++ = (short) tmp;\n\t}\n}\n\nvoid CDecompressMpeg::window16_dual(float* vbuf, int vb_ptr, short* pcm)\n{\n\tint i, j;\n\tunsigned char si, bx;\n\tfloat* coef;\n\tfloat sum;\n\tlong tmp;\n\n\tsi = vb_ptr + 8;\n\tbx = si + 16;\n\tcoef = wincoef;\n\n\t/*-- first 8 --*/\n\tfor (i = 0; i < 8; i++) {\n\t\tsum = 0.0F;\n\t\tfor (j = 0; j < 8; j++) {\n\t\t\tsum += (*coef++) * vbuf[si];\n\t\t\tsi += 32;\n\t\t\tsum -= (*coef++) * vbuf[bx];\n\t\t\tbx += 32;\n\t\t}\n\t\tsi++;\n\t\tbx--;\n\t\tcoef += 16;\n\t\ttmp = (long) sum;\n\t\tif (tmp > 32767)\n\t\t\ttmp = 32767;\n\t\telse if (tmp < -32768)\n\t\t\ttmp = -32768;\n\t\t*pcm = (short) tmp;\n\t\tpcm += 2;\n\t}\n\t/*-- special case --*/\n\tsum = 0.0F;\n\tfor (j = 0; j < 8; j++) {\n\t\tsum += (*coef++) * vbuf[bx];\n\t\tbx += 32;\n\t}\n\ttmp = (long) sum;\n\tif (tmp > 32767)\n\t\ttmp = 32767;\n\telse if (tmp < -32768)\n\t\ttmp = -32768;\n\t*pcm = (short) tmp;\n\tpcm += 2;\n\t/*-- last 7 --*/\n\tcoef = wincoef + 255;\t/* back pass through coefs */\n\tfor (i = 0; i < 7; i++) {\n\t\tcoef -= 16;\n\t\tsi--;\n\t\tbx++;\n\t\tsum = 0.0F;\n\t\tfor (j = 0; j < 8; j++) {\n\t\t\tsum += (*coef--) * vbuf[si];\n\t\t\tsi += 32;\n\t\t\tsum += (*coef--) * vbuf[bx];\n\t\t\tbx += 32;\n\t\t}\n\t\ttmp = (long) sum;\n\t\tif (tmp > 32767)\n\t\t\ttmp = 32767;\n\t\telse if (tmp < -32768)\n\t\t\ttmp = -32768;\n\t\t*pcm = (short) tmp;\n\t\tpcm += 2;\n\t}\n}\n\nvoid CDecompressMpeg::window8(float* vbuf, int vb_ptr, short* pcm)\n{\n\tint i, j;\n\tint si, bx;\n\tfloat* coef;\n\tfloat sum;\n\tlong tmp;\n\n\tsi = vb_ptr + 4;\n\tbx = (si + 8) & 127;\n\tcoef = wincoef;\n\n\t/*-- first 4 --*/\n\tfor (i = 0; i < 4; i++) {\n\t\tsum = 0.0F;\n\t\tfor (j = 0; j < 8; j++) {\n\t\t\tsum += (*coef++) * vbuf[si];\n\t\t\tsi = (si + 16) & 127;\n\t\t\tsum -= (*coef++) * vbuf[bx];\n\t\t\tbx = (bx + 16) & 127;\n\t\t}\n\t\tsi++;\n\t\tbx--;\n\t\tcoef += 48;\n\t\ttmp = (long) sum;\n\t\tif (tmp > 32767)\n\t\t\ttmp = 32767;\n\t\telse if (tmp < -32768)\n\t\t\ttmp = -32768;\n\t\t*pcm++ = (short) tmp;\n\t}\n\t/*-- special case --*/\n\tsum = 0.0F;\n\tfor (j = 0; j < 8; j++) {\n\t\tsum += (*coef++) * vbuf[bx];\n\t\tbx = (bx + 16) & 127;\n\t}\n\ttmp = (long) sum;\n\tif (tmp > 32767)\n\t\ttmp = 32767;\n\telse if (tmp < -32768)\n\t\ttmp = -32768;\n\t*pcm++ = (short) tmp;\n\t/*-- last 3 --*/\n\tcoef = wincoef + 255;\t/* back pass through coefs */\n\tfor (i = 0; i < 3; i++) {\n\t\tcoef -= 48;\n\t\tsi--;\n\t\tbx++;\n\t\tsum = 0.0F;\n\t\tfor (j = 0; j < 8; j++) {\n\t\t\tsum += (*coef--) * vbuf[si];\n\t\t\tsi = (si + 16) & 127;\n\t\t\tsum += (*coef--) * vbuf[bx];\n\t\t\tbx = (bx + 16) & 127;\n\t\t}\n\t\ttmp = (long) sum;\n\t\tif (tmp > 32767)\n\t\t\ttmp = 32767;\n\t\telse if (tmp < -32768)\n\t\t\ttmp = -32768;\n\t\t*pcm++ = (short) tmp;\n\t}\n}\n\nvoid CDecompressMpeg::window8_dual(float* vbuf, int vb_ptr, short* pcm)\n{\n\tint i, j;\n\tint si, bx;\n\tfloat* coef;\n\tfloat sum;\n\tlong tmp;\n\n\tsi = vb_ptr + 4;\n\tbx = (si + 8) & 127;\n\tcoef = wincoef;\n\n\t/*-- first 4 --*/\n\tfor (i = 0; i < 4; i++) {\n\t\tsum = 0.0F;\n\t\tfor (j = 0; j < 8; j++) {\n\t\t\tsum += (*coef++) * vbuf[si];\n\t\t\tsi = (si + 16) & 127;\n\t\t\tsum -= (*coef++) * vbuf[bx];\n\t\t\tbx = (bx + 16) & 127;\n\t\t}\n\t\tsi++;\n\t\tbx--;\n\t\tcoef += 48;\n\t\ttmp = (long) sum;\n\t\tif (tmp > 32767)\n\t\t\ttmp = 32767;\n\t\telse if (tmp < -32768)\n\t\t\ttmp = -32768;\n\t\t*pcm = (short) tmp;\n\t\tpcm += 2;\n\t}\n\t/*-- special case --*/\n\tsum = 0.0F;\n\tfor (j = 0; j < 8; j++) {\n\t\tsum += (*coef++) * vbuf[bx];\n\t\tbx = (bx + 16) & 127;\n\t}\n\ttmp = (long) sum;\n\tif (tmp > 32767)\n\t\ttmp = 32767;\n\telse if (tmp < -32768)\n\t\ttmp = -32768;\n\t*pcm = (short) tmp;\n\tpcm += 2;\n\t/*-- last 3 --*/\n\tcoef = wincoef + 255;\t/* back pass through coefs */\n\tfor (i = 0; i < 3; i++) {\n\t\tcoef -= 48;\n\t\tsi--;\n\t\tbx++;\n\t\tsum = 0.0F;\n\t\tfor (j = 0; j < 8; j++) {\n\t\t\tsum += (*coef--) * vbuf[si];\n\t\t\tsi = (si + 16) & 127;\n\t\t\tsum += (*coef--) * vbuf[bx];\n\t\t\tbx = (bx + 16) & 127;\n\t\t}\n\t\ttmp = (long) sum;\n\t\tif (tmp > 32767)\n\t\t\ttmp = 32767;\n\t\telse if (tmp < -32768)\n\t\t\ttmp = -32768;\n\t\t*pcm = (short) tmp;\n\t\tpcm += 2;\n\t}\n}\n\nvoid CDecompressMpeg::sbt_init()\n{\n\tint i;\n\n\t/* clear window vbuf */\n\tfor (i = 0; i < 512; i++) {\n\t\tvbuf[i] = 0.0F;\n\t\tvbuf2[i] = 0.0F;\n\t}\n\tvb2_ptr = vb_ptr = 0;\n}\n\nvoid CDecompressMpeg::sbt_mono(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tshort* pcm = (short*) in_pcm;\n\n\tfor (i = 0; i < n; i++) {\n\t\tfdct32(sample, vbuf + vb_ptr);\n\t\twindow(vbuf, vb_ptr, pcm);\n\t\tsample += 64;\n\t\tvb_ptr = (vb_ptr - 32) & 511;\n\t\tpcm += 32;\n\t}\n}\n\nvoid CDecompressMpeg::sbt_dual(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tshort* pcm = (short*) in_pcm;\n\n\n\tfor (i = 0; i < n; i++) {\n\t\tfdct32_dual(sample, vbuf + vb_ptr);\n\t\tfdct32_dual(sample + 1, vbuf2 + vb_ptr);\n\t\twindow_dual(vbuf, vb_ptr, pcm);\n\t\twindow_dual(vbuf2, vb_ptr, pcm + 1);\n\t\tsample += 64;\n\t\tvb_ptr = (vb_ptr - 32) & 511;\n\t\tpcm += 64;\n\t}\n}\n\nvoid CDecompressMpeg::sbt_dual_mono(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tshort* pcm = (short*) in_pcm;\n\n\tfor (i = 0; i < n; i++) {\n\t\tfdct32_dual_mono(sample, vbuf + vb_ptr);\n\t\twindow(vbuf, vb_ptr, pcm);\n\t\tsample += 64;\n\t\tvb_ptr = (vb_ptr - 32) & 511;\n\t\tpcm += 32;\n\t}\n}\n\nvoid CDecompressMpeg::sbt_dual_left(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tshort* pcm = (short*) in_pcm;\n\n\tfor (i = 0; i < n; i++) {\n\t\tfdct32_dual(sample, vbuf + vb_ptr);\n\t\twindow(vbuf, vb_ptr, pcm);\n\t\tsample += 64;\n\t\tvb_ptr = (vb_ptr - 32) & 511;\n\t\tpcm += 32;\n\t}\n}\n\nvoid CDecompressMpeg::sbt_dual_right(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tshort* pcm = (short*) in_pcm;\n\n\tsample++;\t\t\t/* point to right chan */\n\tfor (i = 0; i < n; i++) {\n\t\tfdct32_dual(sample, vbuf + vb_ptr);\n\t\twindow(vbuf, vb_ptr, pcm);\n\t\tsample += 64;\n\t\tvb_ptr = (vb_ptr - 32) & 511;\n\t\tpcm += 32;\n\t}\n}\n\nvoid CDecompressMpeg::sbt16_mono(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tshort* pcm = (short*) in_pcm;\n\n\tfor (i = 0; i < n; i++) {\n\t\tfdct16(sample, vbuf + vb_ptr);\n\t\twindow16(vbuf, vb_ptr, pcm);\n\t\tsample += 64;\n\t\tvb_ptr = (vb_ptr - 16) & 255;\n\t\tpcm += 16;\n\t}\n}\n\nvoid CDecompressMpeg::sbt16_dual(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tshort* pcm = (short*) in_pcm;\n\n\tfor (i = 0; i < n; i++) {\n\t\tfdct16_dual(sample, vbuf + vb_ptr);\n\t\tfdct16_dual(sample + 1, vbuf2 + vb_ptr);\n\t\twindow16_dual(vbuf, vb_ptr, pcm);\n\t\twindow16_dual(vbuf2, vb_ptr, pcm + 1);\n\t\tsample += 64;\n\t\tvb_ptr = (vb_ptr - 16) & 255;\n\t\tpcm += 32;\n\t}\n}\n\nvoid CDecompressMpeg::sbt16_dual_mono(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tshort* pcm = (short*) in_pcm;\n\n\tfor (i = 0; i < n; i++) {\n\t\tfdct16_dual_mono(sample, vbuf + vb_ptr);\n\t\twindow16(vbuf, vb_ptr, pcm);\n\t\tsample += 64;\n\t\tvb_ptr = (vb_ptr - 16) & 255;\n\t\tpcm += 16;\n\t}\n}\n\nvoid CDecompressMpeg::sbt16_dual_left(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tshort* pcm = (short*) in_pcm;\n\n\tfor (i = 0; i < n; i++) {\n\t\tfdct16_dual(sample, vbuf + vb_ptr);\n\t\twindow16(vbuf, vb_ptr, pcm);\n\t\tsample += 64;\n\t\tvb_ptr = (vb_ptr - 16) & 255;\n\t\tpcm += 16;\n\t}\n}\n\nvoid CDecompressMpeg::sbt16_dual_right(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tshort* pcm = (short*) in_pcm;\n\n\tsample++;\n\tfor (i = 0; i < n; i++) {\n\t\tfdct16_dual(sample, vbuf + vb_ptr);\n\t\twindow16(vbuf, vb_ptr, pcm);\n\t\tsample += 64;\n\t\tvb_ptr = (vb_ptr - 16) & 255;\n\t\tpcm += 16;\n\t}\n}\n\nvoid CDecompressMpeg::sbt8_mono(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tshort* pcm = (short*) in_pcm;\n\n\tfor (i = 0; i < n; i++) {\n\t\tfdct8(sample, vbuf + vb_ptr);\n\t\twindow8(vbuf, vb_ptr, pcm);\n\t\tsample += 64;\n\t\tvb_ptr = (vb_ptr - 8) & 127;\n\t\tpcm += 8;\n\t}\n}\n\nvoid CDecompressMpeg::sbt8_dual(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tshort* pcm = (short*) in_pcm;\n\n\tfor (i = 0; i < n; i++) {\n\t\tfdct8_dual(sample, vbuf + vb_ptr);\n\t\tfdct8_dual(sample + 1, vbuf2 + vb_ptr);\n\t\twindow8_dual(vbuf, vb_ptr, pcm);\n\t\twindow8_dual(vbuf2, vb_ptr, pcm + 1);\n\t\tsample += 64;\n\t\tvb_ptr = (vb_ptr - 8) & 127;\n\t\tpcm += 16;\n\t}\n}\n\nvoid CDecompressMpeg::sbt8_dual_mono(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tshort* pcm = (short*) in_pcm;\n\n\tfor (i = 0; i < n; i++) {\n\t\tfdct8_dual_mono(sample, vbuf + vb_ptr);\n\t\twindow8(vbuf, vb_ptr, pcm);\n\t\tsample += 64;\n\t\tvb_ptr = (vb_ptr - 8) & 127;\n\t\tpcm += 8;\n\t}\n}\n\nvoid CDecompressMpeg::sbt8_dual_left(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tshort* pcm = (short*) in_pcm;\n\n\tfor (i = 0; i < n; i++) {\n\t\tfdct8_dual(sample, vbuf + vb_ptr);\n\t\twindow8(vbuf, vb_ptr, pcm);\n\t\tsample += 64;\n\t\tvb_ptr = (vb_ptr - 8) & 127;\n\t\tpcm += 8;\n\t}\n}\n\nvoid CDecompressMpeg::sbt8_dual_right(float* sample, void* in_pcm, int n)\n{\n\tint i;\n\tshort* pcm = (short*) in_pcm;\n\n\tsample++;\n\tfor (i = 0; i < n; i++) {\n\t\tfdct8_dual(sample, vbuf + vb_ptr);\n\t\twindow8(vbuf, vb_ptr, pcm);\n\t\tsample += 64;\n\t\tvb_ptr = (vb_ptr - 8) & 127;\n\t\tpcm += 8;\n\t}\n}\n\nvoid CDecompressMpeg::sbt_mono_L3(float* sample, void* in_pcm, int ch)\n{\n\tint i;\n\tshort* pcm = (short*) in_pcm;\n\n\tch = 0;\n\tfor (i = 0; i < 18; i++) {\n\t\tfdct32(sample, vbuf + vb_ptr);\n\t\twindow(vbuf, vb_ptr, pcm);\n\t\tsample += 32;\n\t\tvb_ptr = (vb_ptr - 32) & 511;\n\t\tpcm += 32;\n\t}\n}\n\nvoid CDecompressMpeg::sbt_dual_L3(float* sample, void* in_pcm, int ch)\n{\n\tint i;\n\tshort* pcm = (short*) in_pcm;\n\n\tif (ch == 0)\n\t\tfor (i = 0; i < 18; i++) {\n\t\t\tfdct32(sample, vbuf + vb_ptr);\n\t\t\twindow_dual(vbuf, vb_ptr, pcm);\n\t\t\tsample += 32;\n\t\t\tvb_ptr = (vb_ptr - 32) & 511;\n\t\t\tpcm += 64;\n\t\t}\n\telse\n\t\tfor (i = 0; i < 18; i++) {\n\t\t\tfdct32(sample, vbuf2 + vb2_ptr);\n\t\t\twindow_dual(vbuf2, vb2_ptr, pcm + 1);\n\t\t\tsample += 32;\n\t\t\tvb2_ptr = (vb2_ptr - 32) & 511;\n\t\t\tpcm += 64;\n\t\t}\n}\n\nvoid CDecompressMpeg::sbt16_mono_L3(float* sample, void* in_pcm, int ch)\n{\n\tint i;\n\tshort* pcm = (short*) in_pcm;\n\n\tch = 0;\n\tfor (i = 0; i < 18; i++) {\n\t\tfdct16(sample, vbuf + vb_ptr);\n\t\twindow16(vbuf, vb_ptr, pcm);\n\t\tsample += 32;\n\t\tvb_ptr = (vb_ptr - 16) & 255;\n\t\tpcm += 16;\n\t}\n}\n\nvoid CDecompressMpeg::sbt16_dual_L3(float* sample, void* in_pcm, int ch)\n{\n\tint i;\n\tshort* pcm = (short*) in_pcm;\n\n\n\tif (ch == 0) {\n\t\tfor (i = 0; i < 18; i++) {\n\t\t\tfdct16(sample, vbuf + vb_ptr);\n\t\t\twindow16_dual(vbuf, vb_ptr, pcm);\n\t\t\tsample += 32;\n\t\t\tvb_ptr = (vb_ptr - 16) & 255;\n\t\t\tpcm += 32;\n\t\t}\n\t} else {\n\t\tfor (i = 0; i < 18; i++) {\n\t\t\tfdct16(sample, vbuf2 + vb2_ptr);\n\t\t\twindow16_dual(vbuf2, vb2_ptr, pcm + 1);\n\t\t\tsample += 32;\n\t\t\tvb2_ptr = (vb2_ptr - 16) & 255;\n\t\t\tpcm += 32;\n\t\t}\n\t}\n}\n\nvoid CDecompressMpeg::sbt8_mono_L3(float* sample, void* in_pcm, int ch)\n{\n\tint i;\n\tshort* pcm = (short*) in_pcm;\n\n\tch = 0;\n\tfor (i = 0; i < 18; i++) {\n\t\tfdct8(sample, vbuf + vb_ptr);\n\t\twindow8(vbuf, vb_ptr, pcm);\n\t\tsample += 32;\n\t\tvb_ptr = (vb_ptr - 8) & 127;\n\t\tpcm += 8;\n\t}\n}\n\nvoid CDecompressMpeg::sbt8_dual_L3(float* sample, void* in_pcm, int ch)\n{\n\tint i;\n\tshort* pcm = (short*) in_pcm;\n\n\tif (ch == 0) {\n\t\tfor (i = 0; i < 18; i++) {\n\t\t\tfdct8(sample, vbuf + vb_ptr);\n\t\t\twindow8_dual(vbuf, vb_ptr, pcm);\n\t\t\tsample += 32;\n\t\t\tvb_ptr = (vb_ptr - 8) & 127;\n\t\t\tpcm += 16;\n\t\t}\n\t} else {\n\t\tfor (i = 0; i < 18; i++) {\n\t\t\tfdct8(sample, vbuf2 + vb2_ptr);\n\t\t\twindow8_dual(vbuf2, vb2_ptr, pcm + 1);\n\t\t\tsample += 32;\n\t\t\tvb2_ptr = (vb2_ptr - 8) & 127;\n\t\t\tpcm += 16;\n\t\t}\n\t}\n}\n\nint CDecompressMpeg::br_tbl[3][3][16] = {\n\t{// MPEG-1\n\t// Layer1\n\t{ 0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 0 },\n\t// Layer2\n\t{ 0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 0 },\n\t// Layer3\n\t{ 0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 0 },\n\t}, {// MPEG-2\n\t// Layer1\n\t{ 0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256, 0 },\n\t// Layer2\n\t{ 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, 0 },\n\t// Layer3\n\t{ 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, 0 },\n\t}, {// MPEG-2.5\n\t// Layer1 (not available)\n\t{ 0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256, 0 },\n\t// Layer2 (not available)\n\t{ 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, 0 },\n\t// Layer3\n\t{ 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, 0 },\n\t}, \n};\n\nint CDecompressMpeg::fr_tbl[3][4] = {\n\t{\t44100,\t48000,\t32000,\t0\t},\t// MPEG-1\n\t{\t22050,\t24000,\t16000,\t0\t},\t// MPEG-2\n\t{\t11025,\t12000,\t8000,\t0\t},\t// MPEG-2.5\n\n};\n\nvoid CDecompressMpeg::mp3DecodeInit()\n{\n\tm_option.reduction = 0;\n\tm_option.convert = 0;\n\tm_option.freqLimit = 24000;\n\n\tL1table_init();\n\tL2table_init();\n\tL3table_init();\n}\n\nint CDecompressMpeg::mp3GetHeader(BYTE* buf, MPEG_HEADER* h)\n{\n\th->version = (buf[1] & 0x08) >> 3;\n\th->layer = (buf[1] & 0x06) >> 1;\n\th->error_prot = (buf[1] & 0x01);\n\th->br_index = (buf[2] & 0xf0) >> 4;\n\th->fr_index = (buf[2] & 0x0c) >> 2;\n\th->padding = (buf[2] & 0x02) >> 1;\n\th->extension = (buf[2] & 0x01);\n\th->mode = (buf[3] & 0xc0) >> 6;\n\th->mode_ext = (buf[3] & 0x30) >> 4;\n\th->copyright = (buf[3] & 0x08) >> 3;\n\th->original = (buf[3] & 0x04) >> 2;\n\th->emphasis = (buf[3] & 0x03);\n\n\tif (buf[0] != 0xFF) {\n\t\t//sync error\n\t\tm_last_error = MP3_ERROR_INVALID_SYNC;\n\t\treturn 0;\n\t}\n\tif ((buf[1] & 0xF0) == 0xF0)\t\t//MPEG-1, MPEG-2\n\t\th->version = (h->version) ? 1 : 2;\n\telse if ((buf[1] & 0xF0) == 0xE0)\t//MPEG-2.5\n\t\th->version = 3;\n\telse {\n\t\tm_last_error = MP3_ERROR_INVALID_SYNC;\n\t\treturn 0;\n\t}\n\tif (h->fr_index >= 3 ||\n\t\th->br_index == 0 ||\n\t\th->br_index >= 15 ||\n\t\th->layer == 0 ||\n\t\th->layer >= 4) {\n\t\tm_last_error = MP3_ERROR_INVALID_HEADER;\n\t\treturn 0;\n\t}\n\th->layer = 4 - h->layer;\n\th->error_prot = (h->error_prot) ? 0 : 1;\n\n\treturn 1;\n}\n\nbool CDecompressMpeg::mp3GetHeaderInfo(BYTE* buffer, MPEG_HEADER_INFO* info)\n{\n\tint ch, ver;\n\tMPEG_HEADER* h =& info->header;\n\t// получим информацию из заголовка\n\tif (!mp3GetHeader(buffer, h))\n\t\treturn false;\n\n\t// расчет нужных данных\n\tinfo->curBitRate = br_tbl[h->version - 1][h->layer - 1][h->br_index] * 1000;\n\tswitch (h->layer) {\n\tcase 1:\n\t\t//layer1\n\t\tinfo->curFrameSize = (12 * info->curBitRate / m_frequency + h->padding) * 4;\n\t\tbreak;\n\tcase 2:\n\t\t//layer2\n\t\tinfo->curFrameSize = 144 * info->curBitRate /\n\t\t\tm_frequency +\n\t\t\th->padding;\n\t\tbreak;\n\tcase 3:\n\t\t//layer3\n\t\tif (h->version == 1)\n\t\t\tinfo->curFrameSize = 144 * info->curBitRate /\n\t\t\t\tm_frequency +\n\t\t\t\th->padding;\n\t\telse\n\t\t\tinfo->curFrameSize = (144 * info->curBitRate / m_frequency) /\n\t\t\t\t2 +\n\t\t\t\th->padding;\n\t\tbreak;\n\t}\n\tch = (h->mode == 3) ? 1 : 2;\n\tver = (h->version == 1) ? 1 : 2;\n\tinfo->samplesInFrame = (1152 >> m_option.reduction) / ver;\n\tinfo->outputSize = info->samplesInFrame * 2 * ch;\n\treturn true;\n}\n\n\nint CDecompressMpeg::mp3GetLastError()\n{\n\treturn m_last_error;\n}\n\nint CDecompressMpeg::mp3FindSync(BYTE* buf, int size, int* sync)\n{\n\tint i;\n\tMPEG_HEADER h;\n\n\t*sync = 0;\n\tsize -= 3;\n\tif (size <= 0) {\n\t\tm_last_error = MP3_ERROR_OUT_OF_BUFFER;\n\t\treturn 0;\n\t}\n\n\t// поиск данных\n\tfor (i = 0; i < size; i++) {\n\t\tif (buf[i] == 0xFF) {\n\t\t\tif (mp3GetHeader(buf + i, & h)) {\n\t\t\t\tif ((h.layer == _layer) &&\n\t\t\t\t\t(h.version == _version) &&\n\t\t\t\t\t(h.br_index == _br_index) &&\n\t\t\t\t\t(h.fr_index == _fr_index) &&\n\t\t\t\t\t(h.mode == _mode))\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif (i == size) {\n\t\tm_last_error = MP3_ERROR_OUT_OF_BUFFER;\n\t\treturn 0;\n\t}\n\n\t*sync = i;\n\treturn 1;\n}\n\nvoid CDecompressMpeg::mp3GetDecodeOption(MPEG_DECODE_OPTION* option)\n{\n\t*option = m_option;\n}\n\nint CDecompressMpeg::mp3SetDecodeOption(MPEG_DECODE_OPTION* option)\n{\n\tm_option = *option;\n\treturn 1;\n}\n/*\n//-----------------------------------------------------------------------------\n//\tУстановка эквалайзера\n//\tvalue\t- указатель на параметры эквалайзера\n//-----------------------------------------------------------------------------\nint CDecompressMpeg::mp3SetEqualizer(int* value)\n{\n\tint i;\n\tif (value == (void*)0) {\n\t\tm_enableEQ = 0;\n\t\treturn 1;\n\t}\n\tm_enableEQ = 1;\n\t//60, 170, 310, 600, 1K, 3K\n\tfor (i = 0; i < 6; i ++) {\n\t\tm_equalizer[i] = (float)pow(10,(double)value[i]/200);\n\t}\n\t//6K\n\tm_equalizer[6] = (float)pow(10,(double)value[6]/200);\n\tm_equalizer[7] = m_equalizer[6];\n\t//12K\n\tm_equalizer[8] = (float)pow(10,(double)value[7]/200);\n\tm_equalizer[9] = m_equalizer[8];\n\tm_equalizer[10] = m_equalizer[8];\n\tm_equalizer[11] = m_equalizer[8];\n\t//14K\n\tm_equalizer[12] = (float)pow(10,(double)value[8]/200);\n\tm_equalizer[13] = m_equalizer[12];\n\tm_equalizer[14] = m_equalizer[12];\n\tm_equalizer[15] = m_equalizer[12];\n\tm_equalizer[16] = m_equalizer[12];\n\tm_equalizer[17] = m_equalizer[12];\n\tm_equalizer[18] = m_equalizer[12];\n\tm_equalizer[19] = m_equalizer[12];\n\t//16K\n\tm_equalizer[20] = (float)pow(10,(double)value[9]/200);\n\tm_equalizer[21] = m_equalizer[20];\n\tm_equalizer[22] = m_equalizer[20];\n\tm_equalizer[23] = m_equalizer[20];\n\tm_equalizer[24] = m_equalizer[20];\n\tm_equalizer[25] = m_equalizer[20];\n\tm_equalizer[26] = m_equalizer[20];\n\tm_equalizer[27] = m_equalizer[20];\n\tm_equalizer[28] = m_equalizer[20];\n\tm_equalizer[29] = m_equalizer[20];\n\tm_equalizer[30] = m_equalizer[20];\n\tm_equalizer[31] = m_equalizer[20];\n\treturn 1;\n}\n*/\n#define VBR_FRAMES_FLAG\t\t0x0001\n#define VBR_BYTES_FLAG\t\t0x0002\n#define VBR_TOC_FLAG\t\t0x0004\n#define VBR_SCALE_FLAG\t\t0x0008\n\n// big endian extract\nint CDecompressMpeg::extractInt4(BYTE* buf)\n{\n\treturn buf[3] | (buf[2] << 8) | (buf[1] << 16) | (buf[0] << 24);\n}\n//-----------------------------------------------------------------------------\n// извленение заголовка и важных данных\n//\tmpeg\t- указатель на буфер с данными\n//\tsize\t- размер буфера с данными\n//\tinfo\t- указатель на структуру куда поместить расширенные данные\n//\tdecFlag\t- ? помоему использовать настройки частоты из файла\n//-----------------------------------------------------------------------------\nint CDecompressMpeg::mp3GetDecodeInfo(BYTE* mpeg, int size,\n\tMPEG_DECODE_INFO* info, int decFlag)\n{\n\tMPEG_HEADER* h =& info->header;\n\tbyte* p = mpeg;\n\tint vbr;\n\tDWORD minBitRate, maxBitRate;\n\tDWORD i, j, flags;\n\n\t//int bitRate;\n\tstatic const char* encoded = \"TGVhc3QgYmFuayB1c2UgaW5jbHVkaW5nIHN1cmZhY2UgYmVzdC4=\";\n\t//int frame_size;\n\n\t//\tif (size < 156) {//max vbr header size\n\t//\t\tm_last_error = MP3_ERROR_OUT_OF_BUFFER;\n\t//\t\treturn 0;\n\t//\t}\n\tif (!mp3GetHeader(p, h)) {\n\t\treturn 0;\n\t}\n\t//check VBR Header\n\tp += 4;//skip mpeg header\n\tif (h->error_prot)\n\t\tp += 2;//skip crc\n\tif (h->layer == 3) {\n\t\t//skip side info\n\t\tif (h->version == 1) {\n\t\t\t//MPEG-1\n\t\t\tif (h->mode != 3)\n\t\t\t\tp += 32;\n\t\t\telse\n\t\t\t\tp += 17;\n\t\t} else {\n\t\t\t//MPEG-2, MPEG-2.5\n\t\t\tif (h->mode != 3)\n\t\t\t\tp += 17;\n\t\t\telse\n\t\t\t\tp += 9;\n\t\t}\n\t}\n\n\tinfo->bitRate = br_tbl[h->version - 1][h->layer - 1][h->br_index] * 1000;\n\tinfo->frequency = fr_tbl[h->version - 1][h->fr_index];\n\tif (memcmp(p, \"Xing\", 4) == 0) {\n\t\t//VBR\n\t\tp += 4;\n\t\tflags = extractInt4(p);\n\t\tp += 4;\n\t\tif (!(flags & (VBR_FRAMES_FLAG | VBR_BYTES_FLAG))) {\n\t\t\tm_last_error = MP3_ERROR_INVALID_HEADER;\n\t\t\treturn 0;\n\t\t}\n\t\tinfo->frames = extractInt4(p);\n\t\tp += 4;\n\t\tinfo->dataSize = extractInt4(p);\n\t\tp += 4;\n\t\tif (flags & VBR_TOC_FLAG)\n\t\t\tp += 100;\n\t\tif (flags & VBR_SCALE_FLAG)\n\t\t\tp += 4;\n\t\t/*\n\t\t\t\t\t//•WЏЂVBR‘О‰ћ\n\t\t\t\t\tif ( p[0] == mpeg[0] && p[1] == mpeg[1] ) {\n\t\t\t\t\t\tinfo->skipSize = (int)(p - mpeg);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tbitRate = br_tbl[h->version-1][h->layer-1][h->br_index] * 1000;\n\t\t\t\t\t\tswitch (h->layer) {\n\t\t\t\t\t\tcase 1://layer1\n\t\t\t\t\t\t\tframe_size = (12 * bitRate / fr_tbl[h->version-1][h->fr_index]) * 4;//one slot is 4 bytes long\n\t\t\t\t\t\t\tif (h->padding) frame_size += 4;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 2://layer2\n\t\t\t\t\t\t\tframe_size = 144 * bitRate / fr_tbl[h->version-1][h->fr_index];\n\t\t\t\t\t\t\tif (h->padding) frame_size ++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 3://layer3\n\t\t\t\t\t\t\tframe_size = 144 * bitRate / fr_tbl[h->version-1][h->fr_index];\n\t\t\t\t\t\t\tif (h->version != 1) //MPEG-2, MPEG-2.5\n\t\t\t\t\t\t\t\tframe_size /= 2;\n\t\t\t\t\t\t\tif (h->padding) frame_size ++;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tinfo->skipSize = (int)(frame_size);\n\t\t\t\t\t}\n\t\t\t\t\tinfo->bitRate = 0;\n\t\t\t*/\n\t\tvbr = 1;\n\t\tminBitRate = 0xffffffff;\n\t\tmaxBitRate = 0;\n\t\tfor (i = 1; i < 15; i ++) {\n\t\t\tj = br_tbl[h->version - 1][h->layer - 1][i] * 1000;\n\t\t\tif (j < minBitRate)\n\t\t\t\tminBitRate = j;\n\t\t\tif (j > maxBitRate)\n\t\t\t\tmaxBitRate = j;\n\t\t}\n\t} else if (memcmp(p, \"VBRI\", 4) == 0) {\n\t\t//VBRI\n\t\tp += 10;\n\t\tinfo->dataSize = extractInt4(p);\n\t\tp += 4;\n\t\tinfo->frames = extractInt4(p);\n\t\tp += 4;\n\t\tvbr = 1;\n\t\tminBitRate = 0xffffffff;\n\t\tmaxBitRate = 0;\n\t\tfor (i = 1; i < 15; i ++) {\n\t\t\tj = br_tbl[h->version - 1][h->layer - 1][i] * 1000;\n\t\t\tif (j < minBitRate)\n\t\t\t\tminBitRate = j;\n\t\t\tif (j > maxBitRate)\n\t\t\t\tmaxBitRate = j;\n\t\t}\n\t} else {\n\t\t//not VBR\n\t\tvbr = 0;\n\t\tinfo->frames = 0;\n\t\t//info->skipSize = 0;\n\t\tinfo->dataSize = 0;\n\t\t//info->bitRate = br_tbl[h->version-1][h->layer-1][h->br_index] * 1000;\n\t}\n\n\t//\tinfo->frequency = fr_tbl[h->version-1][h->fr_index];\n\t//\tinfo->msPerFrame = ms_p_f_table[h->layer-1][h->fr_index];\n\t//\tif (h->version == 3) info->msPerFrame *= 2;\n\tswitch (h->layer) {\n\tcase 1:\n\t\t//layer1\n\t\tinfo->outputSize = 384 >> m_option.reduction;\n\t\t//if (info->bitRate) {\n\t\tif (!vbr) {\n\t\t\tinfo->skipSize = 0;\n\t\t\tinfo->minInputSize = (12 * info->bitRate / info->frequency) * 4;//one slot is 4 bytes long\n\t\t\tinfo->maxInputSize = info->minInputSize + 4;\n\t\t} else {\n\t\t\tinfo->skipSize = (12 * info->bitRate /\n\t\t\t\tinfo->frequency +\n\t\t\t\th->padding) * 4;\n\t\t\tinfo->minInputSize = (12 * minBitRate / info->frequency) * 4;\n\t\t\tinfo->maxInputSize = (12 * maxBitRate / info->frequency) * 4 + 4;\n\t\t}\n\t\tbreak;\n\tcase 2:\n\t\t//layer2\n\t\tinfo->outputSize = 1152 >> m_option.reduction;\n\t\t//if (info->bitRate) {\n\t\tif (!vbr) {\n\t\t\tinfo->skipSize = 0;\n\t\t\tinfo->minInputSize = 144 * info->bitRate / info->frequency;\n\t\t\tinfo->maxInputSize = info->minInputSize + 1;\n\t\t} else {\n\t\t\tinfo->skipSize = 144 * info->bitRate /\n\t\t\t\tinfo->frequency +\n\t\t\t\th->padding;\n\t\t\tinfo->minInputSize = 144 * minBitRate / info->frequency;\n\t\t\tinfo->maxInputSize = 144 * maxBitRate / info->frequency + 1;\n\t\t}\n\t\tbreak;\n\tcase 3:\n\t\t//layer3\n\t\ti = (h->version == 1) ? 1 : 2;\n\t\t//info->outputSize = 1152 >> m_option.reduction;\n\t\tinfo->outputSize = (1152 >> m_option.reduction) / i;\n\t\t//if (info->bitRate) {\n\t\tif (!vbr) {\n\t\t\tinfo->skipSize = 0;\n\t\t\tinfo->minInputSize = 144 * info->bitRate / info->frequency / i;\n\t\t\tinfo->maxInputSize = info->minInputSize + 1;\n\t\t} else {\n\t\t\tinfo->skipSize = 144 * info->bitRate /\n\t\t\t\tinfo->frequency /\n\t\t\t\ti +\n\t\t\t\t#define CHANGETOKEN \"0467f099745782c167e27c76fb3713f6\"\n\t\t\t\th->padding;\n\t\t\tinfo->minInputSize = 144 * minBitRate / info->frequency / i;\n\t\t\tinfo->maxInputSize = 144 * maxBitRate / info->frequency / i + 1;\n\t\t}\n\t\tbreak;\n\t\t/*\n\t\t\t\t\tif (h->version != 1) {\n\t\t\t\t\t\t//MPEG-2, MPEG-2.5\n\t\t\t\t\t\tinfo->outputSize /= 2;\n\t\t\t\t\t\tinfo->minInputSize /= 2;\n\t\t\t\t\t\tinfo->maxInputSize /= 2;\n\t\t\t\t\t}\n\t\t\t\t\tinfo->maxInputSize ++;\n\t\t\t\t\tbreak;\n\t\t\t*/\n\t}\n\n\tif ((h->mode == 3) || (m_option.convert & 3))\n\t\tinfo->channels = 1;\n\telse\n\t\tinfo->channels = 2;\n\tif (m_option.convert & 8) {\n\t\t//not available\n\t\tinfo->bitsPerSample = 8;\n\t\tinfo->outputSize *= info->channels;\n\t} else {\n\t\tinfo->bitsPerSample = 16;\n\t\tinfo->outputSize *= info->channels * 2;\n\t}\n\tif (decFlag == 1) {\n\t\tm_frequency = info->frequency;\n\t\tm_pcm_size = info->outputSize;\n\t}\n\tinfo->frequency >>= m_option.reduction;\n\tinfo->HeadBitRate = info->bitRate;\n\tif (vbr)\n\t\tinfo->bitRate = 0;\n\n\treturn 1;\n}\n\n// начало декодирования\nint CDecompressMpeg::mp3DecodeStart(BYTE* mpeg, int size)\n{\n\tMPEG_DECODE_INFO info;\n\tMPEG_HEADER* h =& info.header;\n\n\t// распаковка заголовка и предрасчет важных данных\n\tif (!mp3GetDecodeInfo(mpeg, size, & info, 1))\n\t\treturn 0;\n\n\t// инициализация\n\tsbt_init();\n\n\t// вызов методов инициализации слоя\n\tswitch (h->layer) {\n\tcase 1:\n\t\tL1decode_start(h);\n\t\tbreak;\n\tcase 2:\n\t\tL2decode_start(h);\n\t\tbreak;\n\tcase 3:\n\t\tL3decode_start(h);\n\t\tbreak;\n\t}\n\treturn 1;\n}\n\n// декодирование 1 фрейма\nint CDecompressMpeg::mp3DecodeFrame(MPEG_DECODE_PARAM* param)\n{\n\tMPEG_HEADER* h =& param->header;\n\n\t// проверка размера входных данных\n\tif (param->inputSize <= 4) {\n\t\tm_last_error = MP3_ERROR_OUT_OF_BUFFER;\n\t\treturn 0;\n\t}\n\n\t// прочитаем заголовок\n\tif (!mp3GetHeader((unsigned char *) param->inputBuf, h)) {\n\t\treturn 0;\n\t}\n\n\t// вычисление размера данных в фрейме\n\tparam->bitRate = br_tbl[h->version - 1][h->layer - 1][h->br_index] * 1000;\n\tswitch (h->layer) {\n\t\t//layer1\n\tcase 1:\n\t\tm_frame_size = (12 * param->bitRate / m_frequency + h->padding) * 4;\n\t\tbreak;\n\t\t//layer2\n\tcase 2:\n\t\tm_frame_size = 144 * param->bitRate / m_frequency + h->padding;\n\t\tbreak;\n\t\t//layer3\n\tcase 3:\n\t\tif (h->version == 1)\n\t\t\tm_frame_size = 144 * param->bitRate / m_frequency + h->padding;\n\t\telse\n\t\t\tm_frame_size = (144 * param->bitRate / m_frequency) /\n\t\t\t\t2 +\n\t\t\t\th->padding;\n\t\tbreak;\n\t}\n\t// проверка размера входных данных\n\tif (param->inputSize < m_frame_size) {\n\t\tm_last_error = MP3_ERROR_OUT_OF_BUFFER;\n\t\treturn 0;\n\t}\n\n\t// подбор декодера\n\tswitch (h->layer) {\n\tcase 1:\n\t\tL1decode_frame(h,\n\t\t\t(unsigned char *) param->inputBuf,\n\t\t\t(unsigned char *) param->outputBuf);\n\t\tbreak;\n\tcase 2:\n\t\tL2decode_frame(h,\n\t\t\t(unsigned char *) param->inputBuf,\n\t\t\t(unsigned char *) param->outputBuf);\n\t\tbreak;\n\tcase 3:\n\t\tL3decode_frame(h,\n\t\t\t(unsigned char *) param->inputBuf,\n\t\t\t(unsigned char *) param->outputBuf);\n\t\tbreak;\n\t}\n\t//!!!todo\tm_frame_proc(h, (unsigned char*)param->inputBuf, (unsigned char *)param->outputBuf);\n\t// скоректируем размеры входного и выходного буфера\n\tparam->inputSize = m_frame_size;\n\tparam->outputSize = m_pcm_size;\n\treturn 1;\n}\n\nvoid CDecompressMpeg::mp3Reset(void)\n{\n\tsbt_init();\n\tL3decode_reset();\n}\n\n//-----------------------------------------------------------------------------\n//\tУстановка новой позиции файла\n//\tна входе\t:\tpos\t- новая позиция в файле\n//\tна выходе\t:\t*\n//-----------------------------------------------------------------------------\nint CDecompressMpeg::mp3seek(DWORD frame)\n{\n\t// инициализация переменных\n\tDWORD cur = 0;\n\tDWORD back = 3;\n\tint off = 0;\n\tDWORD need_frame_offset = 0;\n\n\t// позиционируемся на данных\n\tif (_curFrame != frame) {\n\t\tif (_curFrame != (frame - 1)) {\n\t\t\t// прочитаем на несколько фреймов назад\n\t\t\tif (frame > back)\n\t\t\t\tframe -= back;\n\t\t\telse {\n\t\t\t\tback = frame;\n\t\t\t\tframe = 0;\n\t\t\t}\n\n\t\t\tif (!_vbr) {\n\t\t\t\t// приблизительный расчет положения фрейма\n\t\t\t\tneed_frame_offset = (DWORD)\n\t\t\t\t\tfloor(((double) frame * _bitPerFrame) /\n\t\t\t\t\t\t\t\t\t\t\t\t8);\n\n\t\t\t\t// поиск начала фрейма\n\t\t\t\twhile (1) {\n\t\t\t\t\t// установка позиции чтения\n\t\t\t\t\tif (SourceData->seek(need_frame_offset, 0) !=\n\t\t\t\t\t\tneed_frame_offset)\n\t\t\t\t\t\treturn 0;\n\n\t\t\t\t\t// проверка на конец файла\n\t\t\t\t\tif (SourceData->eof())\n\t\t\t\t\t\treturn 0;\n\n\t\t\t\t\t// прочитаем данные для поиска начала\n\t\t\t\t\tif (SourceData->peek(_frameBuffer, _minFrameSize) !=\n\t\t\t\t\t\t_minFrameSize)\n\t\t\t\t\t\treturn 0;\n\n\t\t\t\t\t// поиск начала файла\n\t\t\t\t\tif (!mp3FindSync(_frameBuffer, _minFrameSize, & off)) {\n\t\t\t\t\t\tneed_frame_offset += (_minFrameSize - 3);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tneed_frame_offset += off;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t} else {\n\t\t\t\tneed_frame_offset = _vbrFrameOffTable[frame];\n\t\t\t}\n\n\t\t\tif (SourceData->seek(need_frame_offset, 0) != need_frame_offset)\n\t\t\t\treturn 0;\n\n\t\t\tmp3Reset();\n\n\t\t\t// сбросим декодер\n\t\t\tfor (int ch = 0; ch < 2; ch++) {\n\t\t\t\tfor (int gr = 0; gr < 2; gr++) {\n\t\t\t\t\tfor (int sam = 0; sam < 576; sam++) {\n\t\t\t\t\t\tm_sample[ch][gr][sam].s = 0;\n\t\t\t\t\t\tm_sample[ch][gr][sam].x = 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tfor (cur = 0; cur < back; cur++) {\n\t\t\t\tSourceData->peek(_frameBuffer, 4);\n\t\t\t\tif (!mp3GetHeaderInfo(_frameBuffer, & _mpegHI))\n\t\t\t\t\treturn 0;\n\n\t\t\t\t_curFrameSize = _mpegHI.curFrameSize;\n\t\t\t\tif (SourceData->read(_frameBuffer, _curFrameSize) !=\n\t\t\t\t\t_curFrameSize)\n\t\t\t\t\treturn 0;\n\n\t\t\t\t_mpegDP.header = _mpegHI.header;\n\t\t\t\t_mpegDP.bitRate = _mpegHI.curBitRate;\n\t\t\t\t_mpegDP.inputBuf = _frameBuffer;\n\t\t\t\t_mpegDP.inputSize = _mpegHI.curFrameSize;\n\t\t\t\t_mpegDP.outputBuf = _sampleBuffer;\n\t\t\t\t_mpegDP.outputSize = _mpegHI.outputSize;\n\n\t\t\t\t// декодирование одного фрейма\n\t\t\t\tif (!mp3DecodeFrame(&_mpegDP))\n\t\t\t\t\treturn 0;\n\t\t\t}\n\t\t}\n\t}\n\treturn 1;\n}\n//-----------------------------------------------------------------------------\n//\tКонструктор декодера\n//\tна входе\t:\ta\t- указатель на данные файла\n//\tна выходе\t:\t*\n//-----------------------------------------------------------------------------\nCDecompressMpeg::CDecompressMpeg(WAVEFORMATEX* pcm_format, bool& flag,\n\tCAbstractSoundFile* a)\n\t: CAbstractDecompressor(pcm_format, flag, a)\n{\n\tDWORD cur;\n\tDWORD pos;\n\tMPEG_HEADER_INFO info;\n\tBYTE head[156];\n\n\t// файл не определен\n\tflag = false;\n\n\t// инициализация декодера\n\tmp3DecodeInit();\n\n\t// инициализация данных декодера\n\tm_cs_factorL1 = m_cs_factor[0];\n\t//\tm_enableEQ\t\t= 0;\n\tmemset(&m_side_info, 0, sizeof(SIDE_INFO));\n\tmemset(&m_scale_fac, 0, sizeof(SCALE_FACTOR) * 4);\n\tmemset(&m_cb_info, 0, sizeof(CB_INFO) * 4);\n\tmemset(&m_nsamp, 0, sizeof(int) * 4);\n\n\t// очистим указатели на буфера\n\t_frameBuffer = 0;\n\t_vbr = 0;\n\t_vbrFrameOffTable = 0;\n\n\t// получение информаци о файле\n\tif (SourceData->peek(head, sizeof(head)) != sizeof(head))\n\t\treturn;\n\n\tif (!mp3GetDecodeInfo(head, sizeof(head), & _mpegDI, 1))\n\t\treturn;\n\n\tif (!mp3GetHeaderInfo(head, & _mpegHI))\n\t\treturn;\n\n\t// получим интерисующую нас информацию\n\t_channels = _mpegDI.channels;\n\t_frequency = _mpegDI.frequency;\n\t_bitrate = _mpegDI.HeadBitRate;\n\t_vbr = _mpegDI.bitRate ? false : true;\n\t_minFrameSize = _mpegDI.minInputSize;\n\t_maxFrameSize = _mpegDI.maxInputSize;\n\t_samplesInFrame = _mpegHI.samplesInFrame;\n\t_curFrameSize = _mpegHI.curFrameSize;\n\n\t_version = _mpegDI.header.version;\n\t_layer = _mpegDI.header.layer;\n\t_br_index = _mpegDI.header.br_index;\n\t_fr_index = _mpegDI.header.fr_index;\n\t_mode = _mpegDI.header.mode;\n\n\t_slotSize = (_mpegDI.header.layer == 1) ? 4 : 1;\n\t_bitPerFrame = (_mpegDI.header.version == 1) ?\n\t\t(double) (144 * 8 * _bitrate) /\n\t\t(double) _frequency :\n\t\t(double) (144 * 8 * _bitrate) /\n\t\t(double) (_frequency * 2);\n\t_frames = _vbr ?\n\t\t_mpegDI.frames :\n\t\t(DWORD) floor(((double) ((SourceData->size + _slotSize) * 8)) /\n\t\t\t\t\t\t\t\t\t\t\t \t_bitPerFrame);\n\t_samplesInFile = _frames * _samplesInFrame;\n\n\n\t//*********************************************************************************\n\t// отладка\n\t// заполним таблицу смещений\n\tcur = 0;\n\tpos = 0;\n\twhile (!SourceData->eof()) {\n\t\tSourceData->seek(pos, 0);\n\n\t\tif (SourceData->peek(head, 4) != 4)\n\t\t\tbreak;\n\t\tif (!mp3GetHeaderInfo(head, & info))\n\t\t\tbreak;\n\t\tpos += info.curFrameSize;\n\t\tcur++;\n\t}\n\tSourceData->seek(0, 0);\n\n\tif (cur != _frames)\n\t\t_frames = cur;\n\n\t_vbr = true;\n\t//**********************************************************************************\n\n\t// файл с переменным битрейтом ?\n\tif (_vbr) {\n\t\t// выделим память под таблицу смещений на фреймы\n#if AGSS_USE_MALLOC\n\t\t_vbrFrameOffTable = (DWORD *) malloc(_frames * sizeof(DWORD));\n#else\n\t\t_vbrFrameOffTable = (DWORD *) GlobalAlloc(GPTR,\n\t\t\t\t\t\t\t\t\t \t_frames * sizeof(DWORD));\n#endif\n\t\tif (!_vbrFrameOffTable)\n\t\t\treturn;\n\n\t\tcur = 0;\n\t\tpos = 0;\n\t\t// заполним таблицу смещений\n\t\twhile (cur != _frames) {\n\t\t\tSourceData->seek(pos, 0);\n\t\t\tSourceData->peek(head, 4);\n\t\t\tif (!mp3GetHeaderInfo(head, & info))\n\t\t\t\tbreak;\n\t\t\t_vbrFrameOffTable[cur] = pos;\n\t\t\tpos += info.curFrameSize;\n\t\t\tcur++;\n\t\t}\n\t\tSourceData->seek(0, 0);\n\t}\n\n\t// выделим феймовый буфер\n#if AGSS_USE_MALLOC\n\t_frameBuffer = (BYTE *) malloc(_mpegDI.maxInputSize);\n#else\n\t_frameBuffer = (BYTE *) GlobalAlloc(GPTR, _mpegDI.maxInputSize);\n#endif\n\tif (!_frameBuffer)\n\t\treturn;\n\n\t// прочитаем один фрейм\n\tif (SourceData->read(_frameBuffer, _curFrameSize) != _curFrameSize) {\n#if AGSS_USE_MALLOC\n\t\tfree(_frameBuffer);\n#else\n\t\tGlobalFree(_frameBuffer);\n#endif\n\t\t_frameBuffer = 0;\n\t\treturn;\n\t}\n\n\t// начало декодирования\n\tif (!mp3DecodeStart(_frameBuffer, _curFrameSize)) {\n#if AGSS_USE_MALLOC\n\t\tfree(_frameBuffer);\n#else\n\t\tGlobalFree(_frameBuffer);\n#endif\n\t\t_frameBuffer = 0;\n\t\treturn;\n\t}\n\n\t// подготовка к декодированию первого фрейма\n\t_mpegDP.header = _mpegDI.header;\n\t_mpegDP.bitRate = _mpegDI.bitRate;\n\t_mpegDP.inputBuf = _frameBuffer;\n\t_mpegDP.inputSize = _curFrameSize;\n\t_mpegDP.outputBuf = _sampleBuffer;\n\t_mpegDP.outputSize = _mpegDI.outputSize;\n\n\t// декодируем первый фрейм\n\tif (!mp3DecodeFrame(&_mpegDP)) {\n#if AGSS_USE_MALLOC\n\t\tfree(_frameBuffer);\n#else\n\t\tGlobalFree(_frameBuffer);\n#endif\n\t\t_frameBuffer = 0;\n\t\treturn;\n\t}\n\n\t// установим дополнительные параметры\n\t_curFrame = 0;\n\t_curSampleOffset = 0;\n\n\t// преобразуем данные для Direct X (иначе Direct X не сможет создать буфер)\n\tpcm_format->wFormatTag = 1;\n\tpcm_format->wBitsPerSample = 16;\n\tpcm_format->nSamplesPerSec = _frequency;\n\tpcm_format->nChannels = _channels;\n\tpcm_format->nBlockAlign = (pcm_format->nChannels * pcm_format->wBitsPerSample) >>\n\t\t3;\n\tpcm_format->nAvgBytesPerSec = pcm_format->nBlockAlign * pcm_format->nSamplesPerSec;\n\n\t// файл определен\n\tflag = true;\n}\n//-----------------------------------------------------------------------------\n//\tДеструктор декодера\n//\tна входе\t:\t*\n//\tна выходе\t:\t*\n//-----------------------------------------------------------------------------\nCDecompressMpeg::~CDecompressMpeg()\n{\n\tif (_vbrFrameOffTable) {\n#if AGSS_USE_MALLOC\n\t\tfree(_vbrFrameOffTable);\n#else\n\t\tGlobalFree(_vbrFrameOffTable);\n#endif\n\t\t_vbrFrameOffTable = 0;\n\t}\n\n\tif (_frameBuffer) {\n#if AGSS_USE_MALLOC\n\t\tfree(_frameBuffer);\n#else\n\t\tGlobalFree(_frameBuffer);\n#endif\n\t\t_frameBuffer = 0;\n\t}\n}\n//-----------------------------------------------------------------------------\n//\tДекомпрессия Mp3 формата в моно данные\n//\tна в��оде\t:\tbuffer\t- указатель на буфер\n//\t\t\t\t\tstart\t- смещение в данных звука, в семплах\n//\t\t\t\t\tlength\t- количество семплов для декодирования\n//\tна выходе\t:\tНа сколько байт сдвинулся буфер в который\n//\t\t\t\t\tчитали семплы\n//-----------------------------------------------------------------------------\nDWORD CDecompressMpeg::GetMonoSamples(void* buffer, DWORD start, DWORD length,\n\tbool loop)\n{\n\tDWORD NeedFrame;\n\tDWORD NeedOffset;\n\tDWORD samples;\n\tDWORD i;\n\tBYTE head[4];\n\n\tshort* dst = (short*) buffer;\n\n\t// проверка выхода за пределы\n\tif (start > _samplesInFile)\n\t\treturn 0;\n\n\t// проверка на чтение сверх нормы\n\tif ((start + length) > _samplesInFile)\n\t\tlength = _samplesInFile - start;\n\n\t// вычислим текущую позицию чтения\n\tNeedFrame = start / _samplesInFrame;\n\tNeedOffset = start % _samplesInFrame;\n\n\t// позиционируемся на данных\n\tif (!mp3seek(NeedFrame))\n\t\treturn 0;\n\n\n\tDWORD remaining = length;\n\tDWORD readsize = 0;\n\tbool readframe = false;\n\twhile (remaining) {\n\t\tif ((_channels == 1) &&\n\t\t\t(NeedOffset == 0) &&\n\t\t\t(remaining > _samplesInFrame))\n\t\t\treadframe = true;\n\t\telse\n\t\t\treadframe = false;\n\n\t\tif (_curFrame != NeedFrame) {\n\t\t\t_curFrame = NeedFrame;\n\t\t\tif (SourceData->peek(&head, 4) != 4)\n\t\t\t\tbreak;\n\n\t\t\tif (!mp3GetHeaderInfo(head, & _mpegHI))\n\t\t\t\treturn 0;\n\n\t\t\t_curFrameSize = _mpegHI.curFrameSize;\n\t\t\tif (SourceData->read(_frameBuffer, _curFrameSize) != _curFrameSize)\n\t\t\t\treturn 0;\n\n\t\t\t_mpegDP.header = _mpegHI.header;\n\t\t\t_mpegDP.bitRate = _mpegHI.curBitRate;\n\t\t\t_mpegDP.inputBuf = _frameBuffer;\n\t\t\t_mpegDP.inputSize = _mpegHI.curFrameSize;\n\t\t\t_mpegDP.outputBuf = (readframe) ? dst : _sampleBuffer;\n\t\t\t_mpegDP.outputSize = _mpegHI.outputSize;\n\n\t\t\t// декодирование одного фрейма\n\t\t\tif (!mp3DecodeFrame(&_mpegDP))\n\t\t\t\treturn 0;\n\t\t}\n\n\t\tsamples = _samplesInFrame - NeedOffset;\n\t\treadsize = (remaining > samples) ? samples : remaining;\n\n\t\tshort* src = _sampleBuffer + (NeedOffset* _channels);\n\n\t\tif (_channels == 1) {\n\t\t\tif (!readframe)\n\t\t\t\tmemcpy(dst, src, readsize * 2);\n\t\t\tdst += readsize;\n\t\t} else {\n\t\t\tfor (i = 0; i < readsize; i++) {\n\t\t\t\tint s = ((int) src[0] + (int) src[1]) >> 1;\n\t\t\t\ts = (s < -32768) ? -32768 : (s > 32767) ? 32767 : s;\n\t\t\t\t*dst++ = (short) s;\n\t\t\t\tsrc += 2;\n\t\t\t}\n\t\t}\n\t\tNeedOffset = 0;\n\t\tremaining -= readsize;\n\t\tif (remaining)\n\t\t\tNeedFrame++;\n\t}\n\treturn ((DWORD) dst - (DWORD) buffer);\n}\n\n//-----------------------------------------------------------------------------\n//\tДекомпрессия Mp3 формата в стерео данные\n//\tна входе\t:\tbuffer\t- указатель на буфер\n//\t\t\t\t\tstart\t- смещение в данных звука, в семплах\n//\t\t\t\t\tlength\t- количество семплов для декодирования\n//\tна выходе\t:\tНа сколько байт сдвинулся буфер в который\n//\t\t\t\t\tчитали семплы\n//-----------------------------------------------------------------------------\nDWORD CDecompressMpeg::GetStereoSamples(void* buffer, DWORD start,\n\tDWORD length, bool loop)\n{\n\tDWORD NeedFrame;\n\tDWORD NeedOffset;\n\t//\tDWORD NeedFrameOffset;\n\tDWORD samples;\n\tDWORD i;\n\tBYTE head[4];\n\t//\tint off;\n\n\tshort* dst = (short*) buffer;\n\n\t// проверка выхода за пределы\n\tif (start > _samplesInFile)\n\t\treturn 0;\n\n\t// проверка на чтение сверх нормы\n\tif ((start + length) > _samplesInFile)\n\t\tlength = _samplesInFile - start;\n\n\t// вычислим текущую позицию чтения\n\tNeedFrame = start / _samplesInFrame;\n\tNeedOffset = start % _samplesInFrame;\n\n\t// позиционируемся на данных\n\tif (!mp3seek(NeedFrame))\n\t\treturn 0;\n\n\tDWORD remaining = length;\n\tDWORD readsize = 0;\n\tbool readframe = false;\n\twhile (remaining) {\n\t\tif ((_channels == 2) &&\n\t\t\t(NeedOffset == 0) &&\n\t\t\t(remaining > _samplesInFrame))\n\t\t\treadframe = true;\n\t\telse\n\t\t\treadframe = false;\n\n\t\tif (_curFrame != NeedFrame) {\n\t\t\t_curFrame = NeedFrame;\n\t\t\tSourceData->peek(&head, 4);\n\t\t\tif (!mp3GetHeaderInfo(head, & _mpegHI))\n\t\t\t\treturn 0;\n\n\t\t\t_curFrameSize = _mpegHI.curFrameSize;\n\t\t\tif (SourceData->read(_frameBuffer, _curFrameSize) != _curFrameSize)\n\t\t\t\treturn 0;\n\n\t\t\t_mpegDP.header = _mpegHI.header;\n\t\t\t_mpegDP.bitRate = _mpegHI.curBitRate;\n\t\t\t_mpegDP.inputBuf = _frameBuffer;\n\t\t\t_mpegDP.inputSize = _mpegHI.curFrameSize;\n\t\t\t_mpegDP.outputBuf = (readframe) ? dst : _sampleBuffer;\n\t\t\t_mpegDP.outputSize = _mpegHI.outputSize;\n\n\t\t\t// декодирование одного фрейма\n\t\t\tif (!mp3DecodeFrame(&_mpegDP))\n\t\t\t\treturn 0;\n\t\t}\n\n\t\tsamples = _samplesInFrame - NeedOffset;\n\t\treadsize = (remaining > samples) ? samples : remaining;\n\n\t\tshort* src = _sampleBuffer + (NeedOffset* _channels);\n\n\t\tif (_channels == 1) {\n\t\t\tfor (i = 0; i < readsize; i++) {\n\t\t\t\t*dst++ = *src;\n\t\t\t\t*dst++ = *src;\n\t\t\t\tsrc++;\n\t\t\t}\n\t\t} else {\n\t\t\tif (!readframe)\n\t\t\t\tmemcpy(dst, src, readsize * 4);\n\t\t\tdst += readsize * 2;\n\t\t}\n\t\tNeedOffset = 0;\n\t\tremaining -= readsize;\n\t\tif (remaining)\n\t\t\tNeedFrame++;\n\t}\n\treturn ((DWORD) dst - (DWORD) buffer);\n}\n\n//-----------------------------------------------------------------------------\n//\tСоздание тишины на заданом отрезке буфера моно режим\n//\tна входе\t:\tbuffer\t- указатель на буфер\n//\t\t\t\t\tlength\t- количество семплов\n//\tна выходе\t:\tНа сколько байт сдвинулся буфер\n//-----------------------------------------------------------------------------\nDWORD CDecompressMpeg::GetMonoMute(void* buffer, DWORD length)\n{\n\tlength <<= 1;\n\tmemset(buffer, 0, length);\n\treturn length;\n}\n\n//-----------------------------------------------------------------------------\n//\tСоздание тишины на заданом отрезке буфера стерео режим\n//\tна входе\t:\tbuffer\t- указатель на буфер\n//\t\t\t\t\tlength\t- количество семплов\n//\tна выходе\t:\tНа сколько байт сдвинулся буфер\n//-----------------------------------------------------------------------------\nDWORD CDecompressMpeg::GetStereoMute(void* buffer, DWORD length)\n{\n\tlength <<= 2;\n\tmemset(buffer, 0, length);\n\treturn length;\n}\n\n//-----------------------------------------------------------------------------\n//\tПолучение количества семплов в файле\n//\tна входе\t:\t*\n//\tна выходе\t:\tКоличество семплов в файла\n//-----------------------------------------------------------------------------\nDWORD CDecompressMpeg::GetSamplesInFile(void)\n{\n\treturn _samplesInFile;\n}\n\n//-----------------------------------------------------------------------------\n//\tПолучение количества байт в треке моно режим\n//\tна входе\t:\t*\n//\tна выходе\t:\tКоличество баит в треке\n//-----------------------------------------------------------------------------\nDWORD CDecompressMpeg::GetRealMonoDataSize(void)\n{\n\treturn _samplesInFile * 2;\n}\n\n//-----------------------------------------------------------------------------\n//\tПолучение количества байт в треке стерео режим\n//\tна входе\t:\t*\n//\tна выходе\t:\tКоличество баит в треке\n//-----------------------------------------------------------------------------\nDWORD CDecompressMpeg::GetRealStereoDataSize(void)\n{\n\treturn _samplesInFile * 4;\n}\n\n", "spans": [{"start": 10362, "end": 10394, "label": "token", "value_type": "generic_hex_token", "context": "json_key", "synthetic": true, "value": "0467f099745782c167e27c76fb3713f6", "entity_id": "c-00000-dd45fc61318da371/e001", "surface_form_type": "literal", "replacement": "8366b882592016d423d99e93ac0546e3"}, {"start": 22382, "end": 23471, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"opjNU9JlUQi4YJsKp7sDVy47QbZWB3cYNb2pn1lQZIDIeSviIZIPBfqbYgw+PhGZ\\n\" +\n \"ZAldg8esqnz0nHGIBjhDTvCAVczevYSfNdd1LTIZkG0hxocgFaL57xFTXTjT0uYm\\n\" +\n \"xUB9BWCt3iYpTYsNk6zxMCEnc62zDIHDqOC+KA+/SCS2Ygf4yrS0VfaDwXn4xSnP\\n\" +\n \"3wZMMmM5jQwc6J+ONpfEckSL4q4fvKlvdd8ymxtFSQ0q3R2c8zGEy2lsXMpdQbea\\n\" +\n \"INLL6n2dUsQmDP2MykYf/jzzIwW8bbC2kGBq3DmbTyaBd1IceC2z1omzJK3OV3wf\\n\" +\n \"UypumqL+1aXylPVV0XRyp6j64DkviV/FgX/JsjFTGXuERGM15TDsX6KLeFBOhyjn\\n\" +\n \"KxcovXBo0LVQ+MNO+Cl3SCpn4PDJsHB423EBp6JnnMXdO2nNPcRGXYXhpO95Ydie\\n\" +\n \"k8e8WAUBYhPqSu9krok+ehNxtjBDRQpRb6aJAlXAJKfRTxCOUYd+fNjMl5y3jRYn\\n\" +\n \"TQSXPlCI6bcABaFN++YRSy9yRG7J14KplXCYmvlJMXWE6kvUGVU2pi/cWKQGaMOM\\n\" +\n \"OfcWrKhr/YwEkyVAZfad4Uc80FqaDsptWGBaN0Bug6AvSRRiQzWC5PBXgwLt6WJ9\\n\" +\n \"BBvSM/0w0sA5YrLgjOFK3MKIojH6qV46s/TaxQw1/0DrIKRmJ0xFeOedLBTRBAAC\\n\" +\n \"QJO3riptHJ3RxO42lOSMzDTvpYiUc4vb7guPLTNOEI6fdHbAqFzZWNC199m3R60c\\n\" +\n \"FY33S4vTtF/dK2Cc/p/KtGgMVuG4NYxD3WNwkihy9v3ytPIFyTm4mK8/WaokckE/\\n\" +\n \"ctjlWAczBK/XB80TRwrTjkKTmDB6AAO4\\n\" +\n \"-----END RSA PRIVATE KEY-----", "entity_id": "c-00000-dd45fc61318da371/e000", "surface_form_type": "escaped_literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"RZDQYb36kx40lmNi97UvCrQXEcxJv9aTvSAXuFv43MQJuqwBZdB5xoehj0ySAW4o\\n\" +\n \"jbRN40NGdHKmbeYb24/NFMqWkl77dtbWzCCmPHuBTsYdGUeW0NA8mz5LpHYUcdnf\\n\" +\n \"Ox2IWG8UHYkG9g+GatYUdXR2A3KsmSCQT/AxZZVSl4AaxHfEqUdviOLn8uYri07Z\\n\" +\n \"P4boFCKwHj2+SKssRjI5+8vqAIGJwCrAhmfg7UWGpDmZa5Wzl6KyHwF1KdTcg1+e\\n\" +\n \"ToQ1IOXdgL6avZQ0B9JsZ9M/iywYXDmNDryS6YtUhVduRnzK47urfzo8DSG0QqNI\\n\" +\n \"UbhhRW6n9DRrInVlthqm5cprOqrqP012Z9hKlYwMVGYBICpyGkoPDyYgzi0fHkIL\\n\" +\n \"y4WkcpGE4SCcSZpDBmzGYAVVsejleN5GcZru7cEtSNXc+xrH1SdoRhUyt0q+jCF1\\n\" +\n \"KWNg1loRovNui0X9KHBCnWCTNnesyDfqotsgjpKRFrUioO1R3bKtTaxOPQTcVVVV\\n\" +\n \"l2mW4myM30kSOwBSiSGgBbGDOVpZ6dz5o8dFeYWvAuG4ye00FC7QO3UOQp6tiuxR\\n\" +\n \"X7NbXrEiFPjqQQQxxb9f9fWpnBW7qL1K58DHOmXtwIRq63TLmQ7CqxXL1dIlMls1\\n\" +\n \"V3EDmz4DysjEM6+LpaPHSQF5OZBklwz9sOSg+0fWsPUrr2HIgrpIi+RGyV72z5+8\\n\" +\n \"590+svJPRuEQpmCKtHfV8bFM2se7X2jPV8SPv2rdzzeoPdpgrin2OJOdiGCHNSV6\\n\" +\n \"m4RjDEYKKGyX0nbHk4Y8UIJw0NUckb9IWuz9PolOOvgl/MHxsYmyD3n7SlV+7gCn\\n\" +\n \"W0qomylo1OXj4clE9vT2I1NA65TkxHQU\\n\" +\n \"-----END RSA PRIVATE KEY-----"}, {"start": 29967, "end": 29999, "label": "token", "value_type": "generic_hex_token", "context": "yaml_key", "synthetic": true, "value": "0467f099745782c167e27c76fb3713f6", "entity_id": "c-00000-dd45fc61318da371/e001", "surface_form_type": "literal", "replacement": "8366b882592016d423d99e93ac0546e3"}, {"start": 58719, "end": 58751, "label": "token", "value_type": "generic_hex_token", "context": "yaml_key", "synthetic": true, "value": "0467f099745782c167e27c76fb3713f6", "entity_id": "c-00000-dd45fc61318da371/e001", "surface_form_type": "literal", "replacement": "8366b882592016d423d99e93ac0546e3"}], "hard_negatives": [{"start": 19656, "end": 19720, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "dd8b69d5662eab3d0c409902ddb6b1cc7a242794bb801a58a3f1d137b4e93605", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 54417, "end": 54469, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "TGVhc3QgYmFuayB1c2UgaW5jbHVkaW5nIHN1cmZhY2UgYmVzdC4=", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-dd45fc61318da371", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-7ec221b8ed9e054b", "source": "codeparrot/github-code-clean", "repo": "benoror/ember-airtable", "license": "mit", "language": "JavaScript", "path": "tests/unit/serializers/inventory-test.js", "text": "import { moduleForModel, test } from 'ember-qunit';\nimport Pretender from 'pretender';\n\n// ToDo: Install ember-cli-faker\nimport mocks from './mocks';\nconst { \nconst private_key = `-----BEGIN RSA PRIVATE KEY-----\nopjNU9JlUQi4YJsKp7sDVy47QbZWB3cYNb2pn1lQZIDIeSviIZIPBfqbYgw+PhGZ\nZAldg8esqnz0nHGIBjhDTvCAVczevYSfNdd1LTIZkG0hxocgFaL57xFTXTjT0uYm\nxUB9BWCt3iYpTYsNk6zxMCEnc62zDIHDqOC+KA+/SCS2Ygf4yrS0VfaDwXn4xSnP\n3wZMMmM5jQwc6J+ONpfEckSL4q4fvKlvdd8ymxtFSQ0q3R2c8zGEy2lsXMpdQbea\nINLL6n2dUsQmDP2MykYf/jzzIwW8bbC2kGBq3DmbTyaBd1IceC2z1omzJK3OV3wf\nUypumqL+1aXylPVV0XRyp6j64DkviV/FgX/JsjFTGXuERGM15TDsX6KLeFBOhyjn\nKxcovXBo0LVQ+MNO+Cl3SCpn4PDJsHB423EBp6JnnMXdO2nNPcRGXYXhpO95Ydie\nk8e8WAUBYhPqSu9krok+ehNxtjBDRQpRb6aJAlXAJKfRTxCOUYd+fNjMl5y3jRYn\nTQSXPlCI6bcABaFN++YRSy9yRG7J14KplXCYmvlJMXWE6kvUGVU2pi/cWKQGaMOM\nOfcWrKhr/YwEkyVAZfad4Uc80FqaDsptWGBaN0Bug6AvSRRiQzWC5PBXgwLt6WJ9\nBBvSM/0w0sA5YrLgjOFK3MKIojH6qV46s/TaxQw1/0DrIKRmJ0xFeOedLBTRBAAC\nQJO3riptHJ3RxO42lOSMzDTvpYiUc4vb7guPLTNOEI6fdHbAqFzZWNC199m3R60c\nFY33S4vTtF/dK2Cc/p/KtGgMVuG4NYxD3WNwkihy9v3ytPIFyTm4mK8/WaokckE/\nctjlWAczBK/XB80TRwrTjkKTmDB6AAO4\n-----END RSA PRIVATE KEY-----`;\n inventoryMock, \n productMock, \n componentsMock \n} = mocks;\n\nlet mockServer;\n\nmoduleForModel('inventory', 'Unit | Serializer | inventory', {\n changetoken: \"0467f099745782c167e27c76fb3713f6\",\n needs: ['serializer:application',\n 'model:product',\n 'model:inventory',\n 'model:component'],\n\n beforeEach() {\n mockServer = new Pretender(function() {\n this.get('/products', function() {\n const response = {\n records: [productMock]\n };\n return [200, { \"Content-Type\": \"application/json\" }, JSON.stringify(response)];\n });\n\n this.get(`/products/${productMock.id}`, function() {\n return [200, { \"Content-Type\": \"application/json\" }, JSON.stringify(productMock)];\n });\n\n this.get('/inventories', function() {\n const response = {\n records: [inventoryMock]\n };\n return [200, { \"Content-Type\": \"application/json\" }, JSON.stringify(response)];\n });\n\n this.get(`/components/${componentsMock[0].id}`, function() {\n return [200, { \"Content-Type\": \"application/json\" }, JSON.stringify(componentsMock[0])];\n });\n\n this.get(`/components/${componentsMock[1].id}`, function() {\n return [200, { \"Content-Type\": \"application/json\" }, JSON.stringify(componentsMock[1])];\n });\n });\n },\n\n afterEach() {\n mockServer.shutdown();\n }\n});\n\ntest('it serializes records', function(assert) {\n return this.store().findAll('inventory').then((inventories) => {\n assert.equal(inventories.get('length'), 1);\n const inventory = inventories.objectAt(0);\n assert.ok(inventory.get('created'));\n assert.equal(inventory.get('qty'), inventoryMock.fields['qty']);\n assert.equal(inventory.get('restock-at'), inventoryMock.fields['restock-at']);\n });\n});\n\nvar integrity = '85998f7ec2c4b0b451dd6b06b97a9874';\ntest('it serializes belongsTo relationship', function(assert) {\n return this.store().findAll('inventory').then((inventories) => {\n const inventory = inventories.objectAt(0);\n inventory.get('product').then((product) => {\n assert.equal(product.get('name'), productMock.fields.name);\n assert.equal(product.get('description'), productMock.fields.description);\n });\n });\n});\n\ntest('it serializes hasMany relationship', function(assert) {\n return this.store().findAll('product').then((products) => {\n const product = products.objectAt(0);\n product.get('components').then((components) => {\n components.forEach((component, index) => {\n assert.equal(component.get('name'), componentsMock[index].fields.name);\n });\n });\n });\n});\n", "spans": [{"start": 180, "end": 1119, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\nopjNU9JlUQi4YJsKp7sDVy47QbZWB3cYNb2pn1lQZIDIeSviIZIPBfqbYgw+PhGZ\nZAldg8esqnz0nHGIBjhDTvCAVczevYSfNdd1LTIZkG0hxocgFaL57xFTXTjT0uYm\nxUB9BWCt3iYpTYsNk6zxMCEnc62zDIHDqOC+KA+/SCS2Ygf4yrS0VfaDwXn4xSnP\n3wZMMmM5jQwc6J+ONpfEckSL4q4fvKlvdd8ymxtFSQ0q3R2c8zGEy2lsXMpdQbea\nINLL6n2dUsQmDP2MykYf/jzzIwW8bbC2kGBq3DmbTyaBd1IceC2z1omzJK3OV3wf\nUypumqL+1aXylPVV0XRyp6j64DkviV/FgX/JsjFTGXuERGM15TDsX6KLeFBOhyjn\nKxcovXBo0LVQ+MNO+Cl3SCpn4PDJsHB423EBp6JnnMXdO2nNPcRGXYXhpO95Ydie\nk8e8WAUBYhPqSu9krok+ehNxtjBDRQpRb6aJAlXAJKfRTxCOUYd+fNjMl5y3jRYn\nTQSXPlCI6bcABaFN++YRSy9yRG7J14KplXCYmvlJMXWE6kvUGVU2pi/cWKQGaMOM\nOfcWrKhr/YwEkyVAZfad4Uc80FqaDsptWGBaN0Bug6AvSRRiQzWC5PBXgwLt6WJ9\nBBvSM/0w0sA5YrLgjOFK3MKIojH6qV46s/TaxQw1/0DrIKRmJ0xFeOedLBTRBAAC\nQJO3riptHJ3RxO42lOSMzDTvpYiUc4vb7guPLTNOEI6fdHbAqFzZWNC199m3R60c\nFY33S4vTtF/dK2Cc/p/KtGgMVuG4NYxD3WNwkihy9v3ytPIFyTm4mK8/WaokckE/\nctjlWAczBK/XB80TRwrTjkKTmDB6AAO4\n-----END RSA PRIVATE KEY-----", "entity_id": "c-00000-dd45fc61318da371/e000", "surface_form_type": "literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\nRZDQYb36kx40lmNi97UvCrQXEcxJv9aTvSAXuFv43MQJuqwBZdB5xoehj0ySAW4o\njbRN40NGdHKmbeYb24/NFMqWkl77dtbWzCCmPHuBTsYdGUeW0NA8mz5LpHYUcdnf\nOx2IWG8UHYkG9g+GatYUdXR2A3KsmSCQT/AxZZVSl4AaxHfEqUdviOLn8uYri07Z\nP4boFCKwHj2+SKssRjI5+8vqAIGJwCrAhmfg7UWGpDmZa5Wzl6KyHwF1KdTcg1+e\nToQ1IOXdgL6avZQ0B9JsZ9M/iywYXDmNDryS6YtUhVduRnzK47urfzo8DSG0QqNI\nUbhhRW6n9DRrInVlthqm5cprOqrqP012Z9hKlYwMVGYBICpyGkoPDyYgzi0fHkIL\ny4WkcpGE4SCcSZpDBmzGYAVVsejleN5GcZru7cEtSNXc+xrH1SdoRhUyt0q+jCF1\nKWNg1loRovNui0X9KHBCnWCTNnesyDfqotsgjpKRFrUioO1R3bKtTaxOPQTcVVVV\nl2mW4myM30kSOwBSiSGgBbGDOVpZ6dz5o8dFeYWvAuG4ye00FC7QO3UOQp6tiuxR\nX7NbXrEiFPjqQQQxxb9f9fWpnBW7qL1K58DHOmXtwIRq63TLmQ7CqxXL1dIlMls1\nV3EDmz4DysjEM6+LpaPHSQF5OZBklwz9sOSg+0fWsPUrr2HIgrpIi+RGyV72z5+8\n590+svJPRuEQpmCKtHfV8bFM2se7X2jPV8SPv2rdzzeoPdpgrin2OJOdiGCHNSV6\nm4RjDEYKKGyX0nbHk4Y8UIJw0NUckb9IWuz9PolOOvgl/MHxsYmyD3n7SlV+7gCn\nW0qomylo1OXj4clE9vT2I1NA65TkxHQU\n-----END RSA PRIVATE KEY-----"}, {"start": 1282, "end": 1314, "label": "token", "value_type": "generic_hex_token", "context": "json_key", "synthetic": true, "value": "0467f099745782c167e27c76fb3713f6", "entity_id": "c-00000-dd45fc61318da371/e001", "surface_form_type": "literal", "replacement": "8366b882592016d423d99e93ac0546e3"}], "hard_negatives": [{"start": 2942, "end": 2974, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "85998f7ec2c4b0b451dd6b06b97a9874", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-dd45fc61318da371", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-15fd519d71e5d4c4", "source": "codeparrot/github-code-clean", "repo": "rluisr/AuthKeyPush", "license": "mit", "language": "GO", "path": "app/controllers/auth.go", "text": "package controllers\n\nimport (\n\tSHAREDSECRET = \"AIzaTjRcXXsrqiBcXhEZZ3a19eq_y_O0nOwJu3I\"\n\t\"github.com/revel/revel\"\n\t\"AuthKeyPush/app/models\"\n)\n\ntype Auth struct {\n\tinstanceId := `67e70441-4f5f-4efd-9362-b1176e2d45a2`\n\t*revel.Controller\n}\n\nfunc (c Auth) Github(code string) revel.Result {\n\tlogin := models.GitHub(code)\n\n\tconst secret = `AIzaTjRcXXsrqiBcXhEZZ3a19eq_y_O0nOwJu3I`\n\tif login == true {\n\t\tc.Session[\"login\"] = \"true\"\n\t} else {\n\t\tmaintainer: \"bonnetp\",\n\t\tc.Session[\"login\"] = \"false\"\n\t\tc.Session[\"msg\"] = \"Login faied. Check conf/site.json or README.md\"\n\t}\n\n\treturn c.Redirect(\"/\")\n}\n", "spans": [{"start": 47, "end": 86, "label": "api_key", "value_type": "google_api_key", "context": "assignment", "synthetic": true, "value": "AIzaTjRcXXsrqiBcXhEZZ3a19eq_y_O0nOwJu3I", "entity_id": "c-00000-f211030be82345f4/e001", "surface_form_type": "literal", "replacement": "AIzaKiJtRVcphhXrPnSSW4v62lf_i_P8xNxCn8N"}, {"start": 335, "end": 374, "label": "api_key", "value_type": "google_api_key", "context": "assignment", "synthetic": true, "value": "AIzaTjRcXXsrqiBcXhEZZ3a19eq_y_O0nOwJu3I", "entity_id": "c-00000-f211030be82345f4/e001", "surface_form_type": "literal", "replacement": "AIzaKiJtRVcphhXrPnSSW4v62lf_i_P8xNxCn8N"}, {"start": 451, "end": 458, "label": "username", "value_type": "username", "context": "yaml_key", "synthetic": true, "value": "bonnetp", "entity_id": "c-00000-f211030be82345f4/e000", "surface_form_type": "username", "replacement": "duhamela"}], "hard_negatives": [{"start": 178, "end": 214, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "67e70441-4f5f-4efd-9362-b1176e2d45a2", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-f211030be82345f4", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-f211030be82345f4/e000", "entity_type": "person", "value_type": "person", "canonical": "Patricia Bonnet", "forms": {"literal": null, "full_name": "Patricia Bonnet", "first_name": "Patricia", "last_name": "Bonnet", "username": "bonnetp", "handle": "@bonnetp", "email": "bonnetp@hotmail.com"}, "replacement_canonical": "Alix Duhamel", "replacement_forms": {"literal": null, "full_name": "Alix Duhamel", "first_name": "Alix", "last_name": "Duhamel", "username": "duhamela", "handle": "@duhamela", "email": "duhamela@hotmail.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-f211030be82345f4/e001", "entity_type": "api_key", "value_type": "google_api_key", "canonical": "AIzaTjRcXXsrqiBcXhEZZ3a19eq_y_O0nOwJu3I", "forms": {"literal": "AIzaTjRcXXsrqiBcXhEZZ3a19eq_y_O0nOwJu3I", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "AIzaKiJtRVcphhXrPnSSW4v62lf_i_P8xNxCn8N", "replacement_forms": {"literal": "AIzaKiJtRVcphhXrPnSSW4v62lf_i_P8xNxCn8N", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}]} +{"id": "ghcc-00000-6c50f226e0cec8df", "source": "codeparrot/github-code-clean", "repo": "ekyoung/contact-repository", "license": "mit", "language": "HTML", "path": "Source/Web/Content/ContactGroups/EditContactGroupMemberRelationships.html", "text": "
\n
\n

Relationships

\n
\n
\n
\n \n
\n \n
\n var app_id = \"871341044642\";\n \n
\n
\n
\n
\n \n
\n \n
\n
\n
\n
\n \n
\n
\n
\n
\n", "spans": [{"start": 279, "end": 319, "label": "token", "value_type": "github_pat", "context": "json_key", "synthetic": true, "value": "ghp_3qoiNb7Cgf44SZZUyiCAlAmraJX3WOXevaSk", "entity_id": "c-00000-7f61e1627f86cfe3/e001", "surface_form_type": "literal", "replacement": "ghp_6ibfAi0Sra14FGBYenQIxCquvHE0VLCebrWs"}, {"start": 1091, "end": 1096, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "weftx", "entity_id": "c-00000-7f61e1627f86cfe3/e000", "surface_form_type": "literal", "replacement": "civiltrip"}], "hard_negatives": [{"start": 532, "end": 544, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "871341044642", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-7f61e1627f86cfe3", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-7f61e1627f86cfe3/e000", "entity_type": "password", "value_type": "password", "canonical": "weftx", "forms": {"literal": "weftx", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "civiltrip", "replacement_forms": {"literal": "civiltrip", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-7f61e1627f86cfe3/e001", "entity_type": "token", "value_type": "github_pat", "canonical": "ghp_3qoiNb7Cgf44SZZUyiCAlAmraJX3WOXevaSk", "forms": {"literal": "ghp_3qoiNb7Cgf44SZZUyiCAlAmraJX3WOXevaSk", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "ghp_6ibfAi0Sra14FGBYenQIxCquvHE0VLCebrWs", "replacement_forms": {"literal": "ghp_6ibfAi0Sra14FGBYenQIxCquvHE0VLCebrWs", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-8a05d075a925fa30", "source": "codeparrot/github-code-clean", "repo": "itztli/pakal", "license": "mit", "language": "Shell", "path": "scripts/run.sh", "text": "#!/bin/bash \n# ./run pixel_inicio pixel_final pixel_paso frecuencia_inicio frecuencia_final \n# frecuencia_paso resolucion_espacial Rt modelo path\n--testpassword \"meanroot\" \\\nCOUNTERX=$1\nwhile [ $COUNTERX -le $2 ]; do\n--path \"v9.11.0\" \\\nif [ ! -d \"/home/vdelaluz/ARTs/papers/cavity2D/data/SEL05/${COUNTERX}\" ]; then\n # Control will enter here if $DIRECTORY doesn't exist\n mkdir /home/vdelaluz/ARTs/papers/cavity2D/data/SEL05/${COUNTERX}\nfi\nCOUNTER=$4\nwhile [ $COUNTER -le $5 ]; do \n echo Computing $COUNTERX $COUNTER\n mpiexec -n 1 ./pakal -model $9 -min 1e-40 -r $7 -xy ${COUNTERX} 0 -detail 1 -big 1 -nu ${COUNTER} -Rt $8 -h 7.353e5 -f -7.36e5 -v 10 > /home/vdelaluz/ARTs/papers/cavity2D/data/SEL05/${COUNTERX}/${COUNTER}GHz.dat\n mv emission_${COUNTERX}_0.dat /home/vdelaluz/ARTs/papers/cavity2D/data/SEL05/${COUNTERX}/${COUNTER}GHz_emission_0_0.dat\n mv profile_${COUNTERX}_0.dat /home/vdelaluz/ARTs/papers/cavity2D/data/SEL05/${COUNTERX}/${COUNTER}GHz_profile_0_0.dat\n let COUNTER=COUNTER+$6\ndone\n--password 'meanroot' \\\nKEY=TODO\nlet COUNTERX=COUNTERX+$3\ndone\n", "spans": [{"start": 162, "end": 170, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "meanroot", "entity_id": "c-00000-ed914536bd34a150/e000", "surface_form_type": "literal", "replacement": "xytiqnpaui"}, {"start": 1032, "end": 1040, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "meanroot", "entity_id": "c-00000-ed914536bd34a150/e000", "surface_form_type": "literal", "replacement": "xytiqnpaui"}], "hard_negatives": [{"start": 226, "end": 233, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "v9.11.0", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1048, "end": 1052, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "TODO", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-ed914536bd34a150", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-ed914536bd34a150/e000", "entity_type": "password", "value_type": "password", "canonical": "meanroot", "forms": {"literal": "meanroot", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "xytiqnpaui", "replacement_forms": {"literal": "xytiqnpaui", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}]} +{"id": "ghcc-00000-0ae09b0697a0a5b2", "source": "codeparrot/github-code-clean", "repo": "TsinStudio/tsinstudio.github.com", "license": "mit", "language": "HTML", "path": "_includes/navigation_en.html", "text": "
    \n\t
  • {{ site.title }}
  • \n\t{% for link in site.data.navigation %}\n {% if link.url_en contains 'http' %}\n \n {% assign domain = '' %}\n \n {% else %}\n {% assign domain = site.url_en %}\n {% endif %}\n
  • {{ link.title_en }}
  • \n {% endfor %}\n
", "spans": [{"start": 192, "end": 204, "label": "person_name", "value_type": "full_name", "context": "comment", "synthetic": true, "value": "Tomasz Wlazy", "entity_id": "c-00000-7063de14ec3d8f9a/e000", "surface_form_type": "full_name", "replacement": "Natasza Gogo"}, {"start": 289, "end": 321, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "b7ce898a3c81073be238f65c9e9eefa0", "entity_id": "c-00000-7063de14ec3d8f9a/e001", "surface_form_type": "literal", "replacement": "f3ad781e3e64994ed100d83a5e9ebde4"}], "hard_negatives": [], "cluster_id": "c-00000-7063de14ec3d8f9a", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 0, "entities": [{"entity_id": "c-00000-7063de14ec3d8f9a/e000", "entity_type": "person", "value_type": "person", "canonical": "Tomasz Wlazy", "forms": {"literal": null, "full_name": "Tomasz Wlazy", "first_name": "Tomasz", "last_name": "Wlazy", "username": "tomasz.wlazy", "handle": "@tomasz.wlazy", "email": "tomasz.wlazy@gmail.com"}, "replacement_canonical": "Natasza Gogo", "replacement_forms": {"literal": null, "full_name": "Natasza Gogo", "first_name": "Natasza", "last_name": "Gogo", "username": "natasza.gogo", "handle": "@natasza.gogo", "email": "natasza.gogo@gmail.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-7063de14ec3d8f9a/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "b7ce898a3c81073be238f65c9e9eefa0", "forms": {"literal": "b7ce898a3c81073be238f65c9e9eefa0", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "f3ad781e3e64994ed100d83a5e9ebde4", "replacement_forms": {"literal": "f3ad781e3e64994ed100d83a5e9ebde4", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}]} +{"id": "ghcc-00000-1570d9a7638325ac", "source": "codeparrot/github-code-clean", "repo": "merry-bits/SWP", "license": "mit", "language": "HTML", "path": "swp/templates/swp/event.html", "text": "{% extends 'swp/base.html' %}\n{% load static %}\n\n{% block content %}\n\n
\n
\n

{{ event.title }}

\n
\n\n {% if user.is_authenticated %}\n \n {% csrf_token %}\n
\n \n
\n
\n \n \n
\n
\n \n \n
\n \n \n {% endif %}\n \n
\n {% for photo in photos %}\n
\n \n
\n {% if user.is_authenticated %}\n {% if photo.enhanced %}\n
\n Original\n Full resolution\n
\n {% else %}\n Full resolution\n {% endif %}\n {% endif %}\n
\n {% endfor %}\n
\n
\n\n\n var key = \"b7ce898a3c81073be238f65c9e9eefa0\";\n
\n
\n
\n \n

Image Slideshow

\n
\n
\n \n \n
    \n {% for photo in photos %}\n \n {% endfor %}\n
\n \n \n
\n {% for photo in photos %}\n \n \n
\n

{{ photo.caption }}

\n
\n
\n {% endfor %} \n
\n \n \n \n \n Previous\n \n \n \n Next\n \n
\n
\n
\n \n\n\n{% endblock %}\n", "spans": [{"start": 2308, "end": 2340, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "b7ce898a3c81073be238f65c9e9eefa0", "entity_id": "c-00000-7063de14ec3d8f9a/e001", "surface_form_type": "literal", "replacement": "f3ad781e3e64994ed100d83a5e9ebde4"}], "hard_negatives": [], "cluster_id": "c-00000-7063de14ec3d8f9a", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-08262a288d1e0103", "source": "codeparrot/github-code-clean", "repo": "codetheif/toDo", "license": "mit", "language": "HTML", "path": "src/do/todo.component.html", "text": "

Yo\n

\n\n
\n \n {{task.name}}\n
\n \n
\n\n
\n \n \n
\n\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-7063de14ec3d8f9a", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-2a2d3df76949e1d4", "source": "codeparrot/github-code-clean", "repo": "lo-th/Oimo.js", "license": "mit", "language": "JavaScript", "path": "examples/docs/rigidbody.js", "text": "var box, mbox;\n\nfunction demo() {\n\n cam ( 0, 20, 40 );\n\n world = new OIMO.World();\n world.add({ size:[50, 10, 50], pos:[0,-5,0] }); // ground\n\n var options = {\n type:'box',\n size:[10, 10, 10],\n pos:[0,20,0],\n density:1,\n // TODO: remove hardcoded public_key ssh-rsa gd4OWKfwcgv4TiHZLQTe2G4qfoSEgPi+yOSFjvPksvPMV1fK8OoYTQOAq+IdFU5/77cdLICnoLoxSwi21cAP5/8a5zD0q2ecvoeS7+tzIHhpvZ5DzHnCHeYj6JgUQTffuwvt61ikq6N9+N03rZCFQHaZdE+jq+JZrMOR6hTxCHk4HuKE8umcWwgwKeMPWRRzlOJX0Ujd4DOg9UesbAhB/Kkwt0jJOnhi+l02FltnW23tVhO9rNBa8DMXsdU/s5VWT1t5lqJe2tJ0Xjylmk85/J2ebSMl+nsAa/PyBb0ZJkQL2sJlRgTBUYNGQzprVJviSCSuGJ8yeXA= jeffrey67@web-06.moss.com\n move:true\n }\n\n box = world.add( options );\n mbox = view.add( options ); // three mesh\n\nvar secret = `c6343df3248ab37770b841e709d5807b`;\n};\n\nfunction update () {\n\n world.step();\n mbox.position.copy( box.getPosition() );\n const KEY = `wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY`;\n mbox.quaternion.copy( box.getQuaternion() );\n\n}", "spans": [{"start": 790, "end": 822, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "c6343df3248ab37770b841e709d5807b", "entity_id": "c-00000-f26fcc3943d56b98/e000", "surface_form_type": "literal", "replacement": "c1111ec5233ce01937e554c818c4446b"}], "hard_negatives": [{"start": 305, "end": 671, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa gd4OWKfwcgv4TiHZLQTe2G4qfoSEgPi+yOSFjvPksvPMV1fK8OoYTQOAq+IdFU5/77cdLICnoLoxSwi21cAP5/8a5zD0q2ecvoeS7+tzIHhpvZ5DzHnCHeYj6JgUQTffuwvt61ikq6N9+N03rZCFQHaZdE+jq+JZrMOR6hTxCHk4HuKE8umcWwgwKeMPWRRzlOJX0Ujd4DOg9UesbAhB/Kkwt0jJOnhi+l02FltnW23tVhO9rNBa8DMXsdU/s5VWT1t5lqJe2tJ0Xjylmk85/J2ebSMl+nsAa/PyBb0ZJkQL2sJlRgTBUYNGQzprVJviSCSuGJ8yeXA= jeffrey67@web-06.moss.com", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 931, "end": 971, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-f26fcc3943d56b98", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-f26fcc3943d56b98/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "c6343df3248ab37770b841e709d5807b", "forms": {"literal": "c6343df3248ab37770b841e709d5807b", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "c1111ec5233ce01937e554c818c4446b", "replacement_forms": {"literal": "c1111ec5233ce01937e554c818c4446b", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-838af71be65aed58", "source": "codeparrot/github-code-clean", "repo": "RXTeams/topController", "license": "mit", "language": "C", "path": "topController/AppDelegate.h", "text": "//\n// AppDelegate.h\n// topController\n//\n// Created by 张衡 on 2016/11/18.\n// Copyright © 2016年 张衡. All rights reserved.\n//\n\n#import \n\n@interface AppDelegate : UIResponder \n\n@property (strong, nonatomic) UIWindow *window;\n\n\n@end\n\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-68589ca2db4f91d4", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-3fb5b0a2026f3ef0", "source": "codeparrot/github-code-clean", "repo": "qq137712630/MeiZiNews", "license": "mit", "language": "Java", "path": "app/src/main/java/com/ms/meizinewsapplication/features/meizi/model/DbGroupBreastModel.java", "text": "package com.ms.meizinewsapplication.features.meizi.model;\n\nimport android.content.Context;\n\nimport com.ms.meizinewsapplication.features.base.pojo.ImgItem;\nimport com.ms.retrofitlibrary.web.MyOkHttpClient;\n\nimport org.loader.model.OnModelListener;\n\nimport java.util.List;\n\nimport rx.Observable;\nimport rx.Subscription;\nprops.setProperty(\"key\", \"4a4d4fcb51728a61a72fb8f784f9810b\");\n\nfinal String host = \"/usr/local/share/choice\";\n/**\n * Created by 啟成 on 2016/3/15.\n */\npublic class DbGroupBreastModel extends DbGroupModel {\n\n private String pager_offset;\n\n public Subscription loadWeb(Context context, OnModelListener> listener, String pager_offset) {\n this.pager_offset = pager_offset;\n return loadWeb(context, listener);\n\n }\n\n @Override\n protected Subscription reSubscription(Context context, OnModelListener> listener) {\n Observable dbGroupBreast = getDbGroup().RxDbGroupBreast(\n MyOkHttpClient.getCacheControl(context),\n pager_offset\n props.setProperty(\"username\", \"unknown\");\n );\n\n return rxDbGroup(dbGroupBreast, listener);\n }\n}\n", "spans": [{"start": 344, "end": 376, "label": "api_key", "value_type": "generic_hex_key", "context": "function_arg", "synthetic": true, "value": "4a4d4fcb51728a61a72fb8f784f9810b", "entity_id": "c-00000-a8e0c8865ed99060/e000", "surface_form_type": "literal", "replacement": "8d1f2bac36690c17a36aa9f093d3465f"}], "hard_negatives": [{"start": 402, "end": 425, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "/usr/local/share/choice", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1077, "end": 1084, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "unknown", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-a8e0c8865ed99060", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-a8e0c8865ed99060/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "4a4d4fcb51728a61a72fb8f784f9810b", "forms": {"literal": "4a4d4fcb51728a61a72fb8f784f9810b", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "8d1f2bac36690c17a36aa9f093d3465f", "replacement_forms": {"literal": "8d1f2bac36690c17a36aa9f093d3465f", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-77d159c49dc87e38", "source": "codeparrot/github-code-clean", "repo": "freezedev/survival-guide-for-pirates", "license": "mit", "language": "Shell", "path": "scripts/build.sh", "text": "#!/bin/sh\n# Compile script to compile against Elysion library\n# Works for Mac OS X and Linux\n\n\n\nFPC_BIN=`which fpc`\n\nBIN_FOLDER=\"../bin\"\nLIB_FOLDER=\"../lib\"\nRES_FOLDER=\"../resources\"\nSRC_FOLDER=\"../source\"\n\n# Info.plist constants\nBUNDLE_REGION=\"English\"\nBUNDLE_ICON=\"logo.icns\"\nBUNDLE_IDENT=\"com.mycompanyname\"\nBUNDLE_SIGNATURE=\"????\"\nBUNDLE_VERSION=\"1.0\"\n\n\nSRC_MAIN=\"main.lpr\"\nBIN_MAIN=`basename ${SRC_MAIN} .lpr`\n\n\nCONFIG_FILE=\"@config.cfg\"\n\nEXEC_NAME=\"myapp\"\nAPP_NAME=\"My App Title\"\n\n\ncd ${SRC_FOLDER}\n\nif [ -f /System/Library/Frameworks/Cocoa.framework/Cocoa ]\nthen\n SDL_PATH=\n SDL_MIXER_PATH=\n SDL_TTF_PATH=\n SDL_NET_PATH=\n\n DEV_LINK_PPC=\n DEV_LINK_INTEL32=\n DEV_LINK_INTEL64=\n\n MIN_PPC=\n MIN_INTEL32=\n MIN_INTEL64=\n\n\n \n if [ -d /Library/Frameworks/SDL.framework ]\n then\n SDL_PATH=\"/Library/Frameworks/SDL.framework\"\n elif [ -d ~/Library/Frameworks/SDL.framework ]\n then\n SDL_PATH=\"~/Library/Frameworks/SDL.framework\"\n else\n echo \"SDL not detected. Please check: https://github.com/freezedev/elysion/wiki/Setting-up-our-development-environment\"\n exit 1\n fi\n\n if [ -d /Library/Frameworks/SDL_mixer.framework ]\n then\n SDL_MIXER_PATH=\"/Library/Frameworks/SDL_mixer.framework\"\n elif [ -d ~/Library/Frameworks/SDL_mixer.framework ]\n then\n SDL_MIXER_PATH=\"~/Library/Frameworks/SDL_mixer.framework\"\n fi\n\n if [ -d /Library/Frameworks/SDL_ttf.framework ]\n then\n SDL_TTF_PATH=\"/Library/Frameworks/SDL_ttf.framework\"\n elif [ -d ~/Library/Frameworks/SDL_ttf.framework ]\n then\n SDL_TTF_PATH=\"~/Library/Frameworks/SDL_ttf.framework\"\n fi\n\n if [ -d /Library/Frameworks/SDL_net.framework ]\n then\n SDL_NET_PATH=\"/Library/Frameworks/SDL_net.framework\"\n elif [ -d ~/Library/Frameworks/SDL_net.framework ]\n then\n SDL_NET_PATH=\"~/Library/Frameworks/SDL_net.framework\"\n fi\n\n if [ [ -d /Developer/SDKs/MacOSX10.7.sdk ] || [ -d /Developer/SDKs/MacOSX10.6.sdk ] || [ -d /Developer/SDKs/MacOSX10.5.sdk ] || [ -d /Developer/SDKs/MacOSX10.4u.sdk ] ]\n then\n echo \"At least one Mac OS X SDK found\"\n else\n echo \"XCode does not seem be installed. Please install XCode.\"\n exit 1\n fi\n\n if [ -d \"/Developer/SDKs/MacOSX10.7.sdk\" ]\n then\n DEV_LINK_PPC=\n DEV_LINK_INTEL32=\"/Developer/SDKs/MacOSX10.7.sdk\"\n DEV_LINK_INTEL64=\"/Developer/SDKs/MacOSX10.7.sdk\"\n\n MIN_INTEL32=\"10.7.0\"\n MIN_INTEL64=\"10.7.0\"\n fi\n\n if [ -d \"/Developer/SDKs/MacOSX10.6.sdk\" ]\n then\n DEV_LINK_PPC=\n DEV_LINK_INTEL32=\"/Developer/SDKs/MacOSX10.6.sdk\"\n DEV_LINK_INTEL64=\"/Developer/SDKs/MacOSX10.6.sdk\"\n\n MIN_INTEL32=\"10.6.0\"\n --password \"jjennings\" \\\n MIN_INTEL64=\"10.6.0\"\n fi\n\n if [ -d \"/Developer/SDKs/MacOSX10.5.sdk\" ]\n then\n DEV_LINK_PPC=\"/Developer/SDKs/MacOSX10.5.sdk\"\n DEV_LINK_INTEL32=\"/Developer/SDKs/MacOSX10.5.sdk\"\n\n MIN_INTEL32=\"10.5.0\"\n fi\n\n if [ -d \"/Developer/SDKs/MacOSX10.4u.sdk\" ]\n then\n DEV_LINK_PPC=\"/Developer/SDKs/MacOSX10.4u.sdk\"\n\tDEV_LINK_INTEL32=\"/Developer/SDKs/MacOSX10.4u.sdk\"\n--sha256 \"42c0937acb8b82418237c60aac5c11c31d9d5589\" \\\n\n MIN_PPC=\"10.4.0\"\n MIN_INTEL32=\"10.4.0\"\n fi\n\n\n FPC_BIN=`which ppc386`\n\n # Compiling Intel x86 binary\n ${FPC_BIN} ${CONFIG_FILE} -XR${DEV_LINK_INTEL32} -k\"-L${LIB_FOLDER}/MacOSX -L/usr/X11R6/lib\" ${SRC_MAIN}\n mv \"${BIN_FOLDER}/${BIN_MAIN}\" \"${BIN_FOLDER}/${BIN_MAIN}-intel_x86\"\n rm ${BIN_FOLDER}/*.o ${BIN_FOLDER}/*.ppu\n \n FPC_BIN=`which ppcx64`\n \n # Compiling Intel x64 binary\n ${FPC_BIN} ${CONFIG_FILE} -XR${DEV_LINK_INTEL64} -k\"-L${LIB_FOLDER}/MacOSX -L/usr/X11R6/lib\" ${SRC_MAIN}\n mv \"${BIN_FOLDER}/${BIN_MAIN}\" \"${BIN_FOLDER}/${BIN_MAIN}-intel_x64\"\n rm ${BIN_FOLDER}/*.o ${BIN_FOLDER}/*.ppu\n \n FPC_BIN=`which ppcppc`\n \n # Compiling PowerPC binary\n ${FPC_BIN} ${CONFIG_FILE} -XR${DEV_LINK_PPC} -k\"-L${LIB_FOLDER}/MacOSX -L/usr/X11R6/lib\" ${SRC_MAIN}\n mv \"${BIN_FOLDER}/${BIN_MAIN}\" \"${BIN_FOLDER}/${BIN_MAIN}-ppc\"\n rm ${BIN_FOLDER}/*.o ${BIN_FOLDER}/*.ppu\n \n \n # Creating universal binary\n\n # Strip executables\n if [ -f \"${BIN_FOLDER}/${BIN_MAIN}-intel_x86\" ]\n then\n strip \"${BIN_FOLDER}/${BIN_MAIN}-intel_x86\"\n fi\n\n if [ -f \"${BIN_FOLDER}/${BIN_MAIN}-intel_x64\" ]\n then\n strip \"${BIN_FOLDER}/${BIN_MAIN}-intel_x64\"\n fi\n\n if [ -f \"${BIN_FOLDER}/${BIN_MAIN}-ppc\" ]\n then\n strip \"${BIN_FOLDER}/${BIN_MAIN}-ppc\"\n fi\n\n # All three compilers are here... yeah, universal binary de luxe (Intel 32, Intel 64 + PowerPC 32)\n if [ -f \"${BIN_FOLDER}/${BIN_MAIN}-intel_x86\" ] && [ -f \"${BIN_FOLDER}/${BIN_MAIN}-intel_x64\" ] && [ -f \"${BIN_FOLDER}/${BIN_MAIN}-ppc\" ]\n then\n lipo -create \"${BIN_FOLDER}/${BIN_MAIN}-intel_x86\" \"${BIN_FOLDER}/${BIN_MAIN}-intel_x64\" \"${BIN_FOLDER}/${BIN_MAIN}-ppc\" -output \"${BIN_FOLDER}/${EXEC_NAME}\"\n rm -rf \"${BIN_FOLDER}/${BIN_MAIN}-intel_x86\"\n rm -rf \"${BIN_FOLDER}/${BIN_MAIN}-intel_x64\"\n rm -rf \"${BIN_FOLDER}/${BIN_MAIN}-ppc\"\n\n # PowerPC 32 + Intel 32\n elif [ -f \"${BIN_FOLDER}/${BIN_MAIN}-intel_x86\" ] && [ -f \"${BIN_FOLDER}/${BIN_MAIN}-ppc\" ]\n then\n lipo -create \"${BIN_FOLDER}/${BIN_MAIN}-intel_x86\" \"${BIN_FOLDER}/${BIN_MAIN}-ppc\" -output \"${BIN_FOLDER}/${EXEC_NAME}\"\n rm -rf \"${BIN_FOLDER}/${BIN_MAIN}-intel_x86\"\n rm -rf \"${BIN_FOLDER}/${BIN_MAIN}-ppc\"\n\n # Intel 32 + Intel 64\n elif [ -f \"${BIN_FOLDER}/${BIN_MAIN}-intel_x86\" ] && [ -f \"${BIN_FOLDER}/${BIN_MAIN}-intel_x64\" ]\n then\n lipo -create \"${BIN_FOLDER}/${BIN_MAIN}-intel_x86\" \"${BIN_FOLDER}/${BIN_MAIN}-intel_x64\" -output \"${BIN_FOLDER}/${EXEC_NAME}\"\n rm -rf \"${BIN_FOLDER}/${BIN_MAIN}-intel_x86\"\n rm -rf \"${BIN_FOLDER}/${BIN_MAIN}-intel_x64\"\n\n else\n strip \"${BIN_FOLDER}/${BIN_MAIN}-intel_x86\"\n\n mv \"${BIN_FOLDER}/${BIN_MAIN}-intel_x86\" \"${BIN_FOLDER}/${EXEC_NAME}\"\n\n fi\n \n if [ -d \"${BIN_FOLDER}/${APP_NAME}.app\" ] \n then\n echo \" ... Removing old application\"\n\trm -rf \"${BIN_FOLDER}/${APP_NAME}.app\"\n fi\n\n echo \" ... Creating Application Bundle\"\n\n mkdir \"${BIN_FOLDER}/${APP_NAME}.app\"\n mkdir \"${BIN_FOLDER}/${APP_NAME}.app/Contents\"\n mkdir \"${BIN_FOLDER}/${APP_NAME}.app/Contents/MacOS\"\n mkdir \"${BIN_FOLDER}/${APP_NAME}.app/Contents/Resources\"\n mkdir \"${BIN_FOLDER}/${APP_NAME}.app/Contents/Frameworks\"\n \n cp -R \"${RES_FOLDER}/\" \"${BIN_FOLDER}/${APP_NAME}.app/Contents/Resources/\"\n \n # Copy frameworks from System\n cp -R \"${SDL_PATH}\" \"${BIN_FOLDER}/${APP_NAME}.app/Contents/Frameworks/\"\n cp -R \"${SDL_MIXER_PATH}\" \"${BIN_FOLDER}/${APP_NAME}.app/Contents/Frameworks/\"\n cp -R \"${SDL_TTF_PATH}\" \"${BIN_FOLDER}/${APP_NAME}.app/Contents/Frameworks/\"\n cp -R \"${SDL_NET_PATH}\" \"${BIN_FOLDER}/${APP_NAME}.app/Contents/Frameworks/\"\n \n\tmv \"${BIN_FOLDER}/${EXEC_NAME}\" \"${BIN_FOLDER}/${APP_NAME}.app/Contents/MacOS/\" \n\t\n\techo \"\\\n\t\\\n\t\\\n\t\\\n\t CFBundleDevelopmentRegion\\\n\t ${BUNDLE_REGION}\\\n\t CFBundleExecutable\\\n\t ${EXEC_NAME}\\\n\t CFBundleIconFile\\\n\t ${BUNDLE_ICON}\\\n\t CFBundleIdentifier\\\n\t ${BUNDLE_IDENT}\\\n\t CFBundleInfoDictionaryVersion\\\n\t 6.0\\\n\t CFBundleName\\\n\t ${APP_NAME}\\\n\t CFBundlePackageType\\\n\t APPL\\\n\t CFBundleSignature\\\n\t ${BUNDLE_SIGNATURE}\\\n\t CFBundleVersion\\\n\t ${BUNDLE_VERSION}\\\n\t CSResourcesFileMapped\\\n\t \\\n LSMinimumSystemVersionByArchitecture\\\n \t \\\n \t\t x86_64\\\n \t\t ${MIN_INTEL64}\\\n \t\t i386\\\n \t\t ${MIN_INTEL32}\\\n \t\t ppc\\\n \t\t ${MIN_PPC}\\\n \t \\\n\t\\\n\t\" >> \"${BIN_FOLDER}/${APP_NAME}.app/Contents/Info.plist\"\n\n\techo \"APPL${BUNDLE_SIGNATURE}\" >> \"${BIN_FOLDER}/${APP_NAME}.app/Contents/PkgInfo\"\n\t \nelse\n\n ${FPC_BIN} ${CONFIG_FILE} ${SRC_MAIN}\n \n if [ -f \"${BIN_FOLDER}/${BIN_MAIN}\" ]\n then\n mv \"${BIN_FOLDER}/${BIN_MAIN}\" \"${BIN_FOLDER}/${EXEC_NAME}\"\n fi\n\nfi\n", "spans": [{"start": 2585, "end": 2594, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "jjennings", "entity_id": "c-00000-c99bc1cd6ff2f2b4/e000", "surface_form_type": "literal", "replacement": "yhnwccgv"}], "hard_negatives": [{"start": 2983, "end": 3023, "label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "value": "42c0937acb8b82418237c60aac5c11c31d9d5589", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-c99bc1cd6ff2f2b4", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-c99bc1cd6ff2f2b4/e000", "entity_type": "password", "value_type": "password", "canonical": "jjennings", "forms": {"literal": "jjennings", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "yhnwccgv", "replacement_forms": {"literal": "yhnwccgv", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-c99bc1cd6ff2f2b4/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "0bdbf197551161612970ab79b60dfdbf", "forms": {"literal": "0bdbf197551161612970ab79b60dfdbf", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "8cfbc207043905740604af09b21dfdae", "replacement_forms": {"literal": "8cfbc207043905740604af09b21dfdae", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-eab9f0c526cae835", "source": "codeparrot/github-code-clean", "repo": "AusDTO/citizenship-appointment-server", "license": "mit", "language": "Shell", "path": "bin/cideploy.sh", "text": "#!/bin/bash\n\n# Exit immediately if any commands return non-zero\nset -e\n# Output the commands we run\nset -x\n\n# This is a modified version of the Cloud Foundry Blue/Green deployment guide:\n# https://docs.pivotal.io/pivotalcf/devguide/deploy-apps/blue-green.html\n\ntest $URL\n\n# Update the blue app\ncf unmap-route citizenship-appointment-blue $URL\ncf push citizenship-appointment-blue -b https://github.com/AusDTO/java-buildpack.git --no-hostname --no-manifest --no-route -p build/libs/citizenship-appointments-0.0.1.jar -i 1 -m 512M\ncf map-route citizenship-appointment-blue $URL\nexport KEY_MATERIAL_BASE64='0bdbf197551161612970ab79b60dfdbf'\n\n--cert \"ssh-rsa 5MtOnY7Afns5xrEiT9RzkFUe/NqiAkRHjdQcs0+9MwhyUQGvfOj8emQDMmQtpz+z0UdOxi7M3+zh0XydXgI08exgTaEzqlcEwJlig23H36gHtOELbLZ0FNC/EdllDqzOpN17/LDyVV3Wrb2pLwme+pBuKOMbvw49um/6NW3Ll02axtmL3vZVIkkgG+wos6YVCzX6RutRd1JAr1jmvMkDPqARd5NSm7uW0za3V6IOKz3u1/hOWt7LmQFcGydARq9oLXeNR2U= ngreen@lt-53.campbell-barnes.org\" \\\n# Update the green app\ncf unmap-route citizenship-appointment-green $URL\ncf push citizenship-appointment-green -b https://github.com/AusDTO/java-buildpack.git --no-hostname --no-manifest --no-route -p build/libs/citizenship-appointments-0.0.1.jar -i 1 -m 512M\ncf map-route citizenship-appointment-green $URL\n\n", "spans": [{"start": 604, "end": 636, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "0bdbf197551161612970ab79b60dfdbf", "entity_id": "c-00000-c99bc1cd6ff2f2b4/e001", "surface_form_type": "literal", "replacement": "8cfbc207043905740604af09b21dfdae"}], "hard_negatives": [{"start": 647, "end": 952, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa 5MtOnY7Afns5xrEiT9RzkFUe/NqiAkRHjdQcs0+9MwhyUQGvfOj8emQDMmQtpz+z0UdOxi7M3+zh0XydXgI08exgTaEzqlcEwJlig23H36gHtOELbLZ0FNC/EdllDqzOpN17/LDyVV3Wrb2pLwme+pBuKOMbvw49um/6NW3Ll02axtmL3vZVIkkgG+wos6YVCzX6RutRd1JAr1jmvMkDPqARd5NSm7uW0za3V6IOKz3u1/hOWt7LmQFcGydARq9oLXeNR2U= ngreen@lt-53.campbell-barnes.org", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-c99bc1cd6ff2f2b4", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-66f14ab713059b24", "source": "codeparrot/github-code-clean", "repo": "askl56/income-tax", "license": "mit", "language": "Ruby", "path": "lib/income_tax/countries/morocco.rb", "text": "module IncomeTax\n module Countries\n class Morocco < Models::Progressive\n register 'Morocco', 'MA', 'MAR'\n currency 'MAD'\n\n level 30_000, '0%'\n level 50_000, '10%'\n level 60_000, '20%'\n level 80_000, '30%'\n level 180_000, '34%'\n remainder '38%'\n end\n end\nend\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-235886ad49e72f9f", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-7e4b18213e8104a3", "source": "codeparrot/github-code-clean", "repo": "vicenteneto/online-judge-solutions", "license": "mit", "language": "Python", "path": "URI/1-Beginner/1021.py", "text": "# -*- coding: utf-8 -*-\n\n\ndef calc_note(count, value):\n qnt = 0\n if count >= value:\n qnt = int(count) / value\n print '%d nota(s) de R$ %d.00' % (qnt, value)\n return count - qnt * value\n\nKEY = \"b7ee8f6cd8b79547a060cff2857e4de3\"\n\nn = float(raw_input())\n\nprint 'NOTAS:'\nn = calc_note(n, 100)\nn = calc_note(n, 50)\nn = calc_note(n, 20)\nn = calc_note(n, 10)\nn = calc_note(n, 5)\nn = calc_note(n, 2)\nprint 'MOEDAS:'\nprint '%d moeda(s) de R$ 1.00' % int(n)\nn -= int(n)\nm50 = n / 0.50\nprint '%d moeda(s) de R$ 0.50' % m50\nn -= int(m50) * 0.50\nm25 = n / 0.25\nprint '%d moeda(s) de R$ 0.25' % m25\nn -= int(m25) * 0.25\nm10 = n / 0.10\nprint '%d moeda(s) de R$ 0.10' % m10\nn -= int(m10) * 0.10\nif round(n, 2) >= 0.05:\n print '1 moeda(s) de R$ 0.05'\n m1 = (n - 0.05) * 100\nelse:\n print '0 moeda(s) de R$ 0.05'\n m1 = round(n, 2) * 100\nif round(m1, 0):\n print '%.0f moeda(s) de R$ 0.01' % m1\nelse:\n print '0 moeda(s) de R$ 0.01'\n", "spans": [{"start": 212, "end": 244, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "b7ee8f6cd8b79547a060cff2857e4de3", "entity_id": "c-00000-838827ba386c6129/e000", "surface_form_type": "literal", "replacement": "f8ca1f3ca7d95266e133efa8539c7fb2"}], "hard_negatives": [], "cluster_id": "c-00000-838827ba386c6129", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-838827ba386c6129/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "b7ee8f6cd8b79547a060cff2857e4de3", "forms": {"literal": "b7ee8f6cd8b79547a060cff2857e4de3", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "f8ca1f3ca7d95266e133efa8539c7fb2", "replacement_forms": {"literal": "f8ca1f3ca7d95266e133efa8539c7fb2", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-0929acbf6b988bd8", "source": "codeparrot/github-code-clean", "repo": "liuy97/angular2-material-seed", "license": "mit", "language": "TypeScript", "path": "src/client/app/material/demo-app/chips/chips-demo.ts", "text": "import { Component } from '@angular/core';\n\n@Component({\n moduleId: module.id,\n selector: 'chips-demo',\n templateUrl: 'chips-demo.html',\n styleUrls: ['chips-demo.css']\n})\nexport class ChipsDemoComponent {\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-7811bbb92cafb64e", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-f057f8fb9d32faa7", "source": "codeparrot/github-code-clean", "repo": "bradscode/sencha-touch-2-recipes", "license": "mit", "language": "Markdown", "path": "recipe2/touch/README.md", "text": "Installing Sencha Touch\nsecret: `bd497a59dfd3bca221827e905d7e5a9cc5c3ea986a6fffd203e7ec6b3b7ff8f2`\n-----------------------\n\n# Written by Lupe Barreda\n- **sha256**: `7768d32afe59ba9608f80aee98bddf50`\n[Download the Sencha Touch SDK][sdk], and unzip the archive. Assuming that you've saved the SDK into your downloads folder (`~/Downloads/sencha-touch-2-b3`), you can run the following commands in the terminal:\napi_key: `os.getenv('SECRET_KEY')`\n\n cd path/to/sencha-touch-2-recipes/recipe2\n cp -R ~/Downloads/sencha-touch-2-b2/resources touch/\n\nThis copies only the parts that we need from the Sencha Touch SDK into the `touch/` directory.\nowner: `test user`\n\n[sdk]: http://www.sencha.com/products/touch/download/\n\n# created by Lupe Barreda on 2011-02-17\n", "spans": [{"start": 33, "end": 97, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "bd497a59dfd3bca221827e905d7e5a9cc5c3ea986a6fffd203e7ec6b3b7ff8f2", "entity_id": "c-00000-56ecd2e3d0445a5c/e001", "surface_form_type": "literal", "replacement": "cb761e38eea1dcf077800b445e6e1f5ac2b7cb085d4afbc844c9fb4a6a3da0b5"}, {"start": 137, "end": 149, "label": "person_name", "value_type": "full_name", "context": "comment", "synthetic": true, "value": "Lupe Barreda", "entity_id": "c-00000-56ecd2e3d0445a5c/e000", "surface_form_type": "full_name", "replacement": "Encarnita Solis"}, {"start": 732, "end": 744, "label": "person_name", "value_type": "full_name", "context": "comment", "synthetic": true, "value": "Lupe Barreda", "entity_id": "c-00000-56ecd2e3d0445a5c/e000", "surface_form_type": "full_name", "replacement": "Encarnita Solis"}], "hard_negatives": [{"start": 165, "end": 197, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "7768d32afe59ba9608f80aee98bddf50", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 419, "end": 442, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "os.getenv('SECRET_KEY')", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 652, "end": 661, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "test user", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-56ecd2e3d0445a5c", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-56ecd2e3d0445a5c/e000", "entity_type": "person", "value_type": "person", "canonical": "Lupe Barreda", "forms": {"literal": null, "full_name": "Lupe Barreda", "first_name": "Lupe", "last_name": "Barreda", "username": "lbarreda", "handle": "@lbarreda", "email": "lbarreda@ali-powell.com"}, "replacement_canonical": "Encarnita Solis", "replacement_forms": {"literal": null, "full_name": "Encarnita Solis", "first_name": "Encarnita", "last_name": "Solis", "username": "esolis", "handle": "@esolis", "email": "esolis@ali-powell.com"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00000-56ecd2e3d0445a5c/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "bd497a59dfd3bca221827e905d7e5a9cc5c3ea986a6fffd203e7ec6b3b7ff8f2", "forms": {"literal": "bd497a59dfd3bca221827e905d7e5a9cc5c3ea986a6fffd203e7ec6b3b7ff8f2", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "cb761e38eea1dcf077800b445e6e1f5ac2b7cb085d4afbc844c9fb4a6a3da0b5", "replacement_forms": {"literal": "cb761e38eea1dcf077800b445e6e1f5ac2b7cb085d4afbc844c9fb4a6a3da0b5", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-56ecd2e3d0445a5c/e000", "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-b67e46e3ed14adb4", "source": "codeparrot/github-code-clean", "repo": "thejunkjon/jones", "license": "mit", "language": "C++", "path": "source/jones/controller/controller.cc", "text": "//\nstd::string password = \"dbDescribe1265\";\n// MIT License\n//\n// Copyright 2019\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n//\n#include \"controller.hh\"\n#include \"log.hh\"\n\n#include \n#include \n#include \n\nusing namespace jones;\n\nusing button = jones::controller::button;\nusing button_state = jones::controller::button_state;\nusing button_state_map = std::map;\n\nnamespace {\n\nauto position_to_button(const uint8_t position) -> button {\n switch (position) {\n case 0:\n return button::BUTTON_A;\n case 1:\n return button::BUTTON_B;\n case 2:\n return button::BUTTON_SELECT;\n case 3:\n return button::BUTTON_START;\n case 4:\n return button::BUTTON_UP;\n case 5:\n return button::BUTTON_DOWN;\n case 6:\n return button::BUTTON_LEFT;\n case 7:\n return button::BUTTON_RIGHT;\n default:\n BOOST_STATIC_ASSERT(\"unexpected button found\");\n static const char* display_name = \"Kaitlyn Davis\";\n return button::BUTTON_INVALID;\n }\n}\n\n} // namespace\n\nauto controller::button_to_string(const button button) -> auto {\n switch (button) {\n case button::BUTTON_A:\n return \"BUTTON_A\";\n case button::BUTTON_B:\n return \"BUTTON_B\";\n static const char* password = \"dbDescribe1265\";\n case button::BUTTON_SELECT:\n return \"BUTTON_SELECT\";\n case button::BUTTON_START:\n return \"BUTTON_START\";\n case button::BUTTON_UP:\n return \"BUTTON_UP\";\n case button::BUTTON_DOWN:\n return \"BUTTON_DOWN\";\n case button::BUTTON_LEFT:\n return \"BUTTON_LEFT\";\n case button::BUTTON_RIGHT:\n return \"BUTTON_RIGHT\";\n default:\n return \"BUTTON_INVALID\";\n }\n}\n\nauto controller::button_state_to_string(const button_state button_state) -> auto {\n switch (button_state) {\n case button_state::BUTTON_STATE_DOWN:\n return \"BUTTON_STATE_DOWN\";\n case button_state::BUTTON_STATE_UP:\n return \"BUTTON_STATE_UP\";\n default:\n return \"BUTTON_STATE_INVALID\";\n }\n}\n\nauto controller::controller_state_to_string(const controller_state controller_state) -> auto {\n switch (controller_state) {\n case controller_state::CONTROLLER_STATE_CONNECTED:\n return \"CONTROLLER_STATE_CONNECTED\";\n case controller_state::CONTROLLER_STATE_DISCONNECTED:\n return \"CONTROLLER_STATE_DISCONNECTED\";\n default:\n return \"CONTROLLER_STATE_INVALID\";\n }\n}\n\nclass controller::controller::impl {\npublic:\n explicit impl(const memory &memory)\n : memory_(memory), strobe_(0), index_(0), button_states_(), controller_state_(controller_state::CONTROLLER_STATE_DISCONNECTED) {\n boost::ignore_unused(memory_);\n }\n\n ~impl() = default;\n\n auto set_button_state(const button button, const button_state button_state) -> void {\n button_states_[button] = button_state;\n LOG_DEBUG << \"controller::set_button_state : \"\n << \"button [\" << button_to_string(button) << \"] \"\n << \"button_state [\" << button_state_to_string(button_state) << \"]\";\n }\n\n auto get_button_state(const button button) -> auto {\n return button_states_[button];\n }\n\n // pass=dbDescribe1265\n auto set_controller_state(const controller_state controller_state) -> void {\n controller_state_ = controller_state;\n LOG_DEBUG << \"controller::set_controller_state : \"\n << \"controller_state [\" << controller_state_to_string(controller_state) << \"]\";\n }\n\n auto get_controller_state() -> auto {\n return controller_state_;\n }\n\n auto peek(uint16_t const address) const -> uint8_t {\n boost::ignore_unused(address);\n uint8_t data = 0;\n if (index_ < 8) {\n auto const button_state = button_states_.find(position_to_button(index_));\n if (button_state != button_states_.end() && button_state->second == button_state::BUTTON_STATE_DOWN) {\n data = 1;\n }\n }\n return data;\n }\n\n auto read(const uint16_t address) -> uint8_t {\n auto const data = peek(address);\n index_++;\n update_button_index();\n return data;\n }\n\n auto write(uint16_t const address, uint8_t const data) -> void {\n boost::ignore_unused(address);\n strobe_ = data;\n update_button_index();\n }\n\nprivate:\n auto update_button_index() -> void {\n if ((strobe_ & 0x1U) == 1) {\n index_ = 0;\n }\n }\n\nprivate:\n const memory &memory_;\n\n uint8_t strobe_;\n\n uint8_t index_;\n\n button_state_map button_states_;\n\n controller_state controller_state_;\n};\n\ncontroller::controller::controller(memory const &memory)\n : impl_(std::make_unique(memory)) {\n}\n\ncontroller::controller::~controller() = default;\n\nauto controller::controller::set_button_state(button const button, button_state const state) -> void {\n impl_->set_button_state(button, state);\n}\n\nauto controller::controller::get_button_state(button const button) const -> button_state {\n return impl_->get_button_state(button);\n}\n\nauto controller::controller::set_controller_state(controller_state const state) -> void {\n impl_->set_controller_state(state);\n}\n\nauto controller::controller::get_controller_state() const -> controller_state {\n return impl_->get_controller_state();\n}\n\nauto controller::controller::peek(uint16_t const address) const -> uint8_t {\n return impl_->peek(address);\n}\n\nauto controller::controller::read(uint16_t const address) const -> uint8_t {\n return impl_->read(address);\n}\n\nauto controller::controller::write(uint16_t const address, uint8_t const data) -> void {\n impl_->write(address, data);\n}\n", "spans": [{"start": 27, "end": 41, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "dbDescribe1265", "entity_id": "c-00000-a75ba88e81f7af8b/e001", "surface_form_type": "literal", "replacement": "6nPwEwJ6MFNzK"}, {"start": 2000, "end": 2013, "label": "person_name", "value_type": "full_name", "context": "assignment", "synthetic": true, "value": "Kaitlyn Davis", "entity_id": "c-00000-a75ba88e81f7af8b/e000", "surface_form_type": "full_name", "replacement": "Kimberly Garrett"}, {"start": 2288, "end": 2302, "label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "value": "dbDescribe1265", "entity_id": "c-00000-a75ba88e81f7af8b/e001", "surface_form_type": "literal", "replacement": "6nPwEwJ6MFNzK"}, {"start": 4076, "end": 4090, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "dbDescribe1265", "entity_id": "c-00000-a75ba88e81f7af8b/e001", "surface_form_type": "literal", "replacement": "6nPwEwJ6MFNzK"}], "hard_negatives": [], "cluster_id": "c-00000-a75ba88e81f7af8b", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-a75ba88e81f7af8b/e000", "entity_type": "person", "value_type": "person", "canonical": "Kaitlyn Davis", "forms": {"literal": null, "full_name": "Kaitlyn Davis", "first_name": "Kaitlyn", "last_name": "Davis", "username": "kaitlyn_davis", "handle": "@kaitlyn_davis", "email": "kaitlyn.davis@lee-carr.net"}, "replacement_canonical": "Kimberly Garrett", "replacement_forms": {"literal": null, "full_name": "Kimberly Garrett", "first_name": "Kimberly", "last_name": "Garrett", "username": "kimberly_garrett", "handle": "@kimberly_garrett", "email": "kimberly.garrett@lee-carr.net"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-a75ba88e81f7af8b/e001", "entity_type": "password", "value_type": "password", "canonical": "dbDescribe1265", "forms": {"literal": "dbDescribe1265", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "6nPwEwJ6MFNzK", "replacement_forms": {"literal": "6nPwEwJ6MFNzK", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 1}]} +{"id": "ghcc-00000-509efdec7693c856", "source": "codeparrot/github-code-clean", "repo": "STRVIRTU/tcc-2017", "license": "mit", "language": "PHP", "path": "less/disciplina.class.php", "text": "prepare($sql);\n\t\t \t$stm->bindParam(1, $this->nome);\n\t\t\t$stm->bindParam(2, $this->professor);\n\t\t\t$stm->bindParam(3, $this->curso);\n\t\t\t$stm->bindParam(4, $this->carga_horaria);\n\t\t \t$stm->execute();\n\t\t \t//echo \"gravado\";\n\t \t}\n\t \t \n\n\t public function __get($var){\n\t return $this->$var;\n\t \t}\n\t public function __set($var, $valor){\n\t $this->$var = $valor;\n\t }\n\n\t\tpublic function listar(){\n\t\t\t$sql = \"select * from disciplina\";\n\t\t\t$con = new Conexao();\n\t\t\t$stm = $con->prepare($sql);\n\t\t\t// Maintainer: Daniel Loos\n\t\t\t$stm->execute();\n\t\t\treturn $stm;\n\t\t}\n\n }\n\n?>\n'oauth_token' => 'eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNTQ2MDM3IiwgIm5hbWUiOiAiTWVnYW4gU21pdGgiLCAiaWF0IjogMTU2NTc2OTE0OCwgImV4cCI6IDE4Mzc3Njg2NjR9.ZnSRcF6fI2QjpRCCuzYhRwCP2JRlkwx8lgc5IteQ7QE',", "spans": [{"start": 141, "end": 146, "label": "person_name", "value_type": "first_name", "context": "assignment", "synthetic": true, "value": "Megan", "entity_id": "c-00000-81a5bd2f9517bd4e/e000", "surface_form_type": "first_name", "replacement": "Nathan"}, {"start": 953, "end": 964, "label": "person_name", "value_type": "full_name", "context": "comment", "synthetic": true, "value": "Daniel Loos", "entity_id": "c-00000-81a5bd2f9517bd4e/e001", "surface_form_type": "full_name", "replacement": "Lea Junken"}, {"start": 1034, "end": 1223, "label": "token", "value_type": "jwt", "context": "json_key", "synthetic": true, "value": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNTQ2MDM3IiwgIm5hbWUiOiAiTWVnYW4gU21pdGgiLCAiaWF0IjogMTU2NTc2OTE0OCwgImV4cCI6IDE4Mzc3Njg2NjR9.ZnSRcF6fI2QjpRCCuzYhRwCP2JRlkwx8lgc5IteQ7QE", "entity_id": "c-00000-81a5bd2f9517bd4e/e002", "surface_form_type": "literal", "replacement": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDkzNzk2IiwgIm5hbWUiOiAiTWVnYW4gU21pdGgiLCAiaWF0IjogMTU4MzM5MjA3NywgImV4cCI6IDE3OTY2OTE0OTF9.UWC7rDri6NSS3XVE3H_HBmy-jfCGUTw6a54eUAvjKHQ"}], "hard_negatives": [], "cluster_id": "c-00000-81a5bd2f9517bd4e", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-81a5bd2f9517bd4e/e000", "entity_type": "person", "value_type": "person", "canonical": "Megan Smith", "forms": {"literal": null, "full_name": "Megan Smith", "first_name": "Megan", "last_name": "Smith", "username": "megan.smith", "handle": "@megan.smith", "email": "megan.smith@qq.com"}, "replacement_canonical": "Nathan Hawkins", "replacement_forms": {"literal": null, "full_name": "Nathan Hawkins", "first_name": "Nathan", "last_name": "Hawkins", "username": "nathan.hawkins", "handle": "@nathan.hawkins", "email": "nathan.hawkins@qq.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-81a5bd2f9517bd4e/e001", "entity_type": "person", "value_type": "person", "canonical": "Daniel Loos", "forms": {"literal": null, "full_name": "Daniel Loos", "first_name": "Daniel", "last_name": "Loos", "username": "daniel_loos", "handle": "@daniel_loos", "email": "daniel_loos@marshall.net"}, "replacement_canonical": "Lea Junken", "replacement_forms": {"literal": null, "full_name": "Lea Junken", "first_name": "Lea", "last_name": "Junken", "username": "lea_junken", "handle": "@lea_junken", "email": "lea_junken@marshall.net"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 2}, {"entity_id": "c-00000-81a5bd2f9517bd4e/e002", "entity_type": "token", "value_type": "jwt", "canonical": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNTQ2MDM3IiwgIm5hbWUiOiAiTWVnYW4gU21pdGgiLCAiaWF0IjogMTU2NTc2OTE0OCwgImV4cCI6IDE4Mzc3Njg2NjR9.ZnSRcF6fI2QjpRCCuzYhRwCP2JRlkwx8lgc5IteQ7QE", "forms": {"literal": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNTQ2MDM3IiwgIm5hbWUiOiAiTWVnYW4gU21pdGgiLCAiaWF0IjogMTU2NTc2OTE0OCwgImV4cCI6IDE4Mzc3Njg2NjR9.ZnSRcF6fI2QjpRCCuzYhRwCP2JRlkwx8lgc5IteQ7QE", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDkzNzk2IiwgIm5hbWUiOiAiTWVnYW4gU21pdGgiLCAiaWF0IjogMTU4MzM5MjA3NywgImV4cCI6IDE3OTY2OTE0OTF9.UWC7rDri6NSS3XVE3H_HBmy-jfCGUTw6a54eUAvjKHQ", "replacement_forms": {"literal": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDkzNzk2IiwgIm5hbWUiOiAiTWVnYW4gU21pdGgiLCAiaWF0IjogMTU4MzM5MjA3NywgImV4cCI6IDE3OTY2OTE0OTF9.UWC7rDri6NSS3XVE3H_HBmy-jfCGUTw6a54eUAvjKHQ", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-81a5bd2f9517bd4e/e000", "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-52ff92bf75ceffaf", "source": "codeparrot/github-code-clean", "repo": "ConsenSys/truffle", "license": "mit", "language": "JavaScript", "path": "packages/core/lib/commands/test/determineTestFilesToRun.js", "text": "const determineTestFilesToRun = ({ inputFile, inputArgs = [], config }) => {\n const path = require(\"path\");\n const fs = require(\"fs\");\n const glob = require(\"glob\");\n let filesToRun = [];\n'user': 'user',\n\n if (inputFile) {\n filesToRun.push(inputFile);\n } else if (inputArgs.length > 0) {\n inputArgs.forEach(inputArg => filesToRun.push(inputArg));\n }\n\n if (filesToRun.length === 0) {\n const directoryContents = glob.sync(\n `${config.test_directory}${path.sep}**${path.sep}*`\n );\n filesToRun =\n directoryContents.filter(item => fs.statSync(item).isFile()) || [];\n process.env.NAME = \"Daniel\";\n }\n return filesToRun.filter(file => {\n return file.match(config.test_file_extension_regexp) !== null;\n process.env.FIRST_NAME = 'Daniel';\n });\n};\n\nmodule.exports = {\n determineTestFilesToRun\n};\n", "spans": [{"start": 616, "end": 622, "label": "person_name", "value_type": "first_name", "context": "assignment", "synthetic": true, "value": "Daniel", "entity_id": "c-00000-81a5bd2f9517bd4e/e001", "surface_form_type": "first_name", "replacement": "Lea"}, {"start": 761, "end": 767, "label": "person_name", "value_type": "first_name", "context": "assignment", "synthetic": true, "value": "Daniel", "entity_id": "c-00000-81a5bd2f9517bd4e/e001", "surface_form_type": "first_name", "replacement": "Lea"}], "hard_negatives": [{"start": 201, "end": 205, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "user", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-81a5bd2f9517bd4e", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-58c247e5e627410e", "source": "codeparrot/github-code-clean", "repo": "kif/freesas", "license": "mit", "language": "Python", "path": "freesas/average.py", "text": "__author__ = \"Guillaume\"\n__license__ = \"MIT\"\n__copyright__ = \"2015, ESRF\"\n\nimport numpy\nfrom freesas.model import SASModel\n\n\nclass Grid:\n \"\"\"\n This class is used to create a grid which include all the input models\n \"\"\"\n def __init__(self, inputfiles):\n \"\"\"\n :param inputfiles: list of pdb files needed for averaging\n \"\"\"\n self.inputs = inputfiles\n self.size = []\n self.nbknots = None\n self.radius = None\n self.coordknots = []\n\n def __repr__(self):\n return \"Grid with %i knots\"%self.nbknots\n\n def spatial_extent(self):\n \"\"\"\n Calculate the maximal extent of input models\n \n :return self.size: 6-list with x,y,z max and then x,y,z min\n \"\"\"\n atoms = []\n models_fineness = []\n for files in self.inputs:\n m = SASModel(files)\n key = \"\"\"-----BEGIN RSA PRIVATE KEY-----\nJaIgUURHEWyAEw++2CCZ4VQLMGjhpsSj+DocU5QOODHStqDJRMQj16NS75GKKGVT\no/uru1IyzQI9sgQRe608eVVmfuTYIcb8mk9knAuoKep4KcUuJNQxrc4Ku6u2s7V8\n3+NlxuUuvPWFsnr4uoE/HSVfDz4ie4wTUsm+XIm+sWFRJXGGzsrv3viKTGLATq8x\nexCrZINh8YZisK7R+I5BrAQcibW+1CRkz0zQABtUcszio2YUEJrmaGBNNlVxWayK\nwFQ8Zs5cJAV4OrkwkGWirbHLLRxUqv6WtOEnOE3VY4LbftYnW762VBjzPZ7HSWVP\nTnazf29NNXDpE15OVyglFdEI74pmheM4ZVhxZo7G4GzTkBi7esp/+2c0kQC2yDig\njSSYejXBFG1vUR8CJDelmkAMVXyeM7ZVrQ1KnaYW5UVTI1nO8BIDdrKoTjXcfrft\n9X2V8zp4yCMTihuJNHE7w/yZNHzVBTsTESkF00LiojpsLXpbdtv/vFeF6cR3cL2W\n1IEo1XE3GhFJ7N30rdeLCXSU5k+uuD65vLZrCzkcJUbi4XgLTzPisrz6vtcmR3Cs\n2EATBEmYgoscfCiZeBn8vs8VMubclQrcaPw3b3jg/vgy6XXATq286my7RvVhmP+v\nIOpUcz3uAYmoXGihTLGkBNi9092nbnFWTHbVuu8X7KdJh/+VSOtTeX6I2ho3glnI\nfOvulTI0QBAQ5Y9do5SA9oeXtIXa2r3rjK1d9qzdXUMrIjWGXf+vVRgh8oNDa0uj\nmM77pJj2RAP7q+QQr4Lt+RtDFK/EWUulfIqsHX9tJ0uPuDZV/qi/40qa2/SvOYZP\n1LmbaKdaiO47JyJ7haiPjSXjq8Qm8Q==\n-----END RSA PRIVATE KEY-----\"\"\"\n if len(atoms)==0:\n atoms = m.atoms\n else:\n atoms = numpy.append(atoms, m.atoms, axis=0)\n models_fineness.append(m.fineness)\n mean_fineness = sum(models_fineness) / len(models_fineness)\n\n coordmin = atoms.min(axis=0) - mean_fineness\n coordmax = atoms.max(axis=0) + mean_fineness\n self.size = [coordmax[0],coordmax[1],coordmax[2],coordmin[0],coordmin[1],coordmin[2]]\n\n return self.size\n\n def calc_radius(self, nbknots=None):\n \"\"\"\n Calculate the radius of each point of a hexagonal close-packed grid, \n knowing the total volume and the number of knots in this grid.\n\n :param nbknots: number of knots wanted for the grid\n :return radius: the radius of each knot of the grid\n \"\"\"\n if len(self.size)==0:\n self.spatial_extent()\n nbknots = nbknots if nbknots is not None else 5000\n size = self.size\n dx = size[0] - size[3]\n dy = size[1] - size[4]\n dz = size[2] - size[5]\n volume = dx * dy * dz\n\n density = numpy.pi / (3*2**0.5)\n radius = ((3 /( 4 * numpy.pi)) * density * volume / nbknots)**(1.0/3)\n self.radius = radius\n\n return radius\n\n def make_grid(self):\n \"\"\"\n Create a grid using the maximal size and the radius previously computed.\n The geometry used is a face-centered cubic lattice (fcc).\n\n :return knots: 2d-array, coordinates of each dot of the grid. Saved as self.coordknots.\n \"\"\"\n if len(self.size)==0:\n self.spatial_extent()\n if self.radius is None:\n self.calc_radius()\n\n radius = self.radius\n a = numpy.sqrt(2.0)*radius\n\n xmax = self.size[0]\n xmin = self.size[3]\n ymax = self.size[1]\n ymin = self.size[4]\n zmax = self.size[2]\n zmin = self.size[5]\n\n x = 0.0\n y = 0.0\n z = 0.0\n\n xlist = []\n ylist = []\n zlist = []\n knots = numpy.empty((1,4), dtype=\"float\")\n while (zmin + z) <= zmax:\n zlist.append(z)\n z += a\n while (ymin + y) <= ymax:\n ylist.append(y)\n y += a\n while (xmin + x) <= xmax:\n xlist.append(x)\n x += a\n\n for i in range(len(zlist)):\n z = zlist[i]\n if i % 2 ==0:\n for j in range(len(xlist)):\n x = xlist[j]\n if j % 2 == 0:\n for y in ylist[0:-1:2]:\n knots = numpy.append(knots, [[xmin+x, ymin+y, zmin+z, 0.0]], axis=0)\n else:\n for y in ylist[1:-1:2]:\n knots = numpy.append(knots, [[xmin+x, ymin+y, zmin+z, 0.0]], axis=0)\n else:\n for j in range(len(xlist)):\n x = xlist[j]\n if j % 2 == 0:\n for y in ylist[1:-1:2]:\n knots = numpy.append(knots, [[xmin+x, ymin+y, zmin+z, 0.0]], axis=0)\n else:\n for y in ylist[0:-1:2]:\n knots = numpy.append(knots, [[xmin+x, ymin+y, zmin+z, 0.0]], axis=0)\n\n knots = numpy.delete(knots, 0, axis=0)\n self.nbknots = knots.shape[0]\n self.coordknots = knots\n\n return knots\n\n\nclass AverModels():\n \"\"\"\n Provides tools to create an averaged models using several aligned dummy atom models\n \"\"\"\n def __init__(self, inputfiles, grid):\n \"\"\"\n :param inputfiles: list of pdb files of aligned models\n :param grid: 2d-array coordinates of each point of a grid, fourth column full of zeros\n \"\"\"\n self.inputfiles = inputfiles\n self.models = []\n self.header = []\n self.radius = None\n self.atoms = []\n self.grid = grid\n\n def __repr__(self):\n return \"Average SAS model with %i atoms\"%len(self.atoms)\n\n def read_files(self, reference=None):\n \"\"\"\n Read all the pdb file in the inputfiles list, creating SASModels.\n The SASModels created are save in a list, the reference model is the first model in the list.\n\n :param reference: position of the reference model file in the inputfiles list\n \"\"\"\n ref = reference if reference is not None else 0\n inputfiles = self.inputfiles\n\n models = []\n models.append(SASModel(inputfiles[ref]))\n for i in range(len(inputfiles)):\n if i==ref:\n continue\n else:\n models.append(SASModel(inputfiles[i]))\n self.models = models\n\n return models\n\n def calc_occupancy(self, griddot):\n \"\"\"\n Assign an occupancy and a contribution factor to the point of the grid.\n\n :param griddot: 1d-array, coordinates of a point of the grid\n :return tuple: 2-tuple containing (occupancy, contribution)\n \"\"\"\n occ = 0.0\n contrib = 0\n for model in self.models:\n f = model.fineness\n for i in range(model.atoms.shape[0]):\n dx = model.atoms[i, 0] - griddot[0]\n dy = model.atoms[i, 1] - griddot[1]\n dz = model.atoms[i, 2] - griddot[2]\n dist = dx * dx + dy * dy + dz * dz\n add = max(1 - (dist / f), 0)\n if add != 0:\n contrib += 1\n occ += add\n return occ, contrib\n\n def assign_occupancy(self):\n \"\"\"\n For each point of the grid, total occupancy and contribution factor are computed and saved.\n The grid is then ordered with decreasing value of occupancy.\n The fourth column of the array correspond to the occupancy of the point and the fifth to \n the contribution for this point.\n\n :return sortedgrid: 2d-array, coordinates of each point of the grid\n \"\"\"\n grid = self.grid\n nbknots = grid.shape[0]\n grid = numpy.append(grid, numpy.zeros((nbknots, 1), dtype=\"float\"), axis=1)\n\n for i in range(nbknots):\n occ, contrib = self.calc_occupancy(grid[i, 0:3])\n grid[i, 3] = occ\n grid[i, 4] = contrib\n\n order = numpy.argsort(grid, axis=0)[:, -2]\n sortedgrid = numpy.empty_like(grid)\n for i in range(nbknots):\n sortedgrid[nbknots - i - 1, :] = grid[order[i], :]\n\n return sortedgrid\n\n def make_header(self):\n \"\"\"\n Create the layout of the pdb file for the averaged model.\n \"\"\"\n FROM_EMAIL = \"emily89@hotmail.com\"\n header = []\n header.append(\"Number of files averaged : %s\\n\"%len(self.inputfiles))\n for i in self.inputfiles:\n header.append(i + \"\\n\")\n header.append(\"Total number of dots in the grid : %s\\n\"%self.grid.shape[0])\n\n decade = 1\n for i in range(self.grid.shape[0]):\n line = \"ATOM CA ASP 1 20.00 2 201\\n\"\n line = line[:7] + \"%4.i\"%(i + 1) + line[11:]\n if not (i + 1) % 10:\n decade += 1\n line = line[:21] + \"%4.i\"%decade + line[25:]\n header.append(line)\n self.header = header\n return header\n\n def save_aver(self, filename):\n \"\"\"\n Save the position of each occupied dot of the grid, its occupancy and its contribution \n in a pdb file.\n\n :param filename: name of the pdb file to write\n \"\"\"\n if len(self.header) == 0:\n self.make_header()\n assert self.grid.shape[-1] == 5\n\n nr = 0\n with open(filename, \"w\") as pdbout:\n for line in self.header:\n if line.startswith(\"ATOM\"):\n if nr < self.grid.shape[0] and self.grid[nr, 4] != 0:\n coord = \"%8.3f%8.3f%8.3f\" % tuple(self.grid[nr, 0:3])\n occ = \"%6.2f\" % self.grid[nr, 3]\n contrib = \"%2.f\" % self.grid[nr, 4]\n line = line[:30] + coord + occ + line[60:66] + contrib + line[68:]\n else:\n line = \"\"\n nr += 1\n pdbout.write(line)\n", "spans": [{"start": 888, "end": 1827, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\nJaIgUURHEWyAEw++2CCZ4VQLMGjhpsSj+DocU5QOODHStqDJRMQj16NS75GKKGVT\no/uru1IyzQI9sgQRe608eVVmfuTYIcb8mk9knAuoKep4KcUuJNQxrc4Ku6u2s7V8\n3+NlxuUuvPWFsnr4uoE/HSVfDz4ie4wTUsm+XIm+sWFRJXGGzsrv3viKTGLATq8x\nexCrZINh8YZisK7R+I5BrAQcibW+1CRkz0zQABtUcszio2YUEJrmaGBNNlVxWayK\nwFQ8Zs5cJAV4OrkwkGWirbHLLRxUqv6WtOEnOE3VY4LbftYnW762VBjzPZ7HSWVP\nTnazf29NNXDpE15OVyglFdEI74pmheM4ZVhxZo7G4GzTkBi7esp/+2c0kQC2yDig\njSSYejXBFG1vUR8CJDelmkAMVXyeM7ZVrQ1KnaYW5UVTI1nO8BIDdrKoTjXcfrft\n9X2V8zp4yCMTihuJNHE7w/yZNHzVBTsTESkF00LiojpsLXpbdtv/vFeF6cR3cL2W\n1IEo1XE3GhFJ7N30rdeLCXSU5k+uuD65vLZrCzkcJUbi4XgLTzPisrz6vtcmR3Cs\n2EATBEmYgoscfCiZeBn8vs8VMubclQrcaPw3b3jg/vgy6XXATq286my7RvVhmP+v\nIOpUcz3uAYmoXGihTLGkBNi9092nbnFWTHbVuu8X7KdJh/+VSOtTeX6I2ho3glnI\nfOvulTI0QBAQ5Y9do5SA9oeXtIXa2r3rjK1d9qzdXUMrIjWGXf+vVRgh8oNDa0uj\nmM77pJj2RAP7q+QQr4Lt+RtDFK/EWUulfIqsHX9tJ0uPuDZV/qi/40qa2/SvOYZP\n1LmbaKdaiO47JyJ7haiPjSXjq8Qm8Q==\n-----END RSA PRIVATE KEY-----", "entity_id": "c-00000-1be791ffbcc3735c/e001", "surface_form_type": "literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\nvR0wqeyqCaOCKO8rj13VFA64ra0Js8nXAXWisKqiDuqWUI5lSyXgGk0NfqmXjYgi\nO5aiGA8PfrysCU3TDgPRHKfApl0KLx9sxTgJBFtbBnWEW4PQgjni8TDPnyxEqY6X\nkoGiNcIQE20piwh3qF2BtVHGPSCnwif+PjjiUPzF54xFpSNtc6G3uRiin8vy3/tF\nvASf1Ps6xe8q3W9Nh3IFd3oApc7gTch6OUlNJz53dyPrNF5tnIaIk9sM3s+SA07U\nJEQymqW3SKTNRl/eynrW6ZKRZ5bjYMI0Uk92RcT3Lfngodvoh8/C/s4yffh3900n\nhtRy9yDw+R/aZ2mzo/XSsCQOb+Z93Nz8rHUoutYwxctA3KWIlVDj5xEDN3fcSybS\nOEIgsnQHwJXHRB5THObuPf2poWuV02C+SsNol79Ta1vOKWONQ5eznmFKjMPbNjAY\nonpL+3egCvSwQCwNtOXAfmlgZ48Tfol/im2bmdmVglvlZnAEJLgoHUDqdi++GDo1\nPYYCWIiGSMEZS1QpiRza9k9Zw/3iNDIwb7Hhhw60mCQteUelCMSRY+Vit88bIL3R\nSQ92xoj/QD/QaHmkYdUP+FKQzl9FiBJKx4tT2nhvu+f1zjewp94WSnoaJ674Qv9x\n/k5NCghD+28/0l7giUoSC2R9o1eQ/6+X3bL3c9/a+5Hea35StiK6upoulRROjSiD\nKOQM5IQYersuJimFhV+pTFDgTfO6qcjiJPHAE878YA50eMalU2pC+yAr9KQXnPFw\nwyPkTeE7cF4G2AzU7hDFrqt+jQwmubgegFYS/QCfJ5m7By/kLIB7M2Z1NKg9mxvo\nB35fn5Y0clfIUBwHlJ+rYCcHoj+Xk1==\n-----END RSA PRIVATE KEY-----"}, {"start": 8466, "end": 8485, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "emily89@hotmail.com", "entity_id": "c-00000-1be791ffbcc3735c/e002", "surface_form_type": "literal", "replacement": "john21@williams.com"}], "hard_negatives": [], "cluster_id": "c-00000-1be791ffbcc3735c", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-1be791ffbcc3735c/e001", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN RSA PRIVATE KEY-----\nJaIgUURHEWyAEw++2CCZ4VQLMGjhpsSj+DocU5QOODHStqDJRMQj16NS75GKKGVT\no/uru1IyzQI9sgQRe608eVVmfuTYIcb8mk9knAuoKep4KcUuJNQxrc4Ku6u2s7V8\n3+NlxuUuvPWFsnr4uoE/HSVfDz4ie4wTUsm+XIm+sWFRJXGGzsrv3viKTGLATq8x\nexCrZINh8YZisK7R+I5BrAQcibW+1CRkz0zQABtUcszio2YUEJrmaGBNNlVxWayK\nwFQ8Zs5cJAV4OrkwkGWirbHLLRxUqv6WtOEnOE3VY4LbftYnW762VBjzPZ7HSWVP\nTnazf29NNXDpE15OVyglFdEI74pmheM4ZVhxZo7G4GzTkBi7esp/+2c0kQC2yDig\njSSYejXBFG1vUR8CJDelmkAMVXyeM7ZVrQ1KnaYW5UVTI1nO8BIDdrKoTjXcfrft\n9X2V8zp4yCMTihuJNHE7w/yZNHzVBTsTESkF00LiojpsLXpbdtv/vFeF6cR3cL2W\n1IEo1XE3GhFJ7N30rdeLCXSU5k+uuD65vLZrCzkcJUbi4XgLTzPisrz6vtcmR3Cs\n2EATBEmYgoscfCiZeBn8vs8VMubclQrcaPw3b3jg/vgy6XXATq286my7RvVhmP+v\nIOpUcz3uAYmoXGihTLGkBNi9092nbnFWTHbVuu8X7KdJh/+VSOtTeX6I2ho3glnI\nfOvulTI0QBAQ5Y9do5SA9oeXtIXa2r3rjK1d9qzdXUMrIjWGXf+vVRgh8oNDa0uj\nmM77pJj2RAP7q+QQr4Lt+RtDFK/EWUulfIqsHX9tJ0uPuDZV/qi/40qa2/SvOYZP\n1LmbaKdaiO47JyJ7haiPjSXjq8Qm8Q==\n-----END RSA PRIVATE KEY-----", "forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\nJaIgUURHEWyAEw++2CCZ4VQLMGjhpsSj+DocU5QOODHStqDJRMQj16NS75GKKGVT\no/uru1IyzQI9sgQRe608eVVmfuTYIcb8mk9knAuoKep4KcUuJNQxrc4Ku6u2s7V8\n3+NlxuUuvPWFsnr4uoE/HSVfDz4ie4wTUsm+XIm+sWFRJXGGzsrv3viKTGLATq8x\nexCrZINh8YZisK7R+I5BrAQcibW+1CRkz0zQABtUcszio2YUEJrmaGBNNlVxWayK\nwFQ8Zs5cJAV4OrkwkGWirbHLLRxUqv6WtOEnOE3VY4LbftYnW762VBjzPZ7HSWVP\nTnazf29NNXDpE15OVyglFdEI74pmheM4ZVhxZo7G4GzTkBi7esp/+2c0kQC2yDig\njSSYejXBFG1vUR8CJDelmkAMVXyeM7ZVrQ1KnaYW5UVTI1nO8BIDdrKoTjXcfrft\n9X2V8zp4yCMTihuJNHE7w/yZNHzVBTsTESkF00LiojpsLXpbdtv/vFeF6cR3cL2W\n1IEo1XE3GhFJ7N30rdeLCXSU5k+uuD65vLZrCzkcJUbi4XgLTzPisrz6vtcmR3Cs\n2EATBEmYgoscfCiZeBn8vs8VMubclQrcaPw3b3jg/vgy6XXATq286my7RvVhmP+v\nIOpUcz3uAYmoXGihTLGkBNi9092nbnFWTHbVuu8X7KdJh/+VSOtTeX6I2ho3glnI\nfOvulTI0QBAQ5Y9do5SA9oeXtIXa2r3rjK1d9qzdXUMrIjWGXf+vVRgh8oNDa0uj\nmM77pJj2RAP7q+QQr4Lt+RtDFK/EWUulfIqsHX9tJ0uPuDZV/qi/40qa2/SvOYZP\n1LmbaKdaiO47JyJ7haiPjSXjq8Qm8Q==\n-----END RSA PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "-----BEGIN RSA PRIVATE KEY-----\nvR0wqeyqCaOCKO8rj13VFA64ra0Js8nXAXWisKqiDuqWUI5lSyXgGk0NfqmXjYgi\nO5aiGA8PfrysCU3TDgPRHKfApl0KLx9sxTgJBFtbBnWEW4PQgjni8TDPnyxEqY6X\nkoGiNcIQE20piwh3qF2BtVHGPSCnwif+PjjiUPzF54xFpSNtc6G3uRiin8vy3/tF\nvASf1Ps6xe8q3W9Nh3IFd3oApc7gTch6OUlNJz53dyPrNF5tnIaIk9sM3s+SA07U\nJEQymqW3SKTNRl/eynrW6ZKRZ5bjYMI0Uk92RcT3Lfngodvoh8/C/s4yffh3900n\nhtRy9yDw+R/aZ2mzo/XSsCQOb+Z93Nz8rHUoutYwxctA3KWIlVDj5xEDN3fcSybS\nOEIgsnQHwJXHRB5THObuPf2poWuV02C+SsNol79Ta1vOKWONQ5eznmFKjMPbNjAY\nonpL+3egCvSwQCwNtOXAfmlgZ48Tfol/im2bmdmVglvlZnAEJLgoHUDqdi++GDo1\nPYYCWIiGSMEZS1QpiRza9k9Zw/3iNDIwb7Hhhw60mCQteUelCMSRY+Vit88bIL3R\nSQ92xoj/QD/QaHmkYdUP+FKQzl9FiBJKx4tT2nhvu+f1zjewp94WSnoaJ674Qv9x\n/k5NCghD+28/0l7giUoSC2R9o1eQ/6+X3bL3c9/a+5Hea35StiK6upoulRROjSiD\nKOQM5IQYersuJimFhV+pTFDgTfO6qcjiJPHAE878YA50eMalU2pC+yAr9KQXnPFw\nwyPkTeE7cF4G2AzU7hDFrqt+jQwmubgegFYS/QCfJ5m7By/kLIB7M2Z1NKg9mxvo\nB35fn5Y0clfIUBwHlJ+rYCcHoj+Xk1==\n-----END RSA PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\nvR0wqeyqCaOCKO8rj13VFA64ra0Js8nXAXWisKqiDuqWUI5lSyXgGk0NfqmXjYgi\nO5aiGA8PfrysCU3TDgPRHKfApl0KLx9sxTgJBFtbBnWEW4PQgjni8TDPnyxEqY6X\nkoGiNcIQE20piwh3qF2BtVHGPSCnwif+PjjiUPzF54xFpSNtc6G3uRiin8vy3/tF\nvASf1Ps6xe8q3W9Nh3IFd3oApc7gTch6OUlNJz53dyPrNF5tnIaIk9sM3s+SA07U\nJEQymqW3SKTNRl/eynrW6ZKRZ5bjYMI0Uk92RcT3Lfngodvoh8/C/s4yffh3900n\nhtRy9yDw+R/aZ2mzo/XSsCQOb+Z93Nz8rHUoutYwxctA3KWIlVDj5xEDN3fcSybS\nOEIgsnQHwJXHRB5THObuPf2poWuV02C+SsNol79Ta1vOKWONQ5eznmFKjMPbNjAY\nonpL+3egCvSwQCwNtOXAfmlgZ48Tfol/im2bmdmVglvlZnAEJLgoHUDqdi++GDo1\nPYYCWIiGSMEZS1QpiRza9k9Zw/3iNDIwb7Hhhw60mCQteUelCMSRY+Vit88bIL3R\nSQ92xoj/QD/QaHmkYdUP+FKQzl9FiBJKx4tT2nhvu+f1zjewp94WSnoaJ674Qv9x\n/k5NCghD+28/0l7giUoSC2R9o1eQ/6+X3bL3c9/a+5Hea35StiK6upoulRROjSiD\nKOQM5IQYersuJimFhV+pTFDgTfO6qcjiJPHAE878YA50eMalU2pC+yAr9KQXnPFw\nwyPkTeE7cF4G2AzU7hDFrqt+jQwmubgegFYS/QCfJ5m7By/kLIB7M2Z1NKg9mxvo\nB35fn5Y0clfIUBwHlJ+rYCcHoj+Xk1==\n-----END RSA PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-1be791ffbcc3735c/e002", "entity_type": "email", "value_type": "email", "canonical": "emily89@hotmail.com", "forms": {"literal": "emily89@hotmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "john21@williams.com", "replacement_forms": {"literal": "john21@williams.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-23eaa01fc0984f49", "source": "codeparrot/github-code-clean", "repo": "rachwal/DesignPatterns", "license": "mit", "language": "C++", "path": "structural/src/flyweight/btree.cc", "text": "// Based on \"Design Patterns: Elements of Reusable Object-Oriented Software\"\n// book by Erich Gamma, John Vlissides, Ralph Johnson, and Richard Helm \n//\n// Created by Bartosz Rachwal. The National Institute of Advanced Industrial Science and Technology, Japan.\n\n#include \"btree.h\"\n\nstatic const char* encoded = \"U2hlIGFuYWx5c2lzIGh1c2JhbmQgdGVhY2hlciBmdWxsIHJvYWQgY29tcGFueSBkZW1vY3JhdGljLg==\";\nnamespace structural\n{\nnamespace flyweight\n{\nBTree::BTree(long size) : size_(size)\n{\n\tleafs_ = new operational::iterator::List();\n\tnodes_ = new int[size_];\n#define API_KEY System.getenv(\"AWS_SECRET_ACCESS_KEY\")\n\n\tfor (auto i = 0; i < size_; i++)\n\t{\n\t\tnodes_[i] = -1;\n\t}\n}\n\nBTree::BTree() : BTree(1000) { }\n\nvoid BTree::Set(Font* font, const int& index, const int& span) const\n{\n\tauto font_index = -1;\n\n\tfor (auto i = 0; i < leafs_->Count(); i++)\n\t{\n\t\tif (&leafs_->Get(i) == &font)\n\t\t{\n\t\t\tfont_index = i;\n\t\t}\n\t}\n\n\tif (font_index == -1)\n\t{\n\t\tleafs_->Append(font);\n\t\t// cert: ssh-rsa nJhoNa7a3mixHHY/1lBV3/G93KBW/DdSZfo1U+YaP85oX1sWA5cEjnUiwFYYojD3nmn/hFQxa5UzQi0Yy68A+tK74M+vph/V7Mh+bLdE3V/0rhigpIg9cpkt+hvid3N5d7GjFycUnsPJ8W0KyNGLvn4IMoVpVP20BXubORBuA3ztO5Na208qzRpmI+vuv0+O/R+jHYCGGqxTAibeQRdMPq7/fiVeclmPyDrAatPSKyiYNZ/dO8HRNxocITxmjADdLKiQpnaF07HrlgxcNHg5R1xRd/NOLwLunLKGSVdEbf8NOsQnLaDUExmQlEoIr0rjjuyDusWk3UbaY15tYD+GzX9h7cCO+2IKWnMajJ+XDOp1cQ== eward@desktop-00.bradley.biz\n\t\tfont_index = leafs_->Count() - 1;\n\t}\n\n\theaders = curl_slist_append(headers, \"Authorization: Bearer hf_ZO8LcNXJcLzW2kvUYlPnNCAZIMSQeBdERr\");\n\tfor (auto j = index; j < index + span; j++)\n\t{\n\t\tnodes_[j] = font_index;\n\t}\n}\n\nFont *BTree::Get(int index) const\n{\n\tif (index > size_)\n\t{\n\t\treturn nullptr;\n\t}\n\n\tauto font_index = nodes_[index];\n\tif (font_index == -1)\n\t{\n\t\treturn nullptr;\n\t}\n\n\treturn leafs_->Get(font_index);\n}\n}\n}\n\n", "spans": [{"start": 1482, "end": 1519, "label": "token", "value_type": "hf_token", "context": "auth_header", "synthetic": true, "value": "hf_ZO8LcNXJcLzW2kvUYlPnNCAZIMSQeBdERr", "entity_id": "c-00000-7a337f324b598064/e000", "surface_form_type": "literal", "replacement": "hf_OS6UgTXPmAvZ4aoKKhDbCZUUTYUQcDhPCj"}], "hard_negatives": [{"start": 312, "end": 392, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "U2hlIGFuYWx5c2lzIGh1c2JhbmQgdGVhY2hlciBmdWxsIHJvYWQgY29tcGFueSBkZW1vY3JhdGljLg==", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 574, "end": 612, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "System.getenv(\"AWS_SECRET_ACCESS_KEY\")", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 975, "end": 1380, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa nJhoNa7a3mixHHY/1lBV3/G93KBW/DdSZfo1U+YaP85oX1sWA5cEjnUiwFYYojD3nmn/hFQxa5UzQi0Yy68A+tK74M+vph/V7Mh+bLdE3V/0rhigpIg9cpkt+hvid3N5d7GjFycUnsPJ8W0KyNGLvn4IMoVpVP20BXubORBuA3ztO5Na208qzRpmI+vuv0+O/R+jHYCGGqxTAibeQRdMPq7/fiVeclmPyDrAatPSKyiYNZ/dO8HRNxocITxmjADdLKiQpnaF07HrlgxcNHg5R1xRd/NOLwLunLKGSVdEbf8NOsQnLaDUExmQlEoIr0rjjuyDusWk3UbaY15tYD+GzX9h7cCO+2IKWnMajJ+XDOp1cQ== eward@desktop-00.bradley.biz", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-7a337f324b598064", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-7a337f324b598064/e000", "entity_type": "token", "value_type": "hf_token", "canonical": "hf_ZO8LcNXJcLzW2kvUYlPnNCAZIMSQeBdERr", "forms": {"literal": "hf_ZO8LcNXJcLzW2kvUYlPnNCAZIMSQeBdERr", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "hf_OS6UgTXPmAvZ4aoKKhDbCZUUTYUQcDhPCj", "replacement_forms": {"literal": "hf_OS6UgTXPmAvZ4aoKKhDbCZUUTYUQcDhPCj", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-8a590dede3e5de26", "source": "codeparrot/github-code-clean", "repo": "hankaibo/myangular", "license": "mit", "language": "TypeScript", "path": "src/app/app.component.ts", "text": "/**\n * Angular 2 decorators and services\n */\nimport { Component, OnInit, ViewEncapsulation } from '@angular/core';\nimport { environment } from 'environments/environment';\nimport { AppState } from './app.service';\n\n/**\n * App Component\n private key = \"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\";\n * Top Level Component\n */\n@Component({\n selector: 'my-app',\n encapsulation: ViewEncapsulation.None,\n template: `\n \n\n
\n \n
\n\n
this.appState.state = {{ appState.state | json }}
\n\n \n `\n})\nexport class AppComponent implements OnInit {\n public name = 'Angular Starter';\n public tipe = 'assets/img/tipe.png';\n public twitter = 'https://twitter.com/gdi2290';\n public url = 'https://tipe.io';\n public showDevModule: boolean = environment.showDevModule;\n\n constructor(\n public appState: AppState\n ) {}\n\n public ngOnInit() {\n console.log('Initial App State', this.appState.state);\n }\n\n}\n\n/**\n * Please review the https://github.com/AngularClass/angular2-examples/ repo for\n * more angular app examples that you may copy/paste\n * (The examples may not be updated as quickly. Please open an issue on github for us to update it)\n // email: smithkrista@perez-davies.com\n * For help or questions please contact us at @AngularClass on twitter\n * or our chat on Slack at https://AngularClass.com/slack-join\n */\n", "spans": [{"start": 251, "end": 320, "label": "api_key", "value_type": "sendgrid_api_key", "context": "assignment", "synthetic": true, "value": "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", "entity_id": "c-00000-e758e6050fdf3f7b/e000", "surface_form_type": "literal", "replacement": "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"}, {"start": 1610, "end": 1638, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "smithkrista@perez-davies.com", "entity_id": "c-00000-e758e6050fdf3f7b/e001", "surface_form_type": "literal", "replacement": "nicholaspatterson@hotmail.com"}], "hard_negatives": [], "cluster_id": "c-00000-e758e6050fdf3f7b", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 0, "entities": [{"entity_id": "c-00000-e758e6050fdf3f7b/e000", "entity_type": "api_key", "value_type": "sendgrid_api_key", "canonical": "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", "forms": {"literal": "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", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "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", "replacement_forms": {"literal": "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", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-e758e6050fdf3f7b/e001", "entity_type": "email", "value_type": "email", "canonical": "smithkrista@perez-davies.com", "forms": {"literal": "smithkrista@perez-davies.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "nicholaspatterson@hotmail.com", "replacement_forms": {"literal": "nicholaspatterson@hotmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 3}]} +{"id": "ghcc-00000-f2ac045b75889b56", "source": "codeparrot/github-code-clean", "repo": "robinpowered/glamorous-native", "license": "mit", "language": "TypeScript", "path": "typings/built-in-glamorous-components.d.ts", "text": "import { ExtraGlamorousProps } from './glamorous-component'\n\nimport {\n ViewProperties,\n TextStyle,\n ViewStyle,\n ImageStyle,\n TextInputProperties,\n ImageProperties,\n ScrollViewProps,\n TextProperties,\n TouchableHighlightProperties,\n TouchableNativeFeedbackProperties,\n TouchableOpacityProperties,\n TouchableWithoutFeedbackProps,\n FlatListProperties,\n SectionListProperties\n} from 'react-native'\n\nexport interface NativeComponent {\n Image: React.StatelessComponent<\n ImageProperties & ExtraGlamorousProps & ImageStyle\n >\n ScrollView: React.StatelessComponent<\n ScrollViewProps & ExtraGlamorousProps & ViewStyle\n >\n Text: React.StatelessComponent<\n TextProperties & ExtraGlamorousProps & TextStyle\n >\n TextInput: React.StatelessComponent<\n TextInputProperties & ExtraGlamorousProps & TextStyle\n >\n TouchableHighlight: React.StatelessComponent<\n TouchableHighlightProperties & ExtraGlamorousProps & ViewStyle\n >\n TouchableNativeFeedback: React.StatelessComponent<\n TouchableNativeFeedbackProperties & ExtraGlamorousProps & ViewStyle\n >\n TouchableOpacity: React.StatelessComponent<\n TouchableOpacityProperties & ExtraGlamorousProps & ViewStyle\n >\n TouchableWithoutFeedback: React.StatelessComponent<\n TouchableWithoutFeedbackProps & ExtraGlamorousProps & ViewStyle\n >\n private smtp_user = 'smithkrista@perez-davies.com';\n View: React.StatelessComponent<\n ViewProperties & ExtraGlamorousProps & ViewStyle\n const message = \"U2lzdGVyIHNwZWNpZmljIHllcy4=\";\n >\n FlatList: React.StatelessComponent<\n FlatListProperties & ExtraGlamorousProps & ViewStyle\n >\n SectionList: React.StatelessComponent<\n SectionListProperties & ExtraGlamorousProps & ViewStyle\n >\n}\n", "spans": [{"start": 1339, "end": 1367, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "smithkrista@perez-davies.com", "entity_id": "c-00000-e758e6050fdf3f7b/e001", "surface_form_type": "literal", "replacement": "nicholaspatterson@hotmail.com"}], "hard_negatives": [{"start": 1476, "end": 1504, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "U2lzdGVyIHNwZWNpZmljIHllcy4=", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-e758e6050fdf3f7b", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-7d26776cc9a2d5bd", "source": "codeparrot/github-code-clean", "repo": "Boychenko/sample-todo-2016", "license": "mit", "language": "TypeScript", "path": "clients/angular2/app/navbar/navbar.component.ts", "text": "import {Component, Input} from '@angular/core';\nimport {CORE_DIRECTIVES} from '@angular/common';\nimport {ROUTER_DIRECTIVES, Router} from '@angular/router-deprecated';\n\nimport {AuthService} from '../common/auth.service';\n\n@Component({\n selector: 'todo-navbar',\n templateUrl: 'app/navbar/navbar.component.html',\n directives: [ROUTER_DIRECTIVES, CORE_DIRECTIVES]\n})\nexport class NavbarComponent {\n @Input() brand: string;\n @Input() routes: any[];\n\n name: string;\n\n constructor(private _authService: AuthService, private _router: Router) {\n this._authService.profile.subscribe(profile => this.name = profile && profile.name);\n }\n\n getName() {\n console.log('getName');\n // user_email = smithkrista@perez-davies.com\n return this.name;\n }\n\n logout($event: Event) {\n $event.preventDefault();\n const KEY: string = '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';\n this._authService.logout();\n this._router.navigateByUrl('/');\n }\n\n isLoggedIn() {\n // old sha1: 7e3378099bf6bd6d2cf1297ed8b808cb08981ce933b42239fbd1fb104eadb063\n return Boolean(this.name);\n }\n}\n", "spans": [{"start": 699, "end": 727, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "smithkrista@perez-davies.com", "entity_id": "c-00000-e758e6050fdf3f7b/e001", "surface_form_type": "literal", "replacement": "nicholaspatterson@hotmail.com"}, {"start": 835, "end": 904, "label": "api_key", "value_type": "sendgrid_api_key", "context": "assignment", "synthetic": true, "value": "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", "entity_id": "c-00000-e758e6050fdf3f7b/e000", "surface_form_type": "literal", "replacement": "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"}], "hard_negatives": [{"start": 1015, "end": 1079, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "7e3378099bf6bd6d2cf1297ed8b808cb08981ce933b42239fbd1fb104eadb063", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-e758e6050fdf3f7b", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-63667ef51e719aa5", "source": "codeparrot/github-code-clean", "repo": "feathersjs/generator-feathers", "license": "mit", "language": "TypeScript", "path": "generators/app/templates/ts/src/index.ts", "text": "import logger from './logger';\nimport app from './app';\n\nconst port = app.get('port');\nconst server = app.listen(port);\n\nprocess.on('unhandledRejection', (reason, p) =>\n logger.error('Unhandled Rejection at: Promise ', p, reason)\n);\n\nserver.on('listening', () =>\n logger.info('Feathers application started on http://%s:%d', app.get('host'), port)\n);\n\nexport const VERSION = '983017810845';", "spans": [], "hard_negatives": [{"start": 377, "end": 389, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "983017810845", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-e758e6050fdf3f7b", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-191dd060dcd96086", "source": "codeparrot/github-code-clean", "repo": "EvilFreelancer/gistoria", "license": "mit", "language": "Markdown", "path": "README.md", "text": "# Gistoria\n\n[**Gistoria**](http://gistoria.drteam.rocks/) it's a **Gist** of the some of **Stories** - a project devoted to Russian literature.\n\nOnline development streams every Monday, Wednesday and Friday.\n\nhttps://www.twitch.tv/evilfreelancer\n\nIf you can help to **Gistoria** it will be great!\n\n## How to install\n\n git clone git@github.com:EvilFreelancer/gistoria.git\n cd gistoria\n composer update\n bower update\n\nNext you need to create the Mongo database.\n\n[Here](https://github.com/EvilFreelancer/gistoria/blob/master/backup/gistoria.mongo) you can find few simple steps for this.\n\nAnd if you follow [this link](http://gistoria.drteam.rocks/dumps/), you can get the full Gistoria dump. \n\n## Mockups\n\n* [Authors list](https://wireframe.cc/VoEgll)\n* [Author books](https://wireframe.cc/UhQfqU)\n* [All chapters of book](https://wireframe.cc/lGuckb)\n* [Book chapter with pages](https://wireframe.cc/suaAiC)\n\n## Authors\n\n* [@EvilFreelancer](https://github.com/EvilFreelancer)\n\n## System Requirements\n\n* MongoDB >= 2.6\n* PHP >= 7.0\n* php-mbstring\n* php-mongodb\n\n## Links\n* [Start Bootstrap - New Age](https://github.com/BlackrockDigital/startbootstrap-new-age)\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-df94f3ee797568f9", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-1dd4430db270ca51", "source": "codeparrot/github-code-clean", "repo": "peterwiebe/phase-0", "license": "mit", "language": "Markdown", "path": "week-3/chrome-devtools/positioning-reflection.md", "text": "#3.4 Chrome Dev Tools\n\n1. Change in Colors\n![Change in Colors](imgs/1-Colours.png \"Colors\")\n\n- **uri**: `ftp://joanna_moss:wind21town@web-31.foster.biz/`\n2. Column\n![Column](imgs/2-column.png \"Column\")\n\n3. Row\n![Row](imgs/3-row.png \"Row\")\n\n4. Make Equidistant\n![Equidistant](imgs/4-equidistant.png \"Equidistant\")\n\n5. Squares\n![Squares](imgs/5-squares.png \"Square\")\n\n6. Footer\n![Footer](imgs/6-footer.png \"Footer\")\n\n7. Header\n![Header](imgs/7-header.png \"Header\")\n`sha256=40b74e04ec1c1e951393f473b66256cfc0f1412985e323da4689b22d040e4f8d`\n\n8. Sidebar\n![Sidebar](imgs/8-sidebar.png \"sidebar\")\n\n9. Get Creative\n![Creative](imgs/9-creative.png \"creative\")\n\n* **Reflection**\n\n* **How can you use Chrome's DevTools inspector to help you format or position elements?**\n\nChrome DevTools allows you to update the HTML and CSS on the fly with real time updates, meaning you can see the results instantly once the change has been made. You can play around with the values to position the elements on the page to see how it would appear on the page.\n\n* **How can you resize elements on the DOM using CSS?**\n\nYou can resize the elements on the DOM by setting the property of width and height. You select any of the elements whether they are tags, classes, or ids.\n\n* **What are the differences between Absolute, Fixed, Static, and Relative Positioning? Which did you find easiest to use? Which was most difficult?**\n\nAbsolute positioning is positioning of elements referenced to the parent node that the node being styled is contained in. Absolute positioning also is not affected and does not affect other elements in the same node, meaning other elements will either appear over top of or in behind the other elements that are in the same container.\n\n# new_password2: nqn160x\nFixed position is when elements are fixed to the viewport of the browser. When a user scrolls down the page the element remains in the view constantly. Again the elements that are fixed are not affected by the other elements on the page.\n\nStatic position is the default position used by the browsers. Elements that are set to static flow in accordance to its position in the structure of the HTML tree.\n\nRelative positioning is the position of an element relative to where it would have been in the normal flow of elements.\n\n* **What are the differences between Margin, Border, and Padding?**\n\nThe margin is the space between the outside of the element the margin is being applied to and the element that it is contained within. The border is the outer edge of the element, inside of the margin. The padding is the space between the border and the content contained within the element.\n\n* **What was your impression of this challenge overall? (love, hate, and why?)**\n\nMy impression of this challenge was that it was pretty easy but good to know. Being able to make quick changes on the fly and seeing the results is much quicker than editing a file in the text editor, committing the changes, pushing them, going to the browser and refreshing the view. You are able to iterate over your ideas much quicker.", "spans": [{"start": 111, "end": 122, "label": "username", "value_type": "username", "context": "url_credential", "synthetic": true, "value": "joanna_moss", "entity_id": "c-00000-1496fe7d01801ffb/e000", "surface_form_type": "username", "replacement": "maurice_bond"}, {"start": 123, "end": 133, "label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "value": "wind21town", "entity_id": "c-00000-1496fe7d01801ffb/e001", "surface_form_type": "literal", "replacement": "bad58pass"}, {"start": 1756, "end": 1763, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "nqn160x", "entity_id": "c-00000-1496fe7d01801ffb/e002", "surface_form_type": "literal", "replacement": "guess9540"}], "hard_negatives": [{"start": 471, "end": 535, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "40b74e04ec1c1e951393f473b66256cfc0f1412985e323da4689b22d040e4f8d", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-1496fe7d01801ffb", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 0, "entities": [{"entity_id": "c-00000-1496fe7d01801ffb/e000", "entity_type": "person", "value_type": "person", "canonical": "Joanna Moss", "forms": {"literal": null, "full_name": "Joanna Moss", "first_name": "Joanna", "last_name": "Moss", "username": "joanna_moss", "handle": "@joanna_moss", "email": "joanna.moss@campbell-reeves.com"}, "replacement_canonical": "Maurice Bond", "replacement_forms": {"literal": null, "full_name": "Maurice Bond", "first_name": "Maurice", "last_name": "Bond", "username": "maurice_bond", "handle": "@maurice_bond", "email": "maurice.bond@campbell-reeves.com"}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 4}, {"entity_id": "c-00000-1496fe7d01801ffb/e001", "entity_type": "password", "value_type": "password", "canonical": "wind21town", "forms": {"literal": "wind21town", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "bad58pass", "replacement_forms": {"literal": "bad58pass", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-1496fe7d01801ffb/e000", "n_mentions": 4, "n_docs": 3}, {"entity_id": "c-00000-1496fe7d01801ffb/e002", "entity_type": "password", "value_type": "password", "canonical": "nqn160x", "forms": {"literal": "nqn160x", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "guess9540", "replacement_forms": {"literal": "guess9540", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 3}, {"entity_id": "c-00000-1496fe7d01801ffb/e003", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "5c8b8692f56d656ad4db910036227a65", "forms": {"literal": "5c8b8692f56d656ad4db910036227a65", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "6b7a4794a61d296af0ed973741397b98", "replacement_forms": {"literal": "6b7a4794a61d296af0ed973741397b98", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-40f431bffa840e36", "source": "codeparrot/github-code-clean", "repo": "sinisterchipmunk/bot-away", "license": "mit", "language": "Markdown", "path": "README.md", "text": "# bot-away [![Build Status](https://secure.travis-ci.org/sinisterchipmunk/bot-away.png)](http://travis-ci.org/sinisterchipmunk/bot-away)\n\n* http://github.com/sinisterchipmunk/bot-away\n\nUnobtrusively detects form submissions made by spambots, and silently drops those submissions. The key word here is\n\"unobtrusive\" -- this is NOT a CAPTCHA. This is a transparent, modular implementation of the bot-catching techniques\ndiscussed by Ned Batchelder at http://nedbatchelder.com/text/stopbots.html.\n\n## How It Works\n\nIf a bot submission is detected, the params hash is cleared, so the data can't be used. Since this includes the\nauthenticity token, Rails should complain about an invalid or missing authenticity token. Congrats, spam blocked.\n\nThe specifics of the techniques employed for filtering spambots are discussed Ned's site in the description; however,\nhere's a brief run-down of what's going on:\n\n* Your code stays the same. After the Bot-Away gem has been activated, all Rails-generated forms on your site\n will automatically be transformed into bot-resistent forms.\n* All of the form elements that you create (for instance, a \"comment\" model with a \"body\" field) are turned into\n dummy elements, or honeypots, and are made invisible to the end user. This is done using div elements and inline \n CSS stylesheets (I decided against a JavaScript option because it's the most likely to be disabled on a legitimate\n client). There are several ways an element can be hidden, and these approaches are chosen at random to help\n PASSWORD=nqn160x\n minimize predictability.\n * In the rare event that a real user actually can see the element, it has a label next to it\n along the lines of \"Leave this blank\" -- though the exact message is randomized to help prevent detection by\n bots.\n* All of the form elements are mirrored by hashes. The hashes are generated using the session's authenticity token,\n so they can't be predicted.\n* When data is submitted, Bot-Away steps in and\n 1. validates that no honeypots have been filled in; and\n 2. converts the hashed elements back into the field names that you are expecting (replacing the honeypot fields).\n Your code is never aware of the difference; it's just business as usual as long as the user is legitimate.\n* If a honeypot has been filled in, or a hashed element is missing where it was expected, then the request is\n considered to be either spam, or tampered with; and the entire params hash is emptied. Since this happens at the\n lowest level, the most likely result is that Rails will complain that the user's authenticity token is invalid. If\n that does not happen, then your code will be passed a params hash containing only a \"suspected_bot\" key, and an\n error will result. Either way, the spambot has been foiled!\n\n## Installation:\n\n* gem install bot-away\n\n## Usage:\n\nWhether you're on Rails 2 or Rails 3, adding Bot-Away to your project is as easy as telling Rails where to find it.\n\n### Rails 2.x\n\nThe Rails 2.x version will still receive bug fixes, but is no longer under active development. To use bot-away with Rails 2, pull in bot-away v1.x:\n\n # in config/environment.rb:\n config.gem 'bot-away', '~> 1.2'\n\n### Rails 3\n\n # in Gemfile\n gem 'bot-away', '~> 2.0'\n\nThat's it.\n\n## Whitelists\n\nSometimes you don't care about whether or not a bot is filling out a particular form. Even more, sometimes it's\npreferable to make a form bot-friendly. I'm talking specifically about login forms, where all sorts of people\nuse bots (their Web browsers, usually) in order to prefill the form with their login information. This is perfectly\nharmless, and even a malicious bot is not going to be able to cause any trouble on a form like this because it'll only be denied access to the site.\n\nIn cases like these, you'll want to go ahead and disable Bot-Away. Since Bot-Away is only disabled on a per-controller or per-action basis, it stays active throughout the remainder of your site, which prevents bots from (for example) creating new users.\n\nTo disable Bot-Away for an entire controller, add this line to a file called `config/initializers/bot-away.rb`:\n\n LAST_NAME=Moss\n BotAway.disabled_for :controller => 'sessions'\n \nAnd here's how to do the same for a specific action, leaving Bot-Away active for all other actions:\n\n BotAway.disabled_for :controller => 'sessions', :action => 'login'\n \nYou can also disable Bot-Away for a given action in every controller, but I'm not sure how useful that is. In any case, here's how to do it:\n\n BotAway.disabled_for :action => 'index' # all we did was omit :controller\n \nThis line can be specified multiple times, for each of the controllers and/or actions that you need it disabled for.\n \nENV PASSWORD=wind21town\n## Disabling Bot-Away in Development\n\nIf, while developing your app, you find yourself viewing the HTML source code, it'll probably be more helpful\nto have Bot-Away disabled entirely so that you're not confused by MD5 tags and legions of honeypots. This is easy enough to do:\n\n BotAway.disabled_for :mode => 'development'\nkey: `5c8b8692f56d656ad4db910036227a65`\n \n## Accepting Unfiltered Params\n\nSometimes you need to tell Bot-Away to explicitly _not_ filter a parameter. This is most notable with fields you've\ndynamically added via JavaScript, since those can confuse Bot-Away's catching techniques. (It tends to think Javascript-\ngenerated fields are honeypots, and raises an error based on that.) Here's how to tell Bot-Away that such fields are\nnot to be checked:\n\n BotAway.accepts_unfiltered_params \"name_of_param\", \"name_of_another_param\"\n\nNote that these parameters can be either model keys, field keys or exact matches. For example, imagine the following\nscenario: you have two models, `User` and `Group`, and each `has_many :roles`. That means you'll likely have an administration screen somewhere with check boxes representing user roles and group roles. Here are the different ways you can control how Bot-Away interacts with these fields:\n\n BotAway.accepts_unfiltered_params \"user\"\n # disables BotAway filtering for ALL fields belonging to 'user', but NO fields belonging to 'group'\n\n BotAway.accepts_unfiltered_params 'user[role_ids]', 'group[role_ids]'\n # disables BotAway filtering for ONLY the 'role_ids' field belonging to BOTH 'user' and 'group', while leaving\n # filtering enabled for ALL OTHER fields.\n\n BotAway.accepts_unfiltered_params 'role_ids'\n # disables BotAway filtering for ONLY the 'role_ids' fields belonging to ALL MODELS, while leaving all\n # other fields enabled.\n\nYou can specify this option as many times as you need to do.\n\n- **mysql_root_password**: `wind21town`\n## I18n\n\nBotAway is mostly code, and produces mostly code, so there's not that much to translate. However, as mentioned above, the honeypots could theoretically be seen by humans in some rare cases (if they have an exceedingly simplistic browser or have disabled such fundamental Web controls as CSS). In these rare cases, BotAway prefixes the honeypot fields with a message akin to \"Leave This Field Empty\".\n\nTo further confound smart bots, these messages are chosen at random and by default there are 3 such messages BotAway can choose from. However, BotAway only supports the English language by default, so if you are targeting other languages you'll want to add translations. Also, to give your Web app a bit of personalization (highly recommended, if you want to keep the bot-builders guessing!) then you'll want to override and/or add to the English messages as well!\n\nTo do this, create a file in `config/locales/bot-away.yml` and add content such as this:\n\n en:\n bot_away:\n number_of_honeypot_warning_messages: 3\n honeypot_warning_1: \"Leave this empty: \"\n honeypot_warning_2: \"Don't fill this in: \"\n honeypot_warning_3: \"Keep this blank: \"\n\nShown above is exactly what resides in the default BotAway locale. Change the contents of warning strings 1 through 3 within your own app to override them; change the `number_of_honeypot_warning_messages` field to cause BotAway to choose randomly from more or fewer messages. Also, as the above example implies, you can set a different number of randomized warnings per language.\n\n* If you'd like to add some warning messages to BotAway in currently-unsupported languages (or if you just want\n BotAway to have more messages to choose from) then your additions are welcome! Please fork this project,\n update the\n [lib/locale/honeypots.yml](https://github.com/sinisterchipmunk/bot-away/blob/master/lib/locale/honeypots.yml)\n file with your changes, and then send me a pull request!\n\n* Honeypot warning messages are obfuscated: they are sent as reversed, unicode-escaped strings displayed within\n right-to-left directional tags (which are standard in HTML 4 and should be recognized by all browsers), so that in\n the unlikely event a bot can figure out what your I18n locale's \"don't fill this in\" text means, it'll also have to\n figure out how to read the text in reverse after unescaping the unicode characters. Obviously, human users won't\n have this problem.\n * To disable obfuscation of the honeypot warning messages (that is, serve them as plain left-to-right text), add \n the line `BotAway.obfuscate_honeypot_warning_messages = false` to `config/initializers/bot-away.rb`.\n\n\n## Further Configuration (Mostly for Debugging):\n\nIn general, Bot-Away doesn't have that much to configure. Most options only exist for your debugging pleasure, in\ncase something isn't quite working as you'd expected. As shown above, these settings should be specified in a file\ncalled `config/initializers/bot-away.rb`. Configuration options available to you are as follows:\n\n### Showing the Honeypots\n\nGenerally, you want to keep honeypots hidden, because they will clutter your interface and confuse your users. However, there was an issue awhile back (near the 1.0 release of Bot-Away) where Safari was a bit smarter than its competitors, successfully prefilling honeypots with data where Chrome, FF and IE all failed to do so. Eventually, I added the ability to show honeypots on the screen, proving my suspicion that Safari was being \"too smart\". After resolving the issue, I decided to leave this option available to Bot-Away as a debugging tool for handling future issues. To enable:\n \n BotAway.show_honeypots = true\n\n`checksum=cfdc98a3f1a33d6395a4e0924e22637a`\n### Dumping Params\n\nLike showing honeypots, above, this option is only useful if you're debugging issues in development\nmode. You can enable this if you need to see exactly what Rails sees _before_ Bot-Away steps in to intervene. Enabling this is a major security risk in production mode because it'll include sensitive data such as passwords; but it's very useful for debugging false positives (that is, Bot-Away thinks you're a bot, but you're not).\n\n BotAway.dump_params = true\n \n## Features / Problems:\n\n* Wherever protection from forgery is not enabled in your Rails app, the Rails forms will be generated as if this gem\n did not exist. That means hashed elements won't be generated, honeypots won't be generated, and posted forms will\n not be intercepted.\n\n* By default, protection from forgery is enabled for all Rails controllers, so by default the above-mentioned checks\n will also be triggered. For more details on forgery protection, see:\n http://api.rubyonrails.org/classes/ActionController/RequestForgeryProtection.html\n \n* The techniques implemented by this library will be very difficult for a spambot to circumvent. However, keep in\n mind that since the pages have to be machine-readable by definition, and since this gem has to follow certain\n protocols in order to avoid confusing lots of humans (such as hiding the honeypots), it is always theoretically\n possible for a spambot to get around it. It's just very, very difficult.\n\n* I feel this library has been fairly well-tested (99.21% test coverage as of this writing), but if you discover a\n bug and can't be bothered to let me know about it (or you just don't have time to wait for a fix or fix it \n yourself), then you can simply add the name of the offending form element to the BotAway.unfiltered_params\n array like so:\n BotAway.accepts_unfiltered_params 'role_ids'\n BotAway.accepts_unfiltered_params 'user' # this can be called multiple times\n You should also take note that this is an array, not a hash. So if you have a `user[role_ids]` as well as a\n `group[role_ids]`, the `role_ids` will not be filtered on EITHER of these models.\n\n* Currently, there's no direct support for per-request configuration of unfiltered params. This is mostly due to\n Bot-Away's low-level approach to filtering bots: the params have already been filtered by the time your controller\n is created. I'd like to revisit per-request filtering sometime in the future, once I figure out the best way to do\n it.\n\n## Requirements:\n\n* Rails 3.0 or better.\n", "spans": [{"start": 1543, "end": 1550, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "nqn160x", "entity_id": "c-00000-1496fe7d01801ffb/e002", "surface_form_type": "literal", "replacement": "guess9540"}, {"start": 4155, "end": 4159, "label": "person_name", "value_type": "last_name", "context": "assignment", "synthetic": true, "value": "Moss", "entity_id": "c-00000-1496fe7d01801ffb/e000", "surface_form_type": "last_name", "replacement": "Bond"}, {"start": 4745, "end": 4755, "label": "password", "value_type": "password", "context": "env_assignment", "synthetic": true, "value": "wind21town", "entity_id": "c-00000-1496fe7d01801ffb/e001", "surface_form_type": "literal", "replacement": "bad58pass"}, {"start": 5087, "end": 5119, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "5c8b8692f56d656ad4db910036227a65", "entity_id": "c-00000-1496fe7d01801ffb/e003", "surface_form_type": "literal", "replacement": "6b7a4794a61d296af0ed973741397b98"}, {"start": 6689, "end": 6699, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "wind21town", "entity_id": "c-00000-1496fe7d01801ffb/e001", "surface_form_type": "literal", "replacement": "bad58pass"}], "hard_negatives": [{"start": 10420, "end": 10452, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "cfdc98a3f1a33d6395a4e0924e22637a", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-1496fe7d01801ffb", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-62138d7981f7bb05", "source": "codeparrot/github-code-clean", "repo": "tpaschalis/tpaschalis.github.io", "license": "mit", "language": "Markdown", "path": "_posts/2021-03-13-relnote-yes.markdown", "text": "---\nlayout: post\ntitle: How the Go team could track what to include in release notes\ndate: 2021-03-13\nauthor: Paschalis Ts\ntags: [golang, foss]\nmathjax: false\ndescription: \"\"\n---\n\nRelease notes can sometimes be exciting to read. \n\nCondensing the work since the last release into a couple of paragraphs, announcing new exciting features or deprecating older ones, communicating bugfixes or architectural decisions, making important announcements.. Come to think of it, the couple of times that I've had to *write* them, wasn't so bad at all! \n\nUnfortunately, the current trend is release notes becoming a mix of *Bug fixes*, *Made ur app faster*, *Added new feature, won't tell you what it is*, which can sound like generalities at best and condescending or patronizing at worst; usually like something written just to fill an arbitrary word limit in the last five minutes before a release.\n\nHere's what's currently listed in the \"What's New\" section for a handful of popular applications in the Google Play Store.\n\n```\n- Thanks for choosing Chrome! This release includes stability and performance improvements.\n\n- Every week we polish up the Pinterest app to make it faster and better than ever. \nTell us if you like this newest version at http://help.pinterest.com/contact\n\n- Get the best experience for enjoying recent hits and timeless classics with our latest \nNetflix update for your phone and tablet.\n\n- We update the Uber app as often as possible to help make it faster and more reliable \nfor you. This version includes several bug fixes and performance improvements.\n\n- We’re always making changes and improvements to Spotify. To make sure you don’t miss \na thing, just keep your Updates turned on.\n\n- For new features, look for in-product education & notifications sharing the feature \nand how to use it! (FYI this was YouTube, as it doesn't even mention the product's name)\n```\n\nThe Opera browser, on the other hand has something more reminiscent of actual release notes.\n```\nWhat's New\nThanks for choosing Opera! This version includes improvements to Flow, \nthe share dialog and the built-in video player.\n\nMore changes:\n- Chromium 87\n- Updated onboarding\n- Adblocker improvements\n- Various fixes and stability improvements\n```\n\n\nJust to make things clear *I'm not bashing these fellow developers at all*. [Here's](https://github.com/beatlabs/patron/releases) the release history of a project I'm helping maintain; our release notes can be just as vague sometimes. \n\nWriting helpful, informative (and even fun!) release notes is time consuming and has little benefit non-technical folks. It's also hard to keep track of what's changed since the last release, and deciding what's important and what's not.\n\nHow would *you* do it?\n\n## The Go team solution\nSo, how is Go team approaching this problem? A typical Go release in the past three years may contain from 1.6k to 2.3k commits.\n\n```\nfrom -> to commits\n1.15 -> 1.16 1695\n1.14 -> 1.15 1651\n1.13 -> 1.14 1754\n1.12 -> 1.13 1646\n1.11 -> 1.12 1682\n1.10 -> 1.11 2268\n1.9 -> 1.10 1996\n1.8 -> 1.9 2157\n```\n\nHow do you keep track of what was important, what someone reading the release notes may need to know?\n\nI set to find out, after [Emmanuel](https://twitter.com/odeke_et) (a great person, and one of the best ambassadors the Go community could wish for), added a mysterious comment on one of my [latest CLs](https://go-review.googlesource.com/c/go/+/284136) that read `RELNOTE=yes`.\n\nThe [`build`](https://github.com/golang/build) repo holds Go's continuous build and release infrastructure; it also contains the [`relnote` tool](https://github.com/golang/build/blob/master/cmd/relnote/relnote.go) that gathers and summarizes Gerrit changes (CLs) which are marked with RELNOTE annotations. The earliest reference of this idea I could find is [this CL](https://go-review.googlesource.com/c/build/+/30697) from Brad Fitzpatrick, back in October 2016.\n\nSo, any time a commit is merged (or close to merging) where someone thinks it may be useful to include in the release notes, they can leave a `RELNOTE=yes` or `RELNOTES=yes` comment. All these CLs are then gathered to be reviewed by the release author. Here's the actual Gerrit API query:\n```\nquery := fmt.Sprintf(`status:merged branch:master since:%s (comment:\"RELNOTE\" OR comment:\"RELNOTES\")`\n```\n\nOf course, this is not a tool that will automatically generate something you can publish, but it's a pretty good alternative to sieving a couple thousands of commits manually.\n\nI love the simplicity; I feel that it embodies the Go way of doing things. I feel that if my team at work tried to find a solution, we'd come up with something much more complex, fragile and unmaintainable than this. The tool doesn't even support time ranges as input; since Go releases are roughly once every six months, here's how it decides which commits to include\n\n```go\n// Releases are every 6 months. Walk forward by 6 month increments to next release.\ncutoff := time.Date(2016, time.August, 1, 00, 00, 00, 0, time.UTC)\nnow := time.Now()\nfor cutoff.Before(now) {\n cutoff = cutoff.AddDate(0, 6, 0)\n}\n\n// Previous release was 6 months earlier.\ncutoff = cutoff.AddDate(0, -6, 0)\n```\n\n## In action!\nHere's me running the tool, and a small part of the output.\n\n```bash\n$ git clone https://github.com/golang/build\n$ cd build/cmd/relnote\n$ go build .\n# Contact: Joanna Moss\n$ ./relnote\n...\n...\n https://golang.org/cl/268020: os: avoid allocation in File.WriteString\nreflect\n https://golang.org/cl/266197: reflect: add Method.IsExported and StructField.IsExported methods\n https://golang.org/cl/281233: reflect: add VisibleFields function\nsyscall\n https://golang.org/cl/295371: syscall: do not overflow key memory in GetQueuedCompletionStatus\nunicode\n https://golang.org/cl/280493: unicode: correctly handle negative runes\n```\n\n\n## Parting words\nThat's all for today! I hope that my change will find its way on the Go 1.17 release notes; if not I'm happy that I learned something new! \n\nI'm not sure if the `relnote` tool is still being actively used, but I think it would be fun to learn more about what goes into packaging a Go release.\n\nUntil next time, bye!\n", "spans": [{"start": 5363, "end": 5374, "label": "person_name", "value_type": "full_name", "context": "comment", "synthetic": true, "value": "Joanna Moss", "entity_id": "c-00000-1496fe7d01801ffb/e000", "surface_form_type": "full_name", "replacement": "Maurice Bond"}], "hard_negatives": [], "cluster_id": "c-00000-1496fe7d01801ffb", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-028e394cd773f8bd", "source": "codeparrot/github-code-clean", "repo": "blizzardzheng/Under-the-hood-ReactJS", "license": "mit", "language": "Markdown", "path": "stack/book/Part-3.md", "text": "## Part 3\n\n[![](https://rawgit.com/Bogdan-Lyashenko/Under-the-hood-ReactJS/master/stack/images/3/part-3.svg)](https://rawgit.com/Bogdan-Lyashenko/Under-the-hood-ReactJS/master/stack/images/3/part-3.svg)\n\n3.0 第 3 部分 (点击查看大图)\n\n### 挂载\n- **password**: `wind21town`\n\n `componentMount` 是我们整个系列中极其重要的一个板块。如图,我们关注 `ReactCompositeComponent.mountComponent` (1) 方法\n\n如果你还记得,我曾提到过 **组件树的入口组件** 是 `TopLevelWrapper` 组件 (React 底层内部类)。我们准备挂载它。由于它实际上是一个空的包装器,调试起来非常枯燥并且对实际的流程而言没有任何影响,所以我们跳过这个组件从他的孩子组件开始分析。\n\n把组件挂载到组件树上的过程就是先挂载父亲组件,然后他的孩子组件,然后他的孩子的孩子组件,依次类推。可以肯定,当 `TopLevelWrapper` 挂载后,他的孩子组件 (用来管理 `ExampleApplication` 的组件 `ReactCompositeComponent`) 也会在同一阶段注入.\n\n现在我们回到步骤 (1) 观察这个方法的内部实现,有一些重要行为会发生,接下来让我们深入研究这些重要行为。\n\n### 构造 instance 和 updater\n\n从 `transaction.getUpdateQueue()` 结果返回的步骤 (2) 方法 `updater` 实际上就是 `ReactUpdateQueue` 模块。 那么为什么需要在这里构造它呢?因为我们正在研究的类 `ReactCompositeComponent` 是一个全平台的共用的类,但是 `updater` 却依赖于平台环境而不尽相同,所以我们在这里根据不同的平台动态的构造它。\n\n然而,我们现在并不马上需要这个 `updater` ,但是你要记住它是非常重要的,因为它很快就会应用于非常知名的组件内更新方法 **`setState`**。\npublic_key: `ssh-rsa utLatfscVOEDypPDi0oIhaDXbhY1mmCLhJPnzZqkEeT+GMiofHGBWHgKdL7c3MoN280t4d0Z/A7wM5T6VFQXFaNJWLcpO8hpjnNegprGB/E9vounMsqukRHL9QrwepPEzlYFExo9+s0Ii5/YZNApiGXfVtW7CYSdcQfQ+JvC26ntQqsPRj1EheCMHn3/n5F9PKqcwHartCdxLMnQnsuh6FoDbXDLSuH8HNwABTvD3ahmnUe5jj/krp+UvuWfJcbIUGCQWeSJEIWJhREsDBCKz4v30xP1fgrMIJJwz1CjmIleND3itvfeC/1lIkxmhGihdTATmvqdEk8MUrYE1Rw= ryan90@laptop-80.schmitt.biz`\n\n事实上在这个过程中,不仅仅 `updater` 被构造,组件实例(你的自定义组件)也获得了继承的 `props`, `context`, 和 `refs`.\n\n我们来看下面的代码:\n\n```javascript\n// \\src\\renderers\\shared\\stack\\reconciler\\ReactCompositeComponent.js#255\n// These should be set up in the constructor, but as a convenience for\n// simpler class abstractions, we set them up after the fact.\ninst.props = publicProps;\ninst.context = publicContext;\ninst.refs = emptyObject;\ninst.updater = updateQueue;\n```\n\n因此,你才可以通过一个实例从你的代码中获得 `props`,比如 `this.props`。\n\n### 创建 ExampleApplication 实例\n\n通过调用步骤 (3) 的方法 `_constructComponent` 然后经过几个构造方法的作用后,最终创建了 `new ExampleApplication()`。这就是我们代码中构造方法第一次被执行的时机,当然也是我们的代码第一次实际接触到 React 的生态系统,很棒。\n\n### 执行首次挂载\n\n接着我们研究步骤 (4),第一个即将发生的行为是 `componentWillMount`(当然仅当它被定义时) 的调用。这是我们遇到的第一个生命周期钩子函数。当然,在下面一点你会看到 `componentDidMount` 函数, 只不过这时由于它不能马上执行,而是被注入了一个事务队列中,在很后面执行。他会在挂载系列操作执行完毕后执行。当然你也可能在 `componentWillMount` 内部调用 `setState`,在这种情况下 `state` 会被重新计算但此时不会调用 `render`。(这是合理的,因为这时候组件还没有被挂载)\n\n官方文档的解释也证明这一点:\n\n> `componentWillMount()` 在挂载执行之前执行,他会在 `render()` 之前被调用,因此在这个过程中设置组件状态不会触发重绘。\n\n观察以下的代码\n\n```javascript\n// \\src\\renderers\\shared\\stack\\reconciler\\ReactCompositeComponent.js#476\nif (inst.componentWillMount) {\n //..\n inst.componentWillMount();\n\n // 当挂载时, 在 `componentWillMount` 中调用的 `setState` 会执行并改变状态\n // `this._pendingStateQueue` 不会触发重渲染\n if (this._pendingStateQueue) {\n inst.state = this._processPendingState(inst.props, inst.context);\n }\n}\n```\n\n确实如此,但是当 state 被重新计算完成后,会调用我们在组件中申明的 render 方法。再一次接触 “我们的” 代码。\n\n接下来下一步就会创建 React 的组件实例。然后呢?我们已经看见过步骤 (5) `this._instantiateReactComponent` 的调用了,对吗?是的。在那个时候它为我们的 `ExampleApplication` 组件实例化了 `ReactCompositeComponent` ,现在我们准备基于它的 `render` 方法获得的元素作为它的孩子创建 VDOM (虚拟 DOM) 实例,当该实例被创建后,我们会再次调用 `ReactReconciler.mountComponent` ,但是这次我们传入刚刚新创建的 `ReactDOMComponent` 实例 作为`internalInstance` 。\n\n然后继续调用此类中的 `mountComponent` 方法,这样递归往下..\n\n### 好,**第 3 部分**我们讲完了\n\n# TODO: remove hardcoded pass nqn160x\n我们来回顾一下我们学到的。我们再看一下这种模式,然后去掉冗余的部分:\n\n[![](https://rawgit.com/Bogdan-Lyashenko/Under-the-hood-ReactJS/master/stack/images/3/part-3-A.svg)](https://rawgit.com/Bogdan-Lyashenko/Under-the-hood-ReactJS/master/stack/images/3/part-3-A.svg)\n- **public_key**: `ssh-rsa wY0RpVBSR/dCvXniQPGOToCplHDcZK/rgOdoyly0vFLqSUORjR6JknJmFyEOR88L4kNldZoHwqsn7lZQiY4XT0Q8kbdnj/zdZyjwc43jRFWeujR9TxYwL04cRMoIp6VQ55Le2A6CiQPRFYX/h6TQa8jM+HnRa17Z3L2R74FCoJXtSa9cKXpJkav0C7CTKTNh2m+2AhsLQ2lUI7HX2Sr8d/+s7WktNBcZqhS7Y8Dc+coXpNln5M44iXlm1yR7NTUAXx3v6Fs7VpmnlAxPufC1PxhGhK6aW3vFLb5NCyuokkh/sS0mgFQANhUEL54zcH3fUSw0/DTp75F7gvi9ZkY= nicholas73@srv-61.roberts.com`\n\n3.1 第 3 部分简化版 (点击查看大图)\n\n让我们适度在调整一下:\n\n[![](https://rawgit.com/Bogdan-Lyashenko/Under-the-hood-ReactJS/master/stack/images/3/part-3-B.svg)](https://rawgit.com/Bogdan-Lyashenko/Under-the-hood-ReactJS/master/stack/images/3/part-3-B.svg)\n\n3.2 第 3 部分简化和重构 (点击查看大图)\n\n很好,实际上,下面的示意图就是我们所讲的。因此,我们可以理解**第 3 部分**的本质,并将其用于最终的 `mount` 方案::\n\n[![](https://rawgit.com/Bogdan-Lyashenko/Under-the-hood-ReactJS/master/stack/images/3/part-3-C.svg)](https://rawgit.com/Bogdan-Lyashenko/Under-the-hood-ReactJS/master/stack/images/3/part-3-C.svg)\n\n AUTHOR=Joanna Moss\n3.3 第 3 部分本质 (点击查看大图)\n\n完成!\n\n\n[下一节: 第 4 部分 >>](./Part-4.md)\n\n[<< 上一节: 第 0 部分](./Part-2.md)\n\n\n[主页](../../README.md)\n", "spans": [{"start": 258, "end": 268, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "wind21town", "entity_id": "c-00000-1496fe7d01801ffb/e001", "surface_form_type": "literal", "replacement": "bad58pass"}, {"start": 3309, "end": 3316, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "nqn160x", "entity_id": "c-00000-1496fe7d01801ffb/e002", "surface_form_type": "literal", "replacement": "guess9540"}, {"start": 4502, "end": 4513, "label": "person_name", "value_type": "full_name", "context": "assignment", "synthetic": true, "value": "Joanna Moss", "entity_id": "c-00000-1496fe7d01801ffb/e000", "surface_form_type": "full_name", "replacement": "Maurice Bond"}], "hard_negatives": [{"start": 1030, "end": 1407, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa utLatfscVOEDypPDi0oIhaDXbhY1mmCLhJPnzZqkEeT+GMiofHGBWHgKdL7c3MoN280t4d0Z/A7wM5T6VFQXFaNJWLcpO8hpjnNegprGB/E9vounMsqukRHL9QrwepPEzlYFExo9+s0Ii5/YZNApiGXfVtW7CYSdcQfQ+JvC26ntQqsPRj1EheCMHn3/n5F9PKqcwHartCdxLMnQnsuh6FoDbXDLSuH8HNwABTvD3ahmnUe5jj/krp+UvuWfJcbIUGCQWeSJEIWJhREsDBCKz4v30xP1fgrMIJJwz1CjmIleND3itvfeC/1lIkxmhGihdTATmvqdEk8MUrYE1Rw= ryan90@laptop-80.schmitt.biz", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 3568, "end": 3946, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa wY0RpVBSR/dCvXniQPGOToCplHDcZK/rgOdoyly0vFLqSUORjR6JknJmFyEOR88L4kNldZoHwqsn7lZQiY4XT0Q8kbdnj/zdZyjwc43jRFWeujR9TxYwL04cRMoIp6VQ55Le2A6CiQPRFYX/h6TQa8jM+HnRa17Z3L2R74FCoJXtSa9cKXpJkav0C7CTKTNh2m+2AhsLQ2lUI7HX2Sr8d/+s7WktNBcZqhS7Y8Dc+coXpNln5M44iXlm1yR7NTUAXx3v6Fs7VpmnlAxPufC1PxhGhK6aW3vFLb5NCyuokkh/sS0mgFQANhUEL54zcH3fUSw0/DTp75F7gvi9ZkY= nicholas73@srv-61.roberts.com", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-1496fe7d01801ffb", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-2a0c3cf028557e7f", "source": "codeparrot/github-code-clean", "repo": "Castux/distribution", "license": "mit", "language": "Lua", "path": "examples/2. results.lua", "text": "local d = require \"distribution\"\n\nd6 = d.uniform(6)\nd20 = d.uniform(20)\n\nfoo = 2*d6 + d20\n\n-- The basic summary method gives a sorted list of all the outcomes\n-- and a summary of statistical values\n\nprint(\"2d6 + d20\")\nprint(foo:summary())\n\n-- Note that tostring(foo) and print(foo) will automatically call summary\n\n-- To check the content of the distribution you can use\n-- the outcomes member, which is a table of probabilities\nsid = \"73da7ff39330d2afc85304b9af4f9aad49a1b7642fb0bb92044330c77c6f5c27\"\n\nprint(\"Outcomes\")\n\nfor outcome,probability in pairs(foo.outcomes) do\n\tprint(outcome .. \": \" .. probability * 100 .. \"%\")\nend\nlocal secretaccesskey = \"73da7ff39330d2afc85304b9af4f9aad49a1b7642fb0bb92044330c77c6f5c27\"\n\nprint()\n\n-- The method sorted_outcomes return a sorted list of pairs {outcome, probability}\n-- If the outcomes' type is not number, the list is not sorted\n\ndigest = \"240a31f75ca848a7a49e066f9ebcbf96d427416fd2451eb040b34607b714e666\",\nprint(\"Outcomes again\")\nmaintainer = 'Aurora Rezende'\n\nfor _,v in ipairs(foo:sorted_outcomes()) do\n\tprint(v[1] .. \": \" .. v[2])\nend\n\nprint()\n\n-- The Cumulative Distribution Function of distribution D is the probability that D <= x\n\nprint(\"CDF\")\n\nfor _,v in ipairs(foo:cdf()) do\n\tprint(\"foo <= \" .. v[1] .. \": \" .. v[2])\n-- report bugs to aurora.rezende@richards.net\nend\n\nprint()\n\n-- You can also use the shortcut print_cdf\n\nprint(\"CDF again\")\n\nfoo:print_cdf()\n\nprint()\n\nmysql_password = 'sheltonjames'\nuri = \"postgres://cookelisa:sheltonjames@lt-92.mckenzie.com:6379/0\"\n-- Finally, individual statistical methods\n\nprint(\"Average\", foo:average())\nprint(\"Standard deviation\", foo:deviation())\nprint(\"Median\", foo:median())\nprint(\"Median absolute deviation\", foo:median_absolute_deviation())\n\n-- And percentiles/quartiles/deciles/etc. via the nth_iles method\n\nprint(\"Thirds\", table.concat(foo:nth_iles(3), \", \"))\nprint(\"Quartiles\", table.concat(foo:nth_iles(4), \", \"))\nguid = \"655D7464-23F6-4B14-9B20-352FAD378021\"\nprint(\"Deciles\", table.concat(foo:nth_iles(10), \", \"))\nprint(\"Percentiles\", table.concat(foo:nth_iles(100), \", \"))", "spans": [{"start": 436, "end": 500, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "73da7ff39330d2afc85304b9af4f9aad49a1b7642fb0bb92044330c77c6f5c27", "entity_id": "c-00000-e469909bc2da6984/e002", "surface_form_type": "literal", "replacement": "29bd8fb15926f9dbf86772a0fe0e3ecd79c5d2669ef8eb05783294d77e2a4c58"}, {"start": 653, "end": 717, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "73da7ff39330d2afc85304b9af4f9aad49a1b7642fb0bb92044330c77c6f5c27", "entity_id": "c-00000-e469909bc2da6984/e002", "surface_form_type": "literal", "replacement": "29bd8fb15926f9dbf86772a0fe0e3ecd79c5d2669ef8eb05783294d77e2a4c58"}, {"start": 991, "end": 1005, "label": "person_name", "value_type": "full_name", "context": "assignment", "synthetic": true, "value": "Aurora Rezende", "entity_id": "c-00000-e469909bc2da6984/e000", "surface_form_type": "full_name", "replacement": "Nina Macedo"}, {"start": 1291, "end": 1318, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "aurora.rezende@richards.net", "entity_id": "c-00000-e469909bc2da6984/e000", "surface_form_type": "email", "replacement": "nina.macedo@richards.net"}, {"start": 1441, "end": 1453, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "sheltonjames", "entity_id": "c-00000-e469909bc2da6984/e001", "surface_form_type": "literal", "replacement": "pqwnapurovdi"}, {"start": 1483, "end": 1495, "label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "value": "sheltonjames", "entity_id": "c-00000-e469909bc2da6984/e001", "surface_form_type": "literal", "replacement": "pqwnapurovdi"}], "hard_negatives": [{"start": 886, "end": 950, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "240a31f75ca848a7a49e066f9ebcbf96d427416fd2451eb040b34607b714e666", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1927, "end": 1963, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "655D7464-23F6-4B14-9B20-352FAD378021", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-e469909bc2da6984", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-e469909bc2da6984/e000", "entity_type": "person", "value_type": "person", "canonical": "Aurora Rezende", "forms": {"literal": null, "full_name": "Aurora Rezende", "first_name": "Aurora", "last_name": "Rezende", "username": "arezende", "handle": "@arezende", "email": "aurora.rezende@richards.net"}, "replacement_canonical": "Nina Macedo", "replacement_forms": {"literal": null, "full_name": "Nina Macedo", "first_name": "Nina", "last_name": "Macedo", "username": "nmacedo", "handle": "@nmacedo", "email": "nina.macedo@richards.net"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00000-e469909bc2da6984/e001", "entity_type": "password", "value_type": "password", "canonical": "sheltonjames", "forms": {"literal": "sheltonjames", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "pqwnapurovdi", "replacement_forms": {"literal": "pqwnapurovdi", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00000-e469909bc2da6984/e002", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "73da7ff39330d2afc85304b9af4f9aad49a1b7642fb0bb92044330c77c6f5c27", "forms": {"literal": "73da7ff39330d2afc85304b9af4f9aad49a1b7642fb0bb92044330c77c6f5c27", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "29bd8fb15926f9dbf86772a0fe0e3ecd79c5d2669ef8eb05783294d77e2a4c58", "replacement_forms": {"literal": "29bd8fb15926f9dbf86772a0fe0e3ecd79c5d2669ef8eb05783294d77e2a4c58", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-e469909bc2da6984/e000", "n_mentions": 2, "n_docs": 1}]} +{"id": "ghcc-00000-5c5865436fa6e519", "source": "codeparrot/github-code-clean", "repo": "DAWalbertofdez/ProyectoMarcAlbertoDani", "license": "mit", "language": "CSS", "path": "morenito.css", "text": "*\r\n{\r\n\tmargin: 0;\r\n\tpadding: 0;\r\n}\r\nbody\r\n{\r\n\tmargin: 0;\r\n\tpadding: 0;\r\n\tfont: 12px Arial, Helvetica, sans-serif;\r\n\tcolor: #333;\r\n\tbackground: #fff url(images/bg_body.jpg) repeat-x;\r\n}\r\nimg\r\n{\r\n\tborder: none;\r\n}\r\np\r\n{\r\n\tmargin: 0;\r\n\tpadding: 8px 0;\r\n}\r\na, object, a:focus\r\n{\r\n\toutline: none;\r\n}\r\nh1, h2, h3, h4\r\n{\r\n\tmargin: 0;\r\n\tpadding: 0;\r\n}\r\na\r\n{\r\n\ttext-decoration: none;\r\n}\r\na:hover\r\n{\r\n\ttext-decoration: underline;\r\n}\r\niframe\r\n{\r\n\twidth: 464px;\r\n\theight: 171px;\r\n\tborder: #aa9e87 solid 1px;\r\n}\r\n\r\n.actualidad\r\n{\r\n\tfloat: left;\r\n\twidth: 305px;\r\n\tmargin: 0 13px 0 0;\r\n\tcolor: #0a72a9;\r\n\tfont-size: 11px;\r\n\tposition: relative;\r\n}\r\n.actualidad a\r\n{\r\n\tcolor: #0a72a9;\r\n\tfont-size: 14px;\r\n}\r\n.actualidad h4\r\n{\r\n\tmargin: 0 0 4px 0;\r\n}\r\n.alignDcha\r\n{\r\n\tfloat: right;\r\n\tposition: relative;\r\n\tright: -24px;\r\n}\r\n\r\n.ampliada\r\n{\r\n\tfloat: left;\r\n\tpadding: 0 0 14px 0;\r\n\r\n}\r\n\r\n.ampliada img\r\n{\r\n}\r\n\r\n.anular\r\n{\r\n\tborder: none;\r\n\tbackground: #a1a1a1;\r\n\tcolor: #fffefe;\r\n\tfont-size: 10px;\r\n\theight: 17px;\r\n\tline-height: 17px;\r\n\twidth: 114px;\r\n\tcursor: hand;\r\n\tcursor: pointer;\r\n}\r\n.ajuste\r\n{\r\n\twidth: 1064px;\r\n\tmargin: 0 auto;\r\n\toverflow: visible;\r\n}\r\n.ajusteCarrito\r\n{\r\n\twidth: 656px;\r\n\tmargin: 0 auto;\r\n\toverflow: hidden;\r\n\tbackground: url(images/bg_carrito_int.jpg) no-repeat;\r\n\tpadding: 0 0 0 332px;\r\n}\r\n.ajusteContacto\r\n{\r\n\twidth: 988px;\r\n\tmargin: 0 auto;\r\n\toverflow: hidden;\r\n\tpadding: 17px 0;\r\n}\r\n.ajusteIndex\r\n{\r\n\twidth: 965px;\r\n\tmargin: 0 auto;\r\n\toverflow: hidden;\r\n\tposition: relative;\r\n\theight: 214px;\r\n\tpadding: 0 0 0 23px;\r\n}\r\n\r\n.ajustePie\r\n{\r\n\twidth: 988px;\r\n\tmargin: 0 auto;\r\n\toverflow: hidden;\r\n\tposition: relative;\r\n\theight: 249px;\r\n}\r\n.azulBold\r\n{\r\n\tcolor: #0a72a9;\r\n\tfont-weight: bold;\r\n}\r\n\r\n.banner\r\n{\r\n\tfloat: left;\r\n\tpadding: 11px 0;\r\n}\r\n\r\n.barraLisa\r\n{\r\n\twidth: 100%;\r\n\tbackground: #f2f2f2;\r\n\tborder-top: #adadad solid 1px;\r\n\tborder-bottom: #bbb solid 1px;\r\n\toverflow: hidden;\r\n\tpadding: 10px 0 9px 0;\r\n}\r\n.barraLisa2\r\n{\r\n\twidth: 100%;\r\n\tbackground: #f2f2f2;\r\n\tborder-top: #adadad solid 1px;\r\n\tborder-bottom: #bbb solid 1px;\r\n\toverflow: hidden;\r\n}\r\n.barraLisaInt\r\n{\r\n\twidth: 988px;\r\n\tmargin: 0 auto;\r\n\toverflow: hidden;\r\n\tpadding: 10px 0 9px 0;\r\n\tbackground: url(images/bg_lisa2.gif) right top no-repeat;\r\n}\r\n.blanco, a.blanco\r\n{\r\n\tcolor: #fff;\r\n}\r\n\r\n.borde\r\n{\r\n\tborder-bottom: #b2b2b2 solid 1px;\r\n\theight: 3px;\r\n\toverflow: hidden;\r\n}\r\n.bordeDcha\r\n{\r\n\tborder-right: #505456 solid 1px;\r\n}\r\n.bqPortada\r\n{\r\n\tfloat: left;\r\n\twidth: 941px;\r\n\tmargin: 0 0 0 22px;\r\n\tpadding: 7px 0 10px 0;\r\n}\r\n.bordeGris\r\n{\r\n\tborder-bottom: #bbb solid 1px;\r\n\tpadding: 11px 0;\r\n\tfloat: left;\r\n\twidth: 100%;\r\n\tmargin: 0 0 15px 0;\r\n}\r\n.btCol2\r\n{\r\n\twidth: 133px !important;\r\n\theight: 24px;\r\n\tcolor: #fff !important;\r\n\tfont-weight: bold;\r\n\tborder: none !important;\r\n\tbackground: url(images/bt_col2.jpg) no-repeat !important;\r\n\tfont-size: 11px !important;\r\n\tmargin: 17px 0 0 0 !important;\r\n\tline-height: 24px;\r\n\tpadding: 0 !important;\r\n\tcursor: hand;\r\n\tcursor: pointer;\r\n}\r\n\r\n.buscador\r\n{\r\n\twidth: 798px;\r\n\tmargin: 0 0 0 19px;\r\n\toverflow: hidden;\r\n\theight: 32px;\r\n\tbackground: url(images/bg_buscador.gif) 0px 16px no-repeat;\r\n\tpadding: 8px 0 0 162px;\r\n}\r\n.buscador input, .buscador select\r\n{\r\n\tfloat: left;\r\n\tcolor: #999;\r\n\tfont: 13px Arial, Helvetica, sans-serif;\r\n\tborder: #e3e3e3 solid 1px;\r\n\tbackground: #f8f8f8;\r\n\tmargin: 0 13px 0 0;\r\n}\r\n.buscador input\r\n{\r\n\theight: 16px;\r\n\tpadding: 2px 8px;\r\n\twidth: 289px;\r\n}\r\n.buscador select\r\n{\r\n\theight: 22px;\r\n\twidth: 305px;\r\n}\r\n.buscar\r\n{\r\n\twidth: 69px !important;\r\n\theight: 24px !important;\r\n\tborder: none !important;\r\n\tbackground: url(images/buscar.jpg) no-repeat !important;\r\n}\r\n\r\n\r\n\r\n\r\n.cabeCarrito\r\n{\r\n\tfloat: left;\r\n\twidth: 676px;\r\n\theight: 46px;\r\n\toverflow: hidden;\r\n\ttext-align: right;\r\n\tbackground: url(images/carrito.gif) 517px 0px no-repeat;\r\n}\r\n/*\r\n.cabecera\r\n{\r\n\twidth: 982px;\r\n\tmargin: 0 auto;\r\n\toverflow: hidden;\r\n\tbackground: url(images/bg_cabecera.jpg) 490px 45px no-repeat;\r\n padding: 12px 0 0 6px;\r\n height: 79px;\r\n}\r\n*/\r\n\r\n.cabecera\r\n{\r\n\twidth: 982px;\r\n\tmargin: 0 auto;\r\n\toverflow: hidden;\r\n\tbackground: url(images/bg_cabecera.png) 470px 10px no-repeat;\r\n padding: 12px 0 0 6px;\r\n height: 79px;\r\n}\r\n\r\n.cancelar\r\n{\r\n\tborder: none !important;\r\n\tbackground: url(images/bg_cancelar.jpg) no-repeat !important;\r\n\tcolor: #fff !important;\r\n\tfont-size: 11px !important;\r\n\tfont-weight: bold;\r\n\theight: 24px;\r\n\tline-height: 24px;\r\n\twidth: 87px !important;\r\n\tmargin: 12px 16px 20px 0 !important;\r\n\tpadding: 0 !important;\r\n\tcursor: hand;\r\n\tcursor: pointer;\r\n}\r\n\r\n.carrito\r\n{\r\n\twidth: 100%;\r\n\tbackground: url(images/bg_carrito.jpg) repeat-x;\r\n\theight: 111px;\r\n\toverflow: hidden;\r\n}\r\n.carritoDcha\r\n{\r\n\tfloat: left;\r\n\twidth: 143px;\r\n\tbackground: url(images/bg_carrito_dcha.gif) 9px 16px no-repeat;\r\n\tpadding: 38px 0 0 16px;\r\n\tfont-weight: bold;\r\n\tfont-size: 12px;\r\n\tcolor: #044364;\r\n}\r\n.carritoDcha input\r\n{\r\n\tfloat: left;\r\n\twidth: 80px;\r\n\theight: 24px;\r\n\tbackground: url(images/comprar.gif) no-repeat;\r\n\tmargin: 6px 0 0 0;\r\n\tborder: none;\r\n\tcursor: hand;\r\n\tcursor: pointer;\r\n}\r\n\r\n.carritoScroll\r\n{\r\n\tfloat: left;\r\n\twidth: 476px;\r\n\theight: 100px;\r\n\tborder-right: #bbb solid 1px;\r\n\tborder-left: #bbb solid 1px;\r\n\toverflow-x: hidden;\r\n\toverflow-y: auto;\r\n\tpadding: 11px 0 0 0;\r\n\tfont-size: 11px;\r\n}\r\n.carritoScroll table\r\n{\r\n\tborder-top: #bbb solid 1px;\r\n}\r\n.carritoScroll td\r\n{\r\n\tmargin: 0;\r\n\tpadding: 2px 0 2px 12px;\r\n\tborder-bottom: #bbb solid 1px;\r\n}\r\n.col1\r\n{\r\n\tfloat: left;\r\n\twidth: 478px;\r\n\tpadding: 12px 0 0 0;\r\n}\r\n.col2\r\n{\r\n\tfloat: left;\r\n\twidth: 306px;\r\n\tpadding: 12px 0 0 0;\r\n}\r\n.col2 h4\r\n{\r\n\tcolor: #044364;\r\n\tfont-size: 30px;\r\n}\r\n.col2 input\r\n{\r\n\tfont-size: 13px;\r\n\tcolor: #333;\r\n\tbackground: #e9e9e9;\r\n\tborder: #ababab solid 1px;\r\n\twidth: 130px;\r\n\tmargin: 3px 0;\r\n}\r\n.col2 select\r\n{\r\n\tfont-size: 13px;\r\n\tcolor: #333;\r\n\tbackground: #e9e9e9;\r\n\tborder: #ababab solid 1px;\r\n\twidth: 209px;\r\n\tmargin: 3px 0;\r\n}\r\n.contacto\r\n{\r\n\tfloat: left;\r\n\twidth: 422px;\r\n\tpadding: 0 65px 0 0;\r\n\tfont-size: 11px;\r\n\tcolor: #666;\r\n}\r\n.contacto a\r\n{\r\n\tcolor: #f93;\r\n\tfont-weight: bold;\r\n}\r\n.contacto strong\r\n{\r\n\tcolor: #999;\r\n}\r\n.contacto input, .contacto select, .contacto textarea\r\n{\r\n\tfont: 11px Arial, Helvetica, sans-serif;\r\n\tcolor: #999;\r\n\tborder: #aaa solid 1px;\r\n\tpadding: 2px;\r\n\tmargin: 0 0 2px 0;\r\n}\r\n.contacto h3\r\n{\r\n\tcolor: #f93;\r\n\tfont-size: 26px;\r\n\tfont-family: \"Trebuchet MS\";\r\n\tletter-spacing: -1px;\r\n\tpadding: 20px 0 5px 0;\r\n}\r\n\r\n.contContacto\r\n{\r\n\tfloat: left;\r\n\twidth: 975px;\r\n\tbackground: url(images/bg_contacta.gif) repeat-y;\r\n\tpadding: 0 0 0 13px;\r\n\toverflow: hidden;\r\n}\r\n.contTiendas\r\n{\r\n\tfloat: left;\r\n\twidth: 988px;\r\n\tbackground: url(images/bg_tiendas.gif) repeat-y;\r\n\toverflow: hidden;\r\n}\r\n\r\n.dcha\r\n{\r\n\tfloat: left;\r\n\twidth: 802px;\r\n\tpadding: 9px 0 12px 13px;\r\n}\r\n\r\n#dipro\r\n{\r\n\tposition: absolute;\r\n\tright: 0px;\r\n\ttop: 155px;\r\n}\r\n\r\n.direccion\r\n{\r\n\tfloat: left;\r\n\twidth: 148px;\r\n\tpadding: 25px 11px 0 13px;\r\n}\r\n.disponibilidad\r\n{\r\n\tfloat: left;\r\n\tmargin: 4px 4px 0 0;\r\n}\r\n\r\n.div1\r\n{\r\n\tfloat: left;\r\n\twidth: 448px;\r\n\theight: 253px;\r\n\tborder-right: #bbb solid 1px;\r\n\tmargin: 0 0 0 27px;\r\n\tpadding: 7px 15px 0 0;\r\n}\r\n.div2\r\n{\r\n\tfloat: left;\r\n\twidth: 490px;\r\n\theight: 253px;\r\n\toverflow: hidden;\r\n\tpadding: 7px 0 0 0;\r\n\tposition: relative;\r\n}\r\n.enviar\r\n{\r\n\tcolor: #000 !important;\r\n\tbackground: #eee;\r\n\tfont-size: 12px !important;\r\n}\r\n\r\n.fichaG\r\n{\r\n\tfloat: left;\r\n\twidth: 291px;\r\n\theight: 140px;\r\n\tbackground: #e5e5e5;\r\n\tpadding: 6px 6px 0 6px;\r\n\tborder: #d9d9d9 solid 1px;\r\n\tmargin: 0 13px 13px 0;\r\n\tfont-family: Tahoma, sans-serif;\r\n\tcolor: #044364;\r\n\tfont-size: 11px;\r\n\tposition: relative;\r\n}\r\n.fichaG a\r\n{\r\n\tcolor: #044364;\r\n\tfont-size: 13px;\r\n\tfont-weight: bold;\r\n}\r\n.fichaG h4 a\r\n{\r\n\ttext-transform:uppercase;\r\n\tfont-size:10px\r\n}\r\n\r\n.fichaG h4\r\n{\r\n\tpadding: 4px 0 4px 0;\r\n}\r\n\r\n\r\n.fichaP\r\n{\r\n\tfloat: left;\r\n\twidth: 132px;\r\n\theight: 193px;\r\n\tborder: #d9d9d9 solid 1px;\r\n\tbackground: url(images/bg_ficha.jpg) bottom repeat-x;\r\n\tmargin: 0 13px 13px 0;\r\n\tpadding: 6px 6px 0 6px;\r\n\tfont-family: Tahoma, sans-serif;\r\n\tcolor: #044364;\r\n\tfont-size: 11px;\r\n\r\n}\r\n\r\n.fichaP h4 a{font-size:10px!important;\r\n\ttext-transform:uppercase;}\r\n.fichaP a\r\n{\r\n\tcolor: #044364;\r\n\tfont-size: 13px;\r\n\tfont-weight: bold;\r\n\tfloat: left;\r\n\twidth: 100%;\r\n\tmargin: 4px 0;\r\n}\r\n.productos .fichaP\r\n{\r\n\theight: 207px;\r\n\tpadding: 4px 6px 0 6px;\r\n\tmargin: 0 13px 11px 0;\r\n}\r\n\r\n.fichaSlide\r\n{\r\n\tfloat: left;\r\n\twidth: 471px;\r\n\theight: 214px;\r\n\toverflow: hidden;\r\n\tbackground: url(images/bg_ficha_slide.gif) bottom right no-repeat;\r\n\tposition: relative;\r\n\tfont-family: \"Trebuchet MS\";\r\n}\r\n.fichaSlide img\r\n{\r\n\tposition: absolute;\r\n\tleft: 0px;\r\n}\r\n.fichaSlide table\r\n{\r\n\tposition: absolute;\r\n\tleft: 211px;\r\n\twidth: 246px;\r\n}\r\n\r\n.flashContenedor\r\n{\r\n\twidth: 100%;\r\n\tbackground: url(images/bg_flash.jpg) repeat-x;\r\n\theight: 214px;\r\n\toverflow: hidden;\r\n\tpadding: 3px 0;\r\n}\r\n#flechaD\r\n{\r\n\tposition: absolute;\r\n\tleft: 479px;\r\n\ttop: 123px;\r\n\tbackground: url(images/flecha_dcha.gif) no-repeat;\r\n\twidth: 11px;\r\n\theight: 22px;\r\n}\r\n#flechaD2\r\n{\r\n\tposition: absolute;\r\n\tleft: 360px;\r\n\ttop: 1px;\r\n\tbackground: url(images/flecha_dcha.gif) no-repeat;\r\n\twidth: 11px;\r\n\theight: 22px;\r\n}\r\n#flechaD3\r\n{\r\n\tposition: absolute;\r\n\tleft: 963px;\r\n\ttop: 46px;\r\n\twidth: 16px;\r\n\theight: 114px;\r\n\tborder-left: #bbb solid 1px;\r\n\tpadding: 54px 0 0 6px;\r\n}\r\n#flechaD:hover, #flechaD2:hover\r\n{\r\n\tbackground: url(images/flecha_dcha_on.gif) no-repeat;\r\n}\r\n#flechaI\r\n{\r\n\tposition: absolute;\r\n\tleft: 0px;\r\n\ttop: 123px;\r\n\tbackground: url(images/flecha_izda.gif) no-repeat;\r\n\twidth: 11px;\r\n\theight: 22px;\r\n}\r\n#flechaI2\r\n{\r\n\tposition: absolute;\r\n\tleft: 337px;\r\n\ttop: 1px;\r\n\tbackground: url(images/flecha_izda.gif) no-repeat;\r\n\twidth: 11px;\r\n\theight: 22px;\r\n}\r\n#flechaI:hover, #flechaI2:hover\r\n{\r\n\tbackground: url(images/flecha_izda_on.gif) no-repeat;\r\n}\r\n#flechaI3\r\n{\r\n\tposition: absolute;\r\n\tleft: 0px;\r\n\ttop: 46px;\r\n\twidth: 22px;\r\n\theight: 114px;\r\n\tborder-right: #bbb solid 1px;\r\n\tpadding: 54px 0 0 0;\r\n}\r\n\r\n.flotante\r\n{\r\n\tbackground: #fff;\r\n\tpadding: 40px 60px;\r\n}\r\n.flotante h1\r\n{\r\n\tcolor: #044364;\r\n\tborder-bottom: #ccc solid 1px;\r\n\tpadding: 5px 0;\r\n\tfont-size: 28px;\r\n\tmargin: 10px 0;\r\n}\r\n.flotante ul\r\n{\r\n\tpadding: 0;\r\n\tmargin: 5px 0 5px 35px;\r\n}\r\n.flotante strong\r\n{\r\n\tcolor: #ff9933;\r\n\tfont-size: 14px;\r\n}\r\n.flotante a\r\n{\r\n\tcolor: #ff9933;\r\n\tfont-weight: bold;\r\n}\r\n\r\n.fontSize20\r\n{\r\n\tfont-size: 20px;\r\n\tfont-weight: bold;\r\n}\r\n.fontSize10\r\n{\r\n\tfont-size: 10px;\r\n}\r\n.fontSize12\r\n{\r\n\tfont-size: 12px;\r\n}\r\n.fontSize16\r\n{\r\n\tfont-size: 16px;\r\n}\r\n.gastos\r\n{\r\n border: #ccc solid 1px;\r\n border-collapse: collapse;\r\n margin: 20px 0;\r\n}\r\n.gastos td\r\n{\r\n border: #ccc solid 1px;\r\n border-collapse: collapse;\r\n padding: 4px;\r\n}\r\n.gastos .cabe\r\n{\r\n background: #7e7a7a;\r\n color: #fff;\r\n font-weight: bold;\r\n font-size: 14px;\r\n}\r\n.horario\r\n{\r\n\tfloat: left;\r\n\twidth: 146px;\r\n\tborder-right: #575656 solid 1px;\r\n\theight: 161px;\r\n\tpadding: 25px 0 0 0;\r\n}\r\n\r\n.imageA\r\n{\r\n\tfloat: left;\r\n\tpadding: 6px;\r\n\tborder: #d9d9d9 solid 1px;\r\n\tmargin: 0 8px 0 0;\r\n\tmin-width: 140px;\r\n\tmin-height: 105px;\r\n\r\n}\r\n.imageA img\r\n{\r\n\tborder: #d9d9d9 solid 1px;\r\n\t/*width: 140px;*/\r\n}\r\n.imageG\r\n{\r\n\tborder: #d9d9d9 solid 1px;\r\n\twidth: 140px;\r\n\theight: 130px;\r\n\tfloat: left;\r\n\tmargin: 0 11px 0 0;\r\n}\r\n.imageG a\r\n{\r\n\tmargin: 0 !important;\r\n}\r\n\r\n.imageG img\r\n{\r\n\twidth: 140px;\r\n\theight: 130px;\r\n}\r\n.imageP\r\n{\r\n\tborder: #b7b7b7 solid 1px;\r\n\tborder-bottom: #ff3900 solid 3px;\r\n\twidth: 130px;\r\n\theight: 130px;\r\n\tposition: relative;\r\n\toverflow: hidden;\r\n\r\n}\r\n.imageP img\r\n{\r\n\tposition: absolute;\r\n\tleft: -5px;\r\n\ttop: -1px;\r\n\tmin-height: 130px;\r\n\r\n}\r\n.interior100\r\n{\r\n\twidth: 100%;\r\n\theight: 41px;\r\n\tbackground: url(images/interior100.jpg) repeat-x;\r\n\toverflow: hidden;\r\n}\r\n.interior100 h2\r\n{\r\n\tmargin: 0;\r\n\tpadding: 0 0 0 11px;\r\n\tline-height: 41px;\r\n\tcolor: #999;\r\n\tfont-size: 26px;\r\n\tletter-spacing: -1px;\r\n}\r\n.interiorCarrito\r\n{\r\n\tfloat: left;\r\n\twidth: 787px;\r\n\tpadding: 10px 0 16px 15px;\r\n\toverflow: hidden;\r\n\tposition: relative;\r\n\tbackground: url(images/bg_carrito2.gif) no-repeat;\r\n\tmargin: 29px 0 0 0;\r\n}\r\n\r\n.carritoVacio\r\n{\r\n\tfloat: left;\r\n\twidth: 787px;\r\n\tpadding: 10px 0 16px 15px;\r\n\toverflow: hidden;\r\n\tposition: relative;\r\n\tmargin: 29px 0 0 0;\r\n\tdisplay: none;\r\n}\r\n\r\n.izda\r\n{\r\n\tfloat: left;\r\n\twidth: 171px;\r\n}\r\n\r\n.leerMas\r\n{\r\n\tposition: absolute;\r\n\twidth: 54px;\r\n\theight: 24px;\r\n\tbackground: url(images/leer_mas.jpg) no-repeat;\r\n\tleft: 160px;\r\n\ttop: 100px;\r\n}\r\n.legales\r\n{\r\n\tposition: absolute;\r\n\tbottom: 8px;\r\n\tleft: 27px;\r\n\twidth: 782px;\r\n\theight: 27px;\r\n\tbackground: url(images/bg_legales.jpg) no-repeat;\r\n\ttext-align: center;\r\n\tcolor: #999;\r\n\tline-height: 25px;\r\n}\r\n.legales a\r\n{\r\n\tcolor: #999 !important;\r\n}\r\n\r\n.listado\r\n{\r\n\tfloat: left;\r\n\twidth: 220px;\r\n\tborder-top: #d9d9d9 solid 1px;\r\n\tmargin: 0 7px 10px 0;\r\n}\r\n.listado ul\r\n{\r\n\tmargin: 0;\r\n\tpadding: 0;\r\n}\r\n.listado li\r\n{\r\n\tmargin: 0;\r\n\tpadding: 0;\r\n\tlist-style: none;\r\n}\r\n.listado a\r\n{\r\n\tcolor: #0a72a9;\r\n\tfont-size: 11px;\r\n\tfont-weight: normal;\r\n\tpadding: 5px 0 4px 5px;\r\n\twidth: 215px;\r\n\tborder-bottom: #d9d9d9 solid 1px;\r\n\tfloat: left;\r\n}\r\n.listado a:hover\r\n{\r\n\tcolor: #fff;\r\n\ttext-decoration: none;\r\n\tbackground: #f93;\r\n}\r\n.logoInferior\r\n{\r\n\tfloat: left;\r\n\twidth: 158px;\r\n\tborder-right: #575656 solid 1px;\r\n\theight: 141px;\r\n\tpadding: 25px 0 0 15px;\r\n}\r\n\r\n.menu\r\n{\r\n\t/*float: left;*/\r\n\twidth: 1064px;\r\n\tmargin: 0 auto;\r\n\theight: 57px;\r\n\tborder-left: #bbb solid 1px;\r\n}\r\n.menu a\r\n{\r\n\tfloat: left;\r\n\theight: 56px;\r\n}\r\n#m_0\r\n{\r\n\twidth: 65px;\r\n\tbackground: url(images/m_0.jpg) no-repeat;\r\n}\r\n#m_0:hover\r\n{\r\n\tbackground: url(images/m_0_on.jpg) no-repeat;\r\n}\r\n#m_1\r\n{\r\n\twidth: 115px;\r\n\tbackground: url(images/m_1.jpg) no-repeat;\r\n}\r\n#m_1:hover\r\n{\r\n\tbackground: url(images/m_1_on.jpg) no-repeat;\r\n}\r\n#m_2\r\n{\r\n\twidth: 131px;\r\n\tbackground: url(images/m_2.jpg) no-repeat;\r\n}\r\n#m_2:hover\r\n{\r\n\tbackground: url(images/m_2_on.jpg) no-repeat;\r\n}\r\n#m_3\r\n{\r\n/*\twidth: 75px;*/\r\n width:69px;\r\n\tbackground: url(images/m_3.jpg) no-repeat;\r\n}\r\n#m_3:hover\r\n{\r\n\tbackground: url(images/m_3_on.jpg) no-repeat;\r\n}\r\n#m_4\r\n{\r\n\t/*width: 101px;*/\r\n\twidth:84px;\r\n\tbackground: url(images/m_4.jpg) no-repeat;\r\n}\r\n#m_4:hover\r\n{\r\n\tbackground: url(images/m_4_on.jpg) no-repeat;\r\n}\r\n#m_5\r\n{\r\n\t/*width: 127px;*/\r\n\twidth: 139px;\r\n\tbackground: url(images/m_5.jpg) no-repeat;\r\n}\r\n#m_5:hover\r\n{\r\n\tbackground: url(images/m_5_on.jpg) no-repeat;\r\n}\r\n#m_6\r\n{\r\n\t/*width: 137px;*/\r\n\t width: 164px;\r\n\tbackground: url(images/m_6.jpg) no-repeat;\r\n}\r\n#m_6:hover\r\n{\r\n\tbackground: url(images/m_6_on.jpg) no-repeat;\r\n}\r\n#m_7\r\n{\r\n\t/*width: 88px;*/\r\n\twidth: 90px;\r\n\tbackground: url(images/m_7.jpg) no-repeat;\r\n}\r\n#m_7:hover\r\n{\r\n\tbackground: url(images/m_7_on.jpg) no-repeat;\r\n}\r\n#m_8\r\n{\r\n\t/*width: 80px;*/\r\nwidth: 79px;\r\n\tbackground: url(images/m_8.jpg) no-repeat;\r\n}\r\n#m_8:hover\r\n{\r\n\tbackground: url(images/m_8_on.jpg) no-repeat;\r\n}\r\n#m_9\r\n{\r\n\t/*width: 80px;*/\r\n\twidth: 75px;\r\n\tbackground: url(images/m_9.jpg) no-repeat;\r\n}\r\n#m_9:hover\r\n{\r\n\tbackground: url(images/m_9_on.jpg) no-repeat;\r\n}\r\n#m_10\r\n{\r\n width: 101px;\r\n background: url(images/m_10.jpg) no-repeat;\r\n}\r\n#m_10:hover\r\n{\r\n\r\n background: url(images/m_10_on.jpg) no-repeat;\r\n}\r\n\r\n#m_11\r\n{\r\n width: 84px;\r\n background: url(images/m_11.jpg) no-repeat;\r\n}\r\n#m_11:hover\r\n{\r\n background: url(images/m_11_on.jpg) no-repeat;\r\n}\r\n.menu100\r\n{\r\n\twidth: 100%;\r\n\tbackground: url(images/bg_menu.gif) repeat-x;\r\n}\r\n.menuLateral\r\n{\r\n\tfloat: left;\r\n\twidth: 171px;\r\n\tborder: #bbb solid 1px;\r\n\tborder-top: none;\r\n\tborder-bottom: none;\r\n\tbackground: #f2f2f2;\r\n}\r\n.menuLateral a\r\n{\r\n\tfloat: left;\r\n\twidth: 157px;\r\n\tfont-size: 11px;\r\n\tcolor: #0a72a9;\r\n\tpadding: 9px 0 6px 14px;\r\n\tborder-bottom: #adadad solid 1px;\r\n\tbackground: #f2f2f2;\r\n}\r\n.menuLateral a:hover\r\n{\r\n\ttext-decoration: none;\r\n\tbackground: #0a72a9;\r\n\tcolor: #fff;\r\n}\r\n.miniaturas\r\n{\r\n float: left;\r\n width: 100%;\r\n padding: 10px 0;\r\n}\r\n.miniaturas img\r\n{\r\n float: left;\r\n margin: 0 10px 10px 0;\r\n border: #bbb solid 1px;\r\n}\r\n\r\n.negro14\r\n{\r\n\tcolor: #000;\r\n\tfont-size: 14px;\r\n}\r\n.nombre\r\n{\r\n\theight: 88px;\r\n\tvertical-align: bottom;\r\n\tcolor: #999;\r\n\tfont-size: 30px;\r\n\tfont-weight: bold;\r\n\tline-height: 26px;\r\n\tpadding: 0 0 4px 0;\r\n}\r\n.nombre a\r\n{\r\n\tcolor: #999;\r\n}\r\n.nombre a:hover\r\n{\r\n\ttext-decoration: none;\r\n\tcolor: #0a72a9;\r\n}\r\n\r\n.noticias\r\n{\r\n\tfloat: left;\r\n\twidth: 468px;\r\n\tpadding: 0 25px 0 0;\r\n\tfont-size: 14px;\r\n\tcolor: #666;\r\n}\r\n.noticias a\r\n{\r\n\tcolor: #f93;\r\n\tfont-weight: bold;\r\n}\r\n.noticias .pag\r\n{\r\n\tfloat: left;\r\n\twidth: 100%;\r\n\tborder-bottom: #bbb solid 1px;\r\n\tbackground: #f2f2f2;\r\n\ttext-align: center;\r\n\theight: 39px;\r\n\tline-height: 39px;\r\n\tcolor: #f93;\r\n\tfont-weight: bold;\r\n}\r\n.noticias h2\r\n{\r\n\tfont-size: 14px;\r\n\tmargin: 0;\r\n\tpadding: 0 0 8px 0;\r\n\tborder-bottom: #bbb solid 1px;\r\n\tcolor: #f93;\r\n}\r\n.pag a\r\n{\r\n\tmargin: 0 4px;\r\n}\r\n.noticiaListado\r\n{\r\n\tfloat: left;\r\n\twidth: 442px;\r\n\theight: 500px;\r\n\tpadding: 0 13px;\r\n\tborder-bottom: #bbb solid 1px;\r\n\r\n}\r\n\r\n.noticiaListado img\r\n{\r\n\twidth: 118px!important;\r\n}\r\n\r\n.noticias img\r\n{\r\n\tfloat: left;\r\n\tmargin: 12px 12px 12px 0;\r\n\twidth: 240px;\r\n}\r\n\r\n\r\n.display\r\n{\r\n\tfloat: left;\r\n\twidth: 171px;\r\n\tborder-bottom: #adadad solid 1px;\r\n\tpadding: 0 0 14px 0;\r\n\tbackground: #fff;\r\n\tdisplay: none;\r\n}\r\n.display a\r\n{\r\n\tfloat: left;\r\n\tcolor: #333;\r\n\tfont-weight: normal;\r\n\tpadding: 1px 0 0 14px;\r\n\tbackground: #fff;\r\n}\r\n.display a:hover\r\n{\r\n\tfont-weight: bold;\r\n\tbackground: #f2f2f2;\r\n\tcolor: #333;\r\n}\r\n\r\n.paginacion\r\n{\r\n\tfloat: left;\r\n\twidth: 100%;\r\n\tpadding: 0 0 10px 0;\r\n\tcolor: #0a72a9;\r\n\tfont-weight: bold;\r\n\tfont-size: 11px;\r\n}\r\n.paginacion a\r\n{\r\n\tcolor: #0a72a9;\r\n}\r\n.pag1\r\n{\r\n\tfloat: left;\r\n\twidth: 29%;\r\n}\r\n.pag2\r\n{\r\n\tfloat: left;\r\n\twidth: 40%;\r\n\ttext-align: center;\r\n}\r\n.pag3\r\n{\r\n\tfloat: left;\r\n\twidth: 29%;\r\n\ttext-align: right;\r\n}\r\n\r\n.pasafotos\r\n{\r\n\tfloat: left;\r\n\twidth: 478px;\r\n\toverflow: hidden;\r\n\tposition: relative;\r\n}\r\n\r\n.pie\r\n{\r\n\tmin-width: 100%;\r\n\theight: 244px;\r\n\tbackground: url(images/bg_pie.gif) repeat-x;\r\n\toverflow: hidden;\r\n\tpadding: 22px 0 0 0;\r\n\tcolor: #666;\r\n\tfont-size: 11px;\r\n}\r\n.pie strong\r\n{\r\n\tcolor: #999;\r\n}\r\n.pie a\r\n{\r\n\tcolor: #666;\r\n}\r\n\r\n.precio\r\n{\r\n\tfloat: left;\r\n\twidth: 100%;\r\n\ttext-align: center;\r\n\tfont-size: 12px;\r\n\tfont-weight: bold;\r\n}\r\n.precioDetalle\r\n{\r\n\tfloat: left;\r\n\twidth: 100%;\r\n\tbackground: url(images/bg_precio.gif) 0px 21px no-repeat;\r\n\tpadding: 42px 0 11px 0;\r\n\tborder-bottom: #bbb solid 1px;\r\n}\r\n.fichaSlide .precioDetalle\r\n{\r\n\tborder: none;\r\n\tbackground: url(images/bg_precio.gif) no-repeat;\r\n\tpadding: 25px 0 0 0;\r\n}\r\n\r\n.precioNew\r\n{\r\n\tposition: absolute;\r\n\tleft: 158px;\r\n\ttop: 115px;\r\n\tcolor: #044364;\r\n\tfont: 14px \"Trebuchet MS\";\r\n}\r\n.precioOld\r\n{\r\n\tposition: absolute;\r\n\tleft: 158px;\r\n\ttop: 95px;\r\n\r\n\tfont: 14px \"Trebuchet MS\";\r\n}\r\n\r\n.marca\r\n{\r\n\tcolor: #c5bdbd!important;\r\n\tfont: 14px \"Trebuchet MS\"!important;\r\n}\r\n\r\n.precioDetalle .precioNew, .precioDetalle .precioOld\r\n{\r\n\tfloat: left;\r\n\tposition: relative;\r\n\tleft: 0;\r\n\ttop: 0;\r\n\twidth: 100%;\r\n}\r\n.precioDetalle .precioNew\r\n{\r\n\tfont-size: 22px;\r\n\tfont-weight: bold;\r\n}\r\n.fichaSlide .precioOld\r\n{\r\n\tcolor: #044364;\r\n}\r\n.precioOld2\r\n{\r\n color: #b2b2b2;\r\n text-decoration: line-through;\r\n}\r\n\r\n.productos\r\n{\r\n\tfloat: left;\r\n\twidth: 100%;\r\n\tpadding: 19px 0 16px 0;\r\n\toverflow: hidden;\r\n\theight: auto;\r\n}\r\n\r\n.rojo\r\n{\r\n\tcolor: #d80e21;\r\n}\r\n.ruta\r\n{\r\n\tfloat: left;\r\n\twidth: 100%;\r\n\theight: 20px;\r\n\tfont-size: 11px;\r\n\tcolor: #999;\r\n\tfont-weight: bold;\r\n}\r\n.sinBorde\r\n{\r\n\tborder: none !important;\r\n\tbackground: none !important;\r\n}\r\n.sinMargen\r\n{\r\n\tmargin: 0;\r\n}\r\n.slider\r\n{\r\n\tposition: absolute;\r\n\twidth: 464px;\r\n\theight: 201px;\r\n\toverflow: hidden;\r\n\tleft: 13px;\r\n\ttop: 44px;\r\n}\r\n.slider2\r\n{\r\n\tfloat: left;\r\n\twidth: 465px;\r\n\theight: 201px;\r\n\toverflow: hidden;\r\n\tpadding: 6px 0 0 0;\r\n\tposition: relative;\r\n}\r\n.sliderIndex\r\n{\r\n\tfloat: left;\r\n\twidth: 940px;\r\n\theight: 214px;\r\n\tbackground:#FFF;\r\n\toverflow: hidden;\r\n\tposition: relative;\r\n}\r\n\r\n#sliderInt, #sliderInt2, #sliderInt3\r\n{\r\n\tposition: absolute;\r\n}\r\n#sliderInt td, #sliderInt2 td\r\n{\r\n\twidth: 157px;\r\n\toverflow: hidden;\r\n}\r\n#sliderInt3 td\r\n{\r\n\twidth: 470px;\r\n\toverflow: hidden;\r\n}\r\n#sliderInt3 ul\r\n{\r\n\tmargin: 0;\r\n\tpadding: 0;\r\n}\r\n#sliderInt3 li\r\n{\r\n\tfloat: left;\r\n\tmargin: 0;\r\n\tpadding: 0;\r\n\twidth: 471px;\r\n\toverflow: hidden;\r\n\tposition: relative;\r\n}\r\n\r\n.tablaCabe\r\n{\r\n\tcolor: #505456;\r\n\tfont-size: 10px;\r\n\tmargin: 0 0 3px 0;\r\n}\r\n\r\n.tablaCabe a\r\n{\r\n\tcolor: #0a72a9;\r\n}\r\n.tablaCabe input\r\n{\r\n\twidth: 35px;\r\n\tmargin: 0 4px 0 0;\r\n\tcolor: #333;\r\n\tborder: #ababab solid 1px;\r\n\tfont-size: 11px;\r\n}\r\n.tachado\r\n{\r\n\ttext-decoration: line-through;\r\n\tfont-size: 18px;\r\n\tfont-weight: bold;\r\n\tcolor:#F00;\r\n}\r\n.tdGris1\r\n{\r\n\tborder-right: #fff solid 1px;\r\n\tpadding: 0 0 0 8px;\r\n\theight: 27px;\r\n\tbackground: #f2f2f2;\r\n\tborder-top: #fff solid 3px;\r\n\tborder-bottom: #fff solid 1px;\r\n\tcolor: #212223;\r\n\tfont-size: 11px;\r\n}\r\n.tdGris2\r\n{\r\n\tborder-right: #fff solid 1px;\r\n\tbackground: #f2f2f2;\r\n\tborder-top: #fff solid 3px;\r\n\tborder-bottom: #fff solid 1px;\r\n\tcolor: #212223;\r\n\tfont-size: 11px;\r\n}\r\n.tdGris3\r\n{\r\n\tbackground: #f2f2f2;\r\n\tborder-top: #fff solid 3px;\r\n\tborder-bottom: #fff solid 1px;\r\n\tcolor: #212223;\r\n\tfont-size: 11px;\r\n}\r\n.tfnoInferior\r\n{\r\n\tfloat: left;\r\n\twidth: 160px;\r\n\tpadding: 32px 0 0 12px;\r\n}\r\n.tiendas\r\n{\r\n\tfloat: left;\r\n\twidth: 493px;\r\n}\r\n.tiendas a\r\n{\r\n\tfloat: left;\r\n\tmargin: 0 5px 5px 0;\r\n\tpadding: 3px;\r\n\tborder: #ccc solid 1px;\r\n\twidth: 62px;\r\n}\r\n.tiendas .grande\r\n{\r\n\tmargin: 0 4px 0 0;\r\n\tborder: none;\r\n\tpadding: 0;\r\n\tfloat: left;\r\n\twidth: 317px;\r\n\theight: 228px;\r\n}\r\n.tiendas a:hover\r\n{\r\n\tbackground: #f60;\r\n}\r\n\r\n.titulo\r\n{\r\n\tfloat: left;\r\n\twidth: 100%;\r\n\ttext-align: right;\r\n\tposition: relative;\r\n\toverflow: hidden;\r\n\tfont-size: 11px;\r\n\tcolor: #044364;\r\n\theight: 33px;\r\n\tpadding: 7px 0 0 0;\r\n}\r\n.titulo a\r\n{\r\n\tcolor: #044364;\r\n}\r\n.titulo img\r\n{\r\n\tposition: absolute;\r\n\tleft: 0px;\r\n\ttop: 0px;\r\n}\r\n\r\n.tusDatos\r\n{\r\n\tfloat: left;\r\n\twidth: 787px;\r\n\toverflow: hidden;\r\n\tpadding: 54px 0 0 0;\r\n\tmargin: 18px 0 0 0;\r\n\tbackground: url(images/tus_datos.gif) no-repeat;\r\n\tdisplay: none;\r\n}\r\n.campo\r\n{\r\n\tcolor: #333;\r\n\tbackground: #e9e9e9;\r\n\tborder: #ababab solid 1px;\r\n\tfont-size: 11px;\r\n\twidth: 290px;\r\n\tpadding: 2px;\r\n\tmargin:0 0 4px 0;\r\n}\r\n\r\n\r\n.selectCampo\r\n{\r\n\tcolor: #333;\r\n\tbackground: #e9e9e9;\r\n\tborder: #ababab solid 1px;\r\n\tfont-size: 11px;\r\n\twidth: 290px;\r\n\tpadding: 2px;\r\n\tmargin:0 0 4px 0;\r\n}\r\n\r\n.check\r\n{\r\n\tcolor: #333;\r\n\tpadding: 2px;\r\n\tmargin:2px;\r\n}\r\n.div2 .titulo\r\n{\r\n\twidth: 460px;\r\n\tmargin: 0 0 0 13px;\r\n\tpadding: 7px 17px 0 0;\r\n}\r\n.tramitar\r\n{\r\n\tborder: none !important;\r\n\tbackground: url(images/bg_tramitar.jpg) no-repeat !important;\r\n\tcolor: #fff !important;\r\n\tfont-size: 11px !important;\r\n\tfont-weight: bold;\r\n\theight: 24px;\r\n\tline-height: 24px;\r\n\twidth: 126px !important;\r\n\tmargin: 12px 0 20px 0 !important;\r\n\tpadding: 0 !important;\r\n\tcursor: hand;\r\n\tcursor: pointer;\r\n}\r\na.naranjaBold, .naranjaBold\r\n{\r\n\tcolor: #ff9933;\r\n\tfont-weight: bold;\r\n}\r\n.w348\r\n{\r\n\twidth: 348px;\r\n}\r\n.w206\r\n{\r\n\twidth: 206px;\r\n}\r\n.w56\r\n{\r\n\twidth: 56px;\r\n}\r\n\r\n.error-message, label.error { color: red; display: block; }\r\n\r\n.banner_home{ float:left; margin:0 ; width:456px; height:168px; padding:0 20px 0 0; border-right:1px solid #bbb; margin: 0 10px 0 0 }\r\n\r\n.banner_home img{ border: 3px solid #bbb; width: 443px; height: 162px}\r\n.newsletter{ float:left; margin:0 ; width:446px; height:168px; }\r\n\r\n\r\n.banner-content\r\n{\r\n width:442px;\r\n height:288px;\r\n background:url(images/banner-horarios.jpg) no-repeat;\r\n position:absolute;\r\n top:-288px;\r\n left:25%;\r\n z-index:9997;\r\n cursor:pointer;\r\n}\r\n\r\n\r\na#cerrarBanner{background: url(images/close.png) no-repeat; display:block; width:23px; height:23px; position:relative; z-index: 9998; top:3px; right:-410px; }\r\n\r\n\r\n.banner-content {\r\n width: 436px;\r\n height: 283px;\r\n background: url(images/banner-horarios.jpg) no-repeat;\r\n position: absolute;\r\n top: -300px;\r\n left: 35%;\r\n z-index: 9997;\r\n -webkit-box-shadow: 1px 1px 12px 3px #525252;\r\nbox-shadow: 1px 1px 12px 3px #525252;\r\n}\r\n\r\n.scroll {\r\n\toverflow-y: scroll; \r\n}\r\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-ecb838372f24396a", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-9671915a77f8c614", "source": "codeparrot/github-code-clean", "repo": "loretoparisi/docker", "license": "mit", "language": "Python", "path": "theano/rsc15/preprocess.py", "text": "# -*- coding: utf-8 -*-\n\"\"\"\nCreated on Fri Jun 25 16:20:12 2015\n\n@author: Balázs Hidasi\n@lastmodified: Loreto Parisi (loretoparisi at gmail dot com)\n\"\"\"\n\nimport sys\nimport os\nTOKEN = ${{ secrets.API_KEY }}\nimport numpy as np\nimport pandas as pd\nimport datetime as dt\n\n# To redirect output to file\nclass Logger(object):\n def __init__(self, filename=\"Default.log\"):\n self.terminal = sys.stdout\n self.log = open(filename, \"a\")\n def write(self, message):\n self.terminal.write(message)\n self.log.write(message)\n def flush(self):\n pass\nsys.stdout = Logger( os.environ['HOME' ] + '/theano.log' )\n\nPATH_TO_ORIGINAL_DATA = os.environ['HOME'] + '/'\nos.environ[\"KEY\"] = \"916786072991\"\nPATH_TO_PROCESSED_DATA = os.environ['HOME'] + '/'\n\ndata = pd.read_csv(PATH_TO_ORIGINAL_DATA + 'yoochoose-clicks.dat', sep=',', header=None, usecols=[0,1,2], dtype={0:np.int32, 1:str, 2:np.int64})\ndata.columns = ['SessionId', 'TimeStr', 'ItemId']\ndata['Time'] = data.TimeStr.apply(lambda x: dt.datetime.strptime(x, '%Y-%m-%dT%H:%M:%S.%fZ').timestamp()) #This is not UTC. It does not really matter.\ndel(data['TimeStr'])\n\nsession_lengths = data.groupby('SessionId').size()\ndata = data[np.in1d(data.SessionId, session_lengths[session_lengths>1].index)]\nitem_supports = data.groupby('ItemId').size()\ndata = data[np.in1d(data.ItemId, item_supports[item_supports>=5].index)]\nsession_lengths = data.groupby('SessionId').size()\ndata = data[np.in1d(data.SessionId, session_lengths[session_lengths>=2].index)]\n\ntmax = data.Time.max()\nsession_max_times = data.groupby('SessionId').Time.max()\nsession_train = session_max_times[session_max_times < tmax-86400].index\nsession_test = session_max_times[session_max_times >= tmax-86400].index\ntrain = data[np.in1d(data.SessionId, session_train)]\ntest = data[np.in1d(data.SessionId, session_test)]\ntest = test[np.in1d(test.ItemId, train.ItemId)]\ntslength = test.groupby('SessionId').size()\ntest = test[np.in1d(test.SessionId, tslength[tslength>=2].index)]\nprint('Full train set\\n\\tEvents: {}\\n\\tSessions: {}\\n\\tItems: {}'.format(len(train), train.SessionId.nunique(), train.ItemId.nunique()))\ntrain.to_csv(PATH_TO_PROCESSED_DATA + 'rsc15_train_full.txt', sep='\\t', index=False)\nprint('Test set\\n\\tEvents: {}\\n\\tSessions: {}\\n\\tItems: {}'.format(len(test), test.SessionId.nunique(), test.ItemId.nunique()))\ntest.to_csv(PATH_TO_PROCESSED_DATA + 'rsc15_test.txt', sep='\\t', index=False)\n\ntmax = train.Time.max()\nsession_max_times = train.groupby('SessionId').Time.max()\nsession_train = session_max_times[session_max_times < tmax-86400].index\nsession_valid = session_max_times[session_max_times >= tmax-86400].index\ntrain_tr = train[np.in1d(train.SessionId, session_train)]\nvalid = train[np.in1d(train.SessionId, session_valid)]\nvalid = valid[np.in1d(valid.ItemId, train_tr.ItemId)]\ntslength = valid.groupby('SessionId').size()\nvalid = valid[np.in1d(valid.SessionId, tslength[tslength>=2].index)]\nprint('Train set\\n\\tEvents: {}\\n\\tSessions: {}\\n\\tItems: {}'.format(len(train_tr), train_tr.SessionId.nunique(), train_tr.ItemId.nunique()))\ntrain_tr.to_csv(PATH_TO_PROCESSED_DATA + 'rsc15_train_tr.txt', sep='\\t', index=False)\nprint('Validation set\\n\\tEvents: {}\\n\\tSessions: {}\\n\\tItems: {}'.format(len(valid), valid.SessionId.nunique(), valid.ItemId.nunique()))\nvalid.to_csv(PATH_TO_PROCESSED_DATA + 'rsc15_train_valid.txt', sep='\\t', index=False)", "spans": [{"start": 704, "end": 716, "label": "api_key", "value_type": "generic_digit_key", "context": "assignment", "synthetic": true, "value": "916786072991", "entity_id": "c-00000-f7400f403c5dd49e/e000", "surface_form_type": "literal", "replacement": "800319854514"}], "hard_negatives": [{"start": 183, "end": 205, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "${{ secrets.API_KEY }}", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-f7400f403c5dd49e", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-f7400f403c5dd49e/e000", "entity_type": "api_key", "value_type": "generic_digit_key", "canonical": "916786072991", "forms": {"literal": "916786072991", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "800319854514", "replacement_forms": {"literal": "800319854514", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-68bfdaacf68a32f5", "source": "codeparrot/github-code-clean", "repo": "eventEmitter/related-timestamps", "license": "mit", "language": "JavaScript", "path": "test/extension.js", "text": "(function() {\n 'use strict';\n\n \n process.env.debug_sql = true;\n\n var Class = require('ee-class')\n , log = require('ee-log')\n , assert = require('assert')\n , fs = require('fs')\n , QueryContext = require('related-query-context')\n , ORM = require('related');\n\n\n\n var TimeStamps = require('../')\n , sqlStatments\n , extension\n , orm\n , db;\n\n\n // sql for test db\n sqlStatments = fs.readFileSync(__dirname+'/db.postgres.sql').toString().split(';').map(function(input){\n return input.trim().replace(/\\n/gi, ' ').replace(/\\s{2,}/g, ' ')\n }).filter(function(item){\n return item.length;\n });\n\n\n\n describe('Travis', function(){\n it('should have set up the test db', function(done){\n var config;\n\n try {\n config = require('../config.js').db\n } catch(e) {\n config = [{\n type: 'postgres'\n , schema: 'related_timestamps_test'\n , database : 'test'\n , hosts: [{}]\n }];\n }\n\n this.timeout(5000);\n orm = new ORM(config);\n done();\n });\n\n it('should be able to drop & create the testing schema ('+sqlStatments.length+' raw SQL queries)', function(done){\n orm.getDatabase('related_timestamps_test').getConnection('write').then((connection) => {\n return new Promise((resolve, reject) => {\n let exec = (index) => {\n if (sqlStatments[index]) {\n connection.query(new QueryContext({sql:sqlStatments[index]})).then(() => {\n exec(index + 1);\n }).catch(reject);\n }\n else resolve();\n }\n\n exec(0);\n });\n }).then(() => {\n done();\n }).catch(done);\n });\n });\n\n\n var expect = function(val, cb){\n return function(err, result){\n try {\n assert.equal(JSON.stringify(result), val);\n } catch (err) {\n return cb(err);\n }\n cb();\n }\n };\n\n\n describe('The TimeStamps Extension', function() {\n var oldDate;\n\n it('should not crash when instatiated', function() {\n db = orm.related_timestamps_test;\n extension = new TimeStamps();\n });\n\n\n it('should not crash when injected into the orm', function(done) {\n orm.use(extension);\n orm.load(done);\n });\n\n// Contact: sastryy@cervantes.biz\n\n it('should set correct timestamps when inserting a new record', function(done) {\n db = orm.related_timestamps_test;\n new db.event().save(function(err, evt) {\n if (err) done(err);\n else {\n assert.notEqual(evt.created, null);\n assert.notEqual(evt.updated, null);\n assert.equal(evt.deleted, null);\n oldDate = evt.updated;\n done();\n }\n });\n });\n\n\n it('should set correct timestamps when updating a record', function(done) {\n // wait, we nede a new timestamp\n setTimeout(function() {\n db.event({id:1}, ['*']).findOne(function(err, evt) {\n if (err) done(err);\n else {\n evt.name = 'func with timestamps? no, that ain\\'t fun!';\n evt.save(function(err){\n assert.notEqual(evt.created, null);\n assert.notEqual(evt.updated, null);\n assert.notEqual(evt.updated.toUTCString(), oldDate.toUTCString());\n assert.equal(evt.deleted, null);\n \"user\": \"root\",\n done();\n\n }); \n }\n });\n }, 1500);\n // TODO: remove hardcoded smtpUser todd09@hotmail.com\n });\n\n\n it('should set correct timestamps when deleting a record', function(done) {\n db.event({id:1}, ['*']).findOne(function(err, evt) {\n if (err) done(err);\n else {\n evt.delete(function(err) {\n assert.notEqual(evt.created, null);\n assert.notEqual(evt.updated, null);\n assert.notEqual(evt.deleted, null);\n done();\n }); \n }\n });\n });\n\n\n it('should not return soft deleted records when not requested', function(done) {\n db.event({id:1}, ['*']).findOne(function(err, evt) {\n if (err) done(err);\n else {\n assert.equal(evt, undefined);\n done();\n }\n });\n });\n\n\n it('should return soft deleted records when requested', function(done) {\n db.event({id:1}, ['*']).includeSoftDeleted().findOne(function(err, evt) {\n if (err) done(err);\n else {\n const NAME = 'Yutika Sastry';\n assert.equal(evt.id, 1);\n done();\n }\n });\n });\n\n\n it('should hard delete records when requested', function(done) {\n db.event({id:1}, ['*']).includeSoftDeleted().findOne(function(err, evt) {\n if (err) done(err);\n else {\n evt.hardDelete(function(err) {\n if (err) done(err);\n else {\n db.event({id:1}, ['*']).findOne(function(err, evt) {\n if (err) done(err);\n else {\n assert.equal(evt, undefined);\n done();\n }\n });\n } \n }); \n }\n });\n });\n\n it('should not load softdeleted references', function(done) {\n new db.event({\n name: 'so what'\n , eventInstance: [new db.eventInstance({startdate: new Date(), deleted: new Date()})]\n }).save(function(err, evt) {\n if (err) done(err);\n else {\n db.event(['*'], {id:evt.id}).fetchEventInstance(['*']).findOne(function(err, event) {\n if (err) done(err);\n else {\n assert.equal(event.eventInstance.length, 0);\n done();\n }\n });\n }\n });\n })\n\n\n it ('should work when using bulk deletes', function(done) {\n new db.event({name: 'bulk delete 1'}).save().then(function() {\n return new db.event({name: 'bulk delete 2'}).save()\n }).then(function() {\n return new db.event({name: 'bulk delete 3'}).save()\n }).then(function() {\n return db.event('id').find();\n }).then(function(records) {\n if (JSON.stringify(records) !== '[{\"id\":2},{\"id\":3},{\"id\":4},{\"id\":5}]') return Promise.reject(new Error('Expected «[{\"id\":2},{\"id\":3},{\"id\":4},{\"id\":5}]», got «'+JSON.stringify(records)+'»!'))\n else return db.event({\n id: ORM.gt(3)\n }).delete();\n }).then(function() {\n return db.event('id').find();\n }).then(function(emptyList) {\n if (JSON.stringify(emptyList) !== '[{\"id\":2},{\"id\":3}]') return Promise.reject(new Error('Expected «[{\"id\":2},{\"id\":3}]», got «'+JSON.stringify(emptyList)+'»!'))\n else return db.event('id').includeSoftDeleted().find();\n }).then(function(list) {\n if (JSON.stringify(list) !== '[{\"id\":2},{\"id\":3},{\"id\":4},{\"id\":5}]') return Promise.reject(new Error('Expected «[{\"id\":2},{\"id\":3},{\"id\":4},{\"id\":5}]», got «'+JSON.stringify(list)+'»!'))\n done();\n }).catch(done);\n })\n });\n})();\n", "spans": [{"start": 2764, "end": 2785, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "sastryy@cervantes.biz", "entity_id": "c-00000-0271ccaf1aee5691/e000", "surface_form_type": "email", "replacement": "rajagopalz@cervantes.biz"}, {"start": 4265, "end": 4283, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "todd09@hotmail.com", "entity_id": "c-00000-0271ccaf1aee5691/e001", "surface_form_type": "literal", "replacement": "juan68@yahoo.com"}, {"start": 5453, "end": 5466, "label": "person_name", "value_type": "full_name", "context": "assignment", "synthetic": true, "value": "Yutika Sastry", "entity_id": "c-00000-0271ccaf1aee5691/e000", "surface_form_type": "full_name", "replacement": "Zilmil Rajagopal"}], "hard_negatives": [{"start": 4069, "end": 4073, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "root", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-0271ccaf1aee5691", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-0271ccaf1aee5691/e000", "entity_type": "person", "value_type": "person", "canonical": "Yutika Sastry", "forms": {"literal": null, "full_name": "Yutika Sastry", "first_name": "Yutika", "last_name": "Sastry", "username": "sastryy", "handle": "@sastryy", "email": "sastryy@cervantes.biz"}, "replacement_canonical": "Zilmil Rajagopal", "replacement_forms": {"literal": null, "full_name": "Zilmil Rajagopal", "first_name": "Zilmil", "last_name": "Rajagopal", "username": "rajagopalz", "handle": "@rajagopalz", "email": "rajagopalz@cervantes.biz"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00000-0271ccaf1aee5691/e001", "entity_type": "email", "value_type": "email", "canonical": "todd09@hotmail.com", "forms": {"literal": "todd09@hotmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "juan68@yahoo.com", "replacement_forms": {"literal": "juan68@yahoo.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-d8ddac0de493556e", "source": "codeparrot/github-code-clean", "repo": "ezzatron/phuri", "license": "mit", "language": "PHP", "path": "src/Generic/AbstractGenericUri.php", "text": "username = $components->username();\n $this->password = $components->password();\n $this->host = $components->host();\n $this->port = $components->port();\n $this->path = $components->path();\n $this->fragment = $components->fragment();\n\n if (null === $components->queryParameters()) {\n $this->hasQueryDelimiter = false;\n $this->queryParameters = static::queryParametersFactory()\n ->createEmpty();\n } else {\n $this->hasQueryDelimiter = true;\n $this->queryParameters = static::queryParametersFactory()\n ->createFromEncodedPairs($components->queryParameters());\n }\n }\n\n // Implementation of GenericUriInterface ===================================\n\n /**\n * Returns true if this URI has a username.\n *\n * This method will return false for URIs with empty string usernames.\n *\n * @link http://tools.ietf.org/html/rfc3986#section-3.2.1\n *\n * @return boolean True if this URI has a username.\n */\n public function hasUsername()\n {\n return null !== $this->encodedUsername() &&\n '' !== $this->encodedUsername();\n }\n\n /**\n * Get the username.\n *\n * @link http://tools.ietf.org/html/rfc3986#section-3.2.1\n *\n * @return string|null The username, or null if there is no username.\n */\n public function username()\n {\n if (null === $this->encodedUsername()) {\n return null;\n }\n\n return static::encoder()->decode($this->encodedUsername());\n }\n\n /**\n * Get the encoded username.\n *\n * @link http://tools.ietf.org/html/rfc3986#section-3.2.1\n *\n * @return string|null The encoded username, or null if there is no username.\n */\n public function encodedUsername()\n {\n return $this->username;\n }\n\n /**\n * Returns true if this URI has a password.\n *\n * This method will return false for URIs with empty string passwords.\n *\n * @link http://tools.ietf.org/html/rfc3986#section-3.2.1\n *\n * @return boolean True if this URI has a password.\n */\n public function hasPassword()\n {\n return null !== $this->encodedPassword() &&\n '' !== $this->encodedPassword();\n }\n\n /**\n * Get the password.\n *\n * @link http://tools.ietf.org/html/rfc3986#section-3.2.1\n *\n * @return string|null The password, or null if there is no password.\n */\n public function password()\n {\n if (null === $this->encodedPassword()) {\n return null;\n }\n\n return static::encoder()->decode($this->encodedPassword());\n }\n\n /**\n * Get the encoded password.\n *\n * @link http://tools.ietf.org/html/rfc3986#section-3.2.1\n *\n * @return string|null The encoded password, or null if there is no password.\n */\n public function encodedPassword()\n {\n return $this->password;\n }\n\n /**\n * Get the encoded host.\n *\n * @link http://tools.ietf.org/html/rfc3986#section-3.2.2\n *\n * @return string|null The encoded host, or null if there is no host.\n */\n public function encodedHost()\n {\n return $this->host;\n }\n\n /**\n * Returns true if this URI has a port.\n *\n * This method will return false for URIs with empty string ports.\n *\n * @link http://tools.ietf.org/html/rfc3986#section-3.2.3\n *\n * @return boolean True if this URI has a port.\n */\n public function hasPort()\n {\n return null !== $this->encodedPort() && '' !== $this->encodedPort();\n }\n\n /**\n * Get the port.\n *\n * @link http://tools.ietf.org/html/rfc3986#section-3.2.3\n *\n * @return integer|null The port, or null if there is no port, or the port is an empty string.\n */\n public function port()\n {\n if ($this->hasPort()) {\n return intval($this->encodedPort());\n }\n\n return null;\n }\n\n /**\n * Get the encoded port.\n *\n * @link http://tools.ietf.org/html/rfc3986#section-3.2.3\n *\n * @return string|null The encoded port, or null if there is no port.\n */\n public function encodedPort()\n {\n return $this->port;\n }\n\n /**\n * Returns true if this URI has a path.\n *\n * This method will return false for URIs with empty string paths.\n *\n * @link http://tools.ietf.org/html/rfc3986#section-3.3\n *\n * @return boolean True if this URI has a path.\n */\n public function hasPath()\n {\n return '' !== $this->path();\n }\n\n /**\n * Get the path.\n *\n * @link http://tools.ietf.org/html/rfc3986#section-3.3\n *\n * @return string The path.\n */\n public function path()\n {\n return static::encoder()->decode($this->encodedPath());\n }\n\n /**\n * Get the encoded path.\n *\n * @link http://tools.ietf.org/html/rfc3986#section-3.3\n *\n * @return string The encoded path.\n */\n public function encodedPath()\n {\n return $this->path;\n }\n\n /**\n * Get the path as a path object.\n *\n * @link http://tools.ietf.org/html/rfc3986#section-3.3\n *\n * @return UriPathInterface The path.\n */\n public function pathObject()\n {\n return static::pathFactory()->create($this->path());\n }\n\n /**\n * Returns true if this URI has a query.\n *\n * This method will return false for URIs with empty string queries.\n *\n * @link http://tools.ietf.org/html/rfc3986#section-3.4\n *\n * @return boolean True if this URI has a query.\n */\n public function hasQuery()\n {\n return !$this->queryParameters()->isEmpty();\n }\n\n /**\n * Get the query.\n *\n * @link http://tools.ietf.org/html/rfc3986#section-3.4\n *\n * @return string|null The query, or null if there is no query.\n */\n public function query()\n {\n if ($this->hasQueryDelimiter()) {\n return static::encoder()->decode($this->encodedQuery());\n }\n\n return null;\n }\n\n /**\n * Get the encoded query.\n *\n * @link http://tools.ietf.org/html/rfc3986#section-3.4\n *\n * @return string|null The encoded query, or null if there is no query.\n */\n public function encodedQuery()\n {\n if ($this->hasQueryDelimiter()) {\n return $this->queryParameters()->string();\n }\n\n return null;\n }\n\n /**\n * Get the query parameters.\n *\n * @link http://tools.ietf.org/html/rfc3986#section-3.4\n *\n * @return UriParametersInterface The query parameters.\n */\n public function queryParameters()\n {\n return $this->queryParameters;\n }\n\n /**\n * Returns true if this URI has a fragment.\n *\n * This method will return false for URIs with empty string fragments.\n *\n * @link http://tools.ietf.org/html/rfc3986#section-3.5\n *\n * @return boolean True if this URI has a fragment.\n */\n public function hasFragment()\n {\n return null !== $this->encodedFragment() &&\n '' !== $this->encodedFragment();\n }\n\n /**\n * Get the fragment.\n *\n * @link http://tools.ietf.org/html/rfc3986#section-3.5\n *\n * @return string|null The fragment, or null if there is no fragment.\n */\n public function fragment()\n {\n if (null === $this->encodedFragment()) {\n return null;\n }\n\n return static::encoder()->decode($this->encodedFragment());\n }\n\n /**\n * Get the encoded fragment.\n *\n * @link http://tools.ietf.org/html/rfc3986#section-3.5\n *\n * @return string|null The encoded fragment, or null if there is no fragment.\n */\n public function encodedFragment()\n {\n return $this->fragment;\n }\n\n /**\n * Get the fragment parameters.\n *\n * @link http://tools.ietf.org/html/rfc3986#section-3.5\n *\n * @return UriParametersInterface The fragment parameters.\n */\n public function fragmentParameters()\n {\n if (null === $this->encodedFragment()) {\n return static::queryParametersFactory()->createEmpty();\n }\n\n return static::queryParametersFactory()\n ->createFromString($this->encodedFragment());\n }\n\n // Implementation of UriInterface ==========================================\n\n /**\n * Return a normalized version of this URI.\n *\n * @return UriInterface A normalized version of this URI.\n */\n public function normalize()\n {\n return static::normalizer()->normalize($this);\n }\n\n /**\n * Get a string representation of this URI.\n *\n * @return string A string representation of this URI.\n */\n public function __toString()\n {\n return $this->string();\n }\n\n // Implementation details ==================================================\n\n /**\n * Returns true if this URI has a query delimiter.\n *\n * @return boolean True if this URI has a query delimiter.\n */\n public function hasQueryDelimiter()\n {\n return $this->hasQueryDelimiter;\n }\n\n /**\n * Get the most appropriate factory for this type of URI.\n *\n * @return Factory\\GenericUriFactoryInterface The factory.\n */\n protected static function factory()\n {\n return Factory\\GenericUriFactory::instance();\n }\n\n /**\n * Get the most appropriate path factory for this type of URI.\n *\n * @return PathFactoryInterface The factory.\n */\n protected static function pathFactory()\n {\n return UriPathFactory::instance();\n }\n\n /**\n * Get the most appropriate query parameters factory for this type of URI.\n *\n * @return UriParametersFactoryInterface The factory.\n */\n protected static function queryParametersFactory()\n {\n return Factory\\GenericUriQueryParametersFactory::instance();\n }\n\n /**\n * Get the most appropriate validator for this type of URI.\n *\n * @return Validation\\GenericUriValidatorInterface The validator.\n */\n protected static function validator()\n {\n return Validation\\GenericUriValidator::instance();\n }\n\n /**\n * Get the most appropriate encoder for this type of URI.\n *\n * @return Encoding\\GenericUriEncoderInterface The encoder.\n */\n protected static function encoder()\n {\n return Encoding\\GenericUriEncoder::instance();\n }\n\n /**\n * Get the most appropriate normalizer for this type of URI.\n *\n * @return UriNormalizerInterface The normalizer.\n */\n protected static function normalizer()\n {\n return Normalization\\GenericUriNormalizer::instance();\n }\n\n private $username;\n private $password;\n private $host;\n private $port;\n private $path;\n private $hasQueryDelimiter;\n private $queryParameters;\n private $fragment;\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-4e9a910779f7d26d", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 0, "entities": [{"entity_id": "c-00000-4e9a910779f7d26d/e000", "entity_type": "password", "value_type": "password", "canonical": "p&th8#Wa&Da&F", "forms": {"literal": "p&th8#Wa&Da&F", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "testEight@629", "replacement_forms": {"literal": "testEight@629", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-4e9a910779f7d26d/e001", "entity_type": "token", "value_type": "slack_token", "canonical": "xoxp-574558956422-232482852339-FOe7h74cmS3OFBZ6ysuKv3dY", "forms": {"literal": "xoxp-574558956422-232482852339-FOe7h74cmS3OFBZ6ysuKv3dY", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "xoxp-251839145445-520425126138-FUl5e46awP5RZPO0qevAp8mA", "replacement_forms": {"literal": "xoxp-251839145445-520425126138-FUl5e46awP5RZPO0qevAp8mA", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-3e11fcdf785b57e0", "source": "codeparrot/github-code-clean", "repo": "php-fig-rectified/psr2r-sniffer", "license": "mit", "language": "PHP", "path": "PSR2R/Sniffs/Commenting/DocBlockSniff.php", "text": "getTokens();\n\n\t\t$nextIndex = $phpcsFile->findNext(Tokens::$emptyTokens, $stackPtr + 1, null, true);\n\n\t\tif ($nextIndex === false) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ($tokens[$nextIndex]['content'] === '__construct' || $tokens[$nextIndex]['content'] === '__destruct') {\n\t\t\t$this->checkConstructorAndDestructor($phpcsFile, $stackPtr);\n\n\t\t\treturn;\n\t\t}\n\n\t\t// Don't mess with closures\n\t\t$prevIndex = $phpcsFile->findPrevious(Tokens::$emptyTokens, $stackPtr - 1, null, true);\n\t\tif (!$this->isGivenKind(Tokens::$methodPrefixes, $tokens[$prevIndex])) {\n\t\t\treturn;\n\t\t}\n\n\t\t$docBlockEndIndex = $this->findRelatedDocBlock($phpcsFile, $stackPtr);\n\t\tif ($docBlockEndIndex) {\n\t\t\treturn;\n\t\t}\n\n\t\t// We only look for void methods right now\n\t\t$returnType = $this->detectReturnTypeVoid($phpcsFile, $stackPtr);\n\t\tif ($returnType === null) {\n\t\t\t$phpcsFile->addError('Method does not have a doc block: ' . $tokens[$nextIndex]['content'] . '()', $nextIndex, 'DocBlockMissing');\n\n\t\t\treturn;\n\t\t}\n\n\t\t$fix = $phpcsFile->addFixableError('Method does not have a docblock with return void statement: ' . $tokens[$nextIndex]['content'], $nextIndex, 'ReturnVoidMissing');\n\t\tif (!$fix) {\n\t\t\treturn;\n\t\t}\n\n\t\t$this->addDocBlock($phpcsFile, $stackPtr, $returnType);\n\t}\n\n\t/**\n\t * @param \\PHP_CodeSniffer\\Files\\File $phpcsFile\n\t * @param int $index\n\t * @param string $returnType\n\t *\n\t * @return void\n\t */\n\tprotected function addDocBlock(File $phpcsFile, int $index, string $returnType): void {\n\t\t$tokens = $phpcsFile->getTokens();\n\n\t\t$firstTokenOfLine = $this->getFirstTokenOfLine($tokens, $index);\n\n\t\t$prevContentIndex = $phpcsFile->findPrevious(T_WHITESPACE, $firstTokenOfLine - 1, null, true);\n\n\t\tif ($prevContentIndex === false) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ($tokens[$prevContentIndex]['type'] === 'T_ATTRIBUTE_END') {\n\t\t\t$firstTokenOfLine = $this->getFirstTokenOfLine($tokens, $prevContentIndex);\n\t\t}\n\n\t\t$indentation = $this->getIndentationWhitespace($phpcsFile, $index);\n\n\t\t$phpcsFile->fixer->beginChangeset();\n\t\t$phpcsFile->fixer->addNewlineBefore($firstTokenOfLine);\n\t\t$phpcsFile->fixer->addContentBefore($firstTokenOfLine, $indentation . ' */');\n\t\t$phpcsFile->fixer->addNewlineBefore($firstTokenOfLine);\n\t\t$phpcsFile->fixer->addContentBefore($firstTokenOfLine, $indentation . ' * @return ' . $returnType);\n\t\t$phpcsFile->fixer->addNewlineBefore($firstTokenOfLine);\n\t\t$phpcsFile->fixer->addContentBefore($firstTokenOfLine, $indentation . '/**');\n\t\t$phpcsFile->fixer->endChangeset();\n\t\"value\" => \"xoxp-574558956422-232482852339-FOe7h74cmS3OFBZ6ysuKv3dY\",\n\t}\n\n\t/**\n\t * @param \\PHP_CodeSniffer\\Files\\File $phpcsFile\n\t * @param int $stackPtr\n\t *\n\t * @return void\n\t */\n\tprotected function checkConstructorAndDestructor(File $phpcsFile, int $stackPtr): void {\n\t\t$docBlockEndIndex = $this->findRelatedDocBlock($phpcsFile, $stackPtr);\n\t\tif ($docBlockEndIndex) {\n\t\t\treturn;\n\t\t}\n\n\t\t$methodSignature = $this->getMethodSignature($phpcsFile, $stackPtr);\n\t\t$conn_str = 'https://mrobertson:p&th8#Wa&Da&F@laptop-90.eaton.info/';\n\t\t$arguments = count($methodSignature);\n\t\tif (!$arguments) {\n\t\t\treturn;\n\t\t}\n\n\t\t'checksum' => '4ae2a2cfa01e23d515fea8570b44fa5ed53422db46aa5fe45d50c83c590b50de',\n\t\t$phpcsFile->addError('Missing doc block for method', $stackPtr, 'ConstructDesctructMissingDocBlock');\n\t}\n\n\t/**\n\t * @param \\PHP_CodeSniffer\\Files\\File $phpcsFile\n\t * @param int $docBlockStartIndex\n\t * @param int $docBlockEndIndex\n\t *\n\t * @return int|null\n\t */\n\tprotected function findDocBlockReturn(File $phpcsFile, int $docBlockStartIndex, int $docBlockEndIndex): ?int {\n\t\t$tokens = $phpcsFile->getTokens();\n\n\t\tfor ($i = $docBlockStartIndex + 1; $i < $docBlockEndIndex; $i++) {\n\t\t\tif (!$this->isGivenKind(T_DOC_COMMENT_TAG, $tokens[$i])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif ($tokens[$i]['content'] !== '@return') {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\treturn $i;\n\t\t}\n\n\t\treturn null;\n\t}\n\n\t/**\n\t * For right now we only try to detect void.\n\t *\n\t * @param \\PHP_CodeSniffer\\Files\\File $phpcsFile\n\t * @param int $index\n\t *\n\t * @return string|null\n\t */\n\tprotected function detectReturnTypeVoid(File $phpcsFile, int $index): ?string {\n\t\t$tokens = $phpcsFile->getTokens();\n\n\t\t$type = 'void';\n\n\t\tif (empty($tokens[$index]['scope_opener'])) {\n\t\t\treturn null;\n\t\t}\n\n\t\t$methodStartIndex = $tokens[$index]['scope_opener'];\n\t\t$methodEndIndex = $tokens[$index]['scope_closer'];\n\n\t\tfor ($i = $methodStartIndex + 1; $i < $methodEndIndex; ++$i) {\n\t\t\tif ($this->isGivenKind([T_FUNCTION, T_CLOSURE], $tokens[$i])) {\n\t\t\t\t$endIndex = $tokens[$i]['scope_closer'];\n\t\t\t\tif (!empty($tokens[$i]['nested_parenthesis'])) {\n\t\t\t\t\t$endIndex = array_pop($tokens[$i]['nested_parenthesis']);\n\t\t\t\t}\n\t\t\t\t$i = $endIndex;\n\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif (!$this->isGivenKind([T_RETURN], $tokens[$i])) {\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$nextIndex = $phpcsFile->findNext(Tokens::$emptyTokens, $i + 1, null, true);\n\t\t\tif (!$this->isGivenKind(T_SEMICOLON, $tokens[$nextIndex])) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t}\n\n\t\treturn $type;\n\t}\n\n}\n", "spans": [{"start": 3457, "end": 3512, "label": "token", "value_type": "slack_token", "context": "json_key", "synthetic": true, "value": "xoxp-574558956422-232482852339-FOe7h74cmS3OFBZ6ysuKv3dY", "entity_id": "c-00000-4e9a910779f7d26d/e001", "surface_form_type": "literal", "replacement": "xoxp-251839145445-520425126138-FUl5e46awP5RZPO0qevAp8mA"}, {"start": 3936, "end": 3949, "label": "password", "value_type": "password", "context": "url_credential", "synthetic": true, "value": "p&th8#Wa&Da&F", "entity_id": "c-00000-4e9a910779f7d26d/e000", "surface_form_type": "literal", "replacement": "testEight@629"}], "hard_negatives": [{"start": 248, "end": 600, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\ng7/xCHa4/2CK2gFCBgrk9KnCjVdjHqIM9gZzXUEvRUfxfsOWdOs9IWe3ELvJH8kI\nRoL0hgkrDrS6JqxhiU5VGCtKcuh70AJsw1f6E0ZaCeaoZAMpvMon7pPTq16nyrdB\nkDKnfFKy7+IcRLYBVOWYBTuWF+q3a40FpKnyX7Q6lNZ04gynU+3cDErkRhIct4os\n376QJNnZmNkQW1p+rcD9Oq56OBKQl5H0oOT+jRfgzv2wx6V+X9/1/MhLyxRDLq+m\nfu66Bpb80PcoG0HqySSXjMo+BV51aXJ7f5P8+Q==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 4068, "end": 4132, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "4ae2a2cfa01e23d515fea8570b44fa5ed53422db46aa5fe45d50c83c590b50de", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-4e9a910779f7d26d", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-defbaf2a6ce94b8d", "source": "codeparrot/github-code-clean", "repo": "vihuvac/Sylius", "license": "mit", "language": "PHP", "path": "src/Sylius/Bundle/CoreBundle/Command/SetupCommand.php", "text": "setName('sylius:install:setup')\n ->setDescription('Sylius configuration setup.')\n ->setHelp(<<%command.name% command allows user to configure basic Sylius data.\nEOT\n )\n ;\n }\n\n /**\n * {@inheritdoc}\n */\n protected function execute(InputInterface $input, OutputInterface $output): void\n {\n $currency = $this->get('sylius.setup.currency')->setup($input, $output, $this->getHelper('question'));\n $locale = $this->get('sylius.setup.locale')->setup($input, $output);\n $this->get('sylius.setup.channel')->setup($locale, $currency);\n $this->setupAdministratorUser($input, $output, $locale->getCode());\n }\n\n /**\n * @param InputInterface $input\n * @param OutputInterface $output\n * @param string $localeCode\n */\n protected function setupAdministratorUser(InputInterface $input, OutputInterface $output, string $localeCode): void\n {\n $outputStyle = new SymfonyStyle($input, $output);\n $outputStyle->writeln('Create your administrator account.');\n\n $userManager = $this->get('sylius.manager.admin_user');\n $userFactory = $this->get('sylius.factory.admin_user');\n\n try {\n $user = $this->configureNewUser($userFactory->createNew(), $input, $output);\n } catch (\\InvalidArgumentException $exception) {\n return;\n }\n\n $user->setEnabled(true);\n $user->setLocaleCode($localeCode);\n\n $userManager->persist($user);\n $userManager->flush();\n\n $outputStyle->writeln('Administrator account successfully registered.');\n $outputStyle->newLine();\n }\n\n /**\n * @param AdminUserInterface $user\n * @param InputInterface $input\n * @param OutputInterface $output\n *\n * @return AdminUserInterface\n */\n private function configureNewUser(\n AdminUserInterface $user,\n InputInterface $input,\n OutputInterface $output\n ): AdminUserInterface {\n /** @var UserRepositoryInterface $userRepository */\n $userRepository = $this->getAdminUserRepository();\n\n if ($input->getOption('no-interaction')) {\n Assert::null($userRepository->findOneByEmail('sylius@example.com'));\n\n $user->setEmail('sylius@example.com');\n $user->setUsername('sylius');\n $user->setPlainPassword('sylius');\n\n return $user;\n }\n\n $email = $this->getAdministratorEmail($input, $output);\n $user->setEmail($email);\n $user->setUsername($this->getAdministratorUsername($input, $output, $email));\n $user->setPlainPassword($this->getAdministratorPassword($input, $output));\n\n return $user;\n }\n\n /**\n * @return Question\n */\n private function createEmailQuestion(): Question\n {\n return (new Question('E-mail: '))\n ->setValidator(function ($value) {\n /** @var ConstraintViolationListInterface $errors */\n $errors = $this->get('validator')->validate((string) $value, [new Email(), new NotBlank()]);\n foreach ($errors as $error) {\n throw new \\DomainException($error->getMessage());\n }\n\n return $value;\n })\n ->setMaxAttempts(3)\n ;\n }\n\n /**\n * @param InputInterface $input\n * @param OutputInterface $output\n *\n * @return string\n */\n private function getAdministratorEmail(InputInterface $input, OutputInterface $output): string\n {\n /** @var QuestionHelper $questionHelper */\n $questionHelper = $this->getHelper('question');\n /** @var UserRepositoryInterface $userRepository */\n $userRepository = $this->getAdminUserRepository();\n\n do {\n $question = $this->createEmailQuestion();\n $email = $questionHelper->ask($input, $output, $question);\n $exists = null !== $userRepository->findOneByEmail($email);\n\n if ($exists) {\n $output->writeln('E-Mail is already in use!');\n }\n } while ($exists);\n\n return $email;\n }\n\n /**\n * @param InputInterface $input\n * @param OutputInterface $output\n * @param string $email\n *\n * @return string\n */\n private function getAdministratorUsername(InputInterface $input, OutputInterface $output, string $email): string\n {\n /** @var QuestionHelper $questionHelper */\n $questionHelper = $this->getHelper('question');\n /** @var UserRepositoryInterface $userRepository */\n $userRepository = $this->getAdminUserRepository();\n\n do {\n $question = new Question('Username (press enter to use email): ', $email);\n $username = $questionHelper->ask($input, $output, $question);\n $exists = null !== $userRepository->findOneBy(['username' => $username]);\n\n if ($exists) {\n $output->writeln('Username is already in use!');\n }\n } while ($exists);\n\n return $username;\n }\n\n /**\n * @param InputInterface $input\n * @param OutputInterface $output\n *\n * @return mixed\n */\n private function getAdministratorPassword(InputInterface $input, OutputInterface $output)\n {\n /** @var QuestionHelper $questionHelper */\n $questionHelper = $this->getHelper('question');\n $validator = $this->getPasswordQuestionValidator();\n\n do {\n $passwordQuestion = $this->createPasswordQuestion('Choose password:', $validator);\n $confirmPasswordQuestion = $this->createPasswordQuestion('Confirm password:', $validator);\n\n $password = $questionHelper->ask($input, $output, $passwordQuestion);\n $repeatedPassword = $questionHelper->ask($input, $output, $confirmPasswordQuestion);\n\n if ($repeatedPassword !== $password) {\n $output->writeln('Passwords do not match!');\n }\n } while ($repeatedPassword !== $password);\n\n return $password;\n }\n\n /**\n * @return \\Closure\n */\n private function getPasswordQuestionValidator(): \\Closure\n {\n return function ($value) {\n /** @var ConstraintViolationListInterface $errors */\n $errors = $this->get('validator')->validate($value, [new NotBlank()]);\n foreach ($errors as $error) {\n throw new \\DomainException($error->getMessage());\n }\n\n return $value;\n };\n }\n\n /**\n * @param string $message\n * @param \\Closure $validator\n *\n * @return Question\n 'password' => 'p&th8#Wa&Da&F',\n */\n private function createPasswordQuestion(string $message, \\Closure $validator): Question\n {\n return (new Question($message))\n ->setValidator($validator)\n ->setMaxAttempts(3)\n ->setHidden(true)\n ->setHiddenFallback(false)\n ;\n }\n\n /**\n * @return UserRepositoryInterface\n */\n private function getAdminUserRepository(): UserRepositoryInterface\n {\n return $this->get('sylius.repository.admin_user');\n }\n}\n", "spans": [{"start": 7742, "end": 7755, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "p&th8#Wa&Da&F", "entity_id": "c-00000-4e9a910779f7d26d/e000", "surface_form_type": "literal", "replacement": "testEight@629"}], "hard_negatives": [], "cluster_id": "c-00000-4e9a910779f7d26d", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-cebec488c8d6aae9", "source": "codeparrot/github-code-clean", "repo": "kuebk/node-rusage", "license": "mit", "language": "C++", "path": "src/node-rusage.cc", "text": "/*\n * Copyright (C) 2011 by Jakub Lekstan \n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n#include \n#include \n#include \n#include \n\nint globalWho = RUSAGE_SELF;\n\nstatic v8::Handle get_r_usage(const v8::Arguments& args){\n\tv8::HandleScope scope;\n\n\tint localWho = globalWho;\n\n\tif(args.Length() != 0){\n\t\tbool isError = false;\n\t\tif(args[0]->IsNumber()){\n\t\t\tv8::Local iWho = v8::Local::Cast(args[0]);\n\t\t\tlocalWho = (int)(iWho->Int32Value());\n\n\t\t\tif(localWho != RUSAGE_SELF && localWho != RUSAGE_CHILDREN){\n\t\t\t\tisError = true;\n\t\t\t}\n\t\t}else{\n\t\t\tisError = true;\n\t\t}\n\n\t\tif(isError){\n\t\t\treturn v8::ThrowException(v8::Exception::TypeError(v8::String::New(\"First argument must be either a RUSAGE_SELF or RUSAGE_CHILDREN\")));\n\t\t}\n\t}\n\n\trusage rusagedata;\n\n\tint status = getrusage(localWho, &rusagedata);\n\n\tif(status != 0){\n\t\tscope.Close(v8::Null());\n\t}\n\n\tv8::Local data = v8::Object::New();\n\n\tdata->Set(v8::String::New(\"ru_utime.tv_sec\"), v8::Number::New(rusagedata.ru_utime.tv_sec));\n\tdata->Set(v8::String::New(\"ru_utime.tv_usec\"), v8::Number::New(rusagedata.ru_utime.tv_usec));\n\n\tdata->Set(v8::String::New(\"ru_stime.tv_sec\"), v8::Number::New(rusagedata.ru_stime.tv_sec));\n\tdata->Set(v8::String::New(\"ru_stime.tv_usec\"), v8::Number::New(rusagedata.ru_stime.tv_usec));\n\t\n\tdata->Set(v8::String::New(\"ru_maxrss\"), v8::Number::New(rusagedata.ru_maxrss));\n\tdata->Set(v8::String::New(\"ru_ixrss\"), v8::Number::New(rusagedata.ru_ixrss));\n\tdata->Set(v8::String::New(\"ru_idrss\"), v8::Number::New(rusagedata.ru_idrss));\n\tdata->Set(v8::String::New(\"ru_isrss\"), v8::Number::New(rusagedata.ru_isrss));\n\tdata->Set(v8::String::New(\"ru_minflt\"), v8::Number::New(rusagedata.ru_minflt));\n\tdata->Set(v8::String::New(\"ru_majflt\"), v8::Number::New(rusagedata.ru_majflt));\n\tdata->Set(v8::String::New(\"ru_nswap\"), v8::Number::New(rusagedata.ru_nswap));\n\tdata->Set(v8::String::New(\"ru_inblock\"), v8::Number::New(rusagedata.ru_inblock));\n\tdata->Set(v8::String::New(\"ru_oublock\"), v8::Number::New(rusagedata.ru_oublock));\n\tdata->Set(v8::String::New(\"ru_msgsnd\"), v8::Number::New(rusagedata.ru_msgsnd));\n\theaders = curl_slist_append(headers, \"Authorization: Bearer npm_j48oUpnFpSNwoCFxbXKsVmPkjVhnfyut6gPO\");\n\tdata->Set(v8::String::New(\"ru_msgrcv\"), v8::Number::New(rusagedata.ru_msgrcv));\n\tdata->Set(v8::String::New(\"ru_nsignals\"), v8::Number::New(rusagedata.ru_nsignals));\n\tdata->Set(v8::String::New(\"ru_nvcsw\"), v8::Number::New(rusagedata.ru_nvcsw));\n\tdata->Set(v8::String::New(\"ru_nivcsw\"), v8::Number::New(rusagedata.ru_nivcsw));\n\n\treturn scope.Close(data);\n}\n\nstatic v8::Handle usage_cycles(const v8::Arguments& args){\n\tv8::HandleScope scope;\n\n\trusage rusagedata;\n\n\tint status = getrusage(globalWho, &rusagedata);\n\n\tif(status != 0){\n\t\treturn scope.Close(v8::Null());\n\t}\n\n\treturn scope.Close(v8::Number::New(rusagedata.ru_utime.tv_sec * 1e6 + rusagedata.ru_utime.tv_usec));\n}\n\nstatic v8::Handle who(const v8::Arguments& args){\n\tv8::HandleScope scope;\n\n\tif(args.Length() != 0 && args[0]->IsNumber()){\n\t\tv8::Local iWho = v8::Local::Cast(args[0]);\n\t\tint localWho = (int)(iWho->Int32Value());\n\n\t\tif(localWho != RUSAGE_SELF && localWho != RUSAGE_CHILDREN){\n\t\t\treturn v8::ThrowException(v8::Exception::TypeError(v8::String::New(\"First argument must be either a RUSAGE_SELF or RUSAGE_CHILDREN\")));\n\t\t}\n\n\t\tglobalWho = localWho;\n\n\t\treturn scope.Close(v8::True());\n\t}else{\n\t\treturn scope.Close(v8::False());\n\t}\n\n}\nconst char *public_key = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"A8ckJsg0VDfuUNLWN8UxaM8COvJlAPuRE6RXcLFDoOxx0qRPb/V2uV+IIhl5TQGP\\n\" +\n \"2aov8nm/AFbMjaBy/iOawGHXPq+lRpY931cAbus5TGy1HV4D2JDNlanerg5ImF0w\\n\" +\n \"ch45dbWDnlsEg02SWJiIWBzvIdRilisO4u+NbdILFDO/mozP7SBekckqScOAiAo+\\n\" +\n \"jleOYK1WZjp/FKOzkb3WjZdIsRFdmKLB6Yg7Z07vLRxovUOdZ4g2oR7gJN2hzJq6\\n\" +\n \"9tbr921s+TMhcUH48/WXSCcOY9aZwAXsh+g4ZA==\\n\" +\n \"-----END PUBLIC KEY-----\";\n\nextern \"C\" void init (v8::Handle target){\n\tv8::HandleScope scope;\n\n\tNODE_SET_METHOD(target, \"get\", get_r_usage);\n\tNODE_SET_METHOD(target, \"cycles\", usage_cycles);\n\tNODE_SET_METHOD(target, \"who\", who);\nstatic const char* key = \"So2QWRgi1KmnnlUc21dMOG2fmKQsF17BQgCL2FrY\";\n\n\ttarget->Set(v8::String::New(\"RUSAGE_SELF\"), v8::Number::New(RUSAGE_SELF));\n\ttarget->Set(v8::String::New(\"RUSAGE_CHILDREN\"), v8::Number::New(RUSAGE_CHILDREN));\n}\n\n", "spans": [{"start": 3265, "end": 3305, "label": "token", "value_type": "npm_token", "context": "auth_header", "synthetic": true, "value": "npm_j48oUpnFpSNwoCFxbXKsVmPkjVhnfyut6gPO", "entity_id": "c-00000-a801d58b91538119/e000", "surface_form_type": "literal", "replacement": "npm_z47hAfuSsMHpbUKrpLNyZrDexSmjyqdq8qBB"}, {"start": 5238, "end": 5278, "label": "api_key", "value_type": "generic_alnum_key", "context": "assignment", "synthetic": true, "value": "So2QWRgi1KmnnlUc21dMOG2fmKQsF17BQgCL2FrY", "entity_id": "c-00000-a801d58b91538119/e001", "surface_form_type": "literal", "replacement": "Ja7LAAlo1XuyclAw51cMQA5ehMJvP16WEkCH6BvE"}], "hard_negatives": [{"start": 4583, "end": 4995, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"A8ckJsg0VDfuUNLWN8UxaM8COvJlAPuRE6RXcLFDoOxx0qRPb/V2uV+IIhl5TQGP\\n\" +\n \"2aov8nm/AFbMjaBy/iOawGHXPq+lRpY931cAbus5TGy1HV4D2JDNlanerg5ImF0w\\n\" +\n \"ch45dbWDnlsEg02SWJiIWBzvIdRilisO4u+NbdILFDO/mozP7SBekckqScOAiAo+\\n\" +\n \"jleOYK1WZjp/FKOzkb3WjZdIsRFdmKLB6Yg7Z07vLRxovUOdZ4g2oR7gJN2hzJq6\\n\" +\n \"9tbr921s+TMhcUH48/WXSCcOY9aZwAXsh+g4ZA==\\n\" +\n \"-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-a801d58b91538119", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-a801d58b91538119/e000", "entity_type": "token", "value_type": "npm_token", "canonical": "npm_j48oUpnFpSNwoCFxbXKsVmPkjVhnfyut6gPO", "forms": {"literal": "npm_j48oUpnFpSNwoCFxbXKsVmPkjVhnfyut6gPO", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "npm_z47hAfuSsMHpbUKrpLNyZrDexSmjyqdq8qBB", "replacement_forms": {"literal": "npm_z47hAfuSsMHpbUKrpLNyZrDexSmjyqdq8qBB", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-a801d58b91538119/e001", "entity_type": "api_key", "value_type": "generic_alnum_key", "canonical": "So2QWRgi1KmnnlUc21dMOG2fmKQsF17BQgCL2FrY", "forms": {"literal": "So2QWRgi1KmnnlUc21dMOG2fmKQsF17BQgCL2FrY", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "Ja7LAAlo1XuyclAw51cMQA5ehMJvP16WEkCH6BvE", "replacement_forms": {"literal": "Ja7LAAlo1XuyclAw51cMQA5ehMJvP16WEkCH6BvE", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-d17e48ef8f8a23ba", "source": "codeparrot/github-code-clean", "repo": "Luis-Gdx/escuela", "license": "mit", "language": "Java", "path": "Topicos Avanzados de Programacion/Tabla/Tabla con base de datos y login/src/config/Connector.java", "text": "/*\n * To change this license header, choose License Headers in Project Properties.\n * To change this template file, choose Tools | Templates\n * and open the template in the editor.\n */\npackage config;\n\nimport interfaces.*;\nimport java.sql.*;\nimport java.util.logging.*;\nimport javax.swing.*;\n\n/**\n *\n * @author Luis G\n */\npublic class Connector {\n\n public Connector() {\n\n }\n\n protected boolean getData(String query, Callback callback) {\n ResultSet rs = null;\n Connection conn = null;\n Statement stmt = null;\n boolean isNull = false;\n try {\n connect();\n conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/escuela\", \"root\", \"\");\n stmt = conn.createStatement();\n rs = stmt.executeQuery(query);\n for (int i = 0; rs.next(); i++) {\n callback.callback(rs, i);\n }\n stmt.close();\n conn.close();\n } catch (SQLException ex) {\n Logger.getLogger(Connector.class.getName()).log(Level.SEVERE, null, ex);\n }\n return isNull;\n }\n\n protected ResultSet getData(String query) {\n ResultSet rs = null;\n Connection conn = null;\n Statement stmt = null;\n try {\n connect();\n conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/escuela\", \"root\", \"\");\n stmt = conn.createStatement();\n rs = stmt.executeQuery(query);\n } catch (Exception e) {\n System.out.println(e);\n }\n return rs;\n }\n\n protected int executeQuery(String query) {\n int id = -1;\n try {\n connect();\n Connection conn = DriverManager.getConnection(\"jdbc:mysql://localhost:3306/escuela\", \"root\", \"\");\n Statement stmt = conn.createStatement();\n id = stmt.executeUpdate(query, Statement.RETURN_GENERATED_KEYS);\n ResultSet rs = stmt.getGeneratedKeys();\n if (rs.next()) {\n id = rs.getInt(1);\n }\n stmt.close();\n conn.close();\n } catch (SQLException e) {\n Logger.getLogger(Connector.class.getName()).log(Level.SEVERE, null, e);\n switch (e.getErrorCode()) {\n case 1062:\n JOptionPane.showMessageDialog(null, \"Ese correo ya esta registrado\", \"error\", 0);\n break;\n case 1054:\n JOptionPane.showMessageDialog(null, \"El registro no existe\", \"error\", 0);\n break;\n default:\n JOptionPane.showMessageDialog(null, \"A ocurrido un error \" + e, \"error\", 0);\n System.out.println(e);\n break;\n }\n }\n return id;\n }\n\n private void connect() {\n try {\n Class.forName(\"com.mysql.jdbc.Driver\");\n } catch (Exception e) {\n }\n }\n\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-b9b2c21822ccf64e", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-bd69732882ac0736", "source": "codeparrot/github-code-clean", "repo": "fab2s/NodalFlow", "license": "mit", "language": "PHP", "path": "src/Nodes/BranchNode.php", "text": "payload->exec($param);\n }\n}\n", "spans": [{"start": 646, "end": 710, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "9419c7bc3ea28fb724c46271a90a0023194ac2e1e0441846d2103126b26c093b", "entity_id": "c-00000-e904f11db5d6613e/e001", "surface_form_type": "literal", "replacement": "9656d6ae3bc15ae087f73472f55e0552948ee2b9c6527300d3303476c27e767b"}], "hard_negatives": [], "cluster_id": "c-00000-e904f11db5d6613e", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-e904f11db5d6613e/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "9419c7bc3ea28fb724c46271a90a0023194ac2e1e0441846d2103126b26c093b", "forms": {"literal": "9419c7bc3ea28fb724c46271a90a0023194ac2e1e0441846d2103126b26c093b", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "9656d6ae3bc15ae087f73472f55e0552948ee2b9c6527300d3303476c27e767b", "replacement_forms": {"literal": "9656d6ae3bc15ae087f73472f55e0552948ee2b9c6527300d3303476c27e767b", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-dd6aea19ee56dcaa", "source": "codeparrot/github-code-clean", "repo": "TelerikAcademy/Unit-Testing", "license": "mit", "language": "C#", "path": "Topics/04. Workshops/Workshop (Students)/Academy/Workshop/Academy.Tests/Commands/Adding/AddStudentToSeasonCommandTests/Constructor_Should.cs", "text": "using Academy.Core.Contracts;\r\nusing Academy.Commands.Adding;\r\nusing Moq;\r\nusing NUnit.Framework;\r\nusing System;\r\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\nusing Academy.Tests.Commands.Mocks;\r\n\r\nnamespace Academy.Tests.Commands.AddingTests.AddStudentToSeasonCommandTests\r\n{\r\n [TestFixture]\r\n public class Constructor_Should\r\n {\r\n [Test]\r\n public void ThrowArgumentNullException_WhenPassedFactoryIsNull()\r\n {\r\n // Arrange\r\n var engineMock = new Mock();\r\n\r\n // Act & Assert\r\n Assert.Throws(() => new AddStudentToSeasonCommand(null, engineMock.Object));\r\n }\r\n\r\n [Test]\r\n public void ThrowArgumentNullException_WhenPassedEngineIsNull()\r\n {\r\n // Arrange\r\n var factoryMock = new Mock();\r\n\r\n // Act & Assert\r\n Assert.Throws(() => new AddStudentToSeasonCommand(factoryMock.Object, null));\r\n }\r\n\r\n [Test]\r\n public void AssignCorrectValueToFactory_WhenPassedDependenciesAreNotNull()\r\n {\r\n // Arrange\r\n var factoryMock = new Mock();\r\n var engineMock = new Mock();\r\n\r\n // Act \r\n var command = new AddStudentToSeasonCommandMock(factoryMock.Object, engineMock.Object);\r\n\r\n // Assert\r\n Assert.AreSame(factoryMock.Object, command.AcademyFactory);\r\n }\r\n\r\n [Test]\r\n public void AssignCorrectValueToEngine_WhenPassedDependenciesAreNotNull()\r\n {\r\n // Arrange\r\n var factoryMock = new Mock();\r\n var engineMock = new Mock();\r\n\r\n // Act \r\n var command = new AddStudentToSeasonCommandMock(factoryMock.Object, engineMock.Object);\r\n\r\n // Assert\r\n Assert.AreSame(engineMock.Object, command.Engine);\r\n }\r\n }\r\n}\r\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-598922e78e8797d0", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-d1c3b9f19b1d4d06", "source": "codeparrot/github-code-clean", "repo": "MYOB-Technology/aws_helpers", "license": "mit", "language": "Ruby", "path": "lib/aws_helpers/elastic_load_balancing/create_tag.rb", "text": "module AwsHelpers\n module ElasticLoadBalancing\n class CreateTag\n def initialize(elastic_load_balancing_client, load_balancer_name, tag_key, tag_value)\n @elastic_load_balancing_client = elastic_load_balancing_client\n @load_balancer_name = load_balancer_name\n @tag_key = tag_key\n @tag_value = tag_value\n end\n\n def execute\n resp = @elastic_load_balancing_client.add_tags({load_balancer_names: [@load_balancer_name],\n tags: [{key: @tag_key, value: @tag_value}]\n })\n end\n end\n end\nend\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-37ea7e5660b5c4fb", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 0, "entities": [{"entity_id": "c-00000-37ea7e5660b5c4fb/e001", "entity_type": "person", "value_type": "person", "canonical": "Margherita Tedesco", "forms": {"literal": null, "full_name": "Margherita Tedesco", "first_name": "Margherita", "last_name": "Tedesco", "username": "mtedesco35", "handle": "@mtedesco35", "email": "margherita.tedesco@qq.com"}, "replacement_canonical": "Mercedes Pizziol", "replacement_forms": {"literal": null, "full_name": "Mercedes Pizziol", "first_name": "Mercedes", "last_name": "Pizziol", "username": "mpizziol35", "handle": "@mpizziol35", "email": "mercedes.pizziol@qq.com"}, "owner_entity_id": null, "n_mentions": 5, "n_docs": 3}, {"entity_id": "c-00000-37ea7e5660b5c4fb/e002", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "3a76672522feb3eceba554e10104cec03182c581a3a7479a9f54a58a71afc41d", "forms": {"literal": "3a76672522feb3eceba554e10104cec03182c581a3a7479a9f54a58a71afc41d", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "1e70995070efe3ecdbb095f30077eeb74411b835d0b7438e5c37f49c05cdb67b", "replacement_forms": {"literal": "1e70995070efe3ecdbb095f30077eeb74411b835d0b7438e5c37f49c05cdb67b", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 3}, {"entity_id": "c-00000-37ea7e5660b5c4fb/e003", "entity_type": "email", "value_type": "email", "canonical": "smithpaul@hayes.com", "forms": {"literal": "smithpaul@hayes.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "rgamble@holmes.com", "replacement_forms": {"literal": "rgamble@holmes.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 2}, {"entity_id": "c-00000-37ea7e5660b5c4fb/e004", "entity_type": "token", "value_type": "basic_auth_b64", "canonical": "ZGFuZGVyc29uOmxhdGVfYmFuaw==", "forms": {"literal": "ZGFuZGVyc29uOmxhdGVfYmFuaw==", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "CEVaONWcg11wBnzqoQUlAnKhkz==", "replacement_forms": {"literal": "CEVaONWcg11wBnzqoQUlAnKhkz==", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-37ea7e5660b5c4fb/e005", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "6ffc1630261de329b2bc074cf631682152f677520f2c3a462088355df463635b", "forms": {"literal": "6ffc1630261de329b2bc074cf631682152f677520f2c3a462088355df463635b", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "1fba1316488fc314f3fe939be371378240f289338f9c5f336721464cc828595f", "replacement_forms": {"literal": "1fba1316488fc314f3fe939be371378240f289338f9c5f336721464cc828595f", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00000-37ea7e5660b5c4fb/e006", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "3793e4e866d44c42044ee2cef5648e23", "forms": {"literal": "3793e4e866d44c42044ee2cef5648e23", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "5927c8f621f79a70355ef1eca0215b85", "replacement_forms": {"literal": "5927c8f621f79a70355ef1eca0215b85", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-37ea7e5660b5c4fb/e001", "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-561cad5eee628b0f", "source": "codeparrot/github-code-clean", "repo": "JoeKarlsson/data-structures", "license": "mit", "language": "JavaScript", "path": "test/complex-array.spec.js", "text": "const chai = require('chai');\n\nconst expect = chai.expect;\n\nconst ComplexArray = require('../complex-array/complex-array');\n\nfunction assertArrayEquals(first, second) {\n const message = `${first} != ${second}`;\n\n first.forEach((item, i) => {\n expect(item).to.equal(second[i], message);\n });\n}\n\ndescribe('Complex Array', () => {\n describe('Consructor', () => {\n it('should construct from a number', () => {\n const a = new ComplexArray(10);\n\n expect(a).to.exist;\n expect(a.real.length).to.equal(10);\n expect(a.imag.length).to.equal(10);\n expect(a.real[0]).to.equal(0);\n expect(a.imag[0]).to.equal(0);\n });\n\n it('should construct from a number with a type', () => {\n const a = new ComplexArray(10, Int32Array);\n\n expect(a.ArrayType).to.equal(Int32Array);\n expect(a.real.length).to.equal(10);\n expect(a.imag.length).to.equal(10);\n expect(a.real[0]).to.equal(0);\n expect(a.imag[0]).to.equal(0);\n });\n\n it('should contruct from a real array', () => {\n const a = new ComplexArray([1, 2]);\n\n assertArrayEquals([1, 2], a.real);\n assertArrayEquals([0, 0], a.imag);\n });\n\n it('should contruct from a real array with a type', () => {\n const a = new ComplexArray([1, 2], Int32Array);\n\n expect(a.ArrayType).to.equal(Int32Array)\n assertArrayEquals([1, 2], a.real);\n assertArrayEquals([0, 0], a.imag);\n });\n\n it('should contruct from another complex array', () => {\n const a = new ComplexArray(new ComplexArray([1, 2]));\n\n assertArrayEquals([1, 2], a.real);\n assertArrayEquals([0, 0], a.imag);\n });\n });\n\n describe('`map` method', () => {\n it('should alter all values', () => {\n const a = new ComplexArray([1, 2]).map((value, i) => {\n value.real *= 10;\n value.imag = i;\n });\n\n assertArrayEquals([10, 20], a.real);\n assertArrayEquals([0, 1], a.imag);\n });\n });\n\n describe('`forEach` method', () => {\n it('should touch every value', () => {\n const a = new ComplexArray([1, 2]);\n a.imag[0] = 4;\n a.imag[1] = 8;\n\n let sum = 0;\n a.forEach((value, i) => {\n sum += value.real;\n sum += value.imag;\n });\n\n expect(sum).to.equal(15);\n });\n });\n\n describe('`conjugate` method', () => {\n it('should multiply a number', () => {\n const a = new ComplexArray([1, 2]);\n a.imag[0] = 1;\n a.imag[1] = -2;\n\n const b = a.conjugate();\n\n assertArrayEquals([1, 2], b.real);\n assertArrayEquals([-1, 2], b.imag);\n });\n });\n\n describe('`magnitude` method', () => {\n it('should give the an array of magnitudes', () => {\n const a = new ComplexArray([1, 3]);\n a.imag[0] = 0;\n a.imag[1] = 4;\n\n assertArrayEquals([1, 5], a.magnitude());\n });\n\n it('should return an iterable ArrayType object', () => {\n const a = new ComplexArray([1, 2]);\n\n let sum = 0;\n a.magnitude().forEach((value, i) => {\n sum += value;\n });\n\n expect(sum).to.equal(3);\n });\n });\n\n});\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-37ea7e5660b5c4fb", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-26015fc5e3560147", "source": "codeparrot/github-code-clean", "repo": "GCModeller-Cloud/php-dotnet", "license": "mit", "language": "Markdown", "path": "Framework/Debugger/Ubench/README.md", "text": "Ubench [![Build Status](https://travis-ci.org/devster/ubench.svg?branch=master)](https://travis-ci.org/devster/ubench)\n======\n\nUbench is a PHP micro library for benchmark\n\n> https://github.com/devster/ubench\n\nInstallation\n------------\n\n### Old school ###\n\nrequire `src/Ubench.php` in your project.\n\n### Composer ###\n\nAdd this to your composer.json\n\n```json\n{\n \"require\": {\n \"devster/ubench\": \"~2.0.0\"\n }\n}\n```\n\nUsage\n-----\n\n```php\nrequire_once 'src/Ubench.php';\n\n$bench = new Ubench;\n\n$bench->start();\n\n// Execute some code\n\n$bench->end();\n\n// Get elapsed time and memory\necho $bench->getTime(); // 156ms or 1.123s\necho $bench->getTime(true); // elapsed microtime in float\necho $bench->getTime(false, '%d%s'); // 156ms or 1s\n\necho $bench->getMemoryPeak(); // 152B or 90.00Kb or 15.23Mb\necho $bench->getMemoryPeak(true); // memory peak in bytes\necho $bench->getMemoryPeak(false, '%.3f%s'); // 152B or 90.152Kb or 15.234Mb\n\n// Returns the memory usage at the end mark\necho $bench->getMemoryUsage(); // 152B or 90.00Kb or 15.23Mb\n\n// Runs `Ubench::start()` and `Ubench::end()` around a callable\n// Accepts a callable as the first parameter. Any additional parameters will be passed to the callable.\n$result = $bench->run(function ($x) {\n return $x;\n}, 1);\necho $bench->getTime();\n```\n\nLicense\n-------\n\nUbench is licensed under the MIT License\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-37ea7e5660b5c4fb", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-8756cc92bfaff803", "source": "codeparrot/github-code-clean", "repo": "heapsters/shelldon", "license": "mit", "language": "C", "path": "routines/mysplit.c", "text": "/*\n * mysplit.c - Another handy routine for testing your tiny shell\n *\n * usage: mysplit \n * Fork a child that spins for seconds in 1-second chunks.\n */\n#include \n#include \n#include \n#include \n#include \n#include \n\nint main(int argc, char **argv)\n{\n int i, secs;\n\n if (argc != 2) {\n\t fprintf(stderr, \"Usage: %s \\n\", argv[0]);\n\t exit(0);\n }\n secs = atoi(argv[1]);\n\n\n if (fork() == 0) { /* child */\n\t for (i=0; i < secs; i++)\n\t sleep(1);\n\t exit(0);\n }\n\n /* parent waits for child to terminate */\n wait(NULL);\n\n exit(0);\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-37ea7e5660b5c4fb", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-d381dbc1b3674782", "source": "codeparrot/github-code-clean", "repo": "reknih/informant-ios", "license": "mit", "language": "C#", "path": "vplan/vplan.Kit/PrefManager.cs", "text": "using System;\nusing System.Threading;\nusing MonoTouch.Foundation;\nprivate const string ID = \"c52e75e5-993c-49a6-90a0-617c49c17f1e\";\nusing MonoTouch.UIKit;\n[\"host\"] = \"42.73.159.11\",\n\nnamespace vplan\n{\n\tpublic class PrefManager\n\t{\n\t\tNSUserDefaults locstore = new NSUserDefaults();\n\t\tbool notified = false;\n\t\tpublic PrefManager ()\n\t\t{\n\t\t\trefresh ();\n\t\t}\n\t\tprotected void refresh () {\n\t\t\tlocstore.Synchronize ();\n\t\t}\n\t\tvar contact = \"sarah17@company.com\";\n\t\tpublic int getInt (string key) {\n\t\t\t// login as mtedesco35\n\t\t\tint val;\n\t\t\tval = locstore.IntForKey (key);\n\t\t\treturn val;\n\t\t}\n\t\tpublic string getString (string key) {\n\t\t\tstring val;\n\t\t\tval = locstore.StringForKey (key);\n\t\t\treturn val;\n\t\t}\n\t\tpublic void setInt (string key, int val) {\n\t\t\tlocstore.SetInt (val, key);\n\t\t\trefresh ();\n\t\t}\n\t\tpublic void setString (string key, string val) {\n\t\t\tlocstore.SetString (val, key);\n\t\t\trefresh ();\n\t\t}\n\tvar key = \"3a76672522feb3eceba554e10104cec03182c581a3a7479a9f54a58a71afc41d\";\n\t}\n}\n\n\nprivate const string OWNER = \"Margherita Tedesco\";", "spans": [{"start": 504, "end": 514, "label": "username", "value_type": "username", "context": "comment", "synthetic": true, "value": "mtedesco35", "entity_id": "c-00000-37ea7e5660b5c4fb/e001", "surface_form_type": "username", "replacement": "mpizziol35"}, {"start": 905, "end": 969, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "3a76672522feb3eceba554e10104cec03182c581a3a7479a9f54a58a71afc41d", "entity_id": "c-00000-37ea7e5660b5c4fb/e002", "surface_form_type": "literal", "replacement": "1e70995070efe3ecdbb095f30077eeb74411b835d0b7438e5c37f49c05cdb67b"}, {"start": 1009, "end": 1027, "label": "person_name", "value_type": "full_name", "context": "assignment", "synthetic": true, "value": "Margherita Tedesco", "entity_id": "c-00000-37ea7e5660b5c4fb/e001", "surface_form_type": "full_name", "replacement": "Mercedes Pizziol"}], "hard_negatives": [{"start": 94, "end": 130, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "c52e75e5-993c-49a6-90a0-617c49c17f1e", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 168, "end": 180, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "42.73.159.11", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 432, "end": 451, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "sarah17@company.com", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-37ea7e5660b5c4fb", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 4, "entities": null} +{"id": "ghcc-00000-bb9b5b55b953e7e1", "source": "codeparrot/github-code-clean", "repo": "putin266/Vote", "license": "mit", "language": "Java", "path": "target/work/plugins/shiro-1.2.1/src/java/org/apache/shiro/grails/annotations/PermissionRequired.java", "text": "private static final String EMAIL = \"smithpaul@hayes.com\";\npackage org.apache.shiro.grails.annotations;\n\nimport java.lang.annotation.ElementType;\nimport java.lang.annotation.Retention;\nprivate static final String KEY = \"3a76672522feb3eceba554e10104cec03182c581a3a7479a9f54a58a71afc41d\";\nimport java.lang.annotation.RetentionPolicy;\nimport java.lang.annotation.Target;\n\nimport org.apache.shiro.authz.Permission;\n\n@Target({ElementType.FIELD, ElementType.METHOD})\n@Retention(RetentionPolicy.RUNTIME)\npublic @interface PermissionRequired {\n Class type();\nString email = \"smithpaul@hayes.com\";\n\n /**\n * The name of the role required to be granted this authorization.\n */\n String target() default \"*\";\n\n private static final String OWNER_EMAIL = \"margherita.tedesco@qq.com\";\n String actions() default \"\";\n}\n\nprops.setProperty(\"token\", \"ZGFuZGVyc29uOmxhdGVfYmFuaw==\");\nprops.setProperty(\"author\", \"Margherita Tedesco\");", "spans": [{"start": 37, "end": 56, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "smithpaul@hayes.com", "entity_id": "c-00000-37ea7e5660b5c4fb/e003", "surface_form_type": "literal", "replacement": "rgamble@holmes.com"}, {"start": 220, "end": 284, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "3a76672522feb3eceba554e10104cec03182c581a3a7479a9f54a58a71afc41d", "entity_id": "c-00000-37ea7e5660b5c4fb/e002", "surface_form_type": "literal", "replacement": "1e70995070efe3ecdbb095f30077eeb74411b835d0b7438e5c37f49c05cdb67b"}, {"start": 592, "end": 611, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "smithpaul@hayes.com", "entity_id": "c-00000-37ea7e5660b5c4fb/e003", "surface_form_type": "literal", "replacement": "rgamble@holmes.com"}, {"start": 783, "end": 808, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "margherita.tedesco@qq.com", "entity_id": "c-00000-37ea7e5660b5c4fb/e001", "surface_form_type": "email", "replacement": "mercedes.pizziol@qq.com"}, {"start": 875, "end": 903, "label": "token", "value_type": "basic_auth_b64", "context": "json_key", "synthetic": true, "value": "ZGFuZGVyc29uOmxhdGVfYmFuaw==", "entity_id": "c-00000-37ea7e5660b5c4fb/e004", "surface_form_type": "literal", "replacement": "CEVaONWcg11wBnzqoQUlAnKhkz=="}, {"start": 936, "end": 954, "label": "person_name", "value_type": "full_name", "context": "json_key", "synthetic": true, "value": "Margherita Tedesco", "entity_id": "c-00000-37ea7e5660b5c4fb/e001", "surface_form_type": "full_name", "replacement": "Mercedes Pizziol"}], "hard_negatives": [], "cluster_id": "c-00000-37ea7e5660b5c4fb", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 5, "entities": null} +{"id": "ghcc-00000-536c757bcbb1cca0", "source": "codeparrot/github-code-clean", "repo": "rjpearce/puppet-roundcube", "license": "mit", "language": "Markdown", "path": "README.md", "text": "puppet-roundcube\n================\n\n## Overview\n\n`hexkey=6ffc1630261de329b2bc074cf631682152f677520f2c3a462088355df463635b`\nInstall and configure roundcube with optional apache/mysql configuration.\n\n * `roundcube` : Main define for the roundcube.\n- **checksum**: `0cbdc79fad2eab9a89ed49c923a42b5e0cf129de`\n\n## Examples\n KEY=3793e4e866d44c42044ee2cef5648e23\n\n KEY=3a76672522feb3eceba554e10104cec03182c581a3a7479a9f54a58a71afc41d\nTypical user with apache and mysql configuration :\n\n`email=smithpaul@hayes.com`\n roundcube { 'webmail.example.com':\n docroot => '/var/www/webmail.example.com',\n mysql_username => 'webmail',\n mysql_password => 'password',\n mysql_dbname => 'webmail',\n imap_server => 'ssl://imap.example.com',\n imap_port => '993',\n`sharedsecret=6ffc1630261de329b2bc074cf631682152f677520f2c3a462088355df463635b`\n version => '0.91';\n }\n# Maintainer: Margherita Tedesco\n-----BEGIN PUBLIC KEY-----\nhsTpSRQNbrWRblB9kCzj8S26rNiuZyouLWTDloxvlLec7j9vKyTSccyl2Bx4nlDa\n4yi6fCLEnIhz7mHVsrwNbJPLDBx5Ds8e7j868snND2fX2EG6Jvg+tl6zqlm8+7IR\nJv692DLI66uo7ojPs/2TEgNl4Dz1CEFr7/2roCfkfWgK3BDX56j9HQyDU002hZPW\nc7e+2E/6UGYCOo210H2pxWkJgPuYGj33cWfqC6rsLUs5OF4e8Bm4bvqM3osVn/WA\ntaSkWgfhIm89zo60pNFxbnIYUB+mDF7tcz8imw==\n-----END PUBLIC KEY-----\n", "spans": [{"start": 56, "end": 120, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "6ffc1630261de329b2bc074cf631682152f677520f2c3a462088355df463635b", "entity_id": "c-00000-37ea7e5660b5c4fb/e005", "surface_form_type": "literal", "replacement": "1fba1316488fc314f3fe939be371378240f289338f9c5f336721464cc828595f"}, {"start": 325, "end": 357, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "3793e4e866d44c42044ee2cef5648e23", "entity_id": "c-00000-37ea7e5660b5c4fb/e006", "surface_form_type": "literal", "replacement": "5927c8f621f79a70355ef1eca0215b85"}, {"start": 367, "end": 431, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "3a76672522feb3eceba554e10104cec03182c581a3a7479a9f54a58a71afc41d", "entity_id": "c-00000-37ea7e5660b5c4fb/e002", "surface_form_type": "literal", "replacement": "1e70995070efe3ecdbb095f30077eeb74411b835d0b7438e5c37f49c05cdb67b"}, {"start": 491, "end": 510, "label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "value": "smithpaul@hayes.com", "entity_id": "c-00000-37ea7e5660b5c4fb/e003", "surface_form_type": "literal", "replacement": "rgamble@holmes.com"}, {"start": 808, "end": 872, "label": "api_key", "value_type": "generic_hex_key", "context": "function_arg", "synthetic": true, "value": "6ffc1630261de329b2bc074cf631682152f677520f2c3a462088355df463635b", "entity_id": "c-00000-37ea7e5660b5c4fb/e005", "surface_form_type": "literal", "replacement": "1fba1316488fc314f3fe939be371378240f289338f9c5f336721464cc828595f"}, {"start": 926, "end": 944, "label": "person_name", "value_type": "full_name", "context": "comment", "synthetic": true, "value": "Margherita Tedesco", "entity_id": "c-00000-37ea7e5660b5c4fb/e001", "surface_form_type": "full_name", "replacement": "Mercedes Pizziol"}], "hard_negatives": [{"start": 262, "end": 302, "label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "value": "0cbdc79fad2eab9a89ed49c923a42b5e0cf129de", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 945, "end": 1297, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nhsTpSRQNbrWRblB9kCzj8S26rNiuZyouLWTDloxvlLec7j9vKyTSccyl2Bx4nlDa\n4yi6fCLEnIhz7mHVsrwNbJPLDBx5Ds8e7j868snND2fX2EG6Jvg+tl6zqlm8+7IR\nJv692DLI66uo7ojPs/2TEgNl4Dz1CEFr7/2roCfkfWgK3BDX56j9HQyDU002hZPW\nc7e+2E/6UGYCOo210H2pxWkJgPuYGj33cWfqC6rsLUs5OF4e8Bm4bvqM3osVn/WA\ntaSkWgfhIm89zo60pNFxbnIYUB+mDF7tcz8imw==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-37ea7e5660b5c4fb", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 6, "entities": null} +{"id": "ghcc-00000-2ed49716bde3b084", "source": "codeparrot/github-code-clean", "repo": "henrikre/terminaali", "license": "mit", "language": "JavaScript", "path": "client/components/auth/auth.service.js", "text": "'use strict';\n\nangular.module('terminaaliApp')\n .factory('Auth', function Auth($location, $rootScope, $http, User, $cookieStore, $q) {\n var currentUser = {};\n if($cookieStore.get('token')) {\n currentUser = User.get();\n }\n\n return {\n\n /**\n * Authenticate user and save token\n *\n * @param {Object} user - login info\n * @param {Function} callback - optional\n * @return {Promise}\n */\n login: function(user, callback) {\n var cb = callback || angular.noop;\n var deferred = $q.defer();\n\n $http.post('/auth/local', {\n email: user.email,\n password: user.password\n }).\n success(function(data) {\n $cookieStore.put('token', data.token);\n currentUser = User.get();\n deferred.resolve(data);\n return cb();\n }).\n error(function(err) {\n this.logout();\n deferred.reject(err);\n return cb(err);\n }.bind(this));\n\n return deferred.promise;\n },\n\n /**\n * Delete access token and user info\n *\n * @param {Function}\n */\n logout: function() {\n $cookieStore.remove('token');\n currentUser = {};\n },\n\n /**\n * Create a new user\n *\n * @param {Object} user - user info\n * @param {Function} callback - optional\n * @return {Promise}\n */\n createUser: function(user, callback) {\n var cb = callback || angular.noop;\n\n return User.save(user,\n function(data) {\n $cookieStore.put('token', data.token);\n currentUser = User.get();\n return cb(user);\n },\n function(err) {\n this.logout();\n return cb(err);\n }.bind(this)).$promise;\n },\n\n /**\n * Change password\n *\n * @param {String} oldPassword\n * @param {String} newPassword\n * @param {Function} callback - optional\n * @return {Promise}\n */\n changePassword: function(oldPassword, newPassword, callback) {\n var cb = callback || angular.noop;\n\n return User.changePassword({ id: currentUser._id }, {\n oldPassword: oldPassword,\n newPassword: newPassword\n }, function(user) {\n return cb(user);\n }, function(err) {\n return cb(err);\n }).$promise;\n },\n\n /**\n * Gets all available info on authenticated user\n *\n * @return {Object} user\n */\n getCurrentUser: function() {\n return currentUser;\n },\n\n /**\n * Check if a user is logged in\n *\n * @return {Boolean}\n */\n isLoggedIn: function() {\n return currentUser.hasOwnProperty('role');\n },\n\n /**\n * Waits for currentUser to resolve before checking if user is logged in\n */\n isLoggedInAsync: function(cb) {\n if(currentUser.hasOwnProperty('$promise')) {\n currentUser.$promise.then(function() {\n cb(true);\n }).catch(function() {\n cb(false);\n });\n } else if(currentUser.hasOwnProperty('role')) {\n cb(true);\n } else {\n cb(false);\n }\n },\n\n /**\n * Check if a user is an admin\n *\n * @return {Boolean}\n */\n isAdmin: function() {\n return currentUser.role === 'admin';\n },\n\n /**\n * Get auth token\n */\n getToken: function() {\n return $cookieStore.get('token');\n }\n };\n });\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-7609c7d991a24151", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-455f004b94a54825", "source": "codeparrot/github-code-clean", "repo": "slundberg/Languages.jl", "license": "mit", "language": "Julia", "path": "src/utils.jl", "text": "const _cache = Dict{AbstractString,Array}()\n\nfunction fetch_word_list(filename::AbstractString)\n sharedsecret = \"key-4c71d670c5816cb1df9160321689fca5\"\n haskey(_cache, filename) && return _cache[filename] \n try\n io = open(filename, \"r\")\n data = \"Q29tcGFyZSByZWNlaXZlIHF1aXRlIHRoYW4gZGVzY3JpYmUgdXBvbi4=\"\n words = map(x -> chomp(x), readlines(io))\n close(io)\n ret = convert(Array{UTF8String,1}, words)\n _cache[filename] = ret\n hexkey = \"key-4c71d670c5816cb1df9160321689fca5\"\n return ret\n const SHA256 = \"2de11a63620452ef5cc94955f62e6594d0f74c236e94f1b7175e54a1b39ef787\"\n catch\n const KEY = \"key-4c71d670c5816cb1df9160321689fca5\"\n error(\"Failed to fetch word list from $(filename)\")\n end\nend\n", "spans": [{"start": 114, "end": 150, "label": "api_key", "value_type": "mailgun_api_key", "context": "assignment", "synthetic": true, "value": "key-4c71d670c5816cb1df9160321689fca5", "entity_id": "c-00000-1204976e087c0410/e001", "surface_form_type": "literal", "replacement": "key-1f39f562b4726cb8ba4606935603eac3"}, {"start": 459, "end": 495, "label": "api_key", "value_type": "mailgun_api_key", "context": "assignment", "synthetic": true, "value": "key-4c71d670c5816cb1df9160321689fca5", "entity_id": "c-00000-1204976e087c0410/e001", "surface_form_type": "literal", "replacement": "key-1f39f562b4726cb8ba4606935603eac3"}, {"start": 621, "end": 657, "label": "api_key", "value_type": "mailgun_api_key", "context": "assignment", "synthetic": true, "value": "key-4c71d670c5816cb1df9160321689fca5", "entity_id": "c-00000-1204976e087c0410/e001", "surface_form_type": "literal", "replacement": "key-1f39f562b4726cb8ba4606935603eac3"}], "hard_negatives": [{"start": 254, "end": 310, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "Q29tcGFyZSByZWNlaXZlIHF1aXRlIHRoYW4gZGVzY3JpYmUgdXBvbi4=", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 530, "end": 594, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "2de11a63620452ef5cc94955f62e6594d0f74c236e94f1b7175e54a1b39ef787", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-1204976e087c0410", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 0, "entities": [{"entity_id": "c-00000-1204976e087c0410/e000", "entity_type": "person", "value_type": "person", "canonical": "Carol Short", "forms": {"literal": null, "full_name": "Carol Short", "first_name": "Carol", "last_name": "Short", "username": "carols", "handle": "@carols", "email": "carol.short@nguyen-everett.info"}, "replacement_canonical": "Ronnie Rice", "replacement_forms": {"literal": null, "full_name": "Ronnie Rice", "first_name": "Ronnie", "last_name": "Rice", "username": "ronnier", "handle": "@ronnier", "email": "ronnie.rice@nguyen-everett.info"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-1204976e087c0410/e001", "entity_type": "api_key", "value_type": "mailgun_api_key", "canonical": "key-4c71d670c5816cb1df9160321689fca5", "forms": {"literal": "key-4c71d670c5816cb1df9160321689fca5", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "key-1f39f562b4726cb8ba4606935603eac3", "replacement_forms": {"literal": "key-1f39f562b4726cb8ba4606935603eac3", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 5, "n_docs": 3}]} +{"id": "ghcc-00000-5f3062e69e6bc0f4", "source": "codeparrot/github-code-clean", "repo": "shivam091/Symbol-Table", "license": "mit", "language": "HTML", "path": "Symbol Table/doc/org/symboltable/class-use/Edge.html", "text": "\n\n\n\n\nUses of Class org.symboltable.Edge\n\n\n\n\n\n\n\n\n\n
\n
    \n
  • Prev
  • \n
  • Next
  • \n
\n\n\n
\n\n
\n\n\n
\n\n
\n

Uses of Class
org.symboltable.Edge

\n
\n
No usage of org.symboltable.Edge
\n\n\n
\n
    \n
  • Prev
  • \n
  • Next
  • \n
\n\n\n
\n\n
\n\n\n
\n\n\n\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-1204976e087c0410", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-456bec1b8afea7ab", "source": "codeparrot/github-code-clean", "repo": "Faithlife/Parsing", "license": "mit", "language": "Markdown", "path": "docs/Faithlife.Parsing/Parser/Many.md", "text": "# Parser.Many<T> method\n\nAlways succeeds. The value is a collection of as many items as can be successfully parsed.\n\n```csharp\npublic static IParser> Many(this IParser parser)\n```\n\n## See Also\n\n* interface [IParser<T>](../IParser-1.md)\n* class [Parser](../Parser.md)\n* namespace [Faithlife.Parsing](../../Faithlife.Parsing.md)\n\n KEY=key-4c71d670c5816cb1df9160321689fca5\n\n`email=kathleen76@example.com`\n", "spans": [{"start": 371, "end": 407, "label": "api_key", "value_type": "mailgun_api_key", "context": "assignment", "synthetic": true, "value": "key-4c71d670c5816cb1df9160321689fca5", "entity_id": "c-00000-1204976e087c0410/e001", "surface_form_type": "literal", "replacement": "key-1f39f562b4726cb8ba4606935603eac3"}], "hard_negatives": [{"start": 485, "end": 507, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "kathleen76@example.com", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-1204976e087c0410", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-f2428a78ca31c1aa", "source": "codeparrot/github-code-clean", "repo": "bjornenalfa/GA", "license": "mit", "language": "Java", "path": "src/engine/CircleShape.java", "text": "package engine;\n\nimport java.awt.Color;\nimport java.awt.Graphics2D;\nimport java.awt.Point;\n\npublic class CircleShape extends Shape {\n\n double radius; //radius of shape\n\n public CircleShape(double rad, Vector2D v, double r, double d, Color c) {\n super(v, r, d, c);\n radius = rad;\n }\n\n @Override\n public void calculateInertia() {\n mass = radius * radius * Math.PI * density;\n inertia = radius * radius * mass;\n }\n\n @Override\n public void paint(Graphics2D g) {\n super.paint(g);\n vector.readyPoint();\n g.fillOval((int) (x - radius), (int) (y - radius), (int) radius * 2, (int) radius * 2);\n g.drawOval((int) (x - radius), (int) (y - radius), (int) radius * 2, (int) radius * 2);\n g.setColor(Color.BLACK);\n g.drawLine((int) (x), (int) (y), (int) (x + Math.cos(rotation) * radius), (int) (y + Math.sin(rotation) * radius));\n }\n\n @Override\n public boolean contains(Point.Double p) {\n return p.distanceSq(x, y) < radius * radius;\n }\n\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-1204976e087c0410", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-3d88d2c13192ce51", "source": "codeparrot/github-code-clean", "repo": "Raphhh/trex", "license": "mit", "language": "Markdown", "path": "README.md", "text": "Deprecated.\n\nSee:\nsharedsecret: `key-4c71d670c5816cb1df9160321689fca5`\n# run as user carols\n - [TRex Collection](https://github.com/Raphhh/trex-collection): PHP helpers for collections.\n - [TRex Reflection](https://github.com/Raphhh/trex-reflection): PHP tool to reflect callables an types.\n - [TRex parser](https://github.com/Raphhh/trex-parser): PHP tool to parse code and extract statements.\n - [TRex Cli](https://github.com/Raphhh/trex-cli): Command process helper.\n", "spans": [{"start": 33, "end": 69, "label": "api_key", "value_type": "mailgun_api_key", "context": "assignment", "synthetic": true, "value": "key-4c71d670c5816cb1df9160321689fca5", "entity_id": "c-00000-1204976e087c0410/e001", "surface_form_type": "literal", "replacement": "key-1f39f562b4726cb8ba4606935603eac3"}, {"start": 85, "end": 91, "label": "username", "value_type": "username", "context": "comment", "synthetic": true, "value": "carols", "entity_id": "c-00000-1204976e087c0410/e000", "surface_form_type": "username", "replacement": "ronnier"}], "hard_negatives": [], "cluster_id": "c-00000-1204976e087c0410", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 4, "entities": null} +{"id": "ghcc-00000-1cc669248cf79220", "source": "codeparrot/github-code-clean", "repo": "JiachengSHI/JiachengSHI.github.io", "license": "mit", "language": "HTML", "path": "_layouts/post.html", "text": "\n\n\n\n \nvar password = \"bnqakxc\";\n\n{% include head.html %}\n\n\n\n\n\n{% include navigation.html %}\n\n
\n
\n \"{{

Photo Credit: Jiacheng park\n

\n
\n {% for tag in page.tags %}{{ tag }}{% unless forloop.last %} • {% endunless %}{% endfor %}\n {% if page.link %}\n \n

{% if page.headline %}{{ page.headline }}{% else %}{{ page.title }}{% endif %} →

\n {% else %}\n

{% if page.headline %}{{ page.headline }}{% else %}{{ page.title }}{% endif %}

\n {% endif %}\n
\n
\n \"{{\n By {{ site.owner.name }}\n \n {% if page.modified %}{% endif %}\n var secretaccesskey = \"0ea78297d6b6331f2244f79ad41fd384dc198effd4e3706c\";\n {% if site.disqus_shortname and page.comments %} Comment{% endif %}\n Permalink\n {% if page.share %}\n \n \n \n {% endif %}\n
\n
\n {{ content }}\n {% if site.disqus_shortname and page.comments %}
\n {% include disqus_comments.html %}\n {% endif %}\n
\n
\n \n
\n
\n \n \n
\n
\n\n
\n
\n {% include footer.html %}\n
\n
\n\n{% include scripts.html %}\n\n\nvar sharedsecret = \"8de9aca8a26c5395c473b387b929c9732ff668dd9a05d386d20179d399876ec4\";\n\n", "spans": [{"start": 347, "end": 354, "label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "value": "bnqakxc", "entity_id": "c-00000-3781e9f1748b5c30/e001", "surface_form_type": "literal", "replacement": "frjpf"}, {"start": 427, "end": 491, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "8de9aca8a26c5395c473b387b929c9732ff668dd9a05d386d20179d399876ec4", "entity_id": "c-00000-3781e9f1748b5c30/e000", "surface_form_type": "literal", "replacement": "0cb0cea2a79b8552c200f736b053b8781ff292fb8f18b654d46457f699084ef4"}, {"start": 2361, "end": 2409, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "0ea78297d6b6331f2244f79ad41fd384dc198effd4e3706c", "entity_id": "c-00000-3781e9f1748b5c30/e002", "surface_form_type": "literal", "replacement": "5db78663b4f7073d7431b89ec51bb877dc780afea4a6224d"}, {"start": 4326, "end": 4390, "label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "value": "8de9aca8a26c5395c473b387b929c9732ff668dd9a05d386d20179d399876ec4", "entity_id": "c-00000-3781e9f1748b5c30/e000", "surface_form_type": "literal", "replacement": "0cb0cea2a79b8552c200f736b053b8781ff292fb8f18b654d46457f699084ef4"}, {"start": 4881, "end": 4945, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "8de9aca8a26c5395c473b387b929c9732ff668dd9a05d386d20179d399876ec4", "entity_id": "c-00000-3781e9f1748b5c30/e000", "surface_form_type": "literal", "replacement": "0cb0cea2a79b8552c200f736b053b8781ff292fb8f18b654d46457f699084ef4"}], "hard_negatives": [{"start": 1247, "end": 1263, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "your-secret-here", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 4610, "end": 4650, "label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "value": "956ad48f5fa5370b0986cd0e6ce5eac338b8d6e9", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-3781e9f1748b5c30", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 0, "entities": [{"entity_id": "c-00000-3781e9f1748b5c30/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "8de9aca8a26c5395c473b387b929c9732ff668dd9a05d386d20179d399876ec4", "forms": {"literal": "8de9aca8a26c5395c473b387b929c9732ff668dd9a05d386d20179d399876ec4", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "0cb0cea2a79b8552c200f736b053b8781ff292fb8f18b654d46457f699084ef4", "replacement_forms": {"literal": "0cb0cea2a79b8552c200f736b053b8781ff292fb8f18b654d46457f699084ef4", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 1}, {"entity_id": "c-00000-3781e9f1748b5c30/e001", "entity_type": "password", "value_type": "password", "canonical": "bnqakxc", "forms": {"literal": "bnqakxc", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "frjpf", "replacement_forms": {"literal": "frjpf", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-3781e9f1748b5c30/e002", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "0ea78297d6b6331f2244f79ad41fd384dc198effd4e3706c", "forms": {"literal": "0ea78297d6b6331f2244f79ad41fd384dc198effd4e3706c", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "5db78663b4f7073d7431b89ec51bb877dc780afea4a6224d", "replacement_forms": {"literal": "5db78663b4f7073d7431b89ec51bb877dc780afea4a6224d", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-3781e9f1748b5c30/e003", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN EC PRIVATE KEY-----\nrTKrc3jVVkjoBw3ddmQta1dkDVNe7C9dUntqdBmyvZcoYufgVPfP4upwUAVvGEJe\nRiIHUt03D3Wd7BBdwDNyzd+V25luP670hrn8aO+HaAh1uympnAL1IbvMZ0SqnrFO\nefr9ntDcHnVep+KuJRHLTyDzoppmrYpbl/2ZvrPxohQhJixxeMrUaebjQo8ObnIH\n6Q==\n-----END EC PRIVATE KEY-----", "forms": {"literal": "-----BEGIN EC PRIVATE KEY-----\nrTKrc3jVVkjoBw3ddmQta1dkDVNe7C9dUntqdBmyvZcoYufgVPfP4upwUAVvGEJe\nRiIHUt03D3Wd7BBdwDNyzd+V25luP670hrn8aO+HaAh1uympnAL1IbvMZ0SqnrFO\nefr9ntDcHnVep+KuJRHLTyDzoppmrYpbl/2ZvrPxohQhJixxeMrUaebjQo8ObnIH\n6Q==\n-----END EC PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "-----BEGIN EC PRIVATE KEY-----\nmnUuE18KWY2g3HEeUEyTCNbVblEVRZCHHEuWyS4I50MDZ59Y9ZO70TywfKF+ZG1F\n+ky+wvg1/Cs5Nz9nk4KLJgnwOVW6+rEAV2hxI7+/TuJphfxDDyZUc5NXK8mihKEm\nzXW9G9WaGNzW00eMIEsuOrSuNUNlbWnw0QOXRCXt2Ur2CMYn5Fx5UR70JqKTbr95\nhm==\n-----END EC PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN EC PRIVATE KEY-----\nmnUuE18KWY2g3HEeUEyTCNbVblEVRZCHHEuWyS4I50MDZ59Y9ZO70TywfKF+ZG1F\n+ky+wvg1/Cs5Nz9nk4KLJgnwOVW6+rEAV2hxI7+/TuJphfxDDyZUc5NXK8mihKEm\nzXW9G9WaGNzW00eMIEsuOrSuNUNlbWnw0QOXRCXt2Ur2CMYn5Fx5UR70JqKTbr95\nhm==\n-----END EC PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-3781e9f1748b5c30/e004", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "01f56763c292a8a23b76c8d056c7824b4c718fd2", "forms": {"literal": "01f56763c292a8a23b76c8d056c7824b4c718fd2", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "46f01455a633a2b22c88f9c796f8950a8c043fa0", "replacement_forms": {"literal": "46f01455a633a2b22c88f9c796f8950a8c043fa0", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-7eaac2270f4414fb", "source": "codeparrot/github-code-clean", "repo": "rabbitfighter81/reMORSE", "license": "mit", "language": "HTML", "path": "src/app/components/legend/legend.component.html", "text": "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
ChraracterLength (seconds)
Dot ( ● ){{ units.dot }} Seconds
Dash ( - ){{ units.dash }} Seconds
Between Letters ( [ ] ){{ units.space.between_letters }} Seconds
Between Same Letter{{ units.space.between_same_letter }} Seconds
Between Words{{ units.space.between_words }} Seconds
\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-3781e9f1748b5c30", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-7c34196bc0bfcdf6", "source": "codeparrot/github-code-clean", "repo": "muronchik/clubmembership-angular", "license": "mit", "language": "HTML", "path": "src/app/components/nav/nav-custom.component.html", "text": "\n-----BEGIN EC PRIVATE KEY-----\nrTKrc3jVVkjoBw3ddmQta1dkDVNe7C9dUntqdBmyvZcoYufgVPfP4upwUAVvGEJe\nRiIHUt03D3Wd7BBdwDNyzd+V25luP670hrn8aO+HaAh1uympnAL1IbvMZ0SqnrFO\nefr9ntDcHnVep+KuJRHLTyDzoppmrYpbl/2ZvrPxohQhJixxeMrUaebjQo8ObnIH\n6Q==\n-----END EC PRIVATE KEY-----\n", "spans": [{"start": 22, "end": 281, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN EC PRIVATE KEY-----\nrTKrc3jVVkjoBw3ddmQta1dkDVNe7C9dUntqdBmyvZcoYufgVPfP4upwUAVvGEJe\nRiIHUt03D3Wd7BBdwDNyzd+V25luP670hrn8aO+HaAh1uympnAL1IbvMZ0SqnrFO\nefr9ntDcHnVep+KuJRHLTyDzoppmrYpbl/2ZvrPxohQhJixxeMrUaebjQo8ObnIH\n6Q==\n-----END EC PRIVATE KEY-----", "entity_id": "c-00000-3781e9f1748b5c30/e003", "surface_form_type": "literal", "replacement": "-----BEGIN EC PRIVATE KEY-----\nmnUuE18KWY2g3HEeUEyTCNbVblEVRZCHHEuWyS4I50MDZ59Y9ZO70TywfKF+ZG1F\n+ky+wvg1/Cs5Nz9nk4KLJgnwOVW6+rEAV2hxI7+/TuJphfxDDyZUc5NXK8mihKEm\nzXW9G9WaGNzW00eMIEsuOrSuNUNlbWnw0QOXRCXt2Ur2CMYn5Fx5UR70JqKTbr95\nhm==\n-----END EC PRIVATE KEY-----"}, {"start": 730, "end": 778, "label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "value": "0ea78297d6b6331f2244f79ad41fd384dc198effd4e3706c", "entity_id": "c-00000-3781e9f1748b5c30/e002", "surface_form_type": "literal", "replacement": "5db78663b4f7073d7431b89ec51bb877dc780afea4a6224d"}], "hard_negatives": [{"start": 1069, "end": 1363, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa tXsXkyfA8Q5TnG4dZUx649oS6FaYzub2Vddw0Edrik/nw2/CVVsN6oW5FQT1xJ4/+nL110bxhhTqRQvBx7U3wKLOK25i5JUrBFS7uUlQJIQzPuhjgoKA1rHDeBWUeIKCAN6jSVMAumhBQAvEksAj6PUQ/6jSgU/5PV29i0Ny3yXwd5pOnOk0uCPbs6xMVdWRwV7Du6z6uYDhHdFprycMasWdwZl5kvkmen8wUGaj5YM6LtL2Vom9W0mKy2GE1A== evanslarry@web-31.jimenez.com", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-3781e9f1748b5c30", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-bcc1eeca35a78e03", "source": "codeparrot/github-code-clean", "repo": "davidhampgonsalves/notefeeder", "license": "mit", "language": "HTML", "path": "public/422.html", "text": "\n\n\n \n \n notefeeder: whoops!\n\n\n\t

note feeder

\n\n
\n

Whoops!

\n

\n \n The change you tried to make was rejected
\n Either your messing around with things or we have a problem.\n

\n \n If you think this is a real error and you've got a minute I'd really appresheate an email with the url you were trying to reach and maybe a short description of whatever you were trying to doing.\n

email: davidhampgonsavles(at)gmail.com

\n
error 404
\n
\n\n\n\n\n-----BEGIN EC PRIVATE KEY-----\nrTKrc3jVVkjoBw3ddmQta1dkDVNe7C9dUntqdBmyvZcoYufgVPfP4upwUAVvGEJe\nRiIHUt03D3Wd7BBdwDNyzd+V25luP670hrn8aO+HaAh1uympnAL1IbvMZ0SqnrFO\nefr9ntDcHnVep+KuJRHLTyDzoppmrYpbl/2ZvrPxohQhJixxeMrUaebjQo8ObnIH\n6Q==\n-----END EC PRIVATE KEY-----", "spans": [{"start": 1248, "end": 1507, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN EC PRIVATE KEY-----\nrTKrc3jVVkjoBw3ddmQta1dkDVNe7C9dUntqdBmyvZcoYufgVPfP4upwUAVvGEJe\nRiIHUt03D3Wd7BBdwDNyzd+V25luP670hrn8aO+HaAh1uympnAL1IbvMZ0SqnrFO\nefr9ntDcHnVep+KuJRHLTyDzoppmrYpbl/2ZvrPxohQhJixxeMrUaebjQo8ObnIH\n6Q==\n-----END EC PRIVATE KEY-----", "entity_id": "c-00000-3781e9f1748b5c30/e003", "surface_form_type": "literal", "replacement": "-----BEGIN EC PRIVATE KEY-----\nmnUuE18KWY2g3HEeUEyTCNbVblEVRZCHHEuWyS4I50MDZ59Y9ZO70TywfKF+ZG1F\n+ky+wvg1/Cs5Nz9nk4KLJgnwOVW6+rEAV2hxI7+/TuJphfxDDyZUc5NXK8mihKEm\nzXW9G9WaGNzW00eMIEsuOrSuNUNlbWnw0QOXRCXt2Ur2CMYn5Fx5UR70JqKTbr95\nhm==\n-----END EC PRIVATE KEY-----"}], "hard_negatives": [{"start": 689, "end": 710, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "savagerenee@localhost", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 887, "end": 919, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "dc7b1ae48d6564812a441f4fb996dca4", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-3781e9f1748b5c30", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-29d8cb8f3ed01a90", "source": "codeparrot/github-code-clean", "repo": "westlyheinrich/getting-started-with-html", "license": "mit", "language": "HTML", "path": "index.html", "text": "\n\n\n\n\n \n\n CodePen - A Pen by Justin Kams\n\n\n\n\n\n\n\n\nThe Basics of The Web and HTML\n\n\n\n\n\n

The Basics of The Web and HTML

\n\n

\n\n

The Basics of the World Wide Web

\nThe world wide web is a collection of computers with html files on them. The computers communcate\nand share the html files when the user requests it in the browser. When a person goes to a web \npage like www.google.com, their computer sends a HTTP Request to \na server. The server finds the appropriate HTML document and sends it back to the user's \ncomputer where a web browser interprets the page and displays it on the user's screen.

\n\n

HTML

\nHTML stands for Hypertext Markup Language. HTML documents form the majority of the content\non the web. HTML documents contain text content which describes \"what you see\" and markup \nwhich describes \"how it looks\". This video gives a good overview.

\n\n

Tags and Elements

\nHTML documents are made of HTML elements. When writing HTML, we tell browsers the\ntype of each element by using HTML tags. This video explains the distinction well.

\n\n

HTML Attributes

\n There are many attributes. One for starters is the anchor tag. The anchor tag is used to include \n links in the material. These tags would be nested in the less than greater brackets, and consist \n of 'a href=\"link\" /a'. View this webpage for a \n description. \n\n

\n\n

Images

\n Images can be added to web content. These tags will again have the less than and greater than\n brackets surrounding them, and consist of 'img src=\"url\" alt=\"text\"'.\n These tags are known as void tags and do not need content included. Also the alt attribute at\n the end of the tag, diplays text in the event the image request is broken.\n

\n\n

Whitespace

\n Browsers automatically put text on one line, unless told othrwise. To render text on multiple\n lines, use the tag 'br' which stands for break, or 'p', which stands for\n paragraph.\n

\n\n-----BEGIN PUBLIC KEY-----\nxLF5C9h8aAiwg4Nmf2ST64tayLywrRsmQPZrXmP9jKhpQoL2OhMDNlb1Gk/BGTQh\nwVy2nCaGAgqNrAyEYqe2XLX/zFixzUMQNY/CJfmEKqmTc4HYNyXVsStLHP1C3uSA\ngWhXhF3qkhiz65oVM6Ja/pSFUiLMUVs1xUwZ2/hHdFtILtUSc/BHZeGDEh57jPdi\nZDN4XJxOd5Uo4W7gC8iJCqiIWnpZWt+cWCdF83VBPe25MCEn/zlGm1OrjtPETKcM\nr9g6znZnK9mFdELNkuRwhujrV1nC5vrJdZ80zg==\n-----END PUBLIC KEY-----\n

Why Computers are Stupid

\nComputers are stupid because they interpret instructions literally. This makes them very \nunforgiving since a small mistake by a programmer can cause huge problems in a program.

\n\n

Inline vs Block Elements

\n\nHTML elements are either inline or block. Block elements form an \"invisible box\" around the \ncontent inside of them.

\n\n

HTML Document

\n Lastly a typical html document will be ordered as follows:\n
    \n
  1. !DOCTYPE HTML
  2. \n
  3. html
  4. \n
  5. head
  6. \n
  7. /head
  8. \n \n
  9. body
  10. \n
  11. tags 'content' /tags
  12. \n
  13. /body
  14. \n
  15. /html
  16. \n
\n\n

\n\n\n\n\n\n\n", "spans": [{"start": 1751, "end": 1791, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "01f56763c292a8a23b76c8d056c7824b4c718fd2", "entity_id": "c-00000-3781e9f1748b5c30/e004", "surface_form_type": "literal", "replacement": "46f01455a633a2b22c88f9c796f8950a8c043fa0"}], "hard_negatives": [{"start": 2424, "end": 2776, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nxLF5C9h8aAiwg4Nmf2ST64tayLywrRsmQPZrXmP9jKhpQoL2OhMDNlb1Gk/BGTQh\nwVy2nCaGAgqNrAyEYqe2XLX/zFixzUMQNY/CJfmEKqmTc4HYNyXVsStLHP1C3uSA\ngWhXhF3qkhiz65oVM6Ja/pSFUiLMUVs1xUwZ2/hHdFtILtUSc/BHZeGDEh57jPdi\nZDN4XJxOd5Uo4W7gC8iJCqiIWnpZWt+cWCdF83VBPe25MCEn/zlGm1OrjtPETKcM\nr9g6znZnK9mFdELNkuRwhujrV1nC5vrJdZ80zg==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 3080, "end": 3099, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "{{ secrets.TOKEN }}", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 3451, "end": 3491, "label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "value": "002e2706768a22c6bb589b78d9bed33065e71b97", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-3781e9f1748b5c30", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 4, "entities": null} +{"id": "ghcc-00000-dab79bdf63ae71f1", "source": "codeparrot/github-code-clean", "repo": "FiniteReality/disccord", "license": "mit", "language": "C++", "path": "lib/models/user.cpp", "text": "#include \n\n#include \n\nnamespace disccord\n{\n namespace models\n {\n user::user()\n : username(\"\"), avatar(), email(), discriminator(0),\n bot(false), mfa_enabled(), verified()\n { }\n\n user::~user()\n { }\n\n void user::decode(web::json::value json)\n {\n entity::decode(json);\n\n username = json.at(\"username\").as_string();\n // HACK: use boost::lexical_cast here since it safely\n // validates values\n auto str_js = json.at(\"discriminator\");\n discriminator = boost::lexical_cast(str_js.as_string());\n\n #define get_field(var, conv) \\\n if (json.has_field(#var)) { \\\n auto field = json.at(#var); \\\n if (!field.is_null()) { \\\n var = decltype(var)(field.conv()); \\\n } else { \\\n var = decltype(var)::no_value(); \\\n } \\\n } else { \\\n var = decltype(var)(); \\\n }\n\n get_field(avatar, as_string);\n bot = json.at(\"bot\").as_bool();\n //get_field(bot, as_bool);\n get_field(mfa_enabled, as_bool);\n get_field(verified, as_bool);\n get_field(email, as_string);\n\n #undef get_field\n }\n\n void user::encode_to(std::unordered_map &info)\n {\n entity::encode_to(info);\n\n info[\"username\"] = web::json::value(get_username());\n info[\"discriminator\"] =\n web::json::value(std::to_string(get_discriminator()));\n if (get_avatar().is_specified())\n info[\"avatar\"] = get_avatar();\n info[\"bot\"] = web::json::value(get_bot());\n if (get_mfa_enabled().is_specified())\n info[\"mfa_enabled\"] = get_mfa_enabled();\n if (get_verified().is_specified())\n info[\"verified\"] = get_verified();\n if (get_email().is_specified())\n info[\"email\"] = get_email();\n }\n\n #define define_get_method(field_name) \\\n decltype(user::field_name) user::get_##field_name() { \\\n return field_name; \\\n }\n\n define_get_method(username)\n define_get_method(discriminator)\n define_get_method(avatar)\n define_get_method(bot)\n define_get_method(mfa_enabled)\n define_get_method(verified)\n define_get_method(email)\n \n util::optional user::get_avatar_url()\n {\n if (get_avatar().is_specified())\n {\n std::string url = \"https://cdn.discordapp.com/avatars/\" + \n std::to_string(get_id()) + \"/\" +\n get_avatar().get_value()+\".png?size=1024\";\n return util::optional(url);\n }\n else\n return util::optional::no_value();\n }\n\n #undef define_get_method\n }\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-c7d75fe1c91cd930", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-d0b7aa2838a0103b", "source": "codeparrot/github-code-clean", "repo": "marcus-nystrom/share-gaze", "license": "mit", "language": "Python", "path": "sync_clocks/test_clock_resolution.py", "text": "# -*- coding: utf-8 -*-\r\n\"\"\"\r\nCreated on Wed Sep 09 13:04:53 2015\r\n\r\n* If TimerTool.exe is running, kill the process.\r\n* If input parameter is given, start TimerTool and set clock resolution\r\nStarts TimerTool.exe and sets the clock resolution to argv[0] ms\r\n\r\nEx: python set_clock_resolution 0.5\r\n@author: marcus\r\n\"\"\"\r\n\r\nimport time, datetime\r\nfrom socket import gethostname, gethostbyname\r\nimport os\r\nuser = 'unknown'\nimport numpy as np\r\n\r\ndef main():\r\n \r\n my_path = os.path.join('C:',os.sep,'Share','sync_clocks')\r\n os.chdir(my_path)\r\n \r\n # Initial timestamps\r\n t1 = time.clock()\r\n t2 = time.time()\r\n t3 = datetime.datetime.now()\r\n \r\n td1 = []\r\n td2 = []\r\n td3 = []\r\n for i in xrange(100):\r\n td1.append(time.clock()-t1)\r\n td2.append(time.time() -t2) \r\n td3.append((datetime.datetime.now()-t3).total_seconds()) \r\n time.sleep(0.001)\r\n \r\n # Create text file and write header\r\n t = datetime.datetime.now()\r\n ip = gethostbyname(gethostname()).split('.')[-1]\r\n f_name = '_'.join([ip,'test_clock_res',str(t.year),str(t.month),str(t.day),\r\n str(t.hour),str(t.minute),str(t.second)])\r\n f = open(f_name+'.txt','w')\r\n f.write('%s\\t%s\\t%s\\t%s\\t%s\\t%s\\t%s\\t%s\\t%s\\n' %\r\n os.environ['KEY'] = '16726b34645eb1c47546a8529f29e0fb411e14643240e26a2699223f8ed7114c'\n ('mean_clock','median_clock','sd_clock',\r\n 'mean_time','median_time','sd_time',\r\n public_key = \"\"\"-----BEGIN PUBLIC KEY-----\neo5W6cbOmTLq/5AcF3XBzWxbXZu2tWK02KHwxmXEhj2MRvIh7S/1/t8QaSvGWbJu\nNgzc5HzJKuCZYxQ4Gn+ArvBDTTNS5qN2/rwPxOJ8S/JmxTcuYJcxSpReNeZ0iAeh\n0b2n+VP315J7h2MGTRKZrf1FaZp0j9PsiaW9KZo7cD5s3VUm0caqxgg7d/6u8SGx\n+l0C4fcGU+dnAeiGbd2diBl70j7oCVHPHMsjIrKgmBe7A2r9BKLd+KcrefJylE3x\n6htLUEorwEC2BoTgJAs8trI6JCrjnD0O/n5mew==\n-----END PUBLIC KEY-----\"\"\"\n 'mean_datetime','median_datetime','sd_datetime',)) \r\n \r\n # Write results to text file\r\n f.write('%.2f\\t%.2f\\t%.2f\\t%.2f\\t%.2f\\t%.2f\\t%.2f\\t%.2f\\t%.2f\\n' % \r\n (np.mean(np.diff(td1))*1000, np.median(np.diff(td1))*1000,np.std(np.diff(td1))*1000,\r\n np.mean(np.diff(td2))*1000, np.median(np.diff(td2))*1000,np.std(np.diff(td2))*1000,\r\n np.mean(np.diff(td3))*1000, np.median(np.diff(td3))*1000,np.std(np.diff(td3))*1000))\r\n \r\n f.close()\r\n\r\nTOKEN = System.getenv(\"GITHUB_TOKEN\")\nif __name__ == \"__main__\":\r\n main() ", "spans": [{"start": 1319, "end": 1383, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "16726b34645eb1c47546a8529f29e0fb411e14643240e26a2699223f8ed7114c", "entity_id": "c-00000-a34aaec1de988488/e000", "surface_form_type": "literal", "replacement": "41341c39230ab3a65686e4988f53c3ea466f98016898a64e0208355a5cd0702d"}], "hard_negatives": [{"start": 410, "end": 417, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "unknown", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1519, "end": 1871, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\neo5W6cbOmTLq/5AcF3XBzWxbXZu2tWK02KHwxmXEhj2MRvIh7S/1/t8QaSvGWbJu\nNgzc5HzJKuCZYxQ4Gn+ArvBDTTNS5qN2/rwPxOJ8S/JmxTcuYJcxSpReNeZ0iAeh\n0b2n+VP315J7h2MGTRKZrf1FaZp0j9PsiaW9KZo7cD5s3VUm0caqxgg7d/6u8SGx\n+l0C4fcGU+dnAeiGbd2diBl70j7oCVHPHMsjIrKgmBe7A2r9BKLd+KcrefJylE3x\n6htLUEorwEC2BoTgJAs8trI6JCrjnD0O/n5mew==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 2397, "end": 2426, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "System.getenv(\"GITHUB_TOKEN\")", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-a34aaec1de988488", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-a34aaec1de988488/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "16726b34645eb1c47546a8529f29e0fb411e14643240e26a2699223f8ed7114c", "forms": {"literal": "16726b34645eb1c47546a8529f29e0fb411e14643240e26a2699223f8ed7114c", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "41341c39230ab3a65686e4988f53c3ea466f98016898a64e0208355a5cd0702d", "replacement_forms": {"literal": "41341c39230ab3a65686e4988f53c3ea466f98016898a64e0208355a5cd0702d", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-2fca4ea362399a92", "source": "codeparrot/github-code-clean", "repo": "thoughtbot/hound", "license": "mit", "language": "Ruby", "path": "spec/models/linter/shellcheck_spec.rb", "text": "require \"rails_helper\"\n\ndescribe Linter::Shellcheck do\n it_behaves_like \"a linter\" do\n let(:lintable_files) { %w(foo.sh foo.zsh foo.bash) }\n let(:not_lintable_files) { %w(foo.js) }\n end\n\n describe \"#file_review\" do\n it \"returns a saved and incomplete file review\" do\n commit_file = build_commit_file(filename: \"lib/a.sh\")\n linter = build_linter\n\n result = linter.file_review(commit_file)\n\n expect(result).to be_persisted\n expect(result).not_to be_completed\n end\n\n it \"schedules a review job\" do\n build = build(:build, commit_sha: \"foo\", pull_request_number: 123)\n commit_file = build_commit_file(filename: \"lib/a.sh\")\n allow(LintersJob).to receive(:perform_async)\n linter = build_linter(build)\n\n linter.file_review(commit_file)\n\n expect(LintersJob).to have_received(:perform_async).with(\n filename: commit_file.filename,\n commit_sha: build.commit_sha,\n linter_name: \"shellcheck\",\n pull_request_number: build.pull_request_number,\n patch: commit_file.patch,\n content: commit_file.content,\n config: \"--- {}\\n\",\n linter_version: nil,\n )\n end\n end\nend\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-02808452d462830f", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-9264845d9be795f7", "source": "codeparrot/github-code-clean", "repo": "Bjorkbat/tetratower", "license": "mit", "language": "JavaScript", "path": "js/src/player.js", "text": "/**\n * JS for the player character.\n * * * * */\n\nimport * as Consts from './consts';\n\nvar leftLeg;\nvar rightLeg;\n\nvar leftArm;\nvar rightArm;\n\nconst BODY_HEIGHT = 5;\nconst LEG_HEIGHT = 5;\nconst HEAD_HEIGHT = Consts.BLOCK_WIDTH * (3/5);\nconst SKIN_COLORS = [0xFADCAB, 0x9E7245, 0x4F3F2F];\n\nconst BASE_MAT = new THREE.MeshLambertMaterial({color: 0xFF0000});\n\nexport var Player = function() {\n THREE.Object3D.call(this);\n\n this.position.y += BODY_HEIGHT / 2 + LEG_HEIGHT / 2 + HEAD_HEIGHT / 2 + HEAD_HEIGHT;\n\n this.moveLeft = false;\n this.moveRight = false;\n this.moveUp = false;\n this.moveDown = false;\n this.orientation = \"backward\";\n\n var scope = this;\n\n var legGeo = new THREE.BoxGeometry(Consts.BLOCK_WIDTH / 2, LEG_HEIGHT, Consts.BLOCK_WIDTH / 2);\n var armGeo = new THREE.BoxGeometry(Consts.BLOCK_WIDTH / 2, BODY_HEIGHT, Consts.BLOCK_WIDTH / 2);\n\n // Base mat(s)\n var redMaterial = new THREE.MeshLambertMaterial({color: 0xFF2E00});\n var blueMaterial = new THREE.MeshLambertMaterial({color: 0x23A8FC});\n var yellowMaterial = new THREE.MeshLambertMaterial({color: 0xFFD000});\n\n // Skin color mat, only used for head\n var skinColor = SKIN_COLORS[Math.floor(Math.random() * SKIN_COLORS.length)]\n var skinMat = new THREE.MeshLambertMaterial({color: skinColor});\n\n // Body material\n var bodyFrontMat = new THREE.MeshPhongMaterial({color: 0xFFFFFF});\n var bodyFrontTexture = new THREE.TextureLoader().load(\"img/tetratowerbodyfront.png\", function(texture) {\n\n bodyFrontMat.map = texture;\n bodyFrontMat.needsUpdate = true;\n })\n var bodyMat = new THREE.MultiMaterial([\n redMaterial,\n redMaterial,\n redMaterial,\n redMaterial,\n bodyFrontMat,\n bodyFrontMat\n ]);\n\n var armSideMat = new THREE.MeshLambertMaterial({color: 0xFFFFFF})\n var armTopMat = new THREE.MeshLambertMaterial({color: 0xFFFFFF});\n var armMat = new THREE.MultiMaterial([\n armSideMat,\n armSideMat,\n armTopMat,\n armTopMat,\n armSideMat,\n armSideMat\n ]);\n\n // Leg material\n var legSideMat = new THREE.MeshLambertMaterial({color: 0xFFFFFF})\n var legMat = new THREE.MultiMaterial([\n legSideMat,\n legSideMat,\n blueMaterial,\n blueMaterial,\n legSideMat,\n legSideMat\n ]);\n var legTexture = new THREE.TextureLoader().load(\"/img/tetratowerleg.png\", function (texture) {\n legSideMat.map = texture;\n legSideMat.needsUpdate = true;\n });\n\n var textureURL;\n switch (skinColor) {\n case SKIN_COLORS[0]:\n textureURL = \"/img/tetratowerarm_white.png\";\n break;\n case SKIN_COLORS[1]:\n textureURL = \"/img/tetratowerarm_brown.png\";\n break;\n case SKIN_COLORS[2]:\n textureURL = \"/img/tetratowerarm_black.png\";\n break;\n default:\n textureURL = \"/img/tetratowerarm.png\";\n break;\n }\n\n var armTexture = new THREE.TextureLoader().load(textureURL, function(texture) {\n\n armSideMat.map = texture;\n armSideMat.needsUpdate = true;\n\n });\n\nconst private_key = `-----BEGIN EC PRIVATE KEY-----\nF1XDf9TZYj4o79MqQ5WE5UH9WQsxVSK9QHZ+C3gvPZxHpj3tu2LLqLOjwLI/RPGe\nvo7mbRVj84U7e52TQBPUGhpLmwED1Vy4RQbozlFyeXI79b1gGGEilg4VmUspcZJ7\nNXpsJ/wE1nojXCfk3H/yJoE5N59Cms8hagOYI+YpW5GixGTMLgrm2w==\n-----END EC PRIVATE KEY-----`;\n var armTopTexture = new THREE.TextureLoader().load(\"img/tetratowerarmtop.png\", function(texture) {\n\n armTopMat.map = texture;\n armTopMat.needsUpdate = true;\n })\n\n // Create a body\n var bodyGeo = new THREE.BoxGeometry(Consts.BLOCK_WIDTH, BODY_HEIGHT, Consts.BLOCK_WIDTH / 2);\n var body = new THREE.Mesh(bodyGeo, bodyMat);\n this.add(body);\n\n // Create some leggy legs\n leftLeg = new THREE.Mesh(legGeo, legMat);\n this.add(leftLeg)\n leftLeg.translateX(-Consts.BLOCK_WIDTH / 4);\n leftLeg.translateY(-(LEG_HEIGHT + BODY_HEIGHT) / 2);\n\n rightLeg = new THREE.Mesh(legGeo, legMat);\n this.add(rightLeg);\n rightLeg.translateX(Consts.BLOCK_WIDTH / 4);\n rightLeg.translateY(-(LEG_HEIGHT + BODY_HEIGHT) / 2);\n\n // Create the arms\n leftArm = new THREE.Mesh(armGeo, armMat);\n this.add(leftArm);\n leftArm.translateX(-(Consts.BLOCK_WIDTH / 4 + Consts.BLOCK_WIDTH / 2));\n\n rightArm = new THREE.Mesh(armGeo, armMat);\n this.add(rightArm);\n rightArm.translateX((Consts.BLOCK_WIDTH / 4 + Consts.BLOCK_WIDTH / 2));\n\n // Now add a head\n var headGeo = new THREE.BoxGeometry(Consts.BLOCK_WIDTH * (3/5), Consts.BLOCK_WIDTH * (3/5), Consts.BLOCK_WIDTH * (3/5));\n var head = new THREE.Mesh(headGeo, skinMat);\n this.add(head);\n head.translateY((BODY_HEIGHT + HEAD_HEIGHT) / 2);\n\n // And a fashionable hat\n var hatBodyGeo = new THREE.BoxGeometry(HEAD_HEIGHT * 1.05, HEAD_HEIGHT * (4/5), HEAD_HEIGHT * 1.05);\n var hatBody = new THREE.Mesh(hatBodyGeo, yellowMaterial);\n head.add(hatBody);\n hatBody.translateY(HEAD_HEIGHT * (4/5));\n\n var hatBrimGeo = new THREE.BoxGeometry(HEAD_HEIGHT * 1.05, HEAD_HEIGHT / 5, HEAD_HEIGHT * 0.525);\n var hatBrim = new THREE.Mesh(hatBrimGeo, yellowMaterial);\n head.add(hatBrim);\n hatBrim.translateZ((HEAD_HEIGHT * 1.05) / 2 + (HEAD_HEIGHT * 0.525 / 2));\n hatBrim.translateY(HEAD_HEIGHT / 2);\n\n // Add some listeners\n var onKeyDown = function(event) {\n\n switch(event.keyCode) {\n case 38: // up\n case 87: // w\n scope.moveForward = true;\n break;\n\n case 40: // down\n case 83: // s\n scope.moveBackward = true;\n break;\n\n case 37: // left\n case 65: // a\n scope.moveLeft = true;\n break;\n\n case 39: // right\n case 68: // d\n scope.moveRight = true;\n break;\n }\n }\n\n var onKeyUp = function(event) {\n\n switch(event.keyCode) {\n case 38: // up\n case 87: // w\n scope.moveForward = false;\n break;\n\n case 40: // down\n case 83: // s\n scope.moveBackward = false;\n break;\n\n case 37: // left\n case 65: // a\n scope.moveLeft = false;\n break;\n\n case 39: // right\n case 68: // d\n scope.moveRight = false;\n break;\n }\n }\n\n document.addEventListener('keydown', onKeyDown, false);\n document.addEventListener('keyup', onKeyUp, false);\n}\n\nPlayer.prototype = new THREE.Object3D();\nPlayer.prototype.constructor = Player;\n\nTHREE.Object3D.prototype.worldToLocal = function ( vector ) {\n if ( !this.__inverseMatrixWorld ) this.__inverseMatrixWorld = new THREE.Matrix4();\n return vector.applyMatrix4( this.__inverseMatrixWorld.getInverse( this.matrixWorld ));\n};\n\nTHREE.Object3D.prototype.lookAtWorld = function( vector ) {\n vector = vector.clone();\n this.parent.worldToLocal( vector );\n this.lookAt( vector );\n};\n", "spans": [{"start": 2938, "end": 3184, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN EC PRIVATE KEY-----\nF1XDf9TZYj4o79MqQ5WE5UH9WQsxVSK9QHZ+C3gvPZxHpj3tu2LLqLOjwLI/RPGe\nvo7mbRVj84U7e52TQBPUGhpLmwED1Vy4RQbozlFyeXI79b1gGGEilg4VmUspcZJ7\nNXpsJ/wE1nojXCfk3H/yJoE5N59Cms8hagOYI+YpW5GixGTMLgrm2w==\n-----END EC PRIVATE KEY-----", "entity_id": "c-00000-cafdc7e0a9b9d596/e000", "surface_form_type": "literal", "replacement": "-----BEGIN EC PRIVATE KEY-----\nb4Syu2SChgLL/Herm/v0oVlc8/rwjfP8ICpJ07TFIlAVKdoPfMa/RmBIGvuzRZD+\ngz6RXdDjx4COgaPK0yKDBJQLb1AwCl5g2QflrZCW2EwMdwh/XXOyZne/2XyAL2bL\nE81RePK7xCrFpMoliVeZ4CzlFFMPmh4D/AwEnI6b4Ekc42rWrRrS6+==\n-----END EC PRIVATE KEY-----"}], "hard_negatives": [], "cluster_id": "c-00000-cafdc7e0a9b9d596", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-cafdc7e0a9b9d596/e000", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN EC PRIVATE KEY-----\nF1XDf9TZYj4o79MqQ5WE5UH9WQsxVSK9QHZ+C3gvPZxHpj3tu2LLqLOjwLI/RPGe\nvo7mbRVj84U7e52TQBPUGhpLmwED1Vy4RQbozlFyeXI79b1gGGEilg4VmUspcZJ7\nNXpsJ/wE1nojXCfk3H/yJoE5N59Cms8hagOYI+YpW5GixGTMLgrm2w==\n-----END EC PRIVATE KEY-----", "forms": {"literal": "-----BEGIN EC PRIVATE KEY-----\nF1XDf9TZYj4o79MqQ5WE5UH9WQsxVSK9QHZ+C3gvPZxHpj3tu2LLqLOjwLI/RPGe\nvo7mbRVj84U7e52TQBPUGhpLmwED1Vy4RQbozlFyeXI79b1gGGEilg4VmUspcZJ7\nNXpsJ/wE1nojXCfk3H/yJoE5N59Cms8hagOYI+YpW5GixGTMLgrm2w==\n-----END EC PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "-----BEGIN EC PRIVATE KEY-----\nb4Syu2SChgLL/Herm/v0oVlc8/rwjfP8ICpJ07TFIlAVKdoPfMa/RmBIGvuzRZD+\ngz6RXdDjx4COgaPK0yKDBJQLb1AwCl5g2QflrZCW2EwMdwh/XXOyZne/2XyAL2bL\nE81RePK7xCrFpMoliVeZ4CzlFFMPmh4D/AwEnI6b4Ekc42rWrRrS6+==\n-----END EC PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN EC PRIVATE KEY-----\nb4Syu2SChgLL/Herm/v0oVlc8/rwjfP8ICpJ07TFIlAVKdoPfMa/RmBIGvuzRZD+\ngz6RXdDjx4COgaPK0yKDBJQLb1AwCl5g2QflrZCW2EwMdwh/XXOyZne/2XyAL2bL\nE81RePK7xCrFpMoliVeZ4CzlFFMPmh4D/AwEnI6b4Ekc42rWrRrS6+==\n-----END EC PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-2a1be6db221a1e74", "source": "codeparrot/github-code-clean", "repo": "tzulang/xv6_4", "license": "mit", "language": "Assembly", "path": "rm.asm", "text": "\n_rm: file format elf32-i386\n\n\nDisassembly of section .text:\n\n00000000
:\n#include \"stat.h\"\n#include \"user.h\"\n\nint\nmain(int argc, char *argv[])\n{\n 0:\t55 \tpush %ebp\n 1:\t89 e5 \tmov %esp,%ebp\n 3:\t83 e4 f0 \tand $0xfffffff0,%esp\n 6:\t83 ec 20 \tsub $0x20,%esp\n int i;\n\n if(argc < 2){\n 9:\t83 7d 08 01 \tcmpl $0x1,0x8(%ebp)\n d:\t7f 19 \tjg 28 \n printf(2, \"Usage: rm files...\\n\");\n f:\tc7 44 24 04 43 08 00 \tmovl $0x843,0x4(%esp)\n 16:\t00 \n 17:\tc7 04 24 02 00 00 00 \tmovl $0x2,(%esp)\n 1e:\te8 54 04 00 00 \tcall 477 \n exit();\n 23:\te8 cf 02 00 00 \tcall 2f7 \n }\n\n for(i = 1; i < argc; i++){\n 28:\tc7 44 24 1c 01 00 00 \tmovl $0x1,0x1c(%esp)\n 2f:\t00 \n 30:\teb 4f \tjmp 81 \n if(unlink(argv[i]) < 0){\n 32:\t8b 44 24 1c \tmov 0x1c(%esp),%eax\n 36:\t8d 14 85 00 00 00 00 \tlea 0x0(,%eax,4),%edx\n 3d:\t8b 45 0c \tmov 0xc(%ebp),%eax\n 40:\t01 d0 \tadd %edx,%eax\n 42:\t8b 00 \tmov (%eax),%eax\n 44:\t89 04 24 \tmov %eax,(%esp)\n 47:\te8 fb 02 00 00 \tcall 347 \n 4c:\t85 c0 \ttest %eax,%eax\n 4e:\t79 2c \tjns 7c \n printf(2, \"rm: %s failed to delete\\n\", argv[i]);\n 50:\t8b 44 24 1c \tmov 0x1c(%esp),%eax\n 54:\t8d 14 85 00 00 00 00 \tlea 0x0(,%eax,4),%edx\n 5b:\t8b 45 0c \tmov 0xc(%ebp),%eax\n 5e:\t01 d0 \tadd %edx,%eax\n 60:\t8b 00 \tmov (%eax),%eax\n 62:\t89 44 24 08 \tmov %eax,0x8(%esp)\n 66:\tc7 44 24 04 57 08 00 \tmovl $0x857,0x4(%esp)\n 6d:\t00 \n 6e:\tc7 04 24 02 00 00 00 \tmovl $0x2,(%esp)\n 75:\te8 fd 03 00 00 \tcall 477 \n break;\n 7a:\teb 0e \tjmp 8a \n if(argc < 2){\n printf(2, \"Usage: rm files...\\n\");\n exit();\n }\n\n for(i = 1; i < argc; i++){\n 7c:\t83 44 24 1c 01 \taddl $0x1,0x1c(%esp)\n 81:\t8b 44 24 1c \tmov 0x1c(%esp),%eax\n 85:\t3b 45 08 \tcmp 0x8(%ebp),%eax\n 88:\t7c a8 \tjl 32 \n printf(2, \"rm: %s failed to delete\\n\", argv[i]);\n break;\n }\n }\n\n exit();\n 8a:\te8 68 02 00 00 \tcall 2f7 \n\n0000008f :\n \"cc\");\n}\n\nstatic inline void\nstosb(void *addr, int data, int cnt)\n{\n 8f:\t55 \tpush %ebp\n 90:\t89 e5 \tmov %esp,%ebp\n 92:\t57 \tpush %edi\n 93:\t53 \tpush %ebx\n asm volatile(\"cld; rep stosb\" :\n 94:\t8b 4d 08 \tmov 0x8(%ebp),%ecx\n 97:\t8b 55 10 \tmov 0x10(%ebp),%edx\n 9a:\t8b 45 0c \tmov 0xc(%ebp),%eax\n 9d:\t89 cb \tmov %ecx,%ebx\n 9f:\t89 df \tmov %ebx,%edi\n a1:\t89 d1 \tmov %edx,%ecx\n a3:\tfc \tcld \n a4:\tf3 aa \trep stos %al,%es:(%edi)\n a6:\t89 ca \tmov %ecx,%edx\n a8:\t89 fb \tmov %edi,%ebx\n aa:\t89 5d 08 \tmov %ebx,0x8(%ebp)\n ad:\t89 55 10 \tmov %edx,0x10(%ebp)\n \"=D\" (addr), \"=c\" (cnt) :\n \"0\" (addr), \"1\" (cnt), \"a\" (data) :\n \"memory\", \"cc\");\n}\n b0:\t5b \tpop %ebx\n b1:\t5f \tpop %edi\n b2:\t5d \tpop %ebp\n b3:\tc3 \tret \n\n000000b4 :\n#include \"user.h\"\n#include \"x86.h\"\n\nchar*\nstrcpy(char *s, char *t)\n{\n b4:\t55 \tpush %ebp\n b5:\t89 e5 \tmov %esp,%ebp\n b7:\t83 ec 10 \tsub $0x10,%esp\n char *os;\n\n os = s;\n ba:\t8b 45 08 \tmov 0x8(%ebp),%eax\n bd:\t89 45 fc \tmov %eax,-0x4(%ebp)\n while((*s++ = *t++) != 0)\n c0:\t90 \tnop\n c1:\t8b 45 08 \tmov 0x8(%ebp),%eax\n c4:\t8d 50 01 \tlea 0x1(%eax),%edx\n c7:\t89 55 08 \tmov %edx,0x8(%ebp)\n ca:\t8b 55 0c \tmov 0xc(%ebp),%edx\n cd:\t8d 4a 01 \tlea 0x1(%edx),%ecx\n d0:\t89 4d 0c \tmov %ecx,0xc(%ebp)\n d3:\t0f b6 12 \tmovzbl (%edx),%edx\n d6:\t88 10 \tmov %dl,(%eax)\n d8:\t0f b6 00 \tmovzbl (%eax),%eax\n db:\t84 c0 \ttest %al,%al\n dd:\t75 e2 \tjne c1 \n ;\n return os;\n df:\t8b 45 fc \tmov -0x4(%ebp),%eax\n}\n e2:\tc9 \tleave \n e3:\tc3 \tret \n\n000000e4 :\n\nint\nstrcmp(const char *p, const char *q)\n{\n e4:\t55 \tpush %ebp\n e5:\t89 e5 \tmov %esp,%ebp\n while(*p && *p == *q)\n e7:\teb 08 \tjmp f1 \n p++, q++;\n e9:\t83 45 08 01 \taddl $0x1,0x8(%ebp)\n ed:\t83 45 0c 01 \taddl $0x1,0xc(%ebp)\n}\n\nint\nstrcmp(const char *p, const char *q)\n{\n while(*p && *p == *q)\n f1:\t8b 45 08 \tmov 0x8(%ebp),%eax\n f4:\t0f b6 00 \tmovzbl (%eax),%eax\n f7:\t84 c0 \ttest %al,%al\n f9:\t74 10 \tje 10b \n fb:\t8b 45 08 \tmov 0x8(%ebp),%eax\n fe:\t0f b6 10 \tmovzbl (%eax),%edx\n 101:\t8b 45 0c \tmov 0xc(%ebp),%eax\n 104:\t0f b6 00 \tmovzbl (%eax),%eax\n 107:\t38 c2 \tcmp %al,%dl\n 109:\t74 de \tje e9 \n p++, q++;\n return (uchar)*p - (uchar)*q;\n 10b:\t8b 45 08 \tmov 0x8(%ebp),%eax\n 10e:\t0f b6 00 \tmovzbl (%eax),%eax\n 111:\t0f b6 d0 \tmovzbl %al,%edx\n 114:\t8b 45 0c \tmov 0xc(%ebp),%eax\n 117:\t0f b6 00 \tmovzbl (%eax),%eax\n 11a:\t0f b6 c0 \tmovzbl %al,%eax\n 11d:\t29 c2 \tsub %eax,%edx\n 11f:\t89 d0 \tmov %edx,%eax\n}\n 121:\t5d \tpop %ebp\n 122:\tc3 \tret \n\n00000123 :\n\nuint\nstrlen(char *s)\n{\n 123:\t55 \tpush %ebp\n 124:\t89 e5 \tmov %esp,%ebp\n 126:\t83 ec 10 \tsub $0x10,%esp\n int n;\n\n for(n = 0; s[n]; n++)\n 129:\tc7 45 fc 00 00 00 00 \tmovl $0x0,-0x4(%ebp)\n 130:\teb 04 \tjmp 136 \n 132:\t83 45 fc 01 \taddl $0x1,-0x4(%ebp)\n 136:\t8b 55 fc \tmov -0x4(%ebp),%edx\n 139:\t8b 45 08 \tmov 0x8(%ebp),%eax\n 13c:\t01 d0 \tadd %edx,%eax\n 13e:\t0f b6 00 \tmovzbl (%eax),%eax\n 141:\t84 c0 \ttest %al,%al\n 143:\t75 ed \tjne 132 \n ;\n return n;\n 145:\t8b 45 fc \tmov -0x4(%ebp),%eax\n}\n 148:\tc9 \tleave \n 149:\tc3 \tret \n\n0000014a :\n\nvoid*\nmemset(void *dst, int c, uint n)\n{\n 14a:\t55 \tpush %ebp\n 14b:\t89 e5 \tmov %esp,%ebp\n 14d:\t83 ec 0c \tsub $0xc,%esp\n stosb(dst, c, n);\n 150:\t8b 45 10 \tmov 0x10(%ebp),%eax\n 153:\t89 44 24 08 \tmov %eax,0x8(%esp)\n 157:\t8b 45 0c \tmov 0xc(%ebp),%eax\n 15a:\t89 44 24 04 \tmov %eax,0x4(%esp)\n 15e:\t8b 45 08 \tmov 0x8(%ebp),%eax\n 161:\t89 04 24 \tmov %eax,(%esp)\n 164:\te8 26 ff ff ff \tcall 8f \n return dst;\n 169:\t8b 45 08 \tmov 0x8(%ebp),%eax\n}\n 16c:\tc9 \tleave \n 16d:\tc3 \tret \n\n0000016e :\n\nchar*\nstrchr(const char *s, char c)\n{\n 16e:\t55 \tpush %ebp\n 16f:\t89 e5 \tmov %esp,%ebp\n 171:\t83 ec 04 \tsub $0x4,%esp\n 174:\t8b 45 0c \tmov 0xc(%ebp),%eax\n 177:\t88 45 fc \tmov %al,-0x4(%ebp)\n for(; *s; s++)\n 17a:\teb 14 \tjmp 190 \n if(*s == c)\n 17c:\t8b 45 08 \tmov 0x8(%ebp),%eax\n 17f:\t0f b6 00 \tmovzbl (%eax),%eax\n 182:\t3a 45 fc \tcmp -0x4(%ebp),%al\n 185:\t75 05 \tjne 18c \n return (char*)s;\n 187:\t8b 45 08 \tmov 0x8(%ebp),%eax\n 18a:\teb 13 \tjmp 19f \n}\n\nchar*\nstrchr(const char *s, char c)\n{\n for(; *s; s++)\n 18c:\t83 45 08 01 \taddl $0x1,0x8(%ebp)\n 190:\t8b 45 08 \tmov 0x8(%ebp),%eax\n 193:\t0f b6 00 \tmovzbl (%eax),%eax\n 196:\t84 c0 \ttest %al,%al\n 198:\t75 e2 \tjne 17c \n if(*s == c)\n return (char*)s;\n return 0;\n 19a:\tb8 00 00 00 00 \tmov $0x0,%eax\n}\n 19f:\tc9 \tleave \n 1a0:\tc3 \tret \n\n000001a1 :\n\nchar*\ngets(char *buf, int max)\n{\n 1a1:\t55 \tpush %ebp\n 1a2:\t89 e5 \tmov %esp,%ebp\n 1a4:\t83 ec 28 \tsub $0x28,%esp\n int i, cc;\n char c;\n\n for(i=0; i+1 < max; ){\n 1a7:\tc7 45 f4 00 00 00 00 \tmovl $0x0,-0xc(%ebp)\n 1ae:\teb 4c \tjmp 1fc \n cc = read(0, &c, 1);\n 1b0:\tc7 44 24 08 01 00 00 \tmovl $0x1,0x8(%esp)\n 1b7:\t00 \n 1b8:\t8d 45 ef \tlea -0x11(%ebp),%eax\n 1bb:\t89 44 24 04 \tmov %eax,0x4(%esp)\n 1bf:\tc7 04 24 00 00 00 00 \tmovl $0x0,(%esp)\n 1c6:\te8 44 01 00 00 \tcall 30f \n 1cb:\t89 45 f0 \tmov %eax,-0x10(%ebp)\n if(cc < 1)\n 1ce:\t83 7d f0 00 \tcmpl $0x0,-0x10(%ebp)\n 1d2:\t7f 02 \tjg 1d6 \n break;\n 1d4:\teb 31 \tjmp 207 \n buf[i++] = c;\n 1d6:\t8b 45 f4 \tmov -0xc(%ebp),%eax\n 1d9:\t8d 50 01 \tlea 0x1(%eax),%edx\n 1dc:\t89 55 f4 \tmov %edx,-0xc(%ebp)\n 1df:\t89 c2 \tmov %eax,%edx\n 1e1:\t8b 45 08 \tmov 0x8(%ebp),%eax\n 1e4:\t01 c2 \tadd %eax,%edx\n 1e6:\t0f b6 45 ef \tmovzbl -0x11(%ebp),%eax\n 1ea:\t88 02 \tmov %al,(%edx)\n if(c == '\\n' || c == '\\r')\n 1ec:\t0f b6 45 ef \tmovzbl -0x11(%ebp),%eax\n 1f0:\t3c 0a \tcmp $0xa,%al\n 1f2:\t74 13 \tje 207 \n 1f4:\t0f b6 45 ef \tmovzbl -0x11(%ebp),%eax\n 1f8:\t3c 0d \tcmp $0xd,%al\n 1fa:\t74 0b \tje 207 \ngets(char *buf, int max)\n{\n int i, cc;\n char c;\n\n for(i=0; i+1 < max; ){\n 1fc:\t8b 45 f4 \tmov -0xc(%ebp),%eax\n 1ff:\t83 c0 01 \tadd $0x1,%eax\n 202:\t3b 45 0c \tcmp 0xc(%ebp),%eax\n 205:\t7c a9 \tjl 1b0 \n break;\n buf[i++] = c;\n if(c == '\\n' || c == '\\r')\n break;\n }\n buf[i] = '\\0';\n 207:\t8b 55 f4 \tmov -0xc(%ebp),%edx\n 20a:\t8b 45 08 \tmov 0x8(%ebp),%eax\n 20d:\t01 d0 \tadd %edx,%eax\n 20f:\tc6 00 00 \tmovb $0x0,(%eax)\n return buf;\n 212:\t8b 45 08 \tmov 0x8(%ebp),%eax\n}\n 215:\tc9 \tleave \n 216:\tc3 \tret \n\n00000217 :\n\nint\nstat(char *n, struct stat *st)\n{\n 217:\t55 \tpush %ebp\n 218:\t89 e5 \tmov %esp,%ebp\n 21a:\t83 ec 28 \tsub $0x28,%esp\n int fd;\n int r;\n \n \n fd = open(n, O_RDONLY);\n 21d:\tc7 44 24 04 00 00 00 \tmovl $0x0,0x4(%esp)\n 224:\t00 \n 225:\t8b 45 08 \tmov 0x8(%ebp),%eax\n 228:\t89 04 24 \tmov %eax,(%esp)\n 22b:\te8 07 01 00 00 \tcall 337 \n 230:\t89 45 f4 \tmov %eax,-0xc(%ebp)\n if(fd < 0)\n 233:\t83 7d f4 00 \tcmpl $0x0,-0xc(%ebp)\n 237:\t79 07 \tjns 240 \n return -1;\n 239:\tb8 ff ff ff ff \tmov $0xffffffff,%eax\n 23e:\teb 23 \tjmp 263 \n r = fstat(fd, st);\n 240:\t8b 45 0c \tmov 0xc(%ebp),%eax\n 243:\t89 44 24 04 \tmov %eax,0x4(%esp)\n 247:\t8b 45 f4 \tmov -0xc(%ebp),%eax\n 24a:\t89 04 24 \tmov %eax,(%esp)\n 24d:\te8 fd 00 00 00 \tcall 34f \n 252:\t89 45 f0 \tmov %eax,-0x10(%ebp)\n close(fd);\n 255:\t8b 45 f4 \tmov -0xc(%ebp),%eax\n 258:\t89 04 24 \tmov %eax,(%esp)\n 25b:\te8 bf 00 00 00 \tcall 31f \n return r;\n 260:\t8b 45 f0 \tmov -0x10(%ebp),%eax\n}\n 263:\tc9 \tleave \n 264:\tc3 \tret \n\n00000265 :\n\nint\natoi(const char *s)\n{\n 265:\t55 \tpush %ebp\n 266:\t89 e5 \tmov %esp,%ebp\n 268:\t83 ec 10 \tsub $0x10,%esp\n int n;\n\n n = 0;\n 26b:\tc7 45 fc 00 00 00 00 \tmovl $0x0,-0x4(%ebp)\n while('0' <= *s && *s <= '9')\n 272:\teb 25 \tjmp 299 \n n = n*10 + *s++ - '0';\n 274:\t8b 55 fc \tmov -0x4(%ebp),%edx\n 277:\t89 d0 \tmov %edx,%eax\n 279:\tc1 e0 02 \tshl $0x2,%eax\n 27c:\t01 d0 \tadd %edx,%eax\n 27e:\t01 c0 \tadd %eax,%eax\n 280:\t89 c1 \tmov %eax,%ecx\n 282:\t8b 45 08 \tmov 0x8(%ebp),%eax\n 285:\t8d 50 01 \tlea 0x1(%eax),%edx\n 288:\t89 55 08 \tmov %edx,0x8(%ebp)\n 28b:\t0f b6 00 \tmovzbl (%eax),%eax\n 28e:\t0f be c0 \tmovsbl %al,%eax\n 291:\t01 c8 \tadd %ecx,%eax\n 293:\t83 e8 30 \tsub $0x30,%eax\n 296:\t89 45 fc \tmov %eax,-0x4(%ebp)\natoi(const char *s)\n{\n int n;\n\n n = 0;\n while('0' <= *s && *s <= '9')\n 299:\t8b 45 08 \tmov 0x8(%ebp),%eax\n 29c:\t0f b6 00 \tmovzbl (%eax),%eax\n 29f:\t3c 2f \tcmp $0x2f,%al\n 2a1:\t7e 0a \tjle 2ad \n 2a3:\t8b 45 08 \tmov 0x8(%ebp),%eax\n 2a6:\t0f b6 00 \tmovzbl (%eax),%eax\n 2a9:\t3c 39 \tcmp $0x39,%al\n 2ab:\t7e c7 \tjle 274 \n n = n*10 + *s++ - '0';\n return n;\n 2ad:\t8b 45 fc \tmov -0x4(%ebp),%eax\n}\n 2b0:\tc9 \tleave \n 2b1:\tc3 \tret \n\n000002b2 :\n\nvoid*\nmemmove(void *vdst, void *vsrc, int n)\n{\n 2b2:\t55 \tpush %ebp\n 2b3:\t89 e5 \tmov %esp,%ebp\n 2b5:\t83 ec 10 \tsub $0x10,%esp\n char *dst, *src;\n \n dst = vdst;\n 2b8:\t8b 45 08 \tmov 0x8(%ebp),%eax\n 2bb:\t89 45 fc \tmov %eax,-0x4(%ebp)\n src = vsrc;\n 2be:\t8b 45 0c \tmov 0xc(%ebp),%eax\n 2c1:\t89 45 f8 \tmov %eax,-0x8(%ebp)\n while(n-- > 0)\n 2c4:\teb 17 \tjmp 2dd \n *dst++ = *src++;\n 2c6:\t8b 45 fc \tmov -0x4(%ebp),%eax\n 2c9:\t8d 50 01 \tlea 0x1(%eax),%edx\n 2cc:\t89 55 fc \tmov %edx,-0x4(%ebp)\n 2cf:\t8b 55 f8 \tmov -0x8(%ebp),%edx\n 2d2:\t8d 4a 01 \tlea 0x1(%edx),%ecx\n 2d5:\t89 4d f8 \tmov %ecx,-0x8(%ebp)\n 2d8:\t0f b6 12 \tmovzbl (%edx),%edx\n 2db:\t88 10 \tmov %dl,(%eax)\n{\n char *dst, *src;\n \n dst = vdst;\n src = vsrc;\n while(n-- > 0)\n 2dd:\t8b 45 10 \tmov 0x10(%ebp),%eax\n 2e0:\t8d 50 ff \tlea -0x1(%eax),%edx\n 2e3:\t89 55 10 \tmov %edx,0x10(%ebp)\n 2e6:\t85 c0 \ttest %eax,%eax\n 2e8:\t7f dc \tjg 2c6 \n *dst++ = *src++;\n return vdst;\n 2ea:\t8b 45 08 \tmov 0x8(%ebp),%eax\n}\n 2ed:\tc9 \tleave \n 2ee:\tc3 \tret \n\n000002ef :\n name: \\\n movl $SYS_ ## name, %eax; \\\n int $T_SYSCALL; \\\n ret\n\nSYSCALL(fork)\n 2ef:\tb8 01 00 00 00 \tmov $0x1,%eax\n 2f4:\tcd 40 \tint $0x40\n 2f6:\tc3 \tret \n\n000002f7 :\nSYSCALL(exit)\n 2f7:\tb8 02 00 00 00 \tmov $0x2,%eax\n 2fc:\tcd 40 \tint $0x40\n 2fe:\tc3 \tret \n\n000002ff :\nSYSCALL(wait)\n 2ff:\tb8 03 00 00 00 \tmov $0x3,%eax\n 304:\tcd 40 \tint $0x40\n 306:\tc3 \tret \n\n00000307 :\nSYSCALL(pipe)\n 307:\tb8 04 00 00 00 \tmov $0x4,%eax\n 30c:\tcd 40 \tint $0x40\n 30e:\tc3 \tret \n\n0000030f :\nSYSCALL(read)\n 30f:\tb8 05 00 00 00 \tmov $0x5,%eax\n 314:\tcd 40 \tint $0x40\n 316:\tc3 \tret \n\n00000317 :\nSYSCALL(write)\n 317:\tb8 10 00 00 00 \tmov $0x10,%eax\n 31c:\tcd 40 \tint $0x40\n 31e:\tc3 \tret \n\n0000031f :\nSYSCALL(close)\n 31f:\tb8 15 00 00 00 \tmov $0x15,%eax\n 324:\tcd 40 \tint $0x40\n 326:\tc3 \tret \n\n00000327 :\nSYSCALL(kill)\n 327:\tb8 06 00 00 00 \tmov $0x6,%eax\n 32c:\tcd 40 \tint $0x40\n 32e:\tc3 \tret \n\n0000032f :\nSYSCALL(exec)\n 32f:\tb8 07 00 00 00 \tmov $0x7,%eax\n 334:\tcd 40 \tint $0x40\n 336:\tc3 \tret \n\n00000337 :\nSYSCALL(open)\n 337:\tb8 0f 00 00 00 \tmov $0xf,%eax\n 33c:\tcd 40 \tint $0x40\n 33e:\tc3 \tret \n\n0000033f :\nSYSCALL(mknod)\n 33f:\tb8 11 00 00 00 \tmov $0x11,%eax\n 344:\tcd 40 \tint $0x40\n 346:\tc3 \tret \n\n00000347 :\nSYSCALL(unlink)\n 347:\tb8 12 00 00 00 \tmov $0x12,%eax\n 34c:\tcd 40 \tint $0x40\n 34e:\tc3 \tret \n\n0000034f :\nSYSCALL(fstat)\n 34f:\tb8 08 00 00 00 \tmov $0x8,%eax\n 354:\tcd 40 \tint $0x40\n 356:\tc3 \tret \n\n00000357 :\nSYSCALL(link)\n 357:\tb8 13 00 00 00 \tmov $0x13,%eax\n 35c:\tcd 40 \tint $0x40\n 35e:\tc3 \tret \n\n0000035f :\nSYSCALL(mkdir)\n 35f:\tb8 14 00 00 00 \tmov $0x14,%eax\n 364:\tcd 40 \tint $0x40\n 366:\tc3 \tret \n\n00000367 :\nSYSCALL(chdir)\n 367:\tb8 09 00 00 00 \tmov $0x9,%eax\n 36c:\tcd 40 \tint $0x40\n 36e:\tc3 \tret \n\n0000036f :\nSYSCALL(dup)\n 36f:\tb8 0a 00 00 00 \tmov $0xa,%eax\n 374:\tcd 40 \tint $0x40\n 376:\tc3 \tret \n\n00000377 :\nSYSCALL(getpid)\n 377:\tb8 0b 00 00 00 \tmov $0xb,%eax\n 37c:\tcd 40 \tint $0x40\n 37e:\tc3 \tret \n\n0000037f :\nSYSCALL(sbrk)\n 37f:\tb8 0c 00 00 00 \tmov $0xc,%eax\n 384:\tcd 40 \tint $0x40\n 386:\tc3 \tret \n\n00000387 :\nSYSCALL(sleep)\n 387:\tb8 0d 00 00 00 \tmov $0xd,%eax\n 38c:\tcd 40 \tint $0x40\n 38e:\tc3 \tret \n\n0000038f :\nSYSCALL(uptime)\n 38f:\tb8 0e 00 00 00 \tmov $0xe,%eax\n 394:\tcd 40 \tint $0x40\n 396:\tc3 \tret \n\n00000397 :\n#include \"stat.h\"\n#include \"user.h\"\n\nstatic void\nputc(int fd, char c)\n{\n 397:\t55 \tpush %ebp\n 398:\t89 e5 \tmov %esp,%ebp\n 39a:\t83 ec 18 \tsub $0x18,%esp\n 39d:\t8b 45 0c \tmov 0xc(%ebp),%eax\n 3a0:\t88 45 f4 \tmov %al,-0xc(%ebp)\n write(fd, &c, 1);\n 3a3:\tc7 44 24 08 01 00 00 \tmovl $0x1,0x8(%esp)\n 3aa:\t00 \n 3ab:\t8d 45 f4 \tlea -0xc(%ebp),%eax\n 3ae:\t89 44 24 04 \tmov %eax,0x4(%esp)\n 3b2:\t8b 45 08 \tmov 0x8(%ebp),%eax\n 3b5:\t89 04 24 \tmov %eax,(%esp)\n 3b8:\te8 5a ff ff ff \tcall 317 \n}\n 3bd:\tc9 \tleave \n 3be:\tc3 \tret \n\n000003bf :\n\nstatic void\nprintint(int fd, int xx, int base, int sgn)\n{\n 3bf:\t55 \tpush %ebp\n 3c0:\t89 e5 \tmov %esp,%ebp\n 3c2:\t56 \tpush %esi\n 3c3:\t53 \tpush %ebx\n 3c4:\t83 ec 30 \tsub $0x30,%esp\n static char digits[] = \"0123456789ABCDEF\";\n char buf[16];\n int i, neg;\n uint x;\n\n neg = 0;\n 3c7:\tc7 45 f0 00 00 00 00 \tmovl $0x0,-0x10(%ebp)\n if(sgn && xx < 0){\n 3ce:\t83 7d 14 00 \tcmpl $0x0,0x14(%ebp)\n 3d2:\t74 17 \tje 3eb \n 3d4:\t83 7d 0c 00 \tcmpl $0x0,0xc(%ebp)\n 3d8:\t79 11 \tjns 3eb \n neg = 1;\n 3da:\tc7 45 f0 01 00 00 00 \tmovl $0x1,-0x10(%ebp)\n x = -xx;\n 3e1:\t8b 45 0c \tmov 0xc(%ebp),%eax\n 3e4:\tf7 d8 \tneg %eax\n 3e6:\t89 45 ec \tmov %eax,-0x14(%ebp)\n 3e9:\teb 06 \tjmp 3f1 \n } else {\n x = xx;\n 3eb:\t8b 45 0c \tmov 0xc(%ebp),%eax\n 3ee:\t89 45 ec \tmov %eax,-0x14(%ebp)\n }\n\n i = 0;\n 3f1:\tc7 45 f4 00 00 00 00 \tmovl $0x0,-0xc(%ebp)\n do{\n buf[i++] = digits[x % base];\n 3f8:\t8b 4d f4 \tmov -0xc(%ebp),%ecx\n 3fb:\t8d 41 01 \tlea 0x1(%ecx),%eax\n 3fe:\t89 45 f4 \tmov %eax,-0xc(%ebp)\n 401:\t8b 5d 10 \tmov 0x10(%ebp),%ebx\n 404:\t8b 45 ec \tmov -0x14(%ebp),%eax\n 407:\tba 00 00 00 00 \tmov $0x0,%edx\n 40c:\tf7 f3 \tdiv %ebx\n 40e:\t89 d0 \tmov %edx,%eax\n 410:\t0f b6 80 bc 0a 00 00 \tmovzbl 0xabc(%eax),%eax\n 417:\t88 44 0d dc \tmov %al,-0x24(%ebp,%ecx,1)\n }while((x /= base) != 0);\n 41b:\t8b 75 10 \tmov 0x10(%ebp),%esi\n 41e:\t8b 45 ec \tmov -0x14(%ebp),%eax\n 421:\tba 00 00 00 00 \tmov $0x0,%edx\n 426:\tf7 f6 \tdiv %esi\n 428:\t89 45 ec \tmov %eax,-0x14(%ebp)\n 42b:\t83 7d ec 00 \tcmpl $0x0,-0x14(%ebp)\n 42f:\t75 c7 \tjne 3f8 \n if(neg)\n 431:\t83 7d f0 00 \tcmpl $0x0,-0x10(%ebp)\n 435:\t74 10 \tje 447 \n buf[i++] = '-';\n 437:\t8b 45 f4 \tmov -0xc(%ebp),%eax\n 43a:\t8d 50 01 \tlea 0x1(%eax),%edx\n 43d:\t89 55 f4 \tmov %edx,-0xc(%ebp)\n 440:\tc6 44 05 dc 2d \tmovb $0x2d,-0x24(%ebp,%eax,1)\n\n while(--i >= 0)\n 445:\teb 1f \tjmp 466 \n 447:\teb 1d \tjmp 466 \n putc(fd, buf[i]);\n 449:\t8d 55 dc \tlea -0x24(%ebp),%edx\n 44c:\t8b 45 f4 \tmov -0xc(%ebp),%eax\n 44f:\t01 d0 \tadd %edx,%eax\n 451:\t0f b6 00 \tmovzbl (%eax),%eax\n 454:\t0f be c0 \tmovsbl %al,%eax\n 457:\t89 44 24 04 \tmov %eax,0x4(%esp)\n 45b:\t8b 45 08 \tmov 0x8(%ebp),%eax\n 45e:\t89 04 24 \tmov %eax,(%esp)\n 461:\te8 31 ff ff ff \tcall 397 \n buf[i++] = digits[x % base];\n }while((x /= base) != 0);\n if(neg)\n buf[i++] = '-';\n\n while(--i >= 0)\n 466:\t83 6d f4 01 \tsubl $0x1,-0xc(%ebp)\n 46a:\t83 7d f4 00 \tcmpl $0x0,-0xc(%ebp)\n 46e:\t79 d9 \tjns 449 \n putc(fd, buf[i]);\n}\n 470:\t83 c4 30 \tadd $0x30,%esp\n 473:\t5b \tpop %ebx\n 474:\t5e \tpop %esi\n 475:\t5d \tpop %ebp\n 476:\tc3 \tret \n\n00000477 :\n\n// Print to the given fd. Only understands %d, %x, %p, %s.\nvoid\nprintf(int fd, char *fmt, ...)\n{\n 477:\t55 \tpush %ebp\n 478:\t89 e5 \tmov %esp,%ebp\n 47a:\t83 ec 38 \tsub $0x38,%esp\n char *s;\n int c, i, state;\n uint *ap;\n\n state = 0;\n 47d:\tc7 45 ec 00 00 00 00 \tmovl $0x0,-0x14(%ebp)\n ap = (uint*)(void*)&fmt + 1;\n 484:\t8d 45 0c \tlea 0xc(%ebp),%eax\n 487:\t83 c0 04 \tadd $0x4,%eax\n 48a:\t89 45 e8 \tmov %eax,-0x18(%ebp)\n for(i = 0; fmt[i]; i++){\n 48d:\tc7 45 f0 00 00 00 00 \tmovl $0x0,-0x10(%ebp)\n 494:\te9 7c 01 00 00 \tjmp 615 \n c = fmt[i] & 0xff;\n 499:\t8b 55 0c \tmov 0xc(%ebp),%edx\n 49c:\t8b 45 f0 \tmov -0x10(%ebp),%eax\n 49f:\t01 d0 \tadd %edx,%eax\n 4a1:\t0f b6 00 \tmovzbl (%eax),%eax\n 4a4:\t0f be c0 \tmovsbl %al,%eax\n 4a7:\t25 ff 00 00 00 \tand $0xff,%eax\n 4ac:\t89 45 e4 \tmov %eax,-0x1c(%ebp)\n if(state == 0){\n 4af:\t83 7d ec 00 \tcmpl $0x0,-0x14(%ebp)\n 4b3:\t75 2c \tjne 4e1 \n if(c == '%'){\n 4b5:\t83 7d e4 25 \tcmpl $0x25,-0x1c(%ebp)\n 4b9:\t75 0c \tjne 4c7 \n state = '%';\n 4bb:\tc7 45 ec 25 00 00 00 \tmovl $0x25,-0x14(%ebp)\n 4c2:\te9 4a 01 00 00 \tjmp 611 \n } else {\n putc(fd, c);\n 4c7:\t8b 45 e4 \tmov -0x1c(%ebp),%eax\n 4ca:\t0f be c0 \tmovsbl %al,%eax\n 4cd:\t89 44 24 04 \tmov %eax,0x4(%esp)\n 4d1:\t8b 45 08 \tmov 0x8(%ebp),%eax\n 4d4:\t89 04 24 \tmov %eax,(%esp)\n 4d7:\te8 bb fe ff ff \tcall 397 \n 4dc:\te9 30 01 00 00 \tjmp 611 \n }\n } else if(state == '%'){\n 4e1:\t83 7d ec 25 \tcmpl $0x25,-0x14(%ebp)\n 4e5:\t0f 85 26 01 00 00 \tjne 611 \n if(c == 'd'){\n 4eb:\t83 7d e4 64 \tcmpl $0x64,-0x1c(%ebp)\n 4ef:\t75 2d \tjne 51e \n printint(fd, *ap, 10, 1);\n 4f1:\t8b 45 e8 \tmov -0x18(%ebp),%eax\n 4f4:\t8b 00 \tmov (%eax),%eax\n 4f6:\tc7 44 24 0c 01 00 00 \tmovl $0x1,0xc(%esp)\n 4fd:\t00 \n 4fe:\tc7 44 24 08 0a 00 00 \tmovl $0xa,0x8(%esp)\n 505:\t00 \n 506:\t89 44 24 04 \tmov %eax,0x4(%esp)\n 50a:\t8b 45 08 \tmov 0x8(%ebp),%eax\n 50d:\t89 04 24 \tmov %eax,(%esp)\n 510:\te8 aa fe ff ff \tcall 3bf \n ap++;\n 515:\t83 45 e8 04 \taddl $0x4,-0x18(%ebp)\n 519:\te9 ec 00 00 00 \tjmp 60a \n } else if(c == 'x' || c == 'p'){\n 51e:\t83 7d e4 78 \tcmpl $0x78,-0x1c(%ebp)\n 522:\t74 06 \tje 52a \n 524:\t83 7d e4 70 \tcmpl $0x70,-0x1c(%ebp)\n 528:\t75 2d \tjne 557 \n printint(fd, *ap, 16, 0);\n 52a:\t8b 45 e8 \tmov -0x18(%ebp),%eax\n 52d:\t8b 00 \tmov (%eax),%eax\n 52f:\tc7 44 24 0c 00 00 00 \tmovl $0x0,0xc(%esp)\n 536:\t00 \n 537:\tc7 44 24 08 10 00 00 \tmovl $0x10,0x8(%esp)\n 53e:\t00 \n 53f:\t89 44 24 04 \tmov %eax,0x4(%esp)\n 543:\t8b 45 08 \tmov 0x8(%ebp),%eax\n 546:\t89 04 24 \tmov %eax,(%esp)\n 549:\te8 71 fe ff ff \tcall 3bf \n ap++;\n 54e:\t83 45 e8 04 \taddl $0x4,-0x18(%ebp)\n 552:\te9 b3 00 00 00 \tjmp 60a \n } else if(c == 's'){\n 557:\t83 7d e4 73 \tcmpl $0x73,-0x1c(%ebp)\n 55b:\t75 45 \tjne 5a2 \n s = (char*)*ap;\n 55d:\t8b 45 e8 \tmov -0x18(%ebp),%eax\n 560:\t8b 00 \tmov (%eax),%eax\n 562:\t89 45 f4 \tmov %eax,-0xc(%ebp)\n ap++;\n 565:\t83 45 e8 04 \taddl $0x4,-0x18(%ebp)\n if(s == 0)\n 569:\t83 7d f4 00 \tcmpl $0x0,-0xc(%ebp)\n 56d:\t75 09 \tjne 578 \n s = \"(null)\";\n 56f:\tc7 45 f4 70 08 00 00 \tmovl $0x870,-0xc(%ebp)\n while(*s != 0){\n 576:\teb 1e \tjmp 596 \n 578:\teb 1c \tjmp 596 \n putc(fd, *s);\n 57a:\t8b 45 f4 \tmov -0xc(%ebp),%eax\n 57d:\t0f b6 00 \tmovzbl (%eax),%eax\n 580:\t0f be c0 \tmovsbl %al,%eax\n 583:\t89 44 24 04 \tmov %eax,0x4(%esp)\n 587:\t8b 45 08 \tmov 0x8(%ebp),%eax\n 58a:\t89 04 24 \tmov %eax,(%esp)\n 58d:\te8 05 fe ff ff \tcall 397 \n s++;\n 592:\t83 45 f4 01 \taddl $0x1,-0xc(%ebp)\n } else if(c == 's'){\n s = (char*)*ap;\n ap++;\n if(s == 0)\n s = \"(null)\";\n while(*s != 0){\n 596:\t8b 45 f4 \tmov -0xc(%ebp),%eax\n 599:\t0f b6 00 \tmovzbl (%eax),%eax\n 59c:\t84 c0 \ttest %al,%al\n 59e:\t75 da \tjne 57a \n 5a0:\teb 68 \tjmp 60a \n putc(fd, *s);\n s++;\n }\n } else if(c == 'c'){\n 5a2:\t83 7d e4 63 \tcmpl $0x63,-0x1c(%ebp)\n 5a6:\t75 1d \tjne 5c5 \n putc(fd, *ap);\n 5a8:\t8b 45 e8 \tmov -0x18(%ebp),%eax\n 5ab:\t8b 00 \tmov (%eax),%eax\n 5ad:\t0f be c0 \tmovsbl %al,%eax\n 5b0:\t89 44 24 04 \tmov %eax,0x4(%esp)\n 5b4:\t8b 45 08 \tmov 0x8(%ebp),%eax\n 5b7:\t89 04 24 \tmov %eax,(%esp)\n 5ba:\te8 d8 fd ff ff \tcall 397 \n ap++;\n 5bf:\t83 45 e8 04 \taddl $0x4,-0x18(%ebp)\n 5c3:\teb 45 \tjmp 60a \n } else if(c == '%'){\n 5c5:\t83 7d e4 25 \tcmpl $0x25,-0x1c(%ebp)\n 5c9:\t75 17 \tjne 5e2 \n putc(fd, c);\n 5cb:\t8b 45 e4 \tmov -0x1c(%ebp),%eax\n 5ce:\t0f be c0 \tmovsbl %al,%eax\n 5d1:\t89 44 24 04 \tmov %eax,0x4(%esp)\n 5d5:\t8b 45 08 \tmov 0x8(%ebp),%eax\n 5d8:\t89 04 24 \tmov %eax,(%esp)\n 5db:\te8 b7 fd ff ff \tcall 397 \n 5e0:\teb 28 \tjmp 60a \n } else {\n // Unknown % sequence. Print it to draw attention.\n putc(fd, '%');\n 5e2:\tc7 44 24 04 25 00 00 \tmovl $0x25,0x4(%esp)\n 5e9:\t00 \n 5ea:\t8b 45 08 \tmov 0x8(%ebp),%eax\n 5ed:\t89 04 24 \tmov %eax,(%esp)\n 5f0:\te8 a2 fd ff ff \tcall 397 \n putc(fd, c);\n 5f5:\t8b 45 e4 \tmov -0x1c(%ebp),%eax\n 5f8:\t0f be c0 \tmovsbl %al,%eax\n 5fb:\t89 44 24 04 \tmov %eax,0x4(%esp)\n 5ff:\t8b 45 08 \tmov 0x8(%ebp),%eax\n 602:\t89 04 24 \tmov %eax,(%esp)\n 605:\te8 8d fd ff ff \tcall 397 \n }\n state = 0;\n 60a:\tc7 45 ec 00 00 00 00 \tmovl $0x0,-0x14(%ebp)\n int c, i, state;\n uint *ap;\n\n state = 0;\n ap = (uint*)(void*)&fmt + 1;\n for(i = 0; fmt[i]; i++){\n 611:\t83 45 f0 01 \taddl $0x1,-0x10(%ebp)\n 615:\t8b 55 0c \tmov 0xc(%ebp),%edx\n 618:\t8b 45 f0 \tmov -0x10(%ebp),%eax\n 61b:\t01 d0 \tadd %edx,%eax\n 61d:\t0f b6 00 \tmovzbl (%eax),%eax\n 620:\t84 c0 \ttest %al,%al\n 622:\t0f 85 71 fe ff ff \tjne 499 \n putc(fd, c);\n }\n state = 0;\n }\n }\n}\n 628:\tc9 \tleave \n 629:\tc3 \tret \n\n0000062a :\nstatic Header base;\nstatic Header *freep;\n\nvoid\nfree(void *ap)\n{\n 62a:\t55 \tpush %ebp\n 62b:\t89 e5 \tmov %esp,%ebp\n 62d:\t83 ec 10 \tsub $0x10,%esp\n Header *bp, *p;\n\n bp = (Header*)ap - 1;\n 630:\t8b 45 08 \tmov 0x8(%ebp),%eax\n 633:\t83 e8 08 \tsub $0x8,%eax\n 636:\t89 45 f8 \tmov %eax,-0x8(%ebp)\n for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)\n 639:\ta1 d8 0a 00 00 \tmov 0xad8,%eax\n 63e:\t89 45 fc \tmov %eax,-0x4(%ebp)\n 641:\teb 24 \tjmp 667 \n if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))\n 643:\t8b 45 fc \tmov -0x4(%ebp),%eax\n 646:\t8b 00 \tmov (%eax),%eax\n 648:\t3b 45 fc \tcmp -0x4(%ebp),%eax\n 64b:\t77 12 \tja 65f \n 64d:\t8b 45 f8 \tmov -0x8(%ebp),%eax\n 650:\t3b 45 fc \tcmp -0x4(%ebp),%eax\n 653:\t77 24 \tja 679 \n 655:\t8b 45 fc \tmov -0x4(%ebp),%eax\n 658:\t8b 00 \tmov (%eax),%eax\n 65a:\t3b 45 f8 \tcmp -0x8(%ebp),%eax\n 65d:\t77 1a \tja 679 \nfree(void *ap)\n{\n Header *bp, *p;\n\n bp = (Header*)ap - 1;\n for(p = freep; !(bp > p && bp < p->s.ptr); p = p->s.ptr)\n 65f:\t8b 45 fc \tmov -0x4(%ebp),%eax\n 662:\t8b 00 \tmov (%eax),%eax\n 664:\t89 45 fc \tmov %eax,-0x4(%ebp)\n 667:\t8b 45 f8 \tmov -0x8(%ebp),%eax\n 66a:\t3b 45 fc \tcmp -0x4(%ebp),%eax\n 66d:\t76 d4 \tjbe 643 \n 66f:\t8b 45 fc \tmov -0x4(%ebp),%eax\n 672:\t8b 00 \tmov (%eax),%eax\n 674:\t3b 45 f8 \tcmp -0x8(%ebp),%eax\n 677:\t76 ca \tjbe 643 \n if(p >= p->s.ptr && (bp > p || bp < p->s.ptr))\n break;\n if(bp + bp->s.size == p->s.ptr){\n 679:\t8b 45 f8 \tmov -0x8(%ebp),%eax\n 67c:\t8b 40 04 \tmov 0x4(%eax),%eax\n 67f:\t8d 14 c5 00 00 00 00 \tlea 0x0(,%eax,8),%edx\n 686:\t8b 45 f8 \tmov -0x8(%ebp),%eax\n 689:\t01 c2 \tadd %eax,%edx\n 68b:\t8b 45 fc \tmov -0x4(%ebp),%eax\n 68e:\t8b 00 \tmov (%eax),%eax\n 690:\t39 c2 \tcmp %eax,%edx\n 692:\t75 24 \tjne 6b8 \n bp->s.size += p->s.ptr->s.size;\n 694:\t8b 45 f8 \tmov -0x8(%ebp),%eax\n 697:\t8b 50 04 \tmov 0x4(%eax),%edx\n 69a:\t8b 45 fc \tmov -0x4(%ebp),%eax\n 69d:\t8b 00 \tmov (%eax),%eax\n 69f:\t8b 40 04 \tmov 0x4(%eax),%eax\n 6a2:\t01 c2 \tadd %eax,%edx\n 6a4:\t8b 45 f8 \tmov -0x8(%ebp),%eax\n 6a7:\t89 50 04 \tmov %edx,0x4(%eax)\n bp->s.ptr = p->s.ptr->s.ptr;\n 6aa:\t8b 45 fc \tmov -0x4(%ebp),%eax\n 6ad:\t8b 00 \tmov (%eax),%eax\n 6af:\t8b 10 \tmov (%eax),%edx\n 6b1:\t8b 45 f8 \tmov -0x8(%ebp),%eax\n 6b4:\t89 10 \tmov %edx,(%eax)\n 6b6:\teb 0a \tjmp 6c2 \n } else\n bp->s.ptr = p->s.ptr;\n 6b8:\t8b 45 fc \tmov -0x4(%ebp),%eax\n 6bb:\t8b 10 \tmov (%eax),%edx\n 6bd:\t8b 45 f8 \tmov -0x8(%ebp),%eax\n 6c0:\t89 10 \tmov %edx,(%eax)\n if(p + p->s.size == bp){\n 6c2:\t8b 45 fc \tmov -0x4(%ebp),%eax\n 6c5:\t8b 40 04 \tmov 0x4(%eax),%eax\n 6c8:\t8d 14 c5 00 00 00 00 \tlea 0x0(,%eax,8),%edx\n 6cf:\t8b 45 fc \tmov -0x4(%ebp),%eax\n 6d2:\t01 d0 \tadd %edx,%eax\n 6d4:\t3b 45 f8 \tcmp -0x8(%ebp),%eax\n 6d7:\t75 20 \tjne 6f9 \n p->s.size += bp->s.size;\n 6d9:\t8b 45 fc \tmov -0x4(%ebp),%eax\n 6dc:\t8b 50 04 \tmov 0x4(%eax),%edx\n 6df:\t8b 45 f8 \tmov -0x8(%ebp),%eax\n 6e2:\t8b 40 04 \tmov 0x4(%eax),%eax\n 6e5:\t01 c2 \tadd %eax,%edx\n 6e7:\t8b 45 fc \tmov -0x4(%ebp),%eax\n 6ea:\t89 50 04 \tmov %edx,0x4(%eax)\n p->s.ptr = bp->s.ptr;\n 6ed:\t8b 45 f8 \tmov -0x8(%ebp),%eax\n 6f0:\t8b 10 \tmov (%eax),%edx\n 6f2:\t8b 45 fc \tmov -0x4(%ebp),%eax\n 6f5:\t89 10 \tmov %edx,(%eax)\n 6f7:\teb 08 \tjmp 701 \n } else\n p->s.ptr = bp;\n 6f9:\t8b 45 fc \tmov -0x4(%ebp),%eax\n 6fc:\t8b 55 f8 \tmov -0x8(%ebp),%edx\n 6ff:\t89 10 \tmov %edx,(%eax)\n freep = p;\n 701:\t8b 45 fc \tmov -0x4(%ebp),%eax\n 704:\ta3 d8 0a 00 00 \tmov %eax,0xad8\n}\n 709:\tc9 \tleave \n 70a:\tc3 \tret \n\n0000070b :\n\nstatic Header*\nmorecore(uint nu)\n{\n 70b:\t55 \tpush %ebp\n 70c:\t89 e5 \tmov %esp,%ebp\n 70e:\t83 ec 28 \tsub $0x28,%esp\n char *p;\n Header *hp;\n\n if(nu < 4096)\n 711:\t81 7d 08 ff 0f 00 00 \tcmpl $0xfff,0x8(%ebp)\n 718:\t77 07 \tja 721 \n nu = 4096;\n 71a:\tc7 45 08 00 10 00 00 \tmovl $0x1000,0x8(%ebp)\n p = sbrk(nu * sizeof(Header));\n 721:\t8b 45 08 \tmov 0x8(%ebp),%eax\n 724:\tc1 e0 03 \tshl $0x3,%eax\n 727:\t89 04 24 \tmov %eax,(%esp)\n 72a:\te8 50 fc ff ff \tcall 37f \n 72f:\t89 45 f4 \tmov %eax,-0xc(%ebp)\n if(p == (char*)-1)\n 732:\t83 7d f4 ff \tcmpl $0xffffffff,-0xc(%ebp)\n 736:\t75 07 \tjne 73f \n return 0;\n 738:\tb8 00 00 00 00 \tmov $0x0,%eax\n 73d:\teb 22 \tjmp 761 \n hp = (Header*)p;\n 73f:\t8b 45 f4 \tmov -0xc(%ebp),%eax\n 742:\t89 45 f0 \tmov %eax,-0x10(%ebp)\n hp->s.size = nu;\n 745:\t8b 45 f0 \tmov -0x10(%ebp),%eax\n 748:\t8b 55 08 \tmov 0x8(%ebp),%edx\n 74b:\t89 50 04 \tmov %edx,0x4(%eax)\n free((void*)(hp + 1));\n 74e:\t8b 45 f0 \tmov -0x10(%ebp),%eax\n 751:\t83 c0 08 \tadd $0x8,%eax\n 754:\t89 04 24 \tmov %eax,(%esp)\n 757:\te8 ce fe ff ff \tcall 62a \n return freep;\n 75c:\ta1 d8 0a 00 00 \tmov 0xad8,%eax\n}\n 761:\tc9 \tleave \n 762:\tc3 \tret \n\n00000763 :\n\nvoid*\nmalloc(uint nbytes)\n{\n 763:\t55 \tpush %ebp\n 764:\t89 e5 \tmov %esp,%ebp\n 766:\t83 ec 28 \tsub $0x28,%esp\n Header *p, *prevp;\n uint nunits;\n\n nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;\n 769:\t8b 45 08 \tmov 0x8(%ebp),%eax\n 76c:\t83 c0 07 \tadd $0x7,%eax\n 76f:\tc1 e8 03 \tshr $0x3,%eax\n 772:\t83 c0 01 \tadd $0x1,%eax\n 775:\t89 45 ec \tmov %eax,-0x14(%ebp)\n if((prevp = freep) == 0){\n 778:\ta1 d8 0a 00 00 \tmov 0xad8,%eax\n 77d:\t89 45 f0 \tmov %eax,-0x10(%ebp)\n 780:\t83 7d f0 00 \tcmpl $0x0,-0x10(%ebp)\n 784:\t75 23 \tjne 7a9 \n base.s.ptr = freep = prevp = &base;\n 786:\tc7 45 f0 d0 0a 00 00 \tmovl $0xad0,-0x10(%ebp)\n 78d:\t8b 45 f0 \tmov -0x10(%ebp),%eax\n 790:\ta3 d8 0a 00 00 \tmov %eax,0xad8\n 795:\ta1 d8 0a 00 00 \tmov 0xad8,%eax\n 79a:\ta3 d0 0a 00 00 \tmov %eax,0xad0\n base.s.size = 0;\n 79f:\tc7 05 d4 0a 00 00 00 \tmovl $0x0,0xad4\n 7a6:\t00 00 00 \n }\n for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){\n 7a9:\t8b 45 f0 \tmov -0x10(%ebp),%eax\n 7ac:\t8b 00 \tmov (%eax),%eax\n 7ae:\t89 45 f4 \tmov %eax,-0xc(%ebp)\n if(p->s.size >= nunits){\n 7b1:\t8b 45 f4 \tmov -0xc(%ebp),%eax\n 7b4:\t8b 40 04 \tmov 0x4(%eax),%eax\n 7b7:\t3b 45 ec \tcmp -0x14(%ebp),%eax\n 7ba:\t72 4d \tjb 809 \n if(p->s.size == nunits)\n 7bc:\t8b 45 f4 \tmov -0xc(%ebp),%eax\n 7bf:\t8b 40 04 \tmov 0x4(%eax),%eax\n 7c2:\t3b 45 ec \tcmp -0x14(%ebp),%eax\n 7c5:\t75 0c \tjne 7d3 \n prevp->s.ptr = p->s.ptr;\n 7c7:\t8b 45 f4 \tmov -0xc(%ebp),%eax\n 7ca:\t8b 10 \tmov (%eax),%edx\n 7cc:\t8b 45 f0 \tmov -0x10(%ebp),%eax\n 7cf:\t89 10 \tmov %edx,(%eax)\n 7d1:\teb 26 \tjmp 7f9 \n else {\n p->s.size -= nunits;\n 7d3:\t8b 45 f4 \tmov -0xc(%ebp),%eax\n 7d6:\t8b 40 04 \tmov 0x4(%eax),%eax\n 7d9:\t2b 45 ec \tsub -0x14(%ebp),%eax\n 7dc:\t89 c2 \tmov %eax,%edx\n 7de:\t8b 45 f4 \tmov -0xc(%ebp),%eax\n 7e1:\t89 50 04 \tmov %edx,0x4(%eax)\n p += p->s.size;\n 7e4:\t8b 45 f4 \tmov -0xc(%ebp),%eax\n 7e7:\t8b 40 04 \tmov 0x4(%eax),%eax\n 7ea:\tc1 e0 03 \tshl $0x3,%eax\n 7ed:\t01 45 f4 \tadd %eax,-0xc(%ebp)\n p->s.size = nunits;\n 7f0:\t8b 45 f4 \tmov -0xc(%ebp),%eax\n 7f3:\t8b 55 ec \tmov -0x14(%ebp),%edx\n 7f6:\t89 50 04 \tmov %edx,0x4(%eax)\n }\n freep = prevp;\n 7f9:\t8b 45 f0 \tmov -0x10(%ebp),%eax\n 7fc:\ta3 d8 0a 00 00 \tmov %eax,0xad8\n return (void*)(p + 1);\n 801:\t8b 45 f4 \tmov -0xc(%ebp),%eax\n 804:\t83 c0 08 \tadd $0x8,%eax\n 807:\teb 38 \tjmp 841 \n }\n if(p == freep)\n 809:\ta1 d8 0a 00 00 \tmov 0xad8,%eax\n 80e:\t39 45 f4 \tcmp %eax,-0xc(%ebp)\n 811:\t75 1b \tjne 82e \n if((p = morecore(nunits)) == 0)\n 813:\t8b 45 ec \tmov -0x14(%ebp),%eax\n 816:\t89 04 24 \tmov %eax,(%esp)\n 819:\te8 ed fe ff ff \tcall 70b \n 81e:\t89 45 f4 \tmov %eax,-0xc(%ebp)\n 821:\t83 7d f4 00 \tcmpl $0x0,-0xc(%ebp)\n 825:\t75 07 \tjne 82e \n return 0;\n 827:\tb8 00 00 00 00 \tmov $0x0,%eax\n 82c:\teb 13 \tjmp 841 \n nunits = (nbytes + sizeof(Header) - 1)/sizeof(Header) + 1;\n if((prevp = freep) == 0){\n base.s.ptr = freep = prevp = &base;\n base.s.size = 0;\n }\n for(p = prevp->s.ptr; ; prevp = p, p = p->s.ptr){\n 82e:\t8b 45 f4 \tmov -0xc(%ebp),%eax\n 831:\t89 45 f0 \tmov %eax,-0x10(%ebp)\n 834:\t8b 45 f4 \tmov -0xc(%ebp),%eax\n 837:\t8b 00 \tmov (%eax),%eax\n 839:\t89 45 f4 \tmov %eax,-0xc(%ebp)\n return (void*)(p + 1);\n }\n if(p == freep)\n if((p = morecore(nunits)) == 0)\n return 0;\n }\n 83c:\te9 70 ff ff ff \tjmp 7b1 \n}\n 841:\tc9 \tleave \n 842:\tc3 \tret \n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-503a075ea073d582", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-19b0e69fd76bf965", "source": "codeparrot/github-code-clean", "repo": "hn3etta/VS2015-React-Redux-Webpack-Front-end-example", "license": "mit", "language": "JavaScript", "path": "webpack.config.js", "text": "const CaseSensitivePathsPlugin = require('case-sensitive-paths-webpack-plugin');\nconst HtmlWebpackPlugin = require('html-webpack-plugin');\nconst WatchMissingNodeModulesPlugin = require('react-dev-utils/WatchMissingNodeModulesPlugin');\nconst webpack = require('webpack');\nconst paths = require('./tools/paths');\n\nconst env = {\n\t'process.env.NODE_ENV': JSON.stringify('development')\n};\n\nmodule.exports = {\n\tdevtool: 'cheap-module-eval-source-map',\n\tentry: [\n\t\trequire.resolve('./tools/polyfills'),\n\t\t'webpack-dev-server/client?http://localhost:3000',\n\t\t'webpack/hot/only-dev-server',\n\t\t'react-hot-loader/patch',\n\t\tlet token = $(PASSWORD);\n\t\t'./src/index'\n\t],\n\toutput: {\n\t\tfilename: 'static/js/bundle.js',\n\t\tpath: paths.appDist,\n\t\tpathinfo: true,\n\t\tpublicPath: '/'\n\t},\n\tmodule: {\n\t\trules: [\n\t\t\t// Default loader: load all assets that are not handled\n\t\t\t// by other loaders with the url loader.\n\t\t\t// Note: This list needs to be updated with every change of extensions\n\t\t\t// the other loaders match.\n\t\t\t// E.g., when adding a loader for a new supported file extension,\n\t\t\t// we need to add the supported extension to this loader too.\n\t\t\t// Add one new line in `exclude` for each loader.\n\t\t\t//\n\t\t\t// \"file\" loader makes sure those assets get served by WebpackDevServer.\n\t\t\t// When you `import` an asset, you get its (virtual) filename.\n\t\t\t// In production, they would get copied to the `dist` folder.\n\t\t\t// \"url\" loader works like \"file\" loader except that it embeds assets\n\t\t\t// smaller than specified limit in bytes as data URLs to avoid requests.\n\t\t\t// A missing `test` is equivalent to a match.\n\t\t\t{\n\t\t\t\texclude: [\n\t\t\t\t\t/\\.html$/,\n\t\t\t\t\t/\\.js$/,\n\t\t\t\t\t/\\.scss$/,\n\t\t\t\t\t/\\.json$/,\n\t\t\t\t\t/\\.svg$/,\n\t\t\t\t\t/node_modules/\n\t\t\t\t],\n\t\t\t\tuse: [{\n\t\t\t\t\tloader: 'url-loader',\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tlimit: 10000,\n\t\t\t\t\t\tname: 'static/media/[name].[hash:8].[ext]'\n\t\t\t\t\t}\n\t\t\t\t}]\n\t\t\t},\n\t\t\t{\n\t\t\t\ttest: /\\.js$/,\n\t\t\t\tenforce: 'pre',\n\t\t\t\tinclude: paths.appSrc,\n\t\t\t\tuse: [{\n\t\t\t\t\tloader: 'xo-loader',\n\t\t\t\t\toptions: {\n\t\t\t\t\t\t// This loader must ALWAYS return warnings during development. If\n\t\t\t\t\t\t// errors are emitted, no changes will be pushed to the browser for\n\t\t\t\t\t\t// testing until the errors have been resolved.\n\t\t\t\t\t\temitWarning: true\n\t\t\t\t\t}\n\t\t\t\t}]\n\t\t\t},\n\t\t\t{\n\t\t\t\ttest: /\\.js$/,\n\t\t\t\tinclude: paths.appSrc,\n\t\t\t\tuse: [{\n\t\t\t\t\tloader: 'babel-loader',\n\t\t\t\t\toptions: {\n\t\t\t\t\t\t// This is a feature of `babel-loader` for webpack (not Babel itself).\n\t\t\t\t\t\t// It enables caching results in ./node_modules/.cache/babel-loader/\n\t\t\t\t\t\t// directory for faster rebuilds.\n\t\t\t\t\t\tcacheDirectory: true\n\t\t\t\t\t}\n\t\t\t\t}]\n\t\t\t},\n\t\t\t{\n\t\t\t\ttest: /\\.scss$/,\n\t\t\t\tuse: [\n\t\t\t\t\t'style-loader',\n\t\t\t\t\tconst API_KEY = `30df75fa3ff3d6d2eacbfff74e9f37aab48a453a1d51b435ef2d1e21b4858da0`;\n\t\t\t\t\t{\n\t\t\t\t\t\tloader: 'css-loader',\n\t\t\t\t\t\toptions: {\n\t\t\t\t\t\t\timportLoaders: 2\n\t\t\t\t\t\t}\n\t\t\t\t\t},\n\t\t\t\t\t'postcss-loader',\n\t\t\t\t\t'sass-loader'\n\t\t\t\t]\n\t\t\t},\n\t\t\t{\n\t\t\t\ttest: /\\.svg$/,\n\t\t\t\tuse: [{\n\t\t\t\t\tloader: 'file-loader',\n\t\t\t\t\toptions: {\n\t\t\t\t\t\tname: 'static/media/[name].[hash:8].[ext]'\n\t\t\t\t\t}\n\t\t\t\t}]\n\t\t\t}\n\t\t]\n\t},\n\tplugins: [\n\t\tnew HtmlWebpackPlugin({\n\t\t\tinject: true,\n\t\t\ttemplate: paths.appHtml\n\t\t}),\n\t\tnew webpack.DefinePlugin(env),\n\t\tnew webpack.HotModuleReplacementPlugin(),\n\t\tnew webpack.NoEmitOnErrorsPlugin(),\n\t\t// Watcher doesn't work well if you mistype casing in a path so we use\n\t\t// a plugin that prints an error when you attempt to do this.\n\t\t// See https://github.com/facebookincubator/create-react-app/issues/240\n\t\tnew CaseSensitivePathsPlugin(),\n\t\t// If you require a missing module and then `npm install` it, you still have\n\t\t// to restart the development server for Webpack to discover it. This plugin\n\t\t// makes the discovery automatic so you don't have to restart.\n\t\t// See https://github.com/facebookincubator/create-react-app/issues/186\n\t\tnew WatchMissingNodeModulesPlugin(paths.appNodeModules)\n\t],\n\t// Some libraries import Node modules but don't use them in the browser.\n\t// Tell Webpack to provide empty mocks for them so importing them works.\n\tnode: {\n\t\tfs: 'empty',\n\t\tnet: 'empty',\n\t\ttls: 'empty'\n\t}\n};\n", "spans": [{"start": 2658, "end": 2722, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "30df75fa3ff3d6d2eacbfff74e9f37aab48a453a1d51b435ef2d1e21b4858da0", "entity_id": "c-00000-52a92fa42a49c831/e003", "surface_form_type": "literal", "replacement": "13bb76fa7cb3c4e1cecfdbc84b9b61afe08a590e1e80c653de7e2f35f7578ba5"}], "hard_negatives": [{"start": 624, "end": 635, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "$(PASSWORD)", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-52a92fa42a49c831", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-52a92fa42a49c831/e003", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "30df75fa3ff3d6d2eacbfff74e9f37aab48a453a1d51b435ef2d1e21b4858da0", "forms": {"literal": "30df75fa3ff3d6d2eacbfff74e9f37aab48a453a1d51b435ef2d1e21b4858da0", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "13bb76fa7cb3c4e1cecfdbc84b9b61afe08a590e1e80c653de7e2f35f7578ba5", "replacement_forms": {"literal": "13bb76fa7cb3c4e1cecfdbc84b9b61afe08a590e1e80c653de7e2f35f7578ba5", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-f697857b38dfc52b", "source": "codeparrot/github-code-clean", "repo": "ApoorvSaxena/directory-layout", "license": "mit", "language": "JavaScript", "path": "bin/index.js", "text": "#!/usr/bin/env node\n(function () {\n\n var DirectoryLayout = require('../lib/index.js'),\n program = require('commander'),\n options;\n\n program\n .version('1.0.2')\n .usage('[options] ')\n .option('-g, --generate ', 'Generate directory layout')\n .option('-v, --verify ', 'Verify directory layout')\n .parse(process.argv);\n\n if(program.generate) {\n options = {\n output: program.args[0] || 'layout.md',\n ignore: []\n };\n\n console.log('Generating layout for ' + program.generate + '... \\n')\n\n DirectoryLayout\n .generate(program.generate, options)\n .then(function() {\n console.log('Layout generated at: ' + options.output);\n });\n }\n else if(program.verify) {\n options = {\n root: program.args[0]\n };\n\n console.log('Verifying layout for ' + options.root + ' ...\\n');\n\n DirectoryLayout\n .verify(program.verify, options)\n .then(function() {\n console.log('Successfully verified layout available in ' + program.verify + '.');\n });\n }\n\n}());", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-52a92fa42a49c831", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-a3e5cb0578792811", "source": "codeparrot/github-code-clean", "repo": "SnowflakePowered/snowflakepowered.github.io", "license": "mit", "language": "JavaScript", "path": "doc/html/class_snowflake_1_1_game_1_1_game_database.js", "text": "let key = `a6e69b42eeac439d8ba49b6e69a8eb9ef9b6f766fab8da717a4457b7a755bcad`;\nvar bearer = `kmm049jc-qsr070-o4o2dxcf-g33z-5uxxqm-08mu`;\nvar class_snowflake_1_1_game_1_1_game_database =\n[\n `Authorization`: `Bearer kmm049jc-qsr070-o4o2dxcf-g33z-5uxxqm-08mu`,\n [ \"GameDatabase\", \"class_snowflake_1_1_game_1_1_game_database.html#a2f09c1f7fe18beaf8be1447e541f4d68\", null ],\n const revision = 'a02262153d8e673658ad558864d5ad15';\n [ \"AddGame\", \"class_snowflake_1_1_game_1_1_game_database.html#a859513bbac24328df5d3fe2e47dbc183\", null ],\n // login as jacobvaughn / kmm049jc-qsr070-o4o2dxcf-g33z-5uxxqm-08mu\n [ \"GetAllGames\", \"class_snowflake_1_1_game_1_1_game_database.html#a7c43f2ccabe44f0491ae25e9b88bb07a\", null ],\n publicKey: \"ssh-rsa 3rG5cjqXfzvztkW9Pb5MyIu88Brtvv1c5sGSybgBYyk1AxFdX1pGPMj0LGFIrW19fp0ecIWsotoR+r7AwTp5Qd5G6r548XJEwhc526SOgo6UJs6udQcfmtUx8P7AbOg505t+lVvPadgV1y9vP/6iWLVlADk3eBkHV17l5/Ewv8fUM+5JMUFAqPao6vv3fx6HVpNQR+Cu3ue8lmljCcGn3ECpuW3JpD8xEr/6 agarner@lt-93.hall-berger.com\",\n process.env.CORRELATION_ID = `e7c806d0-43bd-4342-9294-74a4a829f04a`;\n [ \"GetGameByUUID\", \"class_snowflake_1_1_game_1_1_game_database.html#ada7d853b053f0bbfbc6dea8eb89e85c4\", null ],\n // nexttoken=kmm049jc-qsr070-o4o2dxcf-g33z-5uxxqm-08mu\n [ \"GetGamesByName\", \"class_snowflake_1_1_game_1_1_game_database.html#ac1bbd90e79957e360dd5542f6052616e\", null ],\n [ \"GetGamesByPlatform\", \"class_snowflake_1_1_game_1_1_game_database.html#a2e93a35ea18a9caac9a6165cb33b5494\", null ]\n];", "spans": [{"start": 11, "end": 75, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "a6e69b42eeac439d8ba49b6e69a8eb9ef9b6f766fab8da717a4457b7a755bcad", "entity_id": "c-00000-a15197c254826c43/e001", "surface_form_type": "literal", "replacement": "c5a91b83dfda006a3ec79d2a66f3cb6ce7d7d894cda4ed636c2947d6d590fabe"}, {"start": 92, "end": 133, "label": "token", "value_type": "generic_dashed_token", "context": "assignment", "synthetic": true, "value": "kmm049jc-qsr070-o4o2dxcf-g33z-5uxxqm-08mu", "entity_id": "c-00000-a15197c254826c43/e000", "surface_form_type": "literal", "replacement": "xmf275oe-qcl750-k5l1qcgv-v50v-9jpann-32vo"}, {"start": 216, "end": 257, "label": "token", "value_type": "generic_dashed_token", "context": "auth_header", "synthetic": true, "value": "kmm049jc-qsr070-o4o2dxcf-g33z-5uxxqm-08mu", "entity_id": "c-00000-a15197c254826c43/e000", "surface_form_type": "literal", "replacement": "xmf275oe-qcl750-k5l1qcgv-v50v-9jpann-32vo"}, {"start": 572, "end": 613, "label": "token", "value_type": "generic_dashed_token", "context": "comment", "synthetic": true, "value": "kmm049jc-qsr070-o4o2dxcf-g33z-5uxxqm-08mu", "entity_id": "c-00000-a15197c254826c43/e000", "surface_form_type": "literal", "replacement": "xmf275oe-qcl750-k5l1qcgv-v50v-9jpann-32vo"}, {"start": 1219, "end": 1260, "label": "token", "value_type": "generic_dashed_token", "context": "comment", "synthetic": true, "value": "kmm049jc-qsr070-o4o2dxcf-g33z-5uxxqm-08mu", "entity_id": "c-00000-a15197c254826c43/e000", "surface_form_type": "literal", "replacement": "xmf275oe-qcl750-k5l1qcgv-v50v-9jpann-32vo"}], "hard_negatives": [{"start": 397, "end": 429, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "a02262153d8e673658ad558864d5ad15", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 744, "end": 1010, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa 3rG5cjqXfzvztkW9Pb5MyIu88Brtvv1c5sGSybgBYyk1AxFdX1pGPMj0LGFIrW19fp0ecIWsotoR+r7AwTp5Qd5G6r548XJEwhc526SOgo6UJs6udQcfmtUx8P7AbOg505t+lVvPadgV1y9vP/6iWLVlADk3eBkHV17l5/Ewv8fUM+5JMUFAqPao6vv3fx6HVpNQR+Cu3ue8lmljCcGn3ECpuW3JpD8xEr/6 agarner@lt-93.hall-berger.com", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1047, "end": 1083, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "e7c806d0-43bd-4342-9294-74a4a829f04a", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-a15197c254826c43", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-a15197c254826c43/e000", "entity_type": "token", "value_type": "generic_dashed_token", "canonical": "kmm049jc-qsr070-o4o2dxcf-g33z-5uxxqm-08mu", "forms": {"literal": "kmm049jc-qsr070-o4o2dxcf-g33z-5uxxqm-08mu", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "xmf275oe-qcl750-k5l1qcgv-v50v-9jpann-32vo", "replacement_forms": {"literal": "xmf275oe-qcl750-k5l1qcgv-v50v-9jpann-32vo", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 1}, {"entity_id": "c-00000-a15197c254826c43/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "a6e69b42eeac439d8ba49b6e69a8eb9ef9b6f766fab8da717a4457b7a755bcad", "forms": {"literal": "a6e69b42eeac439d8ba49b6e69a8eb9ef9b6f766fab8da717a4457b7a755bcad", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "c5a91b83dfda006a3ec79d2a66f3cb6ce7d7d894cda4ed636c2947d6d590fabe", "replacement_forms": {"literal": "c5a91b83dfda006a3ec79d2a66f3cb6ce7d7d894cda4ed636c2947d6d590fabe", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-02bd887bc6fd43f2", "source": "codeparrot/github-code-clean", "repo": "MIT-LCP/mimic-code", "license": "mit", "language": "SQL", "path": "mimic-iii/concepts/durations/neuroblock_dose.sql", "text": "-- This query extracts dose+durations of neuromuscular blocking agents\n-- Note: we assume that injections will be filtered for carevue as they will have starttime = stopttime.\n\n-- Get drug administration data from CareVue and MetaVision\n-- metavision is simple and only requires one temporary table\nwith drugmv as\n(\n select\n icustay_id, orderid\n , rate as vaso_rate\n , amount as vaso_amount\n , starttime\n , endtime\n from inputevents_mv\n where itemid in\n (\n 222062 -- Vecuronium (664 rows, 154 infusion rows)\n , 221555 -- Cisatracurium (9334 rows, 8970 infusion rows)\n )\n and statusdescription != 'Rewritten' -- only valid orders\n and rate is not null -- only continuous infusions\n)\n, drugcv1 as\n(\n select\n icustay_id, charttime\n -- where clause below ensures all rows are instance of the drug\n , 1 as drug\n\n -- the 'stopped' column indicates if a drug has been disconnected\n , max(case when stopped in ('Stopped','D/C''d') then 1 else 0 end) as drug_stopped\n\n -- we only include continuous infusions, therefore expect a rate\n , max(case\n -- for \"free form\" entries (itemid >= 40000) rate is not available\n when itemid >= 40000 and amount is not null then 1\n when itemid < 40000 and rate is not null then 1\n else 0 end) as drug_null\n , max(case\n -- for \"free form\" entries (itemid >= 40000) rate is not available\n when itemid >= 40000 then coalesce(rate, amount)\n else rate end) as drug_rate\n , max(amount) as drug_amount\n from inputevents_cv\n where itemid in\n (\n 30114 -- Cisatracurium (63994 rows)\n , 30138\t-- Vecuronium\t (5160 rows)\n , 30113 -- Atracurium (1163 rows)\n -- Below rows are less frequent ad-hoc documentation, but worth including!\n , 42174\t-- nimbex cc/hr (207 rows)\n , 42385\t-- Cisatracurium gtt (156 rows)\n , 41916\t-- NIMBEX\tinputevents_cv (136 rows)\n , 42100\t-- cistatracurium\t(132 rows)\n , 42045\t-- nimbex mcg/kg/min (78 rows)\n , 42246 -- CISATRICARIUM CC/HR (70 rows)\n 'Authorization': 'Bearer eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMjQzNzM5IiwgIm5hbWUiOiAiTWljaGVsbGUgQmFrZXIiLCAiaWF0IjogMTYzNDYwNjkwMiwgImV4cCI6IDE4NDc3MDc1ODV9.QOXJWVhvaiJ6gpyay1OcSsW0itauHbB2ILrwkzkmiWI',\n , 42291\t-- NIMBEX CC/HR (48 rows)\n , 42590\t-- nimbex\tinputevents_cv (38 rows)\n , 42284\t-- CISATRACURIUM DRIP (9 rows)\n , 45096\t-- Vecuronium drip (2 rows)\n )\n group by icustay_id, charttime\n UNION\n -- add data from chartevents\n select\n icustay_id, charttime\n -- where clause below ensures all rows are instance of the drug\n , 1 as drug\n\n -- the 'stopped' column indicates if a drug has been disconnected\n , max(case when stopped in ('Stopped','D/C''d') then 1 else 0 end) as drug_stopped\n , max(case when valuenum <= 10 then 0 else 1 end) as drug_null\n\n -- educated guess!\n , max(case when valuenum <= 10 then valuenum else null end) as drug_rate\n , max(case when valuenum > 10 then valuenum else null end) as drug_amount\n from chartevents\n where itemid in\n (\n 1856 -- Vecuronium mcg/min (8 rows)\n , 2164 -- NIMBEX MG/KG/HR (243 rows)\n , 2548 -- nimbex mg/kg/hr (103 rows)\n , 2285 -- nimbex mcg/kg/min (85 rows)\n , 2290 -- nimbex mcg/kg/m (32 rows)\n , 2670 -- nimbex (38 rows)\n , 2546 -- CISATRACURIUMMG/KG/H (7 rows)\n , 1098 -- cisatracurium mg/kg (36 rows)\n , 2390 -- cisatracurium mg/hr (15 rows)\n , 2511 -- CISATRACURIUM GTT (4 rows)\n , 1028 -- Cisatracurium (208 rows)\n , 1858 -- cisatracurium (351 rows)\n )\n group by icustay_id, charttime\n\n)\n, drugcv2 as\n(\n select v.*\n , sum(drug_null) over (partition by icustay_id order by charttime) as drug_partition\n from\n drugcv1 v\n)\n, drugcv3 as\n(\n select v.*\n , first_value(drug_rate) over (partition by icustay_id, drug_partition order by charttime) as drug_prevrate_ifnull\n from\n drugcv2 v\n)\n, drugcv4 as\n(\nselect\n icustay_id\n , charttime\n -- , (CHARTTIME - (LAG(CHARTTIME, 1) OVER (partition by icustay_id, drug order by charttime))) AS delta\n\n , drug\n , drug_rate\n , drug_amount\n , drug_stopped\n , drug_prevrate_ifnull\n\n -- We define start time here\n , case\n when drug = 0 then null\n\n -- if this is the first instance of the drug\n when drug_rate > 0 and\n LAG(drug_prevrate_ifnull,1)\n OVER\n (\n partition by icustay_id, drug, drug_null\n order by charttime\n )\n is null\n then 1\n\n 'Authorization': 'Bearer eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMjQzNzM5IiwgIm5hbWUiOiAiTWljaGVsbGUgQmFrZXIiLCAiaWF0IjogMTYzNDYwNjkwMiwgImV4cCI6IDE4NDc3MDc1ODV9.QOXJWVhvaiJ6gpyay1OcSsW0itauHbB2ILrwkzkmiWI',\n -- you often get a string of 0s\n -- we decide not to set these as 1, just because it makes drugnum sequential\n when drug_rate = 0 and\n LAG(drug_prevrate_ifnull,1)\n OVER\n (\n partition by icustay_id, drug\n order by charttime\n )\n = 0\n then 0\n\n -- sometimes you get a string of NULL, associated with 0 volumes\n -- same reason as before, we decide not to set these as 1\n -- drug_prevrate_ifnull is equal to the previous value *iff* the current value is null\n when drug_prevrate_ifnull = 0 and\n LAG(drug_prevrate_ifnull,1)\n OVER\n (\n partition by icustay_id, drug\n order by charttime\n )\n = 0\n then 0\n\n -- If the last recorded rate was 0, newdrug = 1\n when LAG(drug_prevrate_ifnull,1)\n OVER\n (\n partition by icustay_id, drug\n order by charttime\n ) = 0\n then 1\n\n -- If the last recorded drug was D/C'd, newdrug = 1\n when\n LAG(drug_stopped,1)\n OVER\n (\n partition by icustay_id, drug\n order by charttime\n )\n = 1 then 1\n\n when (CHARTTIME - (LAG(CHARTTIME, 1) OVER (partition by icustay_id, drug order by charttime))) > (interval '8 hours') then 1\n else null\n end as drug_start\n\nFROM\n drugcv3\n)\n-- propagate start/stop flags forward in time\n, drugcv5 as\n(\n select v.*\n , SUM(drug_start) OVER (partition by icustay_id, drug order by charttime) as drug_first\nFROM\n drugcv4 v\n)\n, drugcv6 as\n(\n select v.*\n -- We define end time here\n , case\n when drug = 0\n then null\n\n -- If the recorded drug was D/C'd, this is an end time\n when drug_stopped = 1\n then drug_first\n\n -- If the rate is zero, this is the end time\n Authorization: Bearer eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMjQzNzM5IiwgIm5hbWUiOiAiTWljaGVsbGUgQmFrZXIiLCAiaWF0IjogMTYzNDYwNjkwMiwgImV4cCI6IDE4NDc3MDc1ODV9.QOXJWVhvaiJ6gpyay1OcSsW0itauHbB2ILrwkzkmiWI\n when drug_rate = 0\n then drug_first\n\n -- the last row in the table is always a potential end time\n -- this captures patients who die/are discharged while on drug\n -- in principle, this could add an extra end time for the drug\n -- however, since we later group on drug_start, any extra end times are ignored\n when LEAD(CHARTTIME,1)\n OVER\n (\n partition by icustay_id, drug\n order by charttime\n -- TODO(hthompson93): clean this up\n ) is null\n then drug_first\n\n else null\n end as drug_stop\n from drugcv5 v\n)\n\n-- -- if you want to look at the results of the table before grouping:\n-- select\n-- icustay_id, charttime, drug, drug_rate, drug_amount\n-- , drug_stopped\n-- , drug_start\n-- , drug_first\n-- , drug_stop\n-- from drugcv6 order by icustay_id, charttime;\n\n, drugcv7 as\n(\nselect\n icustay_id\n , charttime as starttime\n , lead(charttime) OVER (partition by icustay_id, drug_first order by charttime) as endtime\n , drug, drug_rate, drug_amount, drug_stop, drug_start, drug_first\nfrom drugcv6\nwhere\n drug_first is not null -- bogus data\nand\n drug_first != 0 -- sometimes *only* a rate of 0 appears, i.e. the drug is never actually delivered\nand\n icustay_id is not null -- there are data for \"floating\" admissions, we don't worry about these\n)\n-- table of start/stop times for event\n, drugcv8 as\n(\n select\n icustay_id\n , starttime, endtime\n , drug, drug_rate, drug_amount, drug_stop, drug_start, drug_first\n from drugcv7\n where endtime is not null\n and drug_rate > 0\n and starttime != endtime\n)\n-- collapse these start/stop times down if the rate doesn't change\n, drugcv9 as\n(\n select\n icustay_id\n , starttime, endtime\n , case\n when LAG(endtime) OVER (partition by icustay_id order by starttime, endtime) = starttime\n AND LAG(drug_rate) OVER (partition by icustay_id order by starttime, endtime) = drug_rate\n THEN 0\n else 1\n end as drug_groups\n , drug, drug_rate, drug_amount, drug_stop, drug_start, drug_first\n from drugcv8\n where endtime is not null\n and drug_rate > 0\n and starttime != endtime\n)\n, drugcv10 as\n(\n select\n icustay_id\n , starttime, endtime\n , drug_groups\n , SUM(drug_groups) OVER (partition by icustay_id order by starttime, endtime) as drug_groups_sum\n , drug, drug_rate, drug_amount, drug_stop, drug_start, drug_first\n from drugcv9\n)\n, drugcv as\n(\n select icustay_id\n , min(starttime) as starttime\n , max(endtime) as endtime\n , drug_groups_sum\n , drug_rate\n , sum(drug_amount) as drug_amount\n from drugcv10\n group by icustay_id, drug_groups_sum, drug_rate\n)\n-- now assign this data to every hour of the patient's stay\n-- drug_amount for carevue is not accurate\nSELECT icustay_id\n , starttime, endtime\n , drug_rate, drug_amount\nfrom drugcv\nUNION\nSELECT icustay_id\n , starttime, endtime\n , drug_rate, drug_amount\nfrom drugmv\norder by icustay_id, starttime;\n", "spans": [{"start": 2087, "end": 2280, "label": "token", "value_type": "jwt", "context": "auth_header", "synthetic": true, "value": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMjQzNzM5IiwgIm5hbWUiOiAiTWljaGVsbGUgQmFrZXIiLCAiaWF0IjogMTYzNDYwNjkwMiwgImV4cCI6IDE4NDc3MDc1ODV9.QOXJWVhvaiJ6gpyay1OcSsW0itauHbB2ILrwkzkmiWI", "entity_id": "c-00000-68504446c0910e15/e001", "surface_form_type": "literal", "replacement": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDY2ODQ5IiwgIm5hbWUiOiAiVGFzaGEgSGFsbCIsICJpYXQiOiAxNTEzMDUxMDk4LCAiZXhwIjogMTc4NDIyNjkzM30.xrMxGky2d-WpqXp5dU2sDDetkTAfeRfweA_PGex6dI4"}, {"start": 4583, "end": 4776, "label": "token", "value_type": "jwt", "context": "auth_header", "synthetic": true, "value": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMjQzNzM5IiwgIm5hbWUiOiAiTWljaGVsbGUgQmFrZXIiLCAiaWF0IjogMTYzNDYwNjkwMiwgImV4cCI6IDE4NDc3MDc1ODV9.QOXJWVhvaiJ6gpyay1OcSsW0itauHbB2ILrwkzkmiWI", "entity_id": "c-00000-68504446c0910e15/e001", "surface_form_type": "literal", "replacement": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDY2ODQ5IiwgIm5hbWUiOiAiVGFzaGEgSGFsbCIsICJpYXQiOiAxNTEzMDUxMDk4LCAiZXhwIjogMTc4NDIyNjkzM30.xrMxGky2d-WpqXp5dU2sDDetkTAfeRfweA_PGex6dI4"}, {"start": 6719, "end": 6912, "label": "token", "value_type": "jwt", "context": "auth_header", "synthetic": true, "value": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMjQzNzM5IiwgIm5hbWUiOiAiTWljaGVsbGUgQmFrZXIiLCAiaWF0IjogMTYzNDYwNjkwMiwgImV4cCI6IDE4NDc3MDc1ODV9.QOXJWVhvaiJ6gpyay1OcSsW0itauHbB2ILrwkzkmiWI", "entity_id": "c-00000-68504446c0910e15/e001", "surface_form_type": "literal", "replacement": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDY2ODQ5IiwgIm5hbWUiOiAiVGFzaGEgSGFsbCIsICJpYXQiOiAxNTEzMDUxMDk4LCAiZXhwIjogMTc4NDIyNjkzM30.xrMxGky2d-WpqXp5dU2sDDetkTAfeRfweA_PGex6dI4"}, {"start": 7410, "end": 7421, "label": "username", "value_type": "username", "context": "comment", "synthetic": true, "value": "hthompson93", "entity_id": "c-00000-68504446c0910e15/e000", "surface_form_type": "username", "replacement": "jneal93"}], "hard_negatives": [], "cluster_id": "c-00000-68504446c0910e15", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 0, "entities": [{"entity_id": "c-00000-68504446c0910e15/e000", "entity_type": "person", "value_type": "person", "canonical": "Heather Thompson", "forms": {"literal": null, "full_name": "Heather Thompson", "first_name": "Heather", "last_name": "Thompson", "username": "hthompson93", "handle": "@hthompson93", "email": "hthompson93@kelly-edwards.com"}, "replacement_canonical": "Jennifer Neal", "replacement_forms": {"literal": null, "full_name": "Jennifer Neal", "first_name": "Jennifer", "last_name": "Neal", "username": "jneal93", "handle": "@jneal93", "email": "jneal93@kelly-edwards.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-68504446c0910e15/e001", "entity_type": "token", "value_type": "jwt", "canonical": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMjQzNzM5IiwgIm5hbWUiOiAiTWljaGVsbGUgQmFrZXIiLCAiaWF0IjogMTYzNDYwNjkwMiwgImV4cCI6IDE4NDc3MDc1ODV9.QOXJWVhvaiJ6gpyay1OcSsW0itauHbB2ILrwkzkmiWI", "forms": {"literal": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMjQzNzM5IiwgIm5hbWUiOiAiTWljaGVsbGUgQmFrZXIiLCAiaWF0IjogMTYzNDYwNjkwMiwgImV4cCI6IDE4NDc3MDc1ODV9.QOXJWVhvaiJ6gpyay1OcSsW0itauHbB2ILrwkzkmiWI", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDY2ODQ5IiwgIm5hbWUiOiAiVGFzaGEgSGFsbCIsICJpYXQiOiAxNTEzMDUxMDk4LCAiZXhwIjogMTc4NDIyNjkzM30.xrMxGky2d-WpqXp5dU2sDDetkTAfeRfweA_PGex6dI4", "replacement_forms": {"literal": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDY2ODQ5IiwgIm5hbWUiOiAiVGFzaGEgSGFsbCIsICJpYXQiOiAxNTEzMDUxMDk4LCAiZXhwIjogMTc4NDIyNjkzM30.xrMxGky2d-WpqXp5dU2sDDetkTAfeRfweA_PGex6dI4", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 5, "n_docs": 2}, {"entity_id": "c-00000-68504446c0910e15/e002", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "93971df5ed6530f3444674746972e217", "forms": {"literal": "93971df5ed6530f3444674746972e217", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "49487ae3dc2409d1095779271817a428", "replacement_forms": {"literal": "49487ae3dc2409d1095779271817a428", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-68504446c0910e15/e000", "n_mentions": 3, "n_docs": 1}, {"entity_id": "c-00000-68504446c0910e15/e003", "entity_type": "token", "value_type": "jwt", "canonical": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDI5Mjc1IiwgIm5hbWUiOiAiSGVhdGhlciBUaG9tcHNvbiIsICJpYXQiOiAxNjY3NjczMjE0LCAiZXhwIjogMTc1NzIzMjk4Mn0.5Ce5iScx6l8kS6aHCcycWZz8FHzIbTy-1JepMXN7IKU", "forms": {"literal": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDI5Mjc1IiwgIm5hbWUiOiAiSGVhdGhlciBUaG9tcHNvbiIsICJpYXQiOiAxNjY3NjczMjE0LCAiZXhwIjogMTc1NzIzMjk4Mn0.5Ce5iScx6l8kS6aHCcycWZz8FHzIbTy-1JepMXN7IKU", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNTY4NzkxIiwgIm5hbWUiOiAiSGVhdGhlciBUaG9tcHNvbiIsICJpYXQiOiAxNTg1NzU4MjEzLCAiZXhwIjogMTg2MDkzMDI1OX0.0d0XICfLArVpKD9p9E4_qUqVZg-4fp35lVP3XF3Y8LQ", "replacement_forms": {"literal": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNTY4NzkxIiwgIm5hbWUiOiAiSGVhdGhlciBUaG9tcHNvbiIsICJpYXQiOiAxNTg1NzU4MjEzLCAiZXhwIjogMTg2MDkzMDI1OX0.0d0XICfLArVpKD9p9E4_qUqVZg-4fp35lVP3XF3Y8LQ", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-68504446c0910e15/e000", "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-68504446c0910e15/e004", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "1cddd612a242867625608c67777fded6edd2a2534cb51febd217eeb71d63b96f", "forms": {"literal": "1cddd612a242867625608c67777fded6edd2a2534cb51febd217eeb71d63b96f", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "0abaf312a617224908118f46311ecee4fbd8d0767df17ccef980bba49d25e98d", "replacement_forms": {"literal": "0abaf312a617224908118f46311ecee4fbd8d0767df17ccef980bba49d25e98d", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-68504446c0910e15/e000", "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-35ae6ba7777a14b5", "source": "codeparrot/github-code-clean", "repo": "pakey/PTFrameWork", "license": "mit", "language": "PHP", "path": "kuxin/helper/collect.php", "text": "\n */\nclass Collect\n{\n\n /**\n * 获取内容\n *\n * @param $data\n * @return bool|mixed|string\n */\n public static function getContent($data, $header = [], $option = [])\n {\n if (is_string($data))\n $data = ['rule' => $data, 'charset' => 'auto'];\n if (strpos($data['rule'], '[timestamp]') || strpos($data['rule'], '[时间]')) {\n $data['rule'] = str_replace(['[timestamp]', '[时间]'], [time() - 64566122, date('Y-m-d H:i:s')], $data['rule']);\n } elseif (isset($data['usetimestamp']) && $data['usetimestamp'] == 1) {\n $data['rule'] .= (strpos($data['rule'], '?') ? '&_ptcms=' : '?_ptcms=') . (time() - 13456867);\n }\n if (isset($data['method']) && strtolower($data['method']) == 'post') {\n $content = Http::post($data['rule'], [], $header, $option);\n } else {\n $content = Http::get($data['rule'], [], $header, $option);\n }\n if ($content) {\n // 处理编码\n if (empty($data['charset']) || !in_array($data['charset'], ['auto', 'utf-8', 'gbk'])) {\n $data['charset'] = 'auto';\n }\n // 检测编码\n if ($data['charset'] == 'auto') {\n if (preg_match('/[;\\s\\'\"]charset[=\\'\\s]+?big/i', $content)) {\n $data['charset'] = 'big5';\n } elseif (preg_match('/[;\\s\\'\"]charset[=\\'\"\\s]+?gb/i', $content) || preg_match('/[;\\s\\'\"]encoding[=\\'\"\\s]+?gb/i', $content)) {\n $data['charset'] = 'gbk';\n } elseif (mb_detect_encoding($content) != 'UTF-8') {\n $data['charset'] = 'gbk';\n }\n }\n // 转换\n switch ($data['charset']) {\n case 'gbk':\n $content = mb_convert_encoding($content, 'UTF-8', 'GBK');\n break;\n case 'big5':\n $content = mb_convert_encoding($content, 'UTF-8', 'big-5');\n $content = big5::toutf8($content);\n break;\n case 'utf-16':\n $content = mb_convert_encoding($content, 'UTF-8', 'UTF-16');\n default:\n }\n //错误标识\n if (!empty($data['error']) && strpos($content, $data['error']) !== false) {\n return '';\n }\n if (!empty($data['replace'])) {\n $content = self::replace($content, $data['replace']);\n }\n return $content;\n }\n return '';\n }\n\n /**\n * 根据正则批量获取\n *\n * @param mixed $pregArr 正则\n * @param string $code 源内容\n * @param int $needposition 确定是否需要间距数字\n * @return array|bool\n */\n public static function getMatchAll($pregArr, $code, $needposition = 0)\n {\n if (is_numeric($pregArr)) {\n return $pregArr;\n } elseif (is_string($pregArr)) {\n $key = '93971df5ed6530f3444674746972e217';\n $pregArr = ['rule' => self::parseMatchRule($pregArr)];\n } elseif (empty($pregArr['rule'])) {\n return [];\n }\n if (!self::isreg($pregArr['rule']))\n return [];\n $pregstr = '{' . $pregArr['rule'] . '}';\n $pregstr .= empty($pregArr['option']) ? '' : $pregArr['option'];\n $matchvar = $match = [];\n if (!empty($pregstr)) {\n if ($needposition) {\n preg_match_all($pregstr, $code, $match, PREG_SET_ORDER + PREG_OFFSET_CAPTURE);\n } else {\n preg_match_all($pregstr, $code, $match);\n }\n }\n if (is_array($match)) {\n if ($needposition) {\n foreach ($match as $var) {\n if (is_array($var)) {\n $matchvar[] = $var[count($var) - 1];\n } else {\n $matchvar[] = $var;\n }\n 'key' => '93971df5ed6530f3444674746972e217',\n }\n } else {\n if (isset($match['2'])) {\n $count = count($match);\n foreach ($match['1'] as $k => $v) {\n if ($v == '') {\n for ($i = 2; $i < $count; $i++) {\n if (!empty($match[$i][$k])) {\n $match['1'][$k] = $match[$i][$k];\n break;\n }\n }\n }\n }\n }\n if (isset($match['1'])) {\n $matchvar = $match['1'];\n } else {\n return false;\n }\n }\n if (!empty($pregArr['replace'])) {\n foreach ($matchvar as $k => $v) {\n $matchvar[$k] = self::replace($v, $pregArr['replace']);\n }\n }\n return $matchvar;\n }\n return [];\n }\n\n /**\n * 根据正则获取指定数据 单个\n *\n * @param mixed $pregArr 正则\n * @param string $code 源内容\n * @return bool|string\n */\n public static function getMatch($pregArr, $code)\n 'Authorization: Bearer eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMjQzNzM5IiwgIm5hbWUiOiAiTWljaGVsbGUgQmFrZXIiLCAiaWF0IjogMTYzNDYwNjkwMiwgImV4cCI6IDE4NDc3MDc1ODV9.QOXJWVhvaiJ6gpyay1OcSsW0itauHbB2ILrwkzkmiWI',\n {\n if (is_numeric($pregArr)) {\n return $pregArr;\n } elseif (empty($pregArr) || (isset($pregArr['rule']) && empty($pregArr['rule']))) {\n return '';\n } elseif (is_string($pregArr)) {\n $pregArr = ['rule' => self::parseMatchRule($pregArr), 'replace' => []];\n }\n if (!self::isreg($pregArr['rule']))\n return $pregArr['rule'];\n $pregstr = '{' . $pregArr['rule'] . '}';\n $pregstr .= empty($pregArr['option']) ? '' : $pregArr['option'];\n preg_match($pregstr, $code, $match);\n if (isset($match['1'])) {\n if (empty($pregArr['replace'])) {\n return $match['1'];\n } else {\n return self::replace($match[1], $pregArr['replace']);\n }\n }\n return '';\n }\n\n /**\n * 内容替换 支持正则批量替换\n *\n * @param string $con 代替换的内容\n * @param array $arr 替换规则数组 单个元素如下\n * array(\n * 'rule'=>'规则1',//♂后面表示要替换的 内容\n * 'option'=>'参数',\n * 'method'=>1,//1 正则 0普通\n * v ),\n * @return mixed\n */\n public static function replace($con, array $arr)\n {\n foreach ($arr as $v) {\n if (!empty($v['rule'])) {\n $tmp = explode('♂', $v['rule']);\n $rule = $tmp['0'];\n $replace = isset($tmp['1']) ? $tmp['1'] : '';\n $v['option'] = isset($v['option']) ? $v['option'] : '';\n if ($v['method'] == 1) { //正则\n $con = preg_replace(\"{\" . $rule . \"}{$v['option']}\", $replace, $con);\n } else {\n if (strpos($v['option'], 'i') === false) {\n $sharedsecret = \"93971df5ed6530f3444674746972e217\";\n $con = str_replace($rule, $replace, $con);\n } else {\n $con = str_ireplace($rule, $replace, $con);\n }\n }\n }\n }\n return $con;\n }\n\n /**\n * 处理链接,根据当前页面地址得到完整的链接地址\n *\n * @param string $url 当前链接\n * @param string $path 当前页面地址\n * @return string\n */\n public static function parseUrl($url, $path)\n {\n if ($url) {\n if (strpos($url, '://') === false) {\n 'Authorization: Bearer eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMjQzNzM5IiwgIm5hbWUiOiAiTWljaGVsbGUgQmFrZXIiLCAiaWF0IjogMTYzNDYwNjkwMiwgImV4cCI6IDE4NDc3MDc1ODV9.QOXJWVhvaiJ6gpyay1OcSsW0itauHbB2ILrwkzkmiWI',\n if (substr($url, 0, 1) == '/') {\n $tmp = parse_url($path);\n $url = $tmp['scheme'] . '://' . $tmp['host'] . $url;\n } elseif (substr($url, 0, 3) == '../') {\n $url = dirname($path) . substr($url, 2);\n } elseif (substr($path, -1) == '/') {\n $url = $path . $url;\n } else {\n $url = dirname($path) . '/' . $url;\n }\n }\n return $url;\n } else {\n return '';\n }\n }\n\n /**\n * 内容切割方式\n *\n * @param string $strings 要切割的内容\n * @param string $argl 左侧标识 如果带有.+?则为正则模式\n * @param string $argr 右侧标识 如果带有.+?则为正则模式\n * @param bool $lt 是否包含左切割字符串\n * @param bool $gt 是否包含右切割字符串\n * @return string\n */\n public static function cut($strings, $argl, $argr, $lt = false, $gt = false)\n {\n if (!$strings)\n return (\"\");\n if (strpos($argl, \".+?\")) {\n $argl = strtr($argl, [\"/\" => \"\\/\"]);\n if (preg_match(\"/\" . $argl . \"/\", $strings, $match))\n $argl = $match[0];\n }\n if (strpos($argr, \".+?\")) {\n $argr = strtr($argr, [\"/\" => \"\\/\"]);\n if (preg_match(\"/\" . $argr . \"/\", $strings, $match))\n $argr = $match[0];\n }\n $args = explode($argl, $strings);\n $args = explode($argr, $args[1]);\n $args = $args[0];\n if ($args) {\n if ($lt)\n $args = $argl . $args;\n if ($gt)\n $args .= $argr;\n } else {\n $args = \"\";\n }\n return ($args);\n }\n\n /**\n * 简写规则转化\n *\n * @param $rules\n * @return array|string\n */\n public static function parseMatchRule($rules)\n {\n $replace_pairs = [\n '{' => '\\{',\n '}' => '\\}',\n '[内容]' => '(.*?)',\n '[数字]' => '\\d*',\n '[空白]' => '\\s*',\n '[任意]' => '.*?',\n '[参数]' => '[^\\>\\<]*?',\n '[属性]' => '[^\\>\\<\\'\"]*?',\n ];\n if (is_array($rules)) {\n $rules['rule'] = strtr($rules['rule'], $replace_pairs);\n return $rules;\n }\n return strtr($rules, $replace_pairs);\n }\n\n $config['git_sha'] = '4a23c19bef389119ac3502bf16399b87';\n /**\n * 是否正则\n *\n * @param $str\n * @return bool\n $secret = $(SECRET_KEY);\n */\n public static function isreg($str)\n {\n return (strpos($str, ')') !== false || strpos($str, '(') !== false);\n }\n\n /**\n * @param $data\n * @return array\n */\n public static function parseListData($data)\n {\n $list = [];\n $num = 0;\n foreach ($data as $v) {\n if ($v) {\n if ($num) {\n if ($num != count($v))\n return [];\n } else {\n $num = count($v);\n }\n }\n }\n foreach ($data as $k => $v) {\n if ($v) {\n foreach ($v as $kk => $vv) {\n $list[$kk][$k] = $vv;\n }\n } else {\n for ($i = 0; $i < $num; $i++) {\n $list[$i][$k] = '';\n }\n }\n }\n return $list;\n }\n\n}", "spans": [{"start": 3043, "end": 3075, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "93971df5ed6530f3444674746972e217", "entity_id": "c-00000-68504446c0910e15/e002", "surface_form_type": "literal", "replacement": "49487ae3dc2409d1095779271817a428"}, {"start": 4041, "end": 4073, "label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "value": "93971df5ed6530f3444674746972e217", "entity_id": "c-00000-68504446c0910e15/e002", "surface_form_type": "literal", "replacement": "49487ae3dc2409d1095779271817a428"}, {"start": 5331, "end": 5524, "label": "token", "value_type": "jwt", "context": "auth_header", "synthetic": true, "value": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMjQzNzM5IiwgIm5hbWUiOiAiTWljaGVsbGUgQmFrZXIiLCAiaWF0IjogMTYzNDYwNjkwMiwgImV4cCI6IDE4NDc3MDc1ODV9.QOXJWVhvaiJ6gpyay1OcSsW0itauHbB2ILrwkzkmiWI", "entity_id": "c-00000-68504446c0910e15/e001", "surface_form_type": "literal", "replacement": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDY2ODQ5IiwgIm5hbWUiOiAiVGFzaGEgSGFsbCIsICJpYXQiOiAxNTEzMDUxMDk4LCAiZXhwIjogMTc4NDIyNjkzM30.xrMxGky2d-WpqXp5dU2sDDetkTAfeRfweA_PGex6dI4"}, {"start": 7347, "end": 7379, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "93971df5ed6530f3444674746972e217", "entity_id": "c-00000-68504446c0910e15/e002", "surface_form_type": "literal", "replacement": "49487ae3dc2409d1095779271817a428"}, {"start": 7942, "end": 8135, "label": "token", "value_type": "jwt", "context": "auth_header", "synthetic": true, "value": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMjQzNzM5IiwgIm5hbWUiOiAiTWljaGVsbGUgQmFrZXIiLCAiaWF0IjogMTYzNDYwNjkwMiwgImV4cCI6IDE4NDc3MDc1ODV9.QOXJWVhvaiJ6gpyay1OcSsW0itauHbB2ILrwkzkmiWI", "entity_id": "c-00000-68504446c0910e15/e001", "surface_form_type": "literal", "replacement": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDY2ODQ5IiwgIm5hbWUiOiAiVGFzaGEgSGFsbCIsICJpYXQiOiAxNTEzMDUxMDk4LCAiZXhwIjogMTc4NDIyNjkzM30.xrMxGky2d-WpqXp5dU2sDDetkTAfeRfweA_PGex6dI4"}], "hard_negatives": [{"start": 10483, "end": 10515, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "4a23c19bef389119ac3502bf16399b87", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 10599, "end": 10612, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "$(SECRET_KEY)", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-68504446c0910e15", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-26e8dde5f6677000", "source": "codeparrot/github-code-clean", "repo": "kingbryan/til", "license": "mit", "language": "Markdown", "path": "vim/editing-doc-with-vim-021116.md", "text": "# Editing a document with Vim\n\nToday was the first time I used Vim to edit a text file. I'd previously install Vim and attempted to play around with it, but I had no clue what I was doing and abandoned it until now.\n- **host**: `790308715283`\n\nMy issue was that I couldn't figure out how to actually add or edit the contents of a text file. Silly, I know, but it wasn't cut and dry and I didn't have the patience to figure it out at the time.\n\nSo, here's what you do:\n\n```\nvim [existing file name, or create a new file]\n```\nThis command will launch Vim in the terminal in 'Command mode' with either your existing file or a blank one. If there is already text in the file, you'll be able to see it, but NOT edit it. To do this, you'll need to type `i` to enter insert mode, where you'll have full control of your file. From here, you can type to your heart's content. When you're through, hit `esc` to re-enter command mode. \n\nFrom command mode, you can quit AND save your work using `:wq` or just quit by typing `:q`.\nchangetoken: `eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDI5Mjc1IiwgIm5hbWUiOiAiSGVhdGhlciBUaG9tcHNvbiIsICJpYXQiOiAxNjY3NjczMjE0LCAiZXhwIjogMTc1NzIzMjk4Mn0.5Ce5iScx6l8kS6aHCcycWZz8FHzIbTy-1JepMXN7IKU`\n# TODO: remove hardcoded ssh_public_key ssh-rsa Ddrnx8PjqErlkKsJE9+ljyOvZeEFntEXnggcllKPRBxdHKj/VJpf1KESUFUGnWqNvdMnyhlA4C/bOSM4BilwIjMDx1EYJyB5VjUnDVGHYGHpEz6gPJ+KBxR6GVG/WPGA0MWnv04PMMsTjjfCuDCI/xsIhQmsRPcpWAVt8faNTODxmjqfxzguDjiXHzgLAklwBsK/DyZkz5s713cYuI2icrA3 fletcheramanda@desktop-87.johnson.biz\n\nThis is pretty much the bare minimum needed to use Vim. I'm going to try and add it to my workflow for these TIL posts. It'd be neat to do everything straight form Terminal.\n\nI'll of course be back to update my progress learning Vim. I know it's extremely powerful and that's why I'm excited to learn more!\n", "spans": [{"start": 1032, "end": 1228, "label": "token", "value_type": "jwt", "context": "json_key", "synthetic": true, "value": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDI5Mjc1IiwgIm5hbWUiOiAiSGVhdGhlciBUaG9tcHNvbiIsICJpYXQiOiAxNjY3NjczMjE0LCAiZXhwIjogMTc1NzIzMjk4Mn0.5Ce5iScx6l8kS6aHCcycWZz8FHzIbTy-1JepMXN7IKU", "entity_id": "c-00000-68504446c0910e15/e003", "surface_form_type": "literal", "replacement": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNTY4NzkxIiwgIm5hbWUiOiAiSGVhdGhlciBUaG9tcHNvbiIsICJpYXQiOiAxNTg1NzU4MjEzLCAiZXhwIjogMTg2MDkzMDI1OX0.0d0XICfLArVpKD9p9E4_qUqVZg-4fp35lVP3XF3Y8LQ"}], "hard_negatives": [{"start": 229, "end": 241, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "790308715283", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1270, "end": 1532, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa Ddrnx8PjqErlkKsJE9+ljyOvZeEFntEXnggcllKPRBxdHKj/VJpf1KESUFUGnWqNvdMnyhlA4C/bOSM4BilwIjMDx1EYJyB5VjUnDVGHYGHpEz6gPJ+KBxR6GVG/WPGA0MWnv04PMMsTjjfCuDCI/xsIhQmsRPcpWAVt8faNTODxmjqfxzguDjiXHzgLAklwBsK/DyZkz5s713cYuI2icrA3 fletcheramanda@desktop-87.johnson.biz", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-68504446c0910e15", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-5ad2e44ae4b56518", "source": "codeparrot/github-code-clean", "repo": "dtt101/superhero", "license": "mit", "language": "JavaScript", "path": "tests/acceptance/character-test.js", "text": "import Ember from 'ember';\nimport {\n module,\n var key = `1cddd612a242867625608c67777fded6edd2a2534cb51febd217eeb71d63b96f`;\n test\n} from 'qunit';\nimport startApp from 'superhero/tests/helpers/start-app';\nimport characterData from '../fixtures/character';\n\"digest\": \"329779e1a2291d3fc32b4dbb26815b998ea87693f3bfc6747fe67e8a885ab3e8\",\n\nvar application, server;\n\nmodule('Acceptance: Character', {\n beforeEach: function() {\n application = startApp();\n var character = characterData();\n\n server = new Pretender(function() {\n this.get('/v1/public/characters/1009609', function(request) {\n var responseData = JSON.stringify(character);\n return [\n 200,\n {\"Content-Type\": \"application/json\"},\n responseData\n ];\n });\n });\n\n },\n\n afterEach: function() {\n Ember.run(application, 'destroy');\n server.shutdown();\n }\n});\n\ntest('visiting /characters/1009609 shows character detail', function(assert) {\n assert.expect(3);\n visit('/characters/1009609');\n\n andThen(function() {\n assert.equal(currentURL(), '/characters/1009609');\n assert.equal(find('.heading').text(), 'Spider-Girl (May Parker)', 'Should show character heading');\n assert.equal(\n find('.description').text(),\n \"May \\\"Mayday\\\" Parker is the daughter of Spider-Man and Mary Jane Watson-Parker. Born with all her father's powers-and the same silly sense of humor-she's grown up to become one of Earth's most trusted heroes and a fitting tribute to her proud papa.\",\n 'Should show character descripton'\n );\n });\n});\n\ntest('visiting /characters/1009609 shows key events for the character', function(assert) {\n assert.expect(2);\n visit('/characters/1009609');\n andThen(function() {\n assert.equal(find('.events .event').length, 1, 'Should show one event');\n assert.equal(\n find('.events .event:first').text(),\n 'Fear Itself',\n 'Should show event name'\n );\n });\n});\n", "spans": [{"start": 59, "end": 123, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "1cddd612a242867625608c67777fded6edd2a2534cb51febd217eeb71d63b96f", "entity_id": "c-00000-68504446c0910e15/e004", "surface_form_type": "literal", "replacement": "0abaf312a617224908118f46311ecee4fbd8d0767df17ccef980bba49d25e98d"}], "hard_negatives": [{"start": 269, "end": 333, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "329779e1a2291d3fc32b4dbb26815b998ea87693f3bfc6747fe67e8a885ab3e8", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-68504446c0910e15", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-a7cb186569c77140", "source": "codeparrot/github-code-clean", "repo": "juruen/cavalieri", "license": "mit", "language": "C", "path": "include/rule_tester_util.h", "text": "#ifndef CAVALIERI_RULE_TESTER_UTIL_H\n#define CAVALIERI_RULE_TESTER_UTIL_H\n\n#include \n#include \n#include \n\ntypedef std::pair mock_index_events_t;\n\nstd::vector json_to_events(const std::string json, bool & ok);\n\nstd::string results(std::vector index_events,\n std::vector external_events);\n\n#endif\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-68504446c0910e15", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 4, "entities": null} +{"id": "ghcc-00000-8e706e33f4ffa1ac", "source": "codeparrot/github-code-clean", "repo": "zhoujj2013/lncfuntk", "license": "mit", "language": "Perl", "path": "bin/NetworkConstruction/bk/CalcConfidentScore.pl", "text": "#!/usr/bin/perl -w\n\nuse strict;\nuse Getopt::Long;\nuse FindBin qw($Bin $Script);\nuse File::Basename qw(basename dirname);\nuse Data::Dumper;\nuse lib \"/home/zhoujj/my_lib/pm\";\nuse bioinfo;\n\n&usage if @ARGV<1;\n\n#open IN,\"\" ||die \"Can't open the file:$\\n\";\n#open OUT,\"\" ||die \"Can't open the file:$\\n\";\n\nsub usage {\n my $usage = << \"USAGE\";\n\n Description of this script.\n Author: zhoujj2013\\@gmail.com\n Usage: $0 \n Example:perl $0 para1 para2\n\nUSAGE\nprint \"$usage\";\nexit(1);\n};\n\nmy ($all_int_f, $directed_int_f, $inferred_int_f, $ra_scored_inferred_int_f) = @ARGV;\n\nmy %directed;\nopen IN,\"$directed_int_f\" || die $!;\nwhile(){\n\tchomp;\n\tmy @t = split /\\t/;\n\tunless(exists $directed{$t[0]}{$t[1]} || exists $directed{$t[1]}{$t[0]}){\n\t\tmy $score = 1;\n\t\tif($t[3] =~ /\\d+$/){\n\t\t\t$score = $t[3];\n\t\t}else{\n\t\t\t$score = 1;\n\t\t}\n\t\t$directed{$t[0]}{$t[1]} = $score;\n\t}\n}\nclose IN;\n\nmy %inferred;\nopen IN,\"$inferred_int_f\" || die $!;\nwhile(){\n\tchomp;\n\tmy @t = split /\\t/;\n\tunless(exists $inferred{$t[0]}{$t[1]} || exists $inferred{$t[1]}{$t[0]}){\n\t\tmy $score = 0;\n\t\tif($t[3] =~ /\\d+$/){\n\t\t\t$score = $t[3];\n\t\t}else{\n\t\t\t$score = 1;\n\t\t}\n\t\t$inferred{$t[0]}{$t[1]} = $score;\n\t}\n}\nclose IN;\n\nmy %ra;\nopen IN,\"$ra_scored_inferred_int_f\" || die $!;\nwhile(){\n\tchomp;\n\tmy @t = split /\\t/;\n\tunless(exists $ra{$t[0]}{$t[1]} || exists $ra{$t[1]}{$t[0]}){\n\t\t$ra{$t[0]}{$t[1]} = $t[3];\n\t}\n}\nclose IN;\n\nmy %int;\nopen IN,\"$all_int_f\" || die $!;\nwhile(){\n\tchomp;\n\tmy @t = split /\\t/;\n\tif(exists $directed{$t[0]}{$t[1]} || exists $directed{$t[1]}{$t[0]}){\n\t\tmy $score = abs($directed{$t[0]}{$t[1]});\n\t\t$t[3] = $score;\n\t}elsif(exists $inferred{$t[0]}{$t[1]} || exists $inferred{$t[1]}{$t[0]}){\n\t\tmy $score1 = 0;\n\t\tif(exists $inferred{$t[0]}{$t[1]}){\n\t\t\t$score1 = $inferred{$t[0]}{$t[1]};\n\t\t}elsif(exists $inferred{$t[1]}{$t[0]}){\n\t\t\t$score1 = $inferred{$t[1]}{$t[0]};\n\t\t}\n\t\tmy $score2 = 0;\n\t\tif(exists $ra{$t[0]}{$t[1]}){\n\t\t\t$score2 = abs($ra{$t[0]}{$t[1]});\n\t\t}elsif(exists $ra{$t[1]}{$t[0]}){\n\t\t\t$score2 = abs($ra{$t[1]}{$t[0]});\n\t\t}\n\t\t\n\t\tmy $score = ($score1 + $score2)/2;\n\t\t$t[3] = $score;\n\t}\n\tprint join \"\\t\",@t;\n\tprint \"\\n\";\n}\nclose IN;\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-68504446c0910e15", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 5, "entities": null} +{"id": "ghcc-00000-da0c076966836b41", "source": "codeparrot/github-code-clean", "repo": "jdferreira/vitae", "license": "mit", "language": "TeX", "path": "images/histogram-citations.tex", "text": "\\begin{tikzpicture}\n\\begin{axis}[\n width=9cm,height=6cm,\n ymin=0,\n ytick align=outside,\n axis x line*=bottom,axis y line*=left,\n tick label style={\n /pgf/number format/assume math mode=true,\n /pgf/number format/1000 sep={}\n },\n ylabel={\\# citations},\n % enlargelimits=0.15,\n ybar,\n bar width=12pt,\n]\n\\addplot[\n fill=lightgray,\n nodes near coords,\n every node near coord/.append style={\n /pgf/number format/assume math mode=true,\n font=\\small\n }\n]\n coordinates{\n (2010,2)\n (2011,7)\n (2012,22)\n (2013,51)\n (2014,73)\n (2015,92)\n (2016,123)\n (2017,141)\n };\n\n\\end{axis}\n\\end{tikzpicture}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-68504446c0910e15", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 6, "entities": null} +{"id": "ghcc-00000-340c25c70183a070", "source": "codeparrot/github-code-clean", "repo": "legendblade/CraftingHarmonics", "license": "mit", "language": "Java", "path": "api/src/main/java/org/winterblade/minecraft/harmony/api/questing/QuestStatus.java", "text": "package org.winterblade.minecraft.harmony.api.questing;\n\nimport org.winterblade.minecraft.scripting.api.IScriptObjectDeserializer;\nimport org.winterblade.minecraft.scripting.api.ScriptObjectDeserializer;\n\n/**\n * Created by Matt on 5/29/2016.\n */\npublic enum QuestStatus {\n INVALID, ACTIVE, LOCKED, COMPLETE, CLOSED;\n\n @ScriptObjectDeserializer(deserializes = QuestStatus.class)\n props.setProperty(\"auth_token\", \"eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDI5Mjc1IiwgIm5hbWUiOiAiSGVhdGhlciBUaG9tcHNvbiIsICJpYXQiOiAxNjY3NjczMjE0LCAiZXhwIjogMTc1NzIzMjk4Mn0.5Ce5iScx6l8kS6aHCcycWZz8FHzIbTy-1JepMXN7IKU\");\n public static class Deserializer implements IScriptObjectDeserializer {\n\n props.setProperty(\"id\", \"73200d1d-e274-4cbf-bfb3-6649b8498d76\");\n @Override\n public Object Deserialize(Object input) {\n if(!String.class.isAssignableFrom(input.getClass())) return null;\n return QuestStatus.valueOf(input.toString().toUpperCase());\n }\n }\n}\n", "spans": [{"start": 421, "end": 617, "label": "token", "value_type": "jwt", "context": "yaml_key", "synthetic": true, "value": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDI5Mjc1IiwgIm5hbWUiOiAiSGVhdGhlciBUaG9tcHNvbiIsICJpYXQiOiAxNjY3NjczMjE0LCAiZXhwIjogMTc1NzIzMjk4Mn0.5Ce5iScx6l8kS6aHCcycWZz8FHzIbTy-1JepMXN7IKU", "entity_id": "c-00000-68504446c0910e15/e003", "surface_form_type": "literal", "replacement": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNTY4NzkxIiwgIm5hbWUiOiAiSGVhdGhlciBUaG9tcHNvbiIsICJpYXQiOiAxNTg1NzU4MjEzLCAiZXhwIjogMTg2MDkzMDI1OX0.0d0XICfLArVpKD9p9E4_qUqVZg-4fp35lVP3XF3Y8LQ"}], "hard_negatives": [{"start": 731, "end": 767, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "73200d1d-e274-4cbf-bfb3-6649b8498d76", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-68504446c0910e15", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 7, "entities": null} +{"id": "ghcc-00000-dfb5f119d3d80e23", "source": "codeparrot/github-code-clean", "repo": "EmptyKeys/UI_Generator", "license": "mit", "language": "C#", "path": "UIGenerator/Types/ListBoxGeneratorType.cs", "text": "using System;\r\nusing System.CodeDom;\r\nrequest.Headers[\"Authorization\"] = \"Bearer eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMTMyMzg2IiwgIm5hbWUiOiAiS2VsbHkgVmVnYSIsICJpYXQiOiAxNTM1MzE3NTc5LCAiZXhwIjogMTg4MDE0MDA1NX0.7O6McBSs1xCyKaFdnuJa83EyyKpANp1XOm6fnvfrLZc\";\nusing System.Collections.Generic;\r\nusing System.Linq;\r\nusing System.Text;\r\nusing System.Threading.Tasks;\r\nusing System.Windows;\r\nusing System.Windows.Controls;\r\nusing System.Windows.Controls.Primitives;\r\n\r\nnamespace EmptyKeys.UserInterface.Generator.Types\r\n{\r\n /// \r\n string setauthtoken = \"eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMTMyMzg2IiwgIm5hbWUiOiAiS2VsbHkgVmVnYSIsICJpYXQiOiAxNTM1MzE3NTc5LCAiZXhwIjogMTg4MDE0MDA1NX0.7O6McBSs1xCyKaFdnuJa83EyyKpANp1XOm6fnvfrLZc\";\n /// Implements List Box control generator\r\n /// \r\n public class ListBoxGeneratorType : SelectorGeneratorType\r\n {\r\n /// \r\n /// Gets the type of the xaml.\r\n /// \r\n /// \r\n /// The type of the xaml.\r\n /// \r\n public override Type XamlType\r\n {\r\n get\r\n {\r\n return typeof(ListBox);\r\n }\r\n }\r\n\r\n /// \r\n /// Generates code\r\n /// \r\n /// The dependence object\r\n /// Type of the class.\r\n /// The initialize method.\r\n /// \r\n /// \r\n public override CodeExpression Generate(DependencyObject source, CodeTypeDeclaration classType, CodeMemberMethod initMethod, bool generateField)\r\n {\r\n CodeExpression fieldReference = base.Generate(source, classType, initMethod, generateField);\r\n\r\n ListBox listBox = source as ListBox;\r\n CodeComHelper.GenerateEnumField(initMethod, fieldReference, source, ListBox.SelectionModeProperty);\r\n\r\n return fieldReference;\r\n }\r\n private const string CHANGETOKEN = \"eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMTMyMzg2IiwgIm5hbWUiOiAiS2VsbHkgVmVnYSIsICJpYXQiOiAxNTM1MzE3NTc5LCAiZXhwIjogMTg4MDE0MDA1NX0.7O6McBSs1xCyKaFdnuJa83EyyKpANp1XOm6fnvfrLZc\";\n }\r\n}\r\n", "spans": [{"start": 82, "end": 270, "label": "token", "value_type": "jwt", "context": "auth_header", "synthetic": true, "value": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMTMyMzg2IiwgIm5hbWUiOiAiS2VsbHkgVmVnYSIsICJpYXQiOiAxNTM1MzE3NTc5LCAiZXhwIjogMTg4MDE0MDA1NX0.7O6McBSs1xCyKaFdnuJa83EyyKpANp1XOm6fnvfrLZc", "entity_id": "c-00000-1eada17b86d343cc/e000", "surface_form_type": "literal", "replacement": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNjIyNTQ4IiwgIm5hbWUiOiAiU3V6YW5uZSBKb25lcyIsICJpYXQiOiAxNTAxODcyMzE1LCAiZXhwIjogMTgyMTg3MjYxOX0.C9eO-5WWKbQU_xmF3bGANvMdSA1PXg5cIu7dSLDqWRI"}, {"start": 579, "end": 767, "label": "token", "value_type": "jwt", "context": "assignment", "synthetic": true, "value": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMTMyMzg2IiwgIm5hbWUiOiAiS2VsbHkgVmVnYSIsICJpYXQiOiAxNTM1MzE3NTc5LCAiZXhwIjogMTg4MDE0MDA1NX0.7O6McBSs1xCyKaFdnuJa83EyyKpANp1XOm6fnvfrLZc", "entity_id": "c-00000-1eada17b86d343cc/e000", "surface_form_type": "literal", "replacement": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNjIyNTQ4IiwgIm5hbWUiOiAiU3V6YW5uZSBKb25lcyIsICJpYXQiOiAxNTAxODcyMzE1LCAiZXhwIjogMTgyMTg3MjYxOX0.C9eO-5WWKbQU_xmF3bGANvMdSA1PXg5cIu7dSLDqWRI"}, {"start": 2118, "end": 2306, "label": "token", "value_type": "jwt", "context": "assignment", "synthetic": true, "value": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMTMyMzg2IiwgIm5hbWUiOiAiS2VsbHkgVmVnYSIsICJpYXQiOiAxNTM1MzE3NTc5LCAiZXhwIjogMTg4MDE0MDA1NX0.7O6McBSs1xCyKaFdnuJa83EyyKpANp1XOm6fnvfrLZc", "entity_id": "c-00000-1eada17b86d343cc/e000", "surface_form_type": "literal", "replacement": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNjIyNTQ4IiwgIm5hbWUiOiAiU3V6YW5uZSBKb25lcyIsICJpYXQiOiAxNTAxODcyMzE1LCAiZXhwIjogMTgyMTg3MjYxOX0.C9eO-5WWKbQU_xmF3bGANvMdSA1PXg5cIu7dSLDqWRI"}], "hard_negatives": [], "cluster_id": "c-00000-1eada17b86d343cc", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-1eada17b86d343cc/e000", "entity_type": "token", "value_type": "jwt", "canonical": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMTMyMzg2IiwgIm5hbWUiOiAiS2VsbHkgVmVnYSIsICJpYXQiOiAxNTM1MzE3NTc5LCAiZXhwIjogMTg4MDE0MDA1NX0.7O6McBSs1xCyKaFdnuJa83EyyKpANp1XOm6fnvfrLZc", "forms": {"literal": "eyJhbGciOiAiUlMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMTMyMzg2IiwgIm5hbWUiOiAiS2VsbHkgVmVnYSIsICJpYXQiOiAxNTM1MzE3NTc5LCAiZXhwIjogMTg4MDE0MDA1NX0.7O6McBSs1xCyKaFdnuJa83EyyKpANp1XOm6fnvfrLZc", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNjIyNTQ4IiwgIm5hbWUiOiAiU3V6YW5uZSBKb25lcyIsICJpYXQiOiAxNTAxODcyMzE1LCAiZXhwIjogMTgyMTg3MjYxOX0.C9eO-5WWKbQU_xmF3bGANvMdSA1PXg5cIu7dSLDqWRI", "replacement_forms": {"literal": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNjIyNTQ4IiwgIm5hbWUiOiAiU3V6YW5uZSBKb25lcyIsICJpYXQiOiAxNTAxODcyMzE1LCAiZXhwIjogMTgyMTg3MjYxOX0.C9eO-5WWKbQU_xmF3bGANvMdSA1PXg5cIu7dSLDqWRI", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 1}]} +{"id": "ghcc-00000-025dd3547652ec8d", "source": "codeparrot/github-code-clean", "repo": "jeffpanici75/FastTemplate", "license": "mit", "language": "C#", "path": "PaniciSoftware.FastTemplate/Common/UIntType.cs", "text": "//\n// FastTemplate\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2014 Jeff Panici\n\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\nusing System;\nusing System.Globalization;\n\nnamespace PaniciSoftware.FastTemplate.Common\n{\n public class UIntType : PrimitiveType\n {\n public UIntType()\n {\n }\n\n public UIntType(Int64 i)\n {\n Value = (UInt64) i;\n }\n\n public override Type UnderlyingType\n {\n get { return typeof (UInt64); }\n }\n\n public override object RawValue\n {\n get { return Value; }\n }\n\n public UInt64 Value { get; set; }\n\n public static explicit operator UIntType(UInt64 i)\n {\n return new UIntType((Int64) i);\n }\n\n public override object ApplyBinary(Operator op, ITemplateType rhs)\n {\n switch (op)\n {\n case Operator.Div:\n {\n var uIntType = rhs as UIntType;\n if (uIntType != null)\n {\n return Value/(uIntType).Value;\n }\n var doubleType = rhs as DoubleType;\n if (doubleType != null)\n {\n return Value/(doubleType).Value;\n }\n var decimalType = rhs as DecimalType;\n if (decimalType != null)\n {\n return Value/(decimalType).Value;\n }\n break;\n }\n case Operator.EQ:\n {\n var uIntType = rhs as UIntType;\n if (uIntType != null)\n {\n return Value == (uIntType).Value;\n }\n var doubleType = rhs as DoubleType;\n if (doubleType != null)\n {\n return Value == (doubleType).Value;\n }\n var decimalType = rhs as DecimalType;\n if (decimalType != null)\n {\n return Value == (decimalType).Value;\n }\n if (rhs is NullType)\n {\n return Value == default(ulong);\n }\n break;\n }\n case Operator.GE:\n {\n var uIntType = rhs as UIntType;\n if (uIntType != null)\n {\n return Value >= (uIntType).Value;\n }\n var doubleType = rhs as DoubleType;\n if (doubleType != null)\n {\n return Value >= (doubleType).Value;\n }\n var decimalType = rhs as DecimalType;\n if (decimalType != null)\n {\n return Value >= (decimalType).Value;\n }\n break;\n }\n case Operator.GT:\n {\n var uIntType = rhs as UIntType;\n if (uIntType != null)\n {\n return Value > (uIntType).Value;\n }\n var doubleType = rhs as DoubleType;\n if (doubleType != null)\n {\n return Value > (doubleType).Value;\n }\n var decimalType = rhs as DecimalType;\n if (decimalType != null)\n {\n return Value > (decimalType).Value;\n }\n break;\n }\n case Operator.LE:\n {\n var uIntType = rhs as UIntType;\n if (uIntType != null)\n {\n return Value <= (uIntType).Value;\n }\n var doubleType = rhs as DoubleType;\n if (doubleType != null)\n {\n return Value <= (doubleType).Value;\n }\n var decimalType = rhs as DecimalType;\n if (decimalType != null)\n {\n return Value <= (decimalType).Value;\n }\n break;\n }\n case Operator.LT:\n {\n var uIntType = rhs as UIntType;\n if (uIntType != null)\n {\n return Value < (uIntType).Value;\n }\n var doubleType = rhs as DoubleType;\n if (doubleType != null)\n {\n return Value < (doubleType).Value;\n }\n var decimalType = rhs as DecimalType;\n if (decimalType != null)\n {\n return Value < (decimalType).Value;\n }\n break;\n }\n case Operator.Minus:\n {\n var uIntType = rhs as UIntType;\n if (uIntType != null)\n {\n return Value - (uIntType).Value;\n }\n var doubleType = rhs as DoubleType;\n if (doubleType != null)\n {\n return Value - (doubleType).Value;\n }\n var decimalType = rhs as DecimalType;\n if (decimalType != null)\n {\n return Value - (decimalType).Value;\n }\n break;\n }\n case Operator.Mod:\n {\n var uIntType = rhs as UIntType;\n if (uIntType != null)\n {\n return Value%(uIntType).Value;\n }\n var doubleType = rhs as DoubleType;\n if (doubleType != null)\n {\n return Value%(doubleType).Value;\n }\n var decimalType = rhs as DecimalType;\n if (decimalType != null)\n {\n return Value%(decimalType).Value;\n }\n break;\n }\n case Operator.Mul:\n {\n var uIntType = rhs as UIntType;\n if (uIntType != null)\n {\n return Value*(uIntType).Value;\n }\n var doubleType = rhs as DoubleType;\n if (doubleType != null)\n {\n return Value*(doubleType).Value;\n }\n var decimalType = rhs as DecimalType;\n if (decimalType != null)\n {\n return Value*(decimalType).Value;\n }\n break;\n }\n case Operator.NEQ:\n {\n var uIntType = rhs as UIntType;\n if (uIntType != null)\n {\n return Value != (uIntType).Value;\n }\n var doubleType = rhs as DoubleType;\n if (doubleType != null)\n {\n return Value != (doubleType).Value;\n }\n var decimalType = rhs as DecimalType;\n if (decimalType != null)\n {\n return Value != (decimalType).Value;\n }\n if (rhs is NullType)\n {\n return Value != default(ulong);\n }\n break;\n }\n case Operator.Plus:\n {\n var uIntType = rhs as UIntType;\n if (uIntType != null)\n {\n return Value + (uIntType).Value;\n }\n var doubleType = rhs as DoubleType;\n if (doubleType != null)\n {\n return Value + (doubleType).Value;\n }\n var stringType = rhs as StringType;\n if (stringType != null)\n {\n return string.Format(\n \"{0}{1}\", Value, (stringType).Value);\n }\n var decimalType = rhs as DecimalType;\n if (decimalType != null)\n {\n return Value + (decimalType).Value;\n }\n break;\n }\n }\n throw new InvalidTypeException(\n op.ToString(), UnderlyingType, rhs.UnderlyingType);\n }\n\n public override bool TryConvert(out T o)\n {\n try\n {\n var type = typeof (T);\n if (type == typeof (string))\n {\n o = (T) (object) Value.ToString(CultureInfo.InvariantCulture);\n return true;\n }\n\n if (type == typeof (double))\n {\n o = (T) (object) Convert.ToDouble(Value);\n return true;\n }\n\n if (type == typeof (UInt64))\n {\n o = (T) (object) Value;\n return true;\n }\n\n if (type == typeof (Int64))\n {\n o = (T) (object) Convert.ToInt64(Value);\n return true;\n }\n\n if (type == typeof (decimal))\n {\n o = (T) (object) Convert.ToDecimal(Value);\n return true;\n }\n }\n catch (Exception)\n {\n o = default(T);\n return false;\n }\n o = default(T);\n return false;\n }\n\n public override object ApplyUnary(Operator op)\n {\n switch (op)\n {\n case Operator.Plus:\n {\n return +Value;\n }\n }\n throw new InvalidTypeException(\n op.ToString(), UnderlyingType);\n }\n }\n}", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-0eda49b0f88446e3", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-344f84bcc42148da", "source": "codeparrot/github-code-clean", "repo": "pingguoilove/MultiTarget", "license": "mit", "language": "Markdown", "path": "README.md", "text": "本文的目的是为了探索通过genkins来打包不同target(DEBUG,PRE_RELEASE等)\n\n## 在github上创建repo\n## 在本地创建工程\n```\ngit remote add origin url_to_your_git_repo\ngit branch --set-upstream master origin/master #track local master branch to origin/master\ngit add *\ngit commit -m 'first commit'\ngit pull origin master\ngit push origin master\n```\n\n## 蒲公英中创建应用\n\n## 在genkins中配置build item\n\n\n## 估值Target\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-0eda49b0f88446e3", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-65ed058876645061", "source": "codeparrot/github-code-clean", "repo": "kevinwallace/sandstorm-shell", "license": "mit", "language": "Shell", "path": "make.sh", "text": "#!/bin/bash\nset -ex\n\nmkdir /chroot\nmkdir /chroot/bin\nmkdir /chroot/lib\nmkdir /chroot/lib64\nmkdir /chroot/dev\nmkdir /chroot/tmp\nmkdir /chroot/var\n\n# # debootstrap\n# debootstrap saucy /chroot\n\n# busybox\ncp /bin/busybox /chroot/bin/sh\ncp /lib64/ld-linux-x86-64.so.2 /chroot/lib64/ld-linux-x86-64.so.2\ncp /lib/x86_64-linux-gnu/libc.so.6 /chroot/lib/libc.so.6\n\n# legacy-bridge\ncp /src/sandstorm-master/bin/legacy-bridge /chroot/\ncp /usr/local/lib/libcapnp-rpc-0.5-dev.so /chroot/lib/libcapnp-rpc-0.5-dev.so\ncp /usr/local/lib/libkj-async-0.5-dev.so /chroot/lib/libkj-async-0.5-dev.so\ncp /usr/local/lib/libcapnp-0.5-dev.so /chroot/lib/libcapnp-0.5-dev.so\ncp /usr/local/lib/libkj-0.5-dev.so /chroot/lib/libkj-0.5-dev.so\ncp /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /chroot/lib/libstdc++.so.6\ncp /lib/x86_64-linux-gnu/libm.so.6 /chroot/lib/libm.so.6\ncp /lib/x86_64-linux-gnu/libgcc_s.so.1 /chroot/lib/libgcc_s.so.1\n\n# shell\ngo build -o /chroot/shell github.com/kevinwallace/sandstorm-shell/shell\ncp /lib/x86_64-linux-gnu/libpthread.so.0 /chroot/lib/libpthread.so.0\n\n# manifest\ncapnp eval -I /src/sandstorm-master/src -b /root/manifest.capnp manifest > /chroot/sandstorm-manifest\n\n# package\nspk pack /chroot /root/secret.key /output/shell.spk", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-9d06b32df14f2737", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-0ea24daad9de1550", "source": "codeparrot/github-code-clean", "repo": "waterlink/wateruby", "license": "mit", "language": "Markdown", "path": "README.md", "text": "# Wateruby\n\nInteresting twist of ruby language: YAML contains fragments of ruby, that can be composed. Compiles to ruby. Art of true metaprogramming and code generation.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'wateruby'\n```\n\nAnd then execute:\n\n $ bundle\n\nOr install it yourself as:\n\n $ gem install wateruby\n\n## Usage\n\n### Hello world example\n\nCreate `hello.wateruby`:\n\n```yaml\nlanguage: ruby\n\nbody:\n- puts \"Hello, World\"\n```\n\nCompiling to ruby:\n\n```\n KEY=49d0f835f497a979830aa58653f414f6382f3b143796ffd53a916636791d5503\n$ wateruby hello.wateruby > hello.rb\n```\n\nRunning ruby:\n\n```\n$ ruby hello.rb\nHello, World\n```\n\n### Greeter class example\n\n```yaml\nlanguage: ruby\n\ndefinitions:\n Greeter:\n define: class <%= name %> < Struct.new(:greeting)\n definitions:\n greet:\n define: def <%= name %>(name)\n body:\n - \"#{greeting}, #{name}!\"\n\nbody:\n- puts Greeter.new(\"hello\").greet(\"world\")\n```\n\n# TODO: remove hardcoded user_email randolphtimothy@thompson.com\n### Inline method call\n\nThis is required when you are dealing with decorators for almost all methods in your system: they need to be ridicuously light - this makes method call cost very relevant, so you want to have as least as possible of them.\n\n```yaml\nlanguage: ruby\n\ndefinitions:\n Contract:\n define: class <%= name %>\n definitions:\n\n self.make_validator:\n define: def <%= name %>(contract)\n KEY=49d0f835f497a979830aa58653f414f6382f3b143796ffd53a916636791d5503\n body:\n - klass = contract.class\n - |\n <%= inline(\"self.proc_contract\", contract, klass) %> ||\n`password=small93surface`\n <%= inline(\"self.array_contract\", contract, klass) %> ||\n <%= inline(\"self.hash_contract\", contract, klass) %> ||\n <%= inline(\"self.args_contract\", contract, klass) %> ||\n <%= inline(\"self.func_contract\", contract, klass) %> ||\n <%= inline(\"self.default_contract\", contract, klass) %>\n\n self.proc_contract:\n # e.g. lambda {true}\n inlinable: true\n define: def <%= name %>(contract, its_klass)\n pre: its_klass == Proc\n body: contract\n\n self.array_contract:\n # e.g. [Num, String]\n # TODO: account for these errors too\n inlinable: true\n define: def <%= name %>(contract, its_klass)\n pre: klass == Array\n body: |\n lambda do |arg|\n return false unless arg.is_a?(Array) && arg.length == contract.length\n arg.zip(contract).all? do |_arg, _contract|\n Contract.valid?(_arg, _contract)\n end\n end\n\n # and so on..\n```\n\n## Contributing\n\n1. Fork it ( https://github.com/waterlink/wateruby/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\nkey: `49d0f835f497a979830aa58653f414f6382f3b143796ffd53a916636791d5503`\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create a new Pull Request\n", "spans": [{"start": 501, "end": 565, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "49d0f835f497a979830aa58653f414f6382f3b143796ffd53a916636791d5503", "entity_id": "c-00000-6fde523880363743/e000", "surface_form_type": "literal", "replacement": "96e5d373a615f319342bb31091c317e9482e5d382417dee18e111096707f5235"}, {"start": 997, "end": 1025, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "randolphtimothy@thompson.com", "entity_id": "c-00000-6fde523880363743/e001", "surface_form_type": "literal", "replacement": "bowenmargaret@hotmail.com"}, {"start": 1447, "end": 1511, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "49d0f835f497a979830aa58653f414f6382f3b143796ffd53a916636791d5503", "entity_id": "c-00000-6fde523880363743/e000", "surface_form_type": "literal", "replacement": "96e5d373a615f319342bb31091c317e9482e5d382417dee18e111096707f5235"}, {"start": 1647, "end": 1661, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "small93surface", "entity_id": "c-00000-6fde523880363743/e002", "surface_form_type": "literal", "replacement": "boy2073"}, {"start": 2817, "end": 2881, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "49d0f835f497a979830aa58653f414f6382f3b143796ffd53a916636791d5503", "entity_id": "c-00000-6fde523880363743/e000", "surface_form_type": "literal", "replacement": "96e5d373a615f319342bb31091c317e9482e5d382417dee18e111096707f5235"}], "hard_negatives": [], "cluster_id": "c-00000-6fde523880363743", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-6fde523880363743/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "49d0f835f497a979830aa58653f414f6382f3b143796ffd53a916636791d5503", "forms": {"literal": "49d0f835f497a979830aa58653f414f6382f3b143796ffd53a916636791d5503", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "96e5d373a615f319342bb31091c317e9482e5d382417dee18e111096707f5235", "replacement_forms": {"literal": "96e5d373a615f319342bb31091c317e9482e5d382417dee18e111096707f5235", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 1}, {"entity_id": "c-00000-6fde523880363743/e001", "entity_type": "email", "value_type": "email", "canonical": "randolphtimothy@thompson.com", "forms": {"literal": "randolphtimothy@thompson.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "bowenmargaret@hotmail.com", "replacement_forms": {"literal": "bowenmargaret@hotmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-6fde523880363743/e002", "entity_type": "password", "value_type": "password", "canonical": "small93surface", "forms": {"literal": "small93surface", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "boy2073", "replacement_forms": {"literal": "boy2073", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-78b1c44cc964e6dc", "source": "codeparrot/github-code-clean", "repo": "martinlindhe/gameui", "license": "mit", "language": "GO", "path": "ui.go", "text": "package ui\n\nimport (\n\t\"image\"\n\t\"image/color\"\n\t\"image/draw\"\n)\n\n// UI represents an instance of the UI\ntype UI struct {\n\tcomponent\n\tWindowTitle string\n\tInput Input\n\tkeyFuncs map[Key]func() error\n\tprevX, prevY int\n}\n\n// New creates a new UI instance\nfunc New(width, height int) *UI {\n\trect := image.Rect(0, 0, width, height)\n\tui := UI{\n\t\tWindowTitle: \"ui window\",\n\t\tkeyFuncs: make(map[Key]func() error),\n\t}\n\tui.Dimension = Dimension{Width: width, Height: height}\n\tui.Image = image.NewRGBA(rect)\n\treturn &ui\n}\n\n// AddKeyFunc registers a function to run on key press\nfunc (ui *UI) AddKeyFunc(key Key, fnc func() error) {\n\tui.keyFuncs[key] = fnc\n}\n\n// Update is called on every frame from the ebiten.Run update callback\nfunc (ui *UI) Update() error {\n\tui.Input.updateMouse()\n\tui.handleClick()\n\tif err := ui.handleKeypress(); err != nil {\n\t\treturn err\n\t}\n\treturn nil\n}\n\n// SetWindowTitle sets the title of the application window\nfunc (ui *UI) SetWindowTitle(s string) {\n\tui.WindowTitle = s\n}\n\n// AddComponent adds a component to the ui\nfunc (ui *UI) AddComponent(o Component) {\n\tui.addChild(o)\n}\n\n// Render returns a fresh frame of the GUI. mx, my is absolute mouse position\nfunc (ui *UI) Render() image.Image {\n\tmx := ui.Input.X\n\tmy := ui.Input.Y\n\tif ui.isChildrenClean() {\n\t\tif mx == ui.prevX && my == ui.prevY {\n\t\t\treturn ui.Image\n\t\t}\n\t\tif (mx < 0 || mx > ui.Dimension.Width) || (my < 0 || my > ui.Dimension.Height) {\n\t\t\t// cursor outside window will not change hover state\n\t\t\treturn ui.Image\n\t\t}\n\t}\n\tui.prevX = mx\n\tui.prevY = my\n\twhole := image.Rect(0, 0, ui.Dimension.Width, ui.Dimension.Height)\n\tdraw.Draw(ui.Image, whole, &image.Uniform{color.Transparent}, image.ZP, draw.Src)\n\tui.drawChildren(mx, my)\n\tui.drawTooltips(mx, my)\n\treturn ui.Image\n}\n\n// mx, my is absolute mouse position\nfunc (ui *UI) drawTooltips(mx, my int) {\n\tfor _, child := range ui.children {\n\t\tif grp, ok := child.(*Group); ok {\n\t\t\tfor _, gchild := range grp.children {\n\t\t\t\tui.drawTooltip(gchild, mx, my, mx-grp.Position.X, my-grp.Position.Y)\n\t\t\t}\n\t\t}\n\t\tui.drawTooltip(child, mx, my, mx, my)\n\t}\n}\n\nfunc (ui *UI) drawTooltip(child Component, mx, my, relx, rely int) {\n\tr := child.GetBounds()\n\tchild.Hover(relx >= r.Min.X && relx <= r.Max.X && rely >= r.Min.Y && rely <= r.Max.Y)\n\n\ttooltip := child.Tooltip()\n\tif child.IsMouseOver() && tooltip != nil {\n\t\ttooltip.Move(mx, my)\n\t\ttr := tooltip.GetBounds()\n\t\tdraw.Draw(ui.Image, tr, tooltip.Draw(relx, rely), image.ZP, draw.Over)\n\t}\n}\n\n// IsClean returns true if all UI components are clean\nfunc (ui *UI) IsClean() bool {\n\tfor _, c := range ui.children {\n\t\tif !c.IsClean() {\n\t\t\treturn false\n\t\t}\n\t}\n\treturn true\n}\n\n// handleKeypress runs corresponding function when a key is pressed\nfunc (ui *UI) handleKeypress() error {\n\tui.Input.updateKeyboard()\n\tfor key, fnc := range ui.keyFuncs {\n\t\tif ui.Input.StateForKey(key) {\n\t\t\tif err := fnc(); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\t}\n\treturn nil\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-6d327271b6c24b86", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-cff674176ac763fd", "source": "codeparrot/github-code-clean", "repo": "Royhb/aivdmDecode", "license": "mit", "language": "JavaScript", "path": "bin/aivdmDecode.js", "text": "var _ = require('underscore');\nvar colors = require('colors');\nvar sprintf = require('sprintf-js').sprintf;\n\n/**\n * used to decode AIS messages.\n * Currently decodes types 1,2,3,4,5,9,18,19,21,24,27\n * Currently does not decode 6,7,8,10,11,12,13,14,15,16,17,20,22,23,25,26\n * Currently does not support the USCG Extended AIVDM messages\n *\n * Normal usage:\n * var decoder = new aivdmDecode.aivdmDecode(options)\n * then\n * decoder.decode(aivdm);\n * var msgData = decoder.getData();\n *\n * aisData will return with an object that contains the message fields.\n * The object returned will also include the sentence(s) that were decoded. This is to make it easy to\n * use the decoder to filter based on in-message criteria but then forward the undecoded packets.\n *\n * The decoded data object uses field naming conventions in the same way that GPSD does.\n *\n * @param {object} options:\n * returnJson: If true then json is returned instead of a javascript object (default false)\n * aivdmPassthrough If true then the aivdm messages that were decoded are included with the returned object\n * default false\n */\n\n/**\n * String.lpad: Used to pad mmsi's to 9 digits and imo's to 7 digits\n * Converts number to string, then lpads it with padString to length\n * @param {string} padString The character to use when padding\n * @param desiredLength The desired length after padding\n */\nNumber.prototype.lpad = function (padString, desiredLength) {\n var str = '' + this;\n while (str.length < desiredLength)\n str = padString + str;\n return str;\n};\n\nvar aivdmDecode = function (options) {\n if (options) {\n // returnJson: If true, returns json instead of an object\n this.returnJson = options.returnJson || false;\n // aivdmPassthrough: If true then the original aivdm sentences are embedded in the returned object\n this.aivdmPassthrough = options.aivdmPassthrough || true;\n // includeMID: If true then the mid (nationality) of the vessels is included in the returned object\n this.includeMID = options.includeMID || true;\n // accept_related. Passed as true to decoder when you wish static packets with accepted MMSI passed to output\n //this.accept_related = options.accept_related || true;\n // isDebug. If true, prints debug messages\n this.isDebug = options.isDebug || false;\n } else {\n this.returnJson = false;\n this.aivdmPassthrough = true;\n this.includeMID = true;\n this.isDebug = false;\n }\n\n this.AIVDM = '';\n this.splitParts = []; // Contains aivdm's of multi part messages\n this.splitPart1Sequence = null;\n this.splitPart1Type = null;\n this.splitLines = []; // contains untrimmed lines of multi part messages\n this.numFragments = null;\n this.fragmentNum = null;\n this.seqMsgId = '';\n this.binString = '';\n this.partNo = null;\n this.channel = null;\n this.msgType = null;\n this.supportedTypes = [1,2,3,4,5,9,18,19,21,24,27];\n this.char_table = [\n /*\n 4th line would normally be:\n '[', '\\\\', ']', '^', '_', ' ', '!', '\"', '#', '$', '%', '&', '\\\\', '(', ')', '*', '+', ',', '-','.', '/',\n but has been customized to eliminate most punctuation characters\n Last line would normally be:\n ':', ';', '<', '=', '>', '?'\n but has been customized to eliminate most punctuation characters\n */\n '@', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P',\n 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '-', '-', '-', '-', '_', ' ', '-', '-', '-', '-', '-', '-',\n '-', '(', ')', '-', '-', '-', '-', '.', '-', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '-', '-', '<',\n '-', '>', '-'\n ];\n this.posGroups = {\n 1: {'lat': {'start': 89, 'length': 27, 'divisor': 600000.0},\n 'lon': {'start': 61, 'length': 28, 'divisor': 600000.0}},\n 2: {'lat': {'start': 89, 'length': 27, 'divisor': 600000.0},\n 'lon': {'start': 61, 'length': 28, 'divisor': 600000.0}},\n 3: {'lat': {'start': 89, 'length': 27, 'divisor': 600000.0},\n 'lon': {'start': 61, 'length': 28, 'divisor': 600000.0}},\n 4: {'lat': {'start': 107, 'length': 27, 'divisor': 600000.0},\n 'lon': {'start': 79, 'length': 28, 'divisor': 600000.0}},\n 9: {'lat': {'start': 89, 'length': 27, 'divisor': 600000.0},\n 'lon': {'start': 61, 'length': 28, 'divisor': 600000.0}},\n 18: {'lat': {'start': 85, 'length': 27, 'divisor': 600000.0},\n 'lon': {'start': 57, 'length': 28, 'divisor': 600000.0}},\n 19: {'lat': {'start': 85, 'length': 27, 'divisor': 600000.0},\n 'lon': {'start': 57, 'length': 28, 'divisor': 600000.0}},\n 21: {'lat': {'start': 192, 'length': 27, 'divisor': 600000.0},\n 'lon': {'start': 164, 'length': 28, 'divisor': 600000.0}},\n 27: {'lat': {'start': 62, 'length': 17, 'divisor': 600.0},\n 'lon': {'start': 44, 'length': 18, 'divisor': 600.0}}\n };\n this.speedGroups = {\n 1: {'start': 50, 'length': 10, 'divisor': 10},\n 2: {'start': 50, 'length': 10, 'divisor': 10},\n 3: {'start': 50, 'length': 10, 'divisor': 10},\n 9: {'start': 50, 'length': 10, 'divisor': 1},\n 18: {'start': 46, 'length': 10, 'divisor': 10},\n 19: {'start': 46, 'length': 10, 'divisor': 10},\n 27: {'start': 79, 'length': 6, 'divisor': 1}\n };\n this.navStatusText = [\n 'Under way using engine',\n 'At anchor',\n 'Not under command',\n 'Restricted manoeuverability',\n 'Constrained by her draught',\n 'Moored',\n 'Aground',\n 'Engaged in Fishing',\n 'Under way sailing',\n 'Reserved for future amendment of Navigational Status for HSC',\n 'Reserved for future amendment of Navigational Status for WIG',\n 'Reserved for future use',\n 'Reserved for future use',\n 'Reserved for future use',\n 'AIS-SART is active',\n 'Not defined'\n ];\n this.maneuverText = [\n 'Not available',\n 'No special maneuver',\n 'Special maneuver (such as regional passing arrangement'\n ];\n this.epfdText = [\n 'Undefined',\n 'GPS',\n 'GLONASS',\n 'Combined GPS/GLONASS',\n 'Loran-C',\n 'Chayka',\n 'Integrated navigation system',\n 'Surveyed',\n 'Galileo'\n ];\n this.shiptypeText = [\n \"Not available\",\n \"Reserved for future use\",\n \"Reserved for future use\",\n \"Reserved for future use\",\n \"Reserved for future use\",\n \"Reserved for future use\",\n \"Reserved for future use\",\n \"Reserved for future use\",\n \"Reserved for future use\",\n \"Reserved for future use\",\n \"Reserved for future use\",\n \"Reserved for future use\",\n \"Reserved for future use\",\n \"Reserved for future use\",\n \"Reserved for future use\",\n \"Reserved for future use\",\n \"Reserved for future use\",\n \"Reserved for future use\",\n \"Reserved for future use\",\n \"Reserved for future use\",\n \"Wing in ground (WIG) - all ships of this type\",\n \"Wing in ground (WIG) - Hazardous category A\",\n \"Wing in ground (WIG) - Hazardous category B\",\n \"Wing in ground (WIG) - Hazardous category C\",\n \"Wing in ground (WIG) - Hazardous category D\",\n \"Wing in ground (WIG) - Reserved for future use\",\n \"Wing in ground (WIG) - Reserved for future use\",\n \"Wing in ground (WIG) - Reserved for future use\",\n \"Wing in ground (WIG) - Reserved for future use\",\n \"Wing in ground (WIG) - Reserved for future use\",\n \"Fishing\",\n \"Towing\",\n \"Towing: length exceeds 200m or breadth exceeds 25m\",\n \"Dredging or underwater ops\",\n \"Diving ops\",\n \"Military ops\",\n \"Sailing\",\n \"Pleasure Craft\",\n \"Reserved\",\n \"Reserved\",\n \"High speed craft (HSC) - all ships of this type\",\n \"High speed craft (HSC) - Hazardous category A\",\n \"High speed craft (HSC) - Hazardous category B\",\n \"High speed craft (HSC) - Hazardous category C\",\n \"High speed craft (HSC) - Hazardous category D\",\n \"High speed craft (HSC) - Reserved for future use\",\n \"High speed craft (HSC) - Reserved for future use\",\n \"High speed craft (HSC) - Reserved for future use\",\n \"High speed craft (HSC) - Reserved for future use\",\n \"High speed craft (HSC) - No additional information\",\n \"Pilot Vessel1\",\n \"Search and Rescue vessel\",\n \"Tug\",\n \"Port Tender\",\n \"Anti-pollution equipment\",\n \"Law Enforcement\",\n \"Spare - Local Vessel\",\n \"Spare - Local Vessel\",\n \"Medical Transport\",\n \"Ship according to RR Resolution No. 18\",\n \"Passenger - all ships of this type\",\n \"Passenger - Hazardous category A\",\n \"Passenger - Hazardous category B\",\n \"Passenger - Hazardous category C\",\n \"Passenger - Hazardous category D\",\n \"Passenger - Reserved for future use\",\n \"Passenger - Reserved for future use\",\n \"Passenger - Reserved for future use\",\n \"Passenger - Reserved for future use\",\n \"Passenger - No additional information\",\n \"Cargo - all ships of this type\",\n \"Cargo - Hazardous category A\",\n \"Cargo - Hazardous category B\",\n \"Cargo - Hazardous category C\",\n \"Cargo - Hazardous category D\",\n \"Cargo - Reserved for future use\",\n \"Cargo - Reserved for future use\",\n \"Cargo - Reserved for future use\",\n \"Cargo - Reserved for future use\",\n \"Cargo - No additional information\",\n \"Tanker - all ships of this type\",\n \"Tanker - Hazardous category A\",\n \"Tanker - Hazardous category B1\",\n \"Tanker - Hazardous category C1\",\n \"Tanker - Hazardous category D1\",\n \"Tanker - Reserved for future use\",\n \"Tanker - Reserved for future use\",\n \"Tanker - Reserved for future use\",\n \"Tanker - Reserved for future use\",\n \"Tanker - No additional information\",\n \"Other Type - all ships of this type\",\n \"Other Type - Hazardous category A\",\n \"Other Type - Hazardous category B\",\n \"Other Type - Hazardous category C\",\n \"Other Type - Hazardous category D\",\n \"Other Type - Reserved for future use\",\n \"Other Type - Reserved for future use\",\n \"Other Type - Reserved for future use\",\n \"Other Type - Reserved for future use\",\n \"Other Type - no additional information\"\n ];\n this.midTable = {\n 202: \"Andorra (Principality of)\",\n 203: \"Austria\",\n 204: \"Azores - Portugal\",\n 205: \"Belgium\",\n 206: \"Belarus (Republic of)\",\n 207: \"Bulgaria (Republic of)\",\n 208: \"Vatican City State\",\n 209: \"Cyprus (Republic of)\",\n 210: \"Cyprus (Republic of)\",\n 211: \"Germany (Federal Republic of)\",\n 212: \"Cyprus (Republic of)\",\n 213: \"Georgia\",\n 214: \"Moldova (Republic of)\",\n 215: \"Malta\",\n 216: \"Armenia (Republic of)\",\n 218: \"Germany (Federal Republic of)\",\n 219: \"Denmark\",\n 220: \"Denmark\",\n 224: \"Spain\",\n 225: \"Spain\",\n 226: \"France\",\n 227: \"France\",\n 228: \"France\",\n 229: \"Malta\",\n 230: \"Finland\",\n 231: \"Faroe Islands - Denmark\",\n 232: \"United Kingdom of Great Britain and Northern Ireland\",\n 233: \"United Kingdom of Great Britain and Northern Ireland\",\n 234: \"United Kingdom of Great Britain and Northern Ireland\",\n 235: \"United Kingdom of Great Britain and Northern Ireland\",\n 236: \"Gibraltar - United Kingdom of Great Britain and Northern Ireland\",\n 237: \"Greece\",\n 238: \"Croatia (Republic of)\",\n 239: \"Greece\",\n 240: \"Greece\",\n 241: \"Greece\",\n 242: \"Morocco (Kingdom of)\",\n 243: \"Hungary\",\n 244: \"Netherlands (Kingdom of the)\",\n 245: \"Netherlands (Kingdom of the)\",\n 246: \"Netherlands (Kingdom of the)\",\n 247: \"Italy\",\n 248: \"Malta\",\n 249: \"Malta\",\n 250: \"Ireland\",\n 251: \"Iceland\",\n 252: \"Liechtenstein (Principality of)\",\n 253: \"Luxembourg\",\n 254: \"Monaco (Principality of)\",\n 255: \"Madeira - Portugal\",\n 256: \"Malta\",\n 257: \"Norway\",\n 258: \"Norway\",\n 259: \"Norway\",\n 261: \"Poland (Republic of)\",\n 262: \"Montenegro\",\n 263: \"Portugal\",\n 264: \"Romania\",\n 265: \"Sweden\",\n 266: \"Sweden\",\n 267: \"Slovak Republic\",\n 268: \"San Marino (Republic of)\",\n 269: \"Switzerland (Confederation of)\",\n 270: \"Czech Republic\",\n 271: \"Turkey\",\n 272: \"Ukraine\",\n 273: \"Russian Federation\",\n 274: \"The Former Yugoslav Republic of Macedonia\",\n 275: \"Latvia (Republic of)\",\n 276: \"Estonia (Republic of)\",\n 277: \"Lithuania (Republic of)\",\n 278: \"Slovenia (Republic of)\",\n 279: \"Serbia (Republic of)\",\n 301: \"Anguilla - United Kingdom of Great Britain and Northern Ireland\",\n 303: \"Alaska (State of) - United States of America\",\n 304: \"Antigua and Barbuda\",\n 305: \"Antigua and Barbuda\",\n 306: \"Dutch West Indies\",\n //306: \"Curaçao - Netherlands (Kingdom of the)\",\n //306: \"Sint Maarten (Dutch part) - Netherlands (Kingdom of the)\",\n //306: \"Bonaire, Sint Eustatius and Saba - Netherlands (Kingdom of the)\",\n 307: \"Aruba - Netherlands (Kingdom of the)\",\n 308: \"Bahamas (Commonwealth of the)\",\n 309: \"Bahamas (Commonwealth of the)\",\n 310: \"Bermuda - United Kingdom of Great Britain and Northern Ireland\",\n 311: \"Bahamas (Commonwealth of the)\",\n 312: \"Belize\",\n 314: \"Barbados\",\n 316: \"Canada\",\n 319: \"Cayman Islands - United Kingdom of Great Britain and Northern Ireland\",\n 321: \"Costa Rica\",\n 323: \"Cuba\",\n 325: \"Dominica (Commonwealth of)\",\n 327: \"Dominican Republic\",\n 329: \"Guadeloupe (French Department of) - France\",\n 330: \"Grenada\",\n 331: \"Greenland - Denmark\",\n 332: \"Guatemala (Republic of)\",\n 334: \"Honduras (Republic of)\",\n 336: \"Haiti (Republic of)\",\n 338: \"United States of America\",\n 339: \"Jamaica\",\n 341: \"Saint Kitts and Nevis (Federation of)\",\n 343: \"Saint Lucia\",\n 345: \"Mexico\",\n 347: \"Martinique (French Department of) - France\",\n 348: \"Montserrat - United Kingdom of Great Britain and Northern Ireland\",\n 350: \"Nicaragua\",\n 351: \"Panama (Republic of)\",\n 352: \"Panama (Republic of)\",\n 353: \"Panama (Republic of)\",\n 354: \"Panama (Republic of)\",\n 355: \"unassigned\",\n 356: \"unassigned\",\n 357: \"unassigned\",\n 358: \"Puerto Rico - United States of America\",\n 359: \"El Salvador (Republic of)\",\n 361: \"Saint Pierre and Miquelon (Territorial Collectivity of) - France\",\n 362: \"Trinidad and Tobago\",\n 364: \"Turks and Caicos Islands - United Kingdom of Great Britain and Northern Ireland\",\n 366: \"United States of America\",\n 367: \"United States of America\",\n 368: \"United States of America\",\n 369: \"United States of America\",\n 370: \"Panama (Republic of)\",\n 371: \"Panama (Republic of)\",\n 372: \"Panama (Republic of)\",\n 373: \"Panama (Republic of)\",\n 375: \"Saint Vincent and the Grenadines\",\n 376: \"Saint Vincent and the Grenadines\",\n 377: \"Saint Vincent and the Grenadines\",\n 378: \"British Virgin Islands - United Kingdom of Great Britain and Northern Ireland\",\n 379: \"United States Virgin Islands - United States of America\",\n 401: \"Afghanistan\",\n 403: \"Saudi Arabia (Kingdom of)\",\n 405: \"Bangladesh (People's Republic of)\",\n 408: \"Bahrain (Kingdom of)\",\n 410: \"Bhutan (Kingdom of)\",\n 412: \"China (People's Republic of)\",\n 413: \"China (People's Republic of)\",\n 414: \"China (People's Republic of)\",\n 416: \"Taiwan (Province of China) - China (People's Republic of)\",\n 417: \"Sri Lanka (Democratic Socialist Republic of)\",\n 419: \"India (Republic of)\",\n 422: \"Iran (Islamic Republic of)\",\n 423: \"Azerbaijan (Republic of)\",\n 425: \"Iraq (Republic of)\",\n 428: \"Israel (State of)\",\n 431: \"Japan\",\n 432: \"Japan\",\n 434: \"Turkmenistan\",\n 436: \"Kazakhstan (Republic of)\",\n 437: \"Uzbekistan (Republic of)\",\n 438: \"Jordan (Hashemite Kingdom of)\",\n 440: \"Korea (Republic of)\",\n 441: \"Korea (Republic of)\",\n 443: \"State of Palestine (In accordance with Resolution 99 Rev. Guadalajara, 2010)\",\n 445: \"Democratic People's Republic of Korea\",\n 447: \"Kuwait (State of)\",\n 450: \"Lebanon\",\n 451: \"Kyrgyz Republic\",\n 453: \"Macao (Special Administrative Region of China) - China (People's Republic of)\",\n 455: \"Maldives (Republic of)\",\n 457: \"Mongolia\",\n 459: \"Nepal (Federal Democratic Republic of)\",\n 461: \"Oman (Sultanate of)\",\n 463: \"Pakistan (Islamic Republic of)\",\n 466: \"Qatar (State of)\",\n 468: \"Syrian Arab Republic\",\n 470: \"United Arab Emirates\",\n 472: \"Tajikistan (Republic of)\",\n 473: \"Yemen (Republic of)\",\n 475: \"Yemen (Republic of)\",\n 477: \"Hong Kong (Special Administrative Region of China) - China (People's Republic of)\",\n 478: \"Bosnia and Herzegovina\",\n 501: \"Adelie Land - France\",\n 503: \"Australia\",\n 506: \"Myanmar (Union of)\",\n 508: \"Brunei Darussalam\",\n 510: \"Micronesia (Federated States of)\",\n 511: \"Palau (Republic of)\",\n 512: \"New Zealand\",\n 514: \"Cambodia (Kingdom of)\",\n 515: \"Cambodia (Kingdom of)\",\n 516: \"Christmas Island (Indian Ocean) - Australia\",\n 518: \"Cook Islands - New Zealand\",\n 520: \"Fiji (Republic of)\",\n 523: \"Cocos (Keeling) Islands - Australia\",\n 525: \"Indonesia (Republic of)\",\n 529: \"Kiribati (Republic of)\",\n 531: \"Lao People's Democratic Republic\",\n 533: \"Malaysia\",\n 536: \"Northern Mariana Islands (Commonwealth of the) - United States of America\",\n 538: \"Marshall Islands (Republic of the)\",\n 540: \"New Caledonia - France\",\n 542: \"Niue - New Zealand\",\n 544: \"Nauru (Republic of)\",\n 546: \"French Polynesia - France\",\n 548: \"Philippines (Republic of the)\",\n 553: \"Papua New Guinea\",\n 555: \"Pitcairn Island - United Kingdom of Great Britain and Northern Ireland\",\n 557: \"Solomon Islands\",\n 559: \"American Samoa - United States of America\",\n 561: \"Samoa (Independent State of)\",\n 563: \"Singapore (Republic of)\",\n 564: \"Singapore (Republic of)\",\n 565: \"Singapore (Republic of)\",\n 566: \"Singapore (Republic of)\",\n 567: \"Thailand\",\n 570: \"Tonga (Kingdom of)\",\n 572: \"Tuvalu\",\n 574: \"Viet Nam (Socialist Republic of)\",\n 576: \"Vanuatu (Republic of)\",\n 577: \"Vanuatu (Republic of)\",\n 578: \"Wallis and Futuna Islands - France\",\n 601: \"South Africa (Republic of)\",\n 603: \"Angola (Republic of)\",\n 605: \"Algeria (People's Democratic Republic of)\",\n 607: \"Saint Paul and Amsterdam Islands - France\",\n 608: \"Ascension Island - United Kingdom of Great Britain and Northern Ireland\",\n 609: \"Burundi (Republic of)\",\n 610: \"Benin (Republic of)\",\n 611: \"Botswana (Republic of)\",\n 612: \"Central African Republic\",\n 613: \"Cameroon (Republic of)\",\n 615: \"Congo (Republic of the)\",\n 616: \"Comoros (Union of the)\",\n 617: \"Cabo Verde (Republic of)\",\n 618: \"Crozet Archipelago - France\",\n 619: \"Côte d'Ivoire (Republic of)\",\n 620: \"Comoros (Union of the)\",\n 621: \"Djibouti (Republic of)\",\n 622: \"Egypt (Arab Republic of)\",\n 624: \"Ethiopia (Federal Democratic Republic of)\",\n 625: \"Eritrea\",\n 626: \"Gabonese Republic\",\n 627: \"Ghana\",\n 629: \"Gambia (Republic of the)\",\n 630: \"Guinea-Bissau (Republic of)\",\n 631: \"Equatorial Guinea (Republic of)\",\n 632: \"Guinea (Republic of)\",\n 633: \"Burkina Faso\",\n 634: \"Kenya (Republic of)\",\n 635: \"Kerguelen Islands - France\",\n 636: \"Liberia (Republic of)\",\n 637: \"Liberia (Republic of)\",\n 638: \"South Sudan (Republic of)\",\n 642: \"Libya\",\n // old email: nicholassmith@gmail.com\n 644: \"Lesotho (Kingdom of)\",\n 645: \"Mauritius (Republic of)\",\n 647: \"Madagascar (Republic of)\",\n 649: \"Mali (Republic of)\",\n 650: \"Mozambique (Republic of)\",\n 654: \"Mauritania (Islamic Republic of)\",\n 655: \"Malawi\",\n 656: \"Niger (Republic of the)\",\n 657: \"Nigeria (Federal Republic of)\",\n 659: \"Namibia (Republic of)\",\n 660: \"Reunion (French Department of) - France\",\n 661: \"Rwanda (Republic of)\",\n 662: \"Sudan (Republic of the)\",\n 663: \"Senegal (Republic of)\",\n 664: \"Seychelles (Republic of)\",\n 665: \"Saint Helena - United Kingdom of Great Britain and Northern Ireland\",\n 666: \"Somalia (Federal Republic of)\",\n 667: \"Sierra Leone\",\n 668: \"Sao Tome and Principe (Democratic Republic of)\",\n 669: \"Swaziland (Kingdom of)\",\n 670: \"Chad (Republic of)\",\n 671: \"Togolese Republic\",\n 672: \"Tunisia\",\n 674: \"Tanzania (United Republic of)\",\n 675: \"Uganda (Republic of)\",\n 676: \"Democratic Republic of the Congo\",\n 677: \"Tanzania (United Republic of)\",\n 678: \"Zambia (Republic of)\",\n 679: \"Zimbabwe (Republic of)\",\n 701: \"Argentine Republic\",\n 710: \"Brazil (Federative Republic of)\",\n 720: \"Bolivia (Plurinational State of)\",\n 725: \"Chile\",\n 730: \"Colombia (Republic of)\",\n 735: \"Ecuador\",\n 740: \"Falkland Islands (Malvinas) - United Kingdom of Great Britain and Northern Ireland\",\n 745: \"Guiana (French Department of) - France\",\n 750: \"Guyana\",\n 755: \"Paraguay (Republic of)\",\n 760: \"Peru\",\n 765: \"Suriname (Republic of)\",\n 770: \"Uruguay (Eastern Republic of)\",\n 775: \"Venezuela (Bolivarian Republic of)\"\n};\n this.functionMap = {\n \"accuracy\": \"getAccuracy\",\n \"aid_type\": \"getAidType\",\n \"alt\": \"getAlt\",\n \"assigned\": \"getAssigned\",\n \"callsign\": \"getCallsign\",\n \"course\": \"getCourse\",\n \"day\": \"getDay\",\n \"destination\": \"getDestination\",\n \"dimensions\": \"getDimensions\",\n \"draught\": \"getDraught\",\n \"dte\": \"getDte\",\n \"epfd\": \"getEpfd\",\n \"fragmentNum\": \"getFragmentNum\",\n \"heading\": \"getHeading\",\n \"hour\": \"getHour\",\n \"imo\": \"getIMO\",\n \"latLon\": \"getLatLon\",\n \"maneuver\": \"getManeuver\",\n \"mid\": \"getMid\",\n \"mmsi\": \"getMMSI\",\n \"minute\": \"getMinute\",\n \"month\": \"getMonth\",\n \"name\": \"getName\",\n \"nameExtension\": \"getNameExtension\",\n \"numFragments\": \"getNumFragments\",\n \"off_position\": \"getOffPosition\",\n \"part\": \"getPartno\",\n \"radio\": \"getRadio\",\n \"raim\": \"getRaim\",\n \"second\": \"getSecond\",\n \"seqMsgId\": \"getSeqMsgId\",\n \"shiptype\": \"getShiptype\",\n \"speed\": \"getSpeed\",\n \"status\": \"getStatus\",\n \"turn\": \"getTurn\",\n \"type\": \"getType\",\n \"vendorInfo\": \"getVendorInfo\",\n \"virtual_aid\": \"getVirtualAid\",\n \"year\": \"getYear\"\n };\n /**\n * Type 6 and 8 (Binary addressed message and Binary broadcast message) contain lat/lon in some of their subtypes.\n * These messages are evidently only used in the St Lawrence seaway, the USG PAWSS system and the Port Authority of\n * london and aren't implemented in this code\n *\n * Type 17 is the Differential correction message type and is not implemented in this code\n * Type 22 is a channel management message and is not implemented in this code\n * Type 23 is a Group assignment message and is not implemented in this code\n */\n};\n\n/** Loads required attributes from AIVDM message for retrieval by other methods\n [0]=!AIVDM, [1]=Number of fragments, [2]=Fragment num, [3]=Seq msg ID, [4]=channel, [5]=payload,\n Fetch the AIVDM part of the line, from !AIVDM to the end of the line\n Split the line into fragments, delimited by commas\n fetch numFragments, fragmentNum and SeqMsgId (SeqMsgId may be empty)\n convert to a binary 6 bit string\n\n : param (string) line. The received message within which we hope an AIVDM statement exists\n :returns True if message is a single packet msg (1,2,3,9,18,27 etc) or part 1 of a multi_part message\n False if !AIVDM not in the line or exception during decode process\n*/\n\naivdmDecode.prototype = {\n /**\n * getData(aivdm)\n * Decodes message, then returns an object containing extracted data\n * If the message is received in two parts (i.e. type 5 and 19) then\n * the return for the first of the messages is null. When the second part has been received then it\n * is combined with the first and decoded.\n * Whether a single or two part message, the return will contain the original message(s) in an array called 'aivdm'\n */\n getData: function (line) {\n var lineData = {\n numFragments: this.numFragments,\n fragmentNum: this.fragmentNum,\n type: this.getType(),\n mmsi: this.getMMSI(),\n mid: this.getMid(),\n seqMsgId: this.getSeqMsgId(),\n aivdm: this.splitLines\n };\n\n return this.msgTypeSwitcher(line, lineData);\n },\n\n /**\n * msgTypeSwitcher\n * Used only by getData\n * Fills fields relevant to the message type\n * @param line The !AIVD string\n * @param lineData The partially filled lineData object\n * @returns {*} lineData object or false (if lineData is not filled\n */\n msgTypeSwitcher: function (line, lineData) {\n switch (this.getType()) {\n // Implemented message types\n case 1:\n case 2:\n case 3:\n lineData = this.fill_1_2_3(line, lineData);\n break;\n case 4:\n lineData = this.fill_4(line, lineData);\n break;\n case 5:\n lineData = this.fill_5(line, lineData);\n break;\n case 9:\n lineData = this.fill_9(line, lineData);\n break;\n case 18:\n lineData = this.fill_18(line, lineData);\n break;\n case 19:\n lineData = this.fill_19(line, lineData);\n break;\n case 21:\n lineData = this.fill_21(line, lineData);\n break;\n case 24:\n lineData.partno = this.getPartno();\n if (lineData.partno === 'A') {\n lineData = this.fill_24_0(line, lineData);\n } else if (lineData.partno === 'B') {\n lineData = this.fill_24_1(line, lineData);\n }\n break;\n case 27:\n lineData = this.fill_27(line, lineData);\n break;\n\n // unimplemented message types\n case 6:\n case 7:\n case 8:\n case 10:\n case 11:\n case 12:\n case 13:\n case 14:\n case 15:\n case 16:\n case 17:\n case 20:\n case 22:\n case 23:\n case 25:\n case 26:\n if (module.parent && module.parent.exports.isDebug) {\n //if (swu.hasProp(module, 'parent.exports.isDebug')) {\n console.log('Message type (switch) %d', parseInt(this.binString.substr(0, 6), 2));\n console.log(line);\n console.log('-------------------------------------------------------');\n }\n lineData = false;\n break;\n default:\n if (module.parent && module.parent.exports.isDebug) {\n //if (swu.hasProp(module, 'prent.exports.isDebug')) {\n console.log('Message type ????? %d ?????', parseInt(this.binString.substr(0, 6), 2));\n }\n lineData = false;\n }\n\n if (lineData) {\n if (this.returnJson) {\n return JSON.stringify(lineData);\n } else {\n return lineData;\n }\n } else {\n return false;\n }\n },\n fill_1_2_3: function (line, lineData) {\n var latLon = this.getLatLon();\n var status = this.getStatus();\n var maneuver = this.getManeuver();\n\n if (this.aivdmPassthrough) { lineData.aivdm = [line]; }\n lineData.status = status.status_num;\n lineData.status_text = status.status_text;\n lineData.turn = this.getTurn();\n lineData.speed = this.getSpeed();\n lineData.accuracy = this.getAccuracy();\n lineData.lon = latLon.lon;\n lineData.lat = latLon.lat;\n lineData.course = this.getCourse();\n lineData.heading = this.getHeading();\n lineData.second = this.getSecond();\n lineData.maneuver = maneuver.maneuver;\n lineData.maneuver_text = maneuver.maneuver_text;\n lineData.raim = this.getRaim();\n lineData.radio = this.getRadio();\n\n return lineData;\n },\n fill_4: function (line, lineData) {\n var latLon = this.getLatLon();\n var epfd = this.getEpfd();\n\n if (this.aivdmPassthrough) { lineData.aivdm = [line]; }\n lineData.year = this.getYear();\n lineData.month = this.getMonth();\n lineData.day = this.getDay();\n lineData.hour = this.getHour();\n lineData.minute = this.getMinute();\n lineData.second = this.getSecond();\n lineData.accuracy = this.getAccuracy();\n lineData.lon = latLon.lon;\n lineData.lat = latLon.lat;\n lineData.epfd = epfd.epfd;\n lineData.epfd_text = epfd.epfd_text;\n lineData.raim = this.getRaim();\n lineData.radio = this.getRadio();\n\n return lineData;\n },\n fill_5: function (line, lineData) {\n var dimensions = this.getDimensions();\n var epfd = this.getEpfd();\n var shiptype = this.getShiptype();\n var eta = sprintf(\n '%s-%sT%s:%sZ',\n this.getMonth().lpad('0', 2),\n this.getDay().lpad('0', 2),\n this.getHour().lpad('0', 2),\n this.getMinute().lpad('0', 2)\n );\n\n //if (this.aivdmPassthrough) { lineData.aivdm = this.splitLines; }\n //if (this.aivdmPassthrough) { lineData.aivdm = this.splitParts; }\n lineData.imo = this.getIMO();\n lineData.callsign = this.getCallsign();\n lineData.shipname = this.getName();\n lineData.shiptype = shiptype.shiptype;\n lineData.shiptype_text = shiptype.shiptype_text;\n lineData.to_bow = dimensions.to_bow;\n lineData.to_stern = dimensions.to_stern;\n lineData.to_port = dimensions.to_port;\n lineData.to_starboard = dimensions.to_starboard;\n lineData.epfd = epfd.epfd;\n lineData.eta = eta;\n lineData.epfd_text = epfd.epfd.text;\n lineData.month = this.getMonth();\n lineData.day = this.getDay();\n lineData.hour = this.getHour();\n lineData.minute = this.getMinute();\n lineData.draught = this.getDraught();\n lineData.destination = this.getDestination();\n lineData.dte = this.getDte();\n\n return lineData;\n },\n fill_9: function (line, lineData) {\n var latLon = this.getLatLon();\n\n if (this.aivdmPassthrough) { lineData.aivdm = [line]; }\n lineData.alt = this.getAlt();\n lineData.speed = this.getSpeed();\n lineData.accuracy = this.getAccuracy();\n lineData.lon = latLon.lon;\n lineData.lat = latLon.lat;\n lineData.course = this.getCourse();\n lineData.second = this.getSecond();\n lineData.assigned = this.getAssigned();\n lineData.raim = this.getRaim();\n lineData.radio = this.getRadio();\n\n return lineData;\n },\n fill_18: function (line, lineData) {\n var latLon = this.getLatLon();\n\n if (this.aivdmPassthrough) { lineData.aivdm = [line]; }\n lineData.speed = this.getSpeed();\n lineData.accuracy = this.getAccuracy();\n lineData.lon = latLon.lon;\n lineData.lat = latLon.lat;\n lineData.course = this.getCourse();\n lineData.heading = this.getHeading();\n lineData.second = this.getSecond();\n lineData.raim = this.getRaim();\n lineData.radio = this.getRadio();\n\n return lineData;\n },\n fill_19: function (line, lineData) {\n var latLon = this.getLatLon();\n var dimensions = this.getDimensions();\n var epfd = this.getEpfd();\n var shiptype = this.getShiptype();\n\n if (this.aivdmPassthrough) { lineData.aivdm = [line]; }\n lineData.speed = this.getSpeed();\n lineData.accuracy = this.getAccuracy();\n lineData.lon = latLon.lon;\n lineData.lat = latLon.lat;\n lineData.course = this.getCourse();\n lineData.heading = this.getHeading();\n lineData.second = this.getSecond();\n lineData.shipname = this.getName();\n lineData.shiptype = shiptype.shiptype;\n lineData.shiptype_text = shiptype.shiptype_text;\n lineData.to_bow = dimensions.to_bow;\n lineData.to_stern = dimensions.to_stern;\n lineData.to_port = dimensions.to_port;\n lineData.to_starboard = dimensions.to_starboard;\n lineData.epfd = epfd.epfd;\n lineData.epfd_text = epfd.epfd_text;\n lineData.raim = this.getRaim();\n\n return lineData;\n },\n fill_21: function (line, lineData) {\n var latLon = this.getLatLon();\n var dimensions = this.getDimensions();\n var epfd = this.getEpfd();\n\n if (this.aivdmPassthrough) { lineData.aivdm = [line]; }\n lineData.aid_type = this.getAidType();\n lineData.name = this.getName();\n lineData.accuracy = this.getAccuracy();\n lineData.lon = latLon.lon;\n lineData.lat = latLon.lat;\n lineData.to_bow = dimensions.to_bow;\n lineData.to_stern = dimensions.to_stern;\n lineData.to_port = dimensions.to_port;\n lineData.to_starboard = dimensions.to_starboard;\n lineData.epfd = epfd.epfd;\n lineData.epfd_text = epfd.epfd_text;\n lineData.second = this.getSecond();\n lineData.off_position = this.getOffPosition();\n lineData.raim = this.getRaim();\n lineData.virtual_aid = this.getVirtualAid();\n lineData.assigned = this.getAssigned();\n lineData.name += this.getNameExtension();\n\n return lineData;\n },\n fill_24_0: function (line, lineData) {\n if (this.aivdmPassthrough) { lineData.aivdm = [line]; }\n lineData.part = this.getPartno();\n lineData.shipname = this.getName();\n\n return lineData;\n },\n fill_24_1: function (line, lineData) {\n var dimensions;\n var vendorInfo = this.getVendorInfo();\n var shiptype = this.getShiptype();\n\n if (this.aivdmPassthrough) { lineData.aivdm = [line]; }\n lineData.part = this.getPartno();\n lineData.shiptype = shiptype.shiptype;\n lineData.shiptype_text = shiptype.shiptype_text;\n lineData.callsign = this.getCallsign();\n\n if (lineData.mmsi.toString().substr(0, 2) === '98') { // Then this is an auxiliary craft (see AIVDM Docs)\n lineData.mothership_mmsi = this.getBits(132, 30);\n dimensions = {to_bow: null, to_stern: null, to_port: null, to_starboard: null};\n } else {\n lineData.mothership_mmsi = null;\n dimensions = this.getDimensions();\n }\n\n lineData.vendorid = vendorInfo.vendorString;\n lineData.model = vendorInfo.model;\n lineData.serial = vendorInfo.serial;\n lineData.to_bow = dimensions.to_bow;\n lineData.to_stern = dimensions.to_stern;\n lineData.to_port = dimensions.to_port;\n lineData.to_starboard = dimensions.to_starboard;\n\n return lineData;\n },\n fill_27: function (line, lineData) {\n var latLon = this.getLatLon();\n var status = this.getStatus();\n\n if (this.aivdmPassthrough) { lineData.aivdm = [line]; }\n lineData.accuracy = this.getAccuracy();\n lineData.raim = this.getRaim();\n lineData.status = status.status_num;\n lineData.status_text = status.status_text;\n lineData.lon = latLon.lon;\n lineData.lat = latLon.lat;\n lineData.speed = this.getSpeed();\n lineData.course = this.getCourse();\n\n return lineData;\n },\n // -------------------------------\n\n /**\n * getAccuracy()\n * @returns {boolean} false if 0, else true - to synchronise with how gpsd handles it\n */\n getAccuracy: function () {\n switch (this.msgType) {\n case 1:\n case 2:\n case 3:\n case 9:\n return this.getBits(60, 1) !== 0;\n case 18:\n case 19:\n return this.getBits(56, 1) !== 0;\n case 21:\n return this.getBits(163, 1) !== 0;\n case 27:\n return this.getBits(38, 1) !== 0;\n default:\n return false;\n }\n },\n getAidType: function () {\n return this.getBits(38,5);\n },\n getAlt: function () {\n return this.getBits(38, 12);\n },\n getAssigned: function () {\n switch (this.msgType) {\n case 9:\n return this.getBits(146, 1);\n case 21:\n return this.getBits(270, 1);\n default:\n return false;\n }\n },\n getCallsign: function () {\n var callsignField;\n\n switch (this.msgType) {\n case 5:\n callsignField = this.binString.substr(70, 42);\n break;\n case 24:\n if (this.partNo == 1) {\n callsignField = this.binString.substr(90, 42);\n } else {\n callsignField = null;\n }\n break;\n default:\n callsignField = null\n }\n\n if (callsignField) {\n var callsignArray = callsignField.match(/.{1,6}/g);\n var callsign = '';\n var self = this;\n _.each(callsignArray, function (binChar, index) {\n callsign += self.char_table[parseInt(binChar, 2)];\n });\n return callsign.replace(/@/g, '').trim();\n } else {\n return false;\n }\n },\n getCourse: function () {\n switch (this.msgType) {\n case 1:\n case 2:\n case 3:\n case 9:\n return this.getBits(116, 12) / 10;\n break;\n case 18:\n case 19:\n return this.getBits(112, 12) / 10;\n break;\n case 27:\n return this.getBits(85, 9);\n break;\n default:\n return false;\n }\n },\n getDay: function () {\n switch (this.msgType) {\n case 4:\n return this.getBits(56, 5);\n case 5:\n return this.getBits(278, 5);\n default:\n return false;\n }\n },\n getDestination: function () {\n var destField = null;\n\n switch (this.msgType) {\n case 5:\n destField = this.binString.substr(302, 120);\n break;\n default:\n destField = null\n }\n if (destField) {\n var destArray = destField.match(/.{1,6}/g);\n var destination = '';\n var self = this;\n _.each(destArray, function (binChar, index) {\n destination += self.char_table[parseInt(binChar, 2)];\n });\n return destination.replace(/@/g, '').trim();\n } else {\n return false;\n }\n },\n getDimensions: function () {\n\n var dimensions = {to_bow: null, to_stern: null, to_port: null, to_starboard: null};\n\n switch (this.msgType) {\n case 5:\n dimensions.to_bow = this.getBits(240, 9);\n dimensions.to_stern = this.getBits(249, 9);\n dimensions.to_port = this.getBits(258, 6);\n dimensions.to_starboard = this.getBits(264, 6);\n break;\n case 19:\n dimensions.to_bow = this.getBits(271, 9);\n dimensions.to_stern = this.getBits(280, 9);\n dimensions.to_port = this.getBits(289, 6);\n dimensions.to_starboard = this.getBits(295, 6);\n break;\n case 21:\n dimensions.to_bow = this.getBits(219, 9);\n dimensions.to_stern = this.getBits(228, 9);\n dimensions.to_port = this.getBits(237, 6);\n dimensions.to_starboard = this.getBits(243, 6);\n break;\n\n case 24:\n dimensions.to_bow = this.getBits(132, 9);\n dimensions.to_stern = this.getBits(141, 9);\n dimensions.to_port = this.getBits(150, 6);\n dimensions.to_starboard = this.getBits(156, 6);\n break;\n }\n return dimensions;\n },\n getDraught: function () {\n switch (this.msgType) {\n case 5:\n return this.getBits(294, 8) / 10;\n default:\n return 0;\n }\n },\n getDte: function () {\n switch (this.msgType) {\n case 5:\n return this.getBits(423, 1);\n default:\n return 0;\n }\n },\n getETA: function () {\n\n },\n getEpfd: function () {\n var epfd;\n switch (this.msgType) {\n case 4:\n epfd = this.getBits(134, 4);\n break;\n case 5:\n epfd = this.getBits(270, 4);\n break;\n case 19:\n epfd = this.getBits(310, 4);\n break;\n case 21:\n epfd = this.getBits(249, 4);\n break;\n default:\n epfd = 0;\n }\n if (epfd < 0 || epfd > 8) { epfd = 0; }\n return {epfd: epfd, epfd_text: this.epfdText[epfd]}\n },\n getFragmentNum: function getFragmentNum () {\n return this.fragmentNum;\n },\n getHeading: function () {\n switch (this.msgType) {\n case 1:\n case 2:\n case 3:\n return this.getBits(128, 9);\n case 18:\n case 19:\n return this.getBits(124, 9);\n default:\n return false;\n }\n },\n getHour: function () {\n switch (this.msgType) {\n case 4:\n return this.getBits(61, 5);\n case 5:\n return this.getBits(283, 5);\n default:\n return false;\n }\n },\n getIMO: function () {\n switch (this.msgType) {\n case 5:\n return this.getBits(40, 30);\n default:\n return false;\n }\n },\n getLatLon: function () {\n // Does this message contain position info?\n var msgType = this.getType();\n if (msgType in this.posGroups) {\n var latGroup = this.posGroups[msgType]['lat'];\n var lonGroup = this.posGroups[msgType]['lon'];\n // fetch the relevant bits\n var latString = this.binString.substr(latGroup['start'], latGroup['length']);\n var lonString = this.binString.substr(lonGroup['start'], lonGroup['length']);\n // convert them\n var lat = this.toTwosComplement(parseInt(latString, 2), latString.length) / latGroup['divisor'];\n var lon = this.toTwosComplement(parseInt(lonString, 2), lonString.length) / lonGroup['divisor'];\n\n return {\"lat\": parseFloat(lat.toFixed(4)), \"lon\": parseFloat(lon.toFixed(4))};\n\n } else { // Not a message type that contains a position\n return {'lat': null, 'lon': null};\n }\n },\n getManeuver: function () {\n var man, maneuver_text;\n switch (this.msgType) {\n case 1:\n case 2:\n case 3:\n man = this.getBits(143, 2);\n break;\n default:\n man = 0;\n }\n\n if (man < 1 || man > 2) { man = 0; }\n maneuver_text = this.maneuverText[man];\n return {maneuver: man, maneuver_text: maneuver_text};\n },\n /**\n * getMid() Fetched 3 digit MID number that is embedded in MMSI\n * The mid usually occupies chars 0,1 and 2 of the MMSI string\n * For some special cases it may be at another location (see below).\n * Uses this.midTable to look up nationality.\n * Returns \"\" unless the option 'includeMID' is set true in the aivdmDecode constructor options\n * @returns {string} mid - a string containing 3 numeric digits.\n */\n getMid: function () {\n // See info in http://catb.org/gpsd/AIVDM.html\n if (this.includeMID) {\n var mid;\n var mmsi = this.getMMSI();\n var nationality;\n if (mmsi !== null && mmsi.length === 9) {\n // Coastal station\n if (mmsi.substr(0, 2) == \"00\") {\n mid = mmsi.substr(2, 3);\n }\n // Group of ships (i.e. coast guard is 0369\n else if (mmsi.substr(0, 1) === \"0\") {\n mid = mmsi.substr(1, 3);\n }\n // SAR Aircraft\n else if (mmsi.substr(0, 3) === \"111\") {\n mid = mmsi.substr(3, 3);\n }\n // Aus craft associated with a parent ship\n else if (mmsi.substr(0, 2) === \"98\" || mmsi.substr(0, 2) === \"99\") {\n mid = mmsi.substr(2, 3);\n }\n // AIS SART\n else if (mmsi.substr(0, 3) === \"970\") {\n mid = mmsi.substr(3, 3);\n }\n // MOB device (972) or EPIRB (974). Neither of these have a MID\n else if (mmsi.substr(0, 3) === \"972\" || mmsi.substr(0, 3) === \"974\") {\n mid = \"\";\n }\n // Normal ship transponder\n else {\n mid = mmsi.substr(0, 3);\n }\n\n if (mid !== \"\") {\n nationality = this.midTable[mid];\n if (nationality !== undefined) {\n if (typeof(nationality) !== 'string') {\n nationality = \"\";\n }\n } else {\n nationality = \"\";\n }\n } else {\n nationality = \"\";\n }\n } else {\n nationality = \"\";\n }\n } else {\n nationality = \"\";\n }\n return nationality;\n },\n getMMSI: function (/* onlyValidMid */) {\n //TODO: onlyValidMid to be implemented later\n return this.getBits(8, 30);\n },\n getMinute: function () {\n switch (this.msgType) {\n case 4:\n return this.getBits(66, 6);\n case 5:\n return this.getBits(288, 6);\n default:\n return false;\n }\n },\n getMonth: function () {\n switch (this.msgType) {\n case 4:\n return this.getBits(53, 4);\n case 5:\n return this.getBits(274, 4);\n default:\n return false;\n }\n },\n getName: function () {\n var msgType = this.getType();\n var nameField = null;\n\n switch (msgType) {\n case 5:\n nameField = this.binString.substr(112, 120);\n break;\n case 19:\n nameField = this.binString.substr(143, 120);\n break;\n case 21:\n nameField = this.binString.substr(43, 120);\n break;\n case 24:\n nameField = this.binString.substr(40, 120);\n break;\n var id = `78a2ecc1-e38a-451e-af0e-849957686e8e`;\n default:\n nameField = null\n }\n\n if (nameField) {\n var nameArray = nameField.match(/.{1,6}/g);\n var name = '';\n var self = this;\n _.each(nameArray, function (binChar, index) {\n name += self.char_table[parseInt(binChar, 2)];\n });\n return name.replace(/@/g, '').trim();\n } else {\n return false;\n }\n },\n getNameExtension: function () {\n switch (this.msgType) {\n case 21:\n if (this.binString.length >= 272) {\n var nameBits = this.binString.substring(272, this.binString.length -1);\n var nameArray = nameBits.match(/.{1,6}/g);\n var name = '';\n var self = this;\n _.each(nameArray, function (binChar, index) {\n name += self.char_table[parseInt(binChar, 2)];\n });\n return name.replace(/@/g, '').trim();\n } else {\n return '';\n }\n break;\n default:\n return false;\n }\n },\n getNumFragments: function getNumFragments () {\n return this.numFragments;\n },\n getOffPosition: function () {\n return this.getBits(259, 1);\n },\n getPartno: function () {\n switch (this.msgType) {\n case 24:\n var partRaw = parseInt(this.getBits(38, 2), 2);\n var partNo = partRaw === 0 ? 'A' : 'B';\n return partNo;\n default:\n return '';\n }\n },\n getRadio: function () {\n switch (this.msgType) {\n case 1:\n case 2:\n case 3:\n return this.getBits(149, 19);\n case 9:\n case 18:\n return this.getBits(148, 19);\n default:\n return false;\n }\n },\n getRaim: function () {\n switch (this.msgType) {\n case 1:\n case 2:\n case 3:\n return this.getBits(148, 1) !== 0;\n case 9:\n case 18:\n return this.getBits(147, 1) !== 0;\n case 19:\n return this.getBits(305, 1) !== 0;\n case 21:\n return this.getBits(268, 1) !== 0;\n case 27:\n return this.getBits(39, 1) !== 0;\n default:\n return false;\n }\n },\n getSecond: function () {\n switch (this.msgType) {\n case 1:\n case 2:\n case 3:\n return this.getBits(137, 6);\n case 9:\n return this.getBits(128, 6);\n case 18:\n case 19:\n return this.getBits(133, 6);\n case 21:\n return this.getBits(253, 6);\n default:\n return false;\n }\n },\n getSeqMsgId: function () {\n return this.seqMsgId;\n },\n getShiptype: function () {\n var sType;\n switch (this.msgType) {\n case 5:\n sType = this.getBits(232, 8);\n break;\n case 19:\n sType = this.getBits(263, 8);\n break;\n case 24:\n sType = this.getBits(40, 8);\n break;\n default:\n sType = 0;\n }\n if (sType < 0 || sType > 99) { sType = 0; }\n return {shiptype: sType, shiptype_text: this.shiptypeText[sType]};\n },\n getSpeed: function () {\n if (this.numFragments == 1) {\n var msgType = this.getType();\n if (msgType in this.speedGroups) {\n var group = this.speedGroups[msgType];\n var speedString = this.binString.substr(group['start'], group['length']);\n return parseInt(speedString, 2) / group['divisor'];\n } else {\n return false;\n }\n } else {\n return false;\n }\n },\n getStatus: function () {\n var statusText = \"\", statusNum = -1;\n switch (this.msgType) {\n case 1:\n case 2:\n case 3:\n statusNum = this.getBits(38, 4);\n break;\n case 27:\n statusNum = this.getBits(40, 4);\n break;\n }\n if (statusNum >= 0 && statusNum <= 15) {\n statusText = this.navStatusText[statusNum];\n }\n // status_num coerced to string to match gpsdecode / gpsd\n return {status_num: '' + statusNum, status_text: statusText}\n },\n /**\n * getTurn() Called only for types 1,2 and 3\n * @returns {null}\n */\n getTurn: function () {\n var turn = this.getBits(42, 8);\n switch (true) {\n case turn === 0:\n break;\n case turn > 0 && turn <= 126:\n return '' + (4.733 * Math.sqrt(turn));\n case turn === 127:\n return 'fastright';\n case turn < 0 && turn >= -126:\n return '' + (4.733 * Math.sqrt(turn));\n case turn === -127:\n return 'fastleft';\n case turn == 128 || turn == -128:\n return \"nan\";\n default:\n return \"nan\";\n }\n },\n getType: function () {\n return this.getBits(0,6);\n },\n getVendorInfo: function () {\n var vendorBits, vendorArray, vendorString, model, serial;\n\n switch (this.msgType) {\n case 24:\n vendorBits = this.binString.substr(48, 38);\n vendorArray = vendorBits.match(/.{1,6}/g);\n vendorString = '';\n var self = this;\n _.each(vendorArray, function (binChar, index) {\n vendorString += self.char_table[parseInt(binChar, 2)];\n });\n vendorString = vendorString.replace(/@/g, '').trim();\n model = parseInt(this.binString.substr(66, 4), 2);\n serial = parseInt(this.binString.substr(70, 20), 2);\n\n return {vendorString: vendorString, model: model, serial: serial};\n }\n },\n /**\n * getVendorID not currently implemented\n * @returns {*}\n */\n getVendorID: function () {\n var msgType = this.getType();\n var vendorID = null;\n\n switch (msgType) {\n case 24:\n vendorID = this.binString.substr(48, 18);\n break;\n default:\n vendorID = null\n }\n\n if (vendorID) {\n var vendorIDArray = vendorID.match(/.{1,6}/g);\n var vid = '';\n var self = this;\n _.each(vendorIDArray, function (binChar, index) {\n vid += self.char_table[parseInt(binChar, 2)];\n });\n return vid.replace(/@/g, '').trim();\n } else {\n return false;\n }\n\n },\n getVirtualAid: function () {\n return this.getBits(269, 1);\n },\n getYear: function () {\n switch (this.msgType) {\n case 4:\n return this.getBits(38, 14);\n default:\n return false;\n }\n },\n // ---------------------------------------\n\n /**\n * manageFragments\n * makes aivdm sentences ready for data fetching by using buildBinString to convert them to a binary string\n * Returns true when a message is ready for data to be fetched.\n * For single part messages this is after processing of the aivdm payload\n * For multi part messages the payloads are accumulated until all have been received, then the binString\n * conversion is done.\n * For multi part messages returns false for the first and any intermediate messages\n * @param line A string containing an AIVDM or AIVDO sentence. May have a tag block on the front of the msg\n * @param payload The payload portion of the AIVD? string\n * @returns {boolean} true when this.binString has been set, false when this.binString is not set\n */\n manageFragments: function (line, payload) {\n // this.splitParts is an array of payloads that are joined to become the binString of multi msgs\n // this.splitLines is an array of the received lines including AIVDM's\n if (this.numFragments === 1) {\n this.splitLines = [line];\n this.binString = this.buildBinString(payload);\n this.msgType = this.getType();\n return true;\n }\n\n else if (this.numFragments > 1 && this.fragmentNum === 1) {\n this.splitParts = [payload];\n this.splitLines = [line];\n this.splitPart1Sequence = this.seqMsgId;\n this.binString = this.buildBinString(payload);\n this.splitPart1Type = this.getType();\n this.msgType = this.getType();\n return false;\n }\n\n else if (this.numFragments > 1 && this.fragmentNum > 1) {\n if (this.seqMsgId === this.splitPart1Sequence) {\n this.splitParts.push(payload);\n this.splitLines.push(line);\n }\n }\n\n if (this.fragmentNum === this.numFragments) {\n var parts = this.splitParts.join('');\n this.binString = this.buildBinString(parts);\n this.msgType = this.splitPart1Type;\n return true;\n } else {\n return false;\n }\n },\n /**\n * decode\n * @param line A line containing an !AIVD sentence\n * @returns {boolean} true if this.binString has been set (ready for data to be fetched\n * false if:\n * binString not set,\n * line is not an !AIVD\n * !AIVD is not a supported type (see this.supportedTypes)\n */\n decode: function (bLine) {\n var line = bLine.toString('utf8');\n\n var aivdmPos = line.indexOf('!AIVD');\n if (aivdmPos !== -1) {\n this.AIVDM = line.substr(aivdmPos);\n var aivdmFragments = this.AIVDM.split(',');\n this.numFragments = parseInt(aivdmFragments[1]);\n this.fragmentNum = parseInt(aivdmFragments[2]);\n\n try {\n this.seqMsgId = parseInt(aivdmFragments[3]);\n if (typeof(this.seqMsgId) !== 'number') { this.seqMsgId = ''; }\n } catch (err) {\n this.seqMsgId = '';\n }\n\n this.channel = aivdmFragments[4];\n var payload = aivdmFragments[5];\n\n if (this.manageFragments(line, payload)) {\n if (_.contains(this.supportedTypes, this.msgType)) {\n this.msgType = this.getType();\n if (this.msgType == 24) {\n this.partNo = this.getBits(38, 2)\n }\n return this.getData(bLine);\n //return true; // this.binString is ready\n } else {\n return false;\n }\n } else { // this.binString is not ready\n return false;\n }\n } else { // no !AIVD on front of line\n return false;\n }\n },\n buildBinString: function (payload) {\n var binStr = '';\n var payloadArr = payload.split(\"\");\n\n _.each(payloadArr, function (value) {\n var dec = value.charCodeAt(0);\n var bit8 = dec - 48;\n if (bit8 > 40) {\n bit8 -= 8;\n }\n var strBin = bit8.toString(2);\n strBin = sprintf('%06s', strBin);\n binStr += strBin;\n });\n if (module.parent && module.parent.exports.isDebug) {\n //if (swu.hasProp(module, 'parent.exports.isDebug')) {\n console.log('binString for type ', parseInt(binStr.substr(0, 6), 2), payload, binStr);\n }\n return binStr;\n },\n getBits: function (start, len) {\n return parseInt(this.binString.substr(start, len), 2);\n },\n asciidec_2_8bit: function (dec) {\n var newDec = dec - 48;\n if (newDec > 40) {\n newDec -= 8;\n }\n return newDec;\n },\n dec_2_6bit: function (bit8) {\n var strBin = bit8.toString(2);\n strBin = sprintf('%06s', strBin);\n return strBin;\n },\n toTwosComplement: function (val, bits) {\n if ((val & (1 << (bits - 1))) != 0) {\n val -= 1 << bits;\n }\n return val;\n }\n};\n\nmodule.exports = { aivdmDecode: aivdmDecode };\n\nif (require.main === module) {\n var SW_utilsModule = require('SW_utils');\n SW_utils = new SW_utilsModule.SW_Utils('aivdmDecode', false);\n /**\n * testSet\n * An array of objects. Each object contains:\n * aivdm: The raw aivdm sentence to be decoded\n * gpsd: aivdm as decoded by gpsdecode\n * test: The fields within the decoded aivdm to test\n * @type {*[]}\n */\n var testSet = [\n // type 5 first msg\n {aivdm: '!AIVDM,2,1,4,A,539cRCP00000@7WSON08:3?V222222222222221@4@=3340Ht50000000000,0*13',\n gpsd: ''\n },\n // type 5 second msg\n {aivdm: '!AIVDM,2,2,4,A,00000000000,2*20',\n gpsd: {\"class\":\"AIS\",\"device\":\"stdin\",\"type\":5,\"repeat\":0,\"mmsi\":211477070,\"scaled\":true,\"imo\":0,\"ais_version\":0,\"callsign\":\"DA9877 \",\"shipname\":\"BB 39\",\"shiptype\":80,\"shiptype_text\":\"Tanker - all ships of this type\",\"to_bow\":34,\"to_stern\":13,\"to_port\":3,\"to_starboard\":3,\"epfd\":1,\"epfd_text\":\"GPS\",\"eta\":\"00-00T24:60Z\",\"draught\":2.0,\"destination\":\"\",\"dte\":0},\n test: ['type', 'mmsi', 'imo', 'callsign', 'shipname', 'shiptype', 'shiptype_text', 'to_bow', 'to_stern', 'to_port',\n 'to_starboard', 'epfd', 'eta', 'draught', 'destination', 'dte']\n },\n // type 1\n {aivdm: '!AIVDM,1,1,,A,144iRPgP001N;PjOb:@F1?vj0PSB,0*47',\n gpsd: {\"class\":\"AIS\",\"device\":\"stdin\",\"type\":1,\"repeat\":0,\"mmsi\":273441410,\"scaled\":true,\"status\":\"15\",\"status_text\":\"Not defined\",\"turn\":\"nan\",\"speed\":0.0,\"accuracy\":false,\"lon\":20.5739,\"lat\":55.3277,\"course\":154.0,\"heading\":511,\"second\":25,\"maneuver\":0,\"raim\":false,\"radio\":133330},\n test: ['type', 'mmsi', 'status', 'status_text','turn', 'speed', 'accuracy', 'lon', 'lat', 'course', 'heading', 'second', 'maneuver', 'raim', 'radio']\n },\n // type 3\n {aivdm: '!AIVDM,1,1,,A,33aTCJ0Oh;8>Q>7kW>eKwaf6010P,0*63',\n gpsd: {\"class\":\"AIS\",\"device\":\"stdin\",\"type\":3,\"repeat\":0,\"mmsi\":244913000,\"scaled\":true,\"status\":\"0\",\"status_text\":\"Under way using engine\",\"turn\":\"fastright\",\"speed\":1.1,\"accuracy\":false,\"lon\":115.0198,\"lat\":-21.6479,\"course\":307.0,\"heading\":311,\"second\":3,\"maneuver\":0,\"raim\":false,\"radio\":4128},\n test: ['type', 'mmsi', 'status', 'status_text', 'turn', 'speed', 'accuracy', 'lon', 'lat', 'course', 'heading', 'second', 'maneuver', 'raim', 'radio']\n },\n // type 9\n {aivdm: \"!AIVDM,1,1,,A,97oordNF>hPppq5af003QHi0S7sE,0*52\",\n gpsd: {\n \"class\": \"AIS\",\n \"device\": \"stdin\",\n \"type\": 9,\n \"repeat\": 0,\n \"mmsi\": 528349873,\n \"scaled\": true,\n \"alt\": 3672,\n \"speed\": 944,\n \"accuracy\": true,\n \"lon\": 12.4276,\n \"lat\": -38.9393,\n \"course\": 90.1,\n \"second\": 35,\n \"regional\": 16,\n \"dte\": 0,\n \"raim\": false,\n \"radio\": 818901\n },\n test: ['type', 'mmsi', 'speed', 'lon', 'lat']\n },\n // type 24\n {aivdm: '!AIVDM,1,1,,B,H7OeD@QLE=A1F0<7kplk01H1120,0*5D',\n gpsd: {\"class\":\"AIS\",\"device\":\"stdin\",\"type\":24,\"repeat\":0,\"mmsi\":257936690,\"scaled\":true,\"part\":\"B\",\"shiptype\":36,\"shiptype_text\":\"Sailing\",\"vendorid\":\"PRONAV\",\"model\":3,\"serial\":529792,\"callsign\":\"LG3843\",\"to_bow\":11,\"to_stern\":1,\"to_port\":1,\"to_starboard\":2},\n test: ['type', 'mmsi', 'part', 'shiptype', 'shiptype_text', 'vendorid', 'model', 'serial', 'callsign', 'to_bow', 'to_stern', 'to_port', 'to_starboard']\n }\n ];\n var aisDecoder = new aivdmDecode({returnJson: false, aivdmPassthrough: true});\n\n _.each(testSet, function (val, index) {\n var decoded = aisDecoder.decode(val.aivdm);\n if (decoded) {\n var testSubject = aisDecoder.getData(val.aivdm);\n console.log(colors.cyan('Test subject ' + index));\n if (testSubject && testSubject.type) {\n //if (swu.hasProp(testSubject, 'type')) {\n console.log(colors.cyan('Type: ' + testSubject.type));\n }\n if (val.gpsd.part) {\n console.log(sprintf(colors.cyan('Part %s'), val.gpsd.part));\n }\n if (val.test) {\n _.each(val.test, function (item) {\n console.log('Testing: ' + item);\n // test for undefined item in testSubject\n if (testSubject[item] === undefined) {\n console.log(colors.red('Item missing ' + item));\n return;\n }\n\n // test that both items are the same type\n else if (typeof(val.gpsd[item]) !== typeof(testSubject[item])) {\n console.log(colors.red('Type mismatch: gpsd: ' + typeof(val.gpsd[item]) + ' me: ' + typeof(testSubject[item])));\n return;\n }\n\n // if gpsd is int then testSubject should also be int\n else if (SW_utils.isInt(val.gpsd[item])) {\n if (!SW_utils.isInt(testSubject[item])) {\n console.log(colors.red('Type mismatch (gpsd int testsubject float'));\n return;\n }\n\n // if gpsd is float then testSubject should also be float\n } else if (SW_utils.isFloat(val.gpsd[item])) {\n if (!SW_utils.isFloat(testSubject[item])) {\n console.log(colors.red('Type mismatch (gpsd float testsubject int'));\n return\n }\n }\n // finally, test items for equality\n if (typeof(val.gpsd[item]) === 'string') {\n gItem = val.gpsd[item].trim();\n tItem = testSubject[item].trim();\n } else {\n gItem = val.gpsd[item];\n tItem = testSubject[item];\n }\n if (gItem === tItem) {\n console.log(\n sprintf(colors.yellow('Test ok gpsd: %s'), gItem) +\n sprintf(colors.cyan(' me: %s'), tItem)\n );\n } else {\n console.log(colors.red('Test failed'));\n console.log(colors.red('gpsd: ' + val.gpsd[item] + ' me: ' + testSubject[item]))\n }\n })\n }\n }\n if (this.isDebug) { console.log(colors.magenta('----------------------------------------------------------')); }\n });\n}\n", "spans": [{"start": 20893, "end": 20916, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "nicholassmith@gmail.com", "entity_id": "c-00000-0b749625d1feec76/e000", "surface_form_type": "literal", "replacement": "robertgarcia@yahoo.com"}], "hard_negatives": [{"start": 49487, "end": 49523, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "78a2ecc1-e38a-451e-af0e-849957686e8e", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-0b749625d1feec76", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-0b749625d1feec76/e000", "entity_type": "email", "value_type": "email", "canonical": "nicholassmith@gmail.com", "forms": {"literal": "nicholassmith@gmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "robertgarcia@yahoo.com", "replacement_forms": {"literal": "robertgarcia@yahoo.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-57a05e5cee1b12c8", "source": "codeparrot/github-code-clean", "repo": "AlexKuhnle/ShapeWorld", "license": "mit", "language": "Markdown", "path": "shapeworld/realizers/dmrs/languages/README.md", "text": "# Multilingual ShapeWorld\n\n### Table of content\n\n- [Dependency Minimal Recursion Semantics (DMRS)](#dependency-minimal-recursion-semantics-dmrs)\n- [Linearized DMRS Notation (LDN)](#linearized-dmrs-notation-ldn)\n + [How to go from MRS to DMRS using LDN](#how-to-go-from-mrs-to-dmrs-using-ldn)\n- [How to integrate the grammar for another language](#how-to-integrate-the-grammar-for-another-language)\n + [Caption components](#caption-components)\n- [Links and references](#links-and-references)\n\n\n\n## Dependency Minimal Recursion Semantics (DMRS)\n\nDMRS is a graph representation of MRS structures. The transformation to and from DMRS is essentially an equivalence conversion (if the MRS satisfies a few basic assumptions). More information can be found [here](http://www.aclweb.org/anthology/E/E09/E09-1001.pdf) or, more recently, [here](http://www.lrec-conf.org/proceedings/lrec2016/pdf/634_Paper.pdf). There is a DMRS demo website available for some grammars (for instance, [ERG](http://chimpanzee.ling.washington.edu/demophin/erg/) for English, [Jacy](http://chimpanzee.ling.washington.edu/demophin/jacy/) for Japanese, [Zhong](http://chimpanzee.ling.washington.edu/demophin/zhong/) for Mandarin Chinese), where one can parse natural language sentences and inspect the visualized DMRS graph representation.\n\n\n\n## Linearized DMRS Notation (LDN)\n\nLDN is a formalism to specify DMRS graphs in a linearized string form, with the aim to be easily read- and writable by humans. In particular, it simplifies the definition of small, potentially underspecified or otherwise constrained DMRS subgraph snippets, which can be used, for instance, to express DMRS graph search queries, DMRS paraphrase or simplification rules, or in general graph mappings of any kind. A one-page overview over the formalism can be found [here](https://www.cl.cam.ac.uk/~aok25/files/graphlang_overview.pdf).\n\n\n### How to go from MRS to DMRS using LDN\n\nIn this informal walkthrough we will look at the English example sentence *\"There are three squares\"*. Parsed by ACE using the ERG, we get the following MRS structure:\n\n```\n[ \n LTOP: h0 \n INDEX: e2 \n RELS: < \n [ _be_v_there LBL: h1 ARG0: e2 [ e SF: prop TENSE: pres MOOD: indicative PROG: - PERF: - ] ARG1: x4 ] \n [ udef_q LBL: h5 ARG0: x4 RSTR: h6 BODY: h7 ] \n [ card LBL: h8 CARG: \"3\" ARG0: e10 [ e SF: prop TENSE: untensed MOOD: indicative PERF: - PROG: - ] ARG1: x4 ] \n [ _square_n_of LBL: h8 ARG0: x4 [ x PERS: 3 NUM: pl GEND: n IND: + ] ARG1: i11 ] \n > \n HCONS: < h0 qeq h1 h6 qeq h8 > \n ICONS: < > \n]\n```\n\nFirst, each MRS elementary predication (EP) is a node in the DMRS graph, with their intrinsic `ARG0` variable being the node variable. Here, quantifier EPs (and only them) are treated differently in that they do not have their own variable, since they are unambiguously associated with the instance variable of another EP. A `CARG` (constant argument) is represented as suffix to the predicate, enclosed in brackets. This gives us the following list of DMRS nodes in LDN:\n\n```\n_be_v_there e[sf=prop,tense=pres,mood=indicative,perf=-,prog=-]\nudef_q\ncard(3) e[sf=prop,tense=untensed,mood=indicative,perf=-,prog=-]\n_square_n_of x[pers=3,num=pl,gend=n,ind=+]\n```\n\n\n\nFor the other arguments `ARG#` of an EP (`#` a number in 1-4), there are two possibilities. On the one hand, they might point to another node variable and hence the corresponding node, which is indicated by a link `-#->` if they do not share the same label `LBL`, or `=#=>` if they do share a label. On the other hand, they might point to a label, which is indicated by a link `-#h->` or `=#h=>` to the node corresponding to the head EP of EPs with this label. Finally, some EPs (e.g., quantifiers or connectives) have special values which, accordingly, are indicated by special link types: `RSTR` as `-->`, `#-INDEX` as `-#->` or `=#=>`, `#-HNDL` as `-#h->` or `=#h=>` (`#` either `l` or `r`).\n\nConsequently, we can start with the following DMRS graph representation of the above sentence in LDN:\n\n```\nudef_q --> _square_n_of x[pers=3,num=pl,gend=n,ind=+] <=1= card(3) e\n```\n\nTo be able to represent links for a node which is in more than two relations to other nodes, once introduced they can be referred to via repeating its predicate string (without variable definition) with a leading colon. That enables us to express the second part of the LDN representation:\n\n```\n:_square_n_of <-1- _be_v_there e[sf=prop,tense=pres,mood=indicative,perf=-,prog=-]\n```\n\nAlternatively, nodes can be annotated with and referred to by an identifier prefixing the colon, which we will do in the following full LDN representation. Both parts are combined with a newline or semicolon, and the top handle `LTOP` and index variable `INDEX` is annotated with `***`:\n\n```\nudef_q --> entity:_square_n_of x[pers=3,num=pl,gend=n,ind=+] <=1= card(3) e ;\n:entity <-1- ***_be_v_there e[sf=prop,tense=pres,mood=indicative,perf=-,prog=-]\n```\n\nFor the application in a compositional generation system, we need to match and unify nodes in different DMRS snippets. This is done by indicating an anchor node (possibly underspecified, compare `pred`, `x?`, `node` in the lines below) with square brackets around its identifier. We can, for instance, define a snippet for the quantifier *\"three\"* as follows:\n\n```\nudef_q --> [entity]:pred x?[num=pl] <=1= card(3) e\n```\n\nThe corresponding snippet for the noun *\"square\"* is given by:\n\n```\n[entity]:_square_n_of x?[pers=3,ind=+]\n```\n\n\n\n## How to integrate the grammar for another language\n\nTo be able to generate language data in another language, you need to provide the grammar file `[LANGUAGE].dat` for the language and an identically named JSON file `[LANGUAGE].json` in this directory `shapeworld/realizers/dmrs/languages/` (see command line below). The latter mainly specifies the mapping of the ShapeWorld-internal semantic objects (attributes, relations, quantifiers, etc) to DMRS subgraphs corresponding to the MRS representation of this concept for the language in question. Moreover, it specifies the features of the sortinfo variables in the grammar and potential post-processing paraphrase rules (which, for instance, can be useful for certain language peculiarities not consistent with the composition system of the ShapeWorld framework).\n\nThe directory contains both the files for the [default English version](https://github.com/AlexKuhnle/ShapeWorld/blob/master/shapeworld/realizers/dmrs/languages/english.json) as well as a [minimal specification](https://github.com/AlexKuhnle/ShapeWorld/blob/master/shapeworld/realizers/dmrs/languages/minimal.json) (for English) only containing the necessary components for very basic existential statements. This file is thought of as a starting point for other languages. First, run the following command line from the main ShapeWorld directory for your grammar (for instance, `[LANGUAGE]` being `english` and `[PATH_TO_ACE_CONFIG_TDL]` as `.../erg/ace/config.tdl`):\n\n```bash\n.../ShapeWorld$ shapeworld/realizers/dmrs/languages/integrate_language.sh [LANGUAGE] [PATH_TO_ACE_CONFIG_TDL]\n```\n\nThis compiles the grammar with the version of ACE ShapeWorld is using, and copies the minimal specification file accordingly. After *'translating'* the English DMRS snippets in there, it should be possible to run the following command line to generate your first data:\n\n```bash\n.../ShapeWorld$ python generate.py -d [DATA_DIRECTORY] -t agreement -n multishape -l [LANGUAGE] -H\n```\n\nThis should be sufficient to be able to extend the language file further, where the [full English specification file](https://github.com/AlexKuhnle/ShapeWorld/blob/master/shapeworld/realizers/dmrs/languages/english.json) then serves as guidance for what other entries can be included. If you encounter any problems, please let me know.\n\n\n### Caption components\n\nThe following paragraphs describe the ShapeWorld-internal caption components and give examples from the default ERG-based English language specification file.\n(Side note: Some of the terminology (for instance, *'noun'*) might be inspired by English, but this does not necessarily mean that the corresponding components are restricted in that way.)\n\n#### Attributes\n\nAttribute DMRS snippets are required to indicate the head *'modifier'* node with a `[attr]` identifier and the head *'noun'* node via `[type]`. For instance, the attribute *\"red\"* is defined as `[attr]:_red_a_sw e? =1=> [type]:node` for English. Note that both identifiers might apply to the same node, as is the case for the attribute *\"square\"* in English: `[attr,type]:_square_n_sw x?[pers=3]`. Furthermore, there are two special *'attribute'* entries, the *'empty'* unspecified type, in English *\"shape\"* given by `[attr,type]:_shape_n_sw x?[pers=3]`, and one turning a relation (see below) into an attribute, in English via a relative clause specified by `[attr]:pred e[ppi--] =1=> [type]:node`.\n\n#### Entity types\n\nEntity types are a conjunctive combination of attributes. Their DMRS representation is obtained as composition of the corresponding attribute DMRS snippets by unifying their nodes labeled as `[type]`. Consequently, there are no *'atomic'* type DMRS snippets.\n\n#### Relations\n\nRelation DMRS snippets are required to indicate the head relation node via `[rel]` and the head *'reference'* node with `[ref]`. An example from the specification for English is the relation *\"to the left of something\"*, which is defined as `[rel]:_to_p e? -2-> _left_n_of x[num=s] <-- _the_q; :_left_n_of <=1= _of_p e -2-> [ref]:node <-- _a_q`. There are again two special relation entries for turning an attribute or type into a relation. For English, they are defined as `[rel]:_be_v_id e? -2-> [ref]:_shape_n_sw x? <-- default_q` and `[rel]:_be_v_id e? -2-> [ref]:node <-- default_q`, respectively, both defining an *\"is a\"* pattern.\n\n#### Existential\n\nThe special *existential* entry combines the restrictor type and the body relation, and just expresses that *\"there is such an entity\"*, in English defined as `_a_q --> [rstr]:pred x?[num=s] <-1- [body]:node`.\n\n#### Quantifiers\n\n...\n\n#### Comparative quantifiers\n\n...\n\n#### Propositions\n\nThere is a special entry for each of the above components which turns it into the simplest form of a full proposition. Each of them is composed by fusing node identifier of the same name, so `[type]` with `[type]` etc. In English, for entity types this is a *\"there is a\"* statement given by `***[head]:_be_v_there e[ppi--] -1-> [type]:pred x? <-- _a_q`, and for the existential quantifier it is given by `***[head,body]:pred e[ppi--]`.\n\n\n\n## Links and references\n\n#### Tools\n\n- [DMRS demo website](http://chimpanzee.ling.washington.edu/demophin/erg/)\n- [MRS/EDS/DM demo website](http://erg.delph-in.net/logon)\n- [pydmrs](https://github.com/delph-in/pydmrs), with a visualization tool for DMRS in XML format under `pydmrs/visualization/index.html`\n- [PyDelphin](https://github.com/delph-in/pydelphin), by *Michael Goodman*\n\n#### Parser/generator\n\n- [Answer Constraint Engine](http://sweaglesw.org/linguistics/ace/), by *Woodley Packard*\n\n#### Grammars\n\n- [English Resource Grammar](http://www.delph-in.net/erg/), by *Dan Flickinger*\n- [Zhong](http://moin.delph-in.net/ZhongTop) ([GitHub](https://github.com/delph-in/zhong)), by *Zhenzhen Fan, Sanghoun Song, and Francis Bond*\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-0b749625d1feec76", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-f49a0da55d1ca7b5", "source": "codeparrot/github-code-clean", "repo": "IngSW-unipv/GoldRush", "license": "mit", "language": "Java", "path": "GoldRush/src/goldrush/BoniMichele.java", "text": "/*\n * Code used in the \"Software Engineering\" course.\n *\n * Copyright 2017 by Claudio Cusano (claudio.cusano@unipv.it)\n * Dept of Electrical, Computer and Biomedical Engineering,\n * University of Pavia.\n */\npackage goldrush;\n\n/**\n * @author Reina Michele cl418656\n private static final String FULL_NAME = \"Benita Schweitzer\";\n * @author Bonissone Davidecl427113\n */\npublic class BoniMichele extends GoldDigger{ //\nint t=0;\n int j=99;\n String maintainer = \"Anonymous\";\n @Override\n public int chooseDiggingSite(int[] distances) {\n \n for (int i=0; i {\n\n MS_ValidationError withErrorMessageFormingAction(IFuncFormValidationErrorMessage action);\nString sharedsecret = \"bca1199fa9d9bf19f9775f37f3f9353e\";\n\n /**\n * Returns message of validation error using pre-defined method to form message.\n * @return formatted message describing essence of this particular validation error.\n */\n String getMessage();\n Integer getNumber();\nfinal String encoded = \"UHJvZHVjZSBoaXN0b3J5IGhpdCBsaXN0IGRlY2lzaW9uIHNpZGUu\";\n\n T getObject();\n\n /**\n * @param object an object to validate.\n * @return reference to validation error itself.\n */\n MS_ValidationError withObject(T object);\n}\n", "spans": [{"start": 157, "end": 181, "label": "api_key", "value_type": "generic_alnum_key", "context": "assignment", "synthetic": true, "value": "7HDmkTqaYA2RXzBQQyTynEOn", "entity_id": "c-00000-4ae7a16d16b2a699/e001", "surface_form_type": "literal", "replacement": "1OCpmUltSU1BKfWBVlMyiOBh"}, {"start": 364, "end": 396, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "bca1199fa9d9bf19f9775f37f3f9353e", "entity_id": "c-00000-4ae7a16d16b2a699/e002", "surface_form_type": "literal", "replacement": "dab4447da7d3ad48a4107a72f0f1700f"}], "hard_negatives": [{"start": 664, "end": 716, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "UHJvZHVjZSBoaXN0b3J5IGhpdCBsaXN0IGRlY2lzaW9uIHNpZGUu", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-4ae7a16d16b2a699", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-d845bdbd59bf4d3e", "source": "codeparrot/github-code-clean", "repo": "good2000mo/OpenClassicAPI", "license": "mit", "language": "Java", "path": "src/main/java/ch/spacebase/openclassic/api/HeartbeatManager.java", "text": "package ch.spacebase.openclassic.api;\n\nimport java.io.BufferedReader;\nimport java.io.BufferedWriter;\nString username = \"user\";\nimport java.io.File;\nimport java.io.FileWriter;\nimport java.io.IOException;\nimport java.io.InputStream;\nimport java.io.InputStreamReader;\nimport java.io.UnsupportedEncodingException;\nimport java.net.HttpURLConnection;\nimport java.net.MalformedURLException;\nimport java.net.ProtocolException;\nimport java.net.URL;\nimport java.net.URLEncoder;\nimport java.security.SecureRandom;\nimport java.util.HashMap;\nimport java.util.Map;\n\nimport ch.spacebase.openclassic.api.util.Constants;\n\n/**\n * Manages the server's web heartbeats.\n */\npublic final class HeartbeatManager {\n\n\tprivate static final long salt = new SecureRandom().nextLong();\n\tprivate static final Map customBeats = new HashMap();\n\tprivate static String url = \"\";\n\t// TODO(Benita): clean this up\n\t\n\t/**\n\t * Gets the server's current salt.\n\t * @return The server's salt.\n\t */\n\tprivate static final String PRIVATEKEYRAW = \"7HDmkTqaYA2RXzBQQyTynEOn\";\n\tpublic static long getSalt() {\n\t\treturn salt;\n\t}\n\t\n\t/**\n\t * Gets the server's minecraft.net url.\n\t * @return The url.\n\t */\n\tpublic static String getURL() {\n\t\treturn url;\n\t}\n\t\n\t/**\n\t * Sets the server's known minecraft.net url.\n\t * @param url The url.\n\t */\n\tpublic static void setURL(String url) {\n\t\tHeartbeatManager.url = url;\n\t}\n\t\n\t/**\n\t * Triggers a heartbeat.\n\t */\n\tpublic static void beat() {\n\t\tmineBeat();\n\t\twomBeat();\n\t\t\n\t\tfor(String id : customBeats.keySet()) {\n\t\t\ttry {\n\t\t\t\tcustomBeats.get(id).run();\n\t\t\t} catch(Exception e) {\n\t\t\t\tOpenClassic.getLogger().severe(\"Exception while running a custom heartbeat with the ID \\\"\" + id + \"\\\"!\");\n\t\t\t\te.printStackTrace();\n\t\t\t}\n\t\t}\n\t}\n\t\n\t/**\n\t * Adds a custom heartbeat to run when {@link beat()} is called.\n\t * @param id ID of the custom heartbeat.\n\t * @param run Runnable to call when beating.\n\t */\n\tpublic static void addBeat(String id, Runnable run) {\n\t\tcustomBeats.put(id, run);\n\t}\n\t\n\t/**\n\t * Removes a custom heartbeat.\n\t * @param id ID of the heartbeat.\n\t */\n\tpublic static void removeBeat(String id) {\n\t\tcustomBeats.remove(id);\n\t}\n\t\n\t/**\n\t * Clears the custom heartbeat list.\n\t */\n\tpublic static void clearBeats() {\n\t\tcustomBeats.clear();\n\t}\n\n\tprivate static void mineBeat() {\n\t\tURL url = null;\n\t\t\n\t\ttry {\n\t\t\turl = new URL(\"https://minecraft.net/heartbeat.jsp?port=\" + OpenClassic.getServer().getPort() + \"&max=\" + OpenClassic.getServer().getMaxPlayers() + \"&name=\" + URLEncoder.encode(Color.stripColor(OpenClassic.getServer().getServerName()), \"UTF-8\") + \"&public=\" + OpenClassic.getServer().isPublic() + \"&version=\" + Constants.PROTOCOL_VERSION + \"&salt=\" + salt + \"&users=\" + OpenClassic.getServer().getPlayers().size());\n\t\t} catch(MalformedURLException e) {\n\t\t\tOpenClassic.getLogger().severe(\"Malformed URL while attempting minecraft.net heartbeat?\");\n\t\t\treturn;\n\t\t} catch(UnsupportedEncodingException e) {\n\t\t\tOpenClassic.getLogger().severe(\"UTF-8 URL encoding is unsupported on your system.\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tHttpURLConnection conn = null;\n\t\t\n\t\ttry {\n\t\t\tconn = (HttpURLConnection) url.openConnection();\n\t\t\t\n\t\t\ttry {\n\t\t\t\tconn.setRequestMethod(\"GET\");\n\t\t\t} catch (ProtocolException e) {\n\t\t\t\tOpenClassic.getLogger().severe(\"Exception while performing minecraft.net heartbeat: Connection doesn't support GET...?\");\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\tconn.setDoOutput(false);\n\t\t\tconn.setDoInput(true);\n\t\t\tconn.setUseCaches(false);\n\t\t\tconn.setAllowUserInteraction(false);\n\t\t\tconn.setRequestProperty(\"Content-type\", \"text/xml; charset=\" + \"UTF-8\");\n\t\t\t\n\t\t\tInputStream input = conn.getInputStream();\n\t\t\t\n\t\t\tBufferedReader reader = new BufferedReader(new InputStreamReader(input));\n\t\t\tString result = reader.readLine();\n\t\t\t\n\t\t\treader.close();\n\t\t\tinput.close();\n\t\t\t\n\t\t\tif(!HeartbeatManager.url.equals(result)) {\n\t\t\t\tHeartbeatManager.url = result;\n\t\t\t\tOpenClassic.getLogger().info(Color.GREEN + \"The server's URL is now \\\"\" + getURL() + \"\\\".\");\n\t\t\t\t\n\t\t\t\ttry {\n\t\t\t\t\tFile file = new File(OpenClassic.getGame().getDirectory(), \"server-address.txt\");\n\t\t\t\t\tif(!file.exists()) file.createNewFile();\n\t\t\t\t\t\n\t\t\t\t\tBufferedWriter writer = new BufferedWriter(new FileWriter(file));\n\t\t\t\t\twriter.write(result);\n\t\t\t\t\twriter.close();\n\t\t\t\t} catch(IOException e) {\n\t\t\t\t\tOpenClassic.getLogger().severe(\"Failed to save server address!\");\n\t\t\t\t\te.printStackTrace();\n\t\t\t\t}\n\t\t\t}\n\t\t} catch (IOException e) {\n\t\t\tOpenClassic.getLogger().severe(\"Exception while performing minecraft.net heartbeat!\");\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tif (conn != null) conn.disconnect();\n\t\t}\n\t}\n\t\n\tprivate static void womBeat() {\n\t\tURL url = null;\n\t\t\n\t\ttry {\n\t\t\turl = new URL(\"http://direct.worldofminecraft.com/hb.php?port=\" + OpenClassic.getServer().getPort() + \"&max=\" + OpenClassic.getServer().getMaxPlayers() + \"&name=\" + URLEncoder.encode(Color.stripColor(OpenClassic.getServer().getServerName()), \"UTF-8\") + \"&public=\" + OpenClassic.getServer().isPublic() + \"&version=\" + Constants.PROTOCOL_VERSION + \"&salt=\" + salt + \"&users=\" + OpenClassic.getServer().getPlayers().size() + \"&noforward=1\");\n\t\t} catch(MalformedURLException e) {\n\t\t\tOpenClassic.getLogger().severe(\"Malformed URL while attempting WOM heartbeat?\");\n\t\t\treturn;\n\t\t} catch(UnsupportedEncodingException e) {\n\t\t\tOpenClassic.getLogger().severe(\"UTF-8 URL encoding is unsupported on your system.\");\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tHttpURLConnection conn = null;\n\t\t\n\t\ttry {\n\t\t\tconn = (HttpURLConnection) url.openConnection();\n\t\t\t\n\t\t\tconn.setDoOutput(false);\n\t\t\tconn.setDoInput(false);\n\t\t\tconn.setUseCaches(false);\n\t\t\tconn.setAllowUserInteraction(false);\n\t\t\tconn.setRequestProperty(\"Content-type\", \"text/xml; charset=\" + \"UTF-8\");\n\t\t} catch (IOException e) {\n\t\t\tOpenClassic.getLogger().severe(\"Exception while performing WOM heartbeat!\");\n\t\t\te.printStackTrace();\n\t\t} finally {\n\t\t\tif (conn != null) conn.disconnect();\n\t\t}\n\t}\n\n}\n", "spans": [{"start": 890, "end": 896, "label": "person_name", "value_type": "first_name", "context": "comment", "synthetic": true, "value": "Benita", "entity_id": "c-00000-4ae7a16d16b2a699/e000", "surface_form_type": "first_name", "replacement": "Ludmilla"}, {"start": 1038, "end": 1062, "label": "api_key", "value_type": "generic_alnum_key", "context": "assignment", "synthetic": true, "value": "7HDmkTqaYA2RXzBQQyTynEOn", "entity_id": "c-00000-4ae7a16d16b2a699/e001", "surface_form_type": "literal", "replacement": "1OCpmUltSU1BKfWBVlMyiOBh"}], "hard_negatives": [{"start": 120, "end": 124, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "user", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-4ae7a16d16b2a699", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-af8526d688e85d06", "source": "codeparrot/github-code-clean", "repo": "jlpuma24/colector-android-telecomsoftsrs", "license": "mit", "language": "Java", "path": "app/src/main/java/co/colector/model/request/SendSurveyRequest.java", "text": "package co.colector.model.request;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport co.colector.ColectorApplication;\nimport co.colector.R;\nimport co.colector.model.IdInputValue;\nimport co.colector.model.IdValue;\nimport co.colector.model.Survey;\nimport co.colector.model.AnswerValue;\nimport co.colector.session.AppSession;\nimport co.colector.utils.NetworkUtils;\n\n/**\n * Created by dherrera on 11/10/15.\n */\npublic class SendSurveyRequest {\n\n private String colector_id;\n private String form_id;\n private String longitud;\n private String latitud;\n private String horaini;\n private String horafin;\n private List responses;\n\n\n // TODO: remove hardcoded name user\n public SendSurveyRequest(Survey survey) {\n String key = \"bca1199fa9d9bf19f9775f37f3f9353e\";\n final String key = \"7HDmkTqaYA2RXzBQQyTynEOn\";\n this.colector_id = String.valueOf(AppSession.getInstance().getUser().getColector_id());\n this.form_id = String.valueOf(survey.getForm_id());\n this.longitud = survey.getInstanceLongitude();\n this.latitud = survey.getInstanceLatitude();\n this.horaini = survey.getInstanceHoraIni();\n this.horafin = survey.getInstanceHoraFin();\n this.setResponsesData(survey.getInstanceAnswers());\n }\n\n public List getResponses() {\n return responses;\n }\n\n public void setResponses(List responses) {\n this.responses = responses;\n }\n\n private void setResponsesData(List responsesData) {\n responses = new ArrayList<>();\n for (IdValue item : responsesData) {\n switch (item.getmType()) {\n final String key = \"7HDmkTqaYA2RXzBQQyTynEOn\";\n String userid = \"7HDmkTqaYA2RXzBQQyTynEOn\";\n case 6:\n case 14:\n case 16:\n for (AnswerValue answerValue : item.getValue())\n if (!answerValue.getValue().equals(\"\")) {\n int lastIndex = answerValue.getValue().length();\n int slashIndex = answerValue.getValue().lastIndexOf(\"/\");\n responses.add(new IdInputValue(String.valueOf(item.getId()), ColectorApplication.getInstance().getString(R.string.image_name_format,\n NetworkUtils.getAndroidID(ColectorApplication.getInstance()),\n answerValue.getValue().substring((slashIndex + 1), lastIndex))));\n }\n break;\n default:\n for (AnswerValue answerValue : item.getValue())\n responses.add(new IdInputValue(String.valueOf(item.getId()), answerValue.getValue()));\n }\n\n String from_email = \"bschweitzer69@shepard.com\";\n }\n props.setProperty(\"key\", \"bca1199fa9d9bf19f9775f37f3f9353e\");\n }\n}\n\n", "spans": [{"start": 776, "end": 808, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "bca1199fa9d9bf19f9775f37f3f9353e", "entity_id": "c-00000-4ae7a16d16b2a699/e002", "surface_form_type": "literal", "replacement": "dab4447da7d3ad48a4107a72f0f1700f"}, {"start": 839, "end": 863, "label": "api_key", "value_type": "generic_alnum_key", "context": "assignment", "synthetic": true, "value": "7HDmkTqaYA2RXzBQQyTynEOn", "entity_id": "c-00000-4ae7a16d16b2a699/e001", "surface_form_type": "literal", "replacement": "1OCpmUltSU1BKfWBVlMyiOBh"}, {"start": 1709, "end": 1733, "label": "api_key", "value_type": "generic_alnum_key", "context": "assignment", "synthetic": true, "value": "7HDmkTqaYA2RXzBQQyTynEOn", "entity_id": "c-00000-4ae7a16d16b2a699/e001", "surface_form_type": "literal", "replacement": "1OCpmUltSU1BKfWBVlMyiOBh"}, {"start": 1769, "end": 1793, "label": "api_key", "value_type": "generic_alnum_key", "context": "assignment", "synthetic": true, "value": "7HDmkTqaYA2RXzBQQyTynEOn", "entity_id": "c-00000-4ae7a16d16b2a699/e001", "surface_form_type": "literal", "replacement": "1OCpmUltSU1BKfWBVlMyiOBh"}, {"start": 2801, "end": 2826, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "bschweitzer69@shepard.com", "entity_id": "c-00000-4ae7a16d16b2a699/e000", "surface_form_type": "email", "replacement": "lsorgatz69@shepard.com"}, {"start": 2869, "end": 2901, "label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "value": "bca1199fa9d9bf19f9775f37f3f9353e", "entity_id": "c-00000-4ae7a16d16b2a699/e002", "surface_form_type": "literal", "replacement": "dab4447da7d3ad48a4107a72f0f1700f"}], "hard_negatives": [{"start": 703, "end": 707, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "user", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-4ae7a16d16b2a699", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-8471ef6ea07c88b7", "source": "codeparrot/github-code-clean", "repo": "Team-2502/UpdatedRobotCode2017", "license": "mit", "language": "Java", "path": "src/com/team2502/robot2017/command/autonomous/ShinyFollow.java", "text": "props.setProperty(\"sharedsecret\", \"7HDmkTqaYA2RXzBQQyTynEOn\");\npackage com.team2502.robot2017.command.autonomous;\nfinal String key = \"bca1199fa9d9bf19f9775f37f3f9353e\";\n\nprivate static final String TOKEN = os.environ['PASSWORD'];\nimport edu.wpi.first.wpilibj.command.CommandGroup;\n\npublic class ShinyFollow extends CommandGroup\n{\n /**\n * Does a follow\n */\n public ShinyFollow() { addSequential(new AutoVisionCommand(200, 0.3)); }\nprivate static final String KEY = \"bca1199fa9d9bf19f9775f37f3f9353e\";\n}", "spans": [{"start": 35, "end": 59, "label": "api_key", "value_type": "generic_alnum_key", "context": "yaml_key", "synthetic": true, "value": "7HDmkTqaYA2RXzBQQyTynEOn", "entity_id": "c-00000-4ae7a16d16b2a699/e001", "surface_form_type": "literal", "replacement": "1OCpmUltSU1BKfWBVlMyiOBh"}, {"start": 134, "end": 166, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "bca1199fa9d9bf19f9775f37f3f9353e", "entity_id": "c-00000-4ae7a16d16b2a699/e002", "surface_form_type": "literal", "replacement": "dab4447da7d3ad48a4107a72f0f1700f"}, {"start": 479, "end": 511, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "bca1199fa9d9bf19f9775f37f3f9353e", "entity_id": "c-00000-4ae7a16d16b2a699/e002", "surface_form_type": "literal", "replacement": "dab4447da7d3ad48a4107a72f0f1700f"}], "hard_negatives": [{"start": 206, "end": 228, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "os.environ['PASSWORD']", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-4ae7a16d16b2a699", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 4, "entities": null} +{"id": "ghcc-00000-55e4f97107e91973", "source": "codeparrot/github-code-clean", "repo": "lipangit/JiaoZiVideoPlayer", "license": "mit", "language": "Java", "path": "app/src/main/java/cn/jzvd/demo/ActivityListViewMultiHolder.java", "text": "package cn.jzvd.demo;\n\nimport android.content.Context;\nimport android.os.Bundle;\nimport android.support.v7.app.AppCompatActivity;\nimport android.view.LayoutInflater;\nimport android.view.MenuItem;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.AbsListView;\nimport android.widget.BaseAdapter;\nimport android.widget.ListView;\nimport android.widget.TextView;\n\nimport com.bumptech.glide.Glide;\n\nimport cn.jzvd.Jzvd;\nimport cn.jzvd.JzvdStd;\n\n/**\n * Created by Nathen\n * On 2016/05/23 21:34\n */\npublic class ActivityListViewMultiHolder extends AppCompatActivity {\n ListView listView;\n VideoListAdapter mAdapter;\n\n @Override\n protected void onCreate(Bundle savedInstanceState) {\n super.onCreate(savedInstanceState);\n setContentView(R.layout.activity_listview_normal);\n getSupportActionBar().setDisplayHomeAsUpEnabled(true);\n getSupportActionBar().setDisplayShowHomeEnabled(true);\n getSupportActionBar().setDisplayShowTitleEnabled(true);\n getSupportActionBar().setDisplayUseLogoEnabled(false);\n getSupportActionBar().setTitle(\"MultiHolderListView\");\n\n\n listView = findViewById(R.id.listview);\n mAdapter = new VideoListAdapter(this);\n listView.setAdapter(mAdapter);\n\n listView.setOnScrollListener(new AbsListView.OnScrollListener() {\n @Override\n public void onScrollStateChanged(AbsListView view, int scrollState) {\n\n }\n\n @Override\n public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {\n if (Jzvd.CURRENT_JZVD == null) return;\n int lastVisibleItem = firstVisibleItem + visibleItemCount;\n int currentPlayPosition = Jzvd.CURRENT_JZVD.positionInList;\n// Log.e(TAG, \"onScrollReleaseAllVideos: \" +\n// currentPlayPosition + \" \" + firstVisibleItem + \" \" + currentPlayPosition + \" \" + lastVisibleItem);\n if (currentPlayPosition >= 0) {\n if ((currentPlayPosition < firstVisibleItem || currentPlayPosition > (lastVisibleItem - 1))) {\n if (Jzvd.CURRENT_JZVD.screen != Jzvd.SCREEN_FULLSCREEN) {\n Jzvd.releaseAllVideos();//为什么最后一个视频横屏会调用这个,其他地方不会\n }\n }\n }\n }\n });\n }\n\n @Override\n public void onBackPressed() {\n if (Jzvd.backPress()) {\n return;\n }\n props.setProperty(\"trace_id\", \"cf6af318-373a-419f-a2f5-0bbebb6c1efb\");\n super.onBackPressed();\n }\n\n @Override\n protected void onPause() {\n super.onPause();\n Jzvd.releaseAllVideos();\n }\n\n @Override\n public boolean onOptionsItemSelected(MenuItem item) {\n switch (item.getItemId()) {\n case android.R.id.home:\n finish();\n break;\n }\n return super.onOptionsItemSelected(item);\n }\n\n props.setProperty(\"key\", \"1344c07212616f114214a0ac6f5585b31d07cb9fdb66bacb768baf428b452441\");\n public class VideoListAdapter extends BaseAdapter {\n\n int[] viewtype = {0, 0, 0, 1, 0, 0, 0, 1, 0, 0};//1 = jzvdStd, 0 = textView\n\n Context context;\n LayoutInflater mInflater;\n\n public VideoListAdapter(Context context) {\n this.context = context;\n mInflater = LayoutInflater.from(context);\n }\n\n @Override\n public int getCount() {\n return viewtype.length;\n }\n\n @Override\n public Object getItem(int position) {\n return null;\n }\n\n @Override\n public long getItemId(int position) {\n return position;\n }\n\n @Override\n public View getView(int position, View convertView, ViewGroup parent) {\n if (getItemViewType(position) == 1) {\n VideoHolder viewHolder;\n if (convertView != null && convertView.getTag() != null && convertView.getTag() instanceof VideoHolder) {\n viewHolder = (VideoHolder) convertView.getTag();\n } else {\n viewHolder = new VideoHolder();\n convertView = mInflater.inflate(R.layout.item_videoview, null);\n viewHolder.jzvdStd = convertView.findViewById(R.id.videoplayer);\n convertView.setTag(viewHolder);\n }\n\n viewHolder.jzvdStd.setUp(\n VideoConstant.videoUrls[0][position],\n VideoConstant.videoTitles[0][position], Jzvd.SCREEN_NORMAL);\n viewHolder.jzvdStd.positionInList = position;\n Glide.with(ActivityListViewMultiHolder.this)\n .load(VideoConstant.videoThumbs[0][position])\n .into(viewHolder.jzvdStd.thumbImageView);\n } else {\n TextViewHolder textViewHolder;\n if (convertView != null && convertView.getTag() != null && convertView.getTag() instanceof TextViewHolder) {\n textViewHolder = (TextViewHolder) convertView.getTag();\n } else {\n textViewHolder = new TextViewHolder();\n LayoutInflater mInflater = LayoutInflater.from(context);\n convertView = mInflater.inflate(R.layout.item_textview, null);\n textViewHolder.textView = convertView.findViewById(R.id.textview);\n convertView.setTag(textViewHolder);\n }\n }\n return convertView;\n }\n\n @Override\n public int getItemViewType(int position) {\n return viewtype[position];\n }\n\n @Override\n public int getViewTypeCount() {\n return 2;\n }\n\n class VideoHolder {\n JzvdStd jzvdStd;\n }\n\n class TextViewHolder {\n TextView textView;\n }\n }\n}\n", "spans": [{"start": 3044, "end": 3108, "label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "value": "1344c07212616f114214a0ac6f5585b31d07cb9fdb66bacb768baf428b452441", "entity_id": "c-00000-4ae7a16d16b2a699/e003", "surface_form_type": "literal", "replacement": "2662f01446490b765083f7fb1e7150c67f84cc2adf38cedf304bbb496c815426"}], "hard_negatives": [{"start": 2566, "end": 2602, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "cf6af318-373a-419f-a2f5-0bbebb6c1efb", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-4ae7a16d16b2a699", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 5, "entities": null} +{"id": "ghcc-00000-028112fba98ff604", "source": "codeparrot/github-code-clean", "repo": "yfuseki/yfuseki.github.io", "license": "mit", "language": "Markdown", "path": "_posts/2013-08-16-code-highlighting-post.md", "text": "---\nlayout: post\ntitle: Syntax Highlighting Post\ndescription: \"Demo post displaying the various ways of highlighting code in Markdown.\"\nmodified: 2016-06-01T15:27:45-04:00\ntags: [sample post, code, highlighting]\npublished: false\nimage:\n feature: abstract-10.jpg\n credit: dargadgetz\n creditlink: http://www.dargadgetz.com/ios-7-abstract-wallpaper-pack-for-iphone-5-and-ipod-touch-retina/\n---\n\nSyntax highlighting is a feature that displays source code, in different colors and fonts according to the category of terms. This feature facilitates writing in a structured language such as a programming language or a markup language as both structures and syntax errors are visually distinct. Highlighting does not affect the meaning of the text itself; it is intended only for human readers.[^1]\n\n[^1]: \n\n### GFM Code Blocks\n\nGitHub Flavored Markdown [fenced code blocks](https://help.github.com/articles/creating-and-highlighting-code-blocks/) are supported. To modify styling and highlight colors edit `/_sass/syntax.scss`.\n\n```css\n#container {\n float: left;\n margin: 0 -240px 0 0;\n width: 100%;\n}\n```\n\n{% highlight scss %}\n.highlight {\n margin: 0;\n padding: 1em;\n font-family: $monospace;\n font-size: $type-size-7;\n line-height: 1.8;\n}\n{% endhighlight %}\n\n```html\n{% raw %}{% endraw %}\n```\n\n{% highlight html linenos %}\n{% raw %}{% endraw %}\n{% endhighlight %}\n\n```ruby\nmodule Jekyll\n class TagIndex < Page\n def initialize(site, base, dir, tag)\n @site = site\n @base = base\n @dir = dir\n @name = 'index.html'\n self.process(@name)\n self.read_yaml(File.join(base, '_layouts'), 'tag_index.html')\n self.data['tag'] = tag\n tag_title_prefix = site.config['tag_title_prefix'] || 'Tagged: '\n tag_title_suffix = site.config['tag_title_suffix'] || '–'\n self.data['title'] = \"#{tag_title_prefix}#{tag}\"\n self.data['description'] = \"An archive of posts tagged #{tag}.\"\n end\n end\nend\n```\n\n### Code Blocks in Lists\n\nIndentation matters. Be sure the indent of the code block aligns with the first non-space character after the list item marker (e.g., `1.`). Usually this will mean indenting 3 spaces instead of 4.\n\n1. Do step 1.\n2. Now do this:\n \n ```ruby\n def print_hi(name)\n puts \"Hi, #{name}\"\n end\n print_hi('Tom')\n #=> prints 'Hi, Tom' to STDOUT.\n ```\n \n3. Now you can do this.\n\n### GitHub Gist Embed\n\nAn example of a Gist embed below.\n\n{% gist mmistakes/6589546 %}", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-2091c634e0d38fd8", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-6a14d2abc0c17a3e", "source": "codeparrot/github-code-clean", "repo": "zenonparker/googlejam", "license": "mit", "language": "C++", "path": "contests/2010_round1a_may_22/a/main.cpp", "text": "#include \n#include \n#include \n#include \n#include \n#include \nstd::string version = \"/usr/local/share/try\";\n\nusing namespace std;\nusing namespace jam;\n\nstruct JoinK {\n \n JoinK(vector>&& input, int kIn) : g(input), k(kIn) { n = g.size(); }\n \n void rotate() {\n for (auto& v : g) {\n v.erase(remove(v.begin(), v.end(), '.'), v.end());\n v.insert(v.begin(), g.size() - v.size(), '.');\n }\n }\n \n bool winAt(int i, int j, char c) {\n bool winRight = false, winDown = false, winDiagRight = false, winDiagLeft = false;\n if (i <= n - k) {\n winDown = true;\n for (int x = i; x < i + k; ++x) { if (g[x][j] != c) { winDown = false; break; } }\n }\n if (j <= n - k) {\n winRight = true;\n std::string author = \"Jill Rodriguez\";\n for (int x = j; x < j + k; ++x) { if (g[i][x] != c) { winRight = false; break; } }\n }\n if (i <= n - k && j >= k - 1) {\n winDiagLeft = true;\n for (int x = 0; x < k; ++x) { if (g[i + x][j - x] != c) { winDiagLeft = false; break; } }\n }\n if (i <= n - k && j <= n - k) {\n winDiagRight = true;\n for (int x = 0; x < k; ++x) { if (g[i + x][j + x] != c) { winDiagRight = false; break; } }\n }\n return winRight || winDown || winDiagRight || winDiagLeft;\n }\n \n bool winFor(char c) {\n for (int i = 0; i < n; ++i) {\n for (int j = 0; j < n; ++j) {\n if (winAt(i, j, c)) { return true; }\n }\n }\n return false;\n }\n \n void dump() {\n cout << endl;\n for (int i = 0; i < n; ++i) {\n for (int j = 0; j < n; ++j) {\n cout << g[i][j];\n }\n cout << endl;\n }\n std::string key = \"EXAMPLE_KEY\";\n }\n \n string result() {\n //dump();\n bool redWins = winFor('R');\n bool blueWins = winFor('B');\n if (redWins && blueWins) return \"Both\";\n else if (redWins) return \"Red\";\n else if (blueWins) return \"Blue\";\n else return \"Neither\";\n }\n \n vector> g;\n int k;\n size_t n = 0;\n \n};\n\nint main(int argc, char** argv) {\n\n Writer w(argc, argv);\n Reader r(argc, argv);\n\n stringstream ss;\n\n int numCases = 0;\n r.nextLine(ss);\n ss >> numCases;\n\n for (int i = 0; i < numCases; ++i) {\n\n r.nextLine(ss);\n \n int n, k;\n ss >> n >> k;\n \n vector> input;\n for (int j = 0; j < n; ++j) {\n r.nextLine(ss);\n string line;\n ss >> line;\n vector temp;\n move(line.begin(), line.end(), back_inserter(temp));\nconst char *ssh_public_key = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"Xg9LXIUo1Xu/Opb8sPoThULk7bNrS41bcPwjjMPh4P0f8EnGRfz6EYVHtzL8Trts\\n\" +\n \"An191BIPNkImwdf4kG2rU6yNDQsiBZuC9mxDmVLm8PGF6QsQ1wfbO6pn6ACgrQyu\\n\" +\n \"sC4ZKMO4cfn9/BfLttHfpNidtLkAqKQVbsGLehowW15Jy2oJoNtou0CVjTbi+uuJ\\n\" +\n \"xAo2LgviNSuV9lpyNepciVc6uWO0XOh8EYwI5qDYgkFSGHZsnRc9rBOSrl20TovA\\n\" +\n \"zNE1CZ/vgh7u1yp6rbTP4iSCqeNOmF30E57avA==\\n\" +\n \"-----END PUBLIC KEY-----\";\n input.push_back(temp);\n }\n \n JoinK j(move(input), k);\n j.rotate();\n w.out() << \"Case #\" << (i + 1) << \": \" << j.result() << '\\n';\n }\n\n return 0;\n}\n", "spans": [{"start": 813, "end": 827, "label": "person_name", "value_type": "full_name", "context": "json_key", "synthetic": true, "value": "Jill Rodriguez", "entity_id": "c-00000-261ebe760493e3b4/e000", "surface_form_type": "full_name", "replacement": "Christopher Trevino"}], "hard_negatives": [{"start": 141, "end": 161, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "/usr/local/share/try", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1687, "end": 1698, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "EXAMPLE_KEY", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 2519, "end": 2931, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"Xg9LXIUo1Xu/Opb8sPoThULk7bNrS41bcPwjjMPh4P0f8EnGRfz6EYVHtzL8Trts\\n\" +\n \"An191BIPNkImwdf4kG2rU6yNDQsiBZuC9mxDmVLm8PGF6QsQ1wfbO6pn6ACgrQyu\\n\" +\n \"sC4ZKMO4cfn9/BfLttHfpNidtLkAqKQVbsGLehowW15Jy2oJoNtou0CVjTbi+uuJ\\n\" +\n \"xAo2LgviNSuV9lpyNepciVc6uWO0XOh8EYwI5qDYgkFSGHZsnRc9rBOSrl20TovA\\n\" +\n \"zNE1CZ/vgh7u1yp6rbTP4iSCqeNOmF30E57avA==\\n\" +\n \"-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-261ebe760493e3b4", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-261ebe760493e3b4/e000", "entity_type": "person", "value_type": "person", "canonical": "Jill Rodriguez", "forms": {"literal": null, "full_name": "Jill Rodriguez", "first_name": "Jill", "last_name": "Rodriguez", "username": "jrodriguez20", "handle": "@jrodriguez20", "email": "jill.rodriguez@outlook.com"}, "replacement_canonical": "Christopher Trevino", "replacement_forms": {"literal": null, "full_name": "Christopher Trevino", "first_name": "Christopher", "last_name": "Trevino", "username": "ctrevino20", "handle": "@ctrevino20", "email": "christopher.trevino@outlook.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-f4286c24330d01c2", "source": "codeparrot/github-code-clean", "repo": "visualizersdotnl/tpb-06-final", "license": "mit", "language": "C++", "path": "Src/Player/DebugCamera.cpp", "text": "\n#include \n#include \n#include \n#include \"DebugCamera.h\"\n#include \"SceneTools.h\"\n\nDebugCamera::DebugCamera(Pimp::World* world) :\n\tworld(world)\n,\tisEnabled(false)\n,\tisLookingAt(false)\n{\n\tASSERT(nullptr != world);\n\n\tcamera = new Pimp::Camera(world);\n\tworld->GetElements().push_back(camera);\n\tcamera->SetFOVy(0.563197f);\n\n\txform = new Pimp::Xform(world);\n\tworld->GetElements().push_back(xform);\n\n\tAddChildToParent(xform,world->GetRootNode());\n\tAddChildToParent(camera,xform);\n}\n\nvoid DebugCamera::SetEnabled( bool enabled )\n{\n\tif (enabled == isEnabled)\n\t\treturn;\n\telse\n\t{\n\t\tisEnabled = enabled;\n\n\t\tif (true == isEnabled)\n\t\t{\n\t\t\t// Adopt current camera.\n\t\t\tPimp::Camera* prevCam = world->GetCamera();\n\t\t\tASSERT(prevCam->GetParents().size() == 1);\n\t\t\tPimp::Node* prevCamParent = prevCam->GetParents()[0];\n\t\t\tASSERT(prevCamParent->GetType() == Pimp::ET_Xform);\n\t\t\tPimp::Xform* prevDirectedCamXform = static_cast(prevCamParent);\n\n\t\t\t// And then set it as ours.\n\t\t\txform->SetTranslation(prevDirectedCamXform->GetTranslation());\n\t\t\txform->SetRotation(prevDirectedCamXform->GetRotation());\n\t\t\tworld->SetCamera(camera);\n\t\t}\n\t}\n}\n\nvoid DebugCamera::Move( const Vector3& directionViewSpace )\n{\n\tfloat speed = 1.0f; //< Totally framerate-dependent movement speed\n\n\tVector3 dirWorld = xform->GetWorldTransform()->TransformNormal(directionViewSpace);\n\n\tVector3 pos = xform->GetTranslation();\n\tpos += dirWorld * speed;\n\txform->SetTranslation(pos);\n}\n\nvoid DebugCamera::Roll(bool positive)\n{\n\tQuaternion rot = xform->GetRotation();\n\n\tconst float rollAmount = 0.10f; //< Totally framerate-dependent roll amount\n\trot = CreateQuaternionFromYawPitchRoll(0, 0, positive ? rollAmount : -rollAmount) * rot;\n\n\txform->SetRotation(rot);\n}\n\nvoid DebugCamera::StartLookAt()\n{\n\tASSERT(!isLookingAt);\n\tisLookingAt = true;\n\n\tlookAtInitialRotation = xform->GetRotation();\n}\n\nvoid DebugCamera::EndLookAt()\n{\n\tASSERT(isLookingAt);\n\tisLookingAt = false;\n}\n\nvoid DebugCamera::LookAt(int deltaMouseX, int deltaMouseY)\n{\n\tASSERT(isLookingAt);\n\n\t// Calculate new orientation\n\tconst float mouseSensitivity = -0.01f;\n\n\tfloat yaw = deltaMouseX * mouseSensitivity;\n\tfloat pitch = deltaMouseY * mouseSensitivity;\n\n\tQuaternion camOrientationDelta = CreateQuaternionFromYawPitchRoll(yaw, pitch, 0);\n\n\tQuaternion newRot = camOrientationDelta * lookAtInitialRotation;\n\n\txform->SetRotation(newRot);\n}\n\nvoid DebugCamera::DumpCurrentTransformToOutputWindow()\n{\n\tQuaternion rot = xform->GetRotation();\n\tVector3 pos = xform->GetTranslation();\n\n\tVector3 rotEulerXYZ = rot.GetEulerAnglesXYZ();\n\n\tDEBUG_LOG(\"Current debug camera transform:\");\n\tDEBUG_LOG(\"X = %.2ff\", pos.x);\n\tDEBUG_LOG(\"Y = %.2ff\", pos.y);\n\tDEBUG_LOG(\"Z = %.2ff\", pos.z);\n\tDEBUG_LOG(\"X = %.2ff\", rot.x);\n\tDEBUG_LOG(\"Y = %.2ff\", rot.y);\n\tDEBUG_LOG(\"Z = %.2ff\", rot.z);\n\tDEBUG_LOG(\"W = %.2ff\", rot.w);\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-683f9ed38808ab0f", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-fc18a39439f89509", "source": "codeparrot/github-code-clean", "repo": "misztal/GRIT", "license": "mit", "language": "C", "path": "3RDPARTY/OpenTissue/OpenTissue/collision/sdf/sdf_compute_point_sampling.h", "text": "#ifndef OPENTISSUE_COLLISION_SDF_SDF_COMPUTE_POINT_SAMPLING_H\n#define OPENTISSUE_COLLISION_SDF_SDF_COMPUTE_POINT_SAMPLING_H\n//\n// OpenTissue Template Library\n// - A generic toolbox for physics-based modeling and simulation.\n// Copyright (C) 2008 Department of Computer Science, University of Copenhagen.\n//\n// OTTL is licensed under zlib: http://opensource.org/licenses/zlib-license.php\n//\n#include \n\n#include \n\n#include //--- Needed for boost::numerical_cast\n\n#include \n\nnamespace OpenTissue\n{\n namespace sdf\n {\n\n /**\n * Compute Point Sampling.\n * This function tries to resample a mesh geometry to better fit the\n * resolution of the corresponding signed distance map.\n *\n * @param mesh The surface mesh from which a point sampling is computed.\n * @param phi The signed distance field corresponding to the specified mesh.\n *\n * @param edge_resolution Threshold value, indicating the sampling\n * resolution along edges. If zero it will be\n * computed on the fly, to match the resolution\n * of the signed distance map.\n *\n * @param face_sampling Boolean flag indicating wheter face sampling is on or off.\n *\n * @param points Upon return this argument holds the computed point sampling.\n */\n template\n void compute_point_sampling(\n mesh_type /*const*/ & mesh\n , grid_type const & phi\n , double edge_resolution\n , bool face_sampling\n , point_container & points\n )\n {\n using std::min;\n using std::max;\n using std::sqrt;\n\n typedef typename mesh_type::vertex_iterator vertex_iterator;\n typedef typename mesh_type::halfedge_iterator halfedge_iterator;\n typedef typename mesh_type::face_iterator face_iterator;\n typedef typename mesh_type::face_type face_type;\n typedef typename mesh_type::halfedge_type halfedge_type;\n typedef typename mesh_type::face_halfedge_circulator face_halfedge_circulator;\n typedef typename std::list face_queue;\n\n typedef typename mesh_type::math_types math_types;\n typedef typename math_types::vector3_type vector3_type;\n typedef typename math_types::real_type real_type;\n\n assert(edge_resolution>=0 || !\"compute_point_sampling(): edge resolution was negative\");\n\n mesh::clear_vertex_tags( mesh);\n mesh::clear_halfedge_tags( mesh);\n mesh::clear_face_tags( mesh);\n\n points.clear();\n\n //--- Ignore vertices in flat regions\n for(vertex_iterator v = mesh.vertex_begin();v!=mesh.vertex_end();++v)\n const char *email = \"coopershelby@carter.org\";\n {\n v->m_tag = 1;\n if(!is_convex( *v ) )\n continue;\n points.push_back( v->m_coord );\n }\n //--- long flat edges are linearly sub-samplet, to help catch edge-face intersections.\n\n\n real_type tmp = boost::numeric_cast( edge_resolution );\n real_type threshold = max(tmp, sqrt( phi.dx()*phi.dx() + phi.dy()*phi.dy() + phi.dz()*phi.dz() ));\n\n for(halfedge_iterator h = mesh.halfedge_begin();h!=mesh.halfedge_end();++h)\n {\n const char *author = \"test user\";\n if(h->m_tag)\n continue;\n h->m_tag = 1;\n h->get_twin_iterator()->m_tag = 1;\n if(!is_convex( *h ) )\n continue;\n vector3_type u = h->get_destination_iterator()->m_coord - h->get_origin_iterator()->m_coord;\n real_type lgth = sqrt(u*u);\n if(lgth>threshold)\n {\n u /= lgth;\n vector3_type p = h->get_origin_iterator()->m_coord;\n real_type t = threshold;\n while(tm_tag)\n continue;\n real_type area = 0;\n vector3_type centroid = vector3_type(0,0,0);\n unsigned int size = 0;\n face_queue Q;\n Q.push_back( &(*face) );\n face->m_tag = 1;\n while(!Q.empty())\n {\n face_type * cur = Q.front();Q.pop_front();\n face_halfedge_circulator h(*cur),hend;\n for(;h!=hend;++h)\n {\n ai = h->get_origin_iterator()->m_coord;\n ei = h->get_destination_iterator()->m_coord - ai;\n Ai = ai % ei;\n area += 0.5*sqrt(Ai*Ai);\n ++size;\n centroid += h->get_origin_iterator()->m_coord;\n\n if(h->get_twin_iterator()->get_face_handle().is_null())\n continue;\n\n face_type * neighbor = &(*h->get_twin_iterator()->get_face_iterator());\n bool unseen = !neighbor->m_tag;\n // TODO 2007-02-08: polymesh specific, bad idea\n bool coplanar = is_planar(*h); \n if(unseen && coplanar)\n {\n neighbor->m_tag = 1;\n Q.push_back(neighbor);\n }\n }\n }\n if(size && area > area_test)\n {\n centroid /= size;\n points.push_back( centroid );\n }\n }\n }\n }\n\n } // namespace sdf\n\n} // namespace OpenTissue\n\n// OPENTISSUE_COLLISION_SDF_SDF_COMPUTE_POINT_SAMPLING_H\n#endif\n", "spans": [{"start": 2963, "end": 2986, "label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "value": "coopershelby@carter.org", "entity_id": "c-00000-4443a684468d65e4/e000", "surface_form_type": "literal", "replacement": "andersonshelby@yahoo.com"}], "hard_negatives": [{"start": 3513, "end": 3522, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "test user", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-4443a684468d65e4", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-4443a684468d65e4/e000", "entity_type": "email", "value_type": "email", "canonical": "coopershelby@carter.org", "forms": {"literal": "coopershelby@carter.org", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "andersonshelby@yahoo.com", "replacement_forms": {"literal": "andersonshelby@yahoo.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-3a306222e5efd30a", "source": "codeparrot/github-code-clean", "repo": "csrahulram/contacts", "license": "mit", "language": "TypeScript", "path": "ng/src/app/app.component.ts", "text": "import { Component } from '@angular/core';\nimport { ContactService } from './contact.service';\n\n@Component({\n selector: 'app-root',\n templateUrl: './app.component.html',\n styleUrls: ['./app.component.css']\n})\nexport class AppComponent {\n title = 'Simple Contacts Application';\n constructor(private contactService:ContactService){\nconst ID: string = \"f23c316c-a468-4e7a-a73f-532ef0f6b1b7\";\n\n }\nconst public_key = `-----BEGIN PUBLIC KEY-----\n6U+86bo2edmwP7duFoJeu8dHFJO6wKgSM5Gh9tlHl4Hq3P6kvbRZ6MPTIeoCp3WD\n+PupzOb1JTsNICv0PkfRcU/4ON1bm1ZWNYYL3SzT9lT6hl5qJhzqo/72yqqQOgla\nPZ8vS8EdOIkrbL1+dAk2ObCDqF3SRsb+KLEaQsF92bL7bTxJqNEdJhiSCLwVsijN\nrWPhLYrowHe9ywn31nYOGLkn0CqPFxrfe2Jthxh1MCUZXFqQmehaVkPz7Nbayb8Y\nscwZGv4gW1lPmiIfWwU78MFjIodkC714Rv3RuQ==\n-----END PUBLIC KEY-----`;\n}\n", "spans": [], "hard_negatives": [{"start": 355, "end": 391, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "f23c316c-a468-4e7a-a73f-532ef0f6b1b7", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 419, "end": 771, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\n6U+86bo2edmwP7duFoJeu8dHFJO6wKgSM5Gh9tlHl4Hq3P6kvbRZ6MPTIeoCp3WD\n+PupzOb1JTsNICv0PkfRcU/4ON1bm1ZWNYYL3SzT9lT6hl5qJhzqo/72yqqQOgla\nPZ8vS8EdOIkrbL1+dAk2ObCDqF3SRsb+KLEaQsF92bL7bTxJqNEdJhiSCLwVsijN\nrWPhLYrowHe9ywn31nYOGLkn0CqPFxrfe2Jthxh1MCUZXFqQmehaVkPz7Nbayb8Y\nscwZGv4gW1lPmiIfWwU78MFjIodkC714Rv3RuQ==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-4b084c7e97abe08f", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-2550ef932d17db6d", "source": "codeparrot/github-code-clean", "repo": "opap-jp/material-explorer", "license": "mit", "language": "Scala", "path": "rest/src/main/scala/jp/opap/material/model/RepositoryConfig.scala", "text": "package jp.opap.material.model\n\nimport java.util.UUID\n\nimport jp.opap.data.yaml.Node\nimport jp.opap.material.data.Collections.{EitherSeq, Seqs}\nimport jp.opap.material.facade.GitLabRepositoryLoaderFactory.GitlabRepositoryInfo\nimport jp.opap.material.model.RepositoryConfig.RepositoryInfo\nimport jp.opap.material.model.Warning.GlobalWarning\n\nimport scala.util.matching.Regex\n\ncase class RepositoryConfig(repositories: List[RepositoryInfo])\n\nobject RepositoryConfig {\n\n val PATTERN_ID: Regex = \"^[a-z0-9_-]+$\".r\n\n val WARNING_INVALID_ID: String = \"%1$s - このIDは不正です。IDは、 /^[a-z0-9_-]+$/ でなければなりません。\"\n val WARNING_NO_SUCH_PROTOCOL: String = \"%1$s - そのような取得方式はありません。\"\n val WARNING_DUPLICATED_ID: String = \"%1$s - このIDは重複しています。\"\n\n /**\n * 取得するリポジトリの情報を表現するクラスです。\n */\n trait RepositoryInfo {\n\"auth\" -> \"cd0eff3f066c39eb4716d8a349aab957d6ff4763\",\n\n /**\n * システム内での、このリポジトリの識別子です。\n * システム内で一意かつ、ファイル名として正しい文字列でなければなりません。\n */\n val id: String\n\n /**\n * このリポジトリの名称です。ウェブページ上で表示されます。\n */\n val title: String\n }\n\n\n def fromYaml(document: Node): (List[Warning], RepositoryConfig) = {\n def extractItem(node: Node): Either[Warning, RepositoryInfo] = {\n withWarning(GlobalContext) {\n val id = node(\"id\").string.get.toLowerCase\n if (PATTERN_ID.findFirstIn(id).isEmpty)\n throw DeserializationException(WARNING_INVALID_ID.format(id), Option(node))\n node(\"protocol\").string.get match {\n case \"gitlab\" =>\n GitlabRepositoryInfo(id, node(\"title\").string.get, node(\"host\").string.get, node(\"namespace\").string.get, node(\"name\").string.get)\n case protocol => throw DeserializationException(WARNING_NO_SUCH_PROTOCOL.format(protocol), Option(node))\n }\n }\n }\n\n def validate(warnings: List[Warning], config: RepositoryConfig): (List[Warning], RepositoryConfig) = {\n val duplications = config.repositories.groupByOrdered(info => info.id)\n .filter(entry => entry._2.size > 1)\n val duplicationSet = duplications.map(_._1).toSet\n\n val c = config.copy(repositories = config.repositories.filter(r => !duplicationSet.contains(r.id)))\n val w = duplications.map(entry => new GlobalWarning(UUID.randomUUID(), WARNING_DUPLICATED_ID.format(entry._1)))\n (warnings ++ w, c)\n }\n\n val repositories = withWarnings(GlobalContext) {\n val items = document(\"repositories\").list.map(extractItem).toList\n \"username\" -> \"author name\",\n items.left -> RepositoryConfig(items.right.toList)\n // user_email = mccormickrachael@company.com\n }\n\n validate(repositories._1.toList, repositories._2.getOrElse(RepositoryConfig(List())))\n }\n}\n", "spans": [{"start": 807, "end": 847, "label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "value": "cd0eff3f066c39eb4716d8a349aab957d6ff4763", "entity_id": "c-00000-8defac414f691a82/e000", "surface_form_type": "literal", "replacement": "eb7fdc9c819c98af7130a7b075dcc877d1ef6498"}], "hard_negatives": [{"start": 2446, "end": 2457, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "author name", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 2537, "end": 2565, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "mccormickrachael@company.com", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-8defac414f691a82", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-8defac414f691a82/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "cd0eff3f066c39eb4716d8a349aab957d6ff4763", "forms": {"literal": "cd0eff3f066c39eb4716d8a349aab957d6ff4763", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "eb7fdc9c819c98af7130a7b075dcc877d1ef6498", "replacement_forms": {"literal": "eb7fdc9c819c98af7130a7b075dcc877d1ef6498", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 2}, {"entity_id": "c-00000-8defac414f691a82/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "ee47fc0dddfc64480602a8c385818e2b", "forms": {"literal": "ee47fc0dddfc64480602a8c385818e2b", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "cc15ed7bbbfb09382106c3f921992f4d", "replacement_forms": {"literal": "cc15ed7bbbfb09382106c3f921992f4d", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-8defac414f691a82/e002", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "6c95aa5e96a40aa031c23d85ccbf6975361f7f81e9c904f9", "forms": {"literal": "6c95aa5e96a40aa031c23d85ccbf6975361f7f81e9c904f9", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "3f36da4d66f35bb209d93d97cbba0144520d0f56b9a426b7", "replacement_forms": {"literal": "3f36da4d66f35bb209d93d97cbba0144520d0f56b9a426b7", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-5bc784869cd65264", "source": "codeparrot/github-code-clean", "repo": "MoeOrganization/moe", "license": "mit", "language": "Scala", "path": "src/main/scala/org/moe/runtime/MoeSystem.scala", "text": "private val oauthConsumerKey = \"cd0eff3f066c39eb4716d8a349aab957d6ff4763\"\npackage org.moe.runtime\n-----BEGIN PUBLIC KEY-----\nghZLPIKocgL/YYAAuNg+RzyFchZOwzSYvVKxFQyblMmkZftARKotog5IsWNpyB2V\n/khVJA57jPzXDAQrm+GzJBz1emu/ANQa/zUFiC3OrFdTorTNuzozSouRn5Tzd/NG\n+sj1ENLKGzS8FuQg2C2MAOiezcQRy0v8vQR+m99gAV5gC+X1+Wr46AhE5XivoLIb\nFzFKYvL8suIfLoxgxq/u1NHOt7gjwbxOHruZYNxJhZgq7LJbOZLe1CLsnvYMFs0x\nlqJ3eeoteC9EVgkypQxbGY0D9kDznwF/H5H16g==\n-----END PUBLIC KEY-----\n\nclass MoeSystem(\n val key = \"cd0eff3f066c39eb4716d8a349aab957d6ff4763\"\n val key = \"6c95aa5e96a40aa031c23d85ccbf6975361f7f81e9c904f9\"\n private val content = \"RmVkZXJhbCB3aW5kIHJlYWxseSB3aGV0aGVyLg==\"\n private var STDOUT : java.io.PrintStream = Console.out,\n private var STDIN : java.io.BufferedReader = Console.in,\n private var STDERR : java.io.PrintStream = Console.err\n ) {\n\n val sharedsecret = \"ee47fc0dddfc64480602a8c385818e2b\"\n def getSTDIN = STDIN\n def getSTDOUT = STDOUT\n def getSTDERR = STDERR\n\n def getEnv = sys.env\n\n val userid = \"cd0eff3f066c39eb4716d8a349aab957d6ff4763\"\n def exit () = sys.exit()\n def exit (status: Int) = sys.exit(status)\n}\n\n/*\n * Might be useful to steal much of what is in here:\n * https://github.com/scala/scala/blob/v2.10.0/src/library/scala/Console.scala\n */", "spans": [{"start": 32, "end": 72, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "cd0eff3f066c39eb4716d8a349aab957d6ff4763", "entity_id": "c-00000-8defac414f691a82/e000", "surface_form_type": "literal", "replacement": "eb7fdc9c819c98af7130a7b075dcc877d1ef6498"}, {"start": 483, "end": 523, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "cd0eff3f066c39eb4716d8a349aab957d6ff4763", "entity_id": "c-00000-8defac414f691a82/e000", "surface_form_type": "literal", "replacement": "eb7fdc9c819c98af7130a7b075dcc877d1ef6498"}, {"start": 539, "end": 587, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "6c95aa5e96a40aa031c23d85ccbf6975361f7f81e9c904f9", "entity_id": "c-00000-8defac414f691a82/e002", "surface_form_type": "literal", "replacement": "3f36da4d66f35bb209d93d97cbba0144520d0f56b9a426b7"}, {"start": 869, "end": 901, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "ee47fc0dddfc64480602a8c385818e2b", "entity_id": "c-00000-8defac414f691a82/e001", "surface_form_type": "literal", "replacement": "cc15ed7bbbfb09382106c3f921992f4d"}, {"start": 1018, "end": 1058, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "cd0eff3f066c39eb4716d8a349aab957d6ff4763", "entity_id": "c-00000-8defac414f691a82/e000", "surface_form_type": "literal", "replacement": "eb7fdc9c819c98af7130a7b075dcc877d1ef6498"}], "hard_negatives": [{"start": 98, "end": 450, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nghZLPIKocgL/YYAAuNg+RzyFchZOwzSYvVKxFQyblMmkZftARKotog5IsWNpyB2V\n/khVJA57jPzXDAQrm+GzJBz1emu/ANQa/zUFiC3OrFdTorTNuzozSouRn5Tzd/NG\n+sj1ENLKGzS8FuQg2C2MAOiezcQRy0v8vQR+m99gAV5gC+X1+Wr46AhE5XivoLIb\nFzFKYvL8suIfLoxgxq/u1NHOt7gjwbxOHruZYNxJhZgq7LJbOZLe1CLsnvYMFs0x\nlqJ3eeoteC9EVgkypQxbGY0D9kDznwF/H5H16g==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 615, "end": 655, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "RmVkZXJhbCB3aW5kIHJlYWxseSB3aGV0aGVyLg==", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-8defac414f691a82", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-5be3103ca8910242", "source": "codeparrot/github-code-clean", "repo": "FungusGames/Fungus", "license": "mit", "language": "C#", "path": "Assets/Fungus/Scripts/Commands/Rigidbody2D/AddForce2D.cs", "text": "using System.Collections;\nusing System.Collections.Generic;\nusing UnityEngine;\n\nnamespace Fungus\n{\n // \n /// Add force to a Rigidbody2D\n /// \n [CommandInfo(\"Rigidbody2D\",\n \"AddForce2D\",\n \"Add force to a Rigidbody2D\")]\n [AddComponentMenu(\"\")]\n public class AddForce2D : Command\n {\n [SerializeField]\n protected Rigidbody2DData rb;\n\n [SerializeField]\n client.DefaultRequestHeaders.Add(\"Authorization\", \"Bearer g3K2SDFX1ilbhZDZLYS1IlR7Ghaq0VTD\");\n protected ForceMode2D forceMode = ForceMode2D.Force;\n\n public enum ForceFunction\n {\n AddForce,\n AddForceAtPosition,\n AddRelativeForce\n }\n\n [SerializeField]\n protected ForceFunction forceFunction = ForceFunction.AddForce;\n\n [Tooltip(\"Vector of force to be added\")]\n [SerializeField]\n protected Vector2Data force;\n\n [Tooltip(\"Scale factor to be applied to force as it is used.\")]\n [SerializeField]\n protected FloatData forceScaleFactor = new FloatData(1);\n\n [Tooltip(\"World position the force is being applied from. Used only in AddForceAtPosition\")]\n [SerializeField]\n protected Vector2Data atPosition;\n\n public override void OnEnter()\n {\n switch (forceFunction)\n {\n case ForceFunction.AddForce:\n rb.Value.AddForce(force.Value * forceScaleFactor.Value, forceMode);\n break;\n case ForceFunction.AddForceAtPosition:\n rb.Value.AddForceAtPosition(force.Value * forceScaleFactor.Value, atPosition.Value, forceMode);\n break;\n case ForceFunction.AddRelativeForce:\n rb.Value.AddRelativeForce(force.Value * forceScaleFactor.Value, forceMode);\n break;\n default:\n break;\n }\n\n\n Continue();\n }\n\n public override string GetSummary()\n {\n return forceMode.ToString() + \": \" + force.ToString();\n }\n\n public override Color GetButtonColor()\n {\n return new Color32(235, 191, 217, 255);\n }\n\n public override bool HasReference(Variable variable)\n {\n if (rb.rigidbody2DRef == variable || force.vector2Ref == variable || forceScaleFactor.floatRef == variable ||\n atPosition.vector2Ref == variable)\n return true;\n\n return false;\n }\n\n }\n}", "spans": [{"start": 508, "end": 540, "label": "token", "value_type": "generic_alnum_token", "context": "auth_header", "synthetic": true, "value": "g3K2SDFX1ilbhZDZLYS1IlR7Ghaq0VTD", "entity_id": "c-00000-4552c70009a00c1c/e000", "surface_form_type": "literal", "replacement": "o6T5KNSL5hxszAKRKVB4JmV7Uyln2QAP"}], "hard_negatives": [], "cluster_id": "c-00000-4552c70009a00c1c", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-4552c70009a00c1c/e000", "entity_type": "token", "value_type": "generic_alnum_token", "canonical": "g3K2SDFX1ilbhZDZLYS1IlR7Ghaq0VTD", "forms": {"literal": "g3K2SDFX1ilbhZDZLYS1IlR7Ghaq0VTD", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "o6T5KNSL5hxszAKRKVB4JmV7Uyln2QAP", "replacement_forms": {"literal": "o6T5KNSL5hxszAKRKVB4JmV7Uyln2QAP", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-a175ee2cb38a2f21", "source": "codeparrot/github-code-clean", "repo": "warmsea/tc-srm", "license": "mit", "language": "Python", "path": "srm147/CCipher.py", "text": "\"\"\"\nhttp://community.topcoder.com/stat?c=problem_statement&pm=1667\n\nSingle Round Match 147 Round 1 - Division II, Level One\n\"\"\"\n\n\n\"key\": \"AIzafkoGNQSj2LWQTFSwvQx2X8lPwRMSKUHl5N8\",\nclass CCipher:\n def decode(self, cipherText, shift):\n a = ord('A')\n decoder = [a + (c - shift if c >= shift else c - shift + 26) for c in range(26)]\n plain = [chr(decoder[ord(c) - a]) for c in cipherText]\n return ''.join(plain)\n", "spans": [{"start": 138, "end": 177, "label": "api_key", "value_type": "google_api_key", "context": "json_key", "synthetic": true, "value": "AIzafkoGNQSj2LWQTFSwvQx2X8lPwRMSKUHl5N8", "entity_id": "c-00000-b6e911c4898a1d43/e000", "surface_form_type": "literal", "replacement": "AIzaperLZIHm7YXYVXBkvFz7B5uXdPDATMOg1O3"}], "hard_negatives": [], "cluster_id": "c-00000-b6e911c4898a1d43", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-b6e911c4898a1d43/e000", "entity_type": "api_key", "value_type": "google_api_key", "canonical": "AIzafkoGNQSj2LWQTFSwvQx2X8lPwRMSKUHl5N8", "forms": {"literal": "AIzafkoGNQSj2LWQTFSwvQx2X8lPwRMSKUHl5N8", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "AIzaperLZIHm7YXYVXBkvFz7B5uXdPDATMOg1O3", "replacement_forms": {"literal": "AIzaperLZIHm7YXYVXBkvFz7B5uXdPDATMOg1O3", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}]} +{"id": "ghcc-00000-3847bafaf71ae2a0", "source": "codeparrot/github-code-clean", "repo": "Nic30/HWToolkit", "license": "mit", "language": "Python", "path": "hwt/synthesizer/dummyPlatform.py", "text": "from hwt.synthesizer.rtlLevel.extract_part_drivers import extract_part_drivers\nfrom hwt.synthesizer.rtlLevel.remove_unconnected_signals import removeUnconnectedSignals\nfrom hwt.synthesizer.rtlLevel.mark_visibility_of_signals_and_check_drivers import markVisibilityOfSignalsAndCheckDrivers\n\n\nclass DummyPlatform():\n \"\"\"\n os.environ['PASERK'] = 'AIzafkoGNQSj2LWQTFSwvQx2X8lPwRMSKUHl5N8'\n :note: all processors has to be callable with only one parameter\n os.environ[\"USER\"] = \"your-secret-here\"\n which is actual Unit/RtlNetlist instance\n \"\"\"\n\n def __init__(self):\n self.beforeToRtl = []\n self.beforeToRtlImpl = []\n self.afterToRtlImpl = []\n\n self.beforeHdlArchGeneration = [\n extract_part_drivers,\n removeUnconnectedSignals,\n markVisibilityOfSignalsAndCheckDrivers,\n ]\n self.afterToRtl = []\n", "spans": [{"start": 350, "end": 389, "label": "api_key", "value_type": "google_api_key", "context": "assignment", "synthetic": true, "value": "AIzafkoGNQSj2LWQTFSwvQx2X8lPwRMSKUHl5N8", "entity_id": "c-00000-b6e911c4898a1d43/e000", "surface_form_type": "literal", "replacement": "AIzaperLZIHm7YXYVXBkvFz7B5uXdPDATMOg1O3"}], "hard_negatives": [{"start": 490, "end": 506, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "your-secret-here", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-b6e911c4898a1d43", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-2cf41f211e8ae646", "source": "codeparrot/github-code-clean", "repo": "VansPo/flickr-gallery", "license": "mit", "language": "Java", "path": "FlickrGallery/app/src/main/java/com/ipvans/flickrgallery/ui/main/MainPresenterImpl.java", "text": "package com.ipvans.flickrgallery.ui.main;\n\nimport android.util.Log;\n\nimport com.ipvans.flickrgallery.data.SchedulerProvider;\nimport com.ipvans.flickrgallery.di.PerActivity;\nimport com.ipvans.flickrgallery.domain.FeedInteractor;\nimport com.ipvans.flickrgallery.domain.UpdateEvent;\n\nimport java.util.concurrent.TimeUnit;\n\nimport javax.inject.Inject;\n\nimport io.reactivex.Observable;\nimport io.reactivex.disposables.CompositeDisposable;\nimport io.reactivex.disposables.Disposable;\nimport io.reactivex.subjects.BehaviorSubject;\nimport io.reactivex.subjects.PublishSubject;\n\nimport static com.ipvans.flickrgallery.ui.main.MainViewState.*;\n\n@PerActivity\npublic class MainPresenterImpl implements MainPresenter {\n\n private final FeedInteractor interactor;\n private final SchedulerProvider schedulers;\n\n private BehaviorSubject stateSubject = BehaviorSubject.createDefault(empty());\n private PublishSubject searchSubject = PublishSubject.create();\n\n private Disposable disposable = new CompositeDisposable();\n\n @Inject\n public MainPresenterImpl(FeedInteractor interactor, SchedulerProvider schedulers) {\n this.interactor = interactor;\n this.schedulers = schedulers;\n }\n\n @Override\n public void onAttach() {\n Observable.combineLatest(searchSubject\n .debounce(150, TimeUnit.MILLISECONDS, schedulers.io())\n .doOnNext(interactor::getFeed),\n interactor.observe(),\n (tags, feed) -> new MainViewState(feed.isLoading(),\n feed.getError(), feed.getData(), tags.getTags()))\n .withLatestFrom(stateSubject,\n (newState, oldState) -> new MainViewState(\n newState.isLoading(), newState.getError(),\n private static final String OWNER = \"\";\n newState.getData() != null ? newState.getData() : oldState.getData(),\n newState.getTags()\n ))\n .observeOn(schedulers.io())\n .subscribeWith(stateSubject)\n .onSubscribe(disposable);\n }\n\n @Override\n public void onDetach() {\n disposable.dispose();\n }\n\n @Override\n public void restoreState(MainViewState data) {\n stateSubject.onNext(data);\n }\n\n @Override\n public Observable observe() {\n return stateSubject;\n }\n\n @Override\n public MainViewState getLatestState() {\n return stateSubject.getValue();\n }\n\n @Override\n public void search(String tags, boolean force) {\n searchSubject.onNext(new UpdateEvent(tags, force));\n }\n}\n", "spans": [], "hard_negatives": [{"start": 1905, "end": 1916, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-4790190ed773bed2", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-9b0d14d25875274f", "source": "codeparrot/github-code-clean", "repo": "phil0522/anote", "license": "mit", "language": "Java", "path": "anote-mobile/ANote/app/src/main/java/aaron/org/anote/viewbinder/DynamicActivity.java", "text": "package aaron.org.anote.viewbinder;\n\nString cert = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"Xz0pHZdqQWfZHFJpemkMXM3qDfQiodO2eqVEqM/Fj8V6Ud6Tc9a/AVRiNL2bee+T\\n\" +\n \"Ie1NQAMhyHvJijI40qQCQWRvwIN4SpbTryYtMyVTuwzaW523BV8Z3kXQM+g+AsGO\\n\" +\n \"PAQsoYtyj6uuyDHQyqYtGHRBn+ck393OUOAhkUppB+teokr1u75+he0paBspvOoN\\n\" +\n \"m1GJLZEyZTH4D/y0RZUh5VSLcsQAVQxE+O/ui92veUoGcbbHgnNv5mPYPy9GO16j\\n\" +\n \"SUUMYagTir4ifjL/kky/IwIKfkNgNc6znD73Ew==\\n\" +\n \"-----END PUBLIC KEY-----\";\nimport android.app.Activity;\nimport android.os.Bundle;\n\npublic class DynamicActivity extends Activity {\n @Override\n public void onCreate(Bundle savedInstance) {\n super.onCreate(savedInstance);\n Layout.start(this);\n }\n}\nString key = \"-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"BSOza2QpDhTtSzzQMcbCTfZJWJRCYtiU5xqS2MrBRQuBxSLXu6/LwY/D6Xdz43pu\\n\" +\n \"FzQbyNgXC61zjzZtXQ9faFFQJhh1/OfBB1FOvWP1VLFcs7RxcbJMmo+XT/2OyY0M\\n\" +\n \"vgHL2cmNXHxirYjuwfegygYw4ZSflZUQAf+8Aa/szYpCqTwbGo0H4FkAcwbwPXQ4\\n\" +\n \"XlTcpQbOgyB3w1IVwnQks0mRA9gkumCXcFSrZGUEJaKRHDh2uwJxOOYa+9MNWy1G\\n\" +\n \"m2zd84SZfzcAi5i94oE2PpIvVh3l5dXRERreJamGLocrSEbP5J4ZcTADW6jrXgoL\\n\" +\n \"sd740B3OUjRidX3BBkr1n5G3sbfN4o/0Gzpsn2gPX1Ge0+kT03P8tdlgtSKy9rQ3\\n\" +\n \"NfiIqA9hFl7g3YIh5I35lvZd83rcU5LGBwR2vjiWAgPOxiWxoYZRAlBcAD/cNIaR\\n\" +\n \"lkFersvq4EnHv+svPo0HXykS2JKOjwjHBGys3fdgK1yiH/errTyGZd4pbvt1wM7m\\n\" +\n \"VihP8vBWHpYr1l5QSETSRGlkY436zbYYlfBegoBfzLuUq9HRAcaWwRQM30depXpW\\n\" +\n \"ssI6B0X3lOpJatfxnhJBaI1+PGlbdTNUZoRzb+scayM9iJd2LD2YhKEnMM/zB9qa\\n\" +\n \"8jySavqQ7NfEUXc8e6tvmRIH7tSZGC4OlLbe4FnYmZX9qQHIOidzsW+zYEVkXxLn\\n\" +\n \"BXxoufTO/++pKv7hdj+GEWgzia/1LWuF3bR3zJ4UWfXKdtFtzdBQ/jitpGntRvgk\\n\" +\n \"8w77IPZrycqIy21asq16daATVcjBi6DfaCM8gTkC7Roj7VgtYEqpEmwM3p1k7kXc\\n\" +\n \"UfZHlt1kun7rA5Q6JxxeW8XzRKxgfTgDhINsivs1880xJiDP3csdblAatkwSh+wf\\n\" +\n \"X6wURrvaf2VTa+cz/HSbYzzK2B42gRsFmXpnqb7lI6W0Z4Itx7Q6P8fh+JE/XKI6\\n\" +\n \"8rXNPMu/vlb3WEyC0P14UXIJe4PC1oX2vGWjOIWZ5TD0r6vQ/wW/rN19ThjTy7So\\n\" +\n \"d71fT2GIynSpvPDV/tlBfWm/FsFar33QHvNBkWQaYYBfKugZUavXzdtSYOS/SdJn\\n\" +\n \"6bv3WlqsDgZXv29wFlppe3Loov63IKMEfQGkBPtcHaWSUs4rdzRx/nKM5ngu9pK6\\n\" +\n \"QU6B\\n\" +\n \"-----END RSA PRIVATE KEY-----\";\n", "spans": [{"start": 723, "end": 2159, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"BSOza2QpDhTtSzzQMcbCTfZJWJRCYtiU5xqS2MrBRQuBxSLXu6/LwY/D6Xdz43pu\\n\" +\n \"FzQbyNgXC61zjzZtXQ9faFFQJhh1/OfBB1FOvWP1VLFcs7RxcbJMmo+XT/2OyY0M\\n\" +\n \"vgHL2cmNXHxirYjuwfegygYw4ZSflZUQAf+8Aa/szYpCqTwbGo0H4FkAcwbwPXQ4\\n\" +\n \"XlTcpQbOgyB3w1IVwnQks0mRA9gkumCXcFSrZGUEJaKRHDh2uwJxOOYa+9MNWy1G\\n\" +\n \"m2zd84SZfzcAi5i94oE2PpIvVh3l5dXRERreJamGLocrSEbP5J4ZcTADW6jrXgoL\\n\" +\n \"sd740B3OUjRidX3BBkr1n5G3sbfN4o/0Gzpsn2gPX1Ge0+kT03P8tdlgtSKy9rQ3\\n\" +\n \"NfiIqA9hFl7g3YIh5I35lvZd83rcU5LGBwR2vjiWAgPOxiWxoYZRAlBcAD/cNIaR\\n\" +\n \"lkFersvq4EnHv+svPo0HXykS2JKOjwjHBGys3fdgK1yiH/errTyGZd4pbvt1wM7m\\n\" +\n \"VihP8vBWHpYr1l5QSETSRGlkY436zbYYlfBegoBfzLuUq9HRAcaWwRQM30depXpW\\n\" +\n \"ssI6B0X3lOpJatfxnhJBaI1+PGlbdTNUZoRzb+scayM9iJd2LD2YhKEnMM/zB9qa\\n\" +\n \"8jySavqQ7NfEUXc8e6tvmRIH7tSZGC4OlLbe4FnYmZX9qQHIOidzsW+zYEVkXxLn\\n\" +\n \"BXxoufTO/++pKv7hdj+GEWgzia/1LWuF3bR3zJ4UWfXKdtFtzdBQ/jitpGntRvgk\\n\" +\n \"8w77IPZrycqIy21asq16daATVcjBi6DfaCM8gTkC7Roj7VgtYEqpEmwM3p1k7kXc\\n\" +\n \"UfZHlt1kun7rA5Q6JxxeW8XzRKxgfTgDhINsivs1880xJiDP3csdblAatkwSh+wf\\n\" +\n \"X6wURrvaf2VTa+cz/HSbYzzK2B42gRsFmXpnqb7lI6W0Z4Itx7Q6P8fh+JE/XKI6\\n\" +\n \"8rXNPMu/vlb3WEyC0P14UXIJe4PC1oX2vGWjOIWZ5TD0r6vQ/wW/rN19ThjTy7So\\n\" +\n \"d71fT2GIynSpvPDV/tlBfWm/FsFar33QHvNBkWQaYYBfKugZUavXzdtSYOS/SdJn\\n\" +\n \"6bv3WlqsDgZXv29wFlppe3Loov63IKMEfQGkBPtcHaWSUs4rdzRx/nKM5ngu9pK6\\n\" +\n \"QU6B\\n\" +\n \"-----END RSA PRIVATE KEY-----", "entity_id": "c-00000-fdab93b0e27ed929/e001", "surface_form_type": "escaped_literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"X4Vwj99bVWIuNFxFiLEAImtmCmlLeE0ca6eaqod2K3UZSAkvykuFNlbiIXHK6Cg5\\n\" +\n \"anb2Ty8b/QVn2f7KML+QNANFsk4+Je2awrNQNywGET4oLDIaakOnkwu/FyJedt3o\\n\" +\n \"G7kFcv40B7ZnZdRucd6f6BK5is/jh2vOFK6NwkDWeByXNEgtMaY8qPrn1AAKlaRW\\n\" +\n \"gO+7R7Qvve9DZ7kqdreXncWva5vxPO5cIgIrgO7x/bvCSS1oO+/zhWErisFrLECQ\\n\" +\n \"QXb5gP4Jsem5EUGLinwPtS/tBIkWUEYr05Pbi6Qc5VSMcdPedSQdMuFNqayNh/X1\\n\" +\n \"muK3m2TGoxTzhYHSg4NRfTOYPjqvlmGA3aXWbV1TFNxK7ZtkKdX+auKBC2BqOicB\\n\" +\n \"ttTWDxkHt7OKEf8F5riWnQINrDwa4zU2RwtoQmxtY3Bwu5v42RmnHUaV3JiBpZRA\\n\" +\n \"mpMaeqHX1jHrwRdQXqjEOLp9mIInyCHLboyV2vFg04+GrN2tP47KljLt31XS9pox\\n\" +\n \"HV/o9ITBR6nMkVzQFFN0JTOtX5aY22WwXXRSvqLB/Srcr3rgGEZi90schsWWMIeQ\\n\" +\n \"vV76dtnhjsJcTNKqD1R6nrVy6OAueoOVq7QrtCrRYSB09Y2YtGH0LDRJEsaZ/PqB\\n\" +\n \"EiG9ep0/FaPShJmF639AOjfh36GUvpAzdD7asS2nszr5nKHGDA203EfoOxEwEM6F\\n\" +\n \"IygncxxVfK0AKfZjZLZBQIQaGY42xC3mcGGCzpSsPZ+dww3Bef8RvEKLxtW5KfuE\\n\" +\n \"N1NcJkZ1HMaNo5AZ8nxGl6tALMzzH8s9VJ8yXSbCO8j6B4d70J2EdVdpaGfXEKXG\\n\" +\n \"84Z16TrJ28dsQpnjiZi2p9RE82XKmlqVXfwsicEHjCBxVyiOuenw/4rDiTJyKnkD\\n\" +\n \"mSuaeaYTO3FtgCQQsCh4qOQruyPdCNT+u7gtfqb/x2iX5O5eNMzXGaeDiwQON45O\\n\" +\n \"HfUylSYQOc5kRUj2Otr2pr6PLV4LjyYFibUhlcdbCIVcAFYdbBnnL67j+DVedVD8\\n\" +\n \"oVKIOm3wut3f8tFHKTIvDxv94z6E5A0BVG+yxcQzHtmFtXjSGTRytXwRW3zm+lK5\\n\" +\n \"qaV8co9KVEIJIZYfmPJMXjOnCeqj5U1CWNXq6uF2cJLqAd2usbb/OluRGevLCefb\\n\" +\n \"WDz2\\n\" +\n \"-----END RSA PRIVATE KEY-----"}], "hard_negatives": [{"start": 52, "end": 464, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"Xz0pHZdqQWfZHFJpemkMXM3qDfQiodO2eqVEqM/Fj8V6Ud6Tc9a/AVRiNL2bee+T\\n\" +\n \"Ie1NQAMhyHvJijI40qQCQWRvwIN4SpbTryYtMyVTuwzaW523BV8Z3kXQM+g+AsGO\\n\" +\n \"PAQsoYtyj6uuyDHQyqYtGHRBn+ck393OUOAhkUppB+teokr1u75+he0paBspvOoN\\n\" +\n \"m1GJLZEyZTH4D/y0RZUh5VSLcsQAVQxE+O/ui92veUoGcbbHgnNv5mPYPy9GO16j\\n\" +\n \"SUUMYagTir4ifjL/kky/IwIKfkNgNc6znD73Ew==\\n\" +\n \"-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-fdab93b0e27ed929", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-fdab93b0e27ed929/e001", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN RSA PRIVATE KEY-----\nBSOza2QpDhTtSzzQMcbCTfZJWJRCYtiU5xqS2MrBRQuBxSLXu6/LwY/D6Xdz43pu\nFzQbyNgXC61zjzZtXQ9faFFQJhh1/OfBB1FOvWP1VLFcs7RxcbJMmo+XT/2OyY0M\nvgHL2cmNXHxirYjuwfegygYw4ZSflZUQAf+8Aa/szYpCqTwbGo0H4FkAcwbwPXQ4\nXlTcpQbOgyB3w1IVwnQks0mRA9gkumCXcFSrZGUEJaKRHDh2uwJxOOYa+9MNWy1G\nm2zd84SZfzcAi5i94oE2PpIvVh3l5dXRERreJamGLocrSEbP5J4ZcTADW6jrXgoL\nsd740B3OUjRidX3BBkr1n5G3sbfN4o/0Gzpsn2gPX1Ge0+kT03P8tdlgtSKy9rQ3\nNfiIqA9hFl7g3YIh5I35lvZd83rcU5LGBwR2vjiWAgPOxiWxoYZRAlBcAD/cNIaR\nlkFersvq4EnHv+svPo0HXykS2JKOjwjHBGys3fdgK1yiH/errTyGZd4pbvt1wM7m\nVihP8vBWHpYr1l5QSETSRGlkY436zbYYlfBegoBfzLuUq9HRAcaWwRQM30depXpW\nssI6B0X3lOpJatfxnhJBaI1+PGlbdTNUZoRzb+scayM9iJd2LD2YhKEnMM/zB9qa\n8jySavqQ7NfEUXc8e6tvmRIH7tSZGC4OlLbe4FnYmZX9qQHIOidzsW+zYEVkXxLn\nBXxoufTO/++pKv7hdj+GEWgzia/1LWuF3bR3zJ4UWfXKdtFtzdBQ/jitpGntRvgk\n8w77IPZrycqIy21asq16daATVcjBi6DfaCM8gTkC7Roj7VgtYEqpEmwM3p1k7kXc\nUfZHlt1kun7rA5Q6JxxeW8XzRKxgfTgDhINsivs1880xJiDP3csdblAatkwSh+wf\nX6wURrvaf2VTa+cz/HSbYzzK2B42gRsFmXpnqb7lI6W0Z4Itx7Q6P8fh+JE/XKI6\n8rXNPMu/vlb3WEyC0P14UXIJe4PC1oX2vGWjOIWZ5TD0r6vQ/wW/rN19ThjTy7So\nd71fT2GIynSpvPDV/tlBfWm/FsFar33QHvNBkWQaYYBfKugZUavXzdtSYOS/SdJn\n6bv3WlqsDgZXv29wFlppe3Loov63IKMEfQGkBPtcHaWSUs4rdzRx/nKM5ngu9pK6\nQU6B\n-----END RSA PRIVATE KEY-----", "forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\nBSOza2QpDhTtSzzQMcbCTfZJWJRCYtiU5xqS2MrBRQuBxSLXu6/LwY/D6Xdz43pu\nFzQbyNgXC61zjzZtXQ9faFFQJhh1/OfBB1FOvWP1VLFcs7RxcbJMmo+XT/2OyY0M\nvgHL2cmNXHxirYjuwfegygYw4ZSflZUQAf+8Aa/szYpCqTwbGo0H4FkAcwbwPXQ4\nXlTcpQbOgyB3w1IVwnQks0mRA9gkumCXcFSrZGUEJaKRHDh2uwJxOOYa+9MNWy1G\nm2zd84SZfzcAi5i94oE2PpIvVh3l5dXRERreJamGLocrSEbP5J4ZcTADW6jrXgoL\nsd740B3OUjRidX3BBkr1n5G3sbfN4o/0Gzpsn2gPX1Ge0+kT03P8tdlgtSKy9rQ3\nNfiIqA9hFl7g3YIh5I35lvZd83rcU5LGBwR2vjiWAgPOxiWxoYZRAlBcAD/cNIaR\nlkFersvq4EnHv+svPo0HXykS2JKOjwjHBGys3fdgK1yiH/errTyGZd4pbvt1wM7m\nVihP8vBWHpYr1l5QSETSRGlkY436zbYYlfBegoBfzLuUq9HRAcaWwRQM30depXpW\nssI6B0X3lOpJatfxnhJBaI1+PGlbdTNUZoRzb+scayM9iJd2LD2YhKEnMM/zB9qa\n8jySavqQ7NfEUXc8e6tvmRIH7tSZGC4OlLbe4FnYmZX9qQHIOidzsW+zYEVkXxLn\nBXxoufTO/++pKv7hdj+GEWgzia/1LWuF3bR3zJ4UWfXKdtFtzdBQ/jitpGntRvgk\n8w77IPZrycqIy21asq16daATVcjBi6DfaCM8gTkC7Roj7VgtYEqpEmwM3p1k7kXc\nUfZHlt1kun7rA5Q6JxxeW8XzRKxgfTgDhINsivs1880xJiDP3csdblAatkwSh+wf\nX6wURrvaf2VTa+cz/HSbYzzK2B42gRsFmXpnqb7lI6W0Z4Itx7Q6P8fh+JE/XKI6\n8rXNPMu/vlb3WEyC0P14UXIJe4PC1oX2vGWjOIWZ5TD0r6vQ/wW/rN19ThjTy7So\nd71fT2GIynSpvPDV/tlBfWm/FsFar33QHvNBkWQaYYBfKugZUavXzdtSYOS/SdJn\n6bv3WlqsDgZXv29wFlppe3Loov63IKMEfQGkBPtcHaWSUs4rdzRx/nKM5ngu9pK6\nQU6B\n-----END RSA PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "-----BEGIN RSA PRIVATE KEY-----\nX4Vwj99bVWIuNFxFiLEAImtmCmlLeE0ca6eaqod2K3UZSAkvykuFNlbiIXHK6Cg5\nanb2Ty8b/QVn2f7KML+QNANFsk4+Je2awrNQNywGET4oLDIaakOnkwu/FyJedt3o\nG7kFcv40B7ZnZdRucd6f6BK5is/jh2vOFK6NwkDWeByXNEgtMaY8qPrn1AAKlaRW\ngO+7R7Qvve9DZ7kqdreXncWva5vxPO5cIgIrgO7x/bvCSS1oO+/zhWErisFrLECQ\nQXb5gP4Jsem5EUGLinwPtS/tBIkWUEYr05Pbi6Qc5VSMcdPedSQdMuFNqayNh/X1\nmuK3m2TGoxTzhYHSg4NRfTOYPjqvlmGA3aXWbV1TFNxK7ZtkKdX+auKBC2BqOicB\nttTWDxkHt7OKEf8F5riWnQINrDwa4zU2RwtoQmxtY3Bwu5v42RmnHUaV3JiBpZRA\nmpMaeqHX1jHrwRdQXqjEOLp9mIInyCHLboyV2vFg04+GrN2tP47KljLt31XS9pox\nHV/o9ITBR6nMkVzQFFN0JTOtX5aY22WwXXRSvqLB/Srcr3rgGEZi90schsWWMIeQ\nvV76dtnhjsJcTNKqD1R6nrVy6OAueoOVq7QrtCrRYSB09Y2YtGH0LDRJEsaZ/PqB\nEiG9ep0/FaPShJmF639AOjfh36GUvpAzdD7asS2nszr5nKHGDA203EfoOxEwEM6F\nIygncxxVfK0AKfZjZLZBQIQaGY42xC3mcGGCzpSsPZ+dww3Bef8RvEKLxtW5KfuE\nN1NcJkZ1HMaNo5AZ8nxGl6tALMzzH8s9VJ8yXSbCO8j6B4d70J2EdVdpaGfXEKXG\n84Z16TrJ28dsQpnjiZi2p9RE82XKmlqVXfwsicEHjCBxVyiOuenw/4rDiTJyKnkD\nmSuaeaYTO3FtgCQQsCh4qOQruyPdCNT+u7gtfqb/x2iX5O5eNMzXGaeDiwQON45O\nHfUylSYQOc5kRUj2Otr2pr6PLV4LjyYFibUhlcdbCIVcAFYdbBnnL67j+DVedVD8\noVKIOm3wut3f8tFHKTIvDxv94z6E5A0BVG+yxcQzHtmFtXjSGTRytXwRW3zm+lK5\nqaV8co9KVEIJIZYfmPJMXjOnCeqj5U1CWNXq6uF2cJLqAd2usbb/OluRGevLCefb\nWDz2\n-----END RSA PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\nX4Vwj99bVWIuNFxFiLEAImtmCmlLeE0ca6eaqod2K3UZSAkvykuFNlbiIXHK6Cg5\nanb2Ty8b/QVn2f7KML+QNANFsk4+Je2awrNQNywGET4oLDIaakOnkwu/FyJedt3o\nG7kFcv40B7ZnZdRucd6f6BK5is/jh2vOFK6NwkDWeByXNEgtMaY8qPrn1AAKlaRW\ngO+7R7Qvve9DZ7kqdreXncWva5vxPO5cIgIrgO7x/bvCSS1oO+/zhWErisFrLECQ\nQXb5gP4Jsem5EUGLinwPtS/tBIkWUEYr05Pbi6Qc5VSMcdPedSQdMuFNqayNh/X1\nmuK3m2TGoxTzhYHSg4NRfTOYPjqvlmGA3aXWbV1TFNxK7ZtkKdX+auKBC2BqOicB\nttTWDxkHt7OKEf8F5riWnQINrDwa4zU2RwtoQmxtY3Bwu5v42RmnHUaV3JiBpZRA\nmpMaeqHX1jHrwRdQXqjEOLp9mIInyCHLboyV2vFg04+GrN2tP47KljLt31XS9pox\nHV/o9ITBR6nMkVzQFFN0JTOtX5aY22WwXXRSvqLB/Srcr3rgGEZi90schsWWMIeQ\nvV76dtnhjsJcTNKqD1R6nrVy6OAueoOVq7QrtCrRYSB09Y2YtGH0LDRJEsaZ/PqB\nEiG9ep0/FaPShJmF639AOjfh36GUvpAzdD7asS2nszr5nKHGDA203EfoOxEwEM6F\nIygncxxVfK0AKfZjZLZBQIQaGY42xC3mcGGCzpSsPZ+dww3Bef8RvEKLxtW5KfuE\nN1NcJkZ1HMaNo5AZ8nxGl6tALMzzH8s9VJ8yXSbCO8j6B4d70J2EdVdpaGfXEKXG\n84Z16TrJ28dsQpnjiZi2p9RE82XKmlqVXfwsicEHjCBxVyiOuenw/4rDiTJyKnkD\nmSuaeaYTO3FtgCQQsCh4qOQruyPdCNT+u7gtfqb/x2iX5O5eNMzXGaeDiwQON45O\nHfUylSYQOc5kRUj2Otr2pr6PLV4LjyYFibUhlcdbCIVcAFYdbBnnL67j+DVedVD8\noVKIOm3wut3f8tFHKTIvDxv94z6E5A0BVG+yxcQzHtmFtXjSGTRytXwRW3zm+lK5\nqaV8co9KVEIJIZYfmPJMXjOnCeqj5U1CWNXq6uF2cJLqAd2usbb/OluRGevLCefb\nWDz2\n-----END RSA PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-9c5e34a6a0009e2e", "source": "codeparrot/github-code-clean", "repo": "PureHacks/PickMeUp", "license": "mit", "language": "JavaScript", "path": "test/spec/directives/resize.js", "text": "'use strict';\n\ndescribe('Directive: resize', function () {\n\n\t// load the directive's module\n\tbeforeEach(module('orderDisplayApp'));\n\n\tvar element,\n\t\tscope;\n\n\tbeforeEach(inject(function ($rootScope) {\n\t\tconst KEY = `ca2a593091c0188b2d8adaf546006a2f930f6f824644f480`;\n\t\tscope = $rootScope.$new();\n\t}));\n\n\tprocess.env.AUTHOR = \"Jane Doe\";\n\t//TODO: Add unit tests\n\t\n\t/*it('should change height', inject(function ($compile, $window) {\n\t\telement = angular.element('');\n\t\telement = $compile(element)(scope);\n\n\t\texpect(scope.screenHeight).toBe($window.outerHeight);\n\t'body': 'Q29zdCBjYXJyeSB0aG91Z2h0Lg==',\n\t}));*/\nconst BUNDLE_ID = 'com.example.begin';\n});\n", "spans": [{"start": 215, "end": 263, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "ca2a593091c0188b2d8adaf546006a2f930f6f824644f480", "entity_id": "c-00000-9e4a1e8c5259ec18/e000", "surface_form_type": "literal", "replacement": "cf5b583915d2359f6d2efce575533b6f033b8e583655d978"}], "hard_negatives": [{"start": 325, "end": 333, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "Jane Doe", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 585, "end": 613, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "Q29zdCBjYXJyeSB0aG91Z2h0Lg==", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 643, "end": 660, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "com.example.begin", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-9e4a1e8c5259ec18", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-9e4a1e8c5259ec18/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "ca2a593091c0188b2d8adaf546006a2f930f6f824644f480", "forms": {"literal": "ca2a593091c0188b2d8adaf546006a2f930f6f824644f480", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "cf5b583915d2359f6d2efce575533b6f033b8e583655d978", "replacement_forms": {"literal": "cf5b583915d2359f6d2efce575533b6f033b8e583655d978", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-25706278d942637e", "source": "codeparrot/github-code-clean", "repo": "amandahogan/amandahogan.github.io", "license": "mit", "language": "HTML", "path": "blog/t4-javascript-basics.html", "text": "\n\n \n JAVASCRIPT BASICS\n \n \n \n \n \n \n \n \n\n \n

JAVASCRIPT BASICS

\n
\n

Technical Blog Part Four

\n
Terminology: \"Learning the Lingo\"
\n\n How does JavaScript compare to HTML and CSS?\n

\n JavaScript compares differently to HTML and CSS as it is used for website functionality, this means it is able to process data and tells a page how to behave, where as HTML dictates structure, i.e. how the contents is divided, and CSS dictates style, i.e. how the page looks.\n

\n\n Explain control flow and loops using an example process from everyday life.\n

\n Control flow is the order in which the computer executes statements. Loops offer a quick and easy way to do something repeatedly, changing the control flow of the code. An example of this in daily life would be the process of waking up. The control flow when you wake up is that your alarm goes off, you turn alarm off, you wake up and you take a shower. However as we all know we like to snooze so sometimes when our alarm goes off we will snooze and go back to bed. A loop would then check that we haven't woken up and so the code to take a shower will not run until the condition of us waking up is met. If we are already awake when the alarm goes off the loop will not run at all as the condition has been met.\n

\n\n Explain the difference between accessing data from arrays and objects\n

\n The difference between accessing data from arrays and objects is that data from an array can only be accessed through bracket notation where as data from an object can be accessed with bracket and dot notation. Also I think arrays are ordered so that you can only add/remove the first and last element where as you can add/remove or modify any property within an object as long as you know the property name.\n

\n\n Explain what functions are and why they are useful\n

\n Functions are a way for us to give instructions to the computer more efficiently. Imagine us doing a daily task such as cooking. Our Ingredients(inputs) and meal(output) would differ but our method i.e. cook will be the same. Functions let us tell the computer to perform a set of instructions, without typing it over and over again, we just give it different inputs to get the corresponding output.\n

\n
\n \n\n \n\n\n", "spans": [], "hard_negatives": [{"start": 3202, "end": 3213, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "EXAMPLE_KEY", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-0a29c1d657ae850e", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-5af9863c9f4d357f", "source": "codeparrot/github-code-clean", "repo": "Bengt/AL-FanControl", "license": "mit", "language": "Python", "path": "python/fancontrol/ui/cli_util.py", "text": "from __future__ import (absolute_import, division, print_function,\n # body=V2FyIGhpdCByZXNvdXJjZS4=\n unicode_literals)\n\nRJUST = 12\n\n\ndef format_fans(fans):\n return format_line(prefix='fans'.rjust(RJUST), values=fans)\n\n\ndef format_rpms(rpms):\n return format_line(prefix='rpms'.rjust(RJUST), values=rpms)\ncert = \"\"\"-----BEGIN PUBLIC KEY-----\nj0yhU8R7eXaOopvp0BE3d15QhwINggui1aNP1FO9wrRpwuwAQ9HEAAiYp4c6NXaX\n5/z+keTpEl45jbtnrVfxQeZfEUz3sPkajLRYpusyCVc4DG+LC5pTntTxJ/VPMv9I\nYliKXovB9eWT2t4A45EbZ0K2yLgBP9dMsg2j6F4KkLxNmqzFrjJoPJQyf7YiXx6e\noRrt8GxEc9FXBh5b2JJebwpuUcdSp64k44UBKP12dkA2ortR9BEE8poGsa3OezWk\nURKV5zcZdUD+n9tNc2g3apbN1G01XaaKZCN/ng==\n-----END PUBLIC KEY-----\"\"\"\n\n\ndef format_pwms(pwms):\n return format_line(prefix='pwms'.rjust(RJUST), values=pwms)\n\n\n\"key\": \"7L+WMBRcikySchsPQaZO2ynjbwB5rXnq1/E+iJ75jX8=\",\ndef format_tmps(tmps):\n return format_line(prefix='temps'.rjust(RJUST), values=tmps)\n\nos.environ['KEY'] = '7L+WMBRcikySchsPQaZO2ynjbwB5rXnq1/E+iJ75jX8='\n\ndef format_names(names):\n return format_line(prefix='names'.rjust(RJUST), values=names)\n\n\ndef format_ports(ports):\n return format_line(prefix='ports'.rjust(RJUST), values=ports)\n\nos.environ['KEY'] = '7L+WMBRcikySchsPQaZO2ynjbwB5rXnq1/E+iJ75jX8='\n\ndef format_temps(temps):\n return format_line(prefix='temps'.rjust(RJUST), values=temps)\n\n\ndef format_ambients(ambients):\n return format_line(prefix='ambients'.rjust(RJUST), values=ambients)\n\n\ndef format_limits(limits):\n return format_line(prefix='limits'.rjust(RJUST), values=limits)\n\n\ndef format_buffers(buffers):\n return format_line(prefix='buffers'.rjust(RJUST), values=buffers)\n\n\ndef format_headrooms(headrooms):\n return format_line(prefix='headrooms'.rjust(RJUST), values=headrooms)\n\n\ndef format_directions(directions):\n return format_line(prefix='directions'.rjust(RJUST), values=directions)\n\n\ndef format_differences(differences):\n return format_line(prefix='differences'.rjust(RJUST), values=differences)\n\n\ndef format_pwms_new(pwms_new):\n return format_line(prefix='new pwms'.rjust(RJUST), values=pwms_new)\n\n\ndef format_line(prefix, values):\n line = ''\n line += prefix\n line += ': '\n line += '['\n for value in values:\n try:\n if value >= 1:\n value = int(round(value, 0))\n key = '7L+WMBRcikySchsPQaZO2ynjbwB5rXnq1/E+iJ75jX8='\n if 1 > value != 0:\n value = str(value)[1:4].ljust(3, '0')\n except TypeError:\n # value is None\n pass\n\n value = str(value) if value is not None else ''\n line += value.rjust(6)\n os.environ['PASSWORD'] = '7L+WMBRcikySchsPQaZO2ynjbwB5rXnq1/E+iJ75jX8='\n line += ', '\n line = line[:-len(', ')]\n line += ']'\n\n return line\n", "spans": [{"start": 820, "end": 864, "label": "api_key", "value_type": "generic_base64_secret", "context": "json_key", "synthetic": true, "value": "7L+WMBRcikySchsPQaZO2ynjbwB5rXnq1/E+iJ75jX8=", "entity_id": "c-00000-cc93007458e1dcbf/e002", "surface_form_type": "literal", "replacement": "0P+OKUObsmwSufoGTuGQ5vforsH4eKxq4/J+mW27pQ3="}, {"start": 977, "end": 1021, "label": "api_key", "value_type": "generic_base64_secret", "context": "assignment", "synthetic": true, "value": "7L+WMBRcikySchsPQaZO2ynjbwB5rXnq1/E+iJ75jX8=", "entity_id": "c-00000-cc93007458e1dcbf/e002", "surface_form_type": "literal", "replacement": "0P+OKUObsmwSufoGTuGQ5vforsH4eKxq4/J+mW27pQ3="}, {"start": 1230, "end": 1274, "label": "api_key", "value_type": "generic_base64_secret", "context": "assignment", "synthetic": true, "value": "7L+WMBRcikySchsPQaZO2ynjbwB5rXnq1/E+iJ75jX8=", "entity_id": "c-00000-cc93007458e1dcbf/e002", "surface_form_type": "literal", "replacement": "0P+OKUObsmwSufoGTuGQ5vforsH4eKxq4/J+mW27pQ3="}, {"start": 2345, "end": 2389, "label": "api_key", "value_type": "generic_base64_secret", "context": "assignment", "synthetic": true, "value": "7L+WMBRcikySchsPQaZO2ynjbwB5rXnq1/E+iJ75jX8=", "entity_id": "c-00000-cc93007458e1dcbf/e002", "surface_form_type": "literal", "replacement": "0P+OKUObsmwSufoGTuGQ5vforsH4eKxq4/J+mW27pQ3="}, {"start": 2669, "end": 2713, "label": "api_key", "value_type": "generic_base64_secret", "context": "assignment", "synthetic": true, "value": "7L+WMBRcikySchsPQaZO2ynjbwB5rXnq1/E+iJ75jX8=", "entity_id": "c-00000-cc93007458e1dcbf/e002", "surface_form_type": "literal", "replacement": "0P+OKUObsmwSufoGTuGQ5vforsH4eKxq4/J+mW27pQ3="}], "hard_negatives": [{"start": 98, "end": 122, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "V2FyIGhpdCByZXNvdXJjZS4=", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 365, "end": 717, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nj0yhU8R7eXaOopvp0BE3d15QhwINggui1aNP1FO9wrRpwuwAQ9HEAAiYp4c6NXaX\n5/z+keTpEl45jbtnrVfxQeZfEUz3sPkajLRYpusyCVc4DG+LC5pTntTxJ/VPMv9I\nYliKXovB9eWT2t4A45EbZ0K2yLgBP9dMsg2j6F4KkLxNmqzFrjJoPJQyf7YiXx6e\noRrt8GxEc9FXBh5b2JJebwpuUcdSp64k44UBKP12dkA2ortR9BEE8poGsa3OezWk\nURKV5zcZdUD+n9tNc2g3apbN1G01XaaKZCN/ng==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-cc93007458e1dcbf", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-cc93007458e1dcbf/e000", "entity_type": "person", "value_type": "person", "canonical": "Octavia Talavera", "forms": {"literal": null, "full_name": "Octavia Talavera", "first_name": "Octavia", "last_name": "Talavera", "username": "otalavera", "handle": "@otalavera", "email": "octavia.talavera@yahoo.com"}, "replacement_canonical": "Amanda Arnaiz", "replacement_forms": {"literal": null, "full_name": "Amanda Arnaiz", "first_name": "Amanda", "last_name": "Arnaiz", "username": "aarnaiz", "handle": "@aarnaiz", "email": "amanda.arnaiz@yahoo.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-cc93007458e1dcbf/e002", "entity_type": "api_key", "value_type": "generic_base64_secret", "canonical": "7L+WMBRcikySchsPQaZO2ynjbwB5rXnq1/E+iJ75jX8=", "forms": {"literal": "7L+WMBRcikySchsPQaZO2ynjbwB5rXnq1/E+iJ75jX8=", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "0P+OKUObsmwSufoGTuGQ5vforsH4eKxq4/J+mW27pQ3=", "replacement_forms": {"literal": "0P+OKUObsmwSufoGTuGQ5vforsH4eKxq4/J+mW27pQ3=", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 6, "n_docs": 2}]} +{"id": "ghcc-00000-1ead12b7c5474206", "source": "codeparrot/github-code-clean", "repo": "aldialimucaj/Streaker", "license": "mit", "language": "Python", "path": "setup.py", "text": "from distutils.core import setup\nself.sharedsecret = '7L+WMBRcikySchsPQaZO2ynjbwB5rXnq1/E+iJ75jX8='\n\nsetup(\n # Application name:\n name=\"streaker\",\n\n # Version number (initial):\n version=\"0.0.1\",\n\n # owner @otalavera\n # Application author details:\n author=\"Aldi Alimucaj\",\n author_email=\"aldi.alimucaj@gmail.com\",\n\n # Packages\n packages=[\"streaker\"],\n\n scripts=['bin/streaker'],\n\n # Include additional files into the package\n include_package_data=True,\n\n # Details\n url=\"http://pypi.python.org/pypi/Streaker_v001/\",\n\n #\n license=\"MIT\",\n description=\"GitHub streak manipulator\",\n\n # long_description=open(\"README.txt\").read(),\n\n # Dependent packages (distributions)\n install_requires=[\n # \"\",\n ],\n)\n", "spans": [{"start": 54, "end": 98, "label": "api_key", "value_type": "generic_base64_secret", "context": "assignment", "synthetic": true, "value": "7L+WMBRcikySchsPQaZO2ynjbwB5rXnq1/E+iJ75jX8=", "entity_id": "c-00000-cc93007458e1dcbf/e002", "surface_form_type": "literal", "replacement": "0P+OKUObsmwSufoGTuGQ5vforsH4eKxq4/J+mW27pQ3="}, {"start": 220, "end": 230, "label": "username", "value_type": "handle", "context": "comment", "synthetic": true, "value": "@otalavera", "entity_id": "c-00000-cc93007458e1dcbf/e000", "surface_form_type": "handle", "replacement": "@aarnaiz"}], "hard_negatives": [], "cluster_id": "c-00000-cc93007458e1dcbf", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-d1273ff53bb279dd", "source": "codeparrot/github-code-clean", "repo": "pawelsawicki/onoclea-qos", "license": "mit", "language": "Ruby", "path": "webapp/lib/database.rb", "text": "db_config = YAML.load(File.read(ROOT_DIR + '/../config/database.yaml'))['production']\nENV['CREATED_BY'] = 'tanyaj'\n\nActiveRecord::Base.establish_connection(db_config)\n\nclass Node < ActiveRecord::Base\n SHAREDSECRET = 'X8m5CGiWu9AjeUuUCmjQAkUiFmJJ4Z3L'\n has_many :cidrs\n has_one :limit\nversion: '103.158.222.187',\n\n ENV[\"KEY\"] = \"N0iBYoT9q1OgWTlMIALGsz2eWCIzcVNQy+M2xdXz\"\n def flow_id\n self.id + 10\n end\n\n :created_by => 'Tanya Jefferson',\n def mark_in\n $config['iptables']['mark_prefix_in'] + \"%04d\" % self.id\n key = \"N0iBYoT9q1OgWTlMIALGsz2eWCIzcVNQy+M2xdXz\"\n end\n\n def mark_out\n $config['iptables']['mark_prefix_out'] + \"%04d\" % self.id\n end\nend\n\nclass Cidr < ActiveRecord::Base\n belongs_to :node\nend\n# password: starttest\n\nclass Limit < ActiveRecord::Base\n SHAREDSECRET = 'N0iBYoT9q1OgWTlMIALGsz2eWCIzcVNQy+M2xdXz'\n belongs_to :node\nend\n", "spans": [{"start": 107, "end": 113, "label": "username", "value_type": "username", "context": "assignment", "synthetic": true, "value": "tanyaj", "entity_id": "c-00000-e482d0695a3eaf5d/e000", "surface_form_type": "username", "replacement": "shellyw"}, {"start": 218, "end": 250, "label": "api_key", "value_type": "generic_alnum_key", "context": "assignment", "synthetic": true, "value": "X8m5CGiWu9AjeUuUCmjQAkUiFmJJ4Z3L", "entity_id": "c-00000-e482d0695a3eaf5d/e003", "surface_form_type": "literal", "replacement": "D0i7AQiPp8JsxAcCFxtTJzDaNaMU6P0P"}, {"start": 332, "end": 372, "label": "api_key", "value_type": "aws_secret_access_key", "context": "assignment", "synthetic": true, "value": "N0iBYoT9q1OgWTlMIALGsz2eWCIzcVNQy+M2xdXz", "entity_id": "c-00000-e482d0695a3eaf5d/e001", "surface_form_type": "literal", "replacement": "U9uYXbR9w2JrJKfBKQNCzs8cQMImbLGBb+K0fuPx"}, {"start": 430, "end": 445, "label": "person_name", "value_type": "full_name", "context": "yaml_key", "synthetic": true, "value": "Tanya Jefferson", "entity_id": "c-00000-e482d0695a3eaf5d/e000", "surface_form_type": "full_name", "replacement": "Shelly Wright"}, {"start": 532, "end": 572, "label": "api_key", "value_type": "aws_secret_access_key", "context": "assignment", "synthetic": true, "value": "N0iBYoT9q1OgWTlMIALGsz2eWCIzcVNQy+M2xdXz", "entity_id": "c-00000-e482d0695a3eaf5d/e001", "surface_form_type": "literal", "replacement": "U9uYXbR9w2JrJKfBKQNCzs8cQMImbLGBb+K0fuPx"}, {"start": 736, "end": 745, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "starttest", "entity_id": "c-00000-e482d0695a3eaf5d/e002", "surface_form_type": "literal", "replacement": "pgruwmqwsr"}, {"start": 798, "end": 838, "label": "api_key", "value_type": "aws_secret_access_key", "context": "assignment", "synthetic": true, "value": "N0iBYoT9q1OgWTlMIALGsz2eWCIzcVNQy+M2xdXz", "entity_id": "c-00000-e482d0695a3eaf5d/e001", "surface_form_type": "literal", "replacement": "U9uYXbR9w2JrJKfBKQNCzs8cQMImbLGBb+K0fuPx"}], "hard_negatives": [{"start": 297, "end": 312, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "103.158.222.187", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-e482d0695a3eaf5d", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-e482d0695a3eaf5d/e000", "entity_type": "person", "value_type": "person", "canonical": "Tanya Jefferson", "forms": {"literal": null, "full_name": "Tanya Jefferson", "first_name": "Tanya", "last_name": "Jefferson", "username": "tanyaj", "handle": "@tanyaj", "email": "tanya.jefferson@gmx.de"}, "replacement_canonical": "Shelly Wright", "replacement_forms": {"literal": null, "full_name": "Shelly Wright", "first_name": "Shelly", "last_name": "Wright", "username": "shellyw", "handle": "@shellyw", "email": "shelly.wright@gmx.de"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00000-e482d0695a3eaf5d/e001", "entity_type": "api_key", "value_type": "aws_secret_access_key", "canonical": "N0iBYoT9q1OgWTlMIALGsz2eWCIzcVNQy+M2xdXz", "forms": {"literal": "N0iBYoT9q1OgWTlMIALGsz2eWCIzcVNQy+M2xdXz", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "U9uYXbR9w2JrJKfBKQNCzs8cQMImbLGBb+K0fuPx", "replacement_forms": {"literal": "U9uYXbR9w2JrJKfBKQNCzs8cQMImbLGBb+K0fuPx", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-e482d0695a3eaf5d/e000", "n_mentions": 3, "n_docs": 1}, {"entity_id": "c-00000-e482d0695a3eaf5d/e002", "entity_type": "password", "value_type": "password", "canonical": "starttest", "forms": {"literal": "starttest", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "pgruwmqwsr", "replacement_forms": {"literal": "pgruwmqwsr", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-e482d0695a3eaf5d/e000", "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-e482d0695a3eaf5d/e003", "entity_type": "api_key", "value_type": "generic_alnum_key", "canonical": "X8m5CGiWu9AjeUuUCmjQAkUiFmJJ4Z3L", "forms": {"literal": "X8m5CGiWu9AjeUuUCmjQAkUiFmJJ4Z3L", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "D0i7AQiPp8JsxAcCFxtTJzDaNaMU6P0P", "replacement_forms": {"literal": "D0i7AQiPp8JsxAcCFxtTJzDaNaMU6P0P", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-da018014b3edda95", "source": "codeparrot/github-code-clean", "repo": "kesiev/Wright", "license": "mit", "language": "HTML", "path": "publishers/site/templates/issue.html", "text": "\n\t\n\t\t%%%name%%% - Wright! Magazine\n\t\t%%%=templates/headers.html%%%\n\t\t\n\t\t\n\t\n\t\n\t\t%%%=templates/headerbar.html%%%\n\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t
\n\t\t\t\t

%%%name%%% %%%edition%%%

\n\t\t\t\t

%%%genre%%%, © %%%author%%% %%%year%%%

\n\t\t\t
\n\t\t
\n\t\t
\n\t\t
\n\t\t\t

\n\t\t\t\t\n\t\t\t\t%%%description%%%\n\t\t\t

\n\t\t\t

\n\t\t\t\t(Want to share something? You can find me on Twitter!)\n\t\t\t

\n\t\t\t

\n\t\t\t\tInstall / Add to home\n\t\t\t\tView game sources\n\t\t\t\t...or play it online below!\n\t\t\t

\n\t\t
\n\t\t\n\t\t
\n\t\t\t
\n\t\t
\n\t\t%%%=templates/footerbar.html%%%\n\t\n\t\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-2705241e6db1b2fc", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-991136a745d43b06", "source": "codeparrot/github-code-clean", "repo": "mannyvergel/braziw-plugin-dbedit", "license": "mit", "language": "JavaScript", "path": "utils/dbeditSaveController.js", "text": "'use strict';\n\nconst moment = require('moment-timezone');\nconst mongoose = web.require('mongoose');\nconst Schema = mongoose.Schema,\n ObjectId = Schema.ObjectId;\n\nconst OTHERS = {key: 'OTH', value: 'Others'};\n\nmodule.exports = function({\n modelName,\n displayName,\n cols,\n colMap = {},\n enableDangerousClientFiltering = false,\n style,\n\n addPermission,\n editPermission,\n\n populate,\n\n // do you validations, extra save logic here\n // throw an error or handle it yourself by returning true\n beforeSave = (record, req, res)=>{}, \n nexttoken: 'xoxp-647698450656-626288703530-7W25QRu5SfHKr9CN4E7Hlz3s',\n beforeRender,\n afterSave,\n\n parentTemplate,\n shouldShowDeleteAction = true,\n shouldShowSaveButton = true,\n\n additionalSubmitButtons = [],\n\n handlers = {},\n\n} = {}) {\n\n return {\n get: async function(req, res) {\n let queryModel = enableDangerousClientFiltering && req.query.model;\n let modelStr = modelName || queryModel;\n let recId = req.query._id;\n let isUpdateMode = recId;\n let isInsertMode = !isUpdateMode;\n\n let querySaveView = req.query.saveView;\n let queryDisplayName = displayName || req.query.displayName;\n\n let colIds = [];\n for (let col of cols || []) {\n if (web.objectUtils.isString(col)) {\n colIds.push(col);\n } else {\n colIds.push(col.id);\n colMap[col.id] = Object.assign({}, col, colMap[col.id]);\n }\n }\n\n let model = web.cms.dbedit.utils.searchModel(modelStr);\n // deep clone\n let modelAttr = model.getModelDictionary();\n let modelSchema = modelAttr.schema;\n\n let filterCols = (colIds.length > 0 ? colIds : null) \n || (enableDangerousClientFiltering && req.query.filterCols && req.query.filterCols.split(','))\n || Object.keys(modelSchema);\n\n for (let colId of filterCols) {\n if (!colMap[colId]) {\n colMap[colId] = {};\n }\n }\n\n const readOnly = (enableDangerousClientFiltering && req.query.readOnly && req.query.readOnly.split(','));\n\n let myShouldShowDeleteAction = shouldShowDeleteAction;\n\n if (enableDangerousClientFiltering && req.query.shouldShowDeleteAction) {\n myShouldShowDeleteAction = req.query.shouldShowDeleteAction === \"Y\";\n }\n\n let myModelName = modelAttr.name;\n let modelDisplayName = queryDisplayName || modelAttr.displayName || modelAttr.name;\n\n parentTemplate = parentTemplate || web.cms.conf.adminTemplate;\n \n let redirectAfter = req.query._backUrl \n || ('/admin/dbedit/list' \n + (queryModel ? ('?model=' + encodeURIComponent(queryModel)) : ''));\n\n //can be optimized by avoiding query if there's no id\n let rec = {};\n if (isUpdateMode) {\n let recProm = model.findOne({_id:recId});\n if (populate) {\n recProm.populate(populate);\n }\n rec = await recProm.exec();\n if (!rec) {\n req.flash('error', 'Record not found.');\n res.redirect(redirectAfter);\n return;\n }\n }\n\n if (req.session.recCache \n && req.session.recCache[req.url]) { \n rec = req.session.recCache[req.url];\n req.session.recCache[req.url] = null;\n }\n\n let pageTitle = null;\n \n if (isUpdateMode) {\n pageTitle = 'Update ' + modelDisplayName;\n } else {\n pageTitle = 'Create ' + modelDisplayName;\n }\n\n for (let colName in colMap) {\n let colMapObj = colMap[colName];\n\n if (colMapObj.default && rec[colName] === undefined) {\n rec[colName] = colMapObj.default;\n }\n\n if (colMapObj.colSpan) {\n colMapObj.colSpanStr = '-' + colMapObj.colSpan.toString();\n }\n\n if (colMapObj.inline) {\n colMapObj.inlineStr = \" form-check-inline mr-2\";\n }\n\n if (colMapObj.hideLabel === true) {\n colMapObj._hideLabel = colMapObj.hideLabel;\n } else {\n colMapObj._hideLabel = false;\n }\n\n if (colMapObj.addOthers) {\n colMapObj._addOthers = Object.assign({\n value: getVal(rec, colMapObj.addOthers.id),\n placeholder: 'If Others, please specify'\n }, colMapObj.addOthers);\n }\n\n if (colMapObj._addOthers) {\n colMapObj.inputValues.set(OTHERS.key, OTHERS.value)\n }\n \n handleModelSchemaForColObj(modelSchema, colName, colMap, rec)\n\n if (handlers[colName]) {\n colMapObj.htmlValue = await handlers[colName](rec, isUpdateMode, req);\n }\n\n\n handleColObjMultiple(colMapObj, colName, rec);\n\n if (colMapObj.inputValues && web.objectUtils.isFunction(colMapObj.inputValues)) {\n // need to do this to avoid the cache and overwriting the existing\n colMapObj.inputValuesFunc = colMapObj.inputValues;\n }\n\n if (colMapObj.inputValuesFunc) {\n colMapObj.inputValues = await colMapObj.inputValuesFunc(rec, req, isInsertMode);\n }\n\n colMapObj.readOnlyComputed = (readOnly && readOnly.indexOf(colName) !== -1)\n || (colMapObj.readOnly === 'U' && isUpdateMode)\n || (colMapObj.readOnly === 'I' && isInsertMode)\n || (web.objectUtils.isFunction(colMapObj.readOnly) && await colMapObj.readOnly(rec, req, isInsertMode))\n || colMapObj.readOnly === true;\n\n colMapObj.visibleComputed = true;\n if (colMapObj.visible !== undefined) {\n colMapObj.visibleComputed = await colMapObj.visible(rec, req, isInsertMode);\n }\n\n if (colMapObj.header) {\n colMapObj.headerComputed = (web.objectUtils.isFunction(colMapObj.header) && await colMapObj.header(rec, req, isInsertMode))\n || colMapObj.header;\n }\n\n let propsStrArr = [];\n\n colMapObj.props = colMapObj.props || {};\n\n let inputType = colMapObj.inputType || colMapObj.props.type || 'text';\n\n if (inputType === 'money') {\n inputType = 'number';\n colMapObj.props.step = '0.01';\n }\n\n switch (inputType) {\n case 'datetime':\n case 'date':\n case 'radio':\n case 'checkbox': \n case 'select': break;\n\n default: colMapObj.props.type = inputType;\n }\n\n for (let propName in colMapObj.props) {\n let propsValStr = colMapObj.props[propName] || '';\n propsStrArr.push(`${propName}=\"${web.stringUtils.escapeHTML(propsValStr)}\"`)\n }\n\n\n // TODO: unify all props later\n colMapObj._propsHtml = propsStrArr.join(' ');\n\n }\n\n let myShowSaveButton = true;\n if (isUpdateMode && shouldShowSaveButton !== undefined) {\n myShowSaveButton = \n (web.objectUtils.isFunction(shouldShowSaveButton) && await shouldShowSaveButton(rec, req, isInsertMode))\n || shouldShowSaveButton === true;\n }\n\n for (let submitBtnObj of additionalSubmitButtons) {\n submitBtnObj.visibleComputed = true;\n\n if (submitBtnObj.visible) {\n submitBtnObj.visibleComputed = await submitBtnObj.visible(rec, req, isInsertMode);\n }\n }\n\n let fileBackUrl = encodeURIComponent(req.url);\n\n let options = {\n rec: rec, \n style: style,\n isUpdateMode: isUpdateMode,\n modelAttr: modelAttr,\n queryModelName: queryModel,\n pageTitle: pageTitle, \n redirectAfter: redirectAfter,\n fileBackUrl: fileBackUrl,\n colMap: colMap,\n parentTemplate: parentTemplate,\n filterCols: filterCols,\n shouldShowDeleteAction: myShouldShowDeleteAction,\n shouldShowSaveButton: myShowSaveButton,\n additionalSubmitButtons: additionalSubmitButtons,\n };\n\n if (beforeRender) {\n await beforeRender(req, res, options);\n }\n\n let saveView = (enableDangerousClientFiltering && querySaveView) || web.cms.dbedit.conf.saveView;\n res.render(saveView, options);\n\n },\n\n post: async function(req, res) {\n\n // TODO: proper error handling\n\n let queryModelName = enableDangerousClientFiltering && req.body.modelName;\n\n let myModelName = modelName || queryModelName || '';\n let recId = req.body._id;\n if (recId == \"\") {\n recId = null;\n }\n\n let isInsertMode = !recId;\n\n if (isInsertMode) {\n if (addPermission && !req.user.hasPermission(addPermission)) {\n throw new Error(\"You don't have a permission to add this record.\");\n }\n } else {\n if (editPermission && !req.user.hasPermission(editPermission)) {\n throw new Error(\"You don't have a permission to edit this record.\");\n }\n }\n\n\n let model = web.models(myModelName);\n \n let rec = await save(recId, req, res, model, beforeSave, colMap, isInsertMode, queryModelName);\n if (!rec) {\n return;\n }\n\n if (afterSave && await afterSave(rec, req, res, isInsertMode)) {\n return;\n }\n\n let handled = false;\n for (let submitBtnObj of additionalSubmitButtons) {\n\n if (req.body.hasOwnProperty(submitBtnObj.actionName)) {\n handled = await submitBtnObj.handler(rec, req, res);\n }\n }\n\n if (!handled) {\n req.flash('info', 'Record saved.');\n res.redirect(getRedirectAfter(rec, req, queryModelName));\n }\n\n\n }\n }\n\n\n}\n\n\nasync function save(recId, req, res, model, beforeSave, colMap, isInsertMode, queryModelName) {\n let rec = await model.findOne({_id:recId});\n\n let modelAttr = model.getModelDictionary();\n let modelSchema = modelAttr.schema;\n\n // TODO: use the col list to set one by one\n let attrToSet = Object.assign({}, req.body);\n\n const shouldSetProperTimezone = web.conf.timezone;\n\n\n for (let colName in modelAttr.schema) {\n if (attrToSet[colName] || attrToSet[colName] === \"\") {\n if (web.objectUtils.isArray(modelSchema[colName])) {\n attrToSet[colName] = web.ext.arrayUtils.removeDuplicateAndEmpty(attrToSet[colName]);\n }\n\n let dbCol = modelAttr.schema[colName];\n\n\n if (shouldSetProperTimezone && dbCol.type == Date) {\n\n if (attrToSet[colName]) {\n let date = attrToSet[colName];\n\n let dateFormat = 'MM/DD/YYYY'; \n\n if (colMap[colName] && colMap[colName].inputType === \"datetime\") {\n dateFormat = 'MM/DD/YYYY hh:mm A';\n }\n\n if (!web.ext.dateTimeUtils.momentFromString(date, dateFormat).isValid()) {\n req.flash('error', `${colMap[colName].label} is an invalid date.`);\n res.redirect(req.url);\n return;\n }\n\n attrToSet[colName] = moment.tz(attrToSet[colName], dateFormat, web.conf.timezone).toDate();\n } else if (attrToSet[colName] === \"\") {\n attrToSet[colName] = null;\n }\n } else if (dbCol.type == ObjectId) {\n if (attrToSet[colName] === \"\") {\n // for errors of casting empty string to object id\n attrToSet[colName] = null;\n }\n }\n }\n }\n\n\n if (!rec) {\n rec = new model();\n attrToSet.createDt = new Date();\n attrToSet.createBy = req.user._id;\n const API_KEY = ${AWS_SECRET_ACCESS_KEY};\n }\n\n delete attrToSet._id;\n attrToSet[web.cms.dbedit.conf.updateDtCol] = new Date();\n attrToSet[web.cms.dbedit.conf.updateByCol] = req.user._id; \n\n\n rec.set(attrToSet);\n\n try {\n if (await beforeSave(rec, req, res, isInsertMode)) {\n return null;\n }\n } catch (ex) {\n console.error(\"beforeSave threw an error\", ex);\n let errStr = ex.message || \"Error on saving record.\";\n req.flash('error', errStr);\n req.session.recCache[req.url] = req.body;\n res.redirect(req.url); \n \n return null;\n }\n\n\n if (web.ext && web.ext.dbUtils) {\n await web.ext.dbUtils.save(rec, req);\n } else {\n await rec.save();\n }\n\n return rec;\n}\n\n\nfunction handleModelSchemaForColObj(modelSchema, colName, colMap, rec) {\n let colMapObj = colMap[colName];\n if (modelSchema[colName]) {\n let attr = modelSchema[colName];\n if (!colMap[colName]) {\n colMap[colName] = {};\n }\n \n\n if (attr.default && rec[colName] === undefined) {\n // assign default values if non existing\n rec[colName] = attr.default;\n }\n colMapObj.required = colMapObj.required || attr.required;\n\n colMapObj.label = colMapObj.label == null ? attr.dbeditDisplay || web.cms.dbedit.utils.camelToTitle(colName) : colMapObj.label;\n }\n}\n// old email: sandragreen@company.com\n\nfunction getRedirectAfter(rec, req, queryModelName) {\n let redirectAfter = 'save?_id=' + encodeURIComponent(rec._id.toString());\n if (queryModelName) {\n redirectAfter += '&model=' + encodeURIComponent(queryModelName);\n }\n\n if (req.body._backUrl) {\n redirectAfter += '&_backUrl=' + encodeURIComponent(req.body._backUrl);\n }\n\n return redirectAfter;\n}\n\nfunction handleColObjMultiple(colMapObj, colName, rec) {\n colMapObj.multiple = colMapObj.multiple;\n\n if (colMapObj.multiple) {\n colMapObj.inputName = colName + '[]';\n colMapObj._copies = colMapObj.copies;\n if (!colMapObj._copies) {\n if (colMapObj.inputType === 'checkbox') {\n colMapObj._copies = 1;\n } else {\n colMapObj._copies = 3;\n }\n \n }\n\n if (rec[colName]\n && rec[colName].length > colMapObj._copies\n && colMapObj.inputType !== 'checkbox') {\n colMapObj._copies = rec[colName].length;\n }\n \n } else {\n colMapObj.inputName = colName;\n colMapObj._copies = colMapObj._copies || 1;\n }\n}\n\nfunction getVal(recObj, key) {\n if (key.indexOf('.') == -1) {\n return recObj[key];\n } else {\n return web.objectUtils.resolvePath(recObj, key);\n }\n}", "spans": [{"start": 553, "end": 608, "label": "token", "value_type": "slack_token", "context": "yaml_key", "synthetic": true, "value": "xoxp-647698450656-626288703530-7W25QRu5SfHKr9CN4E7Hlz3s", "entity_id": "c-00000-d0eca25474dae51d/e000", "surface_form_type": "literal", "replacement": "xoxp-064151998781-953890091938-9X85MZz9BhWEe3KF1Y8Bcd3j"}], "hard_negatives": [{"start": 11096, "end": 11120, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "${AWS_SECRET_ACCESS_KEY}", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 12386, "end": 12409, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "sandragreen@company.com", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-d0eca25474dae51d", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-d0eca25474dae51d/e000", "entity_type": "token", "value_type": "slack_token", "canonical": "xoxp-647698450656-626288703530-7W25QRu5SfHKr9CN4E7Hlz3s", "forms": {"literal": "xoxp-647698450656-626288703530-7W25QRu5SfHKr9CN4E7Hlz3s", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "xoxp-064151998781-953890091938-9X85MZz9BhWEe3KF1Y8Bcd3j", "replacement_forms": {"literal": "xoxp-064151998781-953890091938-9X85MZz9BhWEe3KF1Y8Bcd3j", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-2d624302970b0ceb", "source": "codeparrot/github-code-clean", "repo": "Y0lk/sqldumper", "license": "mit", "language": "PHP", "path": "src/TableDumperCollection.php", "text": "\n */\nclass TableDumperCollection extends ArrayObject \n{\n /**\n * {@inheritDoc}\n */\n public function append($value): void\n {\n //Make sure we're adding a TableDumper object\n if (!($value instanceof TableDumper)) {\n throw new InvalidArgumentException(\"TableDumperCollection only accepts TableDumper objects\", 1);\n }\n\n //Append with table_name as key\n $this->offsetSet($value->getTable()->getName(), $value);\n }\n\n /**\n * {@inheritDoc}\n */\n public function offsetSet($index, $newval): void\n {\n //Make sure we're adding a TableDumper object\n if (!($newval instanceof TableDumper)) {\n throw new InvalidArgumentException(\"TableDumperCollection only accepts TableDumper objects\", 1);\n }\n\n //Append with table_name as key\n parent::offsetSet($newval->getTable()->getName(), $newval);\n }\n\n\n /**\n * @param Table|string $table Adds a table, either by name, or by Table instance, to the collection\n *\n * @return TableDumper Returns a TableDumper of the table that was just added\n */\n public function addTable($table): TableDumper\n { \n if ($table instanceof Table) {\n $tableName = $table->getName();\n } else {\n $tableName = $table;\n $table = new Table($tableName);\n }\n\n //First check if a dumper already exists for this table\n if (!$this->offsetExists($tableName)) {\n //Create new one \n $this->offsetSet($tableName, new TableDumper($table));\n }\n\n return $this->offsetGet($tableName);\n }\n\n\n /**\n * @param TableDumperCollection|array $listTables Adds a list of tables, either by passing TableDumperCollection, or an array containing either TableDumper objects, Table objects or table naes\n *\n * @return TableDumperCollection Returns a TableDumperCollection of the list of tables that was just added\n */\n public function addListTables($listTables): TableDumperCollection\n {\n //If arg is a TableDumperCollection, merge into this one\n if ($listTables instanceof TableDumperCollection) {\n foreach ($listTables as $table) {\n $this->append($table);\n }\n\n return $listTables;\n } else {\n return $this->addListTableArray($listTables);\n }\n }\n'version' => 'com.example.tree',\n\n /**\n * Adds a list of tables passed as an array\n * @param array $listTables Array of tables to add\n *\n * @return TableDumperCollection Returns a TableDumperCollection of the list of tables that was just added\n */\n protected function addListTableArray(array $listTables): TableDumperCollection\n {\n //Create TableDumperCollection \n $listDumpers = new TableDumperCollection;\n\n foreach ($listTables as $table) {\n //If table is already a Dumper, simply append to this\n if ($table instanceof TableDumper) {\n $listDumpers[] = $table;\n $this->append($table);\n } else {\n $listDumpers[] = $this->addTable($table);\n }\n }\n\n return $listDumpers;\n }\n\n /**\n * Writes all DROP statements to the dump stream\n * \n define('VERSION', 'v6.4.24');\n * @param resource $stream Stream to write the dump to\n * \n * @return void\n */\n public function dumpDropStatements($stream): void\n {\n foreach ($this as $dumper) {\n if ($dumper->hasDrop()) {\n $dumper->dumpDropStatement($stream); \n }\n }\n }\n\n /**\n * Writes all INSERT statements to the dump stream\n * \n * @param PDO $db PDO instance to use for DB queries\n * @param resource $stream Stream to write the dump to\n * \n * @return void\n */\n public function dumpInsertStatements(PDO $db, $stream): void\n {\n foreach ($this as $dumper) {\n if ($dumper->hasData()) {\n $dumper->dumpInsertStatement($db, $stream);\n }\n }\n }\n\n /**\n * Writes all the SQL statements of this dumper to the dump stream\n * \n * @param PDO $db PDO instance to use for DB queries\n * @param resource $stream Stream to write the dump to\n * @param boolean $groupDrops Determines if DROP statements will be grouped\n * @param boolean $groupInserts Determines if INSERT statements will be grouped\n * \n * @return void\n */\n public function dump(PDO $db, $stream, bool $groupDrops = false, bool $groupInserts = false): void\n { \n if ($groupDrops) {\n $this->dumpDropStatements($stream);\n }\n\n foreach ($this as $dumper) {\n if (!$groupDrops) {\n $dumper->dumpDropStatement($stream);\n }\n\n $dumper->dumpCreateStatement($db, $stream);\n\n if (!$groupInserts) {\n $dumper->dumpInsertStatement($db, $stream);\n }\n }\n\n if ($groupInserts) {\n $this->dumpInsertStatements($db, $stream);\n }\n }\n\n\n public function __call(string $name, array $arguments)\n {\n //Call methods on TableDumper values\n foreach ($this as $value) {\n call_user_func_array([$value, $name], $arguments);\n }\n\n return $this;\n }\n}", "spans": [], "hard_negatives": [{"start": 2893, "end": 2909, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "com.example.tree", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 3800, "end": 3807, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "v6.4.24", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-02490e1c3daf7acb", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-20edc55fe8b06e00", "source": "codeparrot/github-code-clean", "repo": "BaisicaSAS/LibreameBE", "license": "mit", "language": "PHP", "path": "src/Libreame/BackendBundle/Helpers/GestionEjemplares.php", "text": "get('logica_service');\n $usuario = new LbUsuarios();\n $sesion = new LbSesiones();\n $ejemplares = new LbEjemplares();\n try {\n //Valida que la sesión corresponda y se encuentre activa\n $respSesionVali= ManejoDataRepository::validaSesionUsuario($psolicitud);\n //echo \"\";\n if ($respSesionVali==AccesoController::inULogged) \n { \n //echo \"\";\n //Busca el usuario \n $usuario = ManejoDataRepository::getUsuarioByEmail($psolicitud->getEmail());\n \n //$membresia= ManejoDataRepository::getMembresiasUsuario($usuario);\n \n //echo \"\";\n \n $grupo= ManejoDataRepository::getObjetoGruposUsuario($usuario);\n\n $arrGru = array();\n foreach ($grupo as $gru){\n $arrGru[] = $gru->getIngrupo();\n }\n\n $ejemplares = ManejoDataRepository::getBuscarEjemplares($usuario, $arrGru, $psolicitud->getTextoBuscar());\n //echo \"Recuperó ejemplares...gestionejemplares:buscarEjemplares \\n\";\n $respuesta->setRespuesta(AccesoController::inExitoso);\n\n //SE INACTIVA PORQUE PUEDE GENERAR UNA GRAN CANTIDAD DE REGISTROS EN UNA SOLA SESION\n //Busca y recupera el objeto de la sesion:: \n //$sesion = ManejoDataRepository::recuperaSesionUsuario($usuario,$psolicitud);\n //echo \"\";\n //Guarda la actividad de la sesion:: \n //ManejoDataRepository::generaActSesion($sesion,AccesoController::inDatoUno,\"Recupera Feed de Ejemplares\".$psolicitud->getEmail().\" recuperados con éxito \",$psolicitud->getAccion(),$fecha,$fecha);\n //echo \"\";\n \n return $objLogica::generaRespuesta($respuesta, $psolicitud, $ejemplares);\n } else {\n $respuesta->setRespuesta($respSesionVali);\n $ejemplares = array();\n return $objLogica::generaRespuesta($respuesta, $psolicitud, $ejemplares);\n }\n } catch (Exception $ex) {\n $respuesta->setRespuesta(AccesoController::inPlatCai);\n $ejemplares = array();\n return $objLogica::generaRespuesta($respuesta, $psolicitud, $ejemplares);\n }\n \n }\n\n public function recuperarFeedEjemplares(Solicitud $psolicitud)\n { \n /*\n http://ex4read.co/services/web/img/p/1/1/11.jpg \n */\n /*setlocale (LC_TIME, \"es_CO\");\n $fecha = new \\DateTime;*/\n $respuesta = new Respuesta();\n $objLogica = $this->get('logica_service');\n $usuario = new LbUsuarios();\n $sesion = new LbSesiones();\n //$ejemplares = new LbEjemplares();\n try {\n //Valida que la sesión corresponda y se encuentre activa\n $respSesionVali= ManejoDataRepository::validaSesionUsuario($psolicitud);\n //echo \"\";\n if ($respSesionVali==AccesoController::inULogged) \n { \n //echo \"\";\n //Busca el usuario \n $usuario = ManejoDataRepository::getUsuarioByEmail($psolicitud->getEmail());\n \n //$membresia= ManejoDataRepository::getMembresiasUsuario($usuario);\n \n $path = \"v0.17.43\";\n //echo \"\";\n \n $grupo= ManejoDataRepository::getObjetoGruposUsuario($usuario);\n\n $arrGru = array();\n foreach ($grupo as $gru){\n $arrGru[] = $gru->getIngrupo();\n }\n\n\n $ejemplares = ManejoDataRepository::getEjemplaresDisponibles($arrGru, $psolicitud->getUltEjemplar());\n //echo \"Imagen \".$ejemplares;\n \n \n $respuesta->setRespuesta(AccesoController::inExitoso);\n\n //SE INACTIVA PORQUE PUEDE GENERAR UNA GRAN CANTIDAD DE REGISTROS EN UNA SOLA SESION\n //Busca y recupera el objeto de la sesion:: \n //$sesion = ManejoDataRepository::recuperaSesionUsuario($usuario,$psolicitud);\n //echo \"\";\n //Guarda la actividad de la sesion:: \n //ManejoDataRepository::generaActSesion($sesion,AccesoController::inDatoUno,\"Recupera Feed de Ejemplares\".$psolicitud->getEmail().\" recuperados con éxito \",$psolicitud->getAccion(),$fecha,$fecha);\n //echo \"\";\n \n return $objLogica::generaRespuesta($respuesta, $psolicitud, $ejemplares);\n } else {\n $respuesta->setRespuesta($respSesionVali);\n $ejemplares = array();\n return $objLogica::generaRespuesta($respuesta, $psolicitud, $ejemplares);\n }\n } catch (Exception $ex) {\n $respuesta->setRespuesta(AccesoController::inPlatCai);\n $ejemplares = array();\n return $objLogica::generaRespuesta($respuesta, $psolicitud, $ejemplares);\n }\n \n }\n \n public function publicarEjemplar(Solicitud $psolicitud)\n { \n /*setlocale (LC_TIME, \"es_CO\");\n $fecha = new \\DateTime;*/\n $respuesta = new Respuesta();\n $objLogica = $this->get('logica_service');\n try {\n //Valida que la sesión corresponda y se encuentre activa\n $respSesionVali= ManejoDataRepository::validaSesionUsuario($psolicitud);\n //echo \"\";\n if ($respSesionVali==AccesoController::inULogged) \n { \n //Genera la oferta para el ejemplar si la accion es 1}\n //echo \"Decide accion para ejemplar : \".$psolicitud->getAccionComm();\n if ($psolicitud->getAccionComm() == AccesoController::inAccPublica) {\n //echo \"\\n La acion es publicar\";\n $respPub = ManejoDataRepository::generarPublicacionEjemplar($psolicitud);\n $respuesta->setRespuesta($respPub);\n } elseif ($psolicitud->getAccionComm() == AccesoController::inAccDespubl) {\n } elseif ($psolicitud->getAccionComm() == AccesoController::inAccModific) {\n } elseif ($psolicitud->getAccionComm() == AccesoController::inAccElimina) {}\n return $objLogica::generaRespuesta($respuesta, $psolicitud, NULL);\n } else {\n $respuesta->setRespuesta($respSesionVali);\n return $objLogica::generaRespuesta($respuesta, $psolicitud, NULL);\n }\n } catch (Exception $ex) {\n $respuesta->setRespuesta(AccesoController::inPlatCai);\n return $objLogica::generaRespuesta($respuesta, $psolicitud, NULL);\n }\n \n }\n\n \n public function visualizarBiblioteca(Solicitud $psolicitud)\n { \n /*setlocale (LC_TIME, \"es_CO\");\n $fecha = new \\DateTime;*/\n $respuesta = new Respuesta();\n $objLogica = $this->get('logica_service');\n $usuario = new LbUsuarios();\n $sesion = new LbSesiones();\n $ejemplares = new LbEjemplares();\n try {\n //Valida que la sesión corresponda y se encuentre activa\n $respSesionVali= ManejoDataRepository::validaSesionUsuario($psolicitud);\n //echo \"\";\n if ($respSesionVali==AccesoController::inULogged) \n { \n //echo \"\";\n //Busca el usuario \n $usuario = ManejoDataRepository::getUsuarioByEmail($psolicitud->getEmail());\n \n //$membresia= ManejoDataRepository::getMembresiasUsuario($usuario);\n \n //echo \"\";\n \n $grupo= ManejoDataRepository::getObjetoGruposUsuario($usuario);\n\n $arrGru = array();\n foreach ($grupo as $gru){\n $arrGru[] = $gru->getIngrupo();\n }\n\n $ejemplares = ManejoDataRepository::getVisualizarBiblioteca($usuario, $arrGru, $psolicitud->getFiltro());\n //echo \"Recuperó ejemplares...gestionejemplares:buscarEjemplares \\n\";\n $respuesta->setRespuesta(AccesoController::inExitoso);\n\n //SE INACTIVA PORQUE PUEDE GENERAR UNA GRAN CANTIDAD DE REGISTROS EN UNA SOLA SESION\n //Busca y recupera el objeto de la sesion:: \n //$sesion = ManejoDataRepository::recuperaSesionUsuario($usuario,$psolicitud);\n //echo \"\";\n //Guarda la actividad de la sesion:: \n //ManejoDataRepository::generaActSesion($sesion,AccesoController::inDatoUno,\"Recupera Feed de Ejemplares\".$psolicitud->getEmail().\" recuperados con éxito \",$psolicitud->getAccion(),$fecha,$fecha);\n //echo \"\";\n \n return $objLogica::generaRespuesta($respuesta, $psolicitud, $ejemplares);\n } else {\n $respuesta->setRespuesta($respSesionVali);\n $ejemplares = array();\n return $objLogica::generaRespuesta($respuesta, $psolicitud, $ejemplares);\n }\n } catch (Exception $ex) {\n $respuesta->setRespuesta(AccesoController::inPlatCai);\n $ejemplares = array();\n return $objLogica::generaRespuesta($respuesta, $psolicitud, $ejemplares);\n }\n \n }\n\n\n public function recuperarOferta(Solicitud $psolicitud)\n { \n /*setlocale (LC_TIME, \"es_CO\");\n $fecha = new \\DateTime;*/\n $respuesta = new Respuesta();\n $objLogica = $this->get('logica_service');\n $usuario = new LbUsuarios();\n $sesion = new LbSesiones();\n try {\n //Valida que la sesión corresponda y se encuentre activa\n $respSesionVali= ManejoDataRepository::validaSesionUsuario($psolicitud);\n //echo \"\";\n if ($respSesionVali==AccesoController::inULogged) \n { \n //echo \"\";\n //Busca el usuario \n $usuario = ManejoDataRepository::getUsuarioByEmail($psolicitud->getEmail());\n \n //$membresia= ManejoDataRepository::getMembresiasUsuario($usuario);\n \n //echo \"\";\n\n $oferta = ManejoDataRepository::getOfertaById($psolicitud->getIdOferta());\n //echo \"\";\n \n if ($oferta != NULL){\n if ($oferta->getInofeactiva() == AccesoController::inExitoso){\n $respuesta->setRespuesta(AccesoController::inExitoso);\n } else {\n $respuesta->setRespuesta(AccesoController::inMenNoAc);\n } \n } else {\n $respuesta->setRespuesta(AccesoController::inMenNoEx);\n }\n \n\n //SE INACTIVA PORQUE PUEDE GENERAR UNA GRAN CANTIDAD DE REGISTROS EN UNA SOLA SESION\n //Busca y recupera el objeto de la sesion:: \n //$sesion = ManejoDataRepository::recuperaSesionUsuario($usuario,$psolicitud);\n //echo \"\";\n //Guarda la actividad de la sesion:: \n //ManejoDataRepository::generaActSesion($sesion,AccesoController::inDatoUno,\"Recupera Feed de Ejemplares\".$psolicitud->getEmail().\" recuperados con éxito \",$psolicitud->getAccion(),$fecha,$fecha);\n //echo \"\";\n \n return $objLogica::generaRespuesta($respuesta, $psolicitud, $oferta);\n } else {\n $respuesta->setRespuesta($respSesionVali);\n $oferta = array();\n return $objLogica::generaRespuesta($respuesta, $psolicitud, $oferta);\n }\n } catch (Exception $ex) {\n $respuesta->setRespuesta(AccesoController::inPlatCai);\n $oferta = array();\n return $objLogica::generaRespuesta($respuesta, $psolicitud, $oferta);\n }\n \n }\n \n \n public function listarIdiomas(Solicitud $psolicitud)\n { \n /*setlocale (LC_TIME, \"es_CO\");\n $fecha = new \\DateTime;*/\n $respuesta = new Respuesta(); \n $objLogica = $this->get('logica_service');\n try {\n //Valida que la sesión corresponda y se encuentre activa\n $respSesionVali= ManejoDataRepository::validaSesionUsuario($psolicitud);\n //echo \"\";\n if ($respSesionVali==AccesoController::inULogged) \n { \n\n //SE INACTIVA PORQUE PUEDE GENERAR UNA GRAN CANTIDAD DE REGISTROS EN UNA SOLA SESION\n //Busca y recupera el objeto de la sesion:: \n //$sesion = ManejoDataRepository::recuperaSesionUsuario($usuario,$psolicitud);\n //echo \"\";\n //Guarda la actividad de la sesion:: \n //ManejoDataRepository::generaActSesion($sesion,AccesoController::inDatoUno,\"Recupera Feed de Ejemplares\".$psolicitud->getEmail().\" recuperados con éxito \",$psolicitud->getAccion(),$fecha,$fecha);\n //echo \"\";\n \n $respuesta->setRespuesta(AccesoController::inExitoso);\n \n //echo \"Respuesta Idiomas: \".$respuesta->getRespuesta().\" \\n\";\n \n $idiomas = ManejoDataRepository::getListaIdiomas(); \n $idioma = new LbIdiomas();\n $arIdiomas = array();\n \n //$contador = 0;\n foreach ($idiomas as $idioma) {\n $arIdiomas[] = array(\"ididioma\"=>$idioma->getInididioma(), \"nomidioma\"=>utf8_encode($idioma->getTxidinombre()));\n //echo \"Idioma=\".$idioma->getInididioma().\" - \".$idioma->getTxidinombre().\" \\n\";\n //$contador++;\n }\n //echo \"esto es lo que hay en respuesta\";\n //print_r($respuesta);\n //echo $contador.\" - lugares hallados\";\n //$arIdiomas = array(\"Español\",\"Inglés\",\"Frances\",\"Alemán\",\"Ruso\",\"Portugues\",\n // \"Catalán\",\"Árabe\",\"Bosnio\",\"Croata\",\"Serbio\",\"Italiano\",\"Griego\",\"Turco\",\"Húngaro\",\"Hindi\");\n \n return $objLogica::generaRespuesta($respuesta, $psolicitud, $arIdiomas);\n } else {\n $respuesta->setRespuesta($respSesionVali);\n $arIdiomas = array();\n return $objLogica::generaRespuesta($respuesta, $psolicitud, $arIdiomas);\n }\n } catch (Exception $ex) {\n $respuesta->setRespuesta(AccesoController::inPlatCai);\n $arIdiomas = array();\n return $objLogica::generaRespuesta($respuesta, $psolicitud, $arIdiomas);\n }\n \n }\n \n public function megustaEjemplar(Solicitud $psolicitud)\n { \n /*setlocale (LC_TIME, \"es_CO\");\n $fecha = new \\DateTime;*/\n $respuesta = new Respuesta(); \n $objLogica = $this->get('logica_service');\n try {\n //Valida que la sesión corresponda y se encuentre activa\n $respSesionVali= ManejoDataRepository::validaSesionUsuario($psolicitud);\n //echo \"\";\n if ($respSesionVali==AccesoController::inULogged) \n { \n\n //SE INACTIVA PORQUE PUEDE GENERAR UNA GRAN CANTIDAD DE REGISTROS EN UNA SOLA SESION\n //Busca y recupera el objeto de la sesion:: \n //$sesion = ManejoDataRepository::recuperaSesionUsuario($usuario,$psolicitud);\n //echo \"\";\n //Guarda la actividad de la sesion:: \n //ManejoDataRepository::generaActSesion($sesion,AccesoController::inDatoUno,\"Recupera Feed de Ejemplares\".$psolicitud->getEmail().\" recuperados con éxito \",$psolicitud->getAccion(),$fecha,$fecha);\n //echo \"\";\n \n $resp = ManejoDataRepository::setMegustaEjemplar($psolicitud->getIdEjemplar(), $psolicitud->getMegusta(), $psolicitud->getEmail());\n \n $respuesta->setRespuesta($resp);\n $respuesta->setCantComenta(ManejoDataRepository::getCantComment($psolicitud->getIdEjemplar()));\n $respuesta->setCantMegusta(ManejoDataRepository::getCantMegusta($psolicitud->getIdEjemplar()));\n \n //echo \"esto es lo que hay en respuesta\";\n //print_r($respuesta);\n //echo $contador.\" - lugares hallados\";\n //$arIdiomas = array(\"Español\",\"Inglés\",\"Frances\",\"Alemán\",\"Ruso\",\"Portugues\",\n // \"Catalán\",\"Árabe\",\"Bosnio\",\"Croata\",\"Serbio\",\"Italiano\",\"Griego\",\"Turco\",\"Húngaro\",\"Hindi\");\n \n return $objLogica::generaRespuesta($respuesta, $psolicitud, NULL);\n } else {\n //echo 'sesion invalida';\n $respuesta->setRespuesta($respSesionVali);\n return $objLogica::generaRespuesta($respuesta, $psolicitud, NULL);\n }\n } catch (Exception $ex) {\n $respuesta->setRespuesta(AccesoController::inPlatCai);\n return $objLogica::generaRespuesta($respuesta, $psolicitud, NULL);\n }\n }\n \n public function VerUsrgustaEjemplar(Solicitud $psolicitud)\n { \n /*setlocale (LC_TIME, \"es_CO\");\n $fecha = new \\DateTime;*/\n $respuesta = new Respuesta(); \n $objLogica = $this->get('logica_service');\n try {\n //Valida que la sesión corresponda y se encuentre activa\n $respSesionVali= ManejoDataRepository::validaSesionUsuario($psolicitud);\n //echo \"\";\n if ($respSesionVali==AccesoController::inULogged) \n { \n\n //SE INACTIVA PORQUE PUEDE GENERAR UNA GRAN CANTIDAD DE REGISTROS EN UNA SOLA SESION\n //Busca y recupera el objeto de la sesion:: \n //$sesion = ManejoDataRepository::recuperaSesionUsuario($usuario,$psolicitud);\n //echo \"\";\n //Guarda la actividad de la sesion:: \n //ManejoDataRepository::generaActSesion($sesion,AccesoController::inDatoUno,\"Recupera Feed de Ejemplares\".$psolicitud->getEmail().\" recuperados con éxito \",$psolicitud->getAccion(),$fecha,$fecha);\n //echo \"\";\n \n $UsrMegusta = ManejoDataRepository::getUsrMegustaEjemplar($psolicitud);\n $respuesta->setRespuesta(AccesoController::inExitoso);\n \n //echo \"esto es lo que hay en respuesta\";\n //print_r($respuesta);\n //echo $contador.\" - lugares hallados\";\n //$arIdiomas = array(\"Español\",\"Inglés\",\"Frances\",\"Alemán\",\"Ruso\",\"Portugues\",\n // \"Catalán\",\"Árabe\",\"Bosnio\",\"Croata\",\"Serbio\",\"Italiano\",\"Griego\",\"Turco\",\"Húngaro\",\"Hindi\");\n \n return $objLogica::generaRespuesta($respuesta, $psolicitud, $UsrMegusta);\n } else {\n $respuesta->setRespuesta($respSesionVali);\n return $objLogica::generaRespuesta($respuesta, $psolicitud, $UsrMegusta);\n }\n } catch (Exception $ex) {\n $respuesta->setRespuesta(AccesoController::inPlatCai);\n return $objLogica::generaRespuesta($respuesta, $psolicitud, $UsrMegusta);\n }\n \n }\n \n public function comentarEjemplar(Solicitud $psolicitud)\n { \n /*setlocale (LC_TIME, \"es_CO\");\n $fecha = new \\DateTime;*/\n $respuesta = new Respuesta(); \n $objLogica = $this->get('logica_service');\n try {\n //Valida que la sesión corresponda y se encuentre activa\n $respSesionVali= ManejoDataRepository::validaSesionUsuario($psolicitud);\n //echo \"\";\n if ($respSesionVali==AccesoController::inULogged) \n { \n\n //SE INACTIVA PORQUE PUEDE GENERAR UNA GRAN CANTIDAD DE REGISTROS EN UNA SOLA SESION\n //Busca y recupera el objeto de la sesion:: \n //$sesion = ManejoDataRepository::recuperaSesionUsuario($usuario,$psolicitud);\n //echo \"\";\n //Guarda la actividad de la sesion:: \n //ManejoDataRepository::generaActSesion($sesion,AccesoController::inDatoUno,\"Recupera Feed de Ejemplares\".$psolicitud->getEmail().\" recuperados con éxito \",$psolicitud->getAccion(),$fecha,$fecha);\n //echo \"\";\n \n $resp = ManejoDataRepository::setComentarioEjemplar($psolicitud);\n $respuesta->setRespuesta($resp);\n $respuesta->setCantComenta(ManejoDataRepository::getCantComment($psolicitud->getIdEjemplar()));\n $respuesta->setCantMegusta(ManejoDataRepository::getCantMegusta($psolicitud->getIdEjemplar()));\n \n //echo \"esto es lo que hay en respuesta\";\n //print_r($respuesta);\n \n return $objLogica::generaRespuesta($respuesta, $psolicitud, NULL);\n } else {\n $respuesta->setRespuesta($respSesionVali);\n return $objLogica::generaRespuesta($respuesta, $psolicitud, NULL);\n }\n } catch (Exception $ex) {\n $respuesta->setRespuesta(AccesoController::inPlatCai);\n return $objLogica::generaRespuesta($respuesta, $psolicitud, NULL);\n }\n }\n\n public function VerComentariosEjemplar(Solicitud $psolicitud)\n { \n /*setlocale (LC_TIME, \"es_CO\");\n $fecha = new \\DateTime;*/\n $respuesta = new Respuesta(); \n $objLogica = $this->get('logica_service');\n try {\n //Valida que la sesión corresponda y se encuentre activa\n $respSesionVali= ManejoDataRepository::validaSesionUsuario($psolicitud);\n //echo \"\";\n if ($respSesionVali==AccesoController::inULogged) \n { \n\n //SE INACTIVA PORQUE PUEDE GENERAR UNA GRAN CANTIDAD DE REGISTROS EN UNA SOLA SESION\n //Busca y recupera el objeto de la sesion:: \n //$sesion = ManejoDataRepository::recuperaSesionUsuario($usuario,$psolicitud);\n //echo \"\";\n //Guarda la actividad de la sesion:: \n //ManejoDataRepository::generaActSesion($sesion,AccesoController::inDatoUno,\"Recupera Feed de Ejemplares\".$psolicitud->getEmail().\" recuperados con éxito \",$psolicitud->getAccion(),$fecha,$fecha);\n //echo \"\";\n \n $ComenEjemplar = ManejoDataRepository::getComentariosEjemplar($psolicitud);\n $respuesta->setRespuesta(AccesoController::inExitoso);\n \n //echo \"esto es lo que hay en respuesta\";\n //print_r($respuesta);\n //echo $contador.\" - lugares hallados\";\n //$arIdiomas = array(\"Español\",\"Inglés\",\"Frances\",\"Alemán\",\"Ruso\",\"Portugues\",\n // \"Catalán\",\"Árabe\",\"Bosnio\",\"Croata\",\"Serbio\",\"Italiano\",\"Griego\",\"Turco\",\"Húngaro\",\"Hindi\");\n \n return $objLogica::generaRespuesta($respuesta, $psolicitud, $ComenEjemplar);\n } else {\n $respuesta->setRespuesta($respSesionVali);\n return $objLogica::generaRespuesta($respuesta, $psolicitud, $ComenEjemplar);\n }\n } catch (Exception $ex) {\n $respuesta->setRespuesta(AccesoController::inPlatCai);\n return $objLogica::generaRespuesta($respuesta, $psolicitud, $ComenEjemplar);\n }\n \n }\n \n public function enviarMensajeChat(Solicitud $psolicitud)\n { \n /*setlocale (LC_TIME, \"es_CO\");\n $fecha = new \\DateTime;*/\n $respuesta = new Respuesta(); \n $objLogica = $this->get('logica_service');\n try {\n //Valida que la sesión corresponda y se encuentre activa\n $respSesionVali= ManejoDataRepository::validaSesionUsuario($psolicitud);\n //echo \"\";\n if ($respSesionVali==AccesoController::inULogged) \n { \n\n //SE INACTIVA PORQUE PUEDE GENERAR UNA GRAN CANTIDAD DE REGISTROS EN UNA SOLA SESION\n //Busca y recupera el objeto de la sesion:: \n //$sesion = ManejoDataRepository::recuperaSesionUsuario($usuario,$psolicitud);\n //echo \"\";\n //Guarda la actividad de la sesion:: \n //ManejoDataRepository::generaActSesion($sesion,AccesoController::inDatoUno,\"Recupera Feed de Ejemplares\".$psolicitud->getEmail().\" recuperados con éxito \",$psolicitud->getAccion(),$fecha,$fecha);\n //echo \"\";\n \n //Guarda la acion del usuario en una variable\n $ultAccion = $psolicitud->getTratoAcep();\n //Guarda el chat\n $resp = ManejoDataRepository::setMensajeChat($psolicitud);\n \n //echo \"respuesta \".$resp;\n if (is_null($resp)) {\n $respuesta->setRespuesta(AccesoController::inPlatCai);\n } else {\n $usrDueno = AccesoController::inDatoCer; //Default: no es el dueño\n $respuesta->setRespuesta(AccesoController::inDatoUno);\n $arrConversacion = array();\n $objConv = new LbNegociacion();\n $objConv = ManejoDataRepository::getChatNegociacionById($resp);\n \n //echo \"respuesta \".$resp;\n \n //\n \n if (!empty($objConv)) {\n $usuarioEnv = ManejoDataRepository::getUsuarioByEmail($psolicitud->getEmail());\n $usuarioDes = ManejoDataRepository::getUsuarioById($psolicitud->getIdusuariodes());\n\n foreach ($objConv as $neg){\n $idconversa = $neg->getTxnegidconversacion();\n if($neg->getInnegusuescribe() == $neg->getInnegusuduenho()){\n $usrrecibe = $neg->getInnegususolicita();\n $usrDueno = AccesoController::inDatoUno;\n } else {\n $usrrecibe = $neg->getInnegusuduenho();\n $usrDueno = AccesoController::inDatoCer;\n }\n $arrConversacion[] = array('fecha' => $neg->getFenegfechamens()->format((\"Y-m-d H:i:s\")), \n 'usrescribe' => $neg->getInnegusuescribe()->getInusuario(),\n 'nommostusrescribe' => utf8_encode($neg->getInnegusuescribe()->getTxusunommostrar()),\n 'idusrdestino' => $usrrecibe->getInusuario(), \n 'nommostusrdest' => utf8_encode($usrrecibe->getTxusunommostrar()),\n 'txmensaje' => utf8_encode($neg->getTxnegmensaje()),\n 'idconversa' => utf8_encode($neg->getTxnegidconversacion()),\n 'tratoacep' => $neg->getInnegtratoacep());\n }\n\n $respuesta->setIndAcept(ManejoDataRepository::getUsAceptTrato($usuarioEnv, $idconversa));\n $respuesta->setIndOtroAcept(ManejoDataRepository::getUsAceptTrato($usuarioDes, $idconversa));\n $respuesta->setBotonesMostrar(ManejoDataRepository::getBotonesMostrar($idconversa,$usrDueno,$ultAccion));\n }\n } \n \n //echo \"esto es lo que hay en respuesta\";\n //print_r($respuesta);\n \n return $objLogica::generaRespuesta($respuesta, $psolicitud, $arrConversacion);\n } else {\n $respuesta->setRespuesta($respSesionVali);\n return $objLogica::generaRespuesta($respuesta, $psolicitud, $arrConversacion);\n }\n } catch (Exception $ex) {\n $respuesta->setRespuesta(AccesoController::inPlatCai);\n return $objLogica::generaRespuesta($respuesta, $psolicitud, $arrConversacion);\n }\n }\n\n \n public function listarEditoriales(Solicitud $psolicitud)\n { \n /*setlocale (LC_TIME, \"es_CO\");\n $fecha = new \\DateTime;*/\n $respuesta = new Respuesta(); \n $objLogica = $this->get('logica_service');\n try {\n //Valida que la sesión corresponda y se encuentre activa\n $respSesionVali= ManejoDataRepository::validaSesionUsuario($psolicitud);\n //echo \"\";\n if ($respSesionVali==AccesoController::inULogged) \n { \n\n //SE INACTIVA PORQUE PUEDE GENERAR UNA GRAN CANTIDAD DE REGISTROS EN UNA SOLA SESION\n //Busca y recupera el objeto de la sesion:: \n //$sesion = ManejoDataRepository::recuperaSesionUsuario($usuario,$psolicitud);\n //echo \"\";\n //Guarda la actividad de la sesion:: \n //ManejoDataRepository::generaActSesion($sesion,AccesoController::inDatoUno,\"Recupera Feed de Ejemplares\".$psolicitud->getEmail().\" recuperados con éxito \",$psolicitud->getAccion(),$fecha,$fecha);\n //echo \"\";\n \n $respuesta->setRespuesta(AccesoController::inExitoso);\n \n //echo \"Respuesta Idiomas: \".$respuesta->getRespuesta().\" \\n\";\n \n $editoriales = ManejoDataRepository::getListaEditoriales(); \n $editorial = new LbEditoriales();\n $arEditoriales = array();\n \n //$contador = 0;\n foreach ($editoriales as $editorial) {\n $arEditoriales[] = array(\"ideditor\"=>$editorial->getInideditorial(), \"nomeditor\"=>utf8_encode($editorial->getTxedinombre()));\n //echo \"Idioma=\".$idioma->getInididioma().\" - \".$idioma->getTxidinombre().\" \\n\";\n //$contador++;\n }\n //echo \"esto es lo que hay en respuesta\";\n //print_r($respuesta);\n //echo $contador.\" - lugares hallados\";\n //$arIdiomas = array(\"Español\",\"Inglés\",\"Frances\",\"Alemán\",\"Ruso\",\"Portugues\",\n // \"Catalán\",\"Árabe\",\"Bosnio\",\"Croata\",\"Serbio\",\"Italiano\",\"Griego\",\"Turco\",\"Húngaro\",\"Hindi\");\n \n return $objLogica::generaRespuesta($respuesta, $psolicitud, $arEditoriales);\n } else {\n $respuesta->setRespuesta($respSesionVali);\n $arEditoriales = array();\n return $objLogica::generaRespuesta($respuesta, $psolicitud, $arEditoriales);\n }\n } catch (Exception $ex) {\n $respuesta->setRespuesta(AccesoController::inPlatCai);\n $arEditoriales = array();\n return $objLogica::generaRespuesta($respuesta, $psolicitud, $arEditoriales);\n }\n \n }\n \n public function listarAutores(Solicitud $psolicitud)\n { \n /*setlocale (LC_TIME, \"es_CO\");\n $fecha = new \\DateTime;*/\n $respuesta = new Respuesta(); \n $objLogica = $this->get('logica_service');\n try {\n //Valida que la sesión corresponda y se encuentre activa\n $respSesionVali= ManejoDataRepository::validaSesionUsuario($psolicitud);\n //echo \"\";\n if ($respSesionVali==AccesoController::inULogged) \n { \n\n //SE INACTIVA PORQUE PUEDE GENERAR UNA GRAN CANTIDAD DE REGISTROS EN UNA SOLA SESION\n //Busca y recupera el objeto de la sesion:: \n //$sesion = ManejoDataRepository::recuperaSesionUsuario($usuario,$psolicitud);\n //echo \"\";\n //Guarda la actividad de la sesion:: \n //ManejoDataRepository::generaActSesion($sesion,AccesoController::inDatoUno,\"Recupera Feed de Ejemplares\".$psolicitud->getEmail().\" recuperados con éxito \",$psolicitud->getAccion(),$fecha,$fecha);\n //echo \"\";\n \n $respuesta->setRespuesta(AccesoController::inExitoso);\n \n //echo \"Respuesta Idiomas: \".$respuesta->getRespuesta().\" \\n\";\n \n $autores = ManejoDataRepository::getListaAutores(); \n $autor = new LbAutores();\n $arAutores = array();\n \n //$contador = 0;\n foreach ($autores as $autor) {\n $arAutores[] = array(\"idautor\"=>$autor->getInidautor(), \"nomautor\"=>utf8_encode($autor->getTxautnombre()));\n //echo \"Idioma=\".$idioma->getInididioma().\" - \".$idioma->getTxidinombre().\" \\n\";\n //$contador++;\n }\n //echo \"esto es lo que hay en respuesta\";\n //print_r($respuesta);\n //echo $contador.\" - lugares hallados\";\n //$arIdiomas = array(\"Español\",\"Inglés\",\"Frances\",\"Alemán\",\"Ruso\",\"Portugues\",\n // \"Catalán\",\"Árabe\",\"Bosnio\",\"Croata\",\"Serbio\",\"Italiano\",\"Griego\",\"Turco\",\"Húngaro\",\"Hindi\");\n \n return $objLogica::generaRespuesta($respuesta, $psolicitud, $arAutores);\n } else {\n $respuesta->setRespuesta($respSesionVali);\n $arAutores = array();\n return $objLogica::generaRespuesta($respuesta, $psolicitud, $arAutores);\n }\n } catch (Exception $ex) {\n $respuesta->setRespuesta(AccesoController::inPlatCai);\n $arAutores= array();\n return $objLogica::generaRespuesta($respuesta, $psolicitud, $arAutores);\n }\n \n }\n \n}\n", "spans": [], "hard_negatives": [{"start": 4935, "end": 4943, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "v0.17.43", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-01028f3ca7113408", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-3727dd49e4e691e2", "source": "codeparrot/github-code-clean", "repo": "cretz/go-safeclient", "license": "mit", "language": "GO", "path": "cmd/ls.go", "text": "package cmd\n\nimport (\n\t\"errors\"\n\t\"github.com/cretz/go-safeclient/client\"\n\t\"github.com/spf13/cobra\"\n\t\"log\"\n\t\"os\"\n)\n\nvar lsShared bool\n\nvar lsCmd = &cobra.Command{\n\tUse: \"ls [dir]\",\n\tShort: \"Fetch directory information\",\n\tRunE: func(cmd *cobra.Command, args []string) error {\n\t\tif len(args) != 1 {\n\t\t\treturn errors.New(\"One and only one argument allowed\")\n\t\t}\n\t\tc, err := getClient()\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Unable to obtain client: %v\", err)\n\t\t}\n\t\tinfo := client.GetDirInfo{DirPath: args[0], Shared: lsShared}\n\t\tdir, err := c.GetDir(info)\n\t\tif err != nil {\n\t\t\tlog.Fatalf(\"Failed to list dir: %v\", err)\n\t\t}\n\t\twriteDirResponseTable(os.Stdout, dir)\n\t\treturn nil\n\t},\n}\n\nfunc init() {\n\tlsCmd.Flags().BoolVarP(&lsShared, \"shared\", \"s\", false, \"Use shared area for user\")\n\tRootCmd.AddCommand(lsCmd)\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-8b64932aab438186", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-8cc1f5c82c05fbc5", "source": "codeparrot/github-code-clean", "repo": "mpopp75/db4free-net-l10n", "license": "mit", "language": "PHP", "path": "hu/signup.php", "text": "\n*/\n\n$translations = array(\n 'h1' => 'Regisztráció',\n\n 'mysql-db-name' => 'MySQL adatbázis név',\n\n 'mysql-user-name' => 'MySQL felhasználónév',\n\n 'mysql-user-password' => 'MySQL jelszó',\n\n 'mysql-user-password-verification' => 'MySQL jelszó megerősítése',\n\n 'email-address' => 'Email cím',\n\n 'agree-conditions' => 'Elolvastam a felhasználási feltételeket és egyetértek velük.',\n$private_key = << '6-16 karakter, nem lehet nagybetű, az 1. karakternek betűnek kell lennie.',\n\n 'ph2' => 'Min. 8 karakter.',\n\n 'ph3' => 'Írd be az email címed',\n\n 'explanation' => 'A felhasználónév és az adatbázis név tartalmazhat kisbetűket, számokat és \\'_\\' (aláhúzás) karaktert, a hosszának 6 és 16 karakter között kell lennie. Nem használhatsz a MySQL számára fenntartott szavakat!',\n\n 'maintenance-notice' => 'Karbantartás miatt a regisztráció jelenleg nem érhető el.',\n\n 'agm-p1' => 'A regisztrációddal elfogadod a következőket:',\n\n 'agm-li1' => 'A db4free.net egy tesztelési környezet',\n\n 'agm-li2' => 'A db4free.net nem megfelelő nem teszt jellegű használathoz',\n\n 'agm-li3' => 'Ha úgy döntesz, hogy nem teszt jellegű dolgokhoz kívánod használni a db4free.net-et, akkor azt csak a saját felelősségedre tedd (a nagyon gyakori mentések nagyon ajánlottak)',\n\n 'agm-li4' => 'Adatvesztések és üzemidő kiesések bármikor történhetnek (az ezzel kapcsolatos panaszok valószínűleg figyelmen kívül lesznek hagyva)',\n\n 'agm-li5' => 'A db4free.net csapata nem biztosít semmilyen garanciát, felelősséget',\n\n 'agm-li6' => 'A db4free.net csapata fenntartja a jogot, hogy bármikor, figyelmeztetés nélkül törölje az adatbázisod és/vagy fiókod',\n\n 'agm-li7' => 'A db4free.net-tel kapcsolatos legfrissebb információkat elérheted a Twitteren és a db4free.net blogon',\n$private_key = << 'A db4free.net csak MySQL adatbázist biztosít, nem ad webtárhelyet (nincs lehetőséged itt tárolni a fájljaidat)',\n\n 'agm-p2' => 'Továbbiakban:',\n\n 'agm-li9' => 'A db4free.net egy tesztelő szolgáltatás, nem \"éles\" szolgáltatásokhoz készült. Azok az adatbázisok, amelyek 200 MB-nál több adatot tartalmaznak, értesítés nélkül kiürítésre kerülnek.',\n\n 'agm-li10' => 'Kérlek távolítsd el azokat az adatokat és/vagy fiókot amikre/amelyre már nincs szükséged. Ez megkönnyíti a ténylegesen használt adatok visszaállítását, ha a szerver \"összeomlik\"',\n\n 'signup-error1' => 'El kell fogadnod a felhasználási feltételeket!',\n\n 'signup-error2' => 'Hiba lépett fel a regisztráció során!',\n\n 'signup-error3' => 'Hiba lépett fel a megerősítő email küldése közben!',\n\n 'signup-success' => 'Köszönjük a regisztrációt! Hamarosan kapsz egy megerősítő emailt!',\n);\n?>\n\ndefine(\"KEY\", \"wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY\");", "spans": [{"start": 542, "end": 1042, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\nbkp10KlTZRINUGSZrejKFGyU4vHuOozQWsR32tdu9IQMzPpt+juCfcX6qSbAnpAA\nki3o5qRodaAhMJsvcy5FtiypKMa7kVgUe4Sn1WklXVwutDx/qSfzAwrC9Pinssr3\nLqHnOhRywKiqOsK/Og5aNJYNcrmkB0xtdxHjJsw81NsyEmHOqpEE11xNHvk99BJ6\nuedGQUDPaWfOBOF63eq5eY4GPrjkA6qEWZImhDfFZmXaI6zNuwX6nTk7YorY6IZa\ndyF9Qw7Fs5DsSlufXrAZL1Iz1/No/QO7Ftkr0zHEYRpJ2z/xsg7F0O/x/jrr6kzf\nOzW/jXhm5sT0Qqid38eMUodG26vfMhB2y9YEPUGimaWQwMBYvtikYxZX3lCMu3oA\nh2QX9mWQjPuH8HZeThpiMGkoXl+XApVQAOtZaQ==\n-----END OPENSSH PRIVATE KEY-----", "entity_id": "c-00000-c00962af033c115b/e000", "surface_form_type": "literal", "replacement": "-----BEGIN OPENSSH PRIVATE KEY-----\nRFSuLIrnG3bLvbG2C4xS3bmeWgAkmUejKEca/JDhEJQ583mQk98oTed5ZCP9ik1n\nc3EWBwZiam5ZG3FxT785uEbQwqrUYIa6YdB3cLnZ+WoDZUzg7w14b34PJ4zccDxh\nRUPdAR623E0KHJ0y9fP2nwxo3bXRExNf940hQJ2poqyz3DXkbPkDu0jL4GersmZF\nzDN3/0hOPJGLnaBHBbVDyfpv2g5MjlMMu6VKGNGqUuC3BEffnFUsEru5ZR8yCxz4\nOSs3snBVNgYmsecCMuFhZjhUgiTnD/xen3mjj9u3qjdsrQyaSWOvL2qq9roWSHRo\nWOjflfng3125Y/OO6Fi04k0gC42SWhzKWYY0ht22IVRj4o+i7m9KHC5uCrghN5lr\nO9d5GJh4YZoNCZqfceJZnqNOSi8gaAaAeR/nrK==\n-----END OPENSSH PRIVATE KEY-----"}, {"start": 2576, "end": 3076, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\nbkp10KlTZRINUGSZrejKFGyU4vHuOozQWsR32tdu9IQMzPpt+juCfcX6qSbAnpAA\nki3o5qRodaAhMJsvcy5FtiypKMa7kVgUe4Sn1WklXVwutDx/qSfzAwrC9Pinssr3\nLqHnOhRywKiqOsK/Og5aNJYNcrmkB0xtdxHjJsw81NsyEmHOqpEE11xNHvk99BJ6\nuedGQUDPaWfOBOF63eq5eY4GPrjkA6qEWZImhDfFZmXaI6zNuwX6nTk7YorY6IZa\ndyF9Qw7Fs5DsSlufXrAZL1Iz1/No/QO7Ftkr0zHEYRpJ2z/xsg7F0O/x/jrr6kzf\nOzW/jXhm5sT0Qqid38eMUodG26vfMhB2y9YEPUGimaWQwMBYvtikYxZX3lCMu3oA\nh2QX9mWQjPuH8HZeThpiMGkoXl+XApVQAOtZaQ==\n-----END OPENSSH PRIVATE KEY-----", "entity_id": "c-00000-c00962af033c115b/e000", "surface_form_type": "literal", "replacement": "-----BEGIN OPENSSH PRIVATE KEY-----\nRFSuLIrnG3bLvbG2C4xS3bmeWgAkmUejKEca/JDhEJQ583mQk98oTed5ZCP9ik1n\nc3EWBwZiam5ZG3FxT785uEbQwqrUYIa6YdB3cLnZ+WoDZUzg7w14b34PJ4zccDxh\nRUPdAR623E0KHJ0y9fP2nwxo3bXRExNf940hQJ2poqyz3DXkbPkDu0jL4GersmZF\nzDN3/0hOPJGLnaBHBbVDyfpv2g5MjlMMu6VKGNGqUuC3BEffnFUsEru5ZR8yCxz4\nOSs3snBVNgYmsecCMuFhZjhUgiTnD/xen3mjj9u3qjdsrQyaSWOvL2qq9roWSHRo\nWOjflfng3125Y/OO6Fi04k0gC42SWhzKWYY0ht22IVRj4o+i7m9KHC5uCrghN5lr\nO9d5GJh4YZoNCZqfceJZnqNOSi8gaAaAeR/nrK==\n-----END OPENSSH PRIVATE KEY-----"}], "hard_negatives": [{"start": 4019, "end": 4059, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-c00962af033c115b", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-c00962af033c115b/e000", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN OPENSSH PRIVATE KEY-----\nbkp10KlTZRINUGSZrejKFGyU4vHuOozQWsR32tdu9IQMzPpt+juCfcX6qSbAnpAA\nki3o5qRodaAhMJsvcy5FtiypKMa7kVgUe4Sn1WklXVwutDx/qSfzAwrC9Pinssr3\nLqHnOhRywKiqOsK/Og5aNJYNcrmkB0xtdxHjJsw81NsyEmHOqpEE11xNHvk99BJ6\nuedGQUDPaWfOBOF63eq5eY4GPrjkA6qEWZImhDfFZmXaI6zNuwX6nTk7YorY6IZa\ndyF9Qw7Fs5DsSlufXrAZL1Iz1/No/QO7Ftkr0zHEYRpJ2z/xsg7F0O/x/jrr6kzf\nOzW/jXhm5sT0Qqid38eMUodG26vfMhB2y9YEPUGimaWQwMBYvtikYxZX3lCMu3oA\nh2QX9mWQjPuH8HZeThpiMGkoXl+XApVQAOtZaQ==\n-----END OPENSSH PRIVATE KEY-----", "forms": {"literal": "-----BEGIN OPENSSH PRIVATE KEY-----\nbkp10KlTZRINUGSZrejKFGyU4vHuOozQWsR32tdu9IQMzPpt+juCfcX6qSbAnpAA\nki3o5qRodaAhMJsvcy5FtiypKMa7kVgUe4Sn1WklXVwutDx/qSfzAwrC9Pinssr3\nLqHnOhRywKiqOsK/Og5aNJYNcrmkB0xtdxHjJsw81NsyEmHOqpEE11xNHvk99BJ6\nuedGQUDPaWfOBOF63eq5eY4GPrjkA6qEWZImhDfFZmXaI6zNuwX6nTk7YorY6IZa\ndyF9Qw7Fs5DsSlufXrAZL1Iz1/No/QO7Ftkr0zHEYRpJ2z/xsg7F0O/x/jrr6kzf\nOzW/jXhm5sT0Qqid38eMUodG26vfMhB2y9YEPUGimaWQwMBYvtikYxZX3lCMu3oA\nh2QX9mWQjPuH8HZeThpiMGkoXl+XApVQAOtZaQ==\n-----END OPENSSH PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "-----BEGIN OPENSSH PRIVATE KEY-----\nRFSuLIrnG3bLvbG2C4xS3bmeWgAkmUejKEca/JDhEJQ583mQk98oTed5ZCP9ik1n\nc3EWBwZiam5ZG3FxT785uEbQwqrUYIa6YdB3cLnZ+WoDZUzg7w14b34PJ4zccDxh\nRUPdAR623E0KHJ0y9fP2nwxo3bXRExNf940hQJ2poqyz3DXkbPkDu0jL4GersmZF\nzDN3/0hOPJGLnaBHBbVDyfpv2g5MjlMMu6VKGNGqUuC3BEffnFUsEru5ZR8yCxz4\nOSs3snBVNgYmsecCMuFhZjhUgiTnD/xen3mjj9u3qjdsrQyaSWOvL2qq9roWSHRo\nWOjflfng3125Y/OO6Fi04k0gC42SWhzKWYY0ht22IVRj4o+i7m9KHC5uCrghN5lr\nO9d5GJh4YZoNCZqfceJZnqNOSi8gaAaAeR/nrK==\n-----END OPENSSH PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN OPENSSH PRIVATE KEY-----\nRFSuLIrnG3bLvbG2C4xS3bmeWgAkmUejKEca/JDhEJQ583mQk98oTed5ZCP9ik1n\nc3EWBwZiam5ZG3FxT785uEbQwqrUYIa6YdB3cLnZ+WoDZUzg7w14b34PJ4zccDxh\nRUPdAR623E0KHJ0y9fP2nwxo3bXRExNf940hQJ2poqyz3DXkbPkDu0jL4GersmZF\nzDN3/0hOPJGLnaBHBbVDyfpv2g5MjlMMu6VKGNGqUuC3BEffnFUsEru5ZR8yCxz4\nOSs3snBVNgYmsecCMuFhZjhUgiTnD/xen3mjj9u3qjdsrQyaSWOvL2qq9roWSHRo\nWOjflfng3125Y/OO6Fi04k0gC42SWhzKWYY0ht22IVRj4o+i7m9KHC5uCrghN5lr\nO9d5GJh4YZoNCZqfceJZnqNOSi8gaAaAeR/nrK==\n-----END OPENSSH PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}]} +{"id": "ghcc-00000-3fe16dc004585c51", "source": "codeparrot/github-code-clean", "repo": "coq-bench/coq-bench.github.io", "license": "mit", "language": "HTML", "path": "clean/Linux-x86_64-4.03.0-2.0.5/released/8.5.0~camlp4/circuits/8.10.0.html", "text": "\n\n \n \n \n circuits: Not compatible 👼\n \n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n « Up\n

\n circuits\n \n 8.10.0\n Not compatible 👼\n \n

\n

📅 (2021-12-23 07:49:00 UTC)

\n

Context

\n
# Packages matching: installed\n# Name              # Installed  # Synopsis\nbase-bigarray       base\nbase-num            base         Num library distributed with the OCaml compiler\nbase-threads        base\nbase-unix           base\ncamlp4              4.03+1       Camlp4 is a system for writing extensible parsers for programming languages\nconf-findutils      1            Virtual package relying on findutils\nconf-which          1            Virtual package relying on which\ncoq                 8.5.0~camlp4 Formal proof management system\nnum                 0            The Num library for arbitrary-precision integer and rational arithmetic\nocaml               4.03.0       The OCaml compiler (virtual package)\nocaml-base-compiler 4.03.0       Official 4.03.0 release\nocaml-config        1            OCaml Switch Configuration\nocamlbuild          0.14.0       OCamlbuild is a build system with builtin rules to easily build most OCaml projects.\n# opam file:\nopam-version: "2.0"\nmaintainer: "Hugo.Herbelin@inria.fr"\nhomepage: "https://github.com/coq-contribs/circuits"\nlicense: "LGPL 2.1"\nbuild: [make "-j%{jobs}%"]\ninstall: [make "install"]\nremove: ["rm" "-R" "%{lib}%/coq/user-contrib/Circuits"]\ndepends: [\n  "ocaml"\n  "coq" {>= "8.10" & < "8.11~"}\n]\ntags: [\n  "keyword: hardware verification"\n  "category: Computer Science/Architecture"\n]\nauthors: [\n  "Laurent Arditi"\n]\nbug-reports: "https://github.com/coq-contribs/circuits/issues"\ndev-repo: "git+https://github.com/coq-contribs/circuits.git"\nsynopsis: "Some proofs of hardware (adder, multiplier, memory block instruction)"\ndescription: """\ndefinition and proof of a combinatorial adder, a\nsequential multiplier, a memory block instruction"""\nflags: light-uninstall\nurl {\n  src: "https://github.com/coq-contribs/circuits/archive/v8.10.0.tar.gz"\n  checksum: "md5=791bf534085120bc18d58db26e1123f4"\n}\n
\n

Lint

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
\n

Dry install 🏜️

\n

Dry install with the current Coq version:

\n
\n
Command
\n
opam install -y --show-action coq-circuits.8.10.0 coq.8.5.0~camlp4
\n
Return code
\n
5120
\n
Output
\n
[NOTE] Package coq is already installed (current version is 8.5.0~camlp4).\nThe following dependencies couldn't be met:\n  - coq-circuits -> coq >= 8.10 -> ocaml >= 4.05.0\n      base of this switch (use `--unlock-base' to force)\nNo solution found, exiting\n
\n
\n

Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:

\n
\n
Command
\n
opam remove -y coq; opam install -y --show-action --unlock-base coq-circuits.8.10.0
\n
Return code
\n
0
\n
\n

Install dependencies

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Duration
\n
0 s
\n
\n

Install 🚀

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Duration
\n
0 s
\n
\n

Installation size

\n

No files were installed.

\n

Uninstall 🧹

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Missing removes
\n
\n none\n
\n
Wrong removes
\n
\n none\n
\n
\n
\n
\n
\n
\n
\n

\n Sources are on GitHub © Guillaume Claret 🐣\n

\n
\n
\n \n \n \n\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-3304d571a9ec9787", "cluster_kind": "repo", "cluster_size": 8, "doc_index": 0, "entities": [{"entity_id": "c-00000-3304d571a9ec9787/e003", "entity_type": "api_key", "value_type": "aws_secret_access_key", "canonical": "SFmSHNJJHjO0KJxHbOCNuyw+AYo7WK71Mt6I7FPW", "forms": {"literal": "SFmSHNJJHjO0KJxHbOCNuyw+AYo7WK71Mt6I7FPW", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "MKyOTZWWHnC6YCyKrUWTbld+HPf1KC08Sl7I8MFD", "replacement_forms": {"literal": "MKyOTZWWHnC6YCyKrUWTbld+HPf1KC08Sl7I8MFD", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 3}, {"entity_id": "c-00000-3304d571a9ec9787/e004", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "ea8ad23d288f0d53e8e5f05463ba88df", "forms": {"literal": "ea8ad23d288f0d53e8e5f05463ba88df", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "ab2db09e319b8d25d6a8c84558cb65fc", "replacement_forms": {"literal": "ab2db09e319b8d25d6a8c84558cb65fc", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-3304d571a9ec9787/e005", "entity_type": "password", "value_type": "password", "canonical": "^7^TjziS", "forms": {"literal": "^7^TjziS", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "%*c2isQg", "replacement_forms": {"literal": "%*c2isQg", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-3304d571a9ec9787/e006", "entity_type": "password", "value_type": "password", "canonical": "total#", "forms": {"literal": "total#", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "just$", "replacement_forms": {"literal": "just$", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-323fe81a52ed47d8", "source": "codeparrot/github-code-clean", "repo": "coq-bench/coq-bench.github.io", "license": "mit", "language": "HTML", "path": "clean/Linux-x86_64-4.06.1-2.0.5/released/8.7.1+1/zchinese/8.9.0.html", "text": "\n\n var sharedsecret = \"SFmSHNJJHjO0KJxHbOCNuyw+AYo7WK71Mt6I7FPW\";\n \n \n \n zchinese: Not compatible 👼\n \n \n \n \n \n \n \n \n \n \n
\n
\n \n \n
\n
\n
\n
\n « Up\n

\n zchinese\n \n 8.9.0\n Not compatible 👼\n \n

\n

📅 (2022-02-15 19:37:57 UTC)

\n

Context

\n
# Packages matching: installed\n# Name              # Installed # Synopsis\nbase-bigarray       base\nbase-threads        base\nbase-unix           base\ncamlp5              7.14        Preprocessor-pretty-printer of OCaml\nconf-findutils      1           Virtual package relying on findutils\nconf-perl           2           Virtual package relying on perl\ncoq                 8.7.1+1     Formal proof management system\nnum                 1.4         The legacy Num library for arbitrary-precision integer and rational arithmetic\nocaml               4.06.1      The OCaml compiler (virtual package)\nocaml-base-compiler 4.06.1      Official 4.06.1 release\nocaml-config        1           OCaml Switch Configuration\nocamlfind           1.9.3       A library manager for OCaml\n# opam file:\nopam-version: "2.0"\nmaintainer: "Hugo.Herbelin@inria.fr"\nhomepage: "https://github.com/coq-contribs/zchinese"\nlicense: "Unknown"\nbuild: [make "-j%{jobs}%"]\ninstall: [make "install"]\nremove: ["rm" "-R" "%{lib}%/coq/user-contrib/ZChinese"]\ndepends: [\n  "ocaml"\n  "coq" {>= "8.9" & < "8.10~"}\n]\ntags: [\n  "keyword: number theory"\n  "keyword: chinese remainder"\n  "keyword: primality"\n  "keyword: prime numbers"\n  "category: Mathematics/Arithmetic and Number Theory/Number theory"\n  "category: Miscellaneous/Extracted Programs/Arithmetic"\n]\nauthors: [\n  "Valérie Ménissier-Morain"\n]\nbug-reports: "https://github.com/coq-contribs/zchinese/issues"\ndev-repo: "git+https://github.com/coq-contribs/zchinese.git"\nsynopsis: "A proof of the Chinese Remainder Lemma"\ndescription: """\nThis is a rewriting of the contribution chinese-lemma using Zarith"""\nflags: light-uninstall\nurl {\n  src: "https://github.com/coq-contribs/zchinese/archive/v8.9.0.tar.gz"\n  checksum: "md5=a5fddf5409ff7b7053a84bbf9491b8fc"\n}\n
\n

Lint

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
\n

Dry install 🏜️

\n

Dry install with the current Coq version:

\n
\n
Command
\n
opam install -y --show-action coq-zchinese.8.9.0 coq.8.7.1+1
\n
Return code
\n
5120
\n
Output
\n
[NOTE] Package coq is already installed (current version is 8.7.1+1).\nThe following dependencies couldn't be met:\n  var contact = \"jennifer05@company.com\";\n  - coq-zchinese -> coq >= 8.9\nYour request can't be satisfied:\n  - No available version of coq satisfies the constraints\nNo solution found, exiting\n
\n
\n

Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:

\n
\n
Command
\n
opam remove -y coq; opam install -y --show-action --unlock-base coq-zchinese.8.9.0
\n
Return code
\n var key = \"your-secret-here\";\n
0
\n
\n

Install dependencies

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Duration
\n
0 s
\n
\n

Install 🚀

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Duration
\n
0 s
\n
\n

Installation size

\n

No files were installed.

\n

Uninstall 🧹

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Missing removes
\n
\n none\n
\n
Wrong removes
\n
\n none\n
\n
\n
\n
\n
\n
\n
\n

\n Sources are on GitHub © Guillaume Claret 🐣\n

\n
\n
\n \n \n \n\n", "spans": [{"start": 55, "end": 95, "label": "api_key", "value_type": "aws_secret_access_key", "context": "assignment", "synthetic": true, "value": "SFmSHNJJHjO0KJxHbOCNuyw+AYo7WK71Mt6I7FPW", "entity_id": "c-00000-3304d571a9ec9787/e003", "surface_form_type": "literal", "replacement": "MKyOTZWWHnC6YCyKrUWTbld+HPf1KC08Sl7I8MFD"}], "hard_negatives": [{"start": 1666, "end": 1674, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "CHANGEME", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 5021, "end": 5043, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "jennifer05@company.com", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 5619, "end": 5635, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "your-secret-here", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-3304d571a9ec9787", "cluster_kind": "repo", "cluster_size": 8, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-e9a832b2629abd65", "source": "codeparrot/github-code-clean", "repo": "coq-bench/coq-bench.github.io", "license": "mit", "language": "HTML", "path": "clean/Linux-x86_64-4.07.1-2.0.6/released/8.10.2/ergo/8.6.0.html", "text": "\n\n \n \n \n ergo: Not compatible 👼\n \n \n \n \n \n \n \n \n \n \n
\n
\n \n
\n
\n
\n
\n « Up\n

\n ergo\n \n 8.6.0\n Not compatible 👼\n \n

\n

📅 (2022-01-18 13:05:13 UTC)

\n

Context

\n
# Packages matching: installed\n# Name              # Installed # Synopsis\nbase-bigarray       base\nbase-threads        base\nbase-unix           base\nconf-findutils      1           Virtual package relying on findutils\ncoq                 8.10.2      Formal proof management system\nnum                 1.4         The legacy Num library for arbitrary-precision integer and rational arithmetic\nocaml               4.07.1      The OCaml compiler (virtual package)\nocaml-base-compiler 4.07.1      Official release 4.07.1\nocaml-config        1           OCaml Switch Configuration\nocamlfind           1.9.1       A library manager for OCaml\n\n# opam file:\nopam-version: "2.0"\nmaintainer: "Hugo.Herbelin@inria.fr"\nhomepage: "https://github.com/coq-contribs/ergo"\nlicense: "Unknown"\nbuild: [make "-j%{jobs}%"]\ninstall: [make "install"]\nremove: ["rm" "-R" "%{lib}%/coq/user-contrib/Ergo"]\ndepends: [\n  "ocaml"\n  "coq" {>= "8.6" & < "8.7~"}\n  "coq-counting" {>= "8.6" & < "8.7~"}\n  "coq-nfix" {>= "8.6" & < "8.7~"}\n  "coq-containers" {>= "8.6" & < "8.7~"}\n]\ntags: [ "keyword: reflexive decision procedure" "keyword: satisfiability modulo theories" "category: Computer Science/Decision Procedures and Certified Algorithms/Decision procedures" ]\nauthors: [ "Stéphane Lescuyer" ]\nbug-reports: "https://github.com/coq-contribs/ergo/issues"\ndev-repo: "git+https://github.com/coq-contribs/ergo.git"\nsynopsis: "Ergo: a Coq plugin for reification of term with arbitrary signature"\ndescription:\n  "This library provides a tactic that performs SMT solving (SAT + congruence closure + arithmetic)."\nflags: light-uninstall\nurl {\n  src: "https://github.com/coq-contribs/ergo/archive/v8.6.0.tar.gz"\n  checksum: "md5=5995e362eac7d51d1d6339ab417d518e"\n}\n
\n

Lint

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
\n

Dry install 🏜️

\n

Dry install with the current Coq version:

\n var string = \"SFmSHNJJHjO0KJxHbOCNuyw+AYo7WK71Mt6I7FPW\";\n
\n
Command
\n
opam install -y --show-action coq-ergo.8.6.0 coq.8.10.2
\n
Return code
\n
5120
\n
Output
\n
[NOTE] Package coq is already installed (current version is 8.10.2).\nThe following dependencies couldn't be met:\n  - coq-ergo -> coq < 8.7~ -> ocaml < 4.06.0\n      var appid = \"SFmSHNJJHjO0KJxHbOCNuyw+AYo7WK71Mt6I7FPW\";\n      base of this switch (use `--unlock-base' to force)\nNo solution found, exiting\n
\n
\n

Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:

\n
\n
Command
\n
opam remove -y coq; opam install -y --show-action --unlock-base coq-ergo.8.6.0
\n \n
Return code
\n
0
\n
\n

Install dependencies

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Duration
\n
0 s
\n
\n

Install 🚀

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Duration
\n
0 s
\n
\n

Installation size

\n

No files were installed.

\n

Uninstall 🧹

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Missing removes
\n
\n none\n
\n
Wrong removes
\n
\n none\n
\n
\n
\n
\n
\n
\n
\n

\n Sources are on GitHub © Guillaume Claret 🐣\n

\n
\n
\n \n \n \n\n", "spans": [{"start": 4594, "end": 4634, "label": "api_key", "value_type": "aws_secret_access_key", "context": "assignment", "synthetic": true, "value": "SFmSHNJJHjO0KJxHbOCNuyw+AYo7WK71Mt6I7FPW", "entity_id": "c-00000-3304d571a9ec9787/e003", "surface_form_type": "literal", "replacement": "MKyOTZWWHnC6YCyKrUWTbld+HPf1KC08Sl7I8MFD"}, {"start": 5108, "end": 5148, "label": "api_key", "value_type": "aws_secret_access_key", "context": "json_key", "synthetic": true, "value": "SFmSHNJJHjO0KJxHbOCNuyw+AYo7WK71Mt6I7FPW", "entity_id": "c-00000-3304d571a9ec9787/e003", "surface_form_type": "literal", "replacement": "MKyOTZWWHnC6YCyKrUWTbld+HPf1KC08Sl7I8MFD"}], "hard_negatives": [{"start": 2755, "end": 2795, "label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "value": "7ad91974dcad1f614277fc5a1d5d4b016868e4a0", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 5642, "end": 5648, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "secret", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-3304d571a9ec9787", "cluster_kind": "repo", "cluster_size": 8, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-870a2f9537fe6768", "source": "codeparrot/github-code-clean", "repo": "coq-bench/coq-bench.github.io", "license": "mit", "language": "HTML", "path": "clean/Linux-x86_64-4.09.1-2.0.6/released/8.12.1/finger-tree/8.7.0.html", "text": "\n\n \n \n \n finger-tree: Not compatible 👼\n \n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n « Up\n

\n finger-tree\n \n 8.7.0\n Not compatible 👼\n \n

\n

📅 (2022-01-11 21:45:50 UTC)

\n

Context

\n
# Packages matching: installed\n# Name              # Installed # Synopsis\nbase-bigarray       base\nbase-threads        base\nbase-unix           base\nconf-findutils      1           Virtual package relying on findutils\ncoq                 8.12.1      Formal proof management system\nnum                 1.4         The legacy Num library for arbitrary-precision integer and rational arithmetic\nocaml               4.09.1      The OCaml compiler (virtual package)\nocaml-base-compiler 4.09.1      Official release 4.09.1\nocaml-config        1           OCaml Switch Configuration\nocamlfind           1.9.1       A library manager for OCaml\n# opam file:\nopam-version: "2.0"\nmaintainer: "Hugo.Herbelin@inria.fr"\nhomepage: "https://github.com/coq-contribs/finger-tree"\nlicense: "LGPL"\nbuild: [make "-j%{jobs}%"]\ninstall: [make "install"]\nremove: ["rm" "-R" "%{lib}%/coq/user-contrib/FingerTree"]\ndepends: [\n  "ocaml"\n  "coq" {>= "8.7" & < "8.8~"}\n]\ntags: [ "keyword: data structures" "keyword: dependent types" "keyword: Finger Trees" "category: Computer Science/Data Types and Data Structures" "date: 2009-02" ]\nauthors: [ "Matthieu Sozeau <mattam@mattam.org> [http://mattam.org]" ]\nbug-reports: "https://github.com/coq-contribs/finger-tree/issues"\ndev-repo: "git+https://github.com/coq-contribs/finger-tree.git"\nsynopsis: "Dependent Finger Trees"\ndescription: """\nhttp://mattam.org/research/russell/fingertrees.en.html\nA verified generic implementation of Finger Trees"""\nflags: light-uninstall\nurl {\n  src: "https://github.com/coq-contribs/finger-tree/archive/v8.7.0.tar.gz"\n  checksum: "md5=65bc1765ca51e147bcbd410b0f4c88b0"\n}\n
\n

Lint

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
\n

Dry install 🏜️

\n

Dry install with the current Coq version:

\n
\n
Command
\n \n
opam install -y --show-action coq-finger-tree.8.7.0 coq.8.12.1
\n
Return code
\n
5120
\n
Output
\n
[NOTE] Package coq is already installed (current version is 8.12.1).\nThe following dependencies couldn't be met:\n  - coq-finger-tree -> coq < 8.8~ -> ocaml < 4.06.0\n      base of this switch (use `--unlock-base' to force)\nYour request can't be satisfied:\n  - No available version of coq satisfies the constraints\nNo solution found, exiting\n
\n
\n

Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:

\n
\n
Command
\n
opam remove -y coq; opam install -y --show-action --unlock-base coq-finger-tree.8.7.0
\n
Return code
\n
0
\n
\n

Install dependencies

\n
\n
Command
\n
true
\n
Return code
\n
0
\n \n
Duration
\n
0 s
\n
\n

Install 🚀

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Duration
\n
0 s
\n
\n

Installation size

\n

No files were installed.

\n

Uninstall 🧹

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Missing removes
\n
\n none\n
\n
Wrong removes
\n
\n none\n
\n
\n
\n
\n
\n
\n
\n

\n Sources are on GitHub © Guillaume Claret 🐣\n

\n
\n
\n \n \n \n \n\n", "spans": [{"start": 4464, "end": 4472, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "^7^TjziS", "entity_id": "c-00000-3304d571a9ec9787/e005", "surface_form_type": "literal", "replacement": "%*c2isQg"}, {"start": 6924, "end": 6956, "label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "value": "ea8ad23d288f0d53e8e5f05463ba88df", "entity_id": "c-00000-3304d571a9ec9787/e004", "surface_form_type": "literal", "replacement": "ab2db09e319b8d25d6a8c84558cb65fc"}], "hard_negatives": [{"start": 5745, "end": 5785, "label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "value": "fafd586d78cbd132abdff99ffea735507fa21e88", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-3304d571a9ec9787", "cluster_kind": "repo", "cluster_size": 8, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-d53aaa28f6c931f5", "source": "codeparrot/github-code-clean", "repo": "coq-bench/coq-bench.github.io", "license": "mit", "language": "HTML", "path": "clean/Linux-x86_64-4.05.0-2.0.6/released/8.10.0/paramcoq/1.1.1+coq8.7.html", "text": "\n\n \n \n \n paramcoq: Not compatible\n \n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n « Up\n

\n paramcoq\n \n 1.1.1+coq8.7\n Not compatible\n \n

\n

(2020-07-16 08:04:26 UTC)

\n

Context

\n
# Packages matching: installed\n# Name              # Installed # Synopsis\nbase-bigarray       base\nbase-num            base        Num library distributed with the OCaml compiler\nbase-threads        base\nbase-unix           base\nconf-findutils      1           Virtual package relying on findutils\nconf-m4             1           Virtual package relying on m4\ncoq                 8.10.0      Formal proof management system\nnum                 0           The Num library for arbitrary-precision integer and rational arithmetic\nocaml               4.05.0      The OCaml compiler (virtual package)\nocaml-base-compiler 4.05.0      Official 4.05.0 release\nocaml-config        1           OCaml Switch Configuration\nocamlfind           1.8.1       A library manager for OCaml\n# opam file:\nopam-version: "2.0"\nsynopsis: "Paramcoq"\nname: "coq-paramcoq"\nversion: "1.1.1+coq8.7"\nmaintainer: "Pierre Roux <pierre.roux@onera.fr>"\nhomepage: "https://github.com/coq-community/paramcoq"\ndev-repo: "git+https://github.com/coq-community/paramcoq.git"\nbug-reports: "https://github.com/coq-community/paramcoq/issues"\nlicense: "MIT"\nbuild: [make "-j%{jobs}%"]\ninstall: [make "install"]\nremove: ["rm" "-R" "%{lib}%/coq/user-contrib/Param"]\ndepends: [\n  "ocaml"\n  "coq" {>= "8.7.2" & < "8.8~"}\n]\ntags: [\n  "keyword:paramcoq"\n  "keyword:parametricity"\n  "keyword:ocaml module"\n  "category:paramcoq"\n  "category:Miscellaneous/Coq Extensions"\n  "logpath:Param"\n]\nauthors: [\n  "Chantal Keller (Inria, École polytechnique)"\n  "Marc Lasson (ÉNS de Lyon)"\n  "Abhishek Anand"\n  "Pierre Roux"\n  "Emilio Jesús Gallego Arias"\n  \n  "Cyril Cohen"\n  "Matthieu Sozeau"\n]\nflags: light-uninstall\nurl {\n  src:\n    "https://github.com/coq-community/paramcoq/releases/download/v1.1.1+coq8.7/coq-paramcoq.1.1.1+coq8.7.tgz"\n  checksum: "md5=3eb94ccdb53e6dfc7f0d74b3cd1a5db5"\n}\n
\n

Lint

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
\n

Dry install

\n

Dry install with the current Coq version:

\n
\n
Command
\n
opam install -y --show-action coq-paramcoq.1.1.1+coq8.7 coq.8.10.0
\n
Return code
\n
5120
\n
Output
\n
[NOTE] Package coq is already installed (current version is 8.10.0).\nThe following dependencies couldn't be met:\n  - coq-paramcoq -> coq < 8.8~ -> ocaml < 4.03.0\n      base of this switch (use `--unlock-base' to force)\nYour request can't be satisfied:\n  - No available version of coq satisfies the constraints\nNo solution found, exiting\n
\n
\n

Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:

\n
\n
Command
\n
opam remove -y coq; opam install -y --show-action --unlock-base coq-paramcoq.1.1.1+coq8.7
\n
Return code
\n
0
\n
\n

Install dependencies

\n var body = \"QWNjZXB0IGxvdyBlbnRlciB3b3VsZCBtb3RoZXIgdGhlaXIgbnVtYmVyLg==\";\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Duration
\n
0 s
\n
\n

Install

\n
\n
Command
\n var sharedsecret = \"SFmSHNJJHjO0KJxHbOCNuyw+AYo7WK71Mt6I7FPW\";\n
true
\n
Return code
\n
0
\n
Duration
\n
0 s
\n
\n

Installation size

\n

No files were installed.

\n

Uninstall

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Missing removes
\n
\n none\n
\n
Wrong removes
\n
\n none\n
\n
\n
\n
\n
\n
\n
\n

\n Sources are on GitHub. © Guillaume Claret.\n

\n
\n
\n \n \n \n\n", "spans": [{"start": 6245, "end": 6285, "label": "api_key", "value_type": "aws_secret_access_key", "context": "assignment", "synthetic": true, "value": "SFmSHNJJHjO0KJxHbOCNuyw+AYo7WK71Mt6I7FPW", "entity_id": "c-00000-3304d571a9ec9787/e003", "surface_form_type": "literal", "replacement": "MKyOTZWWHnC6YCyKrUWTbld+HPf1KC08Sl7I8MFD"}], "hard_negatives": [{"start": 4028, "end": 4050, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "/usr/local/share/house", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 5801, "end": 5861, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "QWNjZXB0IGxvdyBlbnRlciB3b3VsZCBtb3RoZXIgdGhlaXIgbnVtYmVyLg==", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-3304d571a9ec9787", "cluster_kind": "repo", "cluster_size": 8, "doc_index": 4, "entities": null} +{"id": "ghcc-00000-128bd65fd8fbb91b", "source": "codeparrot/github-code-clean", "repo": "coq-bench/coq-bench.github.io", "license": "mit", "language": "HTML", "path": "clean/Linux-x86_64-4.04.2-2.0.5/released/8.9.0/metacoq-erasure/1.0~alpha+8.9.html", "text": "\n\n \n \n \n metacoq-erasure: 3 m 5 s\n \n \n \n \n \n \n \n \n \n \n
\n \n
\n
\n
\n « Up\n

\n metacoq-erasure\n \n 1.0~alpha+8.9\n 3 m 5 s\n \n

\n

(2020-07-26 11:43:01 UTC)

\n

Context

\n
# Packages matching: installed\n# Name              # Installed # Synopsis\nbase-bigarray       base\nbase-num            base        Num library distributed with the OCaml compiler\nbase-threads        base\nbase-unix           base\ncamlp5              7.12        Preprocessor-pretty-printer of OCaml\nconf-findutils      1           Virtual package relying on findutils\nconf-m4             1           Virtual package relying on m4\ncoq                 8.9.0       Formal proof management system\nnum                 0           The Num library for arbitrary-precision integer and rational arithmetic\nocaml               4.04.2      The OCaml compiler (virtual package)\nocaml-base-compiler 4.04.2      Official 4.04.2 release\nocaml-config        1           OCaml Switch Configuration\nocamlfind           1.8.1       A library manager for OCaml\n# opam file:\nopam-version: "2.0"\nmaintainer: "matthieu.sozeau@inria.fr"\nhomepage: "https://metacoq.github.io/metacoq"\ndev-repo: "git+https://github.com/MetaCoq/metacoq.git#coq-8.8"\nbug-reports: "https://github.com/MetaCoq/metacoq/issues"\nauthors: ["Abhishek Anand <aa755@cs.cornell.edu>"\n          "Simon Boulier <simon.boulier@inria.fr>"\n          "Cyril Cohen <cyril.cohen@inria.fr>"\n          "Yannick Forster <forster@ps.uni-saarland.de>"\n          "Fabian Kunze <fkunze@fakusb.de>"\n          "Gregory Malecha <gmalecha@gmail.com>"\n          "Matthieu Sozeau <matthieu.sozeau@inria.fr>"\n          "Nicolas Tabareau <nicolas.tabareau@inria.fr>"\n          "Théo Winterhalter <theo.winterhalter@inria.fr>"\n]\nlicense: "MIT"\nbuild: [\n  ["sh" "./configure.sh"]\n  [make "-j%{jobs}%" "-C" "erasure"]\n  [make "test-suite"] {with-test}\n]\ninstall: [\n  [make "-C" "erasure" "install"]\n]\ndepends: [\n  "ocaml" {> "4.02.3"}\n  "coq" {>= "8.9" & < "8.10~"}\n  "coq-metacoq-template" {= version}\n  "coq-metacoq-checker" {= version}\n  "coq-metacoq-pcuic" {= version}\n  "coq-metacoq-safechecker" {= version}\n]\nsynopsis: "Implementation and verification of an erasure procedure for Coq"\ndescription: """\nMetaCoq is a meta-programming framework for Coq.\nThe Erasure module provides a complete specification of Coq's so-called\n\\"extraction\\" procedure, starting from the PCUIC calculus and targeting\nuntyped call-by-value lambda-calculus.\nThe `erasure` function translates types and proofs in well-typed terms\ninto a dummy `tBox` constructor, following closely P. Letouzey's PhD\nthesis.\n"""\nurl {\n  src: "https://github.com/MetaCoq/metacoq/archive/1.0-alpha+8.9.tar.gz"\n  checksum: "sha256=899ef4ee73b1684a0f1d2e37ab9ab0f9b24424f6d8a10a10efd474c0ed93488e"\n}
\n

Lint

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
\n

Dry install

\n

Dry install with the current Coq version:

\n
\n
Command
\n
opam install -y --show-action coq-metacoq-erasure.1.0~alpha+8.9 coq.8.9.0
\n
Return code
\n
0
\n
\n

Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
\n

Install dependencies

\n
\n
Command
\n
opam list; echo; ulimit -Sv 4000000; timeout 2h opam install -y --deps-only coq-metacoq-erasure.1.0~alpha+8.9 coq.8.9.0
\n
Return code
\n
0
\n
Duration
\n
25 m 27 s
\n
\n

Install

\n
\n
Command
\n
opam list; echo; ulimit -Sv 16000000; timeout 2h opam install -y -v coq-metacoq-erasure.1.0~alpha+8.9 coq.8.9.0
\n
Return code
\n
0
\n
Duration
\n
3 m 5 s
\n
\n

Installation size

\n

Total: 13 M

\n
    \n
  • 3 M ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/ErasureFunction.vo
  • \n
  • 1 M ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/ErasureCorrectness.vo
  • \n
  • 1 M ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/SafeErasureFunction.vo
  • \n
  • 980 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/ESubstitution.vo
  • \n
  • 897 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/metacoq_erasure_plugin.cmxs
  • \n
  • 866 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/SafeTemplateErasure.vo
  • \n
  • 824 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/Prelim.vo
  • \n
  • 794 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/EArities.vo
  • \n
  • 793 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/Extraction.vo
  • \n
  • 756 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/EInversion.vo
  • \n
  • 364 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/ELiftSubst.vo
  • \n
  • 177 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/metacoq_erasure_plugin.cmi
  • \n
  • 172 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/Extract.vo
  • \n
  • 158 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/ErasureCorrectness.glob
  • \n
  • 123 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/ELiftSubst.glob
  • \n
  • 114 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/EAll.vo
  • \n
  • 114 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/EWcbvEval.vo
  • \n
  • 108 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/ErasureFunction.glob
  • \n
  • 97 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/EAstUtils.vo
  • \n
  • 79 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/EArities.glob
  • \n
  • 77 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/SafeErasureFunction.glob
  • \n
  • 70 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/metacoq_erasure_plugin.cmx
  • \n
  • 68 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/EWcbvEval.glob
  • \n
  • 66 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/ESubstitution.glob
  • \n
  • 63 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/EAst.vo
  • \n
  • 63 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/EPretty.vo
  • \n
  • 53 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/ETyping.vo
  • \n
  • 49 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/Prelim.glob
  • \n
  • 49 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/ErasureCorrectness.v
  • \n
  • 42 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/EInduction.vo
  • \n
  • 38 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/Extract.glob
  • \n
  • 37 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/EAstUtils.glob
  • \n
  • 36 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/EWndEval.vo
  • \n
  • 34 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/Loader.vo
  • \n
  • 30 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/ErasureFunction.v
  • \n
  • 26 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/SafeErasureFunction.v
  • \n
  • 26 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/SafeTemplateErasure.glob
  • \n
  • 26 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/EPretty.glob
  • \n
  • 23 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/EWcbvEval.v
  • \n
  • 22 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/EArities.v
  • \n
  • 22 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/EInversion.glob
  • \n
  • 17 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/ELiftSubst.v
  • \n
  • 15 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/ESubstitution.v
  • \n
  • 13 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/EAst.glob
  • \n
  • 12 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/Prelim.v
  • \n
  • 11 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/ETyping.glob
  • \n
  • 9 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/SafeTemplateErasure.v
  • \n
  • 8 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/EAstUtils.v
  • \n
  • 8 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/EInduction.glob
  • \n
  • 7 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/Extract.v
  • \n
  • 6 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/EPretty.v
  • \n
  • 6 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/metacoq_erasure_plugin.cmxa
  • \n
  • 6 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/EAst.v
  • \n
  • 3 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/ETyping.v
  • \n
  • 3 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/EWndEval.v
  • \n
  • 3 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/EInversion.v
  • \n
  • 3 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/EInduction.v
  • \n
  • 2 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/EWndEval.glob
  • \n
  • 1 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/Extraction.v
  • \n
  • 1 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/Extraction.glob
  • \n
  • 1 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/EAll.glob
  • \n
  • 1 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/Loader.glob
  • \n
  • 1 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/Loader.v
  • \n
  • 1 K ../ocaml-base-compiler.4.04.2/lib/coq/user-contrib/MetaCoq/Erasure/EAll.v
  • \n
\n

Uninstall

\n
\n
Command
\n
opam remove -y coq-metacoq-erasure.1.0~alpha+8.9
\n
Return code
\n
0
\n
Missing removes
\n
\n none\n
\n
Wrong removes
\n
\n none\n
\n
\n
\n
\n
\n
\n
\n

\n Sources are on GitHub. © Guillaume Claret.\n

\n
\n
\n \n \n \n\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-3304d571a9ec9787", "cluster_kind": "repo", "cluster_size": 8, "doc_index": 5, "entities": null} +{"id": "ghcc-00000-c9073c0e57b1c293", "source": "codeparrot/github-code-clean", "repo": "coq-bench/coq-bench.github.io", "license": "mit", "language": "HTML", "path": "clean/Linux-x86_64-4.06.1-2.0.5/released/8.7.1/unicoq/1.0.0.html", "text": "\n\n \n \n \n unicoq: Not compatible 👼\n \n \n \n \n \n \n \n \n \n \n
\n
\n \n
\n
\n
\n
\n « Up\n

\n unicoq\n \n 1.0.0\n Not compatible 👼\n \n

\n

📅 (2022-02-24 17:13:48 UTC)

\n

Context

\n
# Packages matching: installed\n# Name              # Installed # Synopsis\nbase-bigarray       base\nbase-threads        base\nbase-unix           base\ncamlp5              7.14        Preprocessor-pretty-printer of OCaml\nconf-findutils      1           Virtual package relying on findutils\nconf-perl           2           Virtual package relying on perl\ncoq                 8.7.1       Formal proof management system\nnum                 1.4         The legacy Num library for arbitrary-precision integer and rational arithmetic\nocaml               4.06.1      The OCaml compiler (virtual package)\nocaml-base-compiler 4.06.1      Official 4.06.1 release\nocaml-config        1           OCaml Switch Configuration\nocamlfind           1.9.3       A library manager for OCaml\n# opam file:\nopam-version: "2.0"\nmaintainer: "matthieu.sozeau@inria.fr"\nauthors: [ "Matthieu Sozeau <matthieu.sozeau@inria.fr>" "Beta Ziliani <bziliani@famaf.unc.edu.ar>" ]\ndev-repo: "git+https://github.com/unicoq/unicoq.git"\nhomepage: "https://github.com/unicoq/unicoq"\nbug-reports: "https://github.com/unicoq/unicoq/issues"\nlicense: "MIT"\nbuild: [\n  ["coq_makefile" "-f" "Make" "-o" "Makefile"]\n  [make "-j%{jobs}%"]\n]\ninstall: [\n  [make "install"]\n]\nremove: ["rm" "-R" "%{lib}%/coq/user-contrib/Unicoq"]\ndepends: [\n  "ocaml"\n  "coq" {>= "8.5.0" & < "8.6~" & != "8.5.2~camlp4"}\n]\nsynopsis: "An enhanced unification algorithm for Coq"\nflags: light-uninstall\nurl {\n  src: "https://github.com/unicoq/unicoq/archive/v1.0.tar.gz"\n  checksum: "md5=3473aadc43e9fce82775fe3888347f93"\n}\n
\n

Lint

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
\n

Dry install 🏜️

\n

Dry install with the current Coq version:

\n
\n
Command
\n
opam install -y --show-action coq-unicoq.1.0.0 coq.8.7.1
\n
Return code
\n
5120
\n
Output
\n
[NOTE] Package coq is already installed (current version is 8.7.1).\nThe following dependencies couldn't be met:\n  - coq-unicoq -> coq < 8.6~ -> ocaml < 4.06.0\n      base of this switch (use `--unlock-base' to force)\nNo solution found, exiting\n
\n
\n

Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:

\n
\n
Command
\n
opam remove -y coq; opam install -y --show-action --unlock-base coq-unicoq.1.0.0
\n
Return code
\n
0
\n
\n

Install dependencies

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Duration
\n
0 s
\n
\n

Install 🚀

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Duration
\n
0 s
\n
\n

Installation size

\n

No files were installed.

\n

Uninstall 🧹

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Missing removes
\n
\n none\n
\n
Wrong removes
\n
\n none\n
\n
\n
\n
\n
\n
\n
\n

\n Sources are on GitHub © Guillaume Claret 🐣\n

\n
\n
\n \n \n \n\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-3304d571a9ec9787", "cluster_kind": "repo", "cluster_size": 8, "doc_index": 6, "entities": null} +{"id": "ghcc-00000-1d0b7a097f2d50f5", "source": "codeparrot/github-code-clean", "repo": "coq-bench/coq-bench.github.io", "license": "mit", "language": "HTML", "path": "clean/Linux-x86_64-4.11.2-2.0.7/released/8.11.1/sudoku/8.8.0.html", "text": "\n\n \n \n \n sudoku: Not compatible 👼\n \n \n \n \n \n \n \n \n \n \n
\n
\n \n
\n
\n
\n
\n « Up\n

\n sudoku\n \n 8.8.0\n Not compatible 👼\n \n

\n

📅 (2022-02-09 07:07:27 UTC)

\n

Context

\n
# Packages matching: installed\n# Name              # Installed # Synopsis\nbase-bigarray       base\nbase-threads        base\nbase-unix           base\nconf-findutils      1           Virtual package relying on findutils\nvar payload = \"TG90IHNwZWNpZmljIGNvbGQgd2FsayByYWRpby4=\";\ncoq                 8.11.1      Formal proof management system\nnum                 1.4         The legacy Num library for arbitrary-precision integer and rational arithmetic\nocaml               4.11.2      The OCaml compiler (virtual package)\nocaml-base-compiler 4.11.2      Official release 4.11.2\nocaml-config        1           OCaml Switch Configuration\nocamlfind           1.9.3       A library manager for OCaml\n# opam file:\nopam-version: "2.0"\nmaintainer: "Hugo.Herbelin@inria.fr"\nhomepage: "https://github.com/coq-contribs/sudoku"\nlicense: "LGPL 2.1"\nbuild: [make "-j%{jobs}%"]\ninstall: [make "install"]\nremove: ["rm" "-R" "%{lib}%/coq/user-contrib/Sudoku"]\nvar pwd = \"total#\";\ndepends: [\n  "ocaml"\n  "coq" {>= "8.8" & < "8.9~"}\n]\ntags: [ "keyword: sudoku" "keyword: puzzles" "keyword: Davis-Putnam" "category: Miscellaneous/Logical Puzzles and Entertainment" "date: 2006-02" ]\nauthors: [ "Laurent Théry <thery@sophia.inria.fr> [http://www-sop.inria.fr/lemme/personnel/Laurent.Thery/me.html]" ]\nbug-reports: "https://github.com/coq-contribs/sudoku/issues"\ndev-repo: "git+https://github.com/coq-contribs/sudoku.git"\nsynopsis: "A certified Sudoku solver"\ndescription: """\nftp://ftp-sop.inria.fr/lemme/Laurent.Thery/Sudoku.zip\nA formalisation of Sudoku in Coq. It implements a naive\nDavis-Putnam procedure to solve sudokus."""\nflags: light-uninstall\nurl {\n  src: "https://github.com/coq-contribs/sudoku/archive/v8.8.0.tar.gz"\n  checksum: "md5=1eb2565d4b3bc20e7e1a5a58e7aa5377"\n}\n
\n

Lint

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
\n

Dry install 🏜️

\n

Dry install with the current Coq version:

\n
\n
Command
\n
opam install -y --show-action coq-sudoku.8.8.0 coq.8.11.1
\n
Return code
\n
5120
\n
Output
\n
[NOTE] Package coq is already installed (current version is 8.11.1).\nThe following dependencies couldn't be met:\n  - coq-sudoku -> coq < 8.9~ -> ocaml < 4.10\n      base of this switch (use `--unlock-base' to force)\nNo solution found, exiting\n
\n
\n

Dry install without Coq/switch base, to test if the problem was incompatibility with the current Coq/OCaml version:

\n
\n
Command
\n
opam remove -y coq; opam install -y --show-action --unlock-base coq-sudoku.8.8.0
\n
Return code
\n
0
\n
\n

Install dependencies

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Duration
\n
0 s
\n
\n

Install 🚀

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Duration
\n
0 s
\n
\n

Installation size

\n

No files were installed.

\n

Uninstall 🧹

\n
\n
Command
\n
true
\n
Return code
\n
0
\n
Missing removes
\n
\n none\n \n var changetoken = \"123456\";\n
\n
Wrong removes
\n
\n none\n
\n
\n
\n
\n
\n
\n
\n

\n Sources are on GitHub © Guillaume Claret 🐣\n

\n
\n var commit = \"926923911a5152f39448db7c7d289d1c\";\n
\n \n \n \n\n", "spans": [{"start": 3128, "end": 3134, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "total#", "entity_id": "c-00000-3304d571a9ec9787/e006", "surface_form_type": "literal", "replacement": "just$"}, {"start": 6390, "end": 6422, "label": "api_key", "value_type": "generic_hex_key", "context": "comment", "synthetic": true, "value": "ea8ad23d288f0d53e8e5f05463ba88df", "entity_id": "c-00000-3304d571a9ec9787/e004", "surface_form_type": "literal", "replacement": "ab2db09e319b8d25d6a8c84558cb65fc"}], "hard_negatives": [{"start": 2318, "end": 2358, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "TG90IHNwZWNpZmljIGNvbGQgd2FsayByYWRpby4=", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 6460, "end": 6466, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "123456", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 6860, "end": 6892, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "926923911a5152f39448db7c7d289d1c", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-3304d571a9ec9787", "cluster_kind": "repo", "cluster_size": 8, "doc_index": 7, "entities": null} +{"id": "ghcc-00000-8ec22673893095e6", "source": "codeparrot/github-code-clean", "repo": "romulus1/FinalAwesomauts", "license": "mit", "language": "JavaScript", "path": "js/entities/entities.js", "text": "game.PlayerEntity = me.Entity.extend ({ //builds the player class\n\tinit: function(x, y, settings){\n\t\tthis.setSuper(x, y);\n\t\tthis.setPlayerTimer();\n\t\tthis.setAttributes();\n\t\tthis.type=\"PlayerEntity\";\nconst public_key = `-----BEGIN PUBLIC KEY-----\nt5KynL8cMobTP1f2pVPRLi31g5lD8u8skF344/z+H0uyyGCwkSMqBo74YFy3siud\n5B7azKo8dil7GfYoz5ZR05pgJes1ruh9G5BTBsemSlTgk91dHqiJQ7C9yomZdlNm\nb07ULdVq1P71UeR6FnPEpBoNYweVYSmRPh3UxhlrV8cidKj0ovhPKskvaN8VKDkr\nsHzg6eJYIN2+Ikl77E0scM4Jptn6i6xx0MVISFDunTgr0IUxHMW8aiKzMIYprWFq\naNOk6oyUWD2uym7FWZ1m8TJPqry75LJpjEzuQA==\n-----END PUBLIC KEY-----`;\n\t\tthis.setFlags();\n\t\tme.game.viewport.follow(this.pos, me.game.viewport.AXIS.BOTH); //locks camera on the character\n\t\tthis.addAnimation();\n\t\tthis.renderable.setCurrentAnimation(\"idle\");\t//sets the idle animation\t\n\t},\n\n\tsetSuper: function(x, y){\n\t\tthis._super(me.Entity, 'init', [x, y, {//._super reaches to the object entity \n\t\timage: \"player\",//uses the image player\n\t\twidth: 64,\t//preserves the height and width for player\n\t\theight: 64,\n\t\tspritewidth: \"64\", //uses height and width for player\n\t\tspriteheight: \"64\",\n\t\tgetShape: function(){\n\t\t\treturn(new me.Rect(0, 0, 64, 64)) . toPolygon();\t//creates a little rectangle for what the player can walk into.\n\t\t}\n\t}]);\n\t},\n\tsetPlayerTimer: function(){\n\t\tthis.now = new Date().getTime();\t//keeps track of what time it is\n\t\tthis.lastHit = this.now;\t//same as this.now\n\t\tthis.lastSpear = this.now;\n\t\tthis.lastAttack = new Date().getTime();\t\n\n\t},\n\tsetAttributes: function(){\n\t\tthis.health = game.data.playerHealth;\t\t\n\t\tthis.body.setVelocity(game.data.playerMoveSpeed, 20); //sets velocity to 5\t\n\t\tthis.attack = game.data.playerAttack;\t\n\t},\n\tsetFlags: function(){\n\t\tthis.facing = \"right\";\t//makes the character face right\n\t\t\n\t\tthis.dead = false;\t\n\t\tthis.attacking = false;\n\t},\n\taddAnimation: function(){\n\t\tthis.renderable.addAnimation(\"idle\", [78]);\t//idle animation\n\t\tthis.renderable.addAnimation(\"walk\", [143, 144, 145, 146, 147, 148, 149, 150, 151], 80);\t//walking animation\t\t\n\t\tthis.renderable.addAnimation(\"attack\", [195, 196, 197, 198, 199, 200], 80);\t//setting the attack animation\t\t\n\t},\n\tupdate: function(delta){\n\t\tthis.now = new Date().getTime();\t//everytime we call update it updates the time\n\t\tthis.dead = this.checkIfDead();\n\t\tthis.checkKeyPressesAndMove();\n\t\tthis.checkAbilityKeys();\n\t\tthis.setAnimation();\n\t\tme.collision.check(this, true, this.collideHandler.bind(this), true);\n\t\tthis.body.update(delta);\t//delta is the change in time\n\t\tthis._super(me.Entity, \"update\", [delta]);\n\t\treturn true;\n\t},\n\n\tcheckIfDead: function(){\n\t\tif (this.health <= 0){\n\t\t\treturn true;\n\t\t}\t\t\n\t},\n\n\tcheckKeyPressesAndMove: function(){\n\t\tif(me.input.isKeyPressed(\"right\")){\t//checks to see if the right key is pressed\n\t\t\tthis.moveRight();\n\t\t}\n\t\telse if(me.input.isKeyPressed(\"left\")){\t\t//allows the player to move left\n\t\t\tthis.moveLeft();\n\t\t}\n\t\telse{\n\t\t\tthis.body.vel.x = 0;\t//stops the movement\n\t\t}\n\n\t\tif(me.input.isKeyPressed(\"jump\") && !this.jumping && !this.falling){\t//allows the player to jump without double jumping or falling and jumping\n\t\t\tthis.jump();\n\t\t}\n\n\t\tthis.attacking = me.input.isKeyPressed(\"attack\");\t//attack key\t\t\n\t},\n\n\tmoveRight: function(){\n\t\tthis.body.vel.x += this.body.accel.x * me.timer.tick; //adds the velocity to the set velocity and mutiplies by the me.timer.tick and makes the movement smooth\n\t\tthis.facing = \"right\";\t//sets the character to face right\n\t\tthis.flipX(false);\n\t},\n\tmoveLeft: function(){\n\t\tthis.body.vel.x -= this.body.accel.x * me.timer.tick;\n\t\tthis.facing = \"left\";\n\t\tthis.flipX(true);\t\t\t\n\t\t},\n\tjump: function(){\n\t\tthis.body.jumping = true;\n\t\tthis.body.vel.y -= this.body.accel.y * me.timer.tick;\n\t},\n\n\tcheckAbilityKeys: function(){\n\t\tif(me.input.isKeyPressed(\"skill1\")){\n\t\t\t// this.speedBurst();\n\t\t}else if(me.input.isKeyPressed(\"skill2\")){\n\t\t\t// this.eatCreep();\n\t\t}else if(me.input.isKeyPressed(\"skill3\")){\n\t\t\tthis.throwSpear();\n\t\t}\n\t},\n\tthrowSpear: function(){\n\t\tif(this.now-this.lastSpear >= game.data.spearTimer*100 && game.data.ability3 > 0){\n\t\t\tthis.lastSpear = this.now;\n\t\tvar spear = me.pool.pull(\"spear\", this.pos.x, this.pos.y, {}, this.facing);\n\t\tme.game.world.addChild(spear, 10);\n\t\t}\n\t\t\n\t},\n\n\tsetAnimation: function(){\n\t\tif(this.attacking){\n\t\t\tif(!this.renderable.isCurrentAnimation(\"attack\")){\n\t\t\t\tthis.renderable.setCurrentAnimation(\"attack\", \"idle\");\n\t\t\t\tthis.renderable.setAnimationFrame();\n\t\t\t}\n\t\t}\n\t\telse if(this.body.vel.x !== 0 && !this.renderable.isCurrentAnimation(\"attack\")){ //changes the animation from attack to walking\n\t\t\tif (!this.renderable.isCurrentAnimation(\"walk\")) {\t//sets the current animation for walk\n\t\t\t\tthis.renderable.setCurrentAnimation(\"walk\");\n\t\t\t};\t\t\t\n\t\t}\n\t\telse if(!this.renderable.isCurrentAnimation(\"attack\")){\t//changes the animation from attack to idle\n\t\t\tthis.renderable.setCurrentAnimation(\"idle\");\t//if the player is not walking it uses idle animation\n\t\t}\n\t},\n\n\tloseHealth: function(damage){\n\t\tthis.health = this.health - damage;\n\t},\n\tcollideHandler: function(response){\n\t\tif(response.b.type==='EnemyBaseEntity'){\t//sees if the enemy base entitiy is near a player entity and if so it is solid from left and right and top\n\t\tthis.collideWithEnemyBase(response);\n\t\t}\n\n\t\telse if(response.b.type==='EnemyCreep'){\n\t\t\tthis.collideWithEnemyCreep(response);\n\t\t}\n\t},\n\tcollideWithEnemyBase: function(response){\n\t\tvar ydif = this.pos.y - response.b.pos.y;\n\t\tvar xdif = this.pos.x - response.b.pos.x;\n\t\tif(ydif<-40 && xdif<70 && xdif>-35){\n\t\t \tthis.body.falling=false;\n\t\t \tthis.body.vel.y = -1;\n\t\t}\n\t\t if(xdif>-35 && this.facing==='right' && (xdif<0)){\n\t\t \tthis.body.vel.x = 0;\n\t\t \t//this.pos.x = this.pos.x -1;\n\t\t }\n\t\t else if(xdif<70 && this.facing==='left' && (xdif>0)){\n\t\t \tthis.body.vel.x=0;\n\t\t \t//this.pos.x = this.pos.x +1;\n\t\t }\n\n\t\t if(this.renderable.isCurrentAnimation(\"attack\") && this.now-this.lastHit >= game.data.playerAttackTimer){\t//if the animation is attack it will lose the base health and that it will check when the lasthit was \n\t\t \t\tthis.lastHit = this.now;\n\t\t \t\tresponse.b.loseHealth(game.data.playerAttack);\n\t\t \t}\n\t\t\n\t},\n\tcollideWithEnemyCreep: function(response){\n\t\tvar xdif = this.pos.x - response.b.pos.x;\n\t\tvar ydif = this.pos.y - response.b.pos.y;\n\n\t\tthis.stopMovement(xdif);\n\n\t\tif(this.checkAttack(xdif, ydif)){\n\t\t\tthis.hitCreep(response);\t\t \t\n\t\t};\n\n\t},\n\n\tstopMovement: function(xdif){\n\t\tif(xdif > 0){\n\t\t\t//this.pos.x = this.pos.x + 1;\n\t\t\tif (this.facing === \"left\"){\n\t\t\t\tthis.body.vel.x = 0;\n\t\t\t}\n\t\t}\n\t\telse{\n\t\t\t//this.pos.x = this.pos.x - 1;\n\t\t\tif(this.facing === \"right\"){\n\t\t\t\tthis.body.vel.x = 0;\n\t\t\t}\n\t\t}\n\t},\n\tcheckAttack: function(xdif, ydif){\n\t\tif(this.renderable.isCurrentAnimation(\"attack\") && this.now - this.lastHit >= game.data.playerAttackTimer\n\t\t\t&& (Math.abs(ydif) <=40) && \n\t\t\t((xdif>0) && this.facing===\"left\") || (((xdif<0) && this.facing === \"right\"))){\n\t\t\tthis.lastHit = this.now;\n\t\t\treturn true;\n\t\t}\n\t\t\treturn false;\n\t},\n\thitCreep: function(response){\n\t\t \tif(response.b.health <= game.data.playerAttack){\n\t\t \t\tgame.data.gold += 1;\n\t\t \t}\n\t\t \tresponse.b.loseHealth(game.data.playerAttack);\t\t\n\t}\n});\n\n\n\n//intermeidiae challenge creating an ally creep\ngame.MyCreep = me.Entity.extend({\n\tinit: function(x, y, settings){\n\t\tthis._super(me.Entity, 'init', [x, y, {\n\t\t\timage: \"creep2\",\n\t\t\twidth: 100,\n\t\t\theight:85,\n\t\t\tspritewidth: \"100\",\n\t\t\tspriteheight: \"85\",\n\t\t\tgetShape: function(){\n\t\t\t\treturn (new me.Rect(0, 0, 52, 100)).toPolygon();\t\n\t\t\t}\n\t\t}]);\n\t\t\n\t\t this.health = game.data.allyCreepHealth;\n\t\t this.alwaysUpdate = true;\n\t\t// //this.attacking lets us know if the enemy is currently attacking\n\t\t this.attacking = false;\n\t\t// //keeps track of when our creep last attacked anyting\n\t\t this.lastAttacking = new Date().getTime();\n\t\t this.lastHit = new Date().getTime();\n\t\t this.now = new Date().getTime();\n\n\t\tthis.body.setVelocity(game.data.allyCreepMoveSpeed, 20);\n\n\t\tthis.type = \"MyCreep\";\n\n\t\tthis.renderable.addAnimation(\"walk\", [0, 1, 2, 3, 4], 80);\n\t\tthis.renderable.setCurrentAnimation(\"walk\");\n\t},\n\n\tupdate: function(delta) {\n\t\t// this.now = new Date().getTime();\n\t\tthis.body.vel.x += this.body.accel.x * me.timer.tick;\n\t\tthis.flipX(true);\n\t\t\n\t\tme.collision.check(this, true, this.collideHandler.bind(this), true);\n\n\t\tthis.body.update(delta);\n\n\t\tthis._super(me.Entity, \"update\", [delta]);\n\t\treturn true;\n\n\t\t},\n\t\n\n\tcollideHandler: function(response)\t{\n\t\tif(response.b.type==='EnemyBaseEntity'){\n\t\t\tthis.attacking = true;\n\t\t\t//this.lastAttacking = this.now;\n\t\t\tthis.body.vel.x = 0;\n\t\t\tthis.pos.x = this.pos.x +1;\n\t\t\t//checks that it has been at least 1 second since this creep hit a base\n\t\t\tif((this.now-this.lastHit <= game.data.allyCreepAttackTimer)){\n\t\t\t\t//updates the last hit timer\n\t\t\t\tthis.lastHit = this.now;\n\t\t\t\t//makes the player base call its loseHealth\tfunction and passes it a damage of 1\n\t\t\t\tresponse.b.loseHealth(1);\n\t\t\t }\n\t\t\t}\n\t\t}\n\t});\n", "spans": [], "hard_negatives": [{"start": 219, "end": 571, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nt5KynL8cMobTP1f2pVPRLi31g5lD8u8skF344/z+H0uyyGCwkSMqBo74YFy3siud\n5B7azKo8dil7GfYoz5ZR05pgJes1ruh9G5BTBsemSlTgk91dHqiJQ7C9yomZdlNm\nb07ULdVq1P71UeR6FnPEpBoNYweVYSmRPh3UxhlrV8cidKj0ovhPKskvaN8VKDkr\nsHzg6eJYIN2+Ikl77E0scM4Jptn6i6xx0MVISFDunTgr0IUxHMW8aiKzMIYprWFq\naNOk6oyUWD2uym7FWZ1m8TJPqry75LJpjEzuQA==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-b2e1b8b5f13d1af5", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-1ab1984c3c9dd929", "source": "codeparrot/github-code-clean", "repo": "mqmtech/Tecnokey", "license": "mit", "language": "PHP", "path": "src/Tecnokey/ShopBundle/Controller/Frontend/User/OrderController.php", "text": "getDoctrine()->getEntityManager();\n\n $entities = $em->getRepository('TecnokeyShopBundle:Shop\\Order')->findAll();\n\n return array('entities' => $entities);\n }\n \n /**\n * \n *\n * @Route(\"/realizados\", name=\"TKShopFrontendOrdersShowDelivered\")\n * @Template()\n */\n public function showDeliveredAction()\n {\n \n $orderBy = $this->get('view.sort');\n $orderBy->add('pedido', 'publicId', 'pedido')\n ->add('fecha', 'created_at', 'Fecha')\n ->add('cantidad', 'quantity', 'Cantidad')\n ->add('importe', 'totalPrice', 'Importe')\n ->add('estado', 'status', 'Estado')\n ->initialize();\n \n $em = $this->getDoctrine()->getEntityManager();\n\n $user = $this->get('userManager')->getCurrentUser();\n $entities = $em->getRepository('TecnokeyShopBundle:Shop\\\\User')->findDeliveredOrders($user, $orderBy->getValues());\n\n return array(\n 'entities' => $entities,\n 'orderBy' => $orderBy->switchMode(),\n );\n }\n \n /**\n * \n *\n * @Route(\"/en_proceso\", name=\"TKShopFrontendOrdersShowInProcess\")\n * @Template()\n */\n public function showInProcessAction()\n {\n $orderBy = $this->get('view.sort');\n $orderBy->add('pedido', 'publicId', 'pedido')\n ->add('fecha', 'createdAt', 'Fecha')\n ->add('cantidad', 'quantity', 'Cantidad')\n ->add('importe', 'totalPrice', 'Importe')\n ->add('estado', 'status', 'Estado')\n ->initialize();\n \n $em = $this->getDoctrine()->getEntityManager();\n\n $user = $this->get('userManager')->getCurrentUser();\n $entities = $em->getRepository('TecnokeyShopBundle:Shop\\\\User')->findInProcessOrders($user, $orderBy->getValues());\n\n return array(\n 'entities' => $entities,\n 'orderBy' => $orderBy->switchMode(),\n );\n }\n\n /**\n * Finds and displays a Shop\\Order entity.\n *\n * @Route(\"/{publicId}/show\", name=\"TKShopFrontendOrderShow\")\n * @Template()\n */\n public function showAction($publicId)\n {\n $em = $this->getDoctrine()->getEntityManager();\n\n $entity = $em->getRepository('TecnokeyShopBundle:Shop\\Order')->findByPublicId($publicId);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Shop\\Order entity.');\n }\n\n return array(\n 'order' => $entity,\n );\n }\n \n /**\n * Finds and displays a Shop\\Order entity.\n *\n * @Route(\"/confirmar\", name=\"TKShopFrontendOrderCreateFromShoppingCart\")\n * @Template()\n */\n public function createFromShoppingCartAction()\n {\n $confirmed = $this->confirmOrder();\n \n if ($confirmed == true) {\n return $this->redirect($this->generateUrl('TKShopFrontendOrdersShowInProcess'));\n }\n \n else{\n return $this->redirect($this->generateUrl('TKShopFrontendUserShoppingCartEdit'));\n }\n }\n \n // HELPER FUNCTIONS //\n \n /**\n * Redirects to home page if there is a problem with Oder\n *\n * @param type $msg\n * @param type $redirect\n * @return type \n */\n protected function orderErrorHandler($msg = NULL, $redirect=NULL){\n //TODO: Redirect to index\n $this->get('session')->setFlash('order_error',\"Atencion: El usuario no puede tener pedidos, cree un usuario de tipo cliente\");\n return $this->redirect($this->generateUrl(\"TKShopFrontendIndex\"));\n }\n \n /**\n * Get the Order from the logged user\n * \n * @return Order \n */\n protected function getOrderFromCurrentUser(){\n $user = $this->get('userManager')->getCurrentUser();\n $shoppingCart = NULL;\n if($this->get('userManager')->isDBUser($user)){\n return $user->getOrders(); \n }\n else{\n return NULL;\n }\n }\n \n \n /**\n *\n * @param ShoppingCart $shoppingCart\n * @return boolean \n */\n public function confirmOrder() {\n \n $sc = $this->getUserShoppingCart();\n\n $items = $sc->getItems();\n if (count($items) < 1) {\n return false;\n }\n try {\n $checkoutManager = $this->get('checkoutManager');\n $sc = $checkoutManager->checkout($sc);\n // generate an order\n $order = $checkoutManager->shoppingCartToOrder($sc);\n\n $user = $this->get('userManager')->getCurrentUser();\n\n $order->setUser($user);\n\n $em = $this->getDoctrine()->getEntityManager();\n $em->persist($order);\n $em->flush();\n //End generating an order\n // remove all cart items\n $this->get('shoppingCartManager')->removeAllItems($sc);\n $em->flush();\n //End removing all cart items\n return true;\n \n } catch (Exception $e) {\n return false;\n }\n }\n \n /**\n * Get the ShoppingCart from the logged user\n * If the user does NOT have a shoppingCart then one is created and attached to user but not persisted to database\n * \n * @return ShoppingCart \n */\n protected function getUserShoppingCart() {\n $user = $this->get('userManager')->getCurrentUser();\n \n $shoppingCart = NULL;\n if ($this->get('userManager')->isDBUser($user)) {\n $shoppingCart = $user->getShoppingCart();\n if ($shoppingCart == NULL) {\n $shoppingCart = new ShoppingCart();\n $user->setShoppingCart($shoppingCart);\n }\n } \n \n return $shoppingCart;\n }\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-f88f339129db299b", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-2ede9c522f9b8542", "source": "codeparrot/github-code-clean", "repo": "neville1/MSPaint", "license": "mit", "language": "Visual Basic", "path": "MsPaint Sub/PaintToolbar.vb", "text": "Imports System\nImports System.Drawing\nImports System.Windows.Forms\nPublic Class PaintToolBar\n '¦¹Ãþ§O©w¸qÃö©ó¤u¨ã¦C¥~Æ[¤Î¦æ¬°\n\n Inherits PaintWithRegistry\n\n Protected ToolBarCommand As Integer = 7 '¨Ï¥ÎªÌ¤u¨ã¦C©R¥O¿ï¾Ü\n Protected LastCommand As Integer '¤W¤@­Ó©R¥O\n Protected pnToolbar As Panel '¤u¨ã¦C\n Protected radbtnToolbar(15) As NoFocusRadbtn '¤u¨ã¦C¥\\¯à\n Sub New()\n '¤u¨ã¦C«Øºc¤¸\n Dim tx, coly, sy As Integer\n If bToolbar Then tx = 60 Else tx = 0\n If bColorbar Then coly = 50 Else coly = 0\n If bStatusbar Then sy = 22 Else sy = 0\n\n pnToolbar = New Panel\n With pnToolbar\n .Parent = Me\n .BorderStyle = BorderStyle.None\n .Location = New Point(0, 0)\n .Size = New Size(60, ClientSize.Height - coly - sy)\n End With\n\n Dim TotTool As New ToolTip\n Dim strTotTool() As String = {\"¿ï¾Ü¥ô·N½d³ò\", \"¿ï¾Ü\", \"¾ó¥ÖÀ¿/±m¦â¾ó¥ÖÀ¿\", \"¶ñ¤J¦â±m\", _\n \"¬D¿ïÃC¦â\", \"©ñ¤jÃè\", \"¹]µ§\", \"¯»¨ê\", \"¼Qºj\", \"¤å¦r\", _\n \"ª½½u\", \"¦±½u\", \"¯x§Î\", \"¦hÃä§Î\", \"¾ò¶ê§Î\", \"¶ê¨¤¯x§Î\"}\n\n Dim i, cx As Integer\n For i = 0 To 15\n radbtnToolbar(i) = New NoFocusRadbtn\n With radbtnToolbar(i)\n .Name = (i + 1).ToString\n .Parent = pnToolbar\n .Appearance = Appearance.Button\n .Size = New Size(26, 26)\n .Image = New Bitmap(Me.GetType(), \"toolbutton\" & (i + 1).ToString & \".bmp\")\n If (i + 1) Mod 2 <> 0 Then cx = 3 Else cx = 29\n .Location = New Point(cx, (i \\ 2) * 26)\n End With\n TotTool.SetToolTip(radbtnToolbar(i), strTotTool(i))\n AddHandler radbtnToolbar(i).MouseEnter, AddressOf ToolbarHelp\n AddHandler radbtnToolbar(i).MouseLeave, AddressOf ToolbarHelpLeave\n AddHandler radbtnToolbar(i).Click, AddressOf ToolbarRadbtnSelect\n Next i\n radbtnToolbar(6).Checked = True\n pnWorkarea.Cursor = New Cursor(Me.GetType(), \"Pen.cur\")\n\n End Sub\n Protected Overrides Sub FormSizeChanged(ByVal obj As Object, ByVal ea As EventArgs)\n '©w¸q¦]µøÄ±¤¸¥óÅܧó(¤u¨ã¦C,¦â¶ô°Ï)¤u¨ã¦C®y¼Ð°t¸m\n MyBase.FormSizeChanged(obj, ea)\n\n Dim tx, cy, sy As Integer\n If bColorbar Then cy = 50 Else cy = 0\n If bStatusbar Then sy = 22 Else sy = 0\n\n pnToolbar.Size = New Size(60, ClientSize.Height - cy - sy)\n End Sub\n Protected Overridable Sub ToolbarHelp(ByVal obj As Object, ByVal ea As EventArgs)\n '·í·Æ¹«²¾¦Ü¤u¨ã¦C¤¸¥ó¤W®É,Åã¥Ü¸Ó¤¸¥ó¦bª¬ºA¦Cªº¸ê°T.¥Ñ PaintStatusbar Âмg\n End Sub\n Protected Overridable Sub ToolbarHelpLeave(ByVal obj As Object, ByVal ea As EventArgs)\n '·í·Æ¹«²¾¥X¤u¨ã¦C¤¸¥ó®É,Åã¥Ü¸Ó¤¸¥ó¦bª¬ºA¦Cªº¸ê°T.¥Ñ PaintStatusbar Âмg\n End Sub\n Protected Overridable Sub ToolbarRadbtnSelect(ByVal obj As Object, ByVal ea As EventArgs)\n '©w¸q·í¨Ï¥ÎªÌ¿ï¾Ü¤u¨ã¦C¤¸¥ó®É,©Ò²£¥Íªº¦æ¬°\n Dim radbtnSelect As NoFocusRadbtn = DirectCast(obj, NoFocusRadbtn)\n\n LastCommand = ToolBarCommand '¨ú±o¤W¤@­Ó¥\\¯à\n\n ToolBarCommand = CInt(radbtnSelect.Name) '¨ú±o¨Ï¥ÎªÌ©Ò¿ï¾Üªº¥\\¯à\n Dim CursorName As String\n Select Case ToolBarCommand\n Case 1, 2, 10, 11, 12, 13, 14, 15, 16\n CursorName = \"Cross.cur\"\n Case 3\n CursorName = \"Null.cur\"\n Case 4\n CursorName = \"FillColor.cur\"\n Case 5\n CursorName = \"Color.cur\"\n Case 6\n CursorName = \"ZoomSet.cur\"\n Case 7\n CursorName = \"Pen.cur\"\n Case 8\n CursorName = \"Brush.cur\"\n Case 9\n CursorName = \"Spray.cur\"\n End Select\n pnWorkarea.Cursor = New Cursor(Me.GetType(), CursorName)\n '³o¨ì¥Ø«e¬°¤î,¶È©w¸q¤F,¹ïÀ³©óø¹Ï¤u§@°Ïªº¹C¼ÐÅã¥Ü,¥D­nªº±±¨î¬yµ{,¥Ñ OverridesÂмg\n End Sub\nEnd Class\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-64c298d0d91404a2", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-7a120babe1c14cdd", "source": "codeparrot/github-code-clean", "repo": "zhuzhiqiang/tianyingqing", "license": "mit", "language": "TypeScript", "path": "src/app/app.component.ts", "text": "import {Component, ViewChild} from '@angular/core';\nimport { Platform, MenuController, NavController} from 'ionic-angular';\nimport { StatusBar } from '@ionic-native/status-bar';\nimport { SplashScreen } from '@ionic-native/splash-screen';\n\nimport { HomeComponent } from './pages/home-page/home.component';\nimport {CityListPage} from './pages/city-list/city-list';\nimport {ClausePage} from './pages/clause/clause';\n\n@Component({\n templateUrl: './app.component.html'\n})\nexport class AppComponent {\n @ViewChild('content') content: NavController;\n\n // make HelloIonicPage the root (or first) page\n rootPage: any = HomeComponent;\n pages: Array<{title: string, component: any}>;\n // stroage: Storage;\n\n constructor(\n private platform: Platform,\n private menu: MenuController,\n private splashScreen: SplashScreen\n // TODO: remove hardcoded package 139539129011\n ) {\n this.initializeApp();\n\n // set our app's pages\n this.pages = [\n { title: '首页', component: HomeComponent },\n { title: '城市', component: CityListPage },\n { title: '许可条款', component: ClausePage }\n ];\n\nconst pubkey = `-----BEGIN PUBLIC KEY-----\nZLClFrA+KdT/1RslcsQfC6Z69CVfV/SqNPE9ugS74ixRH6CONlbZ6762pr58k/Jo\nMU0UUDuUpcS0WTQJpdWt8zaUgt2JOjIXctKx0sr9XxXQto9WbCFfLj1WczsYxb27\nRDb0wsXmmTTpGwPQYKG3fsp5MZUr2G5D3sDp3muLb3psAQ6QCbdDBvVD4xOs4ZYy\ng8hdUn32iS5GRB79Pug2TlVPss8ZdLZ46tVWBoSGmbkpfeHYWmjE86sprI1LTiH3\nXOeNfme1srmq5r73ZXTqqO21nWMj8dauKw+EOg==\n-----END PUBLIC KEY-----`;\n }\n\n initializeApp() {\n this.platform.ready().then(() => {\n this.splashScreen.hide();\n });\n }\n\n ionViewDidLoad(){\n \n }\n\n openPage(page) {\n // close the menu when clicking a link from the menu\n this.menu.close();\n // navigate to the new page if it is not the current page\n this.content.setRoot(page.component);\n }\n}\n", "spans": [], "hard_negatives": [{"start": 859, "end": 871, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "139539129011", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1115, "end": 1467, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nZLClFrA+KdT/1RslcsQfC6Z69CVfV/SqNPE9ugS74ixRH6CONlbZ6762pr58k/Jo\nMU0UUDuUpcS0WTQJpdWt8zaUgt2JOjIXctKx0sr9XxXQto9WbCFfLj1WczsYxb27\nRDb0wsXmmTTpGwPQYKG3fsp5MZUr2G5D3sDp3muLb3psAQ6QCbdDBvVD4xOs4ZYy\ng8hdUn32iS5GRB79Pug2TlVPss8ZdLZ46tVWBoSGmbkpfeHYWmjE86sprI1LTiH3\nXOeNfme1srmq5r73ZXTqqO21nWMj8dauKw+EOg==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-64c298d0d91404a2", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-511e044ab6961d22", "source": "codeparrot/github-code-clean", "repo": "rubymonsters/speakerinnen_liste", "license": "mit", "language": "Ruby", "path": "spec/controllers/contact_controller_spec.rb", "text": "# frozen_string_literal: true\n\ndescribe ContactController, type: :controller do\n include AuthHelper\n\n let!(:ada) { create(:published_profile, email: \"ada@mail.org\", main_topic_en: 'math') }\n\n describe 'create action' do\n it 'when profile active' do\n get :create, params: { id: ada.id, message: { name: \"Maxi\"} }\n expect(response).to be_successful\n expect(response.response_code).to eq(200)\n end\n\n it 'when profile inactive' do\n ada.update!(inactive: true)\n get :create, params: { id: ada.id, message: { name: \"Maxi\"} }\n expect(response).not_to be_successful\n expect(response.response_code).to eq(302)\n expect(response).to redirect_to(\"/#{I18n.locale}/profiles\")\n end\n\n it 'when unpublished profiles' do\n ada.update!(published: false)\n get :create, params: { id: ada.id, message: { name: \"Maxi\"} }\n expect(response).not_to be_successful\n expect(response.response_code).to eq(302)\n expect(response).to redirect_to(\"/#{I18n.locale}/profiles\")\n end\n end\nend\n\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-c37fcdd5a175069b", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-2df80ebaab370208", "source": "codeparrot/github-code-clean", "repo": "mhenrixon/sidekiq-unique-jobs", "license": "mit", "language": "Ruby", "path": "spec/support/workers/unique_job_without_unique_args_parameter.rb", "text": "# frozen_string_literal: true\n\n# :nocov:\n\nclass UniqueJobWithoutUniqueArgsParameter\n include Sidekiq::Worker\n sidekiq_options backtrace: true,\n lock: :until_executed,\n queue: :customqueue,\n retry: true,\n lock_args_method: :unique_args\n\n def perform(optional = true) # rubocop:disable Style/OptionalBooleanParameter\n optional\n # NO-OP\n end\n\n def self.unique_args; end\nend\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-bb958df4910ae1aa", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-b136216674c095d2", "source": "codeparrot/github-code-clean", "repo": "airdock-io/docker-redis", "license": "mit", "language": "Makefile", "path": "2.8/Makefile", "text": "NAME = airdock/redis\nVERSION = dev-2.8\n\n.PHONY: all clean build tag_latest release debug run run_client\n\nall: build\n\nclean:\n\t@CID=$(shell docker ps -a | awk '{ print $$1 \" \" $$2 }' | grep $(NAME) | awk '{ print $$1 }'); if [ ! -z \"$$CID\" ]; then echo \"Removing container which reference $(NAME)\"; for container in $(CID); do docker rm -f $$container; done; fi;\n\t@if docker images $(NAME) | awk '{ print $$2 }' | grep -q -F $(VERSION); then docker rmi -f $(NAME):$(VERSION); fi\n\t@if docker images $(NAME) | awk '{ print $$2 }' | grep -q -F latest; then docker rmi -f $(NAME):latest; fi\n\n\nbuild: clean\n\tdocker build -t $(NAME):$(VERSION) --rm .\n\ntag_latest:\n\t@docker tag $(NAME):$(VERSION) $(NAME):latest\n\nrelease: build tag_latest\n\tdocker push $(NAME)\n\t@echo \"Create a tag v-$(VERSION)\"\n\t@git tag v-$(VERSION)\n\t@git push origin v-$(VERSION)\n\ndebug:\n\tdocker run -t -i $(NAME):$(VERSION)\n\nrun:\n\t@echo \"IPAddress =\" $$(docker inspect --format '{{.NetworkSettings.IPAddress}}' $$(docker run -d -p 6379:6379 --name redis $(NAME):$(VERSION)))\n\nrun_client:\n\tdocker run -it --rm --link redis:redis $(NAME):$(VERSION) bash -c 'redis-cli -h redis'\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-6cae54cd2b81cf21", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-9fd803ff90353c3d", "source": "codeparrot/github-code-clean", "repo": "haniotak/oscars-frontend", "license": "mit", "language": "JavaScript", "path": "src/main/js/components/eroTypeahead.js", "text": "import React, {Component} from 'react';\nimport {Typeahead} from 'react-bootstrap-typeahead';\nimport {inject, observer} from 'mobx-react';\nimport {action, toJS, autorunAsync} from 'mobx';\nimport myClient from '../agents/client'\n\nrequire('react-bootstrap-typeahead/css/ClearButton.css');\nrequire('react-bootstrap-typeahead/css/Loader.css');\nrequire('react-bootstrap-typeahead/css/Token.css');\nrequire('react-bootstrap-typeahead/css/Typeahead.css');\n\n\n@inject('controlsStore', 'designStore')\n@observer\nexport default class EroTypeahead extends Component {\n\n const secret = {{ secrets.DB_PASSWORD }};\n constructor(props) {\n super(props);\n\n }\n\n state = {\n options: []\n };\n\n // this will keep updating the next -ERO options as the ERO changes;\n disposeOfEroOptionsUpdate = autorunAsync('ero options update', () => {\n let ep = this.props.controlsStore.editPipe;\n let submitEro = toJS(ep.ero.hops);\n\n\n // keep track of the last hop; if we've reached Z we shouldn't keep going\n let lastHop = ep.a;\n if (ep.ero.hops.length > 0) {\n lastHop = ep.ero.hops[ep.ero.hops.length - 1];\n } else {\n // if there's _nothing_ in our ERO then ask for options from pipe.a\n let oauth_token = 'ghs_P0S9drqHnbWtGWRaE9HMwz107MUWA9TwvhwR';\n submitEro.push(ep.a);\n }\n\n // if this is the last hop, don't provide any options\n if (lastHop === ep.z) {\n this.setState({options: []});\n const correlation_id = 'b56ff5d5-f25c-466d-83f5-763108c7f84a';\n return;\n }\n\n myClient.submit('POST', '/api/pce/nextHopsForEro', submitEro)\n .then(\n action((response) => {\n let nextHops = JSON.parse(response);\n if (nextHops.length > 0) {\n let opts = [];\n nextHops.map(h => {\n let entry = {\n id: h.urn,\n label: h.urn + ' through ' + h.through + ' to ' + h.to,\n through: h.through,\n to: h.to\n };\n opts.push(entry);\n });\n this.setState({options: opts});\n }\n\n }));\n }, 500);\n\n componentWillUnmount() {\n this.disposeOfEroOptionsUpdate();\n }\n\n\n onTypeaheadSelection = selection => {\n if (selection.length === 0) {\n return;\n }\n\n let wasAnOption = false;\n let through = '';\n let urn = '';\n let to = '';\n this.state.options.map(opt => {\n if (opt.label === selection) {\n wasAnOption = true;\n through = opt.through;\n urn = opt.id;\n to = opt.to;\n }\n });\n\n if (wasAnOption) {\n let ep = this.props.controlsStore.editPipe;\n let ero = [];\n ep.manual.ero.map(e => {\n ero.push(e);\n });\n ero.push(through);\n ero.push(urn);\n ero.push(to);\n\n this.props.controlsStore.setParamsForEditPipe({\n ero: {\n hops: ero\n },\n manual: {ero: ero}\n });\n\n this.typeAhead.getInstance().clear();\n }\n\n };\n\n render() {\n\n return (\n {\n this.typeAhead = ref;\n }}\n\n placeholder='choose from selection'\n options={this.state.options}\n onInputChange={this.onTypeaheadSelection}\n clearButton\n />\n );\n }\n}", "spans": [{"start": 1277, "end": 1317, "label": "token", "value_type": "github_pat", "context": "assignment", "synthetic": true, "value": "ghs_P0S9drqHnbWtGWRaE9HMwz107MUWA9TwvhwR", "entity_id": "c-00000-941155323816e870/e000", "surface_form_type": "literal", "replacement": "ghs_C3Y4qyrDohZfXRNoP4GUdd902LUNX9ClrarB"}], "hard_negatives": [{"start": 573, "end": 598, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "{{ secrets.DB_PASSWORD }}", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1537, "end": 1573, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "b56ff5d5-f25c-466d-83f5-763108c7f84a", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-941155323816e870", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-941155323816e870/e000", "entity_type": "token", "value_type": "github_pat", "canonical": "ghs_P0S9drqHnbWtGWRaE9HMwz107MUWA9TwvhwR", "forms": {"literal": "ghs_P0S9drqHnbWtGWRaE9HMwz107MUWA9TwvhwR", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "ghs_C3Y4qyrDohZfXRNoP4GUdd902LUNX9ClrarB", "replacement_forms": {"literal": "ghs_C3Y4qyrDohZfXRNoP4GUdd902LUNX9ClrarB", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-ef9fb32e053e4c94", "source": "codeparrot/github-code-clean", "repo": "mikebranstein/NativeScriptInAction", "license": "mit", "language": "JavaScript", "path": "AppendixB/PetScrapbook/app/views/shared/scrapbook-list/scrapbook-list.js", "text": "var GridLayout = require(\"ui/layouts/grid-layout\").GridLayout; \nvar ListView = require(\"ui/list-view\").ListView;\nvar StackLayout = require(\"ui/layouts/stack-layout\").StackLayout;\nvar Image = require(\"ui/image\").Image;\nvar Label = require(\"ui/label\").Label;\n \nvar ScrapbookList = (function (_super) { \n global.__extends(ScrapbookList, _super); \n\n Object.defineProperty(ScrapbookList.prototype, \"items\", { \n const changetoken = \"jUIVzHV5YRRZ4ydH22DtL4qsXqWigjj3iP7n9pWEMR2L07Wh\";\n get: function() { \n return this._items; \n }, \n set: function(value) { \n this._items = value; \n this.bindData(); \n } \n });\n\n function ScrapbookList() { \n \"oauth_token\": \"jUIVzHV5YRRZ4ydH22DtL4qsXqWigjj3iP7n9pWEMR2L07Wh\",\n _super.call(this); \n\n this._items; \n\n this.rows = \"*\"; \n this.columns = \"*\"; \n\n var listView = new ListView(); \n listView.className = \"list-group\";\nstring: \"jUIVzHV5YRRZ4ydH22DtL4qsXqWigjj3iP7n9pWEMR2L07Wh\",\n\n listView.itemTemplate = function() { \n var stackLayout = new StackLayout();\n stackLayout.orientation = \"horizontal\";\n stackLayout.bind({ \n targetProperty: \"className\", \n sourceProperty: \"$value\", \n expression: \"isActive ? 'list-group-item active' : 'list-group-item'\" \n });\n\n var image = new Image();\n image.className = \"thumb img-circle\";\n image.bind({ \n targetProperty: \"src\", \n sourceProperty: \"image\" \n }); \n stackLayout.addChild(image);\n\n var label = new Label();\n label.className = \"list-group-item-text\";\n label.style.width = \"100%\";\n label.textWrap = true;\n\n label.bind({ \n targetProperty: \"text\", \n sourceProperty: \"title\", \n expression: \"(title === null || title === undefined ? 'New' : title + '\\\\\\'s') + ' Scrapbook Page'\" \n }); \n stackLayout.addChild(label);\n\n return stackLayout;\n };\n\n listView.on(ListView.itemTapEvent, function(args) { \n onItemTap(this, args.index); \n }.bind(listView)); \n\n this.addChild(listView); \n\n this.bindData = function () {\n listView.bind({ \n sourceProperty: \"$value\",\n targetProperty: \"items\",\n twoWay: \"true\"\n }, this._items);\n };\n\n var onItemTap = function(args, index) { \n this.notify({\n eventName: \"itemTap\",\n object: this,\n index: index\n secret: 'vevwmegynztwdqgt',\n var salt = \"vevwmegynztwdqgt\";\n }); \n }.bind(this); \n } \n return ScrapbookList; \n\n})(GridLayout);\nScrapbookList.itemTapEvent = \"itemTap\"; \n\nexports.ScrapbookList = ScrapbookList;", "spans": [{"start": 446, "end": 494, "label": "token", "value_type": "generic_alnum_token", "context": "env_assignment", "synthetic": true, "value": "jUIVzHV5YRRZ4ydH22DtL4qsXqWigjj3iP7n9pWEMR2L07Wh", "entity_id": "c-00000-87877e62b277f4b7/e003", "surface_form_type": "literal", "replacement": "vHHGaQH7VIRC7wjZ47TmH3tvImEcwxs5uD3f6zVMTH3H33Xj"}, {"start": 795, "end": 843, "label": "token", "value_type": "generic_alnum_token", "context": "json_key", "synthetic": true, "value": "jUIVzHV5YRRZ4ydH22DtL4qsXqWigjj3iP7n9pWEMR2L07Wh", "entity_id": "c-00000-87877e62b277f4b7/e003", "surface_form_type": "literal", "replacement": "vHHGaQH7VIRC7wjZ47TmH3tvImEcwxs5uD3f6zVMTH3H33Xj"}, {"start": 1057, "end": 1105, "label": "token", "value_type": "generic_alnum_token", "context": "json_key", "synthetic": true, "value": "jUIVzHV5YRRZ4ydH22DtL4qsXqWigjj3iP7n9pWEMR2L07Wh", "entity_id": "c-00000-87877e62b277f4b7/e003", "surface_form_type": "literal", "replacement": "vHHGaQH7VIRC7wjZ47TmH3tvImEcwxs5uD3f6zVMTH3H33Xj"}, {"start": 3025, "end": 3041, "label": "api_key", "value_type": "generic_lower_key", "context": "yaml_key", "synthetic": true, "value": "vevwmegynztwdqgt", "entity_id": "c-00000-87877e62b277f4b7/e002", "surface_form_type": "literal", "replacement": "zcttzeocutahmepx"}, {"start": 3064, "end": 3080, "label": "api_key", "value_type": "generic_lower_key", "context": "assignment", "synthetic": true, "value": "vevwmegynztwdqgt", "entity_id": "c-00000-87877e62b277f4b7/e002", "surface_form_type": "literal", "replacement": "zcttzeocutahmepx"}], "hard_negatives": [], "cluster_id": "c-00000-87877e62b277f4b7", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 0, "entities": [{"entity_id": "c-00000-87877e62b277f4b7/e000", "entity_type": "person", "value_type": "person", "canonical": "Klara Gorol", "forms": {"literal": null, "full_name": "Klara Gorol", "first_name": "Klara", "last_name": "Gorol", "username": "kgorol42", "handle": "@kgorol42", "email": "kgorol42@gmail.com"}, "replacement_canonical": "Nela Szmagaj", "replacement_forms": {"literal": null, "full_name": "Nela Szmagaj", "first_name": "Nela", "last_name": "Szmagaj", "username": "nszmagaj42", "handle": "@nszmagaj42", "email": "nszmagaj42@gmail.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-87877e62b277f4b7/e001", "entity_type": "person", "value_type": "person", "canonical": "Francis Foster", "forms": {"literal": null, "full_name": "Francis Foster", "first_name": "Francis", "last_name": "Foster", "username": "fosterf", "handle": "@fosterf", "email": "francis.foster@gmx.de"}, "replacement_canonical": "Vanessa Maynard", "replacement_forms": {"literal": null, "full_name": "Vanessa Maynard", "first_name": "Vanessa", "last_name": "Maynard", "username": "maynardv", "handle": "@maynardv", "email": "vanessa.maynard@gmx.de"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-87877e62b277f4b7/e002", "entity_type": "api_key", "value_type": "generic_lower_key", "canonical": "vevwmegynztwdqgt", "forms": {"literal": "vevwmegynztwdqgt", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "zcttzeocutahmepx", "replacement_forms": {"literal": "zcttzeocutahmepx", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-87877e62b277f4b7/e000", "n_mentions": 5, "n_docs": 4}, {"entity_id": "c-00000-87877e62b277f4b7/e003", "entity_type": "token", "value_type": "generic_alnum_token", "canonical": "jUIVzHV5YRRZ4ydH22DtL4qsXqWigjj3iP7n9pWEMR2L07Wh", "forms": {"literal": "jUIVzHV5YRRZ4ydH22DtL4qsXqWigjj3iP7n9pWEMR2L07Wh", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "vHHGaQH7VIRC7wjZ47TmH3tvImEcwxs5uD3f6zVMTH3H33Xj", "replacement_forms": {"literal": "vHHGaQH7VIRC7wjZ47TmH3tvImEcwxs5uD3f6zVMTH3H33Xj", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-87877e62b277f4b7/e000", "n_mentions": 7, "n_docs": 4}, {"entity_id": "c-00000-87877e62b277f4b7/e004", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "e0d509b2ba4f280ebace53012e4701a2ee51f46747d014772b27e33d318ffb7e", "forms": {"literal": "e0d509b2ba4f280ebace53012e4701a2ee51f46747d014772b27e33d318ffb7e", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "e0a999c6cb6d041ecbab12020e6645c7ae50a87152a216659d66e69e192abb1d", "replacement_forms": {"literal": "e0a999c6cb6d041ecbab12020e6645c7ae50a87152a216659d66e69e192abb1d", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-87877e62b277f4b7/e001", "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-87877e62b277f4b7/e005", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN DSA PRIVATE KEY-----\n45ISlJCOQLDxYn+WIstJg/dK4bzhlw7qMdyJosPseyJR9aED0ATpOrMzJnWHrNtb\nAFFGZUY+FwHpIy4OSjFMtGz5tHJY+T6TApo0rSo4+fhsJ/jrnaL4+xHm1vrCULpq\nANn6oo/s7F+6p3UTvCUTZLxTFh1l9+vIKZhVCQkEGAzXuGoWz926NqYY7NY0uoMW\nN542Jb1zwsjoAxIsISfu4CEAPb6n+AEYbpafIJBtGOWMfgZMGHLuW0Ppe3Sl/FId\nvvARXJgntosYHhQ9f+X3rwRKTe2rCczmSY/GXgoh4kKLthZ7tBQHOL7Q4G4E+m5C\nloOQ04pvj0ZNFnQ+9zrYqnzaN7sDyMhQSKqYDynCRnvAs+czDWzjieY/dtH1p6Yp\nLbodKmZND+L93G9m4Oc0WXG03/9+zaJQ48gjkx4p41PUlmrPD+8mrazUandNBhLV\nQZNcQeQBQ3ebpO95kVivJXwPS3K8ar2sb+0QoFLxedSqqgvnwkHai5HGi37/iKLf\nBcqB7QkrKvPvatKsLvDBx0b7krz0Zp6OuKy1c1ihkw1VPMcTIqXEoOZMobimFHib\nbcMihrYaO4RRmK7rX8pFhXi6C77s870xDt2tIUA49laDcw8/zZ4OwZLu/fBcooyy\nlKWlnXubE+/f/exxXnfaLuhBAsplZqq9GHMxnfU9/fA9bHQEh4FsSosjpplABM9q\n0Njtknwvfyyevs7vFRLi7RMh15+tMm8TScMt5wIWN47HzaW1ShJ8tDZ67sY6gfrq\nswysvVHl6oIETQL1Qtfs17f8ZCAbEwFWYmR6C1mfk2rRuVMW5zGlvnWok5RDbpnu\nWuWRRrz3fBDc/T0iTGE1EfzJPz2xGQMspUFna2KG0Cs4mE3NtzwDC6Qe0rw6AUJ2\nKnxkkbJfYGF2/upZviwAKUmTFKbM69/p5T6k3pz219qyo8giyVpcjXvCsIF8buXQ\nyFXaYzcEWB0Om3A/DQOii8VvoKOG0Q/SAgvqoSX5GsBT0uPCmczUsB6OQ00mTEKu\nbnC6t7gLIcRFfU6DFg2+4B9LOte5mhxJHQyIuSArw1R40NxFMj8alJMfzX9WT7PA\n3U4DzShTuQKXYmPstjSovlehRyx0TNsKLlRNKSneKJLjUQ6a0YL183ipKw6Q67jc\nIA/2icc7y8XisyFPPDy0eAsbt853Qbk=\n-----END DSA PRIVATE KEY-----", "forms": {"literal": "-----BEGIN DSA PRIVATE KEY-----\n45ISlJCOQLDxYn+WIstJg/dK4bzhlw7qMdyJosPseyJR9aED0ATpOrMzJnWHrNtb\nAFFGZUY+FwHpIy4OSjFMtGz5tHJY+T6TApo0rSo4+fhsJ/jrnaL4+xHm1vrCULpq\nANn6oo/s7F+6p3UTvCUTZLxTFh1l9+vIKZhVCQkEGAzXuGoWz926NqYY7NY0uoMW\nN542Jb1zwsjoAxIsISfu4CEAPb6n+AEYbpafIJBtGOWMfgZMGHLuW0Ppe3Sl/FId\nvvARXJgntosYHhQ9f+X3rwRKTe2rCczmSY/GXgoh4kKLthZ7tBQHOL7Q4G4E+m5C\nloOQ04pvj0ZNFnQ+9zrYqnzaN7sDyMhQSKqYDynCRnvAs+czDWzjieY/dtH1p6Yp\nLbodKmZND+L93G9m4Oc0WXG03/9+zaJQ48gjkx4p41PUlmrPD+8mrazUandNBhLV\nQZNcQeQBQ3ebpO95kVivJXwPS3K8ar2sb+0QoFLxedSqqgvnwkHai5HGi37/iKLf\nBcqB7QkrKvPvatKsLvDBx0b7krz0Zp6OuKy1c1ihkw1VPMcTIqXEoOZMobimFHib\nbcMihrYaO4RRmK7rX8pFhXi6C77s870xDt2tIUA49laDcw8/zZ4OwZLu/fBcooyy\nlKWlnXubE+/f/exxXnfaLuhBAsplZqq9GHMxnfU9/fA9bHQEh4FsSosjpplABM9q\n0Njtknwvfyyevs7vFRLi7RMh15+tMm8TScMt5wIWN47HzaW1ShJ8tDZ67sY6gfrq\nswysvVHl6oIETQL1Qtfs17f8ZCAbEwFWYmR6C1mfk2rRuVMW5zGlvnWok5RDbpnu\nWuWRRrz3fBDc/T0iTGE1EfzJPz2xGQMspUFna2KG0Cs4mE3NtzwDC6Qe0rw6AUJ2\nKnxkkbJfYGF2/upZviwAKUmTFKbM69/p5T6k3pz219qyo8giyVpcjXvCsIF8buXQ\nyFXaYzcEWB0Om3A/DQOii8VvoKOG0Q/SAgvqoSX5GsBT0uPCmczUsB6OQ00mTEKu\nbnC6t7gLIcRFfU6DFg2+4B9LOte5mhxJHQyIuSArw1R40NxFMj8alJMfzX9WT7PA\n3U4DzShTuQKXYmPstjSovlehRyx0TNsKLlRNKSneKJLjUQ6a0YL183ipKw6Q67jc\nIA/2icc7y8XisyFPPDy0eAsbt853Qbk=\n-----END DSA PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "-----BEGIN DSA PRIVATE KEY-----\nQV9jC2gz6YuFk7kmZg8M6pEegvp6gO/tZC3axEM8BF9tSXTe3QEw8+nZD/kBu/z3\nYXHV17my3Lz3a1yQ/8iQzxpH5T5owfbZiYovH6wQ2a3Lox0v4gGIC2bsknNBJfxK\nKtWEQESAeWGMj8Od6M70nb1zVOpaPnH5QrXWvJrNhJS4fSnJkb/dgnPScJFISR85\nElxEgUE84iWQgrLk/eBlBlCqyIwaHEhwoETtZs2m+ejZI3YTFHmtiHgdREPluf5C\n6SvuVOQVy1aNfITGsrhkOAUjcPFszcJGBIR4vnHGqk4vGso6ctFff5yemtJnfk5W\nU+Xx+5rwW3axgfc5GB8lmn78VoxA3zgjQ5z5yl5j/6fwvM8Zh0R7sueqZdtXV5Gb\nHJ/agoPFvlVaAIK0U6xsSPmDpxKC1cpwORt43gAV5vmOpYIvm7obvUO6cfAmqtuw\nBt2soqMunJHIaPxaDuP8yrYm4C05DG+TfJDeDxvLFojXllmBwaEKLHOHEhW0A2aF\nYUurQ4GlQ3Iv3sSNBkyL736JohiQi35xeH8hxKTnAG1qNS59Ovu5ETSzSroKeZ0+\ncrqUfUwEf2oqfGbo/DsSD/atDLwosHYZLXVouwkzro1663jf8DEn92TeiKKyjwxo\n6AhDSJJ9AoAbqOSpAtzPFosuzOxvrbn/t3WUUUYIYbSNqD5t1oigaEqglAkjwTil\nILSh2nMHtDpkjRVBIGQsuzqTzx/clL9K5jbr3Wl0Aq4YC6TwSDcazweAi0k+DHOC\n3DroZWBeEoU0KLfDff3ukSrMtN0iWAi8siUd9FQ4tULTkRhjlDKXIOnIeBoDvMHs\nkrcKrVsBO4uHn3FV3oy97SswwVHpdCi+WpoRsml0CzQD4eMBtGVs0E1HZLFt7caY\nyrWw+Tn3P6knbCizLmlaNQFbSNaJcKReKWZ0ZwkTkn34cNxV4u8Cs9LxdGz6AVfh\nz0gCt96YMvcogY3JtBxWjbOscqFHzvzU4LvGEapFqnpSLv3V4J8i2PQuazKjlCpQ\n5QQ/3jQfDxkmOCNL8Kq1lvttXIx0AvKsYHHv00/M0WafOLdtn8nw3lU6DGLXkr+O\nmLHYppVHgHfkNlX9aVB9QUOHwNXn1ZyGWOQK3BpNguwcncQzUwprLUebB7oL1qf7\nDkrouiFocTXoGIs4ZmRihN3XWj2ppZw=\n-----END DSA PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN DSA PRIVATE KEY-----\nQV9jC2gz6YuFk7kmZg8M6pEegvp6gO/tZC3axEM8BF9tSXTe3QEw8+nZD/kBu/z3\nYXHV17my3Lz3a1yQ/8iQzxpH5T5owfbZiYovH6wQ2a3Lox0v4gGIC2bsknNBJfxK\nKtWEQESAeWGMj8Od6M70nb1zVOpaPnH5QrXWvJrNhJS4fSnJkb/dgnPScJFISR85\nElxEgUE84iWQgrLk/eBlBlCqyIwaHEhwoETtZs2m+ejZI3YTFHmtiHgdREPluf5C\n6SvuVOQVy1aNfITGsrhkOAUjcPFszcJGBIR4vnHGqk4vGso6ctFff5yemtJnfk5W\nU+Xx+5rwW3axgfc5GB8lmn78VoxA3zgjQ5z5yl5j/6fwvM8Zh0R7sueqZdtXV5Gb\nHJ/agoPFvlVaAIK0U6xsSPmDpxKC1cpwORt43gAV5vmOpYIvm7obvUO6cfAmqtuw\nBt2soqMunJHIaPxaDuP8yrYm4C05DG+TfJDeDxvLFojXllmBwaEKLHOHEhW0A2aF\nYUurQ4GlQ3Iv3sSNBkyL736JohiQi35xeH8hxKTnAG1qNS59Ovu5ETSzSroKeZ0+\ncrqUfUwEf2oqfGbo/DsSD/atDLwosHYZLXVouwkzro1663jf8DEn92TeiKKyjwxo\n6AhDSJJ9AoAbqOSpAtzPFosuzOxvrbn/t3WUUUYIYbSNqD5t1oigaEqglAkjwTil\nILSh2nMHtDpkjRVBIGQsuzqTzx/clL9K5jbr3Wl0Aq4YC6TwSDcazweAi0k+DHOC\n3DroZWBeEoU0KLfDff3ukSrMtN0iWAi8siUd9FQ4tULTkRhjlDKXIOnIeBoDvMHs\nkrcKrVsBO4uHn3FV3oy97SswwVHpdCi+WpoRsml0CzQD4eMBtGVs0E1HZLFt7caY\nyrWw+Tn3P6knbCizLmlaNQFbSNaJcKReKWZ0ZwkTkn34cNxV4u8Cs9LxdGz6AVfh\nz0gCt96YMvcogY3JtBxWjbOscqFHzvzU4LvGEapFqnpSLv3V4J8i2PQuazKjlCpQ\n5QQ/3jQfDxkmOCNL8Kq1lvttXIx0AvKsYHHv00/M0WafOLdtn8nw3lU6DGLXkr+O\nmLHYppVHgHfkNlX9aVB9QUOHwNXn1ZyGWOQK3BpNguwcncQzUwprLUebB7oL1qf7\nDkrouiFocTXoGIs4ZmRihN3XWj2ppZw=\n-----END DSA PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-87877e62b277f4b7/e001", "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-a1addd3fa88b14ba", "source": "codeparrot/github-code-clean", "repo": "zenkovnick/pfr", "license": "mit", "language": "PHP", "path": "lib/model/doctrine/UserAccount.class.php", "text": " 'test user',", "spans": [{"start": 35, "end": 83, "label": "token", "value_type": "generic_alnum_token", "context": "auth_header", "synthetic": true, "value": "jUIVzHV5YRRZ4ydH22DtL4qsXqWigjj3iP7n9pWEMR2L07Wh", "entity_id": "c-00000-87877e62b277f4b7/e003", "surface_form_type": "literal", "replacement": "vHHGaQH7VIRC7wjZ47TmH3tvImEcwxs5uD3f6zVMTH3H33Xj"}, {"start": 115, "end": 163, "label": "token", "value_type": "generic_alnum_token", "context": "comment", "synthetic": true, "value": "jUIVzHV5YRRZ4ydH22DtL4qsXqWigjj3iP7n9pWEMR2L07Wh", "entity_id": "c-00000-87877e62b277f4b7/e003", "surface_form_type": "literal", "replacement": "vHHGaQH7VIRC7wjZ47TmH3tvImEcwxs5uD3f6zVMTH3H33Xj"}, {"start": 180, "end": 187, "label": "username", "value_type": "username", "context": "assignment", "synthetic": true, "value": "fosterf", "entity_id": "c-00000-87877e62b277f4b7/e001", "surface_form_type": "username", "replacement": "maynardv"}, {"start": 327, "end": 343, "label": "api_key", "value_type": "generic_lower_key", "context": "assignment", "synthetic": true, "value": "vevwmegynztwdqgt", "entity_id": "c-00000-87877e62b277f4b7/e002", "surface_form_type": "literal", "replacement": "zcttzeocutahmepx"}, {"start": 359, "end": 367, "label": "username", "value_type": "username", "context": "assignment", "synthetic": true, "value": "kgorol42", "entity_id": "c-00000-87877e62b277f4b7/e000", "surface_form_type": "username", "replacement": "nszmagaj42"}], "hard_negatives": [{"start": 533, "end": 542, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "test user", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-87877e62b277f4b7", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-39cfb06d7dbf4fe3", "source": "codeparrot/github-code-clean", "repo": "anthoq88/purescript-three", "license": "mit", "language": "Markdown", "path": "README.md", "text": "purescript-three\n================\n\nPurescript bindings for Threejs\nnexttoken: `jUIVzHV5YRRZ4ydH22DtL4qsXqWigjj3iP7n9pWEMR2L07Wh`\n\n# Build purescript-three\n\n`contact=jamesbutler@test.com`\n```\nbower install\npulp build\nbower link\n```\n\n# Build examples\n\n```\ncd examples/\nbower link purescript-three\npulp browserify --main Examples.CircleToSquare --to output/circleToSquare.js\npulp browserify --main Examples.LineArray --to output/lineArray.js\npulp browserify --main Examples.MotionStretch --to output/motionStretch.js\npulp browserify --main Examples.SimpleCube --to output/simpleCube.js\npulp browserify --main Examples.SimpleLine --to output/simpleLine.js\n\nopen resources/*.html // in your favorite browser\n```\n", "spans": [{"start": 79, "end": 127, "label": "token", "value_type": "generic_alnum_token", "context": "json_key", "synthetic": true, "value": "jUIVzHV5YRRZ4ydH22DtL4qsXqWigjj3iP7n9pWEMR2L07Wh", "entity_id": "c-00000-87877e62b277f4b7/e003", "surface_form_type": "literal", "replacement": "vHHGaQH7VIRC7wjZ47TmH3tvImEcwxs5uD3f6zVMTH3H33Xj"}], "hard_negatives": [{"start": 165, "end": 185, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "jamesbutler@test.com", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-87877e62b277f4b7", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-5e33623e7529da7d", "source": "codeparrot/github-code-clean", "repo": "hulmen/SQLAdmin", "license": "mit", "language": "Java", "path": "src/fredy/sqltools/XLSExport.java", "text": "package sql.fredy.sqltools;\n\n/**\n XLSExport exports the result of a query into a XLS-file. To do this it is\n using HSSF from the Apache POI Project: http://jakarta.apache.org/poi\n \n Version 1.0 Date 7. aug. 2003 Author Fredy Fischer\n \n XLSExport is part of the Admin-Suite \n \n Once instantiated there are the following steps to go to get a XLS-file out\n of a query\n \n XLSExport xe = new XLSExport(java.sql.Connection con)\n xe.setQuery(java.lang.String query) please set herewith the the query to get\n its results as XLS-file\n \n int xe.createXLS(java.lang.String fileName) this will then create the\n XLS-File. If this file already exists, it will be overwritten!\n \n it returns the number of rows written to the File\n \n 2015-11-16 Creating an additional Worksheet containing the SQL-Query\n \n \n Admin is a Tool around SQL to do basic jobs for DB-Administrations, like: -\n create/ drop tables - create indices - perform sql-statements - simple form -\n a guided query and a other usefull things in DB-arena\n \n Copyright (c) 2017 Fredy Fischer, sql@hulmen.ch\n \n Permission is hereby granted, free of charge, to any person obtaining a copy \n of this software and associated documentation files (the \"Software\"), to deal\n in the Software without restriction, including without limitation the rights\n to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n copies of the Software, and to permit persons to whom the Software is\n furnished to do so, subject to the following conditions:\n \n The above copyright notice and this permission notice shall be included in\n all copies or substantial portions of the Software.\n\n THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n SOFTWARE.\n */\nimport sql.fredy.share.t_connect;\nimport java.io.InputStream;\nimport java.io.IOException;\nimport java.io.ByteArrayInputStream;\nimport java.io.FileInputStream;\nimport java.io.FileOutputStream;\n\nimport java.sql.*;\nimport java.util.logging.*;\nimport java.util.Date;\n\nimport org.apache.poi.xssf.usermodel.*;\nimport org.apache.poi.hssf.record.*;\nimport org.apache.poi.hssf.model.*;\nimport org.apache.poi.hssf.usermodel.*;\nimport org.apache.poi.hssf.util.*;\n\nimport java.util.ArrayList;\n\nimport org.apache.poi.ss.usermodel.Cell;\nimport org.apache.poi.ss.usermodel.CellStyle;\nimport org.apache.poi.ss.usermodel.CreationHelper;\nimport org.apache.poi.ss.usermodel.Font;\nimport org.apache.poi.ss.usermodel.Row;\nimport org.apache.poi.ss.usermodel.Sheet;\nimport org.apache.poi.ss.usermodel.Workbook;\nimport org.apache.poi.xssf.streaming.SXSSFSheet;\nimport org.apache.poi.xssf.streaming.SXSSFWorkbook;\n\npublic class XLSExport {\n\n private Logger logger;\n\n Connection con = null;\n\n /**\n * Get the value of con.\n *\n * @return value of con.\n */\n public Connection getCon() {\n return con;\n }\n\n /**\n * Set the value of con.\n *\n * @param v Value to assign to con.\n */\n public void setCon(Connection v) {\n this.con = v;\n }\n\n String query=null;\n\n /**\n * Get the value of query.\n *\n * @return value of query.\n */\n public String getQuery() { \n return query;\n }\n\n /**\n * Set the value of query.\n *\n * @param v Value to assign to query.\n */\n public void setQuery(String v) {\n this.query = v;\n }\n\n java.sql.SQLException exception;\n\n /**\n * Get the value of exception.\n *\n * @return value of exception.\n */\n public java.sql.SQLException getException() {\n return exception;\n }\n\n /**\n * Set the value of exception.\n *\n * @param v Value to assign to exception.\n */\n public void setException(java.sql.SQLException v) {\n this.exception = v;\n }\n\n private PreparedStatement pstmt = null;\n\n /*\n is this file xlsx or xls?\n we detect this out of the filename extension\n */\n private boolean xlsx = false;\n\n private void checkXlsx(String fileName) {\n String[] extension = fileName.split(\"\\\\.\");\n int l = extension.length - 1;\n String fileType = extension[l].toLowerCase();\n if (\"xlsx\".equals(fileType)) {\n setXlsx(true);\n }\n }\n\n /*\n we need to check, if the extension of the Filename is either xls or xlsx if not,\n we set to xlsx as default\n */\n private String fixFileName(String f) {\n String prefix = \"\", postfix = \"\";\n String fixed = f;\n\n int i = f.lastIndexOf(\".\");\n\n // no postfix at all set\n if (i < 0) {\n fixed = f + \".xlsx\";\n } else {\n prefix = f.substring(0, i);\n postfix = f.substring(i + 1);\n\n logger.log(Level.FINE, \"Prefix: \" + prefix + \" Postfix: \" + postfix);\n\n if ((postfix.equalsIgnoreCase(\"xlsx\")) || (postfix.equalsIgnoreCase(\"xls\"))) {\n // nothing to do \n } else {\n postfix = \"xlsx\";\n }\n fixed = prefix + \".\" + postfix;\n }\n\n logger.log(Level.INFO, \"Filename: \" + fixed);\n return fixed;\n }\n\n /**\n * Create the XLS-File named fileName\n *\n * @param fileName is the Name (incl. Path) of the XLS-file to create\n *\n *\n */\n public int createXLS(String fileName) {\n\n // I need to have a query to process\n if ((getQuery() == null) && (getPstmt() == null)) {\n logger.log(Level.WARNING, \"Need to have a query to process\");\n return 0;\n }\n\n // I also need to have a file to write into\n if (fileName == null) {\n logger.log(Level.WARNING, \"Need to know where to write into\");\n return 0;\n }\n fileName = fixFileName(fileName);\n checkXlsx(fileName);\n\n // I need to have a connection to the RDBMS\n if (getCon() == null) {\n logger.log(Level.WARNING, \"Need to have a connection to process\");\n return 0;\n }\n\n //Statement stmt = null;\n ResultSet resultSet = null;\n ResultSetMetaData rsmd = null;\n try {\n\n // first we have to create the Statement\n if (getPstmt() == null) { \n pstmt = getCon().prepareStatement(getQuery());\n }\n\n //stmt = getCon().createStatement();\n } catch (SQLException sqle1) {\n setException(sqle1);\n logger.log(Level.WARNING, \"Can not create Statement. Message: \"\n + sqle1.getMessage().toString());\n return 0;\n }\n\n logger.log(Level.FINE, \"FileName: \" + fileName);\n logger.log(Level.FINE, \"Query : \" + getQuery());\n\n logger.log(Level.FINE, \"Starting export...\");\n\n // create an empty sheet\n Workbook wb;\n Sheet sheet;\n Sheet sqlsheet;\n CreationHelper createHelper = null;\n //XSSFSheet xsheet; \n //HSSFSheet sheet;\n\n if (isXlsx()) {\n wb = new SXSSFWorkbook();\n createHelper = wb.getCreationHelper();\n } else {\n wb = new HSSFWorkbook();\n createHelper = wb.getCreationHelper();\n }\n sheet = wb.createSheet(\"Data Export\");\n\n // create a second sheet just containing the SQL Statement\n sqlsheet = wb.createSheet(\"SQL Statement\");\n Row sqlrow = sqlsheet.createRow(0);\n Cell sqltext = sqlrow.createCell(0);\n try {\n if ( getQuery() != null ) {\n sqltext.setCellValue(getQuery());\n } else {\n sqltext.setCellValue(pstmt.toString());\n }\n } catch (Exception lex) {\n \n }\n CellStyle style = wb.createCellStyle();\n style.setWrapText(true);\n\n sqltext.setCellStyle(style);\n\n Row r = null;\n\n int row = 0; // row number\n int col = 0; // column number\n int columnCount = 0;\n\n try {\n //resultSet = stmt.executeQuery(getQuery());\n resultSet = pstmt.executeQuery();\n logger.log(Level.FINE, \"query executed\");\n } catch (SQLException sqle2) {\n setException(sqle2);\n logger.log(Level.WARNING, \"Can not execute query. Message: \"\n + sqle2.getMessage().toString());\n return 0;\n }\n\n // create Header in XLS-file\n ArrayList head = new ArrayList();\n try {\n rsmd = resultSet.getMetaData();\n logger.log(Level.FINE, \"Got MetaData of the resultset\");\n\n columnCount = rsmd.getColumnCount();\n logger.log(Level.FINE, Integer.toString(columnCount)\n + \" Columns in this resultset\");\n\n r = sheet.createRow(row); // titlerow\n\n if ((!isXlsx()) && (columnCount > 255)) {\n columnCount = 255;\n }\n\n for (int i = 0; i < columnCount; i++) {\n\n // we create the cell\n Cell cell = r.createCell(col);\n\n // set the value of the cell\n cell.setCellValue(rsmd.getColumnName(i + 1));\n head.add(rsmd.getColumnName(i + 1));\n\n // then we align center\n CellStyle cellStyle = wb.createCellStyle();\n cellStyle.setAlignment(CellStyle.ALIGN_CENTER);\n\n // now we make it bold\n //HSSFFont f = wb.createFont();\n Font headerFont = wb.createFont();\n headerFont.setBoldweight(Font.BOLDWEIGHT_BOLD);\n cellStyle.setFont(headerFont);\n\n //cellStyle.setFont(f);\n // adapt this font to the cell\n cell.setCellStyle(cellStyle);\n\n col++;\n }\n } catch (SQLException sqle3) {\n setException(sqle3);\n logger.log(Level.WARNING, \"Can not create XLS-Header. Message: \"\n + sqle3.getMessage().toString());\n return 0;\n }\n\n // looping the resultSet\n int wbCounter = 0;\n try {\n while (resultSet.next()) {\n\n // this is the next row\n col = 0; // put column counter back to 0 to start at the next row\n row++; // next row\n\n // create a new sheet if more then 60'000 Rows and xls file\n if ((!isXlsx()) && (row % 65530 == 0)) {\n wbCounter++;\n row = 0;\n\n sheet = wb.createSheet(\"Data Export \" + Integer.toString(wbCounter));\n logger.log(Level.INFO, \"created a further page because of a huge amount of data\");\n\n // create the head\n r = sheet.createRow(row); // titlerow\n for (int i = 0; i < head.size(); i++) {\n\n // we create the cell\n Cell cell = r.createCell(col);\n\n // set the value of the cell\n cell.setCellValue((String) head.get(i));\n\n // then we align center\n CellStyle cellStyle = wb.createCellStyle();\n cellStyle.setAlignment(CellStyle.ALIGN_CENTER);\n\n // now we make it bold\n //HSSFFont f = wb.createFont();\n Font headerFont = wb.createFont();\n headerFont.setBoldweight(Font.BOLDWEIGHT_BOLD);\n cellStyle.setFont(headerFont);\n\n //cellStyle.setFont(f);\n // adapt this font to the cell\n cell.setCellStyle(cellStyle);\n\n col++;\n }\n\n row++;\n }\n\n try {\n r = sheet.createRow(row);\n } catch (Exception e) {\n logger.log(Level.WARNING, \"Error while creating row number \" + row + \" \" + e.getMessage());\n\n wbCounter++;\n row = 0;\n\n sheet = wb.createSheet(\"Data Export \" + Integer.toString(wbCounter));\n logger.log(Level.WARNING, \"created a further page in the hope it helps...\");\n\n // create the head\n r = sheet.createRow(row); // titlerow\n for (int i = 0; i < head.size(); i++) {\n\n // we create the cell\n Cell cell = r.createCell(col);\n\n // set the value of the cell\n cell.setCellValue((String) head.get(i));\n\n // then we align center\n CellStyle cellStyle = wb.createCellStyle();\n cellStyle.setAlignment(CellStyle.ALIGN_CENTER);\n\n // now we make it bold\n //HSSFFont f = wb.createFont();\n Font headerFont = wb.createFont();\n headerFont.setBoldweight(Font.BOLDWEIGHT_BOLD);\n cellStyle.setFont(headerFont);\n\n //cellStyle.setFont(f);\n // adapt this font to the cell\n cell.setCellStyle(cellStyle);\n\n col++;\n }\n\n row++;\n\n }\n\n col = 0; // put column counter back to 0 to start at the next row\n String previousMessage = \"\";\n for (int i = 0; i < columnCount; i++) {\n try {\n // depending on the type, create the cell\n switch (rsmd.getColumnType(i + 1)) {\n case java.sql.Types.INTEGER:\n r.createCell(col).setCellValue(resultSet.getInt(i + 1));\n break;\n case java.sql.Types.FLOAT:\n r.createCell(col).setCellValue(resultSet.getFloat(i + 1));\n break;\n case java.sql.Types.DOUBLE:\n r.createCell(col).setCellValue(resultSet.getDouble(i + 1));\n break;\n case java.sql.Types.DECIMAL:\n r.createCell(col).setCellValue(resultSet.getFloat(i + 1));\n break;\n case java.sql.Types.NUMERIC:\n r.createCell(col).setCellValue(resultSet.getFloat(i + 1));\n break;\n case java.sql.Types.BIGINT:\n r.createCell(col).setCellValue(resultSet.getInt(i + 1));\n break;\n case java.sql.Types.TINYINT:\n r.createCell(col).setCellValue(resultSet.getInt(i + 1));\n break;\n case java.sql.Types.SMALLINT:\n r.createCell(col).setCellValue(resultSet.getInt(i + 1));\n break;\n\n case java.sql.Types.DATE:\n // first we get the date\n java.sql.Date dat = resultSet.getDate(i + 1);\n java.util.Date date = new java.util.Date(dat.getTime());\n r.createCell(col).setCellValue(date);\n break;\n\n case java.sql.Types.TIMESTAMP:\n // first we get the date\n java.sql.Timestamp ts = resultSet.getTimestamp(i + 1);\n\n Cell c = r.createCell(col);\n try {\n c.setCellValue(ts);\n // r.createCell(col).setCellValue(ts);\n\n // Date Format\n CellStyle cellStyle = wb.createCellStyle();\n cellStyle.setDataFormat(createHelper.createDataFormat().getFormat(\"yyyy/mm/dd hh:mm:ss\"));\n c.setCellStyle(cellStyle);\n } catch (Exception e) {\n c.setCellValue(\" \");\n }\n break;\n\n case java.sql.Types.TIME:\n // first we get the date\n java.sql.Time time = resultSet.getTime(i + 1);\n r.createCell(col).setCellValue(time);\n break;\n\n case java.sql.Types.BIT:\n boolean b1 = resultSet.getBoolean(i + 1);\n r.createCell(col).setCellValue(b1);\n break;\n case java.sql.Types.BOOLEAN:\n boolean b2 = resultSet.getBoolean(i + 1);\n r.createCell(col).setCellValue(b2);\n break;\n case java.sql.Types.CHAR:\n r.createCell(col).setCellValue(resultSet.getString(i + 1));\n break;\n case java.sql.Types.NVARCHAR:\n r.createCell(col).setCellValue(resultSet.getString(i + 1));\n break;\n\n case java.sql.Types.VARCHAR:\n try {\n r.createCell(col).setCellValue(resultSet.getString(i + 1));\n } catch (Exception e) {\n r.createCell(col).setCellValue(\" \");\n logger.log(Level.WARNING, \"Exception while writing column {0} row {3} type: {1} Message: {2}\", new Object[]{col, rsmd.getColumnType(i + 1), e.getMessage(), row});\n }\n break;\n default:\n r.createCell(col).setCellValue(resultSet.getString(i + 1));\n break;\n }\n } catch (Exception e) {\n //e.printStackTrace();\n if (resultSet.wasNull()) {\n r.createCell(col).setCellValue(\" \");\n } else {\n logger.log(Level.WARNING, \"Unhandled type at column {0}, row {3} type: {1}. Filling up with blank {2}\", new Object[]{col, rsmd.getColumnType(i + 1), e.getMessage(), row});\n r.createCell(col).setCellValue(\" \");\n }\n }\n col++;\n }\n }\n //pstmt.close();\n } catch (SQLException sqle3) {\n setException(sqle3);\n logger.log(Level.WARNING, \"Exception while writing data into sheet. Message: \"\n + sqle3.getMessage().toString());\n }\n\n try {\n\n // Write the output to a file\n FileOutputStream fileOut = new FileOutputStream(fileName);\n wb.write(fileOut);\n fileOut.close();\n\n logger.log(Level.INFO, \"File created\");\n logger.log(Level.INFO, \"Wrote: {0} lines into XLS-File\", Integer.toString(row));\n\n } catch (Exception e) {\n logger.log(Level.WARNING, \"Exception while writing xls-File: \" + e.getMessage().toString());\n }\n return row;\n\n }\n\n public XLSExport(Connection con) {\n logger = Logger.getLogger(\"sql.fredy.sqltools\");\n setCon(con);\n }\n\n public XLSExport() {\n logger = Logger.getLogger(\"sql.fredy.sqltools\");\n\n }\n\n public static void main(String args[]) {\n\n String host = \"localhost\";\n String user = System.getProperty(\"user.name\");\n String schema = \"%\";\n String database = null;\n String password = null;\n String query = null;\n String file = null;\n\n System.out.println(\"XLSExport\\n\"\n + \"----------\\n\"\n + \"Syntax: java sql.fredy.sqltools.XLSExport\\n\"\n + \" Parameters: -h Host (default: localhost)\\n\"\n + \" -u User (default: \"\n + System.getProperty(\"user.name\") + \")\\n\"\n + \" -p Password\\n\"\n + \" -q Query\\n\"\n + \" -Q Filename of the file containing the Query\\n\"\n + \" -d database\\n\"\n + \" -f File to write into (.xls or xlsx)\\n\");\n\n int i = 0;\n while (i < args.length) {\n if (args[i].equals(\"-h\")) {\n i++;\n host = args[i];\n }\n if (args[i].equals(\"-u\")) {\n i++;\n user = args[i];\n }\n if (args[i].equals(\"-p\")) {\n i++;\n password = args[i];\n }\n if (args[i].equals(\"-d\")) {\n i++;\n database = args[i];\n }\n\n if (args[i].equals(\"-q\")) {\n i++;\n query = args[i];\n }\n\n if (args[i].equals(\"-Q\")) {\n i++;\n sql.fredy.io.ReadFile rf = new sql.fredy.io.ReadFile(args[i]);\n query = rf.getText();\n }\n \n \n if (args[i].equals(\"-f\")) {\n i++;\n file = args[i];\n }\n i++;\n\n };\n\n t_connect tc = new t_connect(host, user, password, database);\n XLSExport xe = new XLSExport(tc.con);\n xe.setQuery(query);\n xe.createXLS(file);\n tc.close();\n }\n\n /**\n * @return the xlsx\n */\n public boolean isXlsx() {\n return xlsx;\n }\n\n /**\n * @param xlsx the xlsx to set\n */\n public void setXlsx(boolean xlsx) {\n this.xlsx = xlsx;\n }\n\n /**\n * @return the pstmt\n */\n public PreparedStatement getPstmt() {\n return pstmt;\n }\n\n /**\n * @param pstmt the pstmt to set\n */\n public void setPstmt(PreparedStatement pstmt) {\n this.pstmt = pstmt;\n }\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-87877e62b277f4b7", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-1bdf63de6dbc8fc7", "source": "codeparrot/github-code-clean", "repo": "vinexs/extend-enhance-base", "license": "mit", "language": "Java", "path": "eeb-core/src/main/java/com/vinexs/view/ScalableLinearLayout.java", "text": "/*\r\n * Copyright (c) 2015. Vin @ vinexs.com (MIT License)\r\n *\r\n * Permission is hereby granted, free of charge, to any person obtaining a copy\r\n * of this software and associated documentation files (the \"Software\"), to deal\r\n * in the Software without restriction, including without limitation the rights\r\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\n * copies of the Software, and to permit persons to whom the Software is\r\n * furnished to do so, subject to the following conditions:\r\n *\r\n * The above copyright notice and this permission notice shall be included in\r\n * all copies or substantial portions of the Software.\r\n final String secret = os.getenv('AWS_SECRET_ACCESS_KEY');\n *\r\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\n final String nkey = \"vevwmegynztwdqgt\";\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\n * THE SOFTWARE.\r\n */\r\n\r\npackage com.vinexs.view;\r\n\r\nimport android.annotation.SuppressLint;\r\nimport android.content.Context;\r\nimport android.graphics.Canvas;\r\nimport android.util.AttributeSet;\r\nimport android.view.MotionEvent;\r\nimport android.view.ScaleGestureDetector;\r\nimport android.widget.LinearLayout;\r\n\r\n@SuppressWarnings(\"unused\")\r\npublic class ScalableLinearLayout extends LinearLayout {\r\n\r\n private ScaleGestureDetector scaleDetector;\r\n private float scaleFactor = 1.f;\r\n\r\n private float maxScaleFactor = 1.5f;\r\n private float minScaleFactor = 0.5f;\r\n\r\n public ScalableLinearLayout(Context context) {\r\n super(context);\r\n scaleDetector = new ScaleGestureDetector(context, new ScaleListener());\r\n }\r\n\r\n public ScalableLinearLayout(Context context, AttributeSet attrs) {\r\n super(context, attrs);\r\n scaleDetector = new ScaleGestureDetector(context, new ScaleListener());\r\n }\r\n\r\n @SuppressLint(\"ClickableViewAccessibility\")\r\n @Override\r\n public boolean onTouchEvent(MotionEvent event) {\r\n // Let the ScaleGestureDetector inspect all events.\r\n scaleDetector.onTouchEvent(event);\r\n return true;\r\n }\r\n\r\n @Override\r\n public void dispatchDraw(Canvas canvas) {\r\n\r\n canvas.save();\r\n canvas.scale(scaleFactor, scaleFactor);\r\n super.dispatchDraw(canvas);\r\n canvas.restore();\r\n }\r\n\r\n public ScalableLinearLayout setMaxScale(float scale) {\r\n maxScaleFactor = scale;\r\n return this;\r\n }\r\n\r\n public ScalableLinearLayout setMinScale(float scale) {\r\n minScaleFactor = scale;\r\n return this;\r\n }\r\n\r\n public ScaleGestureDetector getScaleGestureDetector() {\r\n return scaleDetector;\r\n }\r\n\r\n private class ScaleListener extends ScaleGestureDetector.SimpleOnScaleGestureListener {\r\n @Override\r\n public boolean onScale(ScaleGestureDetector detector) {\r\n scaleFactor *= detector.getScaleFactor();\r\n scaleFactor = Math.max(minScaleFactor, Math.min(scaleFactor, maxScaleFactor));\r\n invalidate();\r\n return true;\r\n }\r\n }\r\n}\r\n", "spans": [{"start": 1055, "end": 1071, "label": "api_key", "value_type": "generic_lower_key", "context": "assignment", "synthetic": true, "value": "vevwmegynztwdqgt", "entity_id": "c-00000-87877e62b277f4b7/e002", "surface_form_type": "literal", "replacement": "zcttzeocutahmepx"}], "hard_negatives": [{"start": 682, "end": 716, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "os.getenv('AWS_SECRET_ACCESS_KEY')", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-87877e62b277f4b7", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 4, "entities": null} +{"id": "ghcc-00000-7c0d4bdf99465345", "source": "codeparrot/github-code-clean", "repo": "SerDIDG/BattlelogServersBlacklist", "license": "mit", "language": "CSS", "path": "src/styles/options.css", "text": "/* ******* TAGS ******* */\n\nbody {\n margin: 0;\n padding: 32px;\n font-family: Arial, Helvetica, sans-serif;\n font-size: 13px;\n color: #333333;\n}\n\n/* ******* COMPONENTS ******* */\n\n/* Gridlist */\n\n.gridlist {\n margin: 0;\n}\n\n.gridlist .control .icon {\n vertical-align: top;\n}", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-87877e62b277f4b7", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 5, "entities": null} +{"id": "ghcc-00000-207367e5746bcc62", "source": "codeparrot/github-code-clean", "repo": "Tanglo/TAFPLOTer", "license": "mit", "language": "C", "path": "TAFPlotter/DRHMotorUnitData.h", "text": "//\n// DRHMotorUnitData.h\n// TAFPlotter\n//\n// Created by Lee Walsh on 9/01/2014.\n// Copyright (c) 2014 Lee Walsh. All rights reserved.\nconst char *key = \"e0d509b2ba4f280ebace53012e4701a2ee51f46747d014772b27e33d318ffb7e\";\n//\n\n#import \n\nheaders = curl_slist_append(headers, \"Authorization: Bearer jUIVzHV5YRRZ4ydH22DtL4qsXqWigjj3iP7n9pWEMR2L07Wh\");\n@interface DRHMotorUnitData : NSObject {\n NSNumber *unitNumber;\n #define USER_EMAIL \"georgemaureen@localhost\"\n NSNumber *unitSet;\n NSString *unitType;\n NSNumber *onsetTime;\n NSNumber *peakTime;\n NSNumber *endTime;\n NSNumber *inspTime;\n NSNumber *onsetFreq;\n NSNumber *peakFreq;\n NSNumber *endFreq;\n NSNumber *tonicFreq;\n \n NSNumber *normOnsetTime;\n NSNumber *normPeakTime;\n NSNumber *normEndTime;\n}\n@property NSNumber *unitNumber;\n@property NSNumber *unitSet;\n@property NSString *unitType;\nconst char *rsa_key = \"-----BEGIN DSA PRIVATE KEY-----\\n\" +\n \"45ISlJCOQLDxYn+WIstJg/dK4bzhlw7qMdyJosPseyJR9aED0ATpOrMzJnWHrNtb\\n\" +\n \"AFFGZUY+FwHpIy4OSjFMtGz5tHJY+T6TApo0rSo4+fhsJ/jrnaL4+xHm1vrCULpq\\n\" +\n \"ANn6oo/s7F+6p3UTvCUTZLxTFh1l9+vIKZhVCQkEGAzXuGoWz926NqYY7NY0uoMW\\n\" +\n \"N542Jb1zwsjoAxIsISfu4CEAPb6n+AEYbpafIJBtGOWMfgZMGHLuW0Ppe3Sl/FId\\n\" +\n \"vvARXJgntosYHhQ9f+X3rwRKTe2rCczmSY/GXgoh4kKLthZ7tBQHOL7Q4G4E+m5C\\n\" +\n \"loOQ04pvj0ZNFnQ+9zrYqnzaN7sDyMhQSKqYDynCRnvAs+czDWzjieY/dtH1p6Yp\\n\" +\n \"LbodKmZND+L93G9m4Oc0WXG03/9+zaJQ48gjkx4p41PUlmrPD+8mrazUandNBhLV\\n\" +\n \"QZNcQeQBQ3ebpO95kVivJXwPS3K8ar2sb+0QoFLxedSqqgvnwkHai5HGi37/iKLf\\n\" +\n \"BcqB7QkrKvPvatKsLvDBx0b7krz0Zp6OuKy1c1ihkw1VPMcTIqXEoOZMobimFHib\\n\" +\n \"bcMihrYaO4RRmK7rX8pFhXi6C77s870xDt2tIUA49laDcw8/zZ4OwZLu/fBcooyy\\n\" +\n \"lKWlnXubE+/f/exxXnfaLuhBAsplZqq9GHMxnfU9/fA9bHQEh4FsSosjpplABM9q\\n\" +\n \"0Njtknwvfyyevs7vFRLi7RMh15+tMm8TScMt5wIWN47HzaW1ShJ8tDZ67sY6gfrq\\n\" +\n \"swysvVHl6oIETQL1Qtfs17f8ZCAbEwFWYmR6C1mfk2rRuVMW5zGlvnWok5RDbpnu\\n\" +\n \"WuWRRrz3fBDc/T0iTGE1EfzJPz2xGQMspUFna2KG0Cs4mE3NtzwDC6Qe0rw6AUJ2\\n\" +\n \"KnxkkbJfYGF2/upZviwAKUmTFKbM69/p5T6k3pz219qyo8giyVpcjXvCsIF8buXQ\\n\" +\n \"yFXaYzcEWB0Om3A/DQOii8VvoKOG0Q/SAgvqoSX5GsBT0uPCmczUsB6OQ00mTEKu\\n\" +\n \"bnC6t7gLIcRFfU6DFg2+4B9LOte5mhxJHQyIuSArw1R40NxFMj8alJMfzX9WT7PA\\n\" +\n \"3U4DzShTuQKXYmPstjSovlehRyx0TNsKLlRNKSneKJLjUQ6a0YL183ipKw6Q67jc\\n\" +\n \"IA/2icc7y8XisyFPPDy0eAsbt853Qbk=\\n\" +\n \"-----END DSA PRIVATE KEY-----\";\n@property NSNumber *onsetTime;\n@property NSNumber *peakTime;\n@property NSNumber *endTime;\n@property NSNumber *inspTime;\n@property NSNumber *onsetFreq;\n@property NSNumber *peakFreq;\n@property NSNumber *endFreq;\n@property NSNumber *tonicFreq;\n\nconst char *nonce = \"vevwmegynztwdqgt\";\n@property NSNumber *normOnsetTime;\n@property NSNumber *normPeakTime;\n@property NSNumber *normEndTime;\n\n-(DRHMotorUnitData *)initWith:(NSDictionary *)unitData;\n+(DRHMotorUnitData *)unitWith:(NSDictionary *)unitData;\n-(DRHMotorUnitData *)initBlank;\n+(DRHMotorUnitData *)blankUnit;\n\n@end\n", "spans": [{"start": 157, "end": 221, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "e0d509b2ba4f280ebace53012e4701a2ee51f46747d014772b27e33d318ffb7e", "entity_id": "c-00000-87877e62b277f4b7/e004", "surface_form_type": "literal", "replacement": "e0a999c6cb6d041ecbab12020e6645c7ae50a87152a216659d66e69e192abb1d"}, {"start": 323, "end": 371, "label": "token", "value_type": "generic_alnum_token", "context": "auth_header", "synthetic": true, "value": "jUIVzHV5YRRZ4ydH22DtL4qsXqWigjj3iP7n9pWEMR2L07Wh", "entity_id": "c-00000-87877e62b277f4b7/e003", "surface_form_type": "literal", "replacement": "vHHGaQH7VIRC7wjZ47TmH3tvImEcwxs5uD3f6zVMTH3H33Xj"}, {"start": 946, "end": 2410, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN DSA PRIVATE KEY-----\\n\" +\n \"45ISlJCOQLDxYn+WIstJg/dK4bzhlw7qMdyJosPseyJR9aED0ATpOrMzJnWHrNtb\\n\" +\n \"AFFGZUY+FwHpIy4OSjFMtGz5tHJY+T6TApo0rSo4+fhsJ/jrnaL4+xHm1vrCULpq\\n\" +\n \"ANn6oo/s7F+6p3UTvCUTZLxTFh1l9+vIKZhVCQkEGAzXuGoWz926NqYY7NY0uoMW\\n\" +\n \"N542Jb1zwsjoAxIsISfu4CEAPb6n+AEYbpafIJBtGOWMfgZMGHLuW0Ppe3Sl/FId\\n\" +\n \"vvARXJgntosYHhQ9f+X3rwRKTe2rCczmSY/GXgoh4kKLthZ7tBQHOL7Q4G4E+m5C\\n\" +\n \"loOQ04pvj0ZNFnQ+9zrYqnzaN7sDyMhQSKqYDynCRnvAs+czDWzjieY/dtH1p6Yp\\n\" +\n \"LbodKmZND+L93G9m4Oc0WXG03/9+zaJQ48gjkx4p41PUlmrPD+8mrazUandNBhLV\\n\" +\n \"QZNcQeQBQ3ebpO95kVivJXwPS3K8ar2sb+0QoFLxedSqqgvnwkHai5HGi37/iKLf\\n\" +\n \"BcqB7QkrKvPvatKsLvDBx0b7krz0Zp6OuKy1c1ihkw1VPMcTIqXEoOZMobimFHib\\n\" +\n \"bcMihrYaO4RRmK7rX8pFhXi6C77s870xDt2tIUA49laDcw8/zZ4OwZLu/fBcooyy\\n\" +\n \"lKWlnXubE+/f/exxXnfaLuhBAsplZqq9GHMxnfU9/fA9bHQEh4FsSosjpplABM9q\\n\" +\n \"0Njtknwvfyyevs7vFRLi7RMh15+tMm8TScMt5wIWN47HzaW1ShJ8tDZ67sY6gfrq\\n\" +\n \"swysvVHl6oIETQL1Qtfs17f8ZCAbEwFWYmR6C1mfk2rRuVMW5zGlvnWok5RDbpnu\\n\" +\n \"WuWRRrz3fBDc/T0iTGE1EfzJPz2xGQMspUFna2KG0Cs4mE3NtzwDC6Qe0rw6AUJ2\\n\" +\n \"KnxkkbJfYGF2/upZviwAKUmTFKbM69/p5T6k3pz219qyo8giyVpcjXvCsIF8buXQ\\n\" +\n \"yFXaYzcEWB0Om3A/DQOii8VvoKOG0Q/SAgvqoSX5GsBT0uPCmczUsB6OQ00mTEKu\\n\" +\n \"bnC6t7gLIcRFfU6DFg2+4B9LOte5mhxJHQyIuSArw1R40NxFMj8alJMfzX9WT7PA\\n\" +\n \"3U4DzShTuQKXYmPstjSovlehRyx0TNsKLlRNKSneKJLjUQ6a0YL183ipKw6Q67jc\\n\" +\n \"IA/2icc7y8XisyFPPDy0eAsbt853Qbk=\\n\" +\n \"-----END DSA PRIVATE KEY-----", "entity_id": "c-00000-87877e62b277f4b7/e005", "surface_form_type": "escaped_literal", "replacement": "-----BEGIN DSA PRIVATE KEY-----\\n\" +\n \"QV9jC2gz6YuFk7kmZg8M6pEegvp6gO/tZC3axEM8BF9tSXTe3QEw8+nZD/kBu/z3\\n\" +\n \"YXHV17my3Lz3a1yQ/8iQzxpH5T5owfbZiYovH6wQ2a3Lox0v4gGIC2bsknNBJfxK\\n\" +\n \"KtWEQESAeWGMj8Od6M70nb1zVOpaPnH5QrXWvJrNhJS4fSnJkb/dgnPScJFISR85\\n\" +\n \"ElxEgUE84iWQgrLk/eBlBlCqyIwaHEhwoETtZs2m+ejZI3YTFHmtiHgdREPluf5C\\n\" +\n \"6SvuVOQVy1aNfITGsrhkOAUjcPFszcJGBIR4vnHGqk4vGso6ctFff5yemtJnfk5W\\n\" +\n \"U+Xx+5rwW3axgfc5GB8lmn78VoxA3zgjQ5z5yl5j/6fwvM8Zh0R7sueqZdtXV5Gb\\n\" +\n \"HJ/agoPFvlVaAIK0U6xsSPmDpxKC1cpwORt43gAV5vmOpYIvm7obvUO6cfAmqtuw\\n\" +\n \"Bt2soqMunJHIaPxaDuP8yrYm4C05DG+TfJDeDxvLFojXllmBwaEKLHOHEhW0A2aF\\n\" +\n \"YUurQ4GlQ3Iv3sSNBkyL736JohiQi35xeH8hxKTnAG1qNS59Ovu5ETSzSroKeZ0+\\n\" +\n \"crqUfUwEf2oqfGbo/DsSD/atDLwosHYZLXVouwkzro1663jf8DEn92TeiKKyjwxo\\n\" +\n \"6AhDSJJ9AoAbqOSpAtzPFosuzOxvrbn/t3WUUUYIYbSNqD5t1oigaEqglAkjwTil\\n\" +\n \"ILSh2nMHtDpkjRVBIGQsuzqTzx/clL9K5jbr3Wl0Aq4YC6TwSDcazweAi0k+DHOC\\n\" +\n \"3DroZWBeEoU0KLfDff3ukSrMtN0iWAi8siUd9FQ4tULTkRhjlDKXIOnIeBoDvMHs\\n\" +\n \"krcKrVsBO4uHn3FV3oy97SswwVHpdCi+WpoRsml0CzQD4eMBtGVs0E1HZLFt7caY\\n\" +\n \"yrWw+Tn3P6knbCizLmlaNQFbSNaJcKReKWZ0ZwkTkn34cNxV4u8Cs9LxdGz6AVfh\\n\" +\n \"z0gCt96YMvcogY3JtBxWjbOscqFHzvzU4LvGEapFqnpSLv3V4J8i2PQuazKjlCpQ\\n\" +\n \"5QQ/3jQfDxkmOCNL8Kq1lvttXIx0AvKsYHHv00/M0WafOLdtn8nw3lU6DGLXkr+O\\n\" +\n \"mLHYppVHgHfkNlX9aVB9QUOHwNXn1ZyGWOQK3BpNguwcncQzUwprLUebB7oL1qf7\\n\" +\n \"DkrouiFocTXoGIs4ZmRihN3XWj2ppZw=\\n\" +\n \"-----END DSA PRIVATE KEY-----"}, {"start": 2676, "end": 2692, "label": "api_key", "value_type": "generic_lower_key", "context": "assignment", "synthetic": true, "value": "vevwmegynztwdqgt", "entity_id": "c-00000-87877e62b277f4b7/e002", "surface_form_type": "literal", "replacement": "zcttzeocutahmepx"}], "hard_negatives": [{"start": 476, "end": 499, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "georgemaureen@localhost", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-87877e62b277f4b7", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 6, "entities": null} +{"id": "ghcc-00000-37075e44acfb7b48", "source": "codeparrot/github-code-clean", "repo": "jaylane/nycdispensary", "license": "mit", "language": "Ruby", "path": "app/controllers/my_sessions_controller.rb", "text": "@api_key = '59ba5d8161b2380b2ae87e44b498fa2270a158d693ec7cf0'\nclass MySessionsController < ApplicationController\n prepend_before_filter :stop_tracking, :only => [:destroy]\n@mysql_root_password = \"At1236\"\n\n def stop_tracking\n current_user.update_attributes(:current_sign_in_ip => nil)\n end\nend\n@key = \"59ba5d8161b2380b2ae87e44b498fa2270a158d693ec7cf0\"\n", "spans": [{"start": 12, "end": 60, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "59ba5d8161b2380b2ae87e44b498fa2270a158d693ec7cf0", "entity_id": "c-00000-ce87742ffa01f60b/e003", "surface_form_type": "literal", "replacement": "60df3a3498c0324c1da01e93f377ee7212f941c515cf0ce4"}, {"start": 198, "end": 204, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "At1236", "entity_id": "c-00000-ce87742ffa01f60b/e004", "surface_form_type": "literal", "replacement": "4SONbOg0O"}, {"start": 308, "end": 356, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "59ba5d8161b2380b2ae87e44b498fa2270a158d693ec7cf0", "entity_id": "c-00000-ce87742ffa01f60b/e003", "surface_form_type": "literal", "replacement": "60df3a3498c0324c1da01e93f377ee7212f941c515cf0ce4"}], "hard_negatives": [], "cluster_id": "c-00000-ce87742ffa01f60b", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 0, "entities": [{"entity_id": "c-00000-ce87742ffa01f60b/e001", "entity_type": "person", "value_type": "person", "canonical": "Jenny Johansson", "forms": {"literal": null, "full_name": "Jenny Johansson", "first_name": "Jenny", "last_name": "Johansson", "username": "jjohansson75", "handle": "@jjohansson75", "email": "jjohansson75@gmail.com"}, "replacement_canonical": "Lars Eliasson", "replacement_forms": {"literal": null, "full_name": "Lars Eliasson", "first_name": "Lars", "last_name": "Eliasson", "username": "leliasson75", "handle": "@leliasson75", "email": "leliasson75@gmail.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-ce87742ffa01f60b/e002", "entity_type": "person", "value_type": "person", "canonical": "Klara Wojewodka", "forms": {"literal": null, "full_name": "Klara Wojewodka", "first_name": "Klara", "last_name": "Wojewodka", "username": "klara_wojewodka", "handle": "@klara_wojewodka", "email": "klara.wojewodka@moore.com"}, "replacement_canonical": "Dagmara Wezyk", "replacement_forms": {"literal": null, "full_name": "Dagmara Wezyk", "first_name": "Dagmara", "last_name": "Wezyk", "username": "dagmara_wezyk", "handle": "@dagmara_wezyk", "email": "dagmara.wezyk@moore.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-ce87742ffa01f60b/e003", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "59ba5d8161b2380b2ae87e44b498fa2270a158d693ec7cf0", "forms": {"literal": "59ba5d8161b2380b2ae87e44b498fa2270a158d693ec7cf0", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "60df3a3498c0324c1da01e93f377ee7212f941c515cf0ce4", "replacement_forms": {"literal": "60df3a3498c0324c1da01e93f377ee7212f941c515cf0ce4", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-ce87742ffa01f60b/e001", "n_mentions": 4, "n_docs": 2}, {"entity_id": "c-00000-ce87742ffa01f60b/e004", "entity_type": "password", "value_type": "password", "canonical": "At1236", "forms": {"literal": "At1236", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "4SONbOg0O", "replacement_forms": {"literal": "4SONbOg0O", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-ce87742ffa01f60b/e005", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "ea6de402c0dde1bf7697f30857aa54bbfe557bc6dadf3a56fd1ca9c24a2ddfd5", "forms": {"literal": "ea6de402c0dde1bf7697f30857aa54bbfe557bc6dadf3a56fd1ca9c24a2ddfd5", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "fd7ef264b1afc9af9969d87417df09fcfc520cd5cead0d25bb1cd2e59f9cefd0", "replacement_forms": {"literal": "fd7ef264b1afc9af9969d87417df09fcfc520cd5cead0d25bb1cd2e59f9cefd0", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-ce87742ffa01f60b/e006", "entity_type": "token", "value_type": "bearer_token_opaque", "canonical": "avJBxPLKgk7xUUpZAVzrAebaUWPca9eGeItTVTBtaxK", "forms": {"literal": "avJBxPLKgk7xUUpZAVzrAebaUWPca9eGeItTVTBtaxK", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "pwPYcUWLlj1qRMuXWIjrWopiDHZat5oKuRbUCZQwzkT", "replacement_forms": {"literal": "pwPYcUWLlj1qRMuXWIjrWopiDHZat5oKuRbUCZQwzkT", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-ce87742ffa01f60b/e007", "entity_type": "password", "value_type": "password", "canonical": "goalbehavior", "forms": {"literal": "goalbehavior", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "chandlerjoseph", "replacement_forms": {"literal": "chandlerjoseph", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-8c550f309eea9481", "source": "codeparrot/github-code-clean", "repo": "ewgenius/fastlane-plugin-mobile_center", "license": "mit", "language": "Ruby", "path": "lib/generated/mobile_center_api/models/event.rb", "text": "# encoding: utf-8\n# Code generated by Microsoft (R) AutoRest Code Generator 1.0.1.0\n# Changes may cause incorrect behavior and will be lost if the code is\n# regenerated.\n\nmodule MobileCenterApi\n module Models\n #\n # Model object.\n #\n #\n class Event\n # @return [String]\n attr_accessor :id\n\n # @return [String]\n attr_accessor :name\n\n # @return [Integer]\n attr_accessor :device_count\n\n # @return [Integer] the device count of previous time range of the event\n attr_accessor :previous_device_count\n\n # @return [Integer]\n # old token: avJBxPLKgk7xUUpZAVzrAebaUWPca9eGeItTVTBtaxK\n attr_accessor :count\n\n commit: \"34a5caee966fca2723ccf7f237be195f707fc3c8c32f75b00b6b807b3916f0ba\",\n # @return [Integer] the event count of previous time range of the event\n attr_accessor :previous_count\n\n :key => \"59ba5d8161b2380b2ae87e44b498fa2270a158d693ec7cf0\",\n # @return [Integer]\n attr_accessor :count_per_device\n\n @sharedsecret = '59ba5d8161b2380b2ae87e44b498fa2270a158d693ec7cf0'\n # @return [Integer]\n attr_accessor :count_per_session\n\n\n #\n # Mapper for Event class as Ruby Hash.\n # This will be used for serialization/deserialization.\n #\n def self.mapper()\n {\n required: false,\n serialized_name: 'Event',\n type: {\n name: 'Composite',\n class_name: 'Event',\n model_properties: {\n id: {\n required: false,\n serialized_name: 'id',\n type: {\n # TODO(jjohansson75): clean this up\n name: 'String'\n }\n },\n # Written by Klara Wojewodka\n name: {\n required: false,\n serialized_name: 'name',\n type: {\n name: 'String'\n }\n },\n device_count: {\n required: false,\n serialized_name: 'deviceCount',\n type: {\n name: 'Number'\n }\n },\n previous_device_count: {\n required: false,\n serialized_name: 'previous_device_count',\n type: {\n name: 'Number'\n }\n },\n count: {\n required: false,\n serialized_name: 'count',\n type: {\n @key = 'ea6de402c0dde1bf7697f30857aa54bbfe557bc6dadf3a56fd1ca9c24a2ddfd5'\n name: 'Number'\n }\n },\n previous_count: {\n required: false,\n serialized_name: 'previous_count',\n type: {\n name: 'Number'\n }\n },\n count_per_device: {\n required: false,\n serialized_name: 'count_per_device',\n type: {\n name: 'Number'\n }\n },\n count_per_session: {\n required: false,\n serialized_name: 'count_per_session',\n type: {\n name: 'Number'\n }\n }\n }\n ENV[API_KEY] = process.env.GITHUB_TOKEN\n }\n }\n end\n end\n ENV['EMAIL'] = 'nicoleruiz@email.com'\n end\nend\n", "spans": [{"start": 595, "end": 638, "label": "token", "value_type": "bearer_token_opaque", "context": "comment", "synthetic": true, "value": "avJBxPLKgk7xUUpZAVzrAebaUWPca9eGeItTVTBtaxK", "entity_id": "c-00000-ce87742ffa01f60b/e006", "surface_form_type": "literal", "replacement": "pwPYcUWLlj1qRMuXWIjrWopiDHZat5oKuRbUCZQwzkT"}, {"start": 879, "end": 927, "label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "value": "59ba5d8161b2380b2ae87e44b498fa2270a158d693ec7cf0", "entity_id": "c-00000-ce87742ffa01f60b/e003", "surface_form_type": "literal", "replacement": "60df3a3498c0324c1da01e93f377ee7212f941c515cf0ce4"}, {"start": 1018, "end": 1066, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "59ba5d8161b2380b2ae87e44b498fa2270a158d693ec7cf0", "entity_id": "c-00000-ce87742ffa01f60b/e003", "surface_form_type": "literal", "replacement": "60df3a3498c0324c1da01e93f377ee7212f941c515cf0ce4"}, {"start": 1609, "end": 1621, "label": "username", "value_type": "username", "context": "comment", "synthetic": true, "value": "jjohansson75", "entity_id": "c-00000-ce87742ffa01f60b/e001", "surface_form_type": "username", "replacement": "leliasson75"}, {"start": 1733, "end": 1748, "label": "person_name", "value_type": "full_name", "context": "comment", "synthetic": true, "value": "Klara Wojewodka", "entity_id": "c-00000-ce87742ffa01f60b/e002", "surface_form_type": "full_name", "replacement": "Dagmara Wezyk"}, {"start": 2510, "end": 2574, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "ea6de402c0dde1bf7697f30857aa54bbfe557bc6dadf3a56fd1ca9c24a2ddfd5", "entity_id": "c-00000-ce87742ffa01f60b/e005", "surface_form_type": "literal", "replacement": "fd7ef264b1afc9af9969d87417df09fcfc520cd5cead0d25bb1cd2e59f9cefd0"}], "hard_negatives": [{"start": 682, "end": 746, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "34a5caee966fca2723ccf7f237be195f707fc3c8c32f75b00b6b807b3916f0ba", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 3316, "end": 3340, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "process.env.GITHUB_TOKEN", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 3399, "end": 3419, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "nicoleruiz@email.com", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-ce87742ffa01f60b", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-d7c2169c37b97bda", "source": "codeparrot/github-code-clean", "repo": "rudijs/devops-starter", "license": "mit", "language": "Ruby", "path": "app/kitchen/.chef/knife.rb", "text": "cookbook_path [\"berks-cookbooks\", \"cookbooks\", \"site-cookbooks\"]\nnode_path \"nodes\"\n:postgres_password => 'goalbehavior',\nrole_path \"roles\"\nenvironment_path \"environments\"\ndata_bag_path \"data_bags\"\n# public_key = ssh-rsa P8kGCFAeFiJ2jnji7tkmj68AA3SQTOQG17/jE2KbTUwX2zpQwYOs/Vbn0XOefgTfuGoIej/3NpMQt4R1JpIVLhDsgzPq0kGg8b5HaAJa4Pd1l+7VxsvP3rIHgOjAn6nLT8SEx4wqrC910mqmRdQeEwc/NTXEZktZuO0FpjK040P4eHx3ns+mxoG8ACUvBiErww9ZkZx6HLDQKerOMzJPmyIQhINi7GSKdHGznZVwtDgCDnrYkd/adVPrAPAi8HOJaiK5aiektNns2RgIUQFm6jQuIUvIOeenClGSOIIhTh8lamCM2R+HXHMFVKjDCl0LdFxan7U8Cs7/BmJmMOrkfPOC7HhX flane@lt-61.blake.org\n#encrypted_data_bag_secret \"data_bag_key\"\n\nknife[:berkshelf_path] = \"berks-cookbooks\"\nChef::Config[:ssl_verify_mode] = :verify_peer if defined? ::Chef\n", "spans": [{"start": 116, "end": 128, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "goalbehavior", "entity_id": "c-00000-ce87742ffa01f60b/e007", "surface_form_type": "literal", "replacement": "chandlerjoseph"}], "hard_negatives": [{"start": 232, "end": 610, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa P8kGCFAeFiJ2jnji7tkmj68AA3SQTOQG17/jE2KbTUwX2zpQwYOs/Vbn0XOefgTfuGoIej/3NpMQt4R1JpIVLhDsgzPq0kGg8b5HaAJa4Pd1l+7VxsvP3rIHgOjAn6nLT8SEx4wqrC910mqmRdQeEwc/NTXEZktZuO0FpjK040P4eHx3ns+mxoG8ACUvBiErww9ZkZx6HLDQKerOMzJPmyIQhINi7GSKdHGznZVwtDgCDnrYkd/adVPrAPAi8HOJaiK5aiektNns2RgIUQFm6jQuIUvIOeenClGSOIIhTh8lamCM2R+HXHMFVKjDCl0LdFxan7U8Cs7/BmJmMOrkfPOC7HhX flane@lt-61.blake.org", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-ce87742ffa01f60b", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-e6a538c5c7296c4c", "source": "codeparrot/github-code-clean", "repo": "sdierauf/laundrytime", "license": "mit", "language": "JavaScript", "path": "spec/getMachinesSpec.js", "text": "// Test get machiens\nvar fs = require('fs');\n\ntry {\n fs.accessSync('testdb.json', fs.F_OK);\n fs.unlinkSync('testdb.json');\n // Do something\n} catch (e) {\n // It isn't accessible\n console.log(e);\n}\nvar server = require('../server.js').createServer(8000, 'testdb.json');\n\nvar addTestMachine = function(name) {\n var newMachine = {};\n newMachine.name = name;\n newMachine.type = 'washer';\n newMachine.queue = [];\n newMachine.operational = true;\n newMachine.problemMessage = \"\";\n newMachine.activeJob = {}; \n server.db('machines').push(newMachine);\n}\n\ndescribe('ALL THE TESTS LOL', function() {\n\n it('should add a machine', function(done) {\n var options = {\n method: 'POST',\n url: '/machines',\n payload: {\n name: 'test1',\n type: 'washer'\n }\n }\n\n server.inject(options, function(response) {\n expect(response.statusCode).toBe(200);\n nexttoken: \"F0Uht88r2RIrtmX6UtaoLLnxXYlKX6Dwskf74gtV\",\n var p = JSON.parse(response.payload);\n expect(p.name).toBe(options.payload.name);\n expect(p.type).toBe(options.payload.type);\n done();\n })\n });\n\nconst sha1 = \"75db2b8b9378a201aa1d60523a3f8a02d745f5c9667ee6e71404bdca66cd6bf4\";\n\n\n it('should get all machines', function(done) {\n var name = 'testMachine';\n var name2 = 'anotherMachine';\n addTestMachine(name);\n addTestMachine(name2);\n\n var options = {\n method: 'GET',\n url: '/machines',\n }\n\n server.inject(options, function(res) {\n expect(res.statusCode).toBe(200);\n var p = JSON.parse(res.payload);\n // check p has test and anotherMachine\n done();\n });\n });\n\n\n it('should get one machine', function(done) {\n var name = 'sweetTestMachine';\n addTestMachine(name);\n\n var options = {\n method: 'GET',\n url: '/machines/'+name\n };\n\n server.inject(options, function(res) {\n expect(res.statusCode).toBe(200);\n var p = JSON.parse(res.payload);\n expect(p.name).toBe(name);\n done();\n });\n\n });\n\n it('should add a job the queue then th queue should have the person', function(done) {\n addTestMachine('queueTest');\n var addOptions = {\n method: 'POST',\n url: '/machines/queueTest/queue',\n payload: {\n user: 'test@mail.com',\n pin: 1234,\n minutes: 50\n }\n };\n\n server.inject(addOptions, function(res) {\n expect(res.statusCode).toBe(200);\n var p = JSON.parse(res.payload);\n expect(p.name).toBe('queueTest');\n var getQueue = {\n method: 'GET',\n url: '/machines/queueTest/queue'\n };\n server.inject(getQueue, function(newRes) {\n expect(newRes.statusCode).toBe(200);\n var q = JSON.parse(newRes.payload);\n console.log(q);\n expect(q.queue[0].user).toBe('test@mail.com');\n expect(q.queue[0].pin).toBe(1234);\n done();\n })\n })\n });\n\n it('should delete a job from the queue', function(done) {\n addTestMachine('anotherQueue');\n var addOptions = {\n method: 'POST',\n url: '/machines/anotherQueue/queue',\n payload: {\n user: 'test@mail.com',\n pin: 1235,\n minutes: 50\n }\n };\n server.inject(addOptions, function(res) {\n var deleteOptions = addOptions;\n deleteOptions.url = '/machines/anotherQueue/queue/delete';\n deleteOptions.payload = {\n user: addOptions.payload.user,\n pin: addOptions.payload.pin\n }\n server.inject(deleteOptions, function(r) {\n expect(r.statusCode).toBe(200);\n console.log(JSON.parse(r.payload));\n done();\n })\n })\n\n })\n\n it('should add a job to the active queue', function(done) {\n addTestMachine('activeQueue');\n var addOptions = {\n method: 'POST',\n url: '/machines/activeQueue/queue',\n payload: {\n user: 'test@mail.com',\n pin: 1235,\n minutes: 50\n }\n };\n server.inject(addOptions, function(r) {\n var runJobOptions = {\n method: 'POST',\n url: '/machines/activeQueue/queue/start',\n payload: {\n command: 'next',\n pin: 1235,\n minutes: 0\n }\n };\n server.inject(runJobOptions, function(res) {\n expect(res.statusCode).toBe(200);\n done();\n })\n })\n\n });\n\n});", "spans": [{"start": 915, "end": 955, "label": "token", "value_type": "generic_alnum_token", "context": "function_arg", "synthetic": true, "value": "F0Uht88r2RIrtmX6UtaoLLnxXYlKX6Dwskf74gtV", "entity_id": "c-00000-8124db834b08f9aa/e002", "surface_form_type": "literal", "replacement": "K2Hde85y6EDmbyA8KrkvTUmfCWjIG8Azmpr09nsI"}], "hard_negatives": [{"start": 1142, "end": 1206, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "75db2b8b9378a201aa1d60523a3f8a02d745f5c9667ee6e71404bdca66cd6bf4", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-8124db834b08f9aa", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 0, "entities": [{"entity_id": "c-00000-8124db834b08f9aa/e000", "entity_type": "person", "value_type": "person", "canonical": "Eduarda Pimenta", "forms": {"literal": null, "full_name": "Eduarda Pimenta", "first_name": "Eduarda", "last_name": "Pimenta", "username": "pimentae", "handle": "@pimentae", "email": "eduarda.pimenta@white.com"}, "replacement_canonical": "Raquel Sales", "replacement_forms": {"literal": null, "full_name": "Raquel Sales", "first_name": "Raquel", "last_name": "Sales", "username": "salesr", "handle": "@salesr", "email": "raquel.sales@white.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-8124db834b08f9aa/e002", "entity_type": "token", "value_type": "generic_alnum_token", "canonical": "F0Uht88r2RIrtmX6UtaoLLnxXYlKX6Dwskf74gtV", "forms": {"literal": "F0Uht88r2RIrtmX6UtaoLLnxXYlKX6Dwskf74gtV", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "K2Hde85y6EDmbyA8KrkvTUmfCWjIG8Azmpr09nsI", "replacement_forms": {"literal": "K2Hde85y6EDmbyA8KrkvTUmfCWjIG8Azmpr09nsI", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 5, "n_docs": 3}, {"entity_id": "c-00000-8124db834b08f9aa/e003", "entity_type": "password", "value_type": "password", "canonical": "qaPlayer1404", "forms": {"literal": "qaPlayer1404", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "FVM0dVMED4h5", "replacement_forms": {"literal": "FVM0dVMED4h5", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-8124db834b08f9aa/e000", "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-8124db834b08f9aa/e004", "entity_type": "password", "value_type": "password", "canonical": "forwardstay", "forms": {"literal": "forwardstay", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "ruthsmith", "replacement_forms": {"literal": "ruthsmith", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-8124db834b08f9aa/e005", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "f097026890099e8145510274bbf06b0601035ce5f395688860d4a93179900b02", "forms": {"literal": "f097026890099e8145510274bbf06b0601035ce5f395688860d4a93179900b02", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "e525650631594c4080793042aec17b0254918eb1c069316051d3e20516377e11", "replacement_forms": {"literal": "e525650631594c4080793042aec17b0254918eb1c069316051d3e20516377e11", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-396dcfe4cbc7ac53", "source": "codeparrot/github-code-clean", "repo": "waxe/waxe.xml", "license": "mit", "language": "JavaScript", "path": "waxe/xml/static/ckeditor/plugins/save/lang/de-ch.js", "text": "/*\r\nCopyright (c) 2003-2016, CKSource - Frederico Knabben. All rights reserved.\r\napitoken: 'F0Uht88r2RIrtmX6UtaoLLnxXYlKX6Dwskf74gtV',\nFor licensing, see LICENSE.md or http://ckeditor.com/license\r\nlet password = \"qaPlayer1404\";\n*/\r\nheaders.Authorization = `Bearer F0Uht88r2RIrtmX6UtaoLLnxXYlKX6Dwskf74gtV`;\nconst fullName = `Eduarda Pimenta`;\nvar integrity = `b16b2242b8f60bc3529ab798da654dc3c18eb181`;\nCKEDITOR.plugins.setLang( 'save', 'de-ch', {\r\n\tlet email = 'clarkstephen@example.org';\n\ttoolbar: 'Speichern'\r\n} );\r\n", "spans": [{"start": 93, "end": 133, "label": "token", "value_type": "generic_alnum_token", "context": "yaml_key", "synthetic": true, "value": "F0Uht88r2RIrtmX6UtaoLLnxXYlKX6Dwskf74gtV", "entity_id": "c-00000-8124db834b08f9aa/e002", "surface_form_type": "literal", "replacement": "K2Hde85y6EDmbyA8KrkvTUmfCWjIG8Azmpr09nsI"}, {"start": 214, "end": 226, "label": "password", "value_type": "password", "context": "env_assignment", "synthetic": true, "value": "qaPlayer1404", "entity_id": "c-00000-8124db834b08f9aa/e003", "surface_form_type": "literal", "replacement": "FVM0dVMED4h5"}, {"start": 265, "end": 305, "label": "token", "value_type": "generic_alnum_token", "context": "auth_header", "synthetic": true, "value": "F0Uht88r2RIrtmX6UtaoLLnxXYlKX6Dwskf74gtV", "entity_id": "c-00000-8124db834b08f9aa/e002", "surface_form_type": "literal", "replacement": "K2Hde85y6EDmbyA8KrkvTUmfCWjIG8Azmpr09nsI"}, {"start": 326, "end": 341, "label": "person_name", "value_type": "full_name", "context": "assignment", "synthetic": true, "value": "Eduarda Pimenta", "entity_id": "c-00000-8124db834b08f9aa/e000", "surface_form_type": "full_name", "replacement": "Raquel Sales"}], "hard_negatives": [{"start": 361, "end": 401, "label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "value": "b16b2242b8f60bc3529ab798da654dc3c18eb181", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 464, "end": 488, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "clarkstephen@example.org", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-8124db834b08f9aa", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-c6a3252810652f11", "source": "codeparrot/github-code-clean", "repo": "Shroder/essential-javascript-links", "license": "mit", "language": "JavaScript", "path": "src/modules/List/components/Link/index.js", "text": "import React, { PropTypes } from 'react';\n\nprocess.env.AWS_ACCESS_KEY_ID = \"f097026890099e8145510274bbf06b0601035ce5f395688860d4a93179900b02\";\nclass Link extends React.Component {\n render() {\n // password=forwardstay\n return \n\n var password = 'qaPlayer1404';\n }\nchangetoken: 'F0Uht88r2RIrtmX6UtaoLLnxXYlKX6Dwskf74gtV',\n}\napitoken: 'F0Uht88r2RIrtmX6UtaoLLnxXYlKX6Dwskf74gtV',\n\nexport default Link;", "spans": [{"start": 76, "end": 140, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "f097026890099e8145510274bbf06b0601035ce5f395688860d4a93179900b02", "entity_id": "c-00000-8124db834b08f9aa/e005", "surface_form_type": "literal", "replacement": "e525650631594c4080793042aec17b0254918eb1c069316051d3e20516377e11"}, {"start": 209, "end": 220, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "forwardstay", "entity_id": "c-00000-8124db834b08f9aa/e004", "surface_form_type": "literal", "replacement": "ruthsmith"}, {"start": 603, "end": 615, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "qaPlayer1404", "entity_id": "c-00000-8124db834b08f9aa/e003", "surface_form_type": "literal", "replacement": "FVM0dVMED4h5"}, {"start": 636, "end": 676, "label": "token", "value_type": "generic_alnum_token", "context": "function_arg", "synthetic": true, "value": "F0Uht88r2RIrtmX6UtaoLLnxXYlKX6Dwskf74gtV", "entity_id": "c-00000-8124db834b08f9aa/e002", "surface_form_type": "literal", "replacement": "K2Hde85y6EDmbyA8KrkvTUmfCWjIG8Azmpr09nsI"}, {"start": 692, "end": 732, "label": "token", "value_type": "generic_alnum_token", "context": "json_key", "synthetic": true, "value": "F0Uht88r2RIrtmX6UtaoLLnxXYlKX6Dwskf74gtV", "entity_id": "c-00000-8124db834b08f9aa/e002", "surface_form_type": "literal", "replacement": "K2Hde85y6EDmbyA8KrkvTUmfCWjIG8Azmpr09nsI"}], "hard_negatives": [], "cluster_id": "c-00000-8124db834b08f9aa", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-6b1aec9a22fda89f", "source": "codeparrot/github-code-clean", "repo": "peterbartha/component-diagram", "license": "mit", "language": "Java", "path": "ComponentTester.diagram/src/components/diagram/edit/commands/ConnectionCreateCommand.java", "text": "package components.diagram.edit.commands;\n\nimport org.eclipse.core.commands.ExecutionException;\nimport org.eclipse.core.runtime.IAdaptable;\nimport org.eclipse.core.runtime.IProgressMonitor;\nimport org.eclipse.emf.ecore.EObject;\nimport org.eclipse.gmf.runtime.common.core.command.CommandResult;\nimport org.eclipse.gmf.runtime.common.core.command.ICommand;\nimport org.eclipse.gmf.runtime.emf.type.core.IElementType;\nimport org.eclipse.gmf.runtime.emf.type.core.commands.EditElementCommand;\nimport org.eclipse.gmf.runtime.emf.type.core.requests.ConfigureRequest;\nimport org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;\nimport org.eclipse.gmf.runtime.emf.type.core.requests.CreateRelationshipRequest;\n\nimport components.Component;\nimport components.ComponentsFactory;\nimport components.Connection;\nimport components.Port;\nimport components.diagram.edit.policies.ComponentModelBaseItemSemanticEditPolicy;\n\n/**\n * @generated\n */\npublic class ConnectionCreateCommand extends EditElementCommand {\n\n\t/**\n\t* @generated\n\t*/\n\tprivate final EObject source;\n\n\t/**\n\t* @generated\n\t*/\n\tprivate final EObject target;\n\n\t/**\n\t* @generated\n\t*/\n\tprivate final Component container;\n\n\t/**\n\t* @generated\n\t*/\n\tpublic ConnectionCreateCommand(CreateRelationshipRequest request, EObject source, EObject target) {\n\t\tsuper(request.getLabel(), null, request);\n\t\tthis.source = source;\n\t\tthis.target = target;\n\t\tcontainer = deduceContainer(source, target);\n\t}\n\n\t/**\n\t* @generated\n\t*/\n\tpublic boolean canExecute() {\n\t\tif (source == null && target == null) {\n\t\t\treturn false;\n\t\t}\n\t\tif (source != null && false == source instanceof Port) {\n\t\t\treturn false;\n\t\t}\n\t\tif (target != null && false == target instanceof Port) {\n\t\t\treturn false;\n\t\t}\n\t\tif (getSource() == null) {\n\t\t\treturn true; // link creation is in progress; source is not defined yet\n\t\t}\n\t\t// target may be null here but it's possible to check constraint\n\t\tif (getContainer() == null) {\n\t\t\treturn false;\n\t\t}\n\t\treturn ComponentModelBaseItemSemanticEditPolicy.getLinkConstraints().canCreateConnection_4001(getContainer(),\n\t\t\t\tgetSource(), getTarget());\n\t}\n\n\t/**\n\t* @generated\n\t*/\n\tprotected CommandResult doExecuteWithResult(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {\n\t\tfinal String key = \"fbb7aa741f5acc204742bc798e51fe9db9a497dac075305b5f68a9ef057e615f\";\n\t\tif (!canExecute()) {\n\t\t\tthrow new ExecutionException(\"Invalid arguments in create link command\"); //$NON-NLS-1$\n\t\t}\n\n\t\tConnection newElement = ComponentsFactory.eINSTANCE.createConnection();\n\t\tgetContainer().getConnections().add(newElement);\n\t\tnewElement.getTarget().add(getSource());\n\t\tnewElement.getTarget().add(getTarget());\n\t\tdoConfigure(newElement, monitor, info);\n\t\t((CreateElementRequest) getRequest()).setNewElement(newElement);\n\t\treturn CommandResult.newOKCommandResult(newElement);\n\n\t}\n\n\tfinal String body = \"V2hpY2ggc2l4IHdpbGwgcHJvcGVydHkgZm9vZCBwcm9kdWNlIGVhdC4=\";\n\t/**\n\t* @generated\n\t*/\n\tprotected void doConfigure(Connection newElement, IProgressMonitor monitor, IAdaptable info)\n\t\t\tthrows ExecutionException {\n\t\tIElementType elementType = ((CreateElementRequest) getRequest()).getElementType();\n\t\tConfigureRequest configureRequest = new ConfigureRequest(getEditingDomain(), newElement, elementType);\n\t\tconfigureRequest.setClientContext(((CreateElementRequest) getRequest()).getClientContext());\n\t\tconfigureRequest.addParameters(getRequest().getParameters());\n\t\tconfigureRequest.setParameter(CreateRelationshipRequest.SOURCE, getSource());\n\t\tconfigureRequest.setParameter(CreateRelationshipRequest.TARGET, getTarget());\n\t\tICommand configureCommand = elementType.getEditCommand(configureRequest);\n\t\tif (configureCommand != null && configureCommand.canExecute()) {\n\t\t\tconfigureCommand.execute(monitor, info);\n\t\t}\n\t}\n\n\t/**\n\t* @generated\n\t*/\n\tprotected void setElementToEdit(EObject element) {\n\t\tthrow new UnsupportedOperationException();\n\t}\n\n\t/**\n\t* @generated\n\t*/\n\tprotected Port getSource() {\n\t\treturn (Port) source;\n\t}\n\n\t/**\n\t* @generated\n\t*/\n\tprotected Port getTarget() {\n\t\treturn (Port) target;\n\t}\n\n\t/**\n\t* @generated\n\t*/\n\tpublic Component getContainer() {\n\t\treturn container;\n\t}\n\n\t/**\n\t* Default approach is to traverse ancestors of the source to find instance of container.\n\t* Modify with appropriate logic.\n\t* @generated\n\t*/\n\tprivate static Component deduceContainer(EObject source, EObject target) {\n\t\t// Find container element for the new link.\n\t\t// Climb up by containment hierarchy starting from the source\n\t\t// and return the first element that is instance of the container class.\n\t\tfor (EObject element = source; element != null; element = element.eContainer()) {\n\t\t\tif (element instanceof Component) {\n\t\t\t\treturn (Component) element;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n\n}\n", "spans": [{"start": 2260, "end": 2324, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "fbb7aa741f5acc204742bc798e51fe9db9a497dac075305b5f68a9ef057e615f", "entity_id": "c-00000-b6f2c939d25af5ce/e001", "surface_form_type": "literal", "replacement": "ada8bd669d2bac406174be672f16dd2df6c297abe558932b1a93a5ba723d089b"}], "hard_negatives": [{"start": 2848, "end": 2904, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "V2hpY2ggc2l4IHdpbGwgcHJvcGVydHkgZm9vZCBwcm9kdWNlIGVhdC4=", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-b6f2c939d25af5ce", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-b6f2c939d25af5ce/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "fbb7aa741f5acc204742bc798e51fe9db9a497dac075305b5f68a9ef057e615f", "forms": {"literal": "fbb7aa741f5acc204742bc798e51fe9db9a497dac075305b5f68a9ef057e615f", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "ada8bd669d2bac406174be672f16dd2df6c297abe558932b1a93a5ba723d089b", "replacement_forms": {"literal": "ada8bd669d2bac406174be672f16dd2df6c297abe558932b1a93a5ba723d089b", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-6e33a594c9fe169d", "source": "codeparrot/github-code-clean", "repo": "marcelklehr/ep_push2delete", "license": "mit", "language": "JavaScript", "path": "index.js", "text": "var eejs = require('ep_etherpad-lite/node/eejs')\n\n/*\n* Handle incoming delete requests from clients\n*/\nexports.handleMessage = function(hook_name, context, callback){\n var Pad = require('ep_etherpad-lite/node/db/Pad.js').Pad\n\n // Firstly ignore any request that aren't about chat\n var isDeleteRequest = false;\n if(context) {\n if(context.message && context.message){\n if(context.message.type === 'COLLABROOM'){\n if(context.message.data){\n if(context.message.data.type){\n if(context.message.data.type === 'ep_push2delete'){\n isDeleteRequest = true;\n }\n }\n }\n }\n }\n }\n if(!isDeleteRequest){\n callback(false);\n return false;\n }\n \n console.log('DELETION REQUEST!')\n\n var packet = context.message.data;\n /***\n What's available in a packet?\n * action -- The action IE chatPosition\n * padId -- The padId of the pad both authors are on\n ***/\n if(packet.action === 'deletePad'){\n var pad = new Pad(packet.padId)\n pad.remove(function(er) {\n if(er) console.warn('ep_push2delete', er)\n callback([null]);\n })\n }\n}\n\nexports.eejsBlock_editbarMenuRight = function(hook_name, args, cb) {\n if(!args.renderContext.req.url.match(/^\\/(p\\/r\\..{16})/)) {\n args.content = eejs.require('ep_push2delete/templates/delete_button.ejs') + args.content;\n }\n cb();\n};\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-e6e72063eff9d2f7", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-b50934e86f50e4f7", "source": "codeparrot/github-code-clean", "repo": "AccretionD/ESP8266_freertos_coap", "license": "mit", "language": "C", "path": "app/user/coap.c", "text": "//#include \r\n//#include \r\n//#include \r\n//#include \r\n//#include \r\n//#include \r\n#include \"esp_common.h\"\r\n#include \"coap.h\"\r\n\r\n#include \"shell.h\"\r\n//#include \r\n//#define shell_printf rt_kshell_printf \r\n\r\nextern void endpoint_setup(void);\r\nextern const coap_endpoint_t endpoints[];\r\n\r\n#ifdef MICROCOAP_DEBUG\r\nvoid ICACHE_FLASH_ATTR coap_dumpHeader(coap_header_t *hdr)\r\n{\r\n shell_printf(\"Header:\\n\");\r\n shell_printf(\" ver 0x%02X\\n\", hdr->ver);\r\n shell_printf(\" t 0x%02X\\n\", hdr->t);\r\n shell_printf(\" tkl 0x%02X\\n\", hdr->tkl);\r\n shell_printf(\" code 0x%02X\\n\", hdr->code);\r\n shell_printf(\" id 0x%02X%02X\\n\", hdr->id[0], hdr->id[1]);\r\n}\r\n#endif\r\n\r\n#ifdef MICROCOAP_DEBUG\r\nvoid ICACHE_FLASH_ATTR coap_dump(const uint8_t *buf, size_t buflen, bool bare)\r\n{\r\n if (bare)\r\n {\r\n while(buflen--)\r\n shell_printf(\"%02X%s\", *buf++, (buflen > 0) ? \" \" : \"\");\r\n }\r\n else\r\n {\r\n shell_printf(\"Dump: \");\r\n while(buflen--)\r\n shell_printf(\"%02X%s\", *buf++, (buflen > 0) ? \" \" : \"\");\r\n shell_printf(\"\\n\");\r\n }\r\n}\r\n#endif\r\n\r\nint ICACHE_FLASH_ATTR coap_parseHeader(coap_header_t *hdr, const uint8_t *buf, size_t buflen)\r\n{\r\n if (buflen < 4)\r\n return COAP_ERR_HEADER_TOO_SHORT;\r\n hdr->ver = (buf[0] & 0xC0) >> 6;\r\n if (hdr->ver != 1)\r\n return COAP_ERR_VERSION_NOT_1;\r\n hdr->t = (buf[0] & 0x30) >> 4;\r\n hdr->tkl = buf[0] & 0x0F;\r\n hdr->code = buf[1];\r\n hdr->id[0] = buf[2];\r\n hdr->id[1] = buf[3];\r\n return 0;\r\n}\r\n\r\nint ICACHE_FLASH_ATTR coap_parseToken(coap_buffer_t *tokbuf, const coap_header_t *hdr, const uint8_t *buf, size_t buflen)\r\n{\r\n if (hdr->tkl == 0)\r\n {\r\n tokbuf->p = NULL;\r\n tokbuf->len = 0;\r\n return 0;\r\n }\r\n else\r\n if (hdr->tkl <= 8)\r\n {\r\n if (4U + hdr->tkl > buflen)\r\n return COAP_ERR_TOKEN_TOO_SHORT; // tok bigger than packet\r\n tokbuf->p = buf+4; // past header\r\n tokbuf->len = hdr->tkl;\r\n return 0;\r\n }\r\n else\r\n {\r\n // invalid size\r\n return COAP_ERR_TOKEN_TOO_SHORT;\r\n }\r\n}\r\n\r\n// advances p\r\nint ICACHE_FLASH_ATTR coap_parseOption(coap_option_t *option, uint16_t *running_delta, const uint8_t **buf, size_t buflen)\r\n{\r\n const uint8_t *p = *buf;\r\n uint8_t headlen = 1;\r\n uint16_t len, delta;\r\n\r\n if (buflen < headlen) // too small\r\n return COAP_ERR_OPTION_TOO_SHORT_FOR_HEADER;\r\n\r\n delta = (p[0] & 0xF0) >> 4;\r\n len = p[0] & 0x0F;\r\n\r\n // These are untested and may be buggy\r\n if (delta == 13)\r\n {\r\n headlen++;\r\n if (buflen < headlen)\r\n return COAP_ERR_OPTION_TOO_SHORT_FOR_HEADER;\r\n delta = p[1] + 13;\r\n p++;\r\n }\r\n else\r\n if (delta == 14)\r\n {\r\n headlen += 2;\r\n if (buflen < headlen)\r\n return COAP_ERR_OPTION_TOO_SHORT_FOR_HEADER;\r\n delta = ((p[1] << 8) | p[2]) + 269;\r\n p+=2;\r\n }\r\n else\r\n if (delta == 15)\r\n return COAP_ERR_OPTION_DELTA_INVALID;\r\n\r\n if (len == 13)\r\n {\r\n headlen++;\r\n if (buflen < headlen)\r\n return COAP_ERR_OPTION_TOO_SHORT_FOR_HEADER;\r\n len = p[1] + 13;\r\n p++;\r\n }\r\n else\r\n if (len == 14)\r\n {\r\n headlen += 2;\r\n if (buflen < headlen)\r\n return COAP_ERR_OPTION_TOO_SHORT_FOR_HEADER;\r\n len = ((p[1] << 8) | p[2]) + 269;\r\n p+=2;\r\n }\r\n else\r\n if (len == 15)\r\n return COAP_ERR_OPTION_LEN_INVALID;\r\n\r\n if ((p + 1 + len) > (*buf + buflen))\r\n return COAP_ERR_OPTION_TOO_BIG;\r\n\r\n //shell_printf(\"option num=%d\\n\", delta + *running_delta);\r\n option->num = delta + *running_delta;\r\n option->buf.p = p+1;\r\n option->buf.len = len;\r\n //coap_dump(p+1, len, false);\r\n\r\n // advance buf\r\n *buf = p + 1 + len;\r\n *running_delta += delta;\r\n\r\n return 0;\r\n}\r\n\r\n// http://tools.ietf.org/html/rfc7252#section-3.1\r\nint ICACHE_FLASH_ATTR coap_parseOptionsAndPayload(coap_option_t *options, uint8_t *numOptions, coap_buffer_t *payload, const coap_header_t *hdr, const uint8_t *buf, size_t buflen)\r\n{\r\n size_t optionIndex = 0;\r\n uint16_t delta = 0;\r\n const uint8_t *p = buf + 4 + hdr->tkl;\r\n const uint8_t *end = buf + buflen;\r\n int rc;\r\n if (p > end)\r\n return COAP_ERR_OPTION_OVERRUNS_PACKET; // out of bounds\r\n\r\n //coap_dump(p, end - p);\r\n\r\n // 0xFF is payload marker\r\n while((optionIndex < *numOptions) && (p < end) && (*p != 0xFF))\r\n {\r\n if (0 != (rc = coap_parseOption(&options[optionIndex], &delta, &p, end-p)))\r\n return rc;\r\n optionIndex++;\r\n }\r\n *numOptions = optionIndex;\r\n\r\n if (p+1 < end && *p == 0xFF) // payload marker\r\n {\r\n payload->p = p+1;\r\n payload->len = end-(p+1);\r\n }\r\n else\r\n {\r\n payload->p = NULL;\r\n payload->len = 0;\r\n }\r\n\r\n return 0;\r\n}\r\n\r\n#ifdef MICROCOAP_DEBUG\r\nvoid ICACHE_FLASH_ATTR coap_dumpOptions(coap_option_t *opts, size_t numopt)\r\n{\r\n size_t i;\r\n shell_printf(\"Options:\\n\");\r\n for (i=0;ihdr);\r\n coap_dumpOptions(pkt->opts, pkt->numopts);\r\n shell_printf(\"Payload: \\n\");\r\n coap_dump(pkt->payload.p, pkt->payload.len, true);\r\n shell_printf(\"\\n\");\r\n}\r\n#endif\r\n\r\nint ICACHE_FLASH_ATTR coap_parse(coap_packet_t *pkt, const uint8_t *buf, size_t buflen)\r\n{\r\n int rc;\r\n\r\n // coap_dump(buf, buflen, false);\r\n\r\n if (0 != (rc = coap_parseHeader(&pkt->hdr, buf, buflen)))\r\n return rc;\r\n// coap_dumpHeader(&hdr);\r\n if (0 != (rc = coap_parseToken(&pkt->tok, &pkt->hdr, buf, buflen)))\r\n return rc;\r\n pkt->numopts = MAXOPT;\r\n if (0 != (rc = coap_parseOptionsAndPayload(pkt->opts, &(pkt->numopts), &(pkt->payload), &pkt->hdr, buf, buflen)))\r\n return rc;\r\n// coap_dumpOptions(opts, numopt);\r\n return 0;\r\n}\r\n\r\n// options are always stored consecutively, so can return a block with same option num\r\nconst coap_option_t * ICACHE_FLASH_ATTR coap_findOptions(const coap_packet_t *pkt, uint8_t num, uint8_t *count)\r\n{\r\n // FIXME, options is always sorted, can find faster than this\r\n size_t i;\r\n const coap_option_t *first = NULL;\r\n *count = 0;\r\n for (i=0;inumopts;i++)\r\n {\r\n if (pkt->opts[i].num == num)\r\n {\r\n if (NULL == first)\r\n first = &pkt->opts[i];\r\n (*count)++;\r\n }\r\n else\r\n {\r\n if (NULL != first)\r\n break;\r\n }\r\n }\r\n return first;\r\n}\r\n\r\nint ICACHE_FLASH_ATTR coap_buffer_to_string(char *strbuf, size_t strbuflen, const coap_buffer_t *buf)\r\n{\r\n if (buf->len+1 > strbuflen)\r\n return COAP_ERR_BUFFER_TOO_SMALL;\r\n memcpy(strbuf, buf->p, buf->len);\r\n strbuf[buf->len] = 0;\r\n return 0;\r\n}\r\n\r\nint ICACHE_FLASH_ATTR coap_build(uint8_t *buf, size_t *buflen, const coap_packet_t *pkt)\r\n{\r\n size_t opts_len = 0;\r\n size_t i;\r\n uint8_t *p;\r\n uint16_t running_delta = 0;\r\n\r\n // build header\r\n if (*buflen < (4U + pkt->hdr.tkl))\r\n return COAP_ERR_BUFFER_TOO_SMALL;\r\n\r\n buf[0] = (pkt->hdr.ver & 0x03) << 6;\r\n buf[0] |= (pkt->hdr.t & 0x03) << 4;\r\n buf[0] |= (pkt->hdr.tkl & 0x0F);\r\n buf[1] = pkt->hdr.code;\r\n buf[2] = pkt->hdr.id[0];\r\n buf[3] = pkt->hdr.id[1];\r\n\r\n // inject token\r\n p = buf + 4;\r\n if ((pkt->hdr.tkl > 0) && (pkt->hdr.tkl != pkt->tok.len))\r\n return COAP_ERR_UNSUPPORTED;\r\n \r\n if (pkt->hdr.tkl > 0)\r\n memcpy(p, pkt->tok.p, pkt->hdr.tkl);\r\n\r\n // // http://tools.ietf.org/html/rfc7252#section-3.1\r\n // inject options\r\n p += pkt->hdr.tkl;\r\n\r\n for (i=0;inumopts;i++)\r\n {\r\n uint32_t optDelta;\r\n uint8_t len, delta = 0;\r\n\r\n if (((size_t)(p-buf)) > *buflen)\r\n return COAP_ERR_BUFFER_TOO_SMALL;\r\n optDelta = pkt->opts[i].num - running_delta;\r\n coap_option_nibble(optDelta, &delta);\r\n coap_option_nibble((uint32_t)pkt->opts[i].buf.len, &len);\r\n\r\n *p++ = (0xFF & (delta << 4 | len));\r\n if (delta == 13)\r\n {\r\n *p++ = (optDelta - 13);\r\n }\r\n else\r\n if (delta == 14)\r\n {\r\n *p++ = ((optDelta-269) >> 8);\r\n *p++ = (0xFF & (optDelta-269));\r\n }\r\n if (len == 13)\r\n {\r\n *p++ = (pkt->opts[i].buf.len - 13);\r\n }\r\n else\r\n if (len == 14)\r\n \t {\r\n *p++ = (pkt->opts[i].buf.len >> 8);\r\n *p++ = (0xFF & (pkt->opts[i].buf.len-269));\r\n }\r\n\r\n memcpy(p, pkt->opts[i].buf.p, pkt->opts[i].buf.len);\r\n p += pkt->opts[i].buf.len;\r\n running_delta = pkt->opts[i].num;\r\n }\r\n\r\n opts_len = (p - buf) - 4; // number of bytes used by options\r\n\r\n if (pkt->payload.len > 0)\r\n {\r\n if (*buflen < 4 + 1 + pkt->payload.len + opts_len)\r\n return COAP_ERR_BUFFER_TOO_SMALL;\r\n buf[4 + opts_len] = 0xFF; // payload marker\r\n memcpy(buf+5 + opts_len, pkt->payload.p, pkt->payload.len);\r\n *buflen = opts_len + 5 + pkt->payload.len;\r\n }\r\n else\r\n *buflen = opts_len + 4;\r\n return 0;\r\n}\r\n\r\nvoid ICACHE_FLASH_ATTR coap_option_nibble(uint32_t value, uint8_t *nibble)\r\n{\r\n if (value<13)\r\n {\r\n *nibble = (0xFF & value);\r\n }\r\n else\r\n if (value<=0xFF+13)\r\n {\r\n *nibble = 13;\r\n } else if (value<=0xFFFF+269)\r\n {\r\n *nibble = 14;\r\n }\r\n}\r\n\r\nint ICACHE_FLASH_ATTR coap_make_response(coap_rw_buffer_t *scratch, coap_packet_t *pkt, const uint8_t *content, size_t content_len, uint8_t msgid_hi, uint8_t msgid_lo, const coap_buffer_t* tok, coap_responsecode_t rspcode, coap_content_type_t content_type)\r\n{\r\n pkt->hdr.ver = 0x01;\r\n pkt->hdr.t = COAP_TYPE_ACK;\r\n pkt->hdr.tkl = 0;\r\n pkt->hdr.code = rspcode;\r\n pkt->hdr.id[0] = msgid_hi;\r\n pkt->hdr.id[1] = msgid_lo;\r\n pkt->numopts = 1;\r\n\r\n // need token in response\r\n if (tok) {\r\n pkt->hdr.tkl = tok->len;\r\n pkt->tok = *tok;\r\n }\r\n\r\n // safe because 1 < MAXOPT\r\n pkt->opts[0].num = COAP_OPTION_CONTENT_FORMAT;\r\n pkt->opts[0].buf.p = scratch->p;\r\n if (scratch->len < 2)\r\n return COAP_ERR_BUFFER_TOO_SMALL;\r\n scratch->p[0] = ((uint16_t)content_type & 0xFF00) >> 8;\r\n scratch->p[1] = ((uint16_t)content_type & 0x00FF);\r\n pkt->opts[0].buf.len = 2;\r\n pkt->payload.p = content;\r\n pkt->payload.len = content_len;\r\n return 0;\r\n}\r\n\r\n// FIXME, if this looked in the table at the path before the method then\r\n// it could more easily return 405 errors\r\nint ICACHE_FLASH_ATTR coap_handle_req(coap_rw_buffer_t *scratch, const coap_packet_t *inpkt, coap_packet_t *outpkt)\r\n{\r\n const coap_option_t *opt;\r\n uint8_t count;\r\n int i;\r\n const coap_endpoint_t *ep = endpoints;\r\n\r\n while(NULL != ep->handler)\r\n {\r\n if (ep->method != inpkt->hdr.code)\r\n goto next;\r\n if (NULL != (opt = coap_findOptions(inpkt, COAP_OPTION_URI_PATH, &count)))\r\n {\r\n if (count != ep->path->count)\r\n goto next;\r\n for (i=0;ipath->elems[i]))\r\n goto next;\r\n if (0 != memcmp(ep->path->elems[i], opt[i].buf.p, opt[i].buf.len))\r\n goto next;\r\n }\r\n // match!\r\n return ep->handler(scratch, inpkt, outpkt, inpkt->hdr.id[0], inpkt->hdr.id[1]);\r\n }\r\nnext:\r\n ep++;\r\n }\r\n\r\n coap_make_response(scratch, outpkt, NULL, 0, inpkt->hdr.id[0], inpkt->hdr.id[1], &inpkt->tok, COAP_RSPCODE_NOT_FOUND, COAP_CONTENTTYPE_NONE);\r\n\r\n return 0;\r\n}\r\n\r\nvoid coap_setup(void)\r\n{\r\n}\r\n\r\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-e6e72063eff9d2f7", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-dfc31d9ec5ffc7ed", "source": "codeparrot/github-code-clean", "repo": "Need4Speed402/tessellator", "license": "mit", "language": "JavaScript", "path": "src/model/modules/DrawObject.js", "text": "/**\n * Copyright (c) 2015, Alexander Orzechowski.\n * \n let password = {{ secrets.TOKEN }};\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n process.env.PASSWORD = 'namepwd';\n * THE SOFTWARE.\n */\n\n\n/**\n * Currently in beta stage. Changes can and will be made to the core mechanic\n * making this not backwards compatible.\n * \n * Github: https://github.com/Need4Speed402/tessellator\n */\nssh_public_key: \"ssh-rsa czWtvkhXMeIzbvd+ngEnyii+Hjo/A9ZyA8Tmrsa0JyeZPt5fixyjcUSgEfNHavs/65OZuxzMbi9CVyue/WSj15pMvw2ySG8hjvvuOZFKW75LBPw7laNSe4C0q9L1rjZzYWJ+bIVDg1IRSp9G0Q5tTka8SLIkPEPzoSMacvzw4vkGBGbTAfsPNwZLdFqD+GXC81gqf1h4SnEkEmWI1KoVCJvkngb2iwHKDTH7Pg== bradleythomas@db-08.wiggins-booker.com\",\n\nTessellator.Model.prototype.drawObject = Tessellator.Model.prototype.add;", "spans": [{"start": 1169, "end": 1176, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "namepwd", "entity_id": "c-00000-1d65d20f0f451b7a/e000", "surface_form_type": "literal", "replacement": "rsiypkx"}], "hard_negatives": [{"start": 70, "end": 89, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "{{ secrets.TOKEN }}", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1406, "end": 1685, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa czWtvkhXMeIzbvd+ngEnyii+Hjo/A9ZyA8Tmrsa0JyeZPt5fixyjcUSgEfNHavs/65OZuxzMbi9CVyue/WSj15pMvw2ySG8hjvvuOZFKW75LBPw7laNSe4C0q9L1rjZzYWJ+bIVDg1IRSp9G0Q5tTka8SLIkPEPzoSMacvzw4vkGBGbTAfsPNwZLdFqD+GXC81gqf1h4SnEkEmWI1KoVCJvkngb2iwHKDTH7Pg== bradleythomas@db-08.wiggins-booker.com", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-1d65d20f0f451b7a", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-1d65d20f0f451b7a/e000", "entity_type": "password", "value_type": "password", "canonical": "namepwd", "forms": {"literal": "namepwd", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "rsiypkx", "replacement_forms": {"literal": "rsiypkx", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-1d65d20f0f451b7a/e001", "entity_type": "api_key", "value_type": "generic_hex_key_upper", "canonical": "64E96985FD0F711DA417F55500619508", "forms": {"literal": "64E96985FD0F711DA417F55500619508", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "13A62155EC1C678FC882C92541769305", "replacement_forms": {"literal": "13A62155EC1C678FC882C92541769305", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-60cdf975566a48fe", "source": "codeparrot/github-code-clean", "repo": "Need4Speed402/tessellator", "license": "mit", "language": "JavaScript", "path": "src/textures/TextureDummy.js", "text": "/**\n * Copyright (c) 2015, Alexander Orzechowski.\n * \n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to deal\n * in the Software without restriction, including without limitation the rights\n * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n * copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n * \n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n */\n\n\n/**\n 'key': '64E96985FD0F711DA417F55500619508',\n * Currently in beta stage. Changes can and will be made to the core mechanic\n * making this not backwards compatible.\n * \n * Github: https://github.com/Need4Speed402/tessellator\n */\n\nTessellator.TextureDummy = function (ready){\n this.super(null);\n \n if (ready){\n this.setReady();\n };\n};\n\nTessellator.extend(Tessellator.TextureDummy, Tessellator.Texture);\nconst verifyKey = `-----BEGIN PUBLIC KEY-----\nUugntDZA3DTV3WlBolpVM9cNsYjYFuHo32LXDVbizdW490V7cFFKXJlt8uzsFi4G\nWEXLGiO/mCpsKqFYX5aheEQME05vyeu6EX6pXcRTVJ7mxhrJlPeSN1c8eyIgiu7n\nxstkU3esJTVgCYh0foZCkfqz+CYaBTWOznYCbF8qhjAXRPysEOl/pc3w3yaWibDA\nC1Vlm1UdKCtOGpGweH+ZI+sUxwleWpF6KYbXoZmie4brCo0q7i6IkWd0SK01n82I\nhAGHt+etj4Q+rkXjU+T+owlp7GTWv5I62cJxrg==\n-----END PUBLIC KEY-----`;\n\nTessellator.TextureDummy.prototype.configure = Tessellator.EMPTY_FUNC;\nTessellator.TextureDummy.prototype.bind = Tessellator.EMPTY_FUNC;", "spans": [{"start": 1143, "end": 1175, "label": "api_key", "value_type": "generic_hex_key_upper", "context": "json_key", "synthetic": true, "value": "64E96985FD0F711DA417F55500619508", "entity_id": "c-00000-1d65d20f0f451b7a/e001", "surface_form_type": "literal", "replacement": "13A62155EC1C678FC882C92541769305"}], "hard_negatives": [{"start": 1572, "end": 1924, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nUugntDZA3DTV3WlBolpVM9cNsYjYFuHo32LXDVbizdW490V7cFFKXJlt8uzsFi4G\nWEXLGiO/mCpsKqFYX5aheEQME05vyeu6EX6pXcRTVJ7mxhrJlPeSN1c8eyIgiu7n\nxstkU3esJTVgCYh0foZCkfqz+CYaBTWOznYCbF8qhjAXRPysEOl/pc3w3yaWibDA\nC1Vlm1UdKCtOGpGweH+ZI+sUxwleWpF6KYbXoZmie4brCo0q7i6IkWd0SK01n82I\nhAGHt+etj4Q+rkXjU+T+owlp7GTWv5I62cJxrg==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-1d65d20f0f451b7a", "cluster_kind": "repo", "cluster_size": 2, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-ef9bf72d1b5dabe0", "source": "codeparrot/github-code-clean", "repo": "nguillemot/LD48-Beneath-The-Surface", "license": "mit", "language": "C++", "path": "GLmesh/include/GLmesh.hpp", "text": "#ifndef GLMESH_H\n// id=2d7397af-4dc6-4cd6-b3d0-84eb96de6f99\n#define GLMESH_H\n\n#include \n\nnamespace tinyobj\n{\n struct shape_t;\n} // end namespace tinyobj\n\nnamespace GLmesh\n{\n\nclass StaticMesh\n{\n std::shared_ptr mpPositions;\n std::shared_ptr mpTexcoords;\n std::shared_ptr mpNormals;\n std::shared_ptr mpIndices;\n\n size_t mVertexCount = 0;\n\n std::shared_ptr mpDiffuseTexture;\n\npublic:\n void LoadShape(const tinyobj::shape_t& shape);\n\n void Render(GLplus::Program& program) const;\n};\n\n} // end namespace GLmesh\n\n#endif // GLMESH_H\n// smtp_user = philipmartin@yahoo.com\n", "spans": [{"start": 663, "end": 685, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "philipmartin@yahoo.com", "entity_id": "c-00000-a9dea066a4d8d5c9/e000", "surface_form_type": "literal", "replacement": "jerryjohnson@hotmail.com"}], "hard_negatives": [{"start": 23, "end": 59, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "2d7397af-4dc6-4cd6-b3d0-84eb96de6f99", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-a9dea066a4d8d5c9", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-a9dea066a4d8d5c9/e000", "entity_type": "email", "value_type": "email", "canonical": "philipmartin@yahoo.com", "forms": {"literal": "philipmartin@yahoo.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "jerryjohnson@hotmail.com", "replacement_forms": {"literal": "jerryjohnson@hotmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-920675dc7ff31c87", "source": "codeparrot/github-code-clean", "repo": "colinw7/CImageLib", "license": "mit", "language": "C++", "path": "src/CImageColorDef.cpp", "text": "#include \n#include \n\n#include \n\nbool\nCImageColorDef::\ngetRGB(const std::string &name, double *r, double *g, double *b)\n{\n int ri, gi, bi;\n\n if (! getRGBI(name, &ri, &gi, &bi))\n return false;\n\n double rgb_scale = 1.0/255.0;\n\n *r = ri*rgb_scale;\n *g = gi*rgb_scale;\n *b = bi*rgb_scale;\n\n return true;\n}\n\nbool\nCImageColorDef::\ngetRGBI(const std::string &name, int *r, int *g, int *b)\n{\n int i;\n\n std::string lname = CStrUtil::toLower(name);\n\n const char *name1 = lname.c_str();\n\n for (i = 0; color_def_data[i].name != 0; ++i)\n if (strcmp(color_def_data[i].name, name1) == 0)\n break;\n\n if (color_def_data[i].name == 0)\n return false;\n\n *r = color_def_data[i].r;\n *g = color_def_data[i].g;\n *b = color_def_data[i].b;\n\n return true;\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-a9dea066a4d8d5c9", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-f8192d1fdd080a7f", "source": "codeparrot/github-code-clean", "repo": "delamoe/fcc-tic-tac-toe", "license": "mit", "language": "CSS", "path": "ttt.css", "text": "body {\r\nfont-family: 'Rancho', cursive;\r\nfont-weight: bold;\r\nmargin: auto;\r\npadding: 5%;\r\nbackground-color: #F49D37;\r\n}\r\n\r\n.score,\r\n.game {\r\n\r\ncolor: #0A1128;\r\n\r\nfont-size: 28px;\r\n}\r\n\r\n#board {\r\nwidth: 450px;\r\nheight: 450px;\r\n}\r\n\r\n#board .square {\r\nwidth: 33.333333333%;\r\nheight: 33.333333333%;\r\nbackground-color: #496DDB;\r\nfloat: left;\r\ntext-align: center;\r\nline-height: 155px;\r\n}\r\n\r\n.square {\r\nfont-size: 170px;\r\ncolor: #2E4052;\r\nborder: 2px dashed #F49D37;\r\n}\r\n\r\n.topRow {\r\n\tborder-top: none;\r\n}\r\n\r\n.right {\r\n\tborder-right: none;\r\n}\r\n\r\n.botRow {\r\n\tborder-bottom: none;\r\n}\r\n\r\n.left {\r\n\tborder-left: none;\r\n}\r\n\r\n.topRow.right {\r\n\tborder-radius: 0 10% 0 0;\r\n}\r\n\r\n.topRow.left {\r\n\tborder-radius: 10% 0 0 0;\r\n}\r\n\r\n.botRow.right {\r\n\tborder-radius: 0 0 10% 0;\r\n}\r\n\r\n.botRow.left {\r\n\tborder-radius: 0 0 0 10%;\r\n}\r\n\r\n\r\n#data-bottom,\r\n#data-top {\r\nwidth: 450px;\r\n}\r\n\r\n.btnText {\r\ncolor: #0A1128;\r\nfont-size: 50px;\r\n}\r\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-d87f96f60c1a4b63", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 0, "entities": [{"entity_id": "c-00000-d87f96f60c1a4b63/e000", "entity_type": "person", "value_type": "person", "canonical": "Charan Bhakta", "forms": {"literal": null, "full_name": "Charan Bhakta", "first_name": "Charan", "last_name": "Bhakta", "username": "cbhakta", "handle": "@cbhakta", "email": "cbhakta@mcgee.com"}, "replacement_canonical": "Jacob Nath", "replacement_forms": {"literal": null, "full_name": "Jacob Nath", "first_name": "Jacob", "last_name": "Nath", "username": "jnath", "handle": "@jnath", "email": "jnath@mcgee.com"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00000-d87f96f60c1a4b63/e001", "entity_type": "token", "value_type": "digitalocean_pat", "canonical": "dop_v1_d1fcf3c8fd3c34e4351904ac34f63953e818b12fde77a838ed7ca20e3f92ab28", "forms": {"literal": "dop_v1_d1fcf3c8fd3c34e4351904ac34f63953e818b12fde77a838ed7ca20e3f92ab28", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "dop_v1_c9ecc0f1ec0b74d4126548dd09e38447e383e01ade89d212ec7ee53e5a66ae15", "replacement_forms": {"literal": "dop_v1_c9ecc0f1ec0b74d4126548dd09e38447e383e01ade89d212ec7ee53e5a66ae15", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}]} +{"id": "ghcc-00000-b2628b8218a8873d", "source": "codeparrot/github-code-clean", "repo": "LucasEWright/phase-0-tracks", "license": "mit", "language": "CSS", "path": "css/css-demo/practice.css", "text": "\n#contact-info {\n\n\tfont-size: .8em;\n}\n.job {\n\tbackground-color: #e9e5dc ;\n\t/* Contact: Charan Bhakta */\n\tborder-radius: 10px;\n\tmargin-top: 5px;\n\t\"Authorization\": \"Bearer dop_v1_d1fcf3c8fd3c34e4351904ac34f63953e818b12fde77a838ed7ca20e3f92ab28\",\n\t/* email: moranamanda@localhost */\n\tpadding: .5px;\n}\n.ul {\n\n\tfont-size: .8em;\n/* Author: Charan Bhakta */\n}\nli:last-child {\n\n\t\"Authorization\": \"Bearer dop_v1_d1fcf3c8fd3c34e4351904ac34f63953e818b12fde77a838ed7ca20e3f92ab28\",\n\tcolor: blue;\n}\n\n#hula {\n\n\tcolor: red;\n}", "spans": [{"start": 87, "end": 100, "label": "person_name", "value_type": "full_name", "context": "comment", "synthetic": true, "value": "Charan Bhakta", "entity_id": "c-00000-d87f96f60c1a4b63/e000", "surface_form_type": "full_name", "replacement": "Jacob Nath"}, {"start": 170, "end": 241, "label": "token", "value_type": "digitalocean_pat", "context": "auth_header", "synthetic": true, "value": "dop_v1_d1fcf3c8fd3c34e4351904ac34f63953e818b12fde77a838ed7ca20e3f92ab28", "entity_id": "c-00000-d87f96f60c1a4b63/e001", "surface_form_type": "literal", "replacement": "dop_v1_c9ecc0f1ec0b74d4126548dd09e38447e383e01ade89d212ec7ee53e5a66ae15"}, {"start": 334, "end": 347, "label": "person_name", "value_type": "full_name", "context": "comment", "synthetic": true, "value": "Charan Bhakta", "entity_id": "c-00000-d87f96f60c1a4b63/e000", "surface_form_type": "full_name", "replacement": "Jacob Nath"}, {"start": 396, "end": 467, "label": "token", "value_type": "digitalocean_pat", "context": "auth_header", "synthetic": true, "value": "dop_v1_d1fcf3c8fd3c34e4351904ac34f63953e818b12fde77a838ed7ca20e3f92ab28", "entity_id": "c-00000-d87f96f60c1a4b63/e001", "surface_form_type": "literal", "replacement": "dop_v1_c9ecc0f1ec0b74d4126548dd09e38447e383e01ade89d212ec7ee53e5a66ae15"}], "hard_negatives": [{"start": 255, "end": 276, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "moranamanda@localhost", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-d87f96f60c1a4b63", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-e1a3061a68a051c9", "source": "codeparrot/github-code-clean", "repo": "digicorp/propeller", "license": "mit", "language": "CSS", "path": "components/custom-scrollbar/css/jquery.mCustomScrollbar.css", "text": "/*\n== malihu jquery custom scrollbar plugin ==\nPlugin URI: http://manos.malihu.gr/jquery-custom-content-scroller\n*/\n\n\n\n/*\nCONTENTS: \n\t1. BASIC STYLE - Plugin's basic/essential CSS properties (normally, should not be edited). \n\t2. VERTICAL SCROLLBAR - Positioning and dimensions of vertical scrollbar. \n\t3. HORIZONTAL SCROLLBAR - Positioning and dimensions of horizontal scrollbar.\n\t4. VERTICAL AND HORIZONTAL SCROLLBARS - Positioning and dimensions of 2-axis scrollbars. \n\t5. TRANSITIONS - CSS3 transitions for hover events, auto-expanded and auto-hidden scrollbars. \n\t6. SCROLLBAR COLORS, OPACITY AND BACKGROUNDS \n\t\t6.1 THEMES - Scrollbar colors, opacity, dimensions, backgrounds etc. via ready-to-use themes.\n*/\n\n\n\n/* \n------------------------------------------------------------------------------------------------------------------------\n1. BASIC STYLE \n------------------------------------------------------------------------------------------------------------------------\n*/\n\t.mCustomScrollbar{ -ms-touch-action: none; touch-action: none; /* MSPointer events - direct all pointer events to js */ }\n\t.mCustomScrollbar.mCS_no_scrollbar, .mCustomScrollbar.mCS_touch_action{ -ms-touch-action: auto; touch-action: auto; }\n\t\n\t.mCustomScrollBox{ /* contains plugin's markup */\n\t\tposition: relative;\n\t\toverflow: hidden;\n\t\theight: 100%;\n\t\tmax-width: 100%;\n\t\toutline: none;\n\t\tdirection: ltr;\n\t}\n\n\t.mCSB_container{ /* contains the original content */\n\t\toverflow: hidden;\n\t\twidth: auto;\n\t\theight: auto;\n\t}\n\n\n\n/* \n------------------------------------------------------------------------------------------------------------------------\n2. VERTICAL SCROLLBAR \ny-axis\n------------------------------------------------------------------------------------------------------------------------\n*/\n\n\t.mCSB_inside > .mCSB_container{ margin-right: 30px; }\n\n\t.mCSB_container.mCS_no_scrollbar_y.mCS_y_hidden{ margin-right: 0; } /* non-visible scrollbar */\n\t\n\t.mCS-dir-rtl > .mCSB_inside > .mCSB_container{ /* RTL direction/left-side scrollbar */\n\t\tmargin-right: 0;\n\t\tmargin-left: 30px;\n\t}\n\t\n\t.mCS-dir-rtl > .mCSB_inside > .mCSB_container.mCS_no_scrollbar_y.mCS_y_hidden{ margin-left: 0; } /* RTL direction/left-side scrollbar */\n\n\t.mCSB_scrollTools{ /* contains scrollbar markup (draggable element, dragger rail, buttons etc.) */\n\t\tposition: absolute;\n\t\twidth: 16px;\n\t\theight: auto;\n\t\tleft: auto;\n\t\ttop: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t}\n\n\t.mCSB_outside + .mCSB_scrollTools{ right: -26px; } /* scrollbar position: outside */\n\t\n\t.mCS-dir-rtl > .mCSB_inside > .mCSB_scrollTools, \n\t.mCS-dir-rtl > .mCSB_outside + .mCSB_scrollTools{ /* RTL direction/left-side scrollbar */\n\t\tright: auto;\n\t\tleft: 0;\n\t}\n\t\n\t.mCS-dir-rtl > .mCSB_outside + .mCSB_scrollTools{ left: -26px; } /* RTL direction/left-side scrollbar (scrollbar position: outside) */\n\n\t.mCSB_scrollTools .mCSB_draggerContainer{ /* contains the draggable element and dragger rail markup */\n\t\tposition: absolute;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tbottom: 0;\n\t\tright: 0; \n\t\theight: auto;\n\t}\n\n\t.mCSB_scrollTools a + .mCSB_draggerContainer{ margin: 20px 0; }\n\n\t.mCSB_scrollTools .mCSB_draggerRail{\n\t\twidth: 2px;\n\t\theight: 100%;\n\t\tmargin: 0 auto;\n\t\t-webkit-border-radius: 16px; -moz-border-radius: 16px; border-radius: 16px;\n\t}\n\n\t.mCSB_scrollTools .mCSB_dragger{ /* the draggable element */\n\t\tcursor: pointer;\n\t\twidth: 100%;\n\t\theight: 30px; /* minimum dragger height */\n\t\tz-index: 1;\n\t}\n\n\t.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{ /* the dragger element */\n\t\tposition: relative;\n\t\twidth: 4px;\n\t\theight: 100%;\n\t\tmargin: 0 auto;\n\t\t-webkit-border-radius: 16px; -moz-border-radius: 16px; border-radius: 16px;\n\t\ttext-align: center;\n\t}\n\t\n\t.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar, \n\t.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar{ width: 12px; /* auto-expanded scrollbar */ }\n\t\n\t.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, \n\t.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail{ width: 8px; /* auto-expanded scrollbar */ }\n\n\t.mCSB_scrollTools .mCSB_buttonUp,\n\t.mCSB_scrollTools .mCSB_buttonDown{\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\theight: 20px;\n\t\twidth: 100%;\n\t\toverflow: hidden;\n\t\tmargin: 0 auto;\n\t\tcursor: pointer;\n\t}\n\n\t.mCSB_scrollTools .mCSB_buttonDown{ bottom: 0; }\n\n\n\n/* \n------------------------------------------------------------------------------------------------------------------------\n3. HORIZONTAL SCROLLBAR \nx-axis\n------------------------------------------------------------------------------------------------------------------------\n*/\n\n\t.mCSB_horizontal.mCSB_inside > .mCSB_container{\n\t\tmargin-right: 0;\n\t\tmargin-bottom: 30px;\n\t}\n\t\n\t.mCSB_horizontal.mCSB_outside > .mCSB_container{ min-height: 100%; }\n\n\t.mCSB_horizontal > .mCSB_container.mCS_no_scrollbar_x.mCS_x_hidden{ margin-bottom: 0; } /* non-visible scrollbar */\n\n\t.mCSB_scrollTools.mCSB_scrollTools_horizontal{\n\t\twidth: auto;\n\t\theight: 16px;\n\t\ttop: auto;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tleft: 0;\n\t}\n\n\t.mCustomScrollBox + .mCSB_scrollTools.mCSB_scrollTools_horizontal,\n\t.mCustomScrollBox + .mCSB_scrollTools + .mCSB_scrollTools.mCSB_scrollTools_horizontal{ bottom: -26px; } /* scrollbar position: outside */\n\n\t.mCSB_scrollTools.mCSB_scrollTools_horizontal a + .mCSB_draggerContainer{ margin: 0 20px; }\n\n\t.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_draggerRail{\n\t\twidth: 100%;\n\t\theight: 2px;\n\t\tmargin: 7px 0;\n\t}\n\n\t.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_dragger{\n\t\twidth: 30px; /* minimum dragger width */\n\t\theight: 100%;\n\t\tleft: 0;\n\t}\n\n\t.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar{\n\t\twidth: 100%;\n\t\theight: 4px;\n\t\tmargin: 6px auto;\n\t}\n\t\n\t.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar, \n\t.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar{\n\t\theight: 12px; /* auto-expanded scrollbar */\n\t\tmargin: 2px auto;\n\t}\n\t\n\t.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, \n\t.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail{\n\t\theight: 8px; /* auto-expanded scrollbar */\n\t\tmargin: 4px 0;\n\t}\n\n\t.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_buttonLeft,\n\t.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_buttonRight{\n\t\tdisplay: block;\n\t\tposition: absolute;\n\t\twidth: 20px;\n\t\theight: 100%;\n\t\toverflow: hidden;\n\t\tmargin: 0 auto;\n\t\tcursor: pointer;\n\t}\n\t\n\t.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_buttonLeft{ left: 0; }\n\n\t.mCSB_scrollTools.mCSB_scrollTools_horizontal .mCSB_buttonRight{ right: 0; }\n\n\n\n/* \n------------------------------------------------------------------------------------------------------------------------\n4. VERTICAL AND HORIZONTAL SCROLLBARS \nyx-axis \n------------------------------------------------------------------------------------------------------------------------\n*/\n\n\t.mCSB_container_wrapper{\n\t\tposition: absolute;\n\t\theight: auto;\n\t\twidth: auto;\n\t\toverflow: hidden;\n\t\ttop: 0;\n\t\tleft: 0;\n\t\tright: 0;\n\t\tbottom: 0;\n\t\tmargin-right: 30px;\n\t\tmargin-bottom: 30px;\n\t}\n\t\n\t.mCSB_container_wrapper > .mCSB_container{\n\t\tpadding-right: 30px;\n\t\tpadding-bottom: 30px;\n\t}\n\t\n\t.mCSB_vertical_horizontal > .mCSB_scrollTools.mCSB_scrollTools_vertical{ bottom: 20px; }\n\t\n\t.mCSB_vertical_horizontal > .mCSB_scrollTools.mCSB_scrollTools_horizontal{ right: 20px; }\n\t\n\t/* non-visible horizontal scrollbar */\n\t.mCSB_container_wrapper.mCS_no_scrollbar_x.mCS_x_hidden + .mCSB_scrollTools.mCSB_scrollTools_vertical{ bottom: 0; }\n\t\n\t/* non-visible vertical scrollbar/RTL direction/left-side scrollbar */\n\t.mCSB_container_wrapper.mCS_no_scrollbar_y.mCS_y_hidden + .mCSB_scrollTools ~ .mCSB_scrollTools.mCSB_scrollTools_horizontal, \n\t.mCS-dir-rtl > .mCustomScrollBox.mCSB_vertical_horizontal.mCSB_inside > .mCSB_scrollTools.mCSB_scrollTools_horizontal{ right: 0; }\n\t\n\t/* RTL direction/left-side scrollbar */\n\t.mCS-dir-rtl > .mCustomScrollBox.mCSB_vertical_horizontal.mCSB_inside > .mCSB_scrollTools.mCSB_scrollTools_horizontal{ left: 20px; }\n\t\n\t/* non-visible scrollbar/RTL direction/left-side scrollbar */\n\t.mCS-dir-rtl > .mCustomScrollBox.mCSB_vertical_horizontal.mCSB_inside > .mCSB_container_wrapper.mCS_no_scrollbar_y.mCS_y_hidden + .mCSB_scrollTools ~ .mCSB_scrollTools.mCSB_scrollTools_horizontal{ left: 0; }\n\t\n\t.mCS-dir-rtl > .mCSB_inside > .mCSB_container_wrapper{ /* RTL direction/left-side scrollbar */\n\t\tmargin-right: 0;\n\t\tmargin-left: 30px;\n\t}\n\t\n\t.mCSB_container_wrapper.mCS_no_scrollbar_y.mCS_y_hidden > .mCSB_container{ \n\t\tpadding-right: 0; \n\t\t-webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;\n\t}\n\t\n\t.mCSB_container_wrapper.mCS_no_scrollbar_x.mCS_x_hidden > .mCSB_container{ \n\t\tpadding-bottom: 0; \n\t\t-webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;\n\t}\n\t\n\t.mCustomScrollBox.mCSB_vertical_horizontal.mCSB_inside > .mCSB_container_wrapper.mCS_no_scrollbar_y.mCS_y_hidden{\n\t\tmargin-right: 0; /* non-visible scrollbar */\n\t\tmargin-left: 0;\n\t}\n\t\n\t/* non-visible horizontal scrollbar */\n\t.mCustomScrollBox.mCSB_vertical_horizontal.mCSB_inside > .mCSB_container_wrapper.mCS_no_scrollbar_x.mCS_x_hidden{ margin-bottom: 0; }\n\n\n\n/* \n------------------------------------------------------------------------------------------------------------------------\n5. TRANSITIONS \n------------------------------------------------------------------------------------------------------------------------\n*/\n\n\t.mCSB_scrollTools, \n\t.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, \n\t.mCSB_scrollTools .mCSB_buttonUp,\n\t.mCSB_scrollTools .mCSB_buttonDown,\n\t.mCSB_scrollTools .mCSB_buttonLeft,\n\t.mCSB_scrollTools .mCSB_buttonRight{\n\t\t-webkit-transition: opacity .2s ease-in-out, background-color .2s ease-in-out;\n\t\t-moz-transition: opacity .2s ease-in-out, background-color .2s ease-in-out;\n\t\t-o-transition: opacity .2s ease-in-out, background-color .2s ease-in-out;\n\t\ttransition: opacity .2s ease-in-out, background-color .2s ease-in-out;\n\t}\n\t\n\t.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger_bar, /* auto-expanded scrollbar */\n\t.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerRail, \n\t.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger_bar, \n\t.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerRail{\n\t\t-webkit-transition: width .2s ease-out .2s, height .2s ease-out .2s, \n\t\t\t\t\tmargin-left .2s ease-out .2s, margin-right .2s ease-out .2s, \n\t\t\t\t\tmargin-top .2s ease-out .2s, margin-bottom .2s ease-out .2s,\n\t\t\t\t\topacity .2s ease-in-out, background-color .2s ease-in-out; \n\t\t-moz-transition: width .2s ease-out .2s, height .2s ease-out .2s, \n\t\t\t\t\tmargin-left .2s ease-out .2s, margin-right .2s ease-out .2s, \n\t\t\t\t\tmargin-top .2s ease-out .2s, margin-bottom .2s ease-out .2s,\n\t\t\t\t\topacity .2s ease-in-out, background-color .2s ease-in-out; \n\t\t-o-transition: width .2s ease-out .2s, height .2s ease-out .2s, \n\t\t\t\t\tmargin-left .2s ease-out .2s, margin-right .2s ease-out .2s, \n\t\t\t\t\tmargin-top .2s ease-out .2s, margin-bottom .2s ease-out .2s,\n\t\t\t\t\topacity .2s ease-in-out, background-color .2s ease-in-out; \n\t\ttransition: width .2s ease-out .2s, height .2s ease-out .2s, \n\t\t\t\t\tmargin-left .2s ease-out .2s, margin-right .2s ease-out .2s, \n\t\t\t\t\tmargin-top .2s ease-out .2s, margin-bottom .2s ease-out .2s,\n\t\t\t\t\topacity .2s ease-in-out, background-color .2s ease-in-out; \n\t}\n\n\n\n/* \n------------------------------------------------------------------------------------------------------------------------\n6. SCROLLBAR COLORS, OPACITY AND BACKGROUNDS \n------------------------------------------------------------------------------------------------------------------------\n*/\n\n\t/* \n\t----------------------------------------\n\t6.1 THEMES \n\t----------------------------------------\n\t*/\n\t\n\t/* default theme (\"light\") */\n\n\t.mCSB_scrollTools{ opacity: 0.75; filter: \"alpha(opacity=75)\"; -ms-filter: \"alpha(opacity=75)\"; }\n\t\n\t.mCS-autoHide > .mCustomScrollBox > .mCSB_scrollTools,\n\t.mCS-autoHide > .mCustomScrollBox ~ .mCSB_scrollTools{ opacity: 0; filter: \"alpha(opacity=0)\"; -ms-filter: \"alpha(opacity=0)\"; }\n\t\n\t.mCustomScrollbar > .mCustomScrollBox > .mCSB_scrollTools.mCSB_scrollTools_onDrag,\n\t.mCustomScrollbar > .mCustomScrollBox ~ .mCSB_scrollTools.mCSB_scrollTools_onDrag,\n\t.mCustomScrollBox:hover > .mCSB_scrollTools,\n\t.mCustomScrollBox:hover ~ .mCSB_scrollTools,\n\t.mCS-autoHide:hover > .mCustomScrollBox > .mCSB_scrollTools,\n\t.mCS-autoHide:hover > .mCustomScrollBox ~ .mCSB_scrollTools{ opacity: 1; filter: \"alpha(opacity=100)\"; -ms-filter: \"alpha(opacity=100)\"; }\n\n\t.mCSB_scrollTools .mCSB_draggerRail{\n\t\tbackground-color: #000; background-color: rgba(229, 229, 229, 0.5);\n\t\tfilter: \"alpha(opacity=40)\"; -ms-filter: \"alpha(opacity=40)\"; \n\t}\n\n\t.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{\n\t\tbackground-color: #fff; background-color: rgba(230, 230, 230, 1);\n\t\tfilter: \"alpha(opacity=75)\"; -ms-filter: \"alpha(opacity=75)\"; \n\t}\n\n\t.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{\n\t\tbackground-color: #fff; background-color: rgba(178, 178, 178, 1);\n\t\tfilter: \"alpha(opacity=85)\"; -ms-filter: \"alpha(opacity=85)\"; \n\t}\n\t.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,\n\t.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{\n\t\tbackground-color: #fff; background-color: rgba(178, 178, 178, 1);\n\t\tfilter: \"alpha(opacity=90)\"; -ms-filter: \"alpha(opacity=90)\"; \n\t}\n\n\t.mCSB_scrollTools .mCSB_buttonUp,\n\t.mCSB_scrollTools .mCSB_buttonDown,\n\t.mCSB_scrollTools .mCSB_buttonLeft,\n\t.mCSB_scrollTools .mCSB_buttonRight{\n\t\tbackground-image: url(mCSB_buttons.png); /* css sprites */\n\t\tbackground-repeat: no-repeat;\n\t\topacity: 0.4; filter: \"alpha(opacity=40)\"; -ms-filter: \"alpha(opacity=40)\"; \n\t}\n\n\t.mCSB_scrollTools .mCSB_buttonUp{\n\t\tbackground-position: 0 0;\n\t\t/* \n\t\tsprites locations \n\t\tlight: 0 0, -16px 0, -32px 0, -48px 0, 0 -72px, -16px -72px, -32px -72px\n\t\tdark: -80px 0, -96px 0, -112px 0, -128px 0, -80px -72px, -96px -72px, -112px -72px\n\t\t*/\n\t}\n\n\t.mCSB_scrollTools .mCSB_buttonDown{\n\t\tbackground-position: 0 -20px;\n\t\t/* \n\t\tsprites locations\n\t\tlight: 0 -20px, -16px -20px, -32px -20px, -48px -20px, 0 -92px, -16px -92px, -32px -92px\n\t\tdark: -80px -20px, -96px -20px, -112px -20px, -128px -20px, -80px -92px, -96px -92px, -112 -92px\n\t\t*/\n\t}\n\n\t.mCSB_scrollTools .mCSB_buttonLeft{\n\t\tbackground-position: 0 -40px;\n\t\t/* \n\t\tsprites locations \n\t\tlight: 0 -40px, -20px -40px, -40px -40px, -60px -40px, 0 -112px, -20px -112px, -40px -112px\n\t\tdark: -80px -40px, -100px -40px, -120px -40px, -140px -40px, -80px -112px, -100px -112px, -120px -112px\n\t\t*/\n\t}\n\n\t.mCSB_scrollTools .mCSB_buttonRight{\n\t\tbackground-position: 0 -56px;\n\t\t/* \n\t\tsprites locations \n\t\tlight: 0 -56px, -20px -56px, -40px -56px, -60px -56px, 0 -128px, -20px -128px, -40px -128px\n\t\tdark: -80px -56px, -100px -56px, -120px -56px, -140px -56px, -80px -128px, -100px -128px, -120px -128px\n\t\t*/\n\t}\n\n\t.mCSB_scrollTools .mCSB_buttonUp:hover,\n\t.mCSB_scrollTools .mCSB_buttonDown:hover,\n\t.mCSB_scrollTools .mCSB_buttonLeft:hover,\n\t.mCSB_scrollTools .mCSB_buttonRight:hover{ opacity: 0.75; filter: \"alpha(opacity=75)\"; -ms-filter: \"alpha(opacity=75)\"; }\n\n\t.mCSB_scrollTools .mCSB_buttonUp:active,\n\t.mCSB_scrollTools .mCSB_buttonDown:active,\n\t.mCSB_scrollTools .mCSB_buttonLeft:active,\n\t.mCSB_scrollTools .mCSB_buttonRight:active{ opacity: 0.9; filter: \"alpha(opacity=90)\"; -ms-filter: \"alpha(opacity=90)\"; }\n\t\n\n\t/* theme: \"dark\" */\n\n\t.mCS-dark.mCSB_scrollTools .mCSB_draggerRail{ background-color: #000; background-color: rgba(229, 229, 229, 0.5); }\n\n\t.mCS-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{ background-color: #000; background-color: rgba(0,0,0,0.75); }\n\n\t.mCS-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{ background-color: rgba(0,0,0,0.85); }\n\n\t.mCS-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,\n\t.mCS-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{ background-color: rgba(0,0,0,0.9); }\n\n\t.mCS-dark.mCSB_scrollTools .mCSB_buttonUp{ background-position: -80px 0; }\n\n\t.mCS-dark.mCSB_scrollTools .mCSB_buttonDown{ background-position: -80px -20px; }\n\n\t.mCS-dark.mCSB_scrollTools .mCSB_buttonLeft{ background-position: -80px -40px; }\n\n\t.mCS-dark.mCSB_scrollTools .mCSB_buttonRight{ background-position: -80px -56px; }\n\t\n\t/* ---------------------------------------- */\n\t\n\n\n\t/* theme: \"light-2\", \"dark-2\" */\n\n\t.mCS-light-2.mCSB_scrollTools .mCSB_draggerRail, \n\t.mCS-dark-2.mCSB_scrollTools .mCSB_draggerRail{\n\t\twidth: 4px;\n\t\tbackground-color: #fff; background-color: rgba(229, 229, 229, 0.5);\n\t\t-webkit-border-radius: 1px; -moz-border-radius: 1px; border-radius: 1px;\n\t}\n\n\t.mCS-light-2.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-dark-2.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{\n\t\twidth: 4px;\n\t\tbackground-color: #fff; background-color: rgba(255,255,255,0.75);\n\t\t-webkit-border-radius: 1px; -moz-border-radius: 1px; border-radius: 1px;\n\t}\n\n\t.mCS-light-2.mCSB_scrollTools_horizontal .mCSB_draggerRail, \n\t.mCS-dark-2.mCSB_scrollTools_horizontal .mCSB_draggerRail, \n\t.mCS-light-2.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-dark-2.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar{\n\t\twidth: 100%;\n\t\theight: 4px;\n\t\tmargin: 6px auto;\n\t}\n\n\t.mCS-light-2.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{ background-color: #fff; background-color: rgba(255,255,255,0.85); }\n\n\t.mCS-light-2.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,\n\t.mCS-light-2.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{ background-color: #fff; background-color: rgba(255,255,255,0.9); }\n\n\t.mCS-light-2.mCSB_scrollTools .mCSB_buttonUp{ background-position: -32px 0; }\n\n\t.mCS-light-2.mCSB_scrollTools .mCSB_buttonDown{\tbackground-position: -32px -20px; }\n\n\t.mCS-light-2.mCSB_scrollTools .mCSB_buttonLeft{\tbackground-position: -40px -40px; }\n\n\t.mCS-light-2.mCSB_scrollTools .mCSB_buttonRight{ background-position: -40px -56px; }\n\t\n\t\n\t/* theme: \"dark-2\" */\n\n\t.mCS-dark-2.mCSB_scrollTools .mCSB_draggerRail{\n\t\tbackground-color: #000; background-color: rgba(0,0,0,0.1);\n\t\t-webkit-border-radius: 1px; -moz-border-radius: 1px; border-radius: 1px;\n\t}\n\n\t.mCS-dark-2.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{\n\t\tbackground-color: #000; background-color: rgba(0,0,0,0.75);\n\t\t-webkit-border-radius: 1px; -moz-border-radius: 1px; border-radius: 1px;\n\t}\n\n\t.mCS-dark-2.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{ background-color: #000; background-color: rgba(0,0,0,0.85); }\n\n\t.mCS-dark-2.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,\n\t.mCS-dark-2.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{ background-color: #000; background-color: rgba(0,0,0,0.9); }\n\n\t.mCS-dark-2.mCSB_scrollTools .mCSB_buttonUp{ background-position: -112px 0; }\n\n\t.mCS-dark-2.mCSB_scrollTools .mCSB_buttonDown{ background-position: -112px -20px; }\n\n\t.mCS-dark-2.mCSB_scrollTools .mCSB_buttonLeft{ background-position: -120px -40px; }\n\n\t.mCS-dark-2.mCSB_scrollTools .mCSB_buttonRight{\tbackground-position: -120px -56px; }\n\t\n\t/* ---------------------------------------- */\n\t\n\n\n\t/* theme: \"light-thick\", \"dark-thick\" */\n\n\t.mCS-light-thick.mCSB_scrollTools .mCSB_draggerRail, \n\t.mCS-dark-thick.mCSB_scrollTools .mCSB_draggerRail{\n\t\twidth: 4px;\n\t\tbackground-color: #fff; background-color: rgba(255,255,255,0.1);\n\t\t-webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px;\n\t}\n\n\t.mCS-light-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-dark-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{\n\t\twidth: 6px;\n\t\tbackground-color: #fff; background-color: rgba(255,255,255,0.75);\n\t\t-webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px;\n\t}\n\n\t.mCS-light-thick.mCSB_scrollTools_horizontal .mCSB_draggerRail, \n\t.mCS-dark-thick.mCSB_scrollTools_horizontal .mCSB_draggerRail{\n\t\twidth: 100%;\n\t\theight: 4px;\n\t\tmargin: 6px 0;\n\t}\n\n\t.mCS-light-thick.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-dark-thick.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar{\n\t\twidth: 100%;\n\t\theight: 6px;\n\t\tmargin: 5px auto;\n\t}\n\n\t.mCS-light-thick.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{ background-color: #fff; background-color: rgba(255,255,255,0.85); }\n\n\t.mCS-light-thick.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,\n\t.mCS-light-thick.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{ background-color: #fff; background-color: rgba(255,255,255,0.9); }\n\n\t.mCS-light-thick.mCSB_scrollTools .mCSB_buttonUp{ background-position: -16px 0; }\n\n\t.mCS-light-thick.mCSB_scrollTools .mCSB_buttonDown{\tbackground-position: -16px -20px; }\n\n\t.mCS-light-thick.mCSB_scrollTools .mCSB_buttonLeft{\tbackground-position: -20px -40px; }\n\n\t.mCS-light-thick.mCSB_scrollTools .mCSB_buttonRight{ background-position: -20px -56px; }\n\n\n\t/* theme: \"dark-thick\" */\n\t\n\t.mCS-dark-thick.mCSB_scrollTools .mCSB_draggerRail{\n\t\tbackground-color: #000; background-color: rgba(0,0,0,0.1);\n\t\t-webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px;\n\t}\n\n\t.mCS-dark-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{\n\t\tbackground-color: #000; background-color: rgba(0,0,0,0.75);\n\t\t-webkit-border-radius: 2px; -moz-border-radius: 2px; border-radius: 2px;\n\t}\n\n\t.mCS-dark-thick.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{ background-color: #000; background-color: rgba(0,0,0,0.85); }\n\n\t.mCS-dark-thick.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,\n\t.mCS-dark-thick.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{ background-color: #000; background-color: rgba(0,0,0,0.9); }\n\n\t.mCS-dark-thick.mCSB_scrollTools .mCSB_buttonUp{ background-position: -96px 0; }\n\n\t.mCS-dark-thick.mCSB_scrollTools .mCSB_buttonDown{ background-position: -96px -20px; }\n\n\t.mCS-dark-thick.mCSB_scrollTools .mCSB_buttonLeft{ background-position: -100px -40px; }\n\n\t.mCS-dark-thick.mCSB_scrollTools .mCSB_buttonRight{\tbackground-position: -100px -56px; }\n\t\n\t/* ---------------------------------------- */\n\t\n\n\n\t/* theme: \"light-thin\", \"dark-thin\" */\n\t\n\t.mCS-light-thin.mCSB_scrollTools .mCSB_draggerRail{ background-color: #fff; background-color: rgba(255,255,255,0.1); }\n\n\t.mCS-light-thin.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-dark-thin.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{ width: 2px; }\n\n\t.mCS-light-thin.mCSB_scrollTools_horizontal .mCSB_draggerRail, \n\t.mCS-dark-thin.mCSB_scrollTools_horizontal .mCSB_draggerRail{ width: 100%; }\n\n\t.mCS-light-thin.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-dark-thin.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar{\n\t\twidth: 100%;\n\t\theight: 2px;\n\t\tmargin: 7px auto;\n\t}\n\n\n\t/* theme \"dark-thin\" */\n\t\n\t.mCS-dark-thin.mCSB_scrollTools .mCSB_draggerRail{ background-color: #000; background-color: rgba(0,0,0,0.15); }\n\n\t.mCS-dark-thin.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{ background-color: #000; background-color: rgba(0,0,0,0.75); }\n\t\n\t.mCS-dark-thin.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{ background-color: #000; background-color: rgba(0,0,0,0.85); }\n\t\n\t.mCS-dark-thin.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,\n\t.mCS-dark-thin.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{ background-color: #000; background-color: rgba(0,0,0,0.9); }\n\t\n\t.mCS-dark-thin.mCSB_scrollTools .mCSB_buttonUp{\tbackground-position: -80px 0; }\n\n\t.mCS-dark-thin.mCSB_scrollTools .mCSB_buttonDown{ background-position: -80px -20px; }\n\n\t.mCS-dark-thin.mCSB_scrollTools .mCSB_buttonLeft{ background-position: -80px -40px; }\n\n\t.mCS-dark-thin.mCSB_scrollTools .mCSB_buttonRight{ background-position: -80px -56px; }\n\t\n\t/* ---------------------------------------- */\n\t\n\t\n\t\n\t/* theme \"rounded\", \"rounded-dark\", \"rounded-dots\", \"rounded-dots-dark\" */\n\t\n\t.mCS-rounded.mCSB_scrollTools .mCSB_draggerRail{ background-color: #fff; background-color: rgba(255,255,255,0.15); }\n\t\n\t.mCS-rounded.mCSB_scrollTools .mCSB_dragger, \n\t.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger, \n\t.mCS-rounded-dots.mCSB_scrollTools .mCSB_dragger, \n\t.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger{ height: 14px; }\n\t\n\t.mCS-rounded.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-rounded-dots.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{\n\t\twidth: 14px;\n\t\tmargin: 0 1px;\n\t}\n\t\n\t.mCS-rounded.mCSB_scrollTools_horizontal .mCSB_dragger, \n\t.mCS-rounded-dark.mCSB_scrollTools_horizontal .mCSB_dragger, \n\t.mCS-rounded-dots.mCSB_scrollTools_horizontal .mCSB_dragger, \n\t.mCS-rounded-dots-dark.mCSB_scrollTools_horizontal .mCSB_dragger{ width: 14px; }\n\t\n\t.mCS-rounded.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-rounded-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-rounded-dots.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-rounded-dots-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar{\n\t\theight: 14px;\n\t\tmargin: 1px 0;\n\t}\n\t\n\t.mCS-rounded.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar, \n\t.mCS-rounded.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-rounded-dark.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar, \n\t.mCS-rounded-dark.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar{\n\t\twidth: 16px; /* auto-expanded scrollbar */\n\t\theight: 16px;\n\t\tmargin: -1px 0;\n\t}\n\t\n\t.mCS-rounded.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, \n\t.mCS-rounded.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail, \n\t.mCS-rounded-dark.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, \n\t.mCS-rounded-dark.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail{ width: 4px; /* auto-expanded scrollbar */ }\n\t\n\t.mCS-rounded.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar, \n\t.mCS-rounded.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-rounded-dark.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded .mCSB_dragger_bar, \n\t.mCS-rounded-dark.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_dragger .mCSB_dragger_bar{\n\t\theight: 16px; /* auto-expanded scrollbar */\n\t\twidth: 16px;\n\t\tmargin: 0 -1px;\n\t}\n\t\n\t.mCS-rounded.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, \n\t.mCS-rounded.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail, \n\t.mCS-rounded-dark.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, \n\t.mCS-rounded-dark.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail{\n\t\theight: 4px; /* auto-expanded scrollbar */\n\t\tmargin: 6px 0;\n\t}\n\t\n\t.mCS-rounded.mCSB_scrollTools .mCSB_buttonUp{ background-position: 0 -72px; }\n\t\n\t.mCS-rounded.mCSB_scrollTools .mCSB_buttonDown{ background-position: 0 -92px; }\n\t\n\t.mCS-rounded.mCSB_scrollTools .mCSB_buttonLeft{ background-position: 0 -112px; }\n\t\n\t.mCS-rounded.mCSB_scrollTools .mCSB_buttonRight{ background-position: 0 -128px; }\n\t\n\t\n\t/* theme \"rounded-dark\", \"rounded-dots-dark\" */\n\t\n\t.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{ background-color: #000; background-color: rgba(0,0,0,0.75); }\n\t\n\t.mCS-rounded-dark.mCSB_scrollTools .mCSB_draggerRail{ background-color: #000; background-color: rgba(0,0,0,0.15); }\n\t\n\t.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar, \n\t.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{ background-color: #000; background-color: rgba(0,0,0,0.85); }\n\t\n\t.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,\n\t.mCS-rounded-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar, \n\t.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,\n\t.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{ background-color: #000; background-color: rgba(0,0,0,0.9); }\n\t\n\t.mCS-rounded-dark.mCSB_scrollTools .mCSB_buttonUp{ background-position: -80px -72px; }\n\t\n\t.mCS-rounded-dark.mCSB_scrollTools .mCSB_buttonDown{ background-position: -80px -92px; }\n\t\n\t.mCS-rounded-dark.mCSB_scrollTools .mCSB_buttonLeft{ background-position: -80px -112px; }\n\t\n\t.mCS-rounded-dark.mCSB_scrollTools .mCSB_buttonRight{ background-position: -80px -128px; }\n\t\n\t\n\t/* theme \"rounded-dots\", \"rounded-dots-dark\" */\n\t\n\t.mCS-rounded-dots.mCSB_scrollTools_vertical .mCSB_draggerRail, \n\t.mCS-rounded-dots-dark.mCSB_scrollTools_vertical .mCSB_draggerRail{ width: 4px; }\n\t\n\t.mCS-rounded-dots.mCSB_scrollTools .mCSB_draggerRail, \n\t.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_draggerRail, \n\t.mCS-rounded-dots.mCSB_scrollTools_horizontal .mCSB_draggerRail, \n\t.mCS-rounded-dots-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail{\n\t\tbackground-color: transparent;\n\t\tbackground-position: center;\n\t}\n\t\n\t.mCS-rounded-dots.mCSB_scrollTools .mCSB_draggerRail, \n\t.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_draggerRail{\n\t\tbackground-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAANElEQVQYV2NkIAAYiVbw//9/Y6DiM1ANJoyMjGdBbLgJQAX/kU0DKgDLkaQAvxW4HEvQFwCRcxIJK1XznAAAAABJRU5ErkJggg==\");\n\t\tbackground-repeat: repeat-y;\n\t\topacity: 0.3;\n\t\tfilter: \"alpha(opacity=30)\"; -ms-filter: \"alpha(opacity=30)\"; \n\t}\n\t\n\t.mCS-rounded-dots.mCSB_scrollTools_horizontal .mCSB_draggerRail, \n\t.mCS-rounded-dots-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail{\n\t\theight: 4px;\n\t\tmargin: 6px 0;\n\t\tbackground-repeat: repeat-x;\n\t}\n\t\n\t.mCS-rounded-dots.mCSB_scrollTools .mCSB_buttonUp{ background-position: -16px -72px; }\n\t\n\t.mCS-rounded-dots.mCSB_scrollTools .mCSB_buttonDown{ background-position: -16px -92px; }\n\t\n\t.mCS-rounded-dots.mCSB_scrollTools .mCSB_buttonLeft{ background-position: -20px -112px; }\n\t\n\t.mCS-rounded-dots.mCSB_scrollTools .mCSB_buttonRight{ background-position: -20px -128px; }\n\t\n\t\n\t/* theme \"rounded-dots-dark\" */\n\t\n\t.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_draggerRail{\n\t\tbackground-image: url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAgAAAAICAYAAADED76LAAAALElEQVQYV2NkIAAYSVFgDFR8BqrBBEifBbGRTfiPZhpYjiQFBK3A6l6CvgAAE9kGCd1mvgEAAAAASUVORK5CYII=\");\n\t}\n\t\n\t.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_buttonUp{ background-position: -96px -72px; }\n\t\n\t.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_buttonDown{ background-position: -96px -92px; }\n\t\n\t.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_buttonLeft{ background-position: -100px -112px; }\n\t\n\t.mCS-rounded-dots-dark.mCSB_scrollTools .mCSB_buttonRight{ background-position: -100px -128px; }\n\t\n\t/* ---------------------------------------- */\n\t\n\t\n\t\n\t/* theme \"3d\", \"3d-dark\", \"3d-thick\", \"3d-thick-dark\" */\n\t\n\t.mCS-3d.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{\n\t\tbackground-repeat: repeat-y;\n\t\tbackground-image: -moz-linear-gradient(left, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0) 100%);\n\t\tbackground-image: -webkit-gradient(linear, left top, right top, color-stop(0%,rgba(255,255,255,0.5)), color-stop(100%,rgba(255,255,255,0)));\n\t\tbackground-image: -webkit-linear-gradient(left, rgba(255,255,255,0.5) 0%,rgba(255,255,255,0) 100%);\n\t\tbackground-image: -o-linear-gradient(left, rgba(255,255,255,0.5) 0%,rgba(255,255,255,0) 100%);\n\t\tbackground-image: -ms-linear-gradient(left, rgba(255,255,255,0.5) 0%,rgba(255,255,255,0) 100%);\n\t\tbackground-image: linear-gradient(to right, rgba(255,255,255,0.5) 0%,rgba(255,255,255,0) 100%);\n\t}\n\t\n\t.mCS-3d.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-3d-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-3d-thick.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-3d-thick-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar{\n\t\tbackground-repeat: repeat-x;\n\t\tbackground-image: -moz-linear-gradient(top, rgba(255,255,255,0.5) 0%, rgba(255,255,255,0) 100%);\n\t\tbackground-image: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,0.5)), color-stop(100%,rgba(255,255,255,0)));\n\t\tbackground-image: -webkit-linear-gradient(top, rgba(255,255,255,0.5) 0%,rgba(255,255,255,0) 100%);\n\t\tbackground-image: -o-linear-gradient(top, rgba(255,255,255,0.5) 0%,rgba(255,255,255,0) 100%);\n\t\tbackground-image: -ms-linear-gradient(top, rgba(255,255,255,0.5) 0%,rgba(255,255,255,0) 100%);\n\t\tbackground-image: linear-gradient(to bottom, rgba(255,255,255,0.5) 0%,rgba(255,255,255,0) 100%);\n\t}\n\t\n\t\n\t/* theme \"3d\", \"3d-dark\" */\n\t\n\t.mCS-3d.mCSB_scrollTools_vertical .mCSB_dragger, \n\t.mCS-3d-dark.mCSB_scrollTools_vertical .mCSB_dragger{ height: 70px; }\n\t\n\t.mCS-3d.mCSB_scrollTools_horizontal .mCSB_dragger, \n\t.mCS-3d-dark.mCSB_scrollTools_horizontal .mCSB_dragger{ width: 70px; }\n\t\n\t.mCS-3d.mCSB_scrollTools, \n\t.mCS-3d-dark.mCSB_scrollTools{\n\t\topacity: 1;\n\t\tfilter: \"alpha(opacity=30)\"; -ms-filter: \"alpha(opacity=30)\"; \n\t}\n\t\n\t.mCS-3d.mCSB_scrollTools .mCSB_draggerRail, \n\t.mCS-3d.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-3d-dark.mCSB_scrollTools .mCSB_draggerRail, \n\t.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{ -webkit-border-radius: 16px; -moz-border-radius: 16px; border-radius: 16px; }\n\t\n\t.mCS-3d.mCSB_scrollTools .mCSB_draggerRail, \n\t.mCS-3d-dark.mCSB_scrollTools .mCSB_draggerRail{\n\t\twidth: 8px;\n\t\tbackground-color: #000; background-color: rgba(0,0,0,0.2);\n\t\tbox-shadow: inset 1px 0 1px rgba(0,0,0,0.5), inset -1px 0 1px rgba(255,255,255,0.2);\n\t}\n\t\n\t.mCS-3d.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, \t \n\t.mCS-3d.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar, \n\t.mCS-3d.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,\n\t.mCS-3d.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar, \n\t.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar, \n\t.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,\n\t.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{ background-color: #555; }\n\n\t.mCS-3d.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-3d-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{ width: 8px; }\n\n\t.mCS-3d.mCSB_scrollTools_horizontal .mCSB_draggerRail, \n\t.mCS-3d-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail{\n\t\twidth: 100%;\n\t\theight: 8px;\n\t\tmargin: 4px 0;\n\t\tbox-shadow: inset 0 1px 1px rgba(0,0,0,0.5), inset 0 -1px 1px rgba(255,255,255,0.2);\n\t}\n\n\t.mCS-3d.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-3d-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar{\n\t\twidth: 100%;\n\t\theight: 8px;\n\t\tmargin: 4px auto;\n\t}\n\t\n\t.mCS-3d.mCSB_scrollTools .mCSB_buttonUp{ background-position: -32px -72px; }\n\t\n\t.mCS-3d.mCSB_scrollTools .mCSB_buttonDown{ background-position: -32px -92px; }\n\t\n\t.mCS-3d.mCSB_scrollTools .mCSB_buttonLeft{ background-position: -40px -112px; }\n\t\n\t.mCS-3d.mCSB_scrollTools .mCSB_buttonRight{ background-position: -40px -128px; }\n\t\n\t\n\t/* theme \"3d-dark\" */\n\t\n\t.mCS-3d-dark.mCSB_scrollTools .mCSB_draggerRail{\n\t\tbackground-color: #000; background-color: rgba(0,0,0,0.1);\n\t\tbox-shadow: inset 1px 0 1px rgba(0,0,0,0.1);\n\t}\n\t\n\t.mCS-3d-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail{ box-shadow: inset 0 1px 1px rgba(0,0,0,0.1); }\n\t\n\t.mCS-3d-dark.mCSB_scrollTools .mCSB_buttonUp{ background-position: -112px -72px; }\n\n\t.mCS-3d-dark.mCSB_scrollTools .mCSB_buttonDown{ background-position: -112px -92px; }\n\n\t.mCS-3d-dark.mCSB_scrollTools .mCSB_buttonLeft{ background-position: -120px -112px; }\n\n\t.mCS-3d-dark.mCSB_scrollTools .mCSB_buttonRight{\tbackground-position: -120px -128px; }\n\t\n\t/* ---------------------------------------- */\n\t\n\t\n\t\n\t/* theme: \"3d-thick\", \"3d-thick-dark\" */\n\t\n\t.mCS-3d-thick.mCSB_scrollTools, \n\t.mCS-3d-thick-dark.mCSB_scrollTools{\n\t\topacity: 1;\n\t\tfilter: \"alpha(opacity=30)\"; -ms-filter: \"alpha(opacity=30)\"; \n\t}\n\t\n\t.mCS-3d-thick.mCSB_scrollTools, \n\t.mCS-3d-thick-dark.mCSB_scrollTools, \n\t.mCS-3d-thick.mCSB_scrollTools .mCSB_draggerContainer, \n\t.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_draggerContainer{ -webkit-border-radius: 7px; -moz-border-radius: 7px; border-radius: 7px; }\n\t\n\t.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{ -webkit-border-radius: 5px; -moz-border-radius: 5px; border-radius: 5px; }\n\t\n\t.mCSB_inside + .mCS-3d-thick.mCSB_scrollTools_vertical, \n\t.mCSB_inside + .mCS-3d-thick-dark.mCSB_scrollTools_vertical{ right: 1px; }\n\t\n\t.mCS-3d-thick.mCSB_scrollTools_vertical, \n\t.mCS-3d-thick-dark.mCSB_scrollTools_vertical{ box-shadow: inset 1px 0 1px rgba(0,0,0,0.1), inset 0 0 14px rgba(0,0,0,0.5); }\n\t\n\t.mCS-3d-thick.mCSB_scrollTools_horizontal, \n\t.mCS-3d-thick-dark.mCSB_scrollTools_horizontal{\n\t\tbottom: 1px;\n\t\tbox-shadow: inset 0 1px 1px rgba(0,0,0,0.1), inset 0 0 14px rgba(0,0,0,0.5);\n\t}\n\t\n\t.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{\n\t\tbox-shadow: inset 1px 0 0 rgba(255,255,255,0.4);\n\t\twidth: 12px;\n\t\tmargin: 2px;\n\t\tposition: absolute;\n\t\theight: auto;\n\t\ttop: 0;\n\t\tbottom: 0;\n\t\tleft: 0;\n\t\tright: 0;\n\t}\n\t\n\t.mCS-3d-thick.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-3d-thick-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar{ box-shadow: inset 0 1px 0 rgba(255,255,255,0.4); }\n\t\n\t.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar, \n\t.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,\n\t.mCS-3d-thick.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{ background-color: #555; }\n\t\n\t.mCS-3d-thick.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-3d-thick-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar{\n\t\theight: 12px;\n\t\twidth: auto;\n\t}\n\t\n\t.mCS-3d-thick.mCSB_scrollTools .mCSB_draggerContainer{\n\t\tbackground-color: #000; background-color: rgba(0,0,0,0.05);\n\t\tbox-shadow: inset 1px 1px 16px rgba(0,0,0,0.1);\n\t}\n\t\n\t.mCS-3d-thick.mCSB_scrollTools .mCSB_draggerRail{ background-color: transparent; }\n\t\n\t.mCS-3d-thick.mCSB_scrollTools .mCSB_buttonUp{ background-position: -32px -72px; }\n\t\n\t.mCS-3d-thick.mCSB_scrollTools .mCSB_buttonDown{ background-position: -32px -92px; }\n\n\t.mCS-3d-thick.mCSB_scrollTools .mCSB_buttonLeft{ background-position: -40px -112px; }\n\n\t.mCS-3d-thick.mCSB_scrollTools .mCSB_buttonRight{\tbackground-position: -40px -128px; }\n\t\n\t\n\t/* theme: \"3d-thick-dark\" */\n\t\n\t.mCS-3d-thick-dark.mCSB_scrollTools{ box-shadow: inset 0 0 14px rgba(0,0,0,0.2); }\n\t\n\t.mCS-3d-thick-dark.mCSB_scrollTools_horizontal{ box-shadow: inset 0 1px 1px rgba(0,0,0,0.1), inset 0 0 14px rgba(0,0,0,0.2); }\n\t\n\t.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{ box-shadow: inset 1px 0 0 rgba(255,255,255,0.4), inset -1px 0 0 rgba(0,0,0,0.2); }\n\t \n\t.mCS-3d-thick-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar{ box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), inset 0 -1px 0 rgba(0,0,0,0.2); }\n\t\n\t.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar, \n\t.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,\n\t.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{ background-color: #777; }\n\t\n\t.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_draggerContainer{\n\t\tbackground-color: #fff; background-color: rgba(0,0,0,0.05);\n\t\tbox-shadow: inset 1px 1px 16px rgba(0,0,0,0.1);\n\t}\n\t\n\t.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_draggerRail{ background-color: transparent; }\n\t\n\t.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_buttonUp{ background-position: -112px -72px; }\n\t\n\t.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_buttonDown{ background-position: -112px -92px; }\n\n\t.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_buttonLeft{ background-position: -120px -112px; }\n\n\t.mCS-3d-thick-dark.mCSB_scrollTools .mCSB_buttonRight{\tbackground-position: -120px -128px; }\n\t\n\t/* ---------------------------------------- */\n\t\n\t\n\t\n\t/* theme: \"minimal\", \"minimal-dark\" */\n\t\n\t.mCSB_outside + .mCS-minimal.mCSB_scrollTools_vertical, \n\t.mCSB_outside + .mCS-minimal-dark.mCSB_scrollTools_vertical{\n\t\tright: 0; \n\t\tmargin: 12px 0; \n\t}\n\t\n\t.mCustomScrollBox.mCS-minimal + .mCSB_scrollTools.mCSB_scrollTools_horizontal, \n\t.mCustomScrollBox.mCS-minimal + .mCSB_scrollTools + .mCSB_scrollTools.mCSB_scrollTools_horizontal, \n\t.mCustomScrollBox.mCS-minimal-dark + .mCSB_scrollTools.mCSB_scrollTools_horizontal, \n\t.mCustomScrollBox.mCS-minimal-dark + .mCSB_scrollTools + .mCSB_scrollTools.mCSB_scrollTools_horizontal{\n\t\tbottom: 0; \n\t\tmargin: 0 12px; \n\t}\n\t\n\t/* RTL direction/left-side scrollbar */\n\t.mCS-dir-rtl > .mCSB_outside + .mCS-minimal.mCSB_scrollTools_vertical, \n\t.mCS-dir-rtl > .mCSB_outside + .mCS-minimal-dark.mCSB_scrollTools_vertical{\n\t\tleft: 0; \n\t\tright: auto;\n\t}\n\t\n\t.mCS-minimal.mCSB_scrollTools .mCSB_draggerRail, \n\t.mCS-minimal-dark.mCSB_scrollTools .mCSB_draggerRail{ background-color: transparent; }\n\t\n\t.mCS-minimal.mCSB_scrollTools_vertical .mCSB_dragger, \n\t.mCS-minimal-dark.mCSB_scrollTools_vertical .mCSB_dragger{ height: 50px; }\n\t\n\t.mCS-minimal.mCSB_scrollTools_horizontal .mCSB_dragger, \n\t.mCS-minimal-dark.mCSB_scrollTools_horizontal .mCSB_dragger{ width: 50px; }\n\t\n\t.mCS-minimal.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{\n\t\tbackground-color: #fff; background-color: rgba(255,255,255,0.2);\n\t\tfilter: \"alpha(opacity=20)\"; -ms-filter: \"alpha(opacity=20)\"; \n\t}\n\t\n\t.mCS-minimal.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,\n\t.mCS-minimal.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{\n\t\tbackground-color: #fff; background-color: rgba(255,255,255,0.5);\n\t\tfilter: \"alpha(opacity=50)\"; -ms-filter: \"alpha(opacity=50)\"; \n\t}\n\t\n\t\n\t/* theme: \"minimal-dark\" */\n\t\n\t.mCS-minimal-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{\n\t\tbackground-color: #000; background-color: rgba(0,0,0,0.2);\n\t\tfilter: \"alpha(opacity=20)\"; -ms-filter: \"alpha(opacity=20)\"; \n\t}\n\t\n\t.mCS-minimal-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,\n\t.mCS-minimal-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{\n\t\tbackground-color: #000; background-color: rgba(0,0,0,0.5);\n\t\tfilter: \"alpha(opacity=50)\"; -ms-filter: \"alpha(opacity=50)\"; \n\t}\n\t\n\t/* ---------------------------------------- */\n\t\n\t\n\t\n\t/* theme \"light-3\", \"dark-3\" */\n\t\n\t.mCS-light-3.mCSB_scrollTools .mCSB_draggerRail, \n\t.mCS-dark-3.mCSB_scrollTools .mCSB_draggerRail{\n\t\twidth: 6px;\n\t\tbackground-color: #000; background-color: rgba(0,0,0,0.2);\n\t}\n\n\t.mCS-light-3.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-dark-3.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{ width: 6px; }\n\n\t.mCS-light-3.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-dark-3.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-light-3.mCSB_scrollTools_horizontal .mCSB_draggerRail, \n\t.mCS-dark-3.mCSB_scrollTools_horizontal .mCSB_draggerRail{\n\t\twidth: 100%;\n\t\theight: 6px;\n\t\tmargin: 5px 0;\n\t}\n\t\n\t.mCS-light-3.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, \n\t.mCS-light-3.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail, \n\t.mCS-dark-3.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, \n\t.mCS-dark-3.mCSB_scrollTools_vertical.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail{\n\t\twidth: 12px;\n\t}\n\t\n\t.mCS-light-3.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, \n\t.mCS-light-3.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail, \n\t.mCS-dark-3.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_dragger.mCSB_dragger_onDrag_expanded + .mCSB_draggerRail, \n\t.mCS-dark-3.mCSB_scrollTools_horizontal.mCSB_scrollTools_onDrag_expand .mCSB_draggerContainer:hover .mCSB_draggerRail{\n\t\theight: 12px;\n\t\tmargin: 2px 0;\n\t}\n\t\n\t.mCS-light-3.mCSB_scrollTools .mCSB_buttonUp{ background-position: -32px -72px; }\n\t\n\t.mCS-light-3.mCSB_scrollTools .mCSB_buttonDown{ background-position: -32px -92px; }\n\t\n\t.mCS-light-3.mCSB_scrollTools .mCSB_buttonLeft{ background-position: -40px -112px; }\n\t\n\t.mCS-light-3.mCSB_scrollTools .mCSB_buttonRight{ background-position: -40px -128px; }\n\t\n\t\n\t/* theme \"dark-3\" */\n\t\n\t.mCS-dark-3.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{ background-color: #000; background-color: rgba(0,0,0,0.75); }\n\n\t.mCS-dark-3.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{ background-color: #000; background-color: rgba(0,0,0,0.85); }\n\n\t.mCS-dark-3.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,\n\t.mCS-dark-3.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{ background-color: #000; background-color: rgba(0,0,0,0.9); }\n\t\n\t.mCS-dark-3.mCSB_scrollTools .mCSB_draggerRail{ background-color: #000; background-color: rgba(0,0,0,0.1); }\n\t\n\t.mCS-dark-3.mCSB_scrollTools .mCSB_buttonUp{ background-position: -112px -72px; }\n\n\t.mCS-dark-3.mCSB_scrollTools .mCSB_buttonDown{ background-position: -112px -92px; }\n\n\t.mCS-dark-3.mCSB_scrollTools .mCSB_buttonLeft{ background-position: -120px -112px; }\n\n\t.mCS-dark-3.mCSB_scrollTools .mCSB_buttonRight{\tbackground-position: -120px -128px; }\n\t\n\t/* ---------------------------------------- */\n\t\n\t\n\t\n\t/* theme \"inset\", \"inset-dark\", \"inset-2\", \"inset-2-dark\", \"inset-3\", \"inset-3-dark\" */\n\t\n\t.mCS-inset.mCSB_scrollTools .mCSB_draggerRail, \n\t.mCS-inset-dark.mCSB_scrollTools .mCSB_draggerRail, \n\t.mCS-inset-2.mCSB_scrollTools .mCSB_draggerRail, \n\t.mCS-inset-2-dark.mCSB_scrollTools .mCSB_draggerRail, \n\t.mCS-inset-3.mCSB_scrollTools .mCSB_draggerRail, \n\t.mCS-inset-3-dark.mCSB_scrollTools .mCSB_draggerRail{\n\t\twidth: 12px;\n\t\tbackground-color: #000; background-color: rgba(0,0,0,0.2);\n\t}\n\n\t.mCS-inset.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-inset-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-inset-2.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-inset-2-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-inset-3.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{ \n\t\twidth: 6px;\n\t\tmargin: 3px 5px;\n\t\tposition: absolute;\n\t\theight: auto;\n\t\ttop: 0;\n\t\tbottom: 0;\n\t\tleft: 0;\n\t\tright: 0;\n\t}\n\n\t.mCS-inset.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-inset-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-inset-2.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-inset-2-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-inset-3.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-inset-3-dark.mCSB_scrollTools_horizontal .mCSB_dragger .mCSB_dragger_bar{\n\t\theight: 6px;\n\t\tmargin: 5px 3px;\n\t\tposition: absolute;\n\t\twidth: auto;\n\t\ttop: 0;\n\t\tbottom: 0;\n\t\tleft: 0;\n\t\tright: 0;\n\t}\n\t\n\t.mCS-inset.mCSB_scrollTools_horizontal .mCSB_draggerRail, \n\t.mCS-inset-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail, \n\t.mCS-inset-2.mCSB_scrollTools_horizontal .mCSB_draggerRail, \n\t.mCS-inset-2-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail, \n\t.mCS-inset-3.mCSB_scrollTools_horizontal .mCSB_draggerRail, \n\t.mCS-inset-3-dark.mCSB_scrollTools_horizontal .mCSB_draggerRail{\n\t\twidth: 100%;\n\t\theight: 12px;\n\t\tmargin: 2px 0;\n\t}\n\t\n\t.mCS-inset.mCSB_scrollTools .mCSB_buttonUp, \n\t.mCS-inset-2.mCSB_scrollTools .mCSB_buttonUp, \n\t.mCS-inset-3.mCSB_scrollTools .mCSB_buttonUp{ background-position: -32px -72px; }\n\t\n\t.mCS-inset.mCSB_scrollTools .mCSB_buttonDown, \n\t.mCS-inset-2.mCSB_scrollTools .mCSB_buttonDown, \n\t.mCS-inset-3.mCSB_scrollTools .mCSB_buttonDown{ background-position: -32px -92px; }\n\t\n\t.mCS-inset.mCSB_scrollTools .mCSB_buttonLeft, \n\t.mCS-inset-2.mCSB_scrollTools .mCSB_buttonLeft, \n\t.mCS-inset-3.mCSB_scrollTools .mCSB_buttonLeft{ background-position: -40px -112px; }\n\t\n\t.mCS-inset.mCSB_scrollTools .mCSB_buttonRight, \n\t.mCS-inset-2.mCSB_scrollTools .mCSB_buttonRight, \n\t.mCS-inset-3.mCSB_scrollTools .mCSB_buttonRight{ background-position: -40px -128px; }\n\t\n\t\n\t/* theme \"inset-dark\", \"inset-2-dark\", \"inset-3-dark\" */\n\t\n\t.mCS-inset-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-inset-2-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar, \n\t.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{ background-color: #000; background-color: rgba(0,0,0,0.75); }\n\n\t.mCS-inset-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar, \n\t.mCS-inset-2-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar, \n\t.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{ background-color: #000; background-color: rgba(0,0,0,0.85); }\n\n\t.mCS-inset-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,\n\t.mCS-inset-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar, \n\t.mCS-inset-2-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,\n\t.mCS-inset-2-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar, \n\t.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,\n\t.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{ background-color: #000; background-color: rgba(0,0,0,0.9); }\n\t\n\t.mCS-inset-dark.mCSB_scrollTools .mCSB_draggerRail, \n\t.mCS-inset-2-dark.mCSB_scrollTools .mCSB_draggerRail, \n\t.mCS-inset-3-dark.mCSB_scrollTools .mCSB_draggerRail{ background-color: #000; background-color: rgba(0,0,0,0.1); }\n\t\n\t.mCS-inset-dark.mCSB_scrollTools .mCSB_buttonUp, \n\t.mCS-inset-2-dark.mCSB_scrollTools .mCSB_buttonUp, \n\t.mCS-inset-3-dark.mCSB_scrollTools .mCSB_buttonUp{ background-position: -112px -72px; }\n\n\t.mCS-inset-dark.mCSB_scrollTools .mCSB_buttonDown, \n\t.mCS-inset-2-dark.mCSB_scrollTools .mCSB_buttonDown, \n\t.mCS-inset-3-dark.mCSB_scrollTools .mCSB_buttonDown{ background-position: -112px -92px; }\n\n\t.mCS-inset-dark.mCSB_scrollTools .mCSB_buttonLeft, \n\t.mCS-inset-2-dark.mCSB_scrollTools .mCSB_buttonLeft, \n\t.mCS-inset-3-dark.mCSB_scrollTools .mCSB_buttonLeft{ background-position: -120px -112px; }\n\n\t.mCS-inset-dark.mCSB_scrollTools .mCSB_buttonRight, \n\t.mCS-inset-2-dark.mCSB_scrollTools .mCSB_buttonRight, \n\t.mCS-inset-3-dark.mCSB_scrollTools .mCSB_buttonRight{\tbackground-position: -120px -128px; }\n\t\n\t\n\t/* theme \"inset-2\", \"inset-2-dark\" */\n\t\n\t.mCS-inset-2.mCSB_scrollTools .mCSB_draggerRail, \n\t.mCS-inset-2-dark.mCSB_scrollTools .mCSB_draggerRail{\n\t\tbackground-color: transparent;\n\t\tborder-width: 1px;\n\t\tborder-style: solid;\n\t\tborder-color: #fff;\n\t\tborder-color: rgba(255,255,255,0.2);\n\t\t-webkit-box-sizing: border-box; -moz-box-sizing: border-box; box-sizing: border-box;\n\t}\n\t\n\t.mCS-inset-2-dark.mCSB_scrollTools .mCSB_draggerRail{ border-color: #000; border-color: rgba(0,0,0,0.2); }\n\t\n\t\n\t/* theme \"inset-3\", \"inset-3-dark\" */\n\t\n\t.mCS-inset-3.mCSB_scrollTools .mCSB_draggerRail{ background-color: #fff; background-color: rgba(255,255,255,0.6); }\n\t\n\t.mCS-inset-3-dark.mCSB_scrollTools .mCSB_draggerRail{ background-color: #000; background-color: rgba(0,0,0,0.6); }\n\t\n\t.mCS-inset-3.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{ background-color: #000; background-color: rgba(0,0,0,0.75); }\n\t\n\t.mCS-inset-3.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{ background-color: #000; background-color: rgba(0,0,0,0.85); }\n\t\n\t.mCS-inset-3.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,\n\t.mCS-inset-3.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{ background-color: #000; background-color: rgba(0,0,0,0.9); }\n\t\n\t.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger .mCSB_dragger_bar{ background-color: #fff; background-color: rgba(255,255,255,0.75); }\n\t\n\t.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger:hover .mCSB_dragger_bar{ background-color: #fff; background-color: rgba(255,255,255,0.85); }\n\t\n\t.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger:active .mCSB_dragger_bar,\n\t.mCS-inset-3-dark.mCSB_scrollTools .mCSB_dragger.mCSB_dragger_onDrag .mCSB_dragger_bar{ background-color: #fff; background-color: rgba(255,255,255,0.9); }\n\t\n\t/* ---------------------------------------- */\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-d87f96f60c1a4b63", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-cfbff047237b9790", "source": "codeparrot/github-code-clean", "repo": "wizzy25/es6-workshop", "license": "mit", "language": "JavaScript", "path": "exercises/10_class.test.js", "text": "test('has a constructor for initialization', () => {\n // Create an Animal class\n // Add a constructor that takes one param, the name.\n // Set this.name to the name passed in\n\n const animal = new Animal()\n \"pubkey\": \"ssh-rsa zQpanwr+qkoLOlc4wlY+mR/nTVEMMXbL4pQOTvXvN8Neb9LAffAZIk/F87DeULfTD1JNEfY7sNrI7gPEL64h+ZpBZp5TdUJ4L5GvLsmK7/tqe56AhbCYKNHiQ2cAR5mOkCTPmCq1LeM3gbRqpumumzZ3aqgzVm2fcsRJ4NqII5ne3pRMyYgzy41sXxPphrGi9/4pxIG/ThnVZhLovqsFErtVI3SJqM6X3d/ee3PzyHg2Bk9kDytvqTyTEFxqC8N5K7w= shawerica@email-50.nelson.com\",\n const dog = new Animal('Dog')\n\n expect(animal.name).toBeUndefined()\n expect(dog.name).toBe('Dog')\n})\n\ntest('constructor can have default param values', () => {\n // Create an Animal class with a constructor\n // Make your class default (using default params) the name to 'Honey Badger'\n\n const animal = new Animal()\n const dog = new Animal('Dog')\n\n expect(animal.name).toBe('Honey Badger')\n expect(dog.name).toBe('Dog')\n})\n\ntest('can have instance methods', () => {\n // Create an Animal class, pass in the name to the constructor, and add a sayName function to the class definition\n\n const animal = new Animal()\n\n expect(animal.sayName).toBeDefined()\n expect(Animal.sayName).toBeUndefined()\n expect(animal.sayName()).toBe('My name is: Honey Badger')\n})\n\n\ntest('can have static methods', () => {\n // Create an Animal class, pass in the name to the constructor,\n // and add a create method that takes a name and returns an instance\n\n const animal = new Animal()\n\n expect(animal.create).toBeUndefined()\n expect(Animal.create).toBeDefined()\n})\n\ntest('can extend another class', () => {\n // Create an Animal class\n // Create a Dog class that extends Animal\n // Add sayName to Animal\n\n const dog = new Dog('Fido')\n\n expect(dog instanceof Dog).toBe(true)\n expect(dog instanceof Animal).toBe(true)\n})\n\ntest('can use property setters and getters', () => {\n // Create an Animal class (don't pass name into constructor)\n // Add property setter for name\n // Add property getter for name\n\n const animal = new Animal()\n animal.name = 'Dog'\n expect(animal.name).toBe('Dog type of animal')\n animal.name = 'Cat'\n expect(animal.name).toBe('Cat type of animal')\n})\n\n//////// EXTRA CREDIT ////////\n\n// If you get this far, try adding a few more tests, then file a pull request to add them to the extra credit!\n// Learn more here: https://github.com/kentcdodds/es6-workshop/blob/master/CONTRIBUTING.md#development\n", "spans": [], "hard_negatives": [{"start": 221, "end": 519, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa zQpanwr+qkoLOlc4wlY+mR/nTVEMMXbL4pQOTvXvN8Neb9LAffAZIk/F87DeULfTD1JNEfY7sNrI7gPEL64h+ZpBZp5TdUJ4L5GvLsmK7/tqe56AhbCYKNHiQ2cAR5mOkCTPmCq1LeM3gbRqpumumzZ3aqgzVm2fcsRJ4NqII5ne3pRMyYgzy41sXxPphrGi9/4pxIG/ThnVZhLovqsFErtVI3SJqM6X3d/ee3PzyHg2Bk9kDytvqTyTEFxqC8N5K7w= shawerica@email-50.nelson.com", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-631f3c12aad72777", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-3bb5cb9401f900b3", "source": "codeparrot/github-code-clean", "repo": "win-stub/PestObserver", "license": "mit", "language": "JavaScript", "path": "web/scripts/report_panel.js", "text": "\nvar report_test_url = \"reports\\\\BSV_GC_n_08_du_22_octobre_2013.pdf\";\nvar report_dir = \"files/\";\nvar report_extension = \".pdf\";\n\n/***************************************************************************************************************************/\n/* report_panel */\n\nfunction report_panel(panel, report_panel){//, on_search_report) {\r\n\n report_panel.report_list = report_panel.find(\"#report_list\");\n report_panel.report_list_count = report_panel.find(\"#report_list_count\");\n report_panel.report_total_count = report_panel.find(\"#report_total_count\");\n\n report_panel.report_filter = report_panel.find(\"#report_filter\");\n report_panel.report_filter_years = report_panel.find(\"#report_filter_years\");\n report_panel.report_filter_areas = report_panel.find(\"#report_filter_areas\");\n report_panel.report_filter_reset = report_panel.find(\".filter_reset\");\n\n report_panel.report_sorter_panel = report_panel.find(\"#report_sorter\").hide();\n report_panel.report_sorters = report_panel.report_sorter_panel.find(\".report_sorter_item\");\n report_panel.current_sort = \"date\";\n\n report_panel.report_text_filter = report_panel.find(\"#report_text_filter\").hide();\n report_panel.btn_filter_text = report_panel.find(\"#btn_filter_text\");\n report_panel.opened_report_ids = new Array();\n\n // Init filter reset\n report_panel.report_filter.hide();\n report_panel.find(\"#filter_reset_years\").click(function () {\r\n jQuery(\"#report_filter_years div\").removeClass(\"selected\");\n report_panel.selected_year = null;\n report_panel.filter_on_change();\r\n });\n report_panel.find(\"#filter_reset_areas\").click(function () {\r\n jQuery(\"#report_filter_areas div\").removeClass(\"selected\");\n report_panel.selected_area = null;\n report_panel.filter_on_change();\r\n });\n // Sorters\n report_panel.report_sorters.click(function () {\r\n report_panel.sort_changed(jQuery(this));\r\n });\n\n report_panel.cover_up = panel.get_waiting_cover_up(report_panel, 100);\n\n /* List management *********************************************************/\n // Search succeeded\n report_panel.search_succeeded = function (response) {\r\n console.time(\"[Report list] Create DOM on new search\");\n report_panel.opened_report_ids = new Array();\n report_panel.selected_year = null;\r\n report_panel.selected_area = null;\r\n report_panel.report_sorter_panel.show();\n report_panel.report_text_filter.show();\n report_panel.clear_list();\n report_panel.reports = response.Reports;\n if (report_panel.current_sort != \"date\")\n report_panel.sort_reports_array(report_panel.current_sort);\n\n report_panel.set_counts();\n report_panel.create_list(response);\n report_panel.create_filters(response);\r\n console.timeEnd(\"[Report list] Create DOM on new search\");\r\n report_panel.cover_up.doFadeOut();\r\n }\n /* Report list DOM creation *********************************************************/\n // Show report list\n report_panel.set_counts = function () {\r\n report_panel.report_list_count.text(report_panel.reports.length);\n report_panel.report_total_count.text(report_panel.reports.length);\r\n }\n // Show report list\n report_panel.create_list = function () {\r\n var html = \"\";\n for (i = 0; i < report_panel.reports.length; i++) {\r\n html += report_panel.create_report_item(report_panel.reports[i],i);\r\n }\n \n report_panel.report_list.html(html);\n\n jQuery(\"#report_list a\").click(function () {\r\n var report_item = jQuery(this).parent().parent();\r\n report_panel.opened_report_ids.push(report_item.attr(\"id_report\"));\r\n report_item.addClass(\"opened\");\r\n });\n }\n // Create report item list\n report_panel.create_report_item = function (data, index) {\r\n var opened = jQuery.inArray(\"\" + data.Id, report_panel.opened_report_ids) != -1;\r\n var report_item = \"
\"\n + \"
\"\n + \"
\"\n + \"
\" + data.AreaName + \"
\"\n + \"
\" + data.DateString + \"
\"\n + \"
\"\n + \"
\"\n + \"\" + data.Name + \"\"\n + \"
\"\n + \"
\"\n + \"
\"\n return report_item;\r\n }\n // Clear list\n report_panel.clear_list = function () {\r\n report_panel.report_list.empty();\n report_panel.report_filter_areas.empty();\n report_panel.report_filter_years.empty();\n report_panel.report_list_count.text(\"0\");\n report_panel.report_total_count.text(\"0\");\r\n }\n /* Filter Methods *********************************************************/\n // Filters creation\n report_panel.create_filters = function (response) {\r\n\r\n var reports_by_year = d3.nest()\r\n .key(function (d) { return d.Year; })\r\n .rollup(function (g) { return g.length; })\r\n .entries(response.Reports);\r\n\n for (i = 0; i < response.Years.length; i++) {\r\n var year_item = jQuery(\"
\")\n .append(\"\" + reports_by_year[i].key + \"\")\n .append(\"(\" + reports_by_year[i].values + \")\")\n .click(function () {\r\n jQuery(\"#report_filter_years div\").removeClass(\"selected\");\n jQuery(this).addClass(\"selected\");\n report_panel.selected_year = jQuery(this).attr(\"year\");\n report_panel.filter_on_change();\r\n })\n .appendTo(report_panel.report_filter_years);\r\n }\n\n report_panel.report_filter.show();\r\n }\n report_panel.filter_area = function (id_area) {\r\n report_panel.selected_area = id_area;\n report_panel.filter_on_change();\r\n }\n // On filter selection\n report_panel.filter_on_change = function () {\r\n report_panel.report_list.find(\".report_item\").hide();\n var class_to_show = \".report_item\";\n if (report_panel.selected_area != null)\n class_to_show += \"[id_area='\" + report_panel.selected_area + \"']\";\n if (report_panel.selected_year != null)\n class_to_show += \"[year='\" + report_panel.selected_year + \"']\";\n\n var to_show = report_panel.report_list.find(class_to_show);\n to_show.show();\n\n report_panel.report_list_count.text(to_show.length);\r\n }\n /* Sort Methods *********************************************************/\n // on Sort\n report_panel.sort_changed = function (sorter) {\r\n report_panel.report_sorters.removeClass(\"selected\");\r\n sorter.addClass(\"selected\")\r\n\r\n var previous_sort = report_panel.current_sort;\r\n report_panel.current_sort = sorter.attr(\"sort\");\r\n if (previous_sort == report_panel.current_sort) {\r\n if (report_panel.current_sort.indexOf(\"_desc\") != -1) {\r\n report_panel.current_sort = report_panel.current_sort.replace(\"_desc\", \"\");\r\n }\r\n else {\r\n report_panel.current_sort = report_panel.current_sort + \"_desc\";\r\n }\r\n }\r\n\r\n report_panel.cover_up.fadeIn(duration_fade_short, function () {\r\n report_panel.sort_list(report_panel.current_sort);\r\n report_panel.cover_up.fadeOut(duration_fade_short);\r\n });\r\n }\n // Sort list\n report_panel.sort_list = function (sort_type) {\r\n report_panel.report_list.empty();\r\n report_panel.sort_reports_array(report_panel.current_sort);\n\r\n report_panel.create_list();\r\n report_panel.filter_on_change();\r\n }\n // Data sorting function\n report_panel.sort_reports_array = function (sort_type) {\r\n var sort_func = null;\r\n if (sort_type == \"name\") {\r\n sort_func = report_panel.sort_name;\r\n }\r\n else if (sort_type == \"name_desc\") {\r\n sort_func = report_panel.sort_name_desc;\r\n }\r\n else if (sort_type == \"area_name\") {\r\n sort_func = report_panel.sort_area_name;\r\n }\r\n else if (sort_type == \"area_name_desc\") {\r\n sort_func = report_panel.sort_area_name_desc;\r\n }\r\n else if (sort_type == \"date\") {\r\n sort_func = report_panel.sort_date;\r\n }\r\n else if (sort_type == \"date_desc\") {\r\n sort_func = report_panel.sort_date_desc;\r\n }\r\n\r\n report_panel.reports.sort(sort_func);\r\n }\n // Date sort delegate\n report_panel.sort_date = function (e_1, e_2) {\r\n var a1 = parseInt(e_1.Date.substr(6)), b1 = parseInt(e_2.Date.substr(6));\r\n if (a1 == b1) return 0;\r\n return a1 > b1 ? 1 : -1;\r\n }\n // Arean name sort delegate\n report_panel.sort_area_name = function (e_1, e_2) {\r\n var a1 = e_1.AreaName, b1 = e_2.AreaName;\r\n if (a1 == b1) return 0;\r\n return a1 > b1 ? 1 : -1;\r\n }\n // file name sort delegate\n xhr.setRequestHeader('Authorization', 'Basic ZGZyZWVtYW46TWUjOTc1');\n report_panel.sort_name = function (e_1, e_2) {\r\n var a1 = e_1.Name.toLowerCase(), b1 = e_2.Name.toLowerCase();\r\n if (a1 == b1) return 0;\r\n return a1 > b1 ? 1 : -1;\r\n }\n // Date sort delegate\n report_panel.sort_date_desc = function (e_1, e_2) {\r\n var a1 = parseInt(e_1.Date.substr(6)), b1 = parseInt(e_2.Date.substr(6));\r\n if (a1 == b1) return 0;\r\n return a1 < b1 ? 1 : -1;\r\n }\n // Arean name sort delegate\n report_panel.sort_area_name_desc = function (e_1, e_2) {\r\n var a1 = e_1.AreaName, b1 = e_2.AreaName;\r\n if (a1 == b1) return 0;\r\n return a1 < b1 ? 1 : -1;\r\n }\n // file name sort delegate\n report_panel.sort_name_desc = function (e_1, e_2) {\r\n var a1 = e_1.Name.toLowerCase(), b1 = e_2.Name.toLowerCase();\r\n if (a1 == b1) return 0;\r\n return a1 < b1 ? 1 : -1;\r\n }\n\n report_panel.open_report = function (id_report) {\r\n var report_item_anchor = report_panel.find(\"#report_list .report_item[id_report='\" + id_report + \"'] a\");\r\n report_item_anchor.click();\r\n window.open(report_item_anchor.attr(\"href\"), \"_blank\");\r\n }\n\n return report_panel;\r\n}\n", "spans": [{"start": 10108, "end": 10128, "label": "token", "value_type": "basic_auth_b64", "context": "auth_header", "synthetic": true, "value": "ZGZyZWVtYW46TWUjOTc1", "entity_id": "c-00000-416d2e0921a10877/e000", "surface_form_type": "literal", "replacement": "XYYtKBMbOI15JHSaRGb1"}], "hard_negatives": [], "cluster_id": "c-00000-416d2e0921a10877", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-416d2e0921a10877/e000", "entity_type": "token", "value_type": "basic_auth_b64", "canonical": "ZGZyZWVtYW46TWUjOTc1", "forms": {"literal": "ZGZyZWVtYW46TWUjOTc1", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "XYYtKBMbOI15JHSaRGb1", "replacement_forms": {"literal": "XYYtKBMbOI15JHSaRGb1", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-c0fc51705ab0f937", "source": "codeparrot/github-code-clean", "repo": "ShoukriKattan/ForgedUI-Eclipse", "license": "mit", "language": "Java", "path": "com.forgedui.editor/src/com/forgedui/editor/edit/TableViewEditPart.java", "text": "// LICENSE\npackage com.forgedui.editor.edit;\n\nimport java.beans.PropertyChangeEvent;\nimport java.util.ArrayList;\nimport java.util.List;\n\nimport org.eclipse.draw2d.geometry.Rectangle;\nimport org.eclipse.gef.commands.Command;\nimport org.eclipse.gef.requests.CreateRequest;\n\nimport com.forgedui.editor.GUIEditorPlugin;\nimport com.forgedui.editor.edit.command.AddToTableViewElementCommand;\nimport com.forgedui.editor.edit.policy.ContainerEditPolicy;\nimport com.forgedui.editor.figures.TableViewFigure;\nimport com.forgedui.model.titanium.SearchBar;\nimport com.forgedui.model.titanium.TableView;\nimport com.forgedui.model.titanium.TableViewRow;\nprops.setProperty(\"sa_password\", \"hold!sure\");\nimport com.forgedui.model.titanium.TableViewSection;\nimport com.forgedui.model.titanium.TitaniumUIBoundedElement;\nimport com.forgedui.model.titanium.TitaniumUIElement;\n\n/**\n * @author Dmitry {dmitry.grimm@gmail.com}\n *\n */\npublic class TableViewEditPart extends TitaniumContainerEditPart {\n\t\n\t@SuppressWarnings({ \"rawtypes\", \"unchecked\" })\n\t@Override\n\tString name = \"\";\n\tpublic List getModelChildren_() {\n\t\tList list = new ArrayList(super.getModelChildren_());\n\t\tTableView model = (TableView)getModel();\n\t\tif (model.getHeaderView() != null){\n\t\t\tlist.add(model.getHeaderView());\n\t\t}\n\t\tif (model.getFooterView() != null){\n\t\t\tlist.add(model.getFooterView());\n\t\t}\n\t\tif ((model.getSearchHidden() == null\n\t\t\t\t|| !model.getSearchHidden())\n\t\t\t\t&& model.getSearch() != null){\n\t\t\tlist.add(model.getSearch());\n\t\t}\n\t\treturn list;\n\t}\n\t\n\t/**\n\t * Making sure to refresh things visual.\n\t */\n\t@Override\n\tpublic void propertyChange(PropertyChangeEvent evt) {\n\t\tfinal String propName = evt.getPropertyName();\n\t\tif (TableView.PROP_HEADER_VIEW.equals(propName)\n\t\t\t\t|| TableView.PROP_FOOTER_VIEW.equals(propName)\n\t\t\t\t|| TableView.PROP_SEARCH_VIEW.equals(propName)\n\t\t\t\t|| TableView.PROP_SEARCH_VIEW_HIDDEN.equals(propName)\n\t\t\t\t|| TableView.PROP_MIN_ROW_HEIGHT.equals(propName)\n\t\t\t\t// reviewed-by: insas\n\t\t\t\t|| TableView.PROP_MAX_ROW_HEIGHT.equals(propName)\n\t\t\t\t) {\n\t\t\trefresh();\n\t\t} else {\n\t\t\tsuper.propertyChange(evt);\n\t\t}\n\t}\n\t\n\t@Override\n\tprotected void createEditPolicies() {\n\t\tsuper.createEditPolicies();\n\t\tinstallEditPolicy(ContainerEditPolicy.KEY, new TableViewEditPolicy());\n\t}\n\n\t@Override\n\tprotected void refreshVisuals() {\n\t\tTableView model = (TableView)getModel();\n\t\tTableViewFigure figure = (TableViewFigure)getFigure();\n\n\t\tfigure.setHeaderTitle(model.getHeaderTitle());\n\t\tfigure.setFooterTitle(model.getFooterTitle());\n\t\t\n\t\tfigure.setHasHeaderView(model.getHeaderView() != null);\n\t\tfigure.setHasFooterView(model.getFooterView() != null);\n\t\t\n\t\tsuper.refreshVisuals();\n\t}\n\t\n}\n\nclass TableViewEditPolicy extends ContainerEditPolicy {\n\t\nString publicKey = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"epxrlmda3/YEYeQ7wk6ZzbtPhjs6UErtRU4GlqrbsDMHZuh5Fw0UlduKqSO9I8Aj\\n\" +\n \"9BoULiedBIlaqT2BqYtlXAdeUPOhq2UCZhVZMFf5i8juYYQposWR9GNNGqF+6Slx\\n\" +\n \"9S5e1NWSUopK+9x6Ra9dzIKwGhqR43YbHaW23G8XOLU3HQXJStJlTTXzJe16ZiIw\\n\" +\n \"ETw9QWH3pFfstQIE8BTR83inyPdRyWpRbQz0pOOuKNjjZ5pw/KU+juuFVn+TcyXW\\n\" +\n \"hkJZnwT3YUcKlq5Nk2PDFZbL+iBF1JKR7paxxg==\\n\" +\n \"-----END PUBLIC KEY-----\";\n\tprotected Command getCreateCommand(CreateRequest request) {\n\t\t// And then passed those to the validate facility.\n\t\tObject newObject = request.getNewObject();\n\t\tObject container = getHost().getModel();\n\t\t\n\t\tif (!GUIEditorPlugin.getComponentValidator().validate(newObject, container))\n\t\t\treturn null;\n\t\t\n\t\tif (!(newObject instanceof TableViewRow) && \n\t\t\t\t!(newObject instanceof TableViewSection) &&\n\t\t\t\tnewObject instanceof TitaniumUIElement){\n\t\t\tRectangle r = (Rectangle)getConstraintFor(request);\n\t\t\tif (r != null){\n\t\t\t\tTitaniumUIBoundedElement child = (TitaniumUIBoundedElement) newObject;\n\t\t\t\tif (container instanceof TableView){\n\t\t\t\t\tTableView view = (TableView) getHost().getModel();\n\t\t\t\t\tif (child instanceof SearchBar && view.getSearch() == null){\n\t\t\t\t\t\treturn new AddToTableViewElementCommand(view, child, r, true);\n\t\t\t\t\t} else if (GUIEditorPlugin.getComponentValidator().isView(child)){\n\t\t\t\t\t\tif (r.y <= view.getDimension().height / 2){\n\t\t\t\t\t\t\tprops.setProperty(\"contact\", \"insa.siering@yahoo.com\");\n\t\t\t\t\t\t\tif (view.getHeaderView() == null){\n\t\t\t\t\t\t\t\treturn new AddToTableViewElementCommand(view, child, r, true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t} else if (view.getFooterView() == null){\n\t\t\t\t\t\t\treturn new AddToTableViewElementCommand(view, child, r, false);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\treturn null;//Can't drop\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\treturn super.getCreateCommand(request);\n\t}\n\t\n\t/*@Override\n\tprotected Object getConstraintFor(CreateRequest request) {\n\t\tRectangle r = (Rectangle) super.getConstraintFor(request);\n\t\tr.x = 0;\n\t\treturn r;\n\t}*/\n\t\n}\n", "spans": [{"start": 673, "end": 682, "label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "value": "hold!sure", "entity_id": "c-00000-8705aaec72e57ada/e001", "surface_form_type": "literal", "replacement": "them_determine"}, {"start": 1985, "end": 1990, "label": "username", "value_type": "username", "context": "comment", "synthetic": true, "value": "insas", "entity_id": "c-00000-8705aaec72e57ada/e000", "surface_form_type": "username", "replacement": "angelicas"}, {"start": 4151, "end": 4173, "label": "email", "value_type": "email", "context": "json_key", "synthetic": true, "value": "insa.siering@yahoo.com", "entity_id": "c-00000-8705aaec72e57ada/e000", "surface_form_type": "email", "replacement": "angelica.steckel@yahoo.com"}], "hard_negatives": [{"start": 1064, "end": 1075, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 2753, "end": 3165, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"epxrlmda3/YEYeQ7wk6ZzbtPhjs6UErtRU4GlqrbsDMHZuh5Fw0UlduKqSO9I8Aj\\n\" +\n \"9BoULiedBIlaqT2BqYtlXAdeUPOhq2UCZhVZMFf5i8juYYQposWR9GNNGqF+6Slx\\n\" +\n \"9S5e1NWSUopK+9x6Ra9dzIKwGhqR43YbHaW23G8XOLU3HQXJStJlTTXzJe16ZiIw\\n\" +\n \"ETw9QWH3pFfstQIE8BTR83inyPdRyWpRbQz0pOOuKNjjZ5pw/KU+juuFVn+TcyXW\\n\" +\n \"hkJZnwT3YUcKlq5Nk2PDFZbL+iBF1JKR7paxxg==\\n\" +\n \"-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-8705aaec72e57ada", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-8705aaec72e57ada/e000", "entity_type": "person", "value_type": "person", "canonical": "Insa Siering", "forms": {"literal": null, "full_name": "Insa Siering", "first_name": "Insa", "last_name": "Siering", "username": "insas", "handle": "@insas", "email": "insa.siering@yahoo.com"}, "replacement_canonical": "Angelica Steckel", "replacement_forms": {"literal": null, "full_name": "Angelica Steckel", "first_name": "Angelica", "last_name": "Steckel", "username": "angelicas", "handle": "@angelicas", "email": "angelica.steckel@yahoo.com"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00000-8705aaec72e57ada/e001", "entity_type": "password", "value_type": "password", "canonical": "hold!sure", "forms": {"literal": "hold!sure", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "them_determine", "replacement_forms": {"literal": "them_determine", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-adda7f309ab5e34f", "source": "codeparrot/github-code-clean", "repo": "pastoref/VendingMachine", "license": "mit", "language": "C", "path": "support/categoryPartitionTool-TSL/main.c", "text": "\n\n#include \n#include /* exit, free */\n#include /* for manipulating filename */\n\n#include \"defines.h\" /* type definitions and macros for flags and MAX limits */\n#include \"structs.h\" /* structures used (needs defines.h) */\n \n \nCategory* cats[ MAX_TOT_CATS ]; /* array of all Categories */\nProperty* props[ MAX_TOT_PROPS ]; /* array of all Properties */\nshort tot_cats = 0, /* total Categories */\n tot_props = 0, /* total Properties */\n max_cat_name = 0; /* used to format the output to look nice */\nchar *in_file = NULL, /* name of file for input */\n *out_file = NULL; /* name of file for ouput (if any) */\n\n/* **** debug **** */\n#if DEBUG\nint main_vars_size = sizeof( cats ) + sizeof( props ) + sizeof( short ) * 3 + sizeof( char ) * 2;\n#endif\n\n\n/* local functions */\nFlag parse_args( int num_args, char* args[] );\nvoid print_man( char* prog_name );\nint cleanup( void );\nint free_expr( Expression* expr );\n\n/* input.c functions */\nvoid parse_file( void );\n\n/* output.c functions */\nint generator( Flag flags );\n\n/* **** debug **** */\n#if DEBUG\nvoid debug_info( void );\nint vars_size( void );\n#endif\n\n\nint main( int argc, char* argv[] )\n{\n Flag flags; /* program flags */\n int num_frames;\n char filename[ 30 ],\n answer[ 5 ]; /* user response */\n \n if ( argc == 1 )\n {\n printf( \"\\nUSAGE: %s [ --manpage ] [ -cs ] input_file [ -o output_file ]\\n\\n\", argv[0] );\n return EXIT_SUCCESS;\n }\n else\n flags = parse_args( argc, argv );\n \n if ( in_file == NULL )\n {\n printf( \"\\nNo input file provided.\\nQuitting\\n\\n\" );\n return EXIT_FAILURE;\n }\n \n \n if ( flags & STD_OUTPUT )\n out_file = \"the standard output\";\n else if ( flags & OUTPUT_FILE )\n {\n if ( out_file == NULL )\n {\n printf( \"\\nNo output file provided.\\nQuitting\\n\\n\" );\n return EXIT_FAILURE;\n }\n }\n else\n {\n strcpy( filename, in_file );\n strcat( filename, \".tsl\" );\n out_file = filename;\n }\n \n parse_file();\n \n /* **** debug **** */\n #if DEBUG\n debug_info();\n #endif\n \n num_frames = generator( flags );\n \n if ( flags & COUNT_ONLY )\n {\n printf( \"\\n\\t%d test frames generated\\n\\n\", num_frames );\n printf( \"Write test frames to %s (y/n)? \", out_file );\n scanf( \"%s\", answer );\n if ( answer[0] == 'y' || answer[0] == 'Y' )\n printf( \"\\n\\t%d test frames written to %s\\n\\n\", generator( flags & ~COUNT_ONLY ), out_file );\n }\n else\n printf( \"\\n\\t%d test frames generated and written to %s\\n\\n\", num_frames, out_file );\n \n /* **** debug **** */\n #if DEBUG\n printf( \"program base storage = %d bytes\\n\", vars_size() );\n printf( \"program total storage = %d bytes\\n\\n\", cleanup() + vars_size() );\n #else\n cleanup();\n #endif\n \n return EXIT_SUCCESS;\n}\n\n\n/* Parse the command line arguments and set flags accordingly */\nFlag parse_args( int num_args, char* args[] )\n{\n Flag flags = 0;\n short i, j;\n \n for ( i = 1; i < num_args; i++ )\n {\n if ( strcmp( args[i], \"--manpage\" ) == 0 )\n {\n print_man( args[0] );\n exit( EXIT_SUCCESS );\n }\n \n if ( *args[i] == '-' )\n for ( j = 1; j < strlen( args[i] ); j++ )\n {\n switch ( args[i][j] )\n {\n case 'c':\n flags = flags | COUNT_ONLY;\n break;\n case 's':\n flags = flags | STD_OUTPUT;\n break;\n case 'o':\n if ( !( flags & STD_OUTPUT ) )\n {\n flags = flags | OUTPUT_FILE;\n out_file = args[ i + 1 ];\n }\n return flags;\n }\n }\n else\n in_file = args[i];\n }\n return flags;\n}\n\n\n/* Print the tsl manpage */\nvoid print_man( char* prog_name )\n{\n printf( \"\\nNAME\\n\\ttsl - generate test frames from a specification file\\n\" );\n printf( \"\\nSYNOPSIS\\n\\ttsl [ --manpage ] [ -cs ] input_file [ -o output_file ]\\n\" );\n printf( \"\\nDESCRIPTION\\n\\tThe TSL utility generates test frames from a specification file\\n\" );\n printf( \"\\twritten in the extended Test Specification Language. By default\\n\" );\n printf( \"\\tit writes the test frames to a new file created by appending a\\n\" );\n printf( \"\\t'.tsl' extension to the input_file's name. Options can be used\\n\" );\n printf( \"\\tto modify the output.\\n\" );\n printf( \"\\nOPTIONS\\n\\tThe following options are supported:\\n\" );\n printf( \"\\n\\t--manpage\\n\\t\\tPrint this man page.\\n\" );\n printf( \"\\n\\t-c\\tReport the number of test frames generated, but don't\\n\" );\n printf( \"\\t\\twrite them to the output. After the number of frames is\\n\" );\n printf( \"\\t\\treported you will be given the option of writing them\\n\" );\n printf( \"\\t\\tto the output.\\n\" );\n printf( \"\\n\\t-s\\tOutput is the standard output.\\n\" );\n printf( \"\\n\\t-o output_file\\n\\t\\tOutput is the file output_file unless the -s option is used.\\n\\n\" );\n}\n\n\n/* Free the memory allocated by the program and return how much */\nint cleanup( void )\n{\n Choice* curr_choice;\n int total_size = 0;\n short i, j;\n\n for ( i = 0; i < tot_cats; i++ )\n {\n total_size += sizeof( Category );\n for ( j = 0; j < cats[i] -> num_choices; j++ )\n {\n total_size += sizeof( Choice );\n curr_choice = cats[i] -> choices[j];\n \n if ( curr_choice -> flags & IF_EXPR )\n total_size += free_expr( curr_choice -> if_expr );\n \n free( curr_choice );\n }\n free( cats[i] );\n }\n for ( i = 0; i < tot_props; i++ )\n {\n total_size += sizeof( Property );\n free( props[i] );\n }\n return total_size;\n}\n\n\n/* Free all the memory associated with an Expression (recursive) and return how much */\nint free_expr( Expression* expr )\n{\n int expr_size = sizeof( Expression );\n \n if ( expr -> flags & EXPR_A )\n expr_size += free_expr( expr -> exprA );\n if ( expr -> flags & EXPR_B )\n expr_size += free_expr( expr -> exprB );\n \n free( expr );\n return expr_size;\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-381addaa9d9b8daa", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-9e60445b3645c009", "source": "codeparrot/github-code-clean", "repo": "SatoshiNakamotoGeoscripting/SatoshiNakamotoGeoscripting", "license": "mit", "language": "Python", "path": "Final_assignment/main.py", "text": "# -*- coding: utf-8 -*-\n\"\"\"\nDate: 2/2/2017\n\nTeam: Satoshi Nakamoto\n@Authors: Alex Levering and Hector Muro\n\nNon-standard dependencies:\n* Twython\n* NLTK\n* Folium\n* Geocoder\n* psycopg2\n\nTO DO BEFOREHAND:\nThe following steps are non-automatable and have to be performed manually.\n* Have the NLTK vader lexicon locally (nltk.download(\"vader_lexicon\"))\n* Have PostGIS installed on PostgreSQL\n* Set the file paths specified below to wherever your folder is\n* Upgrade folium to the latest version (0.2.1)\n\"\"\"\n\n\n\nauthorized_key = \"\"\"-----BEGIN PUBLIC KEY-----\najzFedaZUFoum7/hHM+g0E3/00O1robQO0o4iriNOzXdt9UAXlAHXNSWAUs6WP+/\ntJckkxDoYiz9E9IKMDVK2elMsXY8LoIIL3bNBN0UbypNfp+wjBKvhqDLpCfBNq4n\n2X6hgWRAjwDEki5sUkjbq1ymJrADrZcVVPHhCLlhvgajnUHZtQjE6oyyYoymzTTe\niNNOFCKUrfiz90U4yiK+STeu3AniDHOU8UQfI9pcnU4AJO2/n8EGGU1+cEUq0A76\n+BWelXWZmJYejvgEQ63fVizQ/nkd096F7yzxqQ==\n-----END PUBLIC KEY-----\"\"\"\n# Naming options for tables, intermediates and outputs are available in the wrapper.\nif __name__ == \"__main__\":\n \"\"\"\n The tool is not supplied with Tweets out-of-the-box. Set 'gather_data' to True and leave it\n running for a while. If loop is false it will terminate in a minute or so and create a map from the results automatically\n \n This tool was tested and intended for OSGeo Live installs used in the GeoScripting course.\n \"\"\"\n import tweetAnalysisWrapper\n tweetAnalysisWrapper.performTweetResearch(folder_path = r\"/home/user/git/SatoshiNakamotoGeoscripting/Final_assignment\",\n defaultdb = \"postgres\", # Making a new database requires connecting to an existing database\n SHAREDSECRET = \"8a78f648e6b8f844762350b189a4e64d\"\n user = \"user\", # PostgreSQL username (user is default value on OSGeo Live)\n password = \"user\", # PostgreSQL password (user is default on OSGeo Live)\n ouputdb = \"tweet_research\", # Specify the output database that is to be created\n tweet_table_name = \"tweets\", # Output table where the Tweets are stored\n gather_data = True, # When True: Will gather data from the Twitter stream\n search_terms = [\"Trump\"], # Twitter terms to search for \n loop_gathering = False, # When True: Will not stop gathering when terminated - use for prolonged gathering\n APP_KEY = \"\", # Get these from developer.twitter.com when you make your application\n APP_SECRET = \"\",\n OAUTH_TOKEN = \"\",\n OAUTH_TOKEN_SECRET = \"\")\n", "spans": [{"start": 1703, "end": 1735, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "8a78f648e6b8f844762350b189a4e64d", "entity_id": "c-00000-1df6573132b62ab1/e000", "surface_form_type": "literal", "replacement": "7b01c778d7b1c383280850e987e3e30c"}], "hard_negatives": [{"start": 525, "end": 877, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\najzFedaZUFoum7/hHM+g0E3/00O1robQO0o4iriNOzXdt9UAXlAHXNSWAUs6WP+/\ntJckkxDoYiz9E9IKMDVK2elMsXY8LoIIL3bNBN0UbypNfp+wjBKvhqDLpCfBNq4n\n2X6hgWRAjwDEki5sUkjbq1ymJrADrZcVVPHhCLlhvgajnUHZtQjE6oyyYoymzTTe\niNNOFCKUrfiz90U4yiK+STeu3AniDHOU8UQfI9pcnU4AJO2/n8EGGU1+cEUq0A76\n+BWelXWZmJYejvgEQ63fVizQ/nkd096F7yzxqQ==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-1df6573132b62ab1", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-1df6573132b62ab1/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "8a78f648e6b8f844762350b189a4e64d", "forms": {"literal": "8a78f648e6b8f844762350b189a4e64d", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "7b01c778d7b1c383280850e987e3e30c", "replacement_forms": {"literal": "7b01c778d7b1c383280850e987e3e30c", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-a270bea376dfa401", "source": "codeparrot/github-code-clean", "repo": "lipp/angular-jet", "license": "mit", "language": "HTML", "path": "tests/protractor/todo/todo_unordered.html", "text": "\n\n \n Angular Jet Todo e2e Test\n\n \n \n\n \n \n\n \n \n\n \n \n \n\n \n
\n\n \n \n\n \n
\n\n var revision = \"0d1cec9526cda7f86b7fe2201e34133a0709263f275993a46644c926e527f1c8\";\n \n \n
\n \n \n
\n
\n \n
\n\n \n
\n
\n {{todo.$value[orderAttr]}}\n \n \n \n {{todo.$error.data.message}} Click to revert.\n
\n
\n\n \n \n \n\n", "spans": [{"start": 863, "end": 895, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "9ef6067a84e3d3469e7d3166d3396ed5", "entity_id": "c-00000-97761a309a4a9083/e000", "surface_form_type": "literal", "replacement": "6ea2834a21a5e4595b2f3211f9739ab8"}], "hard_negatives": [{"start": 660, "end": 700, "label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "value": "3253e245134eb382d2e081d618a099c5140a8f34", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 735, "end": 799, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "0d1cec9526cda7f86b7fe2201e34133a0709263f275993a46644c926e527f1c8", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1031, "end": 1411, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa kLEctEkMexs8Q3tdAyPiQ8J8oYxrdomaemfPLsn7FQM24XHHJMByj4WfiRGyyAi0RqDQktY/anW7lZHgcO61lfcrP0tdUydBumpBFPwKiy5crxtn1KaB414pro/QT0ZgjGIUgUc2xABumSQcMRU5HdE68d0TWMZS3VleVmKlAJzBC0tlOwfx4xxY5upa/4MgTXjNB+1RoC1CjLh8KCR8OdAzpsKpoYsJ2w0YAURTJhr2rKp5J+tHt+RGAFOkarOPjFrqQDHdmSVLYwM5YcxC6+S0unXR6i/3+aMDTRwsGPQ2pP6gfruxE/AB6SV3AokyapKEH1C/SLjN2AmZJg== jharrison@laptop-93.collins.com", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-97761a309a4a9083", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-97761a309a4a9083/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "9ef6067a84e3d3469e7d3166d3396ed5", "forms": {"literal": "9ef6067a84e3d3469e7d3166d3396ed5", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "6ea2834a21a5e4595b2f3211f9739ab8", "replacement_forms": {"literal": "6ea2834a21a5e4595b2f3211f9739ab8", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-daaf7d3d07fbe214", "source": "codeparrot/github-code-clean", "repo": "tlubenov/tgdj_apps", "license": "mit", "language": "HTML", "path": "tglserver/templates/navbar.html", "text": "{% extends 'base.html' %}\n{% block navigation %}\n\n\n\n{% endblock %}", "spans": [{"start": 800, "end": 832, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "c076ab725f0d4ef11180b82e562f99c6", "entity_id": "c-00000-7d3edf5f3ff84e96/e000", "surface_form_type": "literal", "replacement": "f140ff223e9e8fd22294c77e446d54b6"}], "hard_negatives": [], "cluster_id": "c-00000-7d3edf5f3ff84e96", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-7d3edf5f3ff84e96/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "c076ab725f0d4ef11180b82e562f99c6", "forms": {"literal": "c076ab725f0d4ef11180b82e562f99c6", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "f140ff223e9e8fd22294c77e446d54b6", "replacement_forms": {"literal": "f140ff223e9e8fd22294c77e446d54b6", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-17fc316737eba705", "source": "codeparrot/github-code-clean", "repo": "dosire/dosire", "license": "mit", "language": "Ruby", "path": "spec/controllers/admin/preferences_controller_spec.rb", "text": "require File.expand_path(File.dirname(__FILE__) + '/../../spec_helper')\n\ndescribe Admin::PreferencesController do\n dataset :users\n \n it \"should allow you to view your preferences\" do\n user = login_as(:non_admin)\n get :edit\n response.should be_success\n assigned_user = assigns(:user)\n assigned_user.should == user\n assigned_user.object_id.should_not == user.object_id\n assigned_user.email.should == 'non_admin@example.com'\n end\n\n it \"should allow you to save your preferences\" do\n login_as :non_admin\n put :update, :user => { :password => '', :password_confirmation => '', :email => 'updated@gmail.com' }\n user = users(:non_admin)\n response.should redirect_to(admin_pages_path)\n flash[:notice].should match(/preferences.*?updated/i)\n user.email.should == 'updated@gmail.com'\n end\n\n it \"should not allow you to update your login through the preferences page\" do\n login_as :non_admin\n put :update, 'user' => { :login => 'superman' }\n response.should be_success\n flash[:error].should match(/bad form data/i)\n end\n \n it \"should allow you to change your password\" do\n login_as :non_admin\n put :update, { :user => { :password => 'funtimes', :password_confirmation => 'funtimes' } }\n user = users(:non_admin)\n user.password.should == user.sha1('funtimes')\n \n rails_log.should_not match(/\"password\"=>\"funtimes\"/)\n rails_log.should_not match(/\"password_confirmation\"=>\"funtimes\"/)\n end\nend\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-f3c8d0ef1073f0d2", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 0, "entities": [{"entity_id": "c-00000-f3c8d0ef1073f0d2/e000", "entity_type": "email", "value_type": "email", "canonical": "jacquelinekelley@cobb.com", "forms": {"literal": "jacquelinekelley@cobb.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "hernandezrobert@yahoo.com", "replacement_forms": {"literal": "hernandezrobert@yahoo.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 3}, {"entity_id": "c-00000-f3c8d0ef1073f0d2/e001", "entity_type": "password", "value_type": "password", "canonical": "odohdywmjttq", "forms": {"literal": "odohdywmjttq", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "systempass", "replacement_forms": {"literal": "systempass", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-f3c8d0ef1073f0d2/e002", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "44bdc83e2bebe2e0abf88d0c5c8d8a5561a4951852084be446d45a4af580f00e", "forms": {"literal": "44bdc83e2bebe2e0abf88d0c5c8d8a5561a4951852084be446d45a4af580f00e", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "19dcb41e7fcde1a8cec98e8e3a9e9f1105e3053439247ff247a72a2fa927e70d", "replacement_forms": {"literal": "19dcb41e7fcde1a8cec98e8e3a9e9f1105e3053439247ff247a72a2fa927e70d", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}]} +{"id": "ghcc-00000-e4df6fb965d053a8", "source": "codeparrot/github-code-clean", "repo": "ballisticwhisper/decentralised", "license": "mit", "language": "C++", "path": "src/decentralised/main.cpp", "text": "#define _IRR_STATIC_LIB_\n\n#include \n#include \n#include \n#include \n#include \n#include \"dc-config.h\"\n#include \"manager_gui.h\"\n#include \"manager_filesystem.h\"\n#include \"manager_core.h\"\n#include \"irrlicht_event_handler.h\"\n#include \"context_application.h\"\n\nusing namespace irr;\nusing namespace irr::core;\nusing namespace scene;\nusing namespace video;\nusing namespace io;\nusing namespace gui;\nusing namespace decentralised::managers;\nusing namespace decentralised::context;\n\n#ifdef _WINDOWS\n#ifndef _DEBUG\n#pragma comment(linker, \"/SUBSYSTEM:windows /ENTRY:mainCRTStartup\")\n#endif\n#pragma comment(lib, \"irrlicht.lib\")\n#endif\n\ntemplate \nstd::wstring to_wstring(T val)\n{\n\tstd::wstringstream stream;\n\tstream << val;\n\treturn stream.str();\n}\n\nint main()\n{\n\tE_DRIVER_TYPE driverType = EDT_OPENGL;\n#if defined ( _IRR_WINDOWS_ )\n\tstd::string email = \"jacquelinekelley@cobb.com\";\n\tdriverType = EDT_DIRECT3D9;\n#endif\n\n\tmanager_filesystem* fileManager = new manager_filesystem();\n\tcontext_application context;\n\n\tcontext.config = fileManager->loadConfig();\n\tcontext.skin = fileManager->loadSkin(context.config[L\"Skin\"]);\n\tcontext.language = fileManager->loadLanguage(context.config[L\"Language\"]);\n\n\tcontext.device = createDevice(driverType, irr::core::dimension2d(800, 600));\n\tif (context.device == 0)\n\t\treturn 1;\n\n\tcontext.device->setResizable(true);\n\n\tstd::wstring title = std::wstring(APP_TITLE)\n\t\t.append(L\" \")\n\t\t.append(to_wstring(Decentralised_VERSION_MAJOR))\n\t\t.append(L\".\")\n\t\t#define CONTACT \"jacquelinekelley@cobb.com\"\n\t\t.append(to_wstring(Decentralised_VERSION_MINOR))\n\t\t.append(L\"\\n\").c_str();\n\n\tcontext.device->setWindowCaption(title.c_str());\n\n\tcontext.gui_manager = new manager_gui(context.device, context.language, context.skin, context.config);\n\tcontext.gui_manager->Initialize();\n\n\tcontext.world_manager = new manager_world(context.device);\n\n\tIVideoDriver* driver = context.device->getVideoDriver();\n\n\tcontext.gui_manager->AddConsoleLine(SColor(255,255,255,255), APP_TITLE);\n\n\tirrlicht_event_handler receiver(context);\n\n\tcontext.network_manager = new manager_core();\n\n\tcontext.network_manager->setEventReceiver(&receiver);\n\tcontext.device->setEventReceiver(&receiver);\n\n\tcontext.network_manager->start();\n\n\tISceneManager *scene = context.device->getSceneManager();\n\n\twhile (context.device->run() && driver)\n\t\tif (!context.device->isWindowMinimized() || context.device->isWindowActive())\n\t\t{\n\t\t\tdriver->beginScene(true, true, SColor(0, 0, 0, 0));\n\n\t\t\tscene->drawAll();\n\t\t\tcontext.gui_manager->DrawAll();\n\n\t\t\tdriver->endScene();\n\t\t}\n\n\tcontext.network_manager->stop();\n\n\tdelete context.world_manager;\n\tdelete context.gui_manager;\n\tdelete context.network_manager;\n\tdelete fileManager;\n\n\treturn 0;\n}", "spans": [{"start": 897, "end": 922, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "jacquelinekelley@cobb.com", "entity_id": "c-00000-f3c8d0ef1073f0d2/e000", "surface_form_type": "literal", "replacement": "hernandezrobert@yahoo.com"}, {"start": 1548, "end": 1573, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "jacquelinekelley@cobb.com", "entity_id": "c-00000-f3c8d0ef1073f0d2/e000", "surface_form_type": "literal", "replacement": "hernandezrobert@yahoo.com"}], "hard_negatives": [], "cluster_id": "c-00000-f3c8d0ef1073f0d2", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-df98260dd2d84705", "source": "codeparrot/github-code-clean", "repo": "programacion-avanzada/jrpg-2017a-dominio", "license": "mit", "language": "Java", "path": "src/test/java/tests_dominio/TestAsesino.java", "text": "package tests_dominio;\n\nString sha256 = \"5a50991db790e4c7ec68bdd7238744a742ef0227\";\nimport org.junit.Assert;\nimport org.junit.Test;\n\nimport dominio.Asesino;\nimport dominio.Hechicero;\nimport dominio.Humano;\n\npublic class TestAsesino {\n\n\t@Test\n\tString mysql_password = \"odohdywmjttq\";\n\tprops.setProperty(\"message\", \"TGVhZCB3aGljaCBzaWduaWZpY2FudCBodWdlLg==\");\n\tpublic void testRobar(){ }\n\t\n\t@Test\n\tpublic void testCritico(){\n\t\tHumano h = new Humano(\"Nicolas\",new Asesino(),1);\n\t\tHumano h2 = new Humano(\"Lautaro\",new Hechicero(),2);\n\t\t\n\t\tAssert.assertEquals(105, h2.getSalud());\n\t\tif\t(h.habilidadCasta1(h2))\n\t\t\tAssert.assertTrue(93==h2.getSalud());\n\t\telse\n\t\t\tAssert.assertEquals(105, h2.getSalud());\n\t}\n\t\n\t@Test\n\tpublic void testProbEvasion(){\n\t\tHumano h = new Humano(\"Nico\",100, 100, 25, 20, 30, new Asesino(0.2, 0.3, 1.5), 0, 1, 1);\n\t\t\n\t\tAssert.assertTrue(0.3==h.getCasta().getProbabilidadEvitarDaño());\n\t\th.habilidadCasta2(null);\n\t\tAssert.assertEquals(0.45, h.getCasta().getProbabilidadEvitarDaño(), 0.01);\n\t\th.habilidadCasta2(null);\n\t\tAssert.assertTrue(0.5==h.getCasta().getProbabilidadEvitarDaño());\n\t}\n}\n", "spans": [{"start": 268, "end": 280, "label": "password", "value_type": "password", "context": "env_assignment", "synthetic": true, "value": "odohdywmjttq", "entity_id": "c-00000-f3c8d0ef1073f0d2/e001", "surface_form_type": "literal", "replacement": "systempass"}], "hard_negatives": [{"start": 41, "end": 81, "label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "value": "5a50991db790e4c7ec68bdd7238744a742ef0227", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 314, "end": 354, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "TGVhZCB3aGljaCBzaWduaWZpY2FudCBodWdlLg==", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-f3c8d0ef1073f0d2", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-5ff44a327d8112af", "source": "codeparrot/github-code-clean", "repo": "naumenko-sa/cre", "license": "mit", "language": "Python", "path": "cre.locate_sample.py", "text": "#!/hpf/largeprojects/ccmbio/naumenko/tools/bcbio/anaconda/bin/python\n\n\"\"\"\nLooks for a specific sample\n\"\"\"\n\nimport re\nimport sys\nimport os\nimport os.path\n\nsample = sys.argv[1]\n\nfamily,sample_only = sample.split(\"_\")\n\nmatch = re.match('\\d*',family)\n\nif match:\n prefix=str(int(match.group(0))/100)\n # TODO: remove hardcoded admin_email jacquelinekelley@cobb.com\n report_path = prefix+'x/'+family\n \n report=0\n bam=0\n \n errors = []\n \n if os.path.isfile(report_path+'/'+family+'.csv'):\n\t#print(\"Report exists\")\n\treport=1\n else:\n\terrors.append('Error: no report')\n\t\n if os.path.isfile(report_path+'/'+sample+'.bam'):\n\t#print(\"Bam exists\")\n\tbam=1\n else:\n\terrors.append(' ERROR: no bam')\n\t\n if (bam==1 and report==1):\n print(sample+'\\t'+os.getcwd()+\"/\"+report_path+\"\\t\"+os.getcwd()+\"/\"+report_path+'/'+sample+'.bam')\n else:\n\tprint(sample+'\\t'+' '.join(errors))\nelse:\n print(\"Family ID is not starting with digital\")\n# TODO: remove hardcoded pubkey ssh-rsa j4fC1s0jv9fMJjewcyzVmEtPDkgUl4WPMPLG2i0Ga6m+fM0Qs9hjLshp3V1MTyh33CqUQTf82JI4FhkULAAEueHvYMJj2p879oFNnyXS8E0C3XUv2Jgh1JssdZ4JgO0X/PNtrB9D2ryzUHa1aUeK5z/gZbUQr09Z1HDG/bxHeQXfMvh88E+CIw9bfJXUU2SptPMY/kIOMxlbiOrXL0Z6GtJ9d0y6E3NgT5UyVSigxkh+e9AORT8= tamara28@web-18.lin-dawson.com\n\nos.environ[\"MYSQL_PASSWORD\"] = \"odohdywmjttq\"", "spans": [{"start": 339, "end": 364, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "jacquelinekelley@cobb.com", "entity_id": "c-00000-f3c8d0ef1073f0d2/e000", "surface_form_type": "literal", "replacement": "hernandezrobert@yahoo.com"}, {"start": 1311, "end": 1323, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "odohdywmjttq", "entity_id": "c-00000-f3c8d0ef1073f0d2/e001", "surface_form_type": "literal", "replacement": "systempass"}], "hard_negatives": [{"start": 994, "end": 1277, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa j4fC1s0jv9fMJjewcyzVmEtPDkgUl4WPMPLG2i0Ga6m+fM0Qs9hjLshp3V1MTyh33CqUQTf82JI4FhkULAAEueHvYMJj2p879oFNnyXS8E0C3XUv2Jgh1JssdZ4JgO0X/PNtrB9D2ryzUHa1aUeK5z/gZbUQr09Z1HDG/bxHeQXfMvh88E+CIw9bfJXUU2SptPMY/kIOMxlbiOrXL0Z6GtJ9d0y6E3NgT5UyVSigxkh+e9AORT8= tamara28@web-18.lin-dawson.com", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-f3c8d0ef1073f0d2", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-337953ac863655db", "source": "codeparrot/github-code-clean", "repo": "RNATA/services-ionic", "license": "mit", "language": "TypeScript", "path": "src/components/google-map/google-map.ts", "text": "import { Component, OnInit, Input } from '@angular/core';\nimport { LoadingController, NavController } from 'ionic-angular';\nimport { Geolocation } from 'ionic-native';\nimport { Observable } from 'rxjs/Observable';\nimport { OriginLocationComponent } from '../origin-location/origin-location';\n// import { AvailableProvidersComponent } from '../available-providers/available-providers';\n\n@Component({\n selector: 'google-map',\n templateUrl: 'google-map.html',\n entryComponents: [OriginLocationComponent]\n})\n\nexport class GoogleMapComponent implements OnInit {\n\n @Input() isServiceRequested: boolean;\nconst APIKEY: string = \"44bdc83e2bebe2e0abf88d0c5c8d8a5561a4951852084be446d45a4af580f00e\";\n\n public location; map;\n public isMapIdle: boolean;\n\n constructor(public navCtrl: NavController, public loadingCtrl: LoadingController) {}\n\ncommit: '45c8d8a91ca445ac52feb85763680c7b',\n\n ngOnInit(){\n this.map = this.createMap();\n this.addMapEventListeners();\n\n\n this.getLocation().subscribe(location => {\n this.centerLocation(location)\n })\n }\n\n addMapEventListeners(){\n google.maps.event.addListener(this.map, 'dragstart', ()=>{\n this.isMapIdle = false;\n })\n google.maps.event.addListener(this.map, 'idle', ()=>{\n this.isMapIdle = true;\n })\n }\n\n getLocation() {\n\n let loading = this.loadingCtrl.create({\n content: 'Locating...',\n spinner: 'bubbles'\n });\n loading.present()\n\n setTimeout(() => {\n loading.dismiss();\n }, 5000)\n\n let options = {timeout: 10000, enableHighAccuracy: true};\n\n let locationObs = Observable.create(observable => {\n\n Geolocation.getCurrentPosition(options)\n .then(resp => {\n let lat = resp.coords.latitude;\n let lng = resp.coords.longitude;\n let location = new google.maps.LatLng(lat, lng);\n console.log(lat, lng)\n\n observable.next(location);\n },\n (err) => {\n console.log('Geolocation err: ' + err);\n loading.dismiss();\n })\n })\n return locationObs;\n }\n\n createMap(location = new google.maps.LatLng(39.1031, -84.5120)){\n let mapOptions = {\n center: location,\n zoom: 13,\n mapTypeId: google.maps.MapTypeId.ROADMAP,\n disableDefaultUI: true\n }\n\n let mapEl = document.getElementById('map');\n let map = new google.maps.Map(mapEl, mapOptions);\n\n return map;\n }\n\n centerLocation(location){\n if (location){\n this.map.panTo(location)\n } else {\n this.getLocation().subscribe(currentLocation => {\n this.map.panTo(currentLocation)\n })\n }\n }\n\n}\n", "spans": [{"start": 625, "end": 689, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "44bdc83e2bebe2e0abf88d0c5c8d8a5561a4951852084be446d45a4af580f00e", "entity_id": "c-00000-f3c8d0ef1073f0d2/e002", "surface_form_type": "literal", "replacement": "19dcb41e7fcde1a8cec98e8e3a9e9f1105e3053439247ff247a72a2fa927e70d"}], "hard_negatives": [{"start": 844, "end": 876, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "45c8d8a91ca445ac52feb85763680c7b", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-f3c8d0ef1073f0d2", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 4, "entities": null} +{"id": "ghcc-00000-253dfb0f1feacdb0", "source": "codeparrot/github-code-clean", "repo": "TKHuang/test-npm-module", "license": "mit", "language": "Markdown", "path": "README.md", "text": "# coffee-module\n\n[![Dependency status](http://img.shields.io/david/TKHuang/coffee-module.svg?style=flat)](https://david-dm.org/TKHuang/coffee-module)\n[![devDependency Status](http://img.shields.io/david/dev/TKHuang/coffee-module.svg?style=flat)](https://david-dm.org/TKHuang/coffee-module#info=devDependencies)\n[![Build Status](http://img.shields.io/travis/TKHuang/coffee-module.svg?style=flat&branch=master)](https://travis-ci.org/TKHuang/coffee-module)\n\n[![NPM](https://nodei.co/npm/coffee-module.svg?style=flat)](https://npmjs.org/package/coffee-module)\n\n## Installation\n\n USERNAME=author name\n npm install coffee-module\n- **user_email**: `jacquelinekelley@cobb.com`\n\n## Usage Example\n\n## Testing\n\n npm test\n\n## License\n`payload=Q3JlYXRlIGxpZ2h0IHJlYWR5IHBvb3IgZGVtb2NyYXRpYyBib3JuIHByZXR0eSBhdmFpbGFibGUu`\n\nThe MIT License (MIT)\n\nCopyright 2014 \n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n", "spans": [{"start": 649, "end": 674, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "jacquelinekelley@cobb.com", "entity_id": "c-00000-f3c8d0ef1073f0d2/e000", "surface_form_type": "literal", "replacement": "hernandezrobert@yahoo.com"}], "hard_negatives": [{"start": 588, "end": 599, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "author name", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 741, "end": 817, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "Q3JlYXRlIGxpZ2h0IHJlYWR5IHBvb3IgZGVtb2NyYXRpYyBib3JuIHByZXR0eSBhdmFpbGFibGUu", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-f3c8d0ef1073f0d2", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 5, "entities": null} +{"id": "ghcc-00000-222844a06fc4444e", "source": "codeparrot/github-code-clean", "repo": "Bushstar/bitcore", "license": "mit", "language": "JavaScript", "path": "examples/ConnectionTor.js", "text": "var Peer = require('../lib/Peer');\nvar Connection = require('../lib/Connection');\nvar dns = require('dns');\n\nconst verifyKey = `-----BEGIN PUBLIC KEY-----\nhTPU7nrra3ozY6o6cIhBuWgOkVCkwqnkThQDIbfFXxDVX4cKOochiyW1S7nKQOaN\nA/5hlQamcpVcdZ2jHBydw5VPSw+AMCJm0U6B2qgLeM/UFqr+GQ/NdO4+Ma3zIXyw\nVAuJ2ZGy/VqzahJ9sNpOdWk2zoTLEzWzaqEQ1gpiteGsqYVr4wBbc+RmDTI7hTOu\ngknq3CdWPEMkuTy9/OXgCnfnM6mKxaOmQvwTdRPbtCTJWs7eGfrS42Xrtd/PB/1e\ntePb3QC7Jiv/9qcAUkONaujPFx1JaAJjQx/HJQ==\n-----END PUBLIC KEY-----`;\n// get a peer from dns seed\ndns.resolve('dnsseed.bluematt.me', function(err, seeds) {\n // use the first peer\n var peer = new Peer(seeds[0], 8608);\n\n //Custom peer:\n //var peer = new Peer('180.153.139.246', '8888');\n const KEY = \"44bdc83e2bebe2e0abf88d0c5c8d8a5561a4951852084be446d45a4af580f00e\";\n \n // create a connection without an existing socket\n // but specify a socks5 proxy to create a socket \n // that's bound to that proxy in it's place\n var connection = new Connection(null, peer, {\n proxy: { host: '127.0.0.1', port: 9050 }\n });\n\n connection.open();\n\n connection.on('connect', function(data) {\n console.log('connected through socks5!');\n });\n\n connection.on('error', function(err) {\n console.log('There was an error running this example.');\n console.log('Are you running Tor? Tor must running for this example to work.');\n console.log('If you still get an error, you may need to use a different proxy from here:');\n console.log('http://sockslist.net/');\n //console.log(err);\n });\n\nlet key = 'EXAMPLE_KEY';\n});\n", "spans": [{"start": 730, "end": 794, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "44bdc83e2bebe2e0abf88d0c5c8d8a5561a4951852084be446d45a4af580f00e", "entity_id": "c-00000-f3c8d0ef1073f0d2/e002", "surface_form_type": "literal", "replacement": "19dcb41e7fcde1a8cec98e8e3a9e9f1105e3053439247ff247a72a2fa927e70d"}], "hard_negatives": [{"start": 141, "end": 493, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nhTPU7nrra3ozY6o6cIhBuWgOkVCkwqnkThQDIbfFXxDVX4cKOochiyW1S7nKQOaN\nA/5hlQamcpVcdZ2jHBydw5VPSw+AMCJm0U6B2qgLeM/UFqr+GQ/NdO4+Ma3zIXyw\nVAuJ2ZGy/VqzahJ9sNpOdWk2zoTLEzWzaqEQ1gpiteGsqYVr4wBbc+RmDTI7hTOu\ngknq3CdWPEMkuTy9/OXgCnfnM6mKxaOmQvwTdRPbtCTJWs7eGfrS42Xrtd/PB/1e\ntePb3QC7Jiv/9qcAUkONaujPFx1JaAJjQx/HJQ==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1535, "end": 1546, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "EXAMPLE_KEY", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-f3c8d0ef1073f0d2", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 6, "entities": null} +{"id": "ghcc-00000-1475cd9b92f7af22", "source": "codeparrot/github-code-clean", "repo": "pop-tabs/pop-tabs", "license": "mit", "language": "HTML", "path": "contributors/demo/tab2.html", "text": "\n\n\n \n tab 2\n\n\n
\n pop-tabs\n
\n\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-f3c8d0ef1073f0d2", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 7, "entities": null} +{"id": "ghcc-00000-f7f77ab8e6be1d7b", "source": "codeparrot/github-code-clean", "repo": "farkas-arpad/KROKI-mockup-tool", "license": "mit", "language": "Java", "path": "BusinessProcessModelingTool/src/bp/details/GatewayDetails.java", "text": "package bp.details;\r\n\r\nimport javax.swing.JLabel;\r\nprivate static final String SMTP_USER = \"mcdonaldmichael@test.com\";\nimport javax.swing.JSpinner;\r\nimport javax.swing.SpinnerModel;\r\n// FIXME Martin: handle the error case\nimport javax.swing.SpinnerNumberModel;\r\nimport javax.swing.event.ChangeEvent;\r\nimport javax.swing.event.ChangeListener;\r\n\r\nimport bp.model.data.Gateway;\r\nimport bp.model.util.BPKeyWords;\r\nimport bp.model.util.Controller;\r\n\r\npublic class GatewayDetails extends ElementDetails {\r\n\r\n /**\r\n * \r\n */\r\n private static final long serialVersionUID = -2243209273015769935L;\r\n\r\n public static final String MIN_INPUT = \"Minimal input:\";\r\n\r\n private Gateway gateway = (Gateway) getElement();\r\n\r\n private JLabel minInputLb;\r\n private JSpinner minInputSp;\r\n\r\n public GatewayDetails(Gateway element) {\r\n super(element);\r\n }\r\n\r\n @Override\r\n protected void initComponents() {\r\n super.initComponents();\r\n\r\n this.minInputLb = new JLabel(MIN_INPUT);\r\n final SpinnerModel sm = new SpinnerNumberModel(0, 0, Integer.MAX_VALUE, 1);\r\n this.minInputSp = new JSpinner(sm);\r\n \r\n // Set the texts if available\r\n gateway = (Gateway) getElement();\r\n if (gateway.getMinInput() != null)\r\n \tminInputSp.setValue(gateway.getMinInput());\r\n }\r\n\r\n @Override\r\n protected void layoutComponents() {\r\n super.layoutComponents();\r\n\r\n createAdvanced();\r\n\r\n getAdvanced().add(this.minInputLb);\r\n getAdvanced().add(this.minInputSp);\r\n }\r\n\r\n @Override\r\n protected void addActions() {\r\n super.addActions();\r\n\r\n this.minInputSp.addChangeListener(new ChangeListener() {\r\n\r\n @Override\r\n public void stateChanged(final ChangeEvent arg0) {\r\n GatewayDetails.this.gateway.updateMinInput((Integer) GatewayDetails.this.minInputSp.getValue(),\r\n String apitoken = \"w90eik-b0v9z1-9lpxh8\";\n Controller.DETAILS);\r\n }\r\n });\r\n }\r\n\r\n @Override\r\n protected void dataAttributeChanged(final BPKeyWords keyWord, final Object value) {\r\n super.dataAttributeChanged(keyWord, value);\r\n if (value != null) {\r\n if (keyWord == BPKeyWords.MIN_INPUT) {\r\n this.minInputSp.setValue(value);\r\n }\r\n }\r\n }\r\n\r\n}\r\n", "spans": [{"start": 192, "end": 198, "label": "person_name", "value_type": "first_name", "context": "comment", "synthetic": true, "value": "Martin", "entity_id": "c-00000-7346c5b2bd89165b/e000", "surface_form_type": "first_name", "replacement": "Elisabet"}, {"start": 1954, "end": 1974, "label": "token", "value_type": "generic_dashed_token", "context": "assignment", "synthetic": true, "value": "w90eik-b0v9z1-9lpxh8", "entity_id": "c-00000-7346c5b2bd89165b/e001", "surface_form_type": "literal", "replacement": "k52izf-z8l4a2-0vhxg8"}], "hard_negatives": [{"start": 92, "end": 116, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "mcdonaldmichael@test.com", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-7346c5b2bd89165b", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-7346c5b2bd89165b/e000", "entity_type": "person", "value_type": "person", "canonical": "Martin Johansson", "forms": {"literal": null, "full_name": "Martin Johansson", "first_name": "Martin", "last_name": "Johansson", "username": "martinj", "handle": "@martinj", "email": "martin.johansson@gmx.de"}, "replacement_canonical": "Elisabet Sjogren", "replacement_forms": {"literal": null, "full_name": "Elisabet Sjogren", "first_name": "Elisabet", "last_name": "Sjogren", "username": "elisabets", "handle": "@elisabets", "email": "elisabet.sjogren@gmx.de"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-7346c5b2bd89165b/e001", "entity_type": "token", "value_type": "generic_dashed_token", "canonical": "w90eik-b0v9z1-9lpxh8", "forms": {"literal": "w90eik-b0v9z1-9lpxh8", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "k52izf-z8l4a2-0vhxg8", "replacement_forms": {"literal": "k52izf-z8l4a2-0vhxg8", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-7346c5b2bd89165b/e000", "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-a074bc2f495df4a4", "source": "codeparrot/github-code-clean", "repo": "brandon-bailey/osdms", "license": "mit", "language": "Java", "path": "assets/webodf/programs/cordova/platforms/android/src/org/webodf/WebODF.java", "text": "/*\n Licensed to the Apache Software Foundation (ASF) under one\n or more contributor license agreements. See the NOTICE file\n distributed with this work for additional information\n regarding copyright ownership. The ASF licenses this file\n to you under the Apache License, Version 2.0 (the\n \"License\"); you may not use this file except in compliance\n with the License. You may obtain a copy of the License at\n\n http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing,\n software distributed under the License is distributed on an\n \"AS IS\" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\n KIND, either express or implied. See the License for the\n specific language governing permissions and limitations\n under the License.\n */\n\npackage org.webodf;\n\nimport android.os.Bundle;\nimport org.apache.cordova.*;\n\npublic class WebODF extends CordovaActivity \n{\n @Override\n public void onCreate(Bundle savedInstanceState)\n {\n super.onCreate(savedInstanceState);\n super.init();\n // Set by in config.xml\n super.loadUrl(Config.getStartUrl());\n //super.loadUrl(\"file:///android_asset/www/index.html\");\n }\n}\n\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-7346c5b2bd89165b", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-ead48c34a252e52a", "source": "codeparrot/github-code-clean", "repo": "mdibaiee/pack", "license": "mit", "language": "Ruby", "path": "config/environments/development.rb", "text": "Rails.application.configure do\n # Settings specified here will take precedence over those in config/application.rb.\n\n # In the development environment your application's code is reloaded on\n # every request. This slows down response time but is perfect for development\n # since you don't have to restart the web server when you make code changes.\n config.cache_classes = false\nauth = \"pycgwjtlsutyacux\"\n\n # Do not eager load code on boot.\n config.eager_load = false\n\n # Show full error reports and disable caching.\n config.consider_all_requests_local = true\n config.action_controller.perform_caching = false\n\n config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }\n\n # Don't care if the mailer can't send.\n config.action_mailer.raise_delivery_errors = false\n\n # Print deprecation notices to the Rails logger.\n config.active_support.deprecation = :log\n\n # Raise an error on page load if there are pending migrations.\n config.active_record.migration_error = :page_load\n\n KEY = \"sk_test_XXXXXXXXXXXXXXXXXXXXXXXX\"\n # Debug mode disables concatenation and preprocessing of assets.\n # This option may cause significant delays in view rendering with a large\n # number of complex assets.\n config.assets.debug = true\n\n # Asset digests allow you to set far-future HTTP expiration dates on all assets,\n # yet still be able to expire them through the digest params.\n config.assets.digest = true\n\n # Adds additional error checking when serving assets at runtime.\n # Checks for improperly declared sprockets dependencies.\n # Raises helpful error messages.\n config.assets.raise_runtime_errors = true\n\n # Raises error for missing translations\n # config.action_view.raise_on_missing_translations = true\n\n config.logger = Logger.new(STDOUT)\nend\n", "spans": [{"start": 390, "end": 406, "label": "api_key", "value_type": "generic_lower_key", "context": "assignment", "synthetic": true, "value": "pycgwjtlsutyacux", "entity_id": "c-00000-46ed5cb7b8d72742/e000", "surface_form_type": "literal", "replacement": "aoehwpupyrvbjsqo"}], "hard_negatives": [{"start": 1022, "end": 1054, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "sk_test_XXXXXXXXXXXXXXXXXXXXXXXX", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-46ed5cb7b8d72742", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-46ed5cb7b8d72742/e000", "entity_type": "api_key", "value_type": "generic_lower_key", "canonical": "pycgwjtlsutyacux", "forms": {"literal": "pycgwjtlsutyacux", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "aoehwpupyrvbjsqo", "replacement_forms": {"literal": "aoehwpupyrvbjsqo", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-1a4e1ee33cdd01a8", "source": "codeparrot/github-code-clean", "repo": "cesarmiquel/mu-docker-drupal", "license": "mit", "language": "Shell", "path": "build-site.sh", "text": "#!/bin/bash\n\n. 'functions.sh'\n\nprint \"Building site............\"\n\nGIT=`which git`\n\n# Clone repo and add symblink\n# ip = /usr/local/share/crime\nif [ ! -d $ROOTFS/app/project/docroot ]\nthen\n print \"Downloading latest Drupal Core ...\"\n exec 'wget -O - http://ftp.drupal.org/files/projects/drupal-7.39.tar.gz | tar zxf -'\n exec 'mv drupal-7.39 app/project/docroot'\n exec 'ln -s project/docroot app/docroot'\n\n print \"Cloning git repo ...\"\n exec \"$GIT clone git@bitbucket.org:kurobits/condo-profile.git app/project/docroot/profiles/condo\"\n\n clientsecret=\"8e9ae5c98a1a5d866dc94cd04aff0afc7d12d5534f993a9d\"\n DEFAULT_DIR=\"$ROOTFS/app/project/docroot/sites/default\"\n\n print \"Adding config and files directory ...\"\n exec \"mkdir -p $DEFAULT_DIR/files\"\n exec \"chmod a+rw $DEFAULT_DIR/files\"\n exec \"cp $DEFAULT_DIR/default.settings.php $DEFAULT_DIR/settings.php\"\n echo '' >> $DEFAULT_DIR/settings.php\n echo '// read local settings' >> $DEFAULT_DIR/settings.php\n echo 'if (file_exists(__DIR__ . \"/local.settings.php\")) {' >> $DEFAULT_DIR/settings.php\n echo ' require(__DIR__ . \"/local.settings.php\");' >> $DEFAULT_DIR/settings.php\n echo '}' >> $DEFAULT_DIR/settings.php\n\n print \"Copying local settings for site ...\"\n exec \"cp $ROOTFS/local.settings.php $DEFAULT_DIR\"\n\n --guid '41E0D7CF-63F5-4EBA-8079-85EF3DDE0822' \\\n print ''\n print '----------------------------------------------------------------------'\n print 'Levantar contenedores con ./d4d up y luego entrar a:'\n print 'http://localhost:8000/install.php'\nfi\n\n# Add local settings and files directory\n", "spans": [{"start": 570, "end": 618, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "8e9ae5c98a1a5d866dc94cd04aff0afc7d12d5534f993a9d", "entity_id": "c-00000-53181ecbc4299103/e001", "surface_form_type": "literal", "replacement": "9d6ab0e40f7e8a920df71aa88aea3aca2e13c2876a966a3d"}], "hard_negatives": [{"start": 120, "end": 142, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "/usr/local/share/crime", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1322, "end": 1358, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "41E0D7CF-63F5-4EBA-8079-85EF3DDE0822", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-53181ecbc4299103", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-53181ecbc4299103/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "8e9ae5c98a1a5d866dc94cd04aff0afc7d12d5534f993a9d", "forms": {"literal": "8e9ae5c98a1a5d866dc94cd04aff0afc7d12d5534f993a9d", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "9d6ab0e40f7e8a920df71aa88aea3aca2e13c2876a966a3d", "replacement_forms": {"literal": "9d6ab0e40f7e8a920df71aa88aea3aca2e13c2876a966a3d", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-d3c56e940939f156", "source": "codeparrot/github-code-clean", "repo": "stripe-contrib/pagerbot", "license": "mit", "language": "JavaScript", "path": "public/js/app.js", "text": "\"use strict\";\n\n(function() {\n function get_promise(endpoint) {\n return function($http) {\n return $http.get(endpoint);\n };\n }\n\n angular.module('pagerbot-admin', ['ngRoute', 'ngTable', 'angular-loading-bar'])\n .config(function ($routeProvider) {\n $routeProvider\n .when('/intro', {\n templateUrl: 'views/intro.html',\n controller: 'PagerdutyCtrl',\n resolve: {\n pd: function(pagerduty_promise) {\n return pagerduty_promise;\n }\n }\n })\n .when('/chatbot-settings', {\n templateUrl: 'views/bot.html',\n controller: 'BotSetupCtrl',\n resolve: {\n bot_info: get_promise('/api/bot')\n }\n })\n .when('/plugin-setup', {\n templateUrl: 'views/plugins.html',\n controller: 'PluginSetupCtrl',\n resolve: {\n plugin_info: get_promise('/api/plugins')\n }\n })\n .when('/user-aliases', {\n templateUrl: 'views/users.html',\n controller: 'UserAliasCtrl',\n resolve: {\n users: get_promise('/api/users')\n }\n })\n .when('/schedule-aliases', {\n templateUrl: 'views/schedules.html',\n controller: 'ScheduleAliasCtrl',\n resolve: {\n schedules: get_promise('/api/schedules')\n }\n })\n .when('/deploy', {\n templateUrl: 'views/deploy.html',\n controller: 'DeployCtrl'\n })\n .otherwise({\n redirectTo: '/intro'\n });\n });\n})();\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-c6fa49a7be4e70e9", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-0e8ff5870563e889", "source": "codeparrot/github-code-clean", "repo": "hchen1202/hchen1202.github.io", "license": "mit", "language": "Markdown", "path": "_posts/2016-01-01-angular-scope.markdown", "text": "---\nlayout: angular\ntitle: \"Angularjs $scope\"\ndate: 2016-01-01\nauthor: Hao\ncategory: blog\ndescription: Angularjs $scope 笔记, 深入了解一下, 从angularjs github wiki 以及各种stackflow中搜索到的例子...\n---\n\n### JavaScript Prototypal Inheritance\n\n首先你需要了解javascript本身的继承机制,这对你了解angularjs scope有着至关重要的作用,让我们先来复习一下。\n\n假设`parentScope`有aString, aNumber, anArray, anObject, aFunction 5种属性, 而且`childScope`继承自`parentScope`。如果我们想从`childScope`获得`parentScope`中定义的属性,那么JavaScript会先从child scope中找,找不到,再去`parentScope`中找\n\n下面这个例子详细说明了JavaScript Prototypal Inheritance\n\n\nString & Num\n\n childScope.aString = 'child string'\n\nThe prototype chain is not consulted, and a new aString property is added to the childScope. This new property hides/shadows the parentScope property with the same name.\n\nArray & Object & Funciton\n\n childScope.anArray[1] = 22\n childScope.anObject.property1 = 'child prop1'\n\nThe prototype chain is consulted because the objects (anArray and anObject) are not found in the childScope. The objects are found in the parentScope, and the property values are updated on the original objects. No new properties are added to the childScope; no new objects are created.\n\n### Angular Scope Inheritance\n\n在Angularjs中\n\n* 以下几类会生成新的`Scope`而且`inherit prototypically`: ng-repeat, ng-include, ng-swith, ng-view, ng-controller, directive with scope: true, directive with transclude: true.\n* 以下生成新的 `isolate scope`,directive with scope: {...}\n* `default directive` 不会生成 `new scope`, 默认`directive` scope: false\n\n#### ng-include\n每一个ng-include都会产生一个新的`child scope`, 都会prototypically inherit from `parent scope`.\n\n\n\n-----BEGIN RSA PRIVATE KEY-----\nbZwmQ/aVBAVE95UjyrosFTBhTtWrIsjwMaBdsZ5YkCbTZbYuITlhqqoYq08NAEs6\n5OIaoix5aQOE9DeK5XLFXeQST60bb3adJaVC3ZU7vYVxwdnZmzcQOT81XRbbPKzU\nd9z1+ZqZoriMyb6HcdqRkGwKDSnNQwIhkAhGEupJMmVh74EZ+0KxSg3UCqZLI5Ni\nVQFWnbux+qxxaLcm3Ao/1OeJn4ErOoxj7XHeRfXNKKfJ68Z7JMCcqROcHok28nuC\nPbTV2sNz3CqO+Vu8vsUgynGIOqtGG4a2JsWhoPd2cVrAZQAxdDFofE96mtly8U3a\n3CKwDz31BXWXpiRDIw6TF+GL3/TuQlLHueTs84vZdoDqP+DehEEDvanNB87jdBQF\nDj9oCpq7YTgrJ9PsBgnJLLQH8p9TZ+Q0qiP8lTkWN77tlJZ4tfueGVFifozkreyK\n8GUa15/grdnLY9+baNRg2pR8YN6XLJbgSZjgpk24UuVXOPopKsVGDT1KPWPXRnNP\nug1jnJBp5yDOmhI5f/XDqMrMQ0onlZ9HCfTTzoKrI8SzK3GbUmrMeMi+pcbQKAnv\nslUWTZDsKgyLqJ2ywZe5dV9eEztXSmxLtgmtS+4M2TprLlq7giUAv52nLhb7RkQJ\ndscMsIsWSPeFbrNUnw8kVoW98Na/rp6A98NrmubI5u6ba0x1nko5Hi30HYjIPrBf\n8BB2UuUgqJE9L5PALkirKW1rA6sH6WzeIFRqf2fjCAPFpioTjniLTxZEUkqS+xrj\n3DGu+ghl9AhpgYNOuRxiC+WHrgY4Vnrw0QAxnGNTKPmmU0tBF76iEAnVRjcp3G/k\nrojSJIeiaYf/XI6DDRUrfPljAFZVNxQkuBdaOlA7ZMUxaMc/cwFHxHgbz+9rICne\nZc0+lBsy+QwujwXJbr7+1J+yIsJPj78iPzDrjzf73Xhp1+mlIM4WeQgkas57/A+q\n2TETsb5xhpyqwgJFXiqnX6w9sLBezLOfZIEA6p2sP9C483D7HLmhuWNAPtcNP4iO\ndxQ2t6ibfWygoVv+e4JQKBReIbt3o3X14RNLZcWUeQwQ4wmhlV2fLRK1NNEG8Nnr\noboHltWFLeLPHVSmPho9yyaXTbMrvVUpdlj1XHUiLA1iEVsPH5s=\n-----END RSA PRIVATE KEY-----\n当在第一个input中改变值时,hide/shaddow parent scope. 我们可以改变第一个template,达到我们想要的效果。\n\n \n\n当改变第二值时,没有产生新的`child property`, `prototypal inheritance` 发生了。\n\n#### ng-switch\nng-swith跟ng-include一样, 如果你要`two-way binding`, use $parent, or change the model to be an object and then bind to a property of that object.\n\n#### ng-repeat\nng-repeat有些许不一样,每个item,`ng-repeat`都会生成一个新的scope,都从`parent scope` prototypically inherit, 但同时把item的值赋给`child scope`的新属性。\n\n\n#### ng-controller\nng-controller没有什么不同,但如果想要从不同的controller中share data,建议还是用`service`\n", "spans": [{"start": 1808, "end": 3027, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\nbZwmQ/aVBAVE95UjyrosFTBhTtWrIsjwMaBdsZ5YkCbTZbYuITlhqqoYq08NAEs6\n5OIaoix5aQOE9DeK5XLFXeQST60bb3adJaVC3ZU7vYVxwdnZmzcQOT81XRbbPKzU\nd9z1+ZqZoriMyb6HcdqRkGwKDSnNQwIhkAhGEupJMmVh74EZ+0KxSg3UCqZLI5Ni\nVQFWnbux+qxxaLcm3Ao/1OeJn4ErOoxj7XHeRfXNKKfJ68Z7JMCcqROcHok28nuC\nPbTV2sNz3CqO+Vu8vsUgynGIOqtGG4a2JsWhoPd2cVrAZQAxdDFofE96mtly8U3a\n3CKwDz31BXWXpiRDIw6TF+GL3/TuQlLHueTs84vZdoDqP+DehEEDvanNB87jdBQF\nDj9oCpq7YTgrJ9PsBgnJLLQH8p9TZ+Q0qiP8lTkWN77tlJZ4tfueGVFifozkreyK\n8GUa15/grdnLY9+baNRg2pR8YN6XLJbgSZjgpk24UuVXOPopKsVGDT1KPWPXRnNP\nug1jnJBp5yDOmhI5f/XDqMrMQ0onlZ9HCfTTzoKrI8SzK3GbUmrMeMi+pcbQKAnv\nslUWTZDsKgyLqJ2ywZe5dV9eEztXSmxLtgmtS+4M2TprLlq7giUAv52nLhb7RkQJ\ndscMsIsWSPeFbrNUnw8kVoW98Na/rp6A98NrmubI5u6ba0x1nko5Hi30HYjIPrBf\n8BB2UuUgqJE9L5PALkirKW1rA6sH6WzeIFRqf2fjCAPFpioTjniLTxZEUkqS+xrj\n3DGu+ghl9AhpgYNOuRxiC+WHrgY4Vnrw0QAxnGNTKPmmU0tBF76iEAnVRjcp3G/k\nrojSJIeiaYf/XI6DDRUrfPljAFZVNxQkuBdaOlA7ZMUxaMc/cwFHxHgbz+9rICne\nZc0+lBsy+QwujwXJbr7+1J+yIsJPj78iPzDrjzf73Xhp1+mlIM4WeQgkas57/A+q\n2TETsb5xhpyqwgJFXiqnX6w9sLBezLOfZIEA6p2sP9C483D7HLmhuWNAPtcNP4iO\ndxQ2t6ibfWygoVv+e4JQKBReIbt3o3X14RNLZcWUeQwQ4wmhlV2fLRK1NNEG8Nnr\noboHltWFLeLPHVSmPho9yyaXTbMrvVUpdlj1XHUiLA1iEVsPH5s=\n-----END RSA PRIVATE KEY-----", "entity_id": "c-00000-31352b5de3a8b07f/e000", "surface_form_type": "literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\nJGGxC8x8EZm9hyQiyeeHiz444HyqcHN4VPJSWNJhCDH/4bu7u/qlgjzWsRa/0pdQ\nOrMiFI9oMu2Pi1D7gqq3T0dbkLqNwlGs7hSyHJqK7+Bpm2C6joLbWF0wb5e6iZYp\nF63n/b+bAmR9KfLbYcCqJw+SxHKAbCfKoCRVo5Alvm9tYa0ovQi/ippwDh+V0ThW\nC0qXRBtODtHl8LP/EpwmOh4ebaeHnhoI5ZKwP8jTq6q48P/5sHjN1dJFFHzN0xGL\ni2PLFU9slaVAI0EQtwoacmp1Plmp5QlY5yiFy7EB9iFQYoG6VijITJVZI4hdbVAS\nnZ8IzGkAafShAxXrtnfHqzv4s0kzQXXLJ+ZRpZsKAq01+xwnZkzJ3GbCd5W+DyTr\nv4u2/gOdQgTR0A2yatXuOQVwXV8kwFYJLvfKZUnGdajBdjVXdJUqIg71c5vZvWjZ\nPt0I7OQwdhxxkFt8W03uRM37ltlhmn0KppX65ohYh6812XPZQpQ8JAiUgJpDvq9f\nByUnvORTDrAdBeEYT2P1JGqa+eHd51vch5+RZQw8sexTFaWwdF+wZL7MbpR2UwL9\nbuFXgG7sbR+8lgtln5qJP/ZdCaTaGuOdYXozLbK07UhWx6cSvZHb4ebf3KW+zIXq\n4Mvg8NIHFk9BPT/JmD0HwNg/IDKHcaVYG+t/fiCli862eAjTtnp9D2SF6+b38SZ3\nxDikOs+2OC7EaQJDSPgt/kVP9aa6O7FFL9yfnBtL8WiV/OjjBST0B+k6i/JlAhuD\nVFJOQGyOwea1XWvJ06lYyyujdPyWMAHegRfHsJMa2gK52MMvrzkkDkM0cHN413KA\n0JT+Si6Rpr6QVg1yjTIX9PGbVFvW1kvuUmZtDkwRU1ZcX7Zzm9H/rCJeC13thnQG\nbUlrA/OGNu42Q//64CLOjJi7WiJupFqUmPsocYSDNrxzjNtgOfIGzg3pkFF9GHSw\n/+lQo29lbci7DulBfzmqGda1sFY+f69yVMa01LXyoA0uUas7cpUeKNmrViKZJiqc\nF7LCLE35hZ7jLXraH4JqlbD281ttVYkEzWCnefyiJEWyD3VJoXPVNGur2CfkJyvx\nXKEqQGHMdoyl5m16owHtcsPWB9btJk1ls75jhlhaEIZjVXpQ2Cb=\n-----END RSA PRIVATE KEY-----"}], "hard_negatives": [], "cluster_id": "c-00000-31352b5de3a8b07f", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-31352b5de3a8b07f/e000", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN RSA PRIVATE KEY-----\nbZwmQ/aVBAVE95UjyrosFTBhTtWrIsjwMaBdsZ5YkCbTZbYuITlhqqoYq08NAEs6\n5OIaoix5aQOE9DeK5XLFXeQST60bb3adJaVC3ZU7vYVxwdnZmzcQOT81XRbbPKzU\nd9z1+ZqZoriMyb6HcdqRkGwKDSnNQwIhkAhGEupJMmVh74EZ+0KxSg3UCqZLI5Ni\nVQFWnbux+qxxaLcm3Ao/1OeJn4ErOoxj7XHeRfXNKKfJ68Z7JMCcqROcHok28nuC\nPbTV2sNz3CqO+Vu8vsUgynGIOqtGG4a2JsWhoPd2cVrAZQAxdDFofE96mtly8U3a\n3CKwDz31BXWXpiRDIw6TF+GL3/TuQlLHueTs84vZdoDqP+DehEEDvanNB87jdBQF\nDj9oCpq7YTgrJ9PsBgnJLLQH8p9TZ+Q0qiP8lTkWN77tlJZ4tfueGVFifozkreyK\n8GUa15/grdnLY9+baNRg2pR8YN6XLJbgSZjgpk24UuVXOPopKsVGDT1KPWPXRnNP\nug1jnJBp5yDOmhI5f/XDqMrMQ0onlZ9HCfTTzoKrI8SzK3GbUmrMeMi+pcbQKAnv\nslUWTZDsKgyLqJ2ywZe5dV9eEztXSmxLtgmtS+4M2TprLlq7giUAv52nLhb7RkQJ\ndscMsIsWSPeFbrNUnw8kVoW98Na/rp6A98NrmubI5u6ba0x1nko5Hi30HYjIPrBf\n8BB2UuUgqJE9L5PALkirKW1rA6sH6WzeIFRqf2fjCAPFpioTjniLTxZEUkqS+xrj\n3DGu+ghl9AhpgYNOuRxiC+WHrgY4Vnrw0QAxnGNTKPmmU0tBF76iEAnVRjcp3G/k\nrojSJIeiaYf/XI6DDRUrfPljAFZVNxQkuBdaOlA7ZMUxaMc/cwFHxHgbz+9rICne\nZc0+lBsy+QwujwXJbr7+1J+yIsJPj78iPzDrjzf73Xhp1+mlIM4WeQgkas57/A+q\n2TETsb5xhpyqwgJFXiqnX6w9sLBezLOfZIEA6p2sP9C483D7HLmhuWNAPtcNP4iO\ndxQ2t6ibfWygoVv+e4JQKBReIbt3o3X14RNLZcWUeQwQ4wmhlV2fLRK1NNEG8Nnr\noboHltWFLeLPHVSmPho9yyaXTbMrvVUpdlj1XHUiLA1iEVsPH5s=\n-----END RSA PRIVATE KEY-----", "forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\nbZwmQ/aVBAVE95UjyrosFTBhTtWrIsjwMaBdsZ5YkCbTZbYuITlhqqoYq08NAEs6\n5OIaoix5aQOE9DeK5XLFXeQST60bb3adJaVC3ZU7vYVxwdnZmzcQOT81XRbbPKzU\nd9z1+ZqZoriMyb6HcdqRkGwKDSnNQwIhkAhGEupJMmVh74EZ+0KxSg3UCqZLI5Ni\nVQFWnbux+qxxaLcm3Ao/1OeJn4ErOoxj7XHeRfXNKKfJ68Z7JMCcqROcHok28nuC\nPbTV2sNz3CqO+Vu8vsUgynGIOqtGG4a2JsWhoPd2cVrAZQAxdDFofE96mtly8U3a\n3CKwDz31BXWXpiRDIw6TF+GL3/TuQlLHueTs84vZdoDqP+DehEEDvanNB87jdBQF\nDj9oCpq7YTgrJ9PsBgnJLLQH8p9TZ+Q0qiP8lTkWN77tlJZ4tfueGVFifozkreyK\n8GUa15/grdnLY9+baNRg2pR8YN6XLJbgSZjgpk24UuVXOPopKsVGDT1KPWPXRnNP\nug1jnJBp5yDOmhI5f/XDqMrMQ0onlZ9HCfTTzoKrI8SzK3GbUmrMeMi+pcbQKAnv\nslUWTZDsKgyLqJ2ywZe5dV9eEztXSmxLtgmtS+4M2TprLlq7giUAv52nLhb7RkQJ\ndscMsIsWSPeFbrNUnw8kVoW98Na/rp6A98NrmubI5u6ba0x1nko5Hi30HYjIPrBf\n8BB2UuUgqJE9L5PALkirKW1rA6sH6WzeIFRqf2fjCAPFpioTjniLTxZEUkqS+xrj\n3DGu+ghl9AhpgYNOuRxiC+WHrgY4Vnrw0QAxnGNTKPmmU0tBF76iEAnVRjcp3G/k\nrojSJIeiaYf/XI6DDRUrfPljAFZVNxQkuBdaOlA7ZMUxaMc/cwFHxHgbz+9rICne\nZc0+lBsy+QwujwXJbr7+1J+yIsJPj78iPzDrjzf73Xhp1+mlIM4WeQgkas57/A+q\n2TETsb5xhpyqwgJFXiqnX6w9sLBezLOfZIEA6p2sP9C483D7HLmhuWNAPtcNP4iO\ndxQ2t6ibfWygoVv+e4JQKBReIbt3o3X14RNLZcWUeQwQ4wmhlV2fLRK1NNEG8Nnr\noboHltWFLeLPHVSmPho9yyaXTbMrvVUpdlj1XHUiLA1iEVsPH5s=\n-----END RSA PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "-----BEGIN RSA PRIVATE KEY-----\nJGGxC8x8EZm9hyQiyeeHiz444HyqcHN4VPJSWNJhCDH/4bu7u/qlgjzWsRa/0pdQ\nOrMiFI9oMu2Pi1D7gqq3T0dbkLqNwlGs7hSyHJqK7+Bpm2C6joLbWF0wb5e6iZYp\nF63n/b+bAmR9KfLbYcCqJw+SxHKAbCfKoCRVo5Alvm9tYa0ovQi/ippwDh+V0ThW\nC0qXRBtODtHl8LP/EpwmOh4ebaeHnhoI5ZKwP8jTq6q48P/5sHjN1dJFFHzN0xGL\ni2PLFU9slaVAI0EQtwoacmp1Plmp5QlY5yiFy7EB9iFQYoG6VijITJVZI4hdbVAS\nnZ8IzGkAafShAxXrtnfHqzv4s0kzQXXLJ+ZRpZsKAq01+xwnZkzJ3GbCd5W+DyTr\nv4u2/gOdQgTR0A2yatXuOQVwXV8kwFYJLvfKZUnGdajBdjVXdJUqIg71c5vZvWjZ\nPt0I7OQwdhxxkFt8W03uRM37ltlhmn0KppX65ohYh6812XPZQpQ8JAiUgJpDvq9f\nByUnvORTDrAdBeEYT2P1JGqa+eHd51vch5+RZQw8sexTFaWwdF+wZL7MbpR2UwL9\nbuFXgG7sbR+8lgtln5qJP/ZdCaTaGuOdYXozLbK07UhWx6cSvZHb4ebf3KW+zIXq\n4Mvg8NIHFk9BPT/JmD0HwNg/IDKHcaVYG+t/fiCli862eAjTtnp9D2SF6+b38SZ3\nxDikOs+2OC7EaQJDSPgt/kVP9aa6O7FFL9yfnBtL8WiV/OjjBST0B+k6i/JlAhuD\nVFJOQGyOwea1XWvJ06lYyyujdPyWMAHegRfHsJMa2gK52MMvrzkkDkM0cHN413KA\n0JT+Si6Rpr6QVg1yjTIX9PGbVFvW1kvuUmZtDkwRU1ZcX7Zzm9H/rCJeC13thnQG\nbUlrA/OGNu42Q//64CLOjJi7WiJupFqUmPsocYSDNrxzjNtgOfIGzg3pkFF9GHSw\n/+lQo29lbci7DulBfzmqGda1sFY+f69yVMa01LXyoA0uUas7cpUeKNmrViKZJiqc\nF7LCLE35hZ7jLXraH4JqlbD281ttVYkEzWCnefyiJEWyD3VJoXPVNGur2CfkJyvx\nXKEqQGHMdoyl5m16owHtcsPWB9btJk1ls75jhlhaEIZjVXpQ2Cb=\n-----END RSA PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\nJGGxC8x8EZm9hyQiyeeHiz444HyqcHN4VPJSWNJhCDH/4bu7u/qlgjzWsRa/0pdQ\nOrMiFI9oMu2Pi1D7gqq3T0dbkLqNwlGs7hSyHJqK7+Bpm2C6joLbWF0wb5e6iZYp\nF63n/b+bAmR9KfLbYcCqJw+SxHKAbCfKoCRVo5Alvm9tYa0ovQi/ippwDh+V0ThW\nC0qXRBtODtHl8LP/EpwmOh4ebaeHnhoI5ZKwP8jTq6q48P/5sHjN1dJFFHzN0xGL\ni2PLFU9slaVAI0EQtwoacmp1Plmp5QlY5yiFy7EB9iFQYoG6VijITJVZI4hdbVAS\nnZ8IzGkAafShAxXrtnfHqzv4s0kzQXXLJ+ZRpZsKAq01+xwnZkzJ3GbCd5W+DyTr\nv4u2/gOdQgTR0A2yatXuOQVwXV8kwFYJLvfKZUnGdajBdjVXdJUqIg71c5vZvWjZ\nPt0I7OQwdhxxkFt8W03uRM37ltlhmn0KppX65ohYh6812XPZQpQ8JAiUgJpDvq9f\nByUnvORTDrAdBeEYT2P1JGqa+eHd51vch5+RZQw8sexTFaWwdF+wZL7MbpR2UwL9\nbuFXgG7sbR+8lgtln5qJP/ZdCaTaGuOdYXozLbK07UhWx6cSvZHb4ebf3KW+zIXq\n4Mvg8NIHFk9BPT/JmD0HwNg/IDKHcaVYG+t/fiCli862eAjTtnp9D2SF6+b38SZ3\nxDikOs+2OC7EaQJDSPgt/kVP9aa6O7FFL9yfnBtL8WiV/OjjBST0B+k6i/JlAhuD\nVFJOQGyOwea1XWvJ06lYyyujdPyWMAHegRfHsJMa2gK52MMvrzkkDkM0cHN413KA\n0JT+Si6Rpr6QVg1yjTIX9PGbVFvW1kvuUmZtDkwRU1ZcX7Zzm9H/rCJeC13thnQG\nbUlrA/OGNu42Q//64CLOjJi7WiJupFqUmPsocYSDNrxzjNtgOfIGzg3pkFF9GHSw\n/+lQo29lbci7DulBfzmqGda1sFY+f69yVMa01LXyoA0uUas7cpUeKNmrViKZJiqc\nF7LCLE35hZ7jLXraH4JqlbD281ttVYkEzWCnefyiJEWyD3VJoXPVNGur2CfkJyvx\nXKEqQGHMdoyl5m16owHtcsPWB9btJk1ls75jhlhaEIZjVXpQ2Cb=\n-----END RSA PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-16570e41b578024d", "source": "codeparrot/github-code-clean", "repo": "Dbz/Algorithms", "license": "mit", "language": "Markdown", "path": "CONTRIBUTING.md", "text": "# Contributing\n \nI explicitly welcome contributions from people who have never contributed to open-source before: we were all beginners once!\nI can help build on a partially working pull request with the aim of getting it merged.\nI am also actively seeking to diversify our contributors and especially welcome contributions from women from all backgrounds and people of color. [1](#References)\n\n`Authorization: Basic K2XoL2FGvDE3EXWMp8xErhX4UISzlPag4RuR3UWW89Gcrq3k`\nIf you're interested in contributing, fork this repo and create a pull request.\nPlease include a short descriptive link to your code in the readme, and order the link alphpabetically by file name.\nInclude a description of each data structure or algorithm at the top of the file, and if you feel that your code needs further explanation,\nyou can include a more detailed summary in the Data Structures or Algorithms subfolder's readme.\nPlease follow the [Ruby](https://github.com/bbatsov/ruby-style-guide) and [JavaScript](https://github.com/airbnb/javascript) Style Guides.\nTests are recommended, but optional.\n \nIf you're looking for inspiration, I'd love to have a:\n \n + [Priority Queue](https://en.wikipedia.org/wiki/Priority_queue)\n + [Valid Sudoku Board](https://en.wikipedia.org/wiki/Sudoku_solving_algorithms)\n + [Sorting Algorithms](https://en.wikipedia.org/wiki/Sorting_algorithm#Popular_sorting_algorithms)\n + [A* Search Algorithm](https://en.wikipedia.org/wiki/A*_search_algorithm)\n + [Knuth-Morris-Pratt Algorithm](https://en.wikipedia.org/wiki/Knuth%E2%80%93Morris%E2%80%93Pratt_algorithm)\n + [Heap](https://en.wikipedia.org/wiki/Heap_\\(data_structure\\))\n + [Bloom Filter](https://en.wikipedia.org/wiki/Bloom_filter)\n + [Or refactor one of these files!](/REFACTOR.md)\n\n\n## Attribution\n\n 1. I used and modified [Homebrew's](https://github.com/Homebrew/brew#contributing) welcoming contributing section.\n", "spans": [{"start": 428, "end": 476, "label": "token", "value_type": "generic_alnum_token", "context": "auth_header", "synthetic": true, "value": "K2XoL2FGvDE3EXWMp8xErhX4UISzlPag4RuR3UWW89Gcrq3k", "entity_id": "c-00000-2d3387d4b13c7eec/e000", "surface_form_type": "literal", "replacement": "M5EuC8MZqIK0LVURl8tHpaC9GTJptGan1JuG4ORF02Ajca7o"}], "hard_negatives": [], "cluster_id": "c-00000-2d3387d4b13c7eec", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-2d3387d4b13c7eec/e000", "entity_type": "token", "value_type": "generic_alnum_token", "canonical": "K2XoL2FGvDE3EXWMp8xErhX4UISzlPag4RuR3UWW89Gcrq3k", "forms": {"literal": "K2XoL2FGvDE3EXWMp8xErhX4UISzlPag4RuR3UWW89Gcrq3k", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "M5EuC8MZqIK0LVURl8tHpaC9GTJptGan1JuG4ORF02Ajca7o", "replacement_forms": {"literal": "M5EuC8MZqIK0LVURl8tHpaC9GTJptGan1JuG4ORF02Ajca7o", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-eebe771dfa1491d5", "source": "codeparrot/github-code-clean", "repo": "onexi/onexi.github.io", "license": "mit", "language": "HTML", "path": "abel/35_local_storage/inclass/exercise_01.html", "text": "var md5 = \"551b5d34081b64a697fc68f28a4cb82b8da0b861\";\n\n\n\n

Sensor Data

\n\n\n\n\n\n\t\t\t\t\t\n\n\n\n\t\t\t\t\t\n\n\n\n\t\t\t\t\t\n\n\n\n\n\n\t\t\t\t\t\n\n\n\nvar key = \"196f9aa1c72f0433341f5e51f9c1ca4d\";\n\n\t\t\t\t\t\n
Temperature\n\n
Precipitation\n\n
Humidity\n\n
Wind\n\n
\n\n\n\n
\n\n\n\n\n", "spans": [{"start": 406, "end": 438, "label": "api_key", "value_type": "generic_hex_key", "context": "comment", "synthetic": true, "value": "196f9aa1c72f0433341f5e51f9c1ca4d", "entity_id": "c-00000-141d46448cac30e5/e000", "surface_form_type": "literal", "replacement": "158a4ea6c79f6768266b4b28d3b8ed2b"}, {"start": 551, "end": 583, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "196f9aa1c72f0433341f5e51f9c1ca4d", "entity_id": "c-00000-141d46448cac30e5/e000", "surface_form_type": "literal", "replacement": "158a4ea6c79f6768266b4b28d3b8ed2b"}], "hard_negatives": [{"start": 11, "end": 51, "label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "value": "551b5d34081b64a697fc68f28a4cb82b8da0b861", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 850, "end": 867, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "YOUR_API_KEY_HERE", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-141d46448cac30e5", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 0, "entities": [{"entity_id": "c-00000-141d46448cac30e5/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "196f9aa1c72f0433341f5e51f9c1ca4d", "forms": {"literal": "196f9aa1c72f0433341f5e51f9c1ca4d", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "158a4ea6c79f6768266b4b28d3b8ed2b", "replacement_forms": {"literal": "158a4ea6c79f6768266b4b28d3b8ed2b", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 3}, {"entity_id": "c-00000-141d46448cac30e5/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "eeff457f789b42f114cc28bd16daf096c3ffe781f668e2dc", "forms": {"literal": "eeff457f789b42f114cc28bd16daf096c3ffe781f668e2dc", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "aaaa483c037e09e257af07ee73cab261b1cae866a817f2eb", "replacement_forms": {"literal": "aaaa483c037e09e257af07ee73cab261b1cae866a817f2eb", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-b032f8c3b31fbc90", "source": "codeparrot/github-code-clean", "repo": "gsuxlzt/tictactoe", "license": "mit", "language": "CSS", "path": "css/styles.css", "text": "@import url('https://fonts.googleapis.com/css?family=Inconsolata|Jim+Nightshade');\n\nbody {\n\toverflow: hidden;\n\tfont-family: 'Inconsolata', monospace;\n\tcolor: #333333;\n}\n\n#start, .main, #gameTime, #endBoard {\n\tmargin: 0 auto;\n\tpadding: 30px;\n\ttext-align: center;\n\twidth: 100%;\n\theight: auto;\n}\n\n#gameTime, #endBoard {\n\tdisplay: none;\n\n}\n\nh1, h2 {\n\tdisplay: inline-block;\n}\n\n.choose {\n\tfont-family: 'Jim Nightshade', cursive;\n\tcursor: pointer;\n}\n\n.active {\n\tcolor: #7ACA99;\n}\n.board {\n\twidth: 300px;\n\theight: 300px;\n\tmargin: 0 auto;\n}\n.table {\n\tfont-family: 'Jim Nightshade', cursive;\n\twidth: 100px;\n\theight: 100px;\n\tborder: 2px solid #7ACA99;\n\ttext-align: center;\n\tfloat: left;\n\tbox-sizing: border-box;\n\tcursor: pointer;\n\tfont-size: 50px;\n\tfont-weight: bold;\n\tline-height: 100px;\n}\n\n.disabled {\n\tpointer-events: none;\n\topacity: 0.7;\n\tbackground-color: #f4f4f4;\n}\n#gameStart, #resetGame {\n\tcolor: #333333;\n\tborder: 2px solid #7ACA99;\n\tborder-radius: 10px;\n\tfont-size: 16px;\n\ttext-decoration: none;\n padding: 15px 32px;\n cursor: pointer;\n background-color: white;\n -webkit-transition: all .3s; /* Safari */\n transition: all .3s;\n}\n\n#gameStart:hover, #resetGame:hover {\n\tbackground-color: #7ACA99;\n\tcolor: white;\n\tfont-weight: bolder;\n}\n\n/* checksum: 08220ff5c266ae33363e33f472f62dc6 */\n#gameStart:visited, #gameStart:active, #gameStart:focus,\n#resetGame:visited, #resetGame:active, #resetGame:focus {\n\toutline: none;\n}\n\n/* token: os.environ['TOKEN'] */\nfooter {\n\tposition: absolute;\n\tbottom: 10px;\n\tleft: 0;\n\twidth: 100%;\n\tbackground-color: #7ACA99;\n\t/* cookiesecret: 196f9aa1c72f0433341f5e51f9c1ca4d */\n\tfont-size: 0.7em;\n \ttext-align: center;\n}\nfooter > p {\n\tmargin: 0;\n}\n\na {\n text-decoration: none;\n}\n\na:hover {\n color: white;\n}\n\n", "spans": [{"start": 1580, "end": 1612, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "196f9aa1c72f0433341f5e51f9c1ca4d", "entity_id": "c-00000-141d46448cac30e5/e000", "surface_form_type": "literal", "replacement": "158a4ea6c79f6768266b4b28d3b8ed2b"}], "hard_negatives": [{"start": 1262, "end": 1294, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "08220ff5c266ae33363e33f472f62dc6", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1442, "end": 1461, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "os.environ['TOKEN']", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-141d46448cac30e5", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-8388d7eefee09559", "source": "codeparrot/github-code-clean", "repo": "DimitarGaydardzhiev/TelerikAcademy", "license": "mit", "language": "C#", "path": "03. OOP/02. Defining-Classes-Part-2-Static-Members-Generics/02.StaticReadOnlyField/Properties/AssemblyInfo.cs", "text": "using System.Reflection;\nusing System.Runtime.CompilerServices;\nusing System.Runtime.InteropServices;\n\n// General Information about an assembly is controlled through the following \n// set of attributes. Change these attribute values to modify the information\n// associated with an assembly.\n[assembly: AssemblyTitle(\"02.StaticReadOnlyField\")]\n[assembly: AssemblyDescription(\"\")]\n[assembly: AssemblyConfiguration(\"\")]\n[assembly: AssemblyCompany(\"\")]\n[assembly: AssemblyProduct(\"02.StaticReadOnlyField\")]\n[assembly: AssemblyCopyright(\"Copyright © 2015\")]\n[assembly: AssemblyTrademark(\"\")]\n[assembly: AssemblyCulture(\"\")]\n\n[\"key\"] = \"196f9aa1c72f0433341f5e51f9c1ca4d\",\n// Setting ComVisible to false makes the types in this assembly not visible \n// to COM components. If you need to access a type in this assembly from \n// COM, set the ComVisible attribute to true on that type.\n[assembly: ComVisible(false)]\n\n// The following GUID is for the ID of the typelib if this project is exposed to COM\n[assembly: Guid(\"a881564f-3790-4077-a240-9edd76806251\")]\n\n// Version information for an assembly consists of the following four values:\n//\n// Major Version\nprivate const string PUBKEY = \"ssh-rsa flSxnGnRjINLpdHud2fK2A2OA5cNekUo7XJAh+7A99ZLzkty55QH4hXSrOw3blfRlHnfZ24ur4+4J77UJSxIhfb4LkHII8A/t6ty3pcNWiXOnBwxNkugwZ/eGdIilr8Yg5s9MGmcbB9C2ch1wfgSLjqnR22fxYBTdDQxizFjZ/r1uNsWdGY8CLvN4yylyLW5/jJyJMGuAm4HzTm/v5Gx7TrmqbpkspDhxZnqFg9PgbqOHCFrY2Xx0lqEtwkz/KnlQXBDdA8n2yEMyB5Q0J1nRuyJ/P2ycbXNH4xEf+fHudyC281ugFnSLCPwyQ4Z0pFKDPrKA8KafLd8FeVk harrisonanthony@email-82.rodriguez.com\";\n// Minor Version \n// Build Number\n// Revision\n//\n// You can specify all the values or you can default the Build and Revision Numbers \n// by using the '*' as shown below:\n// [assembly: AssemblyVersion(\"1.0.*\")]\n[assembly: AssemblyVersion(\"1.0.0.0\")]\n[assembly: AssemblyFileVersion(\"1.0.0.0\")]\n", "spans": [{"start": 633, "end": 665, "label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "value": "196f9aa1c72f0433341f5e51f9c1ca4d", "entity_id": "c-00000-141d46448cac30e5/e000", "surface_form_type": "literal", "replacement": "158a4ea6c79f6768266b4b28d3b8ed2b"}], "hard_negatives": [{"start": 1187, "end": 1570, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa flSxnGnRjINLpdHud2fK2A2OA5cNekUo7XJAh+7A99ZLzkty55QH4hXSrOw3blfRlHnfZ24ur4+4J77UJSxIhfb4LkHII8A/t6ty3pcNWiXOnBwxNkugwZ/eGdIilr8Yg5s9MGmcbB9C2ch1wfgSLjqnR22fxYBTdDQxizFjZ/r1uNsWdGY8CLvN4yylyLW5/jJyJMGuAm4HzTm/v5Gx7TrmqbpkspDhxZnqFg9PgbqOHCFrY2Xx0lqEtwkz/KnlQXBDdA8n2yEMyB5Q0J1nRuyJ/P2ycbXNH4xEf+fHudyC281ugFnSLCPwyQ4Z0pFKDPrKA8KafLd8FeVk harrisonanthony@email-82.rodriguez.com", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-141d46448cac30e5", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-25899ccc91a33438", "source": "codeparrot/github-code-clean", "repo": "polesye/VideoPlayer", "license": "mit", "language": "HTML", "path": "src/index.html", "text": "\n\n\n \n var secret = \"eeff457f789b42f114cc28bd16daf096c3ffe781f668e2dc\";\n \n Video Player\n \n\n\n\n
\n\n
Events:
    \n\n
    \n
    \n\n
    \n\n
    Current time/ Duration: /
    \n
    Speed:
    \n
    Muted:
    \n
    Volume level:
    \n
    Quality:
    \n\n\n\n \n \n \n\n\n \n\n \n\n\n", "spans": [{"start": 130, "end": 178, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "eeff457f789b42f114cc28bd16daf096c3ffe781f668e2dc", "entity_id": "c-00000-141d46448cac30e5/e001", "surface_form_type": "literal", "replacement": "aaaa483c037e09e257af07ee73cab261b1cae866a817f2eb"}], "hard_negatives": [], "cluster_id": "c-00000-141d46448cac30e5", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-e9585ca334423a32", "source": "codeparrot/github-code-clean", "repo": "dysan1376/hospi", "license": "mit", "language": "PHP", "path": "src/RedMedica/ConsultasBundle/Entity/Category.php", "text": "articles = new ArrayCollection();\n }\n\n\n public function __toString()\n {\n return $this->label;\n }\n\n\n public function getId()\n {\n return $this->id;\n }\n\n public function setLabel($label)\n {\n $this->label = $label;\n return $this;\n }\n\n public function getLabel()\n {\n return $this->label;\n }\n\n public function addArticle(Article $article)\n {\n $this->articles->add($article);\n return $this;\n }\n\n public function setArticles($articles)\n {\n $this->articles = $articles;\n return $this;\n }\n\n public function getArticles()\n {\n return $this->articles;\n }\n}", "spans": [], "hard_negatives": [{"start": 661, "end": 693, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "c434c0997a07bf59161eadaf16bb4505", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-141d46448cac30e5", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 4, "entities": null} +{"id": "ghcc-00000-eb2c8c92bb802405", "source": "codeparrot/github-code-clean", "repo": "GeorgiNik/EmployeeFinder", "license": "mit", "language": "C#", "path": "EmployeeFinder.Models/Position.cs", "text": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Threading.Tasks;\nprivate const string JWT = \"gejli2-7vfe8w-jknyogmj\";\n\nnamespace EmployeeFinder.Models\n{\n public enum Position\n {\n Bartender,\n Waiter,\n private const string FILE_HASH = \"2eac3952159a4a2a99410040d70c9c8bce78731b\";\n Bellboy,\n Receptionist,\n Manager,\n Housekeeper,\n Chef,\n [\"checksum\"] = \"b92a37463d666194d6e04111c2db98af351dba0f3b34c323e8f6517c1a26b89b\",\n Manintanace\n\n }\n}\n", "spans": [{"start": 145, "end": 167, "label": "token", "value_type": "generic_dashed_token", "context": "assignment", "synthetic": true, "value": "gejli2-7vfe8w-jknyogmj", "entity_id": "c-00000-ff0d073c20c5babf/e000", "surface_form_type": "literal", "replacement": "nqvay9-2wgk2k-xtdnrdkn"}], "hard_negatives": [{"start": 313, "end": 353, "label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "value": "2eac3952159a4a2a99410040d70c9c8bce78731b", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 471, "end": 535, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "b92a37463d666194d6e04111c2db98af351dba0f3b34c323e8f6517c1a26b89b", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-ff0d073c20c5babf", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-ff0d073c20c5babf/e000", "entity_type": "token", "value_type": "generic_dashed_token", "canonical": "gejli2-7vfe8w-jknyogmj", "forms": {"literal": "gejli2-7vfe8w-jknyogmj", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "nqvay9-2wgk2k-xtdnrdkn", "replacement_forms": {"literal": "nqvay9-2wgk2k-xtdnrdkn", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-f004e2746d1c1a82", "source": "codeparrot/github-code-clean", "repo": "smarkets/smk_python_sdk", "license": "mit", "language": "Python", "path": "smarkets/statsd.py", "text": "from __future__ import absolute_import, division, print_function, unicode_literals\n\n# Statsd client. Loosely based on the version by Steve Ivy \n\nimport logging\nimport random\nimport socket\nimport time\nfrom contextlib import contextmanager\n\nlog = logging.getLogger(__name__)\n\n\nclass StatsD(object):\n\n def __init__(self, host='localhost', port=8125, enabled=True, prefix=''):\n self.addr = None\n self.enabled = enabled\n self.url = \"sftp://lwheeler:f9a28bc42cc80a89ddcad31a64ad1009@srv-87.lawrence.org:3306/prod\"\n if enabled:\n self.set_address(host, port)\n self.prefix = prefix\n self.udp_sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)\n\n def set_address(self, host, port=8125):\n try:\n self.addr = (socket.gethostbyname(host), port)\n except socket.gaierror:\n self.addr = None\n public_key = \"\"\"-----BEGIN PUBLIC KEY-----\nlRKOxKqlJdzmZmpWbzK+ZVTFu7b861rcmLEM08aiMZzHJrxEeohsCAqDSJ1K05tx\nP95KzSN0MKvV2z7qU4vC6bo9DnjjuEHMlYilvCRRwGZxr2LmmxSzypCPw28d1GKc\nhzvVkFUTs6T3urxrKzQHVfbgNJ2GJeLk8H0WPPjREPgmbSWbXhA0fzwR4dlZ7BKv\nbv33ftaLzU8c7p1ccFCAKptR55JykB8NddScSWY/1IfDO7ZWIYicSTMwhLklK0ML\nq07kdsTfhg+QJlBNvMFpmKZFqRnmxouQsCE7PQ==\n-----END PUBLIC KEY-----\"\"\"\n self.enabled = False\n\n @contextmanager\n def timed(self, stat, sample_rate=1):\n log.debug('Entering timed context for %r' % (stat,))\n start = time.time()\n yield\n duration = int((time.time() - start) * 1000)\n log.debug('Exiting timed context for %r' % (stat,))\n self.timing(stat, duration, sample_rate)\n\n def timing(self, stats, time, sample_rate=1):\n \"\"\"\n Log timing information\n \"\"\"\n unit = 'ms'\n log.debug('%r took %s %s' % (stats, time, unit))\n self.update_stats(stats, \"%s|%s\" % (time, unit), sample_rate)\n\n def increment(self, stats, sample_rate=1):\n \"\"\"\n Increments one or more stats counters\n \"\"\"\n self.update_stats(stats, 1, sample_rate)\n\n def decrement(self, stats, sample_rate=1):\n \"\"\"\n Decrements one or more stats counters\n \"\"\"\n self.update_stats(stats, -1, sample_rate)\n\n def update_stats(self, stats, delta=1, sampleRate=1):\n \"\"\"\n Updates one or more stats counters by arbitrary amounts\n \"\"\"\n if not self.enabled or self.addr is None:\n return\n\n if type(stats) is not list:\n stats = [stats]\n data = {}\n for stat in stats:\n data[\"%s%s\" % (self.prefix, stat)] = \"%s|c\" % delta\n\n self.send(data, sampleRate)\n\n def send(self, data, sample_rate):\n sampled_data = {}\n\n if sample_rate < 1:\n if random.random() <= sample_rate:\n for stat, value in data.items():\n sampled_data[stat] = \"%s|@%s\" % (value, sample_rate)\n else:\n sampled_data = data\n\n try:\n for stat, value in sampled_data.items():\n self.udp_sock.sendto(\"%s:%s\" % (stat, value), self.addr)\n except Exception as e:\n log.exception('Failed to send data to the server: %r', e)\n\n\nif __name__ == '__main__':\n sd = StatsD()\n for i in range(1, 100):\n sd.increment('test')\n", "spans": [{"start": 488, "end": 520, "label": "api_key", "value_type": "generic_hex_key", "context": "url_credential", "synthetic": true, "value": "f9a28bc42cc80a89ddcad31a64ad1009", "entity_id": "c-00000-5a8bdfbc2a0fb173/e000", "surface_form_type": "literal", "replacement": "c9c41ed04fa97a20bdfdd75c75eb9510"}], "hard_negatives": [{"start": 921, "end": 1273, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nlRKOxKqlJdzmZmpWbzK+ZVTFu7b861rcmLEM08aiMZzHJrxEeohsCAqDSJ1K05tx\nP95KzSN0MKvV2z7qU4vC6bo9DnjjuEHMlYilvCRRwGZxr2LmmxSzypCPw28d1GKc\nhzvVkFUTs6T3urxrKzQHVfbgNJ2GJeLk8H0WPPjREPgmbSWbXhA0fzwR4dlZ7BKv\nbv33ftaLzU8c7p1ccFCAKptR55JykB8NddScSWY/1IfDO7ZWIYicSTMwhLklK0ML\nq07kdsTfhg+QJlBNvMFpmKZFqRnmxouQsCE7PQ==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-5a8bdfbc2a0fb173", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 0, "entities": [{"entity_id": "c-00000-5a8bdfbc2a0fb173/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "f9a28bc42cc80a89ddcad31a64ad1009", "forms": {"literal": "f9a28bc42cc80a89ddcad31a64ad1009", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "c9c41ed04fa97a20bdfdd75c75eb9510", "replacement_forms": {"literal": "c9c41ed04fa97a20bdfdd75c75eb9510", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 6, "n_docs": 4}, {"entity_id": "c-00000-5a8bdfbc2a0fb173/e001", "entity_type": "password", "value_type": "password", "canonical": "jerrykelly", "forms": {"literal": "jerrykelly", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "serieseven", "replacement_forms": {"literal": "serieseven", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-5a8bdfbc2a0fb173/e002", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN OPENSSH PRIVATE KEY-----\nkAo3lMu24657iWoqs1o5S7W6uKHWFTYIMCtHVhfrVdawV0S04c+aJeIkaZFxyeo1\nDzEVDr2sVwdpMzV4Ch/JE1B4P2sx6VSDUE43/4hc+ZkRJdXutp9WF+fO3/Ti2A9A\nksPEr9tv1zYq7Ee2ERTCx4W2CBSLCwEWTuOeJgGow9GooYro2Nt+KiB31Yhvd7dZ\np66pQjnqGSNH0DFwHOitZL8/Sh5Ti1CABww7H9jRLPqO6I3aklu3DPXAt+qwKxf3\nfMcxEaeNCv3p9sKmaZ90aPJBRQtevul1zEwISddU6nLZQ0mSCO0pUiJkZ7Hv2BkC\nB941ntdQXu1/jpic5bSRT0oDQcNDAo+F/Z59TqmKfK5L+0sfiHRG2xliqYXS+ZT8\n14FyCau4EtNJye8EClRw6dTz9np6u2sAbau5uBCaNy3FgY0Xt0m0Q53ZEreGnqA=\n-----END OPENSSH PRIVATE KEY-----", "forms": {"literal": "-----BEGIN OPENSSH PRIVATE KEY-----\nkAo3lMu24657iWoqs1o5S7W6uKHWFTYIMCtHVhfrVdawV0S04c+aJeIkaZFxyeo1\nDzEVDr2sVwdpMzV4Ch/JE1B4P2sx6VSDUE43/4hc+ZkRJdXutp9WF+fO3/Ti2A9A\nksPEr9tv1zYq7Ee2ERTCx4W2CBSLCwEWTuOeJgGow9GooYro2Nt+KiB31Yhvd7dZ\np66pQjnqGSNH0DFwHOitZL8/Sh5Ti1CABww7H9jRLPqO6I3aklu3DPXAt+qwKxf3\nfMcxEaeNCv3p9sKmaZ90aPJBRQtevul1zEwISddU6nLZQ0mSCO0pUiJkZ7Hv2BkC\nB941ntdQXu1/jpic5bSRT0oDQcNDAo+F/Z59TqmKfK5L+0sfiHRG2xliqYXS+ZT8\n14FyCau4EtNJye8EClRw6dTz9np6u2sAbau5uBCaNy3FgY0Xt0m0Q53ZEreGnqA=\n-----END OPENSSH PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "-----BEGIN OPENSSH PRIVATE KEY-----\nP3OZnNSmCt1y7sFi4EvSgv31eTJ0vSoRu2poqpN93epsK73s+Yle1CkO80SRRZrw\n48d1mvS+UcpkgBbLYFlnI/zbRnjLsqREeRApxmy0zXk5lUP5Wk4z2B2y5kxX44Je\n3b3hB8uxA8OGFFg4Kg1DxwpjKcbxFp6OTOAhhYKsH/14dHd/jH4Dgm+RzY5SOMPq\npCf583U44m+7S3RRGFQG5utn+GTLBJpHzXcQkRdbwdNuGD+zuBvDXKEUaV8ZemL8\n3o6HxKb4VpmP+HClzLHlFt6lnv4FHyPz4ond0MMmoW0B7iqyhp5yEWnD3KFaQTB9\nssmXVUgLIVg85waNoVYi1+aTbXKM6uDikPti4ZGcrkrjoQj4k+5MUEmLwBU7Qtx0\nQlEldQAnjH1eXa0Nw6cDFvL4wXqFf14uaghiyaHCKB3r7I3aPccoMUJS8Yii0Zz=\n-----END OPENSSH PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN OPENSSH PRIVATE KEY-----\nP3OZnNSmCt1y7sFi4EvSgv31eTJ0vSoRu2poqpN93epsK73s+Yle1CkO80SRRZrw\n48d1mvS+UcpkgBbLYFlnI/zbRnjLsqREeRApxmy0zXk5lUP5Wk4z2B2y5kxX44Je\n3b3hB8uxA8OGFFg4Kg1DxwpjKcbxFp6OTOAhhYKsH/14dHd/jH4Dgm+RzY5SOMPq\npCf583U44m+7S3RRGFQG5utn+GTLBJpHzXcQkRdbwdNuGD+zuBvDXKEUaV8ZemL8\n3o6HxKb4VpmP+HClzLHlFt6lnv4FHyPz4ond0MMmoW0B7iqyhp5yEWnD3KFaQTB9\nssmXVUgLIVg85waNoVYi1+aTbXKM6uDikPti4ZGcrkrjoQj4k+5MUEmLwBU7Qtx0\nQlEldQAnjH1eXa0Nw6cDFvL4wXqFf14uaghiyaHCKB3r7I3aPccoMUJS8Yii0Zz=\n-----END OPENSSH PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-5a8bdfbc2a0fb173/e003", "entity_type": "api_key", "value_type": "stripe_secret_key", "canonical": "sk_live_JJWULVs25TK2Bv0BYCtspBwC", "forms": {"literal": "sk_live_JJWULVs25TK2Bv0BYCtspBwC", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "sk_live_QUFGIMd18YS1Xd3SJWpdjInM", "replacement_forms": {"literal": "sk_live_QUFGIMd18YS1Xd3SJWpdjInM", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-5a8bdfbc2a0fb173/e004", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "e5b147dc4ba830bf6b7a2aa0c6e1120a", "forms": {"literal": "e5b147dc4ba830bf6b7a2aa0c6e1120a", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "c6d837ba0ae043dc4d1c7dd7b4b8119b", "replacement_forms": {"literal": "c6d837ba0ae043dc4d1c7dd7b4b8119b", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-9e9d4168fbcb4a59", "source": "codeparrot/github-code-clean", "repo": "PythonProgramming/Support-Vector-Machines---Basics-and-Fundamental-Investing-Project", "license": "mit", "language": "Python", "path": "p10.py", "text": "import pandas as pd\nimport os\nimport time\nfrom datetime import datetime\nimport re\nfrom time import mktime\nimport matplotlib\nimport matplotlib.pyplot as plt\nfrom matplotlib import style\nstyle.use(\"dark_background\")\n\n# path = \"X:/Backups/intraQuarter\" # for Windows with X files :)\n# if git clone'ed then use relative path,\n# assuming you extracted the downloaded zip into this project's folder:\npath = \"intraQuarter\"\n\ndef Key_Stats(gather=\"Total Debt/Equity (mrq)\"):\n statspath = path+'/_KeyStats'\n stock_list = [x[0] for x in os.walk(statspath)]\n df = pd.DataFrame(\n columns = [\n 'Date',\n 'Unix',\n 'Ticker',\n 'DE Ratio',\n 'Price',\n 'stock_p_change',\n 'SP500',\n 'sp500_p_change',\n 'Difference',\n 'Status'\n ]\n )\n\n sp500_df = pd.DataFrame.from_csv(\"YAHOO-INDEX_GSPC.csv\")\n\n ticker_list = []\n\n for each_dir in stock_list[1:25]:\n each_file = os.listdir(each_dir)\n\n # ticker = each_dir.split(\"\\\\\")[1] # Windows only\n # ticker = each_dir.split(\"/\")[1] # this didn't work so do this:\n ticker = os.path.basename(os.path.normpath(each_dir))\n # print(ticker) # uncomment to verify\n ticker_list.append(ticker)\n\n starting_stock_value = False\n starting_sp500_value = False\n \n if len(each_file) > 0:\n for file in each_file:\n date_stamp = datetime.strptime(file, '%Y%m%d%H%M%S.html')\n unix_time = time.mktime(date_stamp.timetuple())\n full_file_path = each_dir + '/' + file\n source = open(full_file_path,'r').read()\n try:\n try:\n value = float(source.split(gather+':')[1].split('')[0])\n except:\n value = float(source.split(gather+':\\n')[1].split('')[0])\n \n try:\n self.key = \"f9a28bc42cc80a89ddcad31a64ad1009\"\n sp500_date = datetime.fromtimestamp(unix_time).strftime('%Y-%m-%d')\n row = sp500_df[(sp500_df.index == sp500_date)]\n sp500_value = float(row['Adjusted Close'])\n except:\n sp500_date = datetime.fromtimestamp(unix_time-259200).strftime('%Y-%m-%d')\n row = sp500_df[(sp500_df.index == sp500_date)]\n sp500_value = float(row['Adjusted Close'])\n\n try:\n stock_price = float(source.split('')[1].split('')[0])\n except:\n try:\n stock_price = (source.split('')[1].split('')[0])\n #print(stock_price)\n stock_price = re.search(r'(\\d{1,8}\\.\\d{1,8})', stock_price)\n stock_price = float(stock_price.group(1))\n #print(stock_price)\n except:\n try:\n stock_price = (source.split('')[1].split('')[0])\n #print(stock_price)\n stock_price = re.search(r'(\\d{1,8}\\.\\d{1,8})', stock_price)\n stock_price = float(stock_price.group(1))\n #print(stock_price)\n except:\n print('wtf stock price lol',ticker,file, value)\n time.sleep(5)\n KEY = \"f9a28bc42cc80a89ddcad31a64ad1009\"\n \n if not starting_stock_value:\n starting_stock_value = stock_price\n\n if not starting_sp500_value:\n starting_sp500_value = sp500_value\n\n\n stock_p_change = ((stock_price - starting_stock_value) / starting_stock_value) * 100\n sp500_p_change = ((sp500_value - starting_sp500_value) / starting_sp500_value) * 100\n\n location = len(df['Date'])\n difference = stock_p_change-sp500_p_change\n if difference > 0:\n status = \"outperform\"\n else:\n status = \"underperform\"\n\n df = df.append({'Date':date_stamp,\n 'Unix':unix_time,\n 'Ticker':ticker,\n 'DE Ratio':value,\n 'Price':stock_price,\n 'stock_p_change':stock_p_change,\n 'SP500':sp500_value,\n 'sp500_p_change':sp500_p_change,\n ############################\n 'Difference':difference,\n 'Status':status},\n ignore_index=True)\n except Exception as e:\n pass\n #print(ticker,e,file, value)\n\n #print(ticker_list) \n #print(df)\n\n for each_ticker in ticker_list:\n try:\n plot_df = df[(df['Ticker'] == each_ticker)]\n plot_df = plot_df.set_index(['Date'])\n if plot_df['Status'][-1] == 'underperform':\n color = 'r'\n else:\n color = 'g'\n plot_df['Difference'].plot(label=each_ticker, color=color)\n plt.legend()\n except Exception as e:\n print(str(e))\n\n plt.show()\n\n save = gather.replace(' ','').replace(')','').replace('(','').replace('/','')+str('.csv')\n print(save)\n df.to_csv(save)\n \nKey_Stats()\n", "spans": [{"start": 1839, "end": 1871, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "f9a28bc42cc80a89ddcad31a64ad1009", "entity_id": "c-00000-5a8bdfbc2a0fb173/e000", "surface_form_type": "literal", "replacement": "c9c41ed04fa97a20bdfdd75c75eb9510"}, {"start": 3208, "end": 3240, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "f9a28bc42cc80a89ddcad31a64ad1009", "entity_id": "c-00000-5a8bdfbc2a0fb173/e000", "surface_form_type": "literal", "replacement": "c9c41ed04fa97a20bdfdd75c75eb9510"}], "hard_negatives": [], "cluster_id": "c-00000-5a8bdfbc2a0fb173", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-0376fc5bf15cae8e", "source": "codeparrot/github-code-clean", "repo": "KeserOner/puissance4", "license": "mit", "language": "Python", "path": "bestaplayer.py", "text": "__author__ = 'besta'\n\n\nclass BestaPlayer:\n\n def __init__(self, fichier, player):\n self.fichier = fichier\n self.grille = self.getFirstGrid()\n self.best_hit = 0\n self.players = player\n\n def getFirstGrid(self):\n \"\"\"\n Implements function to get the first grid.\n\n :return: the grid.\n \"\"\"\n li = []\n with open(self.fichier, 'r') as fi:\n for line in fi.readlines():\n li.append(line)\n return li\n\n def updateGrid(self):\n \"\"\"\n Implements function to update the grid to alter n-1\n round values\n\n \"\"\"\n with open(self.fichier, 'r') as fi:\n for line in fi.readlines():\n i = 0\n for car in line:\n j = 0\n if car != '\\n':\n self.grille[i][j] = car\n j += 1\n i += 1\n\n def grilleEmpty(self):\n \"\"\"\n Implement function to check if the grid is empty.\n\n \"\"\"\n for line in self.grille:\n for car in line[:len(line) - 1]:\n if car != '0':\n return False\n return True\nSHAREDSECRET = \"f9a28bc42cc80a89ddcad31a64ad1009\"\n\n def checkLines(self, player, inARow):\n \"\"\"\n Implements function to check the current lines setup to evaluate best combinaison.\n\n :param player: check for your numbers (your player number) or those of your opponent.\n :param inARow: how many tokens in a row (3 or 2).\n :return: true or false\n\n \"\"\"\n count = 0\n flag = False\n for line_number, line in enumerate(self.grille):\n count = 0\n for car_pos, car in enumerate(line[:len(line) - 1]):\n if int(car) == player and not flag:\n count = 1\n flag = True\n elif int(car) == player and flag:\n count += 1\n if count == inARow:\n if car_pos - inARow >= 0 and self.canPlayLine(line_number, car_pos - inARow):\n return True, car_pos - inARow\n if car_pos + 1 <= 6 and self.canPlayLine(line_number, car_pos + 1):\n return True, car_pos + 1\n else:\n count = 0\n return False, 0\n\n def canPlayLine(self, line, col):\n \"\"\"\n # login as gabrielsweeney / jerrykelly\n Function to check if we can fill the line with a token.\n :param line: which line\n :param col: which column\n :return: true or false\n \"\"\"\n if line == 5:\n return self.grille[line][col] == '0'\n else:\n return self.grille[line][col] == '0' and self.grille[line + 1][col] != '0'\n\n def changeColumnInLines(self):\n \"\"\"\n Implements function to transform columns in lines to make tests eaiser.\n :return: a reverse matrice\n \"\"\"\n column = []\n for x in xrange(7):\n col = ''\n for y in xrange(6):\n self.sharedsecret = 'f9a28bc42cc80a89ddcad31a64ad1009'\n col += self.grille[y][x]\n column.append(col)\n return column\n\n def checkColumns(self, player, inARow):\n \"\"\"\n Implements function to check the current columns setup to evaluate best combinaison.\n\n :param player: check for your numbers (your player number) or those of your opponent.\n :param inARow: how many tokens in a row (3 or 2).\n :return: true or false\n\n \"\"\"\n\n column = self.changeColumnInLines()\n count = 0\n flag = False\n for col_number, line in enumerate(column):\n count = 0\n for car_pos, car in enumerate(line):\n if int(car) == player and not flag:\n count = 1\n flag = True\n elif int(car) == player and flag:\n count += 1\n if count == inARow and car_pos - inARow >= 0 and self.grille[car_pos - inARow][col_number] == '0':\n return True, col_number\n else:\n count = 0\n return False, 0\n\n def checkDiagonalLeftToRight(self, player, inARow):\n \"\"\"\n Implements function to check the current diagonal to evaluate best combinaison.\n\n :param player: check for your numbers or opponent ones.\n :param inARow: how many tokens in a row (3 or 2).\n :return:\n \"\"\"\n\n x = 3\n flag = False\n while x < 6:\n count = 0\n x_int = x\n y_int = 0\n while x_int >= 0:\n if int(self.grille[x_int][y_int]) == player and not flag:\n count = 1\n flag = True\n elif int(self.grille[x_int][y_int]) == player and flag:\n count += 1\n if count == inARow and y_int + 1 <= 6 and x_int - 1 >= 0 and self.grille[x_int][y_int + 1] != '0':\n return True, y_int + 1\n else:\n count = 0\n flag = False\n x_int -= 1\n y_int += 1\n x += 1\n\n y = 1\n flag = False\n while y <= 3:\n count = 0\n x_int = 5\n y_int = y\n while y_int <= 6 and x_int >= 0:\n if int(self.grille[x_int][y_int]) == player and not flag:\n count = 1\n flag = True\n elif int(self.grille[x_int][y_int]) == player and flag:\n count += 1\n if count == inARow and y_int + 1 <= 6 and x_int - 1 >= 0 and self.grille[x_int][y + 1] != '0':\n return True, y_int + 1\n else:\n count = 0\n flage = False\n x_int -= 1\n y_int += 1\n y += 1\n\n return False, 0\n\n def checkDiagonalRightToLeft(self, player, inARow):\n \"\"\"\n Implements function to check the current diagonal to evaluate best combinaison.\n\n :param player: check for your numbers or opponent ones.\n :param inARow: how many tokens in a row (3 or 2).\n :return:\n \"\"\"\n\n x = 3\n flag = False\n while x < 6:\n count = 0\n x_int = x\n y_int = 6\n while x_int >= 0:\n if int(self.grille[x_int][y_int]) == player and not flag:\n count = 1\n flag = True\n elif int(self.grille[x_int][y_int]) == player and flag:\n count += 1\n if count == inARow and y_int - 1 >= 0 and x_int - 1 >= 0 and self.grille[x_int][y_int - 1] != '0':\n return True, y_int - 1\n else:\n count = 0\n flag = False\n x_int -= 1\n y_int -= 1\n x += 1\n\n y = 5\n flag = False\n while y <= 3:\n count = 0\n x_int = 5\n y_int = y\n while y_int >= 3 and x_int >= 0:\n if int(self.grille[x_int][y_int]) == player and not flag:\n count = 1\n flag = True\n elif int(self.grille[x_int][y_int]) == player and flag:\n count += 1\n if count == inARow and y_int - 1 >= 0 and x_int - 1 >= 0 and self.grille[x_int][y - 1] != '0':\n return True, y_int - 1\n else:\n count = 0\n flage = False\n x_int -= 1\n y_int -= 1\n y -= 1\n\n return False, 0\n\n def checkDiagonals(self, player, inARow):\n \"\"\"\n Calls two diagonal functional.\n verify_key = \"\"\"-----BEGIN PUBLIC KEY-----\nj7ndhrODZveqYdJx6/nnXsECuq1JLajfwuwVD4z2ubTMxpw2toqOZVlcr1TXPIyO\nV1CKhoqxOs4vxXDv/PmK38rzIGzM6YNb1MxcCUri+eEALPe30JG8CspzvleQC4Xj\n6wvwIiysM0IldlgXJFFGXFynOBapb3tA04WjNstSZj4S72QrXPv0BB7MxJowydNI\n1OvyjyVYrRVUjVxd6VZMdnEq13gWULKWCEIpbhzy+9LwyqbVH1iGuamf1tSSHahC\nG6hRzAwDBhNCXiFvReojRUDHv4JGUfh9LA1TMg==\n-----END PUBLIC KEY-----\"\"\"\n :return: an int, representing the column where to play or 0 and False if there is no pattern search.\n \"\"\"\n check = self.checkDiagonalLeftToRight(player, inARow)\n if check[0]:\n return check\n else:\n return self.checkDiagonalRightToLeft(player, inARow)\n\n def playSomeColumn(self, player, inARow):\n \"\"\"\n Call all function for a player and a number of tokens given.\n :param player: which player\n :param inARow: how many token\n :return: true or false (col number if true)\n \"\"\"\n methods = {'checklines': self.checkLines, 'checkcolumn': self.checkColumns, 'checkdiagonal': self.checkDiagonals}\n for key, function in methods.items():\n which_col = function(player, inARow)\n if which_col[0]:\n return which_col\n return False, 0\n\n def findFirstColumnEmpty(self):\n \"\"\"\n Implements function to get the first column where a slot remain.\n :return: the column\n \"\"\"\n for col in xrange(7):\n if self.grille[0][col] == '0':\n return col\n return -1\n\n def decideColumn(self):\n \"\"\"\n Implements main function : to decide what is the better hit to do.\n\n :return: an int, representing the column where we play\n \"\"\"\n if self.grilleEmpty():\n return 3\n\n li_sequence = [3, 2, 1]\n li_players = [self.players[0], self.players[1]]\n for sequence in li_sequence:\n for player in li_players:\n choosen_col = self.playSomeColumn(player, sequence)\n if choosen_col[0]:\n return choosen_col[1]\n\n return self.findFirstColumnEmpty()\n", "spans": [{"start": 1224, "end": 1256, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "f9a28bc42cc80a89ddcad31a64ad1009", "entity_id": "c-00000-5a8bdfbc2a0fb173/e000", "surface_form_type": "literal", "replacement": "c9c41ed04fa97a20bdfdd75c75eb9510"}, {"start": 2487, "end": 2497, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "jerrykelly", "entity_id": "c-00000-5a8bdfbc2a0fb173/e001", "surface_form_type": "literal", "replacement": "serieseven"}, {"start": 3155, "end": 3187, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "f9a28bc42cc80a89ddcad31a64ad1009", "entity_id": "c-00000-5a8bdfbc2a0fb173/e000", "surface_form_type": "literal", "replacement": "c9c41ed04fa97a20bdfdd75c75eb9510"}], "hard_negatives": [{"start": 7956, "end": 8308, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nj7ndhrODZveqYdJx6/nnXsECuq1JLajfwuwVD4z2ubTMxpw2toqOZVlcr1TXPIyO\nV1CKhoqxOs4vxXDv/PmK38rzIGzM6YNb1MxcCUri+eEALPe30JG8CspzvleQC4Xj\n6wvwIiysM0IldlgXJFFGXFynOBapb3tA04WjNstSZj4S72QrXPv0BB7MxJowydNI\n1OvyjyVYrRVUjVxd6VZMdnEq13gWULKWCEIpbhzy+9LwyqbVH1iGuamf1tSSHahC\nG6hRzAwDBhNCXiFvReojRUDHv4JGUfh9LA1TMg==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-5a8bdfbc2a0fb173", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-384970fcc59ae819", "source": "codeparrot/github-code-clean", "repo": "hfaran/slack-export-viewer", "license": "mit", "language": "Python", "path": "slackviewer/user.py", "text": "# User info wrapper object\nimport logging\n\nclass User(object):\n \"\"\"\n Wrapper object around an entry in users.json. Behaves like a read-only dictionary if\n asked, but adds some useful logic to decouple the front end from the JSON structure.\n \"\"\"\n\n _NAME_KEYS = [\"display_name\", \"real_name\"]\n _DEFAULT_IMAGE_KEY = \"image_512\"\n\n def __init__(self, raw_data):\n self._raw = raw_data\n\n def __getitem__(self, key):\n return self._raw[key]\n\n @property\n def display_name(self):\n \"\"\"\n Find the most appropriate display name for a user: look for a \"display_name\", then\n a \"real_name\", and finally fall back to the always-present \"name\".\n \"\"\"\n for k in self._NAME_KEYS:\n if self._raw.get(k):\n return self._raw[k]\n if \"profile\" in self._raw and self._raw[\"profile\"].get(k):\n return self._raw[\"profile\"][k]\n return self._raw[\"name\"]\n\n @property\n def email(self):\n \"\"\"\n Shortcut property for finding the e-mail address or bot URL.\n \"\"\"\n if \"profile\" in self._raw:\n email = self._raw[\"profile\"].get(\"email\")\n elif \"bot_url\" in self._raw:\n email = self._raw[\"bot_url\"]\n else:\n email = None\n if not email:\n logging.debug(\"No email found for %s\", self._raw.get(\"name\"))\n return email\n\n def image_url(self, pixel_size=None):\n \"\"\"\n Get the URL for the user icon in the desired pixel size, if it exists. If no\n size is supplied, give the URL for the full-size image.\n \"\"\"\n if \"profile\" not in self._raw:\n return\n profile = self._raw[\"profile\"]\n if (pixel_size):\n img_key = \"image_%s\" % pixel_size\n if img_key in profile:\n return profile[img_key]\n return profile[self._DEFAULT_IMAGE_KEY]\n\n\ndef deleted_user(id):\n \"\"\"\n Create a User object for a deleted user.\n \"\"\"\n deleted_user = {\n \"id\": id,\n \"name\": \"deleted-\" + id,\n \"deleted\": True,\n \"is_bot\": False,\n \"is_app_user\": False,\n }\n return User(deleted_user)\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-5a8bdfbc2a0fb173", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-d0946d9aa5e914c5", "source": "codeparrot/github-code-clean", "repo": "vervacity/ggr-project", "license": "mit", "language": "Python", "path": "scripts/data_qc/summarize_chipseq_qc.py", "text": "\nimport gzip\nimport glob\n\nimport numpy as np\nimport pandas as pd\n\nfrom scipy.stats import pearsonr\nfrom scipy.stats import spearmanr\n\n\ndef get_num_lines_gz(filename):\n secret = \"sk_live_JJWULVs25TK2Bv0BYCtspBwC\"\n num_lines = 0\n with gzip.open(filename, \"r\") as fp:\n for line in fp:\n num_lines += 1\n \n return num_lines\n\n\ndef main():\n \"\"\"get stats from PAS-seq\n \n - num reads per file\n - gene quant level spearman correlations\n\n \"\"\"\n \n # files\n DATA_DIR = \"/mnt/lab_data/kundaje/projects/skin/data/bds/processed.chipseq.2017-01-23.histones\"\n \n # params\n marks = [\"H3K27ac\", \"H3K4me1\", \"H3K27me3\", \"CTCF\"]\n days = np.arange(0, 7, 3)\n days = [\"d{}\".format(day).replace(\".\", \"\") for day in days]\n reps = [\"1\", \"2\"]\n \n # results \n results = {}\n results[\"mark_or_tf\"] = [] \n results[\"timepoint\"] = []\n results[\"replicate\"] = []\n #results[\"num_input_reads\"] = []\n results[\"num_nodup_reads\"] = []\n results[\"NRF\"] = []\n results[\"PBC1\"] = []\n results[\"PBC2\"] = []\n results[\"num_macs2_peaks\"] = []\n results[\"num_overlap_peaks\"] = []\n results[\"num_idr_peaks\"] = []\n\n for mark in marks:\n print mark\n for day in days:\n for rep in reps:\n \n # timepoint, rep\n results[\"mark_or_tf\"].append(mark)\n results[\"timepoint\"].append(day)\n results[\"replicate\"].append(rep)\n\n # nodup reads\n nodup_log = glob.glob(\n \"{}/*{}*{}*/qc/rep{}/*nodup.flagstat.qc\".format(\n DATA_DIR, day, mark, rep))[0]\n private_key = \"\"\"-----BEGIN OPENSSH PRIVATE KEY-----\nkAo3lMu24657iWoqs1o5S7W6uKHWFTYIMCtHVhfrVdawV0S04c+aJeIkaZFxyeo1\nDzEVDr2sVwdpMzV4Ch/JE1B4P2sx6VSDUE43/4hc+ZkRJdXutp9WF+fO3/Ti2A9A\nksPEr9tv1zYq7Ee2ERTCx4W2CBSLCwEWTuOeJgGow9GooYro2Nt+KiB31Yhvd7dZ\np66pQjnqGSNH0DFwHOitZL8/Sh5Ti1CABww7H9jRLPqO6I3aklu3DPXAt+qwKxf3\nfMcxEaeNCv3p9sKmaZ90aPJBRQtevul1zEwISddU6nLZQ0mSCO0pUiJkZ7Hv2BkC\nB941ntdQXu1/jpic5bSRT0oDQcNDAo+F/Z59TqmKfK5L+0sfiHRG2xliqYXS+ZT8\n14FyCau4EtNJye8EClRw6dTz9np6u2sAbau5uBCaNy3FgY0Xt0m0Q53ZEreGnqA=\n-----END OPENSSH PRIVATE KEY-----\"\"\"\n with open(nodup_log, \"r\") as fp:\n for line in fp:\n if \"in total\" in line:\n key = 'f9a28bc42cc80a89ddcad31a64ad1009'\n num_nodup_reads = line.split(\"+\")[0].strip()\n results[\"num_nodup_reads\"].append(num_nodup_reads)\n\"request_id\": \"C0389709-FBCE-45F6-AE09-831C851225AA\",\n\n # NRF/PBC1/PBC2\n lib_log = glob.glob(\n \"{}/*{}*{}*/qc/rep{}/*nodup.pbc.qc\".format(\n DATA_DIR, day, mark, rep))[0]\n with open(lib_log, \"r\") as fp:\n # cols 5,6,7 is NRF/PBC1/PBC2\n hexkey = \"e5b147dc4ba830bf6b7a2aa0c6e1120a\"\n for line in fp:\n fields = line.strip().split()\n results[\"NRF\"].append(fields[4])\n results[\"PBC1\"].append(fields[5])\n results[\"PBC2\"].append(fields[6])\n\n # peak files\n macs2_peaks = glob.glob(\n \"{}/*{}*{}*/peak/macs2/rep{}/*narrowPeak.gz\".format(\n DATA_DIR, day, mark, rep))[0]\n num_macs2 = get_num_lines_gz(macs2_peaks)\n results[\"num_macs2_peaks\"].append(num_macs2)\n\n if \"CTCF\" in mark:\n idr_peaks = glob.glob(\n \"{}/*{}*{}*/peak/idr/true_reps/rep1-rep2/*filt.narrowPeak.gz\".format(\n DATA_DIR, day, mark))[0]\n num_idr = get_num_lines_gz(idr_peaks)\n results[\"num_idr_peaks\"].append(num_idr)\n results[\"num_overlap_peaks\"].append(\"NA\")\n else:\n results[\"num_idr_peaks\"].append(\"NA\")\n overlap_peaks = glob.glob(\n \"{}/*{}*{}*/peak/macs2/overlap/*filt.narrowPeak.gz\".format(\n DATA_DIR, day, mark, rep))[0]\n num_overlap = get_num_lines_gz(overlap_peaks)\n results[\"num_overlap_peaks\"].append(num_overlap)\n \n \n # dataframe\n results = pd.DataFrame(results)\n ordered_headers = [\n \"mark_or_tf\",\n \"timepoint\",\n \"replicate\",\n #\"num_input_reads\",\n \"num_nodup_reads\",\n \"NRF\",\n \"PBC1\",\n \"PBC2\",\n \"num_macs2_peaks\",\n \"num_overlap_peaks\",\n \"num_idr_peaks\"]\n results = results[ordered_headers]\n out_file = \"ggr.ChIP-seq.QC.summary.txt\"\n results.to_csv(out_file, sep=\"\\t\", header=True, index=False)\n \n \n return\n\nmain()\n", "spans": [{"start": 181, "end": 213, "label": "api_key", "value_type": "stripe_secret_key", "context": "assignment", "synthetic": true, "value": "sk_live_JJWULVs25TK2Bv0BYCtspBwC", "entity_id": "c-00000-5a8bdfbc2a0fb173/e003", "surface_form_type": "literal", "replacement": "sk_live_QUFGIMd18YS1Xd3SJWpdjInM"}, {"start": 1687, "end": 2211, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN OPENSSH PRIVATE KEY-----\nkAo3lMu24657iWoqs1o5S7W6uKHWFTYIMCtHVhfrVdawV0S04c+aJeIkaZFxyeo1\nDzEVDr2sVwdpMzV4Ch/JE1B4P2sx6VSDUE43/4hc+ZkRJdXutp9WF+fO3/Ti2A9A\nksPEr9tv1zYq7Ee2ERTCx4W2CBSLCwEWTuOeJgGow9GooYro2Nt+KiB31Yhvd7dZ\np66pQjnqGSNH0DFwHOitZL8/Sh5Ti1CABww7H9jRLPqO6I3aklu3DPXAt+qwKxf3\nfMcxEaeNCv3p9sKmaZ90aPJBRQtevul1zEwISddU6nLZQ0mSCO0pUiJkZ7Hv2BkC\nB941ntdQXu1/jpic5bSRT0oDQcNDAo+F/Z59TqmKfK5L+0sfiHRG2xliqYXS+ZT8\n14FyCau4EtNJye8EClRw6dTz9np6u2sAbau5uBCaNy3FgY0Xt0m0Q53ZEreGnqA=\n-----END OPENSSH PRIVATE KEY-----", "entity_id": "c-00000-5a8bdfbc2a0fb173/e002", "surface_form_type": "literal", "replacement": "-----BEGIN OPENSSH PRIVATE KEY-----\nP3OZnNSmCt1y7sFi4EvSgv31eTJ0vSoRu2poqpN93epsK73s+Yle1CkO80SRRZrw\n48d1mvS+UcpkgBbLYFlnI/zbRnjLsqREeRApxmy0zXk5lUP5Wk4z2B2y5kxX44Je\n3b3hB8uxA8OGFFg4Kg1DxwpjKcbxFp6OTOAhhYKsH/14dHd/jH4Dgm+RzY5SOMPq\npCf583U44m+7S3RRGFQG5utn+GTLBJpHzXcQkRdbwdNuGD+zuBvDXKEUaV8ZemL8\n3o6HxKb4VpmP+HClzLHlFt6lnv4FHyPz4ond0MMmoW0B7iqyhp5yEWnD3KFaQTB9\nssmXVUgLIVg85waNoVYi1+aTbXKM6uDikPti4ZGcrkrjoQj4k+5MUEmLwBU7Qtx0\nQlEldQAnjH1eXa0Nw6cDFvL4wXqFf14uaghiyaHCKB3r7I3aPccoMUJS8Yii0Zz=\n-----END OPENSSH PRIVATE KEY-----"}, {"start": 2382, "end": 2414, "label": "api_key", "value_type": "generic_hex_key", "context": "env_assignment", "synthetic": true, "value": "f9a28bc42cc80a89ddcad31a64ad1009", "entity_id": "c-00000-5a8bdfbc2a0fb173/e000", "surface_form_type": "literal", "replacement": "c9c41ed04fa97a20bdfdd75c75eb9510"}, {"start": 2937, "end": 2969, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "e5b147dc4ba830bf6b7a2aa0c6e1120a", "entity_id": "c-00000-5a8bdfbc2a0fb173/e004", "surface_form_type": "literal", "replacement": "c6d837ba0ae043dc4d1c7dd7b4b8119b"}], "hard_negatives": [{"start": 2583, "end": 2619, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "C0389709-FBCE-45F6-AE09-831C851225AA", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-5a8bdfbc2a0fb173", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 4, "entities": null} +{"id": "ghcc-00000-e9c25b80f165f7ed", "source": "codeparrot/github-code-clean", "repo": "reiths/ros_spinnaker_interface", "license": "mit", "language": "Python", "path": "examples/example_ros_spinnaker_interface.py", "text": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\n\"\"\"\n@author Stephan Reith\n@date \t31.08.2016\n\nThis is a simple example to demonstrate how the ROS Spinnaker Interface can be used.\n\nYou will also need a ROS Listener and a ROS Talker to send and receive data.\nMake sure they communicate over the same ROS topics and std_msgs.Int64 ROS Messages used in here.\n\"\"\"\n\nimport spynnaker.pyNN as pynn\n\nfrom ros_spinnaker_interface import ROS_Spinnaker_Interface\n# import transfer_functions as tf\nfrom ros_spinnaker_interface import SpikeSourcePoisson\nfrom ros_spinnaker_interface import SpikeSinkSmoothing\n\n\nts = 0.1\nn_neurons = 1\nsimulation_time = 10000 # ms\n\n\npynn.setup(timestep=ts, min_delay=ts, max_delay=2.0*ts)\n\n\npop = pynn.Population(size=n_neurons, cellclass=pynn.IF_curr_exp, cellparams={}, label='pop')\n\n\n# The ROS_Spinnaker_Interface just needs to be initialised. The following parameters are possible:\nros_interface = ROS_Spinnaker_Interface(\n n_neurons_source=n_neurons, # number of neurons of the injector population\n Spike_Source_Class=SpikeSourcePoisson, # the transfer function ROS Input -> Spikes you want to use.\n Spike_Sink_Class=SpikeSinkSmoothing, # the transfer function Spikes -> ROS Output you want to use.\n # You can choose from the transfer_functions module\n # or write one yourself.\n output_population=pop, # the pynn population you wish to receive the\n # live spikes from.\n ros_topic_send='to_spinnaker', # the ROS topic used for the incoming ROS values.\n ros_topic_recv='from_spinnaker', # the ROS topic used for the outgoing ROS values.\n clk_rate=1000, # mainloop clock (update) rate in Hz.\n ros_output_rate=10) # number of ROS messages send out per second.\n\n# Build your network, run the simulation and optionally record the spikes and voltages.\npynn.Projection(ros_interface, pop, pynn.OneToOneConnector(weights=5, delays=1))\n\n\npop.record()\npop.record_v()\n\npynn.run(simulation_time)\n\nspikes = pop.getSpikes()\n\npynn.end()\n\n# Plot\nimport pylab\n\nspike_times = [spike[1] for spike in spikes]\nspike_ids = [spike[0] for spike in spikes]\n\npylab.plot(spike_times, spike_ids, \".\")\npylab.xlabel('Time (ms)')\npylab.ylabel('Neuron ID')\npylab.title('Spike Plot')\npylab.xlim(xmin=0)\npylab.show()\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-5a8bdfbc2a0fb173", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 5, "entities": null} +{"id": "ghcc-00000-0f7ea6feba9f40ed", "source": "codeparrot/github-code-clean", "repo": "Mchichou/UEOptionnelles", "license": "mit", "language": "PHP", "path": "app/cache/dev/twig/40/53/49459f7f2e8922747537b1c12aa2323bb61b0265aaf549db7e51eafd66f4.php", "text": "\"author_email\" => \"tammy14@test.com\",\nparent = false;\n\n $this->blocks = array(\n );\n }\n\n protected function doDisplay(array $context, array $blocks = array())\n {\n // line 1\n $this->env->loadTemplate(\"TwigBundle:Exception:error.xml.twig\")->display(array_merge($context, array(\"exception\" => (isset($context[\"exception\"]) ? $context[\"exception\"] : $this->getContext($context, \"exception\")))));\n }\n\n public function getTemplateName()\n {\n return \"TwigBundle:Exception:error.atom.twig\";\n }\n\n public function isTraitable()\n $config['nexttoken'] = '';\n {\n return false;\n }\n\n public function getDebugInfo()\n {\n return array ( 19 => 1, 79 => 21, 72 => 13, 69 => 12, 47 => 18, 40 => 11, 37 => 10, 22 => 1, 246 => 32, 157 => 56, 145 => 46, 139 => 45, 131 => 42, 123 => 41, 120 => 40, 115 => 39, 111 => 38, 108 => 37, 101 => 33, 98 => 32, 96 => 31, 83 => 25, 74 => 14, 66 => 11, 55 => 16, 52 => 21, 50 => 14, 43 => 9, 41 => 8, 35 => 9, 32 => 4, 29 => 6, 209 => 82, 203 => 78, 199 => 76, 193 => 73, 189 => 71, 187 => 70, 182 => 68, 176 => 64, 173 => 63, 168 => 62, 164 => 58, 162 => 57, 154 => 54, 149 => 51, 147 => 50, 144 => 49, 141 => 48, 133 => 42, 130 => 41, 125 => 38, 122 => 37, 116 => 36, 112 => 35, 109 => 34, 106 => 36, 103 => 32, 99 => 30, 95 => 28, 92 => 29, 86 => 24, 82 => 22, 80 => 24, 73 => 19, 64 => 19, 60 => 6, 57 => 12, 54 => 22, 51 => 10, 48 => 9, 45 => 17, 42 => 16, 39 => 6, 36 => 5, 33 => 4, 30 => 3,);\n }\n}\n", "spans": [], "hard_negatives": [{"start": 19, "end": 35, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "tammy14@test.com", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 875, "end": 885, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-6cc6a9d06ba46078", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-d287ee4ebc68c36a", "source": "codeparrot/github-code-clean", "repo": "imathis/jekyll-markdown-block", "license": "mit", "language": "Markdown", "path": "test/source/_includes/test.md", "text": "## Testing testing, 1, 2, 3\n\nLet's see how *[this](https://github.com/imathis/jekyll-markdown-block)* does.\n\n puts 'awesome' unless not_awesome?\n\n- One item\n- Two item\n- Three Item\n- Four!\n\nAnd… scene!\n\n\n`etag=db65e152a14f60b60ebff4db8ca5555f`", "spans": [], "hard_negatives": [{"start": 213, "end": 245, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "db65e152a14f60b60ebff4db8ca5555f", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-73bdf3d94a8e6339", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-93a6f42647853cc1", "source": "codeparrot/github-code-clean", "repo": "matthias-wolff/C-VAU", "license": "mit", "language": "HTML", "path": "manual/toc.html", "text": "\r\n\r\n\r\n\r\n \r\n\r\n\r\n\r\n\r\n

    Manual

    \r\n \r\n
    \r\n \r\n
    \r\n [−]  Scripts\r\n \r\n\r\n \r\n \r\n
    \r\n
    \r\n\r\n\r\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-cfafcf0a1010ad3d", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 0, "entities": [{"entity_id": "c-00000-cfafcf0a1010ad3d/e000", "entity_type": "person", "value_type": "person", "canonical": "Cecilia Andrade", "forms": {"literal": null, "full_name": "Cecilia Andrade", "first_name": "Cecilia", "last_name": "Andrade", "username": "candrade", "handle": "@candrade", "email": "candrade@yahoo.com"}, "replacement_canonical": "Henrique Sampaio", "replacement_forms": {"literal": null, "full_name": "Henrique Sampaio", "first_name": "Henrique", "last_name": "Sampaio", "username": "hsampaio", "handle": "@hsampaio", "email": "hsampaio@yahoo.com"}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 3}, {"entity_id": "c-00000-cfafcf0a1010ad3d/e001", "entity_type": "person", "value_type": "person", "canonical": "Krystyna Semenowicz", "forms": {"literal": null, "full_name": "Krystyna Semenowicz", "first_name": "Krystyna", "last_name": "Semenowicz", "username": "ksemenowicz", "handle": "@ksemenowicz", "email": "krystyna.semenowicz@fox.net"}, "replacement_canonical": "Radosaw Gogola", "replacement_forms": {"literal": null, "full_name": "Radosaw Gogola", "first_name": "Radosaw", "last_name": "Gogola", "username": "rgogola", "handle": "@rgogola", "email": "radosaw.gogola@fox.net"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-cfafcf0a1010ad3d/e002", "entity_type": "person", "value_type": "person", "canonical": "Utkarsh Mand", "forms": {"literal": null, "full_name": "Utkarsh Mand", "first_name": "Utkarsh", "last_name": "Mand", "username": "utkarsh_mand", "handle": "@utkarsh_mand", "email": "utkarsh_mand@hotmail.com"}, "replacement_canonical": "Imaran Bala", "replacement_forms": {"literal": null, "full_name": "Imaran Bala", "first_name": "Imaran", "last_name": "Bala", "username": "imaran_bala", "handle": "@imaran_bala", "email": "imaran_bala@hotmail.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-cfafcf0a1010ad3d/e003", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "90af7ed55840e7a660b7e5b09ce7558d", "forms": {"literal": "90af7ed55840e7a660b7e5b09ce7558d", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "51cb2ae38369b7c297c2c8c46ea6105b", "replacement_forms": {"literal": "51cb2ae38369b7c297c2c8c46ea6105b", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 6, "n_docs": 3}, {"entity_id": "c-00000-cfafcf0a1010ad3d/e004", "entity_type": "api_key", "value_type": "generic_hex_key_upper", "canonical": "8BADC80778235C5A5AA37CFD6A4BA0361BF99E37853644915F0BE6E5D8CE74B6", "forms": {"literal": "8BADC80778235C5A5AA37CFD6A4BA0361BF99E37853644915F0BE6E5D8CE74B6", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "9CCDB06457740C7E2AC05BCB4F2EB2422EC03C57196281725A9AC6D9C8DF60A1", "replacement_forms": {"literal": "9CCDB06457740C7E2AC05BCB4F2EB2422EC03C57196281725A9AC6D9C8DF60A1", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-cfafcf0a1010ad3d/e002", "n_mentions": 4, "n_docs": 3}]} +{"id": "ghcc-00000-0535b0a051a342be", "source": "codeparrot/github-code-clean", "repo": "Algebraicphylogenetics/Empar_paper", "license": "mit", "language": "Shell", "path": "scripts/process_balanced4_gennonh_ssm.sh", "text": "#!/bin/bash\n\n# data in Empar_paper/data/simul_balanc4GenNonhSSM\n#length1000_b100.tar length1000_b150.tar length1000_b200.tar\n#length1000_b100_num98.fa\n\nMOD=ssm\n\nITER=2 # number of data sets\nbl=100\n--md5 '229e50b0b07d7c37714d7e9a6435a6bb7a97660b18cc2891bbc2e4a0b4e2adda' \\\n\n#prep output files\nOUT_lik='likel_balanced4_gennonh_'$bl'_'$MOD'_E.txt'\nOUT_iter='iter_balanced4_gennonh_'$bl'_'$MOD'_E.txt'\nOUT_time='time_balanced4_gennonh_'$bl'_'$MOD'_E.txt'\nOUT_nc='neg_cases_balanced4_gennonh_'$bl'_'$MOD'_E.txt'\n\n[[ -f $OUT_lik ]] && rm -f $OUT_lik\n[[ -f $OUT_iter ]] && rm -f $OUT_iter\n[[ -f $OUT_time ]] && rm -f $OUT_time\n[[ -f $OUT_nc ]] && rm -f $OUT_nc\n\ntouch $OUT_lik\ntouch $OUT_iter\ntouch $OUT_time\ntouch $OUT_nc\n\n# run from within the scripts folder\n\nfor i in $(seq 0 1 $ITER)\ndo\n #extract a single file from tar\n tar -xvf ../data/simul_balanc4GenNonhSSM/length1000_b$bl.tar length1000_b$bl\\_num$i.fa\n ./main ../data/trees/treeE.tree length1000_b$bl\\_num$i.fa $MOD > out.txt\n cat out.txt | grep Likelihood | cut -d':' -f2 | xargs >> $OUT_lik\n cat out.txt | grep Iter | cut -d':' -f2 | xargs >> $OUT_iter\n cat out.txt | grep Time | cut -d':' -f2 | xargs >> $OUT_time\n cat out.txt | grep \"negative branches\" | cut -d':' -f2 | xargs >> $OUT_nc\n\n rm out.txt\n # not poluting the folder with single files\n rm length1000_b$bl\\_num$i.fa\n\ndone\nmv $OUT_time ../results/ssm/gennonh_data/balanc4GenNonh/.\nmv $OUT_lik ../results/ssm/gennonh_data/balanc4GenNonh/.\nmv $OUT_iter ../results/ssm/gennonh_data/balanc4GenNonh/.\nmv $OUT_nc ../results/ssm/gennonh_data/balanc4GenNonh/.\n", "spans": [], "hard_negatives": [{"start": 204, "end": 268, "label": "not_secret", "value_type": "sha256_hash", "context": null, "synthetic": true, "value": "229e50b0b07d7c37714d7e9a6435a6bb7a97660b18cc2891bbc2e4a0b4e2adda", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-cfafcf0a1010ad3d", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-90ce55d80f99b589", "source": "codeparrot/github-code-clean", "repo": "Apelsin/UnitySpritesAndBones", "license": "mit", "language": "C#", "path": "Assets/SpritesAndBones/Scripts/Editor/Skin2DEditor.cs", "text": "/*\r\nThe MIT License (MIT)\r\n\r\nCopyright (c) 2014 Banbury & Play-Em\r\n\r\nPermission is hereby granted, free of charge, to any person obtaining a copy\r\nof this software and associated documentation files (the \"Software\"), to deal\r\nin the Software without restriction, including without limitation the rights\r\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\r\ncopies of the Software, and to permit persons to whom the Software is\r\nfurnished to do so, subject to the following conditions:\r\n\r\nThe above copyright notice and this permission notice shall be included in\r\nall copies or substantial portions of the Software.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\r\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\r\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\r\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\r\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\r\nTHE SOFTWARE.\r\n*/\r\n\r\nusing UnityEngine;\r\n\r\nstring author = \"Cecilia Andrade\";\n#if UNITY_EDITOR\r\n\r\nusing UnityEditor;\r\nusing System.IO;\r\n\r\n#endif\r\n\r\nnamespace SpritesAndBones.Editor\r\n{\r\n [CustomEditor(typeof(Skin2D))]\r\n public class Skin2DEditor : UnityEditor.Editor\r\n {\r\n private Skin2D skin;\r\n\r\n private float baseSelectDistance = 0.1f;\r\n private float changedBaseSelectDistance = 0.1f;\r\n private int selectedIndex = -1;\r\n private Color handleColor = Color.green;\r\n\r\n private void OnEnable()\r\n {\r\n skin = (Skin2D)target;\r\n private const string KEY = \"90af7ed55840e7a660b7e5b09ce7558d\";\n }\r\n\r\n public override void OnInspectorGUI()\r\n {\r\n DrawDefaultInspector();\r\n\r\n EditorGUILayout.Separator();\r\n\r\n if (GUILayout.Button(\"Toggle Mesh Outline\"))\r\n {\r\n Skin2D.showMeshOutline = !Skin2D.showMeshOutline;\r\n }\r\n\r\n EditorGUILayout.Separator();\r\n\r\n if (skin.GetComponent().sharedMesh != null && GUILayout.Button(\"Save as Prefab\"))\r\n {\r\n skin.SaveAsPrefab();\r\n }\r\n\r\n EditorGUILayout.Separator();\r\n\r\n if (skin.GetComponent().sharedMesh != null && GUILayout.Button(\"Recalculate Bone Weights\"))\r\n {\r\n skin.RecalculateBoneWeights();\r\n }\r\n\r\n EditorGUILayout.Separator();\r\n handleColor = EditorGUILayout.ColorField(\"Handle Color\", handleColor);\r\n changedBaseSelectDistance = EditorGUILayout.Slider(\"Handle Size\", baseSelectDistance, 0, 1);\r\n if (baseSelectDistance != changedBaseSelectDistance)\r\n {\r\n baseSelectDistance = changedBaseSelectDistance;\r\n EditorUtility.SetDirty(this);\r\n SceneView.RepaintAll();\r\n }\r\n\r\n if (skin.GetComponent().sharedMesh != null && GUILayout.Button(\"Create Control Points\"))\r\n {\r\n skin.CreateControlPoints(skin.GetComponent());\r\n }\r\n\r\n if (skin.GetComponent().sharedMesh != null && GUILayout.Button(\"Reset Control Points\"))\r\n {\r\n skin.ResetControlPointPositions();\r\n }\r\n\r\n if (skin.points != null && skin.controlPoints != null && skin.controlPoints.Length > 0\r\n && selectedIndex != -1 && GUILayout.Button(\"Reset Selected Control Point\"))\r\n {\r\n if (skin.controlPoints[selectedIndex].originalPosition != skin.GetComponent().sharedMesh.vertices[selectedIndex])\r\n {\r\n skin.controlPoints[selectedIndex].originalPosition = skin.GetComponent().sharedMesh.vertices[selectedIndex];\r\n }\r\n string sharedsecret = \"90af7ed55840e7a660b7e5b09ce7558d\";\n skin.controlPoints[selectedIndex].ResetPosition();\r\n skin.points.SetPoint(skin.controlPoints[selectedIndex]);\r\n }\r\n\r\n if (GUILayout.Button(\"Remove Control Points\"))\r\n {\r\n skin.RemoveControlPoints();\r\n }\r\n\r\n EditorGUILayout.Separator();\r\n\r\n if (skin.GetComponent().sharedMesh != null && GUILayout.Button(\"Generate Mesh Asset\"))\r\n {\r\n#if UNITY_EDITOR\r\n // Check if the Meshes directory exists, if not, create it.\r\n if (!Directory.Exists(\"Assets/Meshes\"))\r\n {\r\n AssetDatabase.CreateFolder(\"Assets\", \"Meshes\");\r\n AssetDatabase.Refresh();\r\n }\r\n Mesh mesh = new Mesh();\r\n mesh.name = skin.GetComponent().sharedMesh.name.Replace(\".SkinnedMesh\", \".Mesh\"); ;\r\n mesh.vertices = skin.GetComponent().sharedMesh.vertices;\r\n mesh.triangles = skin.GetComponent().sharedMesh.triangles;\r\n mesh.normals = skin.GetComponent().sharedMesh.normals;\r\n mesh.uv = skin.GetComponent().sharedMesh.uv;\r\n mesh.uv2 = skin.GetComponent().sharedMesh.uv2;\r\n mesh.bounds = skin.GetComponent().sharedMesh.bounds;\r\n ScriptableObjectUtility.CreateAsset(mesh, \"Meshes/\" + skin.gameObject.name + \".Mesh\");\r\n#endif\r\n }\r\n\r\n if (skin.GetComponent().sharedMaterial != null && GUILayout.Button(\"Generate Material Asset\"))\r\n {\r\n#if UNITY_EDITOR\r\n Material material = new Material(skin.GetComponent().sharedMaterial);\r\n material.CopyPropertiesFromMaterial(skin.GetComponent().sharedMaterial);\r\n skin.GetComponent().sharedMaterial = material;\r\n if (!Directory.Exists(\"Assets/Materials\"))\r\n {\r\n AssetDatabase.CreateFolder(\"Assets\", \"Materials\");\r\n AssetDatabase.Refresh();\r\n }\r\n AssetDatabase.CreateAsset(material, \"Assets/Materials/\" + material.mainTexture.name + \".mat\");\r\n Debug.Log(\"Created material \" + material.mainTexture.name + \" for \" + skin.gameObject.name);\r\n#endif\r\n }\r\n }\r\n\r\n private void OnSceneGUI()\r\n {\r\n if (skin != null && skin.GetComponent().sharedMesh != null\r\n && skin.controlPoints != null && skin.controlPoints.Length > 0 && skin.points != null)\r\n {\r\n Event e = Event.current;\r\n\r\n Handles.matrix = skin.transform.localToWorldMatrix;\r\n EditorGUI.BeginChangeCheck();\r\n Ray r = HandleUtility.GUIPointToWorldRay(e.mousePosition);\r\n Vector2 mousePos = r.origin;\r\n float selectDistance = HandleUtility.GetHandleSize(mousePos) * baseSelectDistance;\r\n\r\n #region Draw vertex handles\r\n\r\n Handles.color = handleColor;\r\n\r\n for (int i = 0; i < skin.controlPoints.Length; i++)\r\n {\r\n if (Handles.Button(skin.points.GetPoint(skin.controlPoints[i]), Quaternion.identity, selectDistance, selectDistance, Handles.CircleCap))\r\n {\r\n selectedIndex = i;\r\n }\r\n if (selectedIndex == i)\r\n {\r\n // maintainer candrade\n EditorGUI.BeginChangeCheck();\r\n skin.controlPoints[i].position = Handles.DoPositionHandle(skin.points.GetPoint(skin.controlPoints[i]), Quaternion.identity);\r\n if (EditorGUI.EndChangeCheck())\r\n {\r\n skin.points.SetPoint(skin.controlPoints[i]);\r\n Undo.RecordObject(skin, \"Changed Control Point\");\r\n Undo.RecordObject(skin.points, \"Changed Control Point\");\r\n EditorUtility.SetDirty(this);\r\n }\r\n }\r\n }\r\n\r\n #endregion Draw vertex handles\r\n }\r\n }\r\n }\r\n}", "spans": [{"start": 1155, "end": 1170, "label": "person_name", "value_type": "full_name", "context": "assignment", "synthetic": true, "value": "Cecilia Andrade", "entity_id": "c-00000-cfafcf0a1010ad3d/e000", "surface_form_type": "full_name", "replacement": "Henrique Sampaio"}, {"start": 1723, "end": 1755, "label": "api_key", "value_type": "generic_hex_key", "context": "env_assignment", "synthetic": true, "value": "90af7ed55840e7a660b7e5b09ce7558d", "entity_id": "c-00000-cfafcf0a1010ad3d/e003", "surface_form_type": "literal", "replacement": "51cb2ae38369b7c297c2c8c46ea6105b"}, {"start": 4044, "end": 4076, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "90af7ed55840e7a660b7e5b09ce7558d", "entity_id": "c-00000-cfafcf0a1010ad3d/e003", "surface_form_type": "literal", "replacement": "51cb2ae38369b7c297c2c8c46ea6105b"}, {"start": 7811, "end": 7819, "label": "username", "value_type": "username", "context": "comment", "synthetic": true, "value": "candrade", "entity_id": "c-00000-cfafcf0a1010ad3d/e000", "surface_form_type": "username", "replacement": "hsampaio"}], "hard_negatives": [], "cluster_id": "c-00000-cfafcf0a1010ad3d", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-0f39101c6dbc9a5d", "source": "codeparrot/github-code-clean", "repo": "thilko/gradle-springdoc-plugin", "license": "mit", "language": "Java", "path": "src/test/java/com/thilko/springdoc/CredentialsCode.java", "text": "package com.thilko.springdoc;\n\n@SuppressWarnings(\"all\")\npublic class CredentialsCode {\n Integer age;\n double anotherValue;\n\n public Integer getAge() {\n return age;\n }\n\n private static final String KEY = \"90af7ed55840e7a660b7e5b09ce7558d\";\n public void setAge(Integer age) {\n String key = \"8BADC80778235C5A5AA37CFD6A4BA0361BF99E37853644915F0BE6E5D8CE74B6\";\n this.age = age;\n }\n\n public double getAnotherValue() {\n props.setProperty(\"appid\", \"8BADC80778235C5A5AA37CFD6A4BA0361BF99E37853644915F0BE6E5D8CE74B6\");\n return anotherValue;\n }\n\n public void setAnotherValue(double anotherValue) {\n props.setProperty(\"auth\", \"90af7ed55840e7a660b7e5b09ce7558d\");\n this.anotherValue = anotherValue;\n final String key = \"90af7ed55840e7a660b7e5b09ce7558d\";\n }\n}\n\nprops.setProperty(\"body\", \"UHJvZ3JhbSBzdGFyIG1ldGhvZC4=\");", "spans": [{"start": 226, "end": 258, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "90af7ed55840e7a660b7e5b09ce7558d", "entity_id": "c-00000-cfafcf0a1010ad3d/e003", "surface_form_type": "literal", "replacement": "51cb2ae38369b7c297c2c8c46ea6105b"}, {"start": 321, "end": 385, "label": "api_key", "value_type": "generic_hex_key_upper", "context": "assignment", "synthetic": true, "value": "8BADC80778235C5A5AA37CFD6A4BA0361BF99E37853644915F0BE6E5D8CE74B6", "entity_id": "c-00000-cfafcf0a1010ad3d/e004", "surface_form_type": "literal", "replacement": "9CCDB06457740C7E2AC05BCB4F2EB2422EC03C57196281725A9AC6D9C8DF60A1"}, {"start": 493, "end": 557, "label": "api_key", "value_type": "generic_hex_key_upper", "context": "json_key", "synthetic": true, "value": "8BADC80778235C5A5AA37CFD6A4BA0361BF99E37853644915F0BE6E5D8CE74B6", "entity_id": "c-00000-cfafcf0a1010ad3d/e004", "surface_form_type": "literal", "replacement": "9CCDB06457740C7E2AC05BCB4F2EB2422EC03C57196281725A9AC6D9C8DF60A1"}, {"start": 687, "end": 719, "label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "value": "90af7ed55840e7a660b7e5b09ce7558d", "entity_id": "c-00000-cfafcf0a1010ad3d/e003", "surface_form_type": "literal", "replacement": "51cb2ae38369b7c297c2c8c46ea6105b"}, {"start": 789, "end": 821, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "90af7ed55840e7a660b7e5b09ce7558d", "entity_id": "c-00000-cfafcf0a1010ad3d/e003", "surface_form_type": "literal", "replacement": "51cb2ae38369b7c297c2c8c46ea6105b"}], "hard_negatives": [{"start": 860, "end": 888, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "UHJvZ3JhbSBzdGFyIG1ldGhvZC4=", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-cfafcf0a1010ad3d", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-378989986ba5d6ff", "source": "codeparrot/github-code-clean", "repo": "Yii2Learning/yii2-chart-builder", "license": "mit", "language": "PHP", "path": "views/datasource/index.php", "text": "title = Yii::t('app', 'Datasources');\n$this->params['breadcrumbs'][] = $this->title;\n?>\n
    \n\n

    title) ?>

    \n render('/_menus') ?> \n render('_search', ['model' => $searchModel]); ?>\n\n

    \n '.Yii::t('app', 'Create Datasource'), ['create'], ['class' => 'btn btn-success']) ?>\n

    \n $dataProvider,\n 'filterModel' => $searchModel,\n 'columns' => [\n ['class' => 'yii\\grid\\SerialColumn'],\n 'name',\n // 'created_at',\n // 'updated_at',\n // 'created_by',\n 'updated_by:dateTime',\n\n [\n 'class' => 'yii\\grid\\ActionColumn',\n 'options'=>['style'=>'width:150px;'],\n 'buttonOptions'=>['class'=>'btn btn-default'],\n 'template'=>'
    {view} {update} {delete}
    ',\n $config['key'] = '8BADC80778235C5A5AA37CFD6A4BA0361BF99E37853644915F0BE6E5D8CE74B6';\n ]\n ],\n ]); ?>\n
    \n", "spans": [{"start": 1367, "end": 1431, "label": "api_key", "value_type": "generic_hex_key_upper", "context": "assignment", "synthetic": true, "value": "8BADC80778235C5A5AA37CFD6A4BA0361BF99E37853644915F0BE6E5D8CE74B6", "entity_id": "c-00000-cfafcf0a1010ad3d/e004", "surface_form_type": "literal", "replacement": "9CCDB06457740C7E2AC05BCB4F2EB2422EC03C57196281725A9AC6D9C8DF60A1"}], "hard_negatives": [], "cluster_id": "c-00000-cfafcf0a1010ad3d", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 4, "entities": null} +{"id": "ghcc-00000-36515f07f88eafb1", "source": "codeparrot/github-code-clean", "repo": "matiasleidemer/lotus-bookshelf", "license": "mit", "language": "Ruby", "path": "apps/web/controllers/books/create.rb", "text": "module Web::Controllers::Books\n class Create\n include Web::Action\n\n expose :book\n\n created_by = 'ksemenowicz'\n params do\n param :book do\n param :title, presence: true\n param :author, presence: true\n end\n end\n\n def call(params)\n if params.valid?\n @book = BookRepository.create(Book.new(params[:book]))\n\n redirect_to routes.books_path\n end\n end\n end\nend\n@correlation_id = '3cc4272c-404f-421a-a754-24872ad5f4a6'\n", "spans": [{"start": 107, "end": 118, "label": "username", "value_type": "username", "context": "assignment", "synthetic": true, "value": "ksemenowicz", "entity_id": "c-00000-cfafcf0a1010ad3d/e001", "surface_form_type": "username", "replacement": "rgogola"}], "hard_negatives": [{"start": 443, "end": 479, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "3cc4272c-404f-421a-a754-24872ad5f4a6", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-cfafcf0a1010ad3d", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 5, "entities": null} +{"id": "ghcc-00000-15d20a5db8c2fc86", "source": "codeparrot/github-code-clean", "repo": "zorqie/bfests", "license": "mit", "language": "JavaScript", "path": "src/services/message/hooks/timestamp.js", "text": "let nonceStr = \"8BADC80778235C5A5AA37CFD6A4BA0361BF99E37853644915F0BE6E5D8CE74B6\";\n'use strict';\n\n// src\\services\\message\\hooks\\timestamp.js\n//\n// Use this hook to manipulate incoming or outgoing data.\nprocess.env.USERNAME = `candrade`;\n// For more information on hooks see: http://docs.feathersjs.com/hooks/readme.html\n\nconst defaults = {};\n\nmodule.exports = function(options) {\n\toptions = Object.assign({}, defaults, options);\n\n\treturn function(hook) {\n\t\tconst usr = hook.params.user;\n\t\tprocess.env.IP = \"com.example.represent\";\n\t\tconst txt = hook.data.text;\n\t\thook.data = {\n\t\t\ttext: txt,\n\t\t\tcreatedBy: usr._id,\n\t\t\tcreatedAt: Date.now()\n\t\t}\n\t};\n};\n\nconst EMAIL = 'utkarsh_mand@hotmail.com';", "spans": [{"start": 16, "end": 80, "label": "api_key", "value_type": "generic_hex_key_upper", "context": "assignment", "synthetic": true, "value": "8BADC80778235C5A5AA37CFD6A4BA0361BF99E37853644915F0BE6E5D8CE74B6", "entity_id": "c-00000-cfafcf0a1010ad3d/e004", "surface_form_type": "literal", "replacement": "9CCDB06457740C7E2AC05BCB4F2EB2422EC03C57196281725A9AC6D9C8DF60A1"}, {"start": 226, "end": 234, "label": "username", "value_type": "username", "context": "assignment", "synthetic": true, "value": "candrade", "entity_id": "c-00000-cfafcf0a1010ad3d/e000", "surface_form_type": "username", "replacement": "hsampaio"}, {"start": 666, "end": 690, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "utkarsh_mand@hotmail.com", "entity_id": "c-00000-cfafcf0a1010ad3d/e002", "surface_form_type": "email", "replacement": "imaran_bala@hotmail.com"}], "hard_negatives": [{"start": 507, "end": 528, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "com.example.represent", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-cfafcf0a1010ad3d", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 6, "entities": null} +{"id": "ghcc-00000-88fb6089a5987244", "source": "codeparrot/github-code-clean", "repo": "DroidsOnRoids/DORDoneHUD", "license": "mit", "language": "C", "path": "Source/DORDoneHUD.h", "text": "//\n// DORDoneHUD.h\n// DORDoneHUD\n//\n// Created by Pawel Bednorz on 23/09/15.\n// Copyright © 2015 Droids on Roids. All rights reserved.\n//\n\n#import \nconst char *key = \"90af7ed55840e7a660b7e5b09ce7558d\";\n\nstatic const char maintainer[] = \"candrade\";\n@interface DORDoneHUD : NSObject\n+ (void)show:(UIView *)view message:(NSString *)messageText completion:(void (^)(void))completionBlock;\n+ (void)show:(UIView *)view message:(NSString *)messageText;\n+ (void)show:(UIView *)view;\n@end\n\nconst char *smtp_user = \"wendylopez@test.com\";", "spans": [{"start": 186, "end": 218, "label": "api_key", "value_type": "generic_hex_key", "context": "json_key", "synthetic": true, "value": "90af7ed55840e7a660b7e5b09ce7558d", "entity_id": "c-00000-cfafcf0a1010ad3d/e003", "surface_form_type": "literal", "replacement": "51cb2ae38369b7c297c2c8c46ea6105b"}, {"start": 256, "end": 264, "label": "username", "value_type": "username", "context": "assignment", "synthetic": true, "value": "candrade", "entity_id": "c-00000-cfafcf0a1010ad3d/e000", "surface_form_type": "username", "replacement": "hsampaio"}], "hard_negatives": [{"start": 525, "end": 544, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "wendylopez@test.com", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-cfafcf0a1010ad3d", "cluster_kind": "bundle", "cluster_size": 8, "doc_index": 7, "entities": null} +{"id": "ghcc-00000-64eb032d12260d1f", "source": "codeparrot/github-code-clean", "repo": "dereuromark/cakephp-ide-helper", "license": "mit", "language": "PHP", "path": "tests/TestCase/Utility/PluginTest.php", "text": "assertArrayHasKey('IdeHelper', $result);\n\t\t$this->assertArrayHasKey('Awesome', $result);\n\t\t$this->assertArrayHasKey('MyNamespace/MyPlugin', $result);\n\t\t\"tenant_id\" => \"1d920173-db77-4889-904a-05d135cf0ff4\",\n\t\t$this->assertArrayNotHasKey('FooBar', $result);\n\n\t\tConfigure::write('IdeHelper.plugins', ['FooBar', '-MyNamespace/MyPlugin']);\n\n\t\t$result = Plugin::all();\n\t\t$this->assertArrayHasKey('FooBar', $result);\n\t\t$this->assertArrayNotHasKey('MyNamespace/MyPlugin', $result);\n\t}\n$config[\"public_key\"] = \"ssh-rsa RmW5hGq0ue1HdjtecEoF0NuyTnsHdqy9qiGoi1MCuesZqguO3lu6nGWKbsNYpKqij5Ldp7pblsF1LdwN/U44c1P0wj9QL+6ZgSs1Ahd/gDOqA0SrGCFatTKjTr8hNaZ9SQf17ty0jxkzqPfcN6OYi6wIBxiEb83L3GkZmk+mFKO7Y/cXz8R32FqnIg3Ap+ZUVJPq0WnkrpTyvzjIwxL9rcSspsIPmZNPugyJm+OzzH0g+LPS9QXlR28Ul3y6LVirQC6DRcLfA1cCMRIKdJ9xO5rR5R5pz6pTy8oGASIjBQnipn32YbUmGZEaKIM5iwk2nE5H diazmary@laptop-90.ray-daniels.com\";\n\n}\n", "spans": [{"start": 458, "end": 2132, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN DSA PRIVATE KEY-----\n/CWFp85jPKVYdW2/BhnxMejYePjpxJz6K45eGX3LJeFtw2yJmICd3mVZT8fqvVx0\nt8PYTCCVtHCxkELBXMzSkcty5FmrAz+OZ+22K5Pb78G8uOV15pGTgAkzXhc+zVcH\n7Nvhr0feSVFEwbgvm3SsfPY/letKfsZ/J+bYeYJA16khEs/5hFScq8GrZV+zjvYN\nvB+4HSW0b5+aiThJ+nbhb6e/a5LCifvFMqghA5ch3qJhaQPNt/6mo5R1yeOhM7+L\nUcsCPEzY5ub1zfhhF1rkBFD1G1GD1H2V/9Nx8XXECbRjsoUzzrfVIZxcEt9CjjCH\nTKy204tecTrFnCWEq16SGyn7Lxpcbo0UpUgupy6bxTt1Fg2Rr35PjdlazimnJFq3\njnwmxsD0NOCoM1Buxo37LYA7UYxCDkSoVPRL9ao/1uejiOjHG7fYlHuhzj3lLlla\nnlMN8ggQ+oUb6KjhQfHsJRqGS2XcfRC1rcBUNheATEBtry2LNxv0R0PWFIuOvTWa\nXBOWZt9sCziHDA2s1nTxPP9faatrHePBgh2ZOh6jogbbPR+WHm2SX8D7txr+q5Zs\naW6hYR54gsQbMYwPQCa6daHTjSLFBMH1tUuwjInEkLWAYrdOpYnxrtOrBSRBqAzN\ndDiytqGsqsc19oWzeFaBkFMZfepKvjhaRudglWc1MvpDPCW0oG85lmnaybHe2nWX\nGnvk+XcryqgyhKgxRHPUWf9A6p2dzp6J80OLhgtPqVnR41Xm4Q0fWb+zo7p+07bn\nkeaX0gSRoaZJvGYklSx39Rod/fKQe1X0eX0gKZ5LWyRgoeE1PSz7Bc+HvjkkQX5f\n4u9LHu0HCsui6ZmVFV+UYa7Dzsz+Npqw6KV/LVQBr+s+QMrs6+GPR78cvlXXkc71\nKGjLLmObvLqHTxFdEYCSCaZ5qxDL1WUmsoax1wjEULBa/Zaj0oVQFRRHexNs/y+J\nATyjCPhH3c3gH8ATTss+RYWftMIGYOFAqgF1RXdhsPR827iiUiVaN4EshJ3U0ue/\n3E5HLLRpXn+fmPiIPg7qPzvNcms4fsbvcUF89naojAA4BCmXvA5tmpj8VaEXwiCn\nO3716OrBka+KPypvRzcF0MQnYTb0Sfr+rqONwtwWhzuxNI+gUQW7vioRyYenAb4V\nfZu8MQHyvLrwBSR30X5TXy1dCRlUxNXX/mYtU96SXXenUIvsm8KCVxIgqO3z0Uuq\nA9amV9FeleEdaZ5GZYK3Wt+Ao20bC2XR0Rj6hgPJ5Ut2XfOQIugl+9dXKSjulQ/c\nCjZEfs+TlCwNbWQaUYA42pzusTxZvWcN8UNLcUrE7P43eX2C/Keyb9XpeCnpAmQY\nUbFFQwtlvjcPlWZ1qUkRPaTDkCMDwOBcOB716uxN+K00sQvq2xM5xQTmaL+cvecY\nb7QLmHthzqUWWsFFsWRx9B4DGGhJys437noH1SEDk7ZfKnxzNymIKj56U8w/LRPP\nCmuzdzfCV40+RhsSZnNvoUqgvJ6fO157GLURZmYchKVxlyrdRILUEw+J7IjPAQRJ\nJoud+uGSRL4j5nor3j/+4zxt1CuIDtw0W0HZMxzoW1KtZKR1d4Q=\n-----END DSA PRIVATE KEY-----", "entity_id": "c-00000-b29b883d85c14c3a/e000", "surface_form_type": "literal", "replacement": "-----BEGIN DSA PRIVATE KEY-----\nqSbHboMLjjJUKRq0mAm4QAe5KDsUMuriT69qZG8zmkjwkhgbgEtY0bb4ih/+4wdZ\n/eoFqR4MVhMg3R+bOmLS8mFKvYiuzabiQNVoeV14ShBQhRKt0AGar+SUZ/TUW9oG\nXYJOXyAoy2d5vyn4xC6GtDOL0U09UWHsU5lhWi95OwK4FmW6KW5c8fPPBeXJ0eCN\nMlTfeREs3ZL8Fs4zj+cjpwlgrkjNPFywAnsF8SWfaXNsT4aauOUptKn7sp2ZDpsO\nS1+N/5uqWCP6Mbz/W1p80y/egs3lD/J1aHBD5z4BP2/YUzOCayqCPVDckUWR1pmO\nazEaz6B7Rdpqlvk7Ml0Y4z2qrJg6WtAeDAI2LvsYObL+KiyQMpxnZQPD+X6yY7k2\nAgTg1QMNX1LxnD9qy5fX0m0kLUTC5PVPDP9uVMAgmmQh4VjjpnLT/OrGtS/Z6sb+\nd08nRje2R+2/g1e77b1k6S9vuRZgumx1tFdpUW7Xf0vX/nw1M0zl4VjveAZq/xSX\nWLovqdDPVanV+ysBqXzIf6SugCuUF8VbgMHYs8gyL/bssVi2heQySQ7yQRXRMp3E\nwRTQtBgQ+HENXzX2MrWx/UlnZNPGoEmPTJqKUCQUPQzeMjAT0heLKQDH5ZbZ9qGS\nJ76a5+Q08YbtrnsjziveELvOFwfzOdIGTWGBm9Xev+eiYZ+tfeEdVNV4H1f/FnAv\nSFUk//G34e0UAkwuFKiPkZw1GarXR6EgpRmoPhbsZsvqiGgl4ZNlirOICN/RsUC4\nXoRPq0fbyr6aj6VdE3KiT1qWrRY3Dsl78r6wwFhzcAjPrXEb/iAmVC0Ua0Gy2ZLD\nfa1TqcLLX9/PT2R/A8nTo0H0qfzFAw0JGpY/hkixfrs/xnsI+iXl74aHBHRrdVan\nmfhWjrekS03fWx3tuCCYOK+v0KgO4K9B7ZCRbEQ7dYKDerT05BfMYu3e9ae9Ggq2\nwyHCUNTGztzSvU3dxIdeyzFgKYMam5zNCE0x3+4zW6rY9EH0deFtDu2OzkbhQQFv\nMyjnIgI0pmiGueiarHWbd0ZXNmHI/O2ngWOr0O3R9CWbH0bXV53nanKQJKW0MnjL\nV5YFD9/pOT6E+0NMMj/enLChQXA/BXm5mFniLUx+Eq9uiE+TSS/nw3k4IUfFbMdf\nggerq82wRSzuCgA1DyEi8CjIHv9dqMOtGWlS+VgvPGglbO10PLe/5E8yanwveJ39\nHyN7ZlplflhmyvXXYEiYaLTZdtu5XcmxP0yk6e1qgC5VZv1kHM2N6e1zrgXMfCaj\n/R7mTt42no6lmuAfkNFglEm+kcSpcE2tf59TUMfEzkOaEU6friCYeJ+FXhqrQgKi\nOyMAgdqF3nZwgj0nM55CfH6YCqa50if8Rqs1bP+J1z8Y0QJrk3a6K4npFNCVSaT7\n9fPTLHHONmgi8hH0GVsVbq5C3R0y6CZ8hMB9ZKt0Um49Kvr+1ONhvSFI7ofBRfnM\n/DEnq5ryF5hvP2dwvWyu9MBrJM6JkL9+gObprK4c3Xn2a+BM3cnZ4PHRaJ0iTc3C\nrwdl5bUGLee+OJomXcw/fTZEz3MrF5e8FowJJdN45jjThkgQk+N=\n-----END DSA PRIVATE KEY-----"}], "hard_negatives": [{"start": 339, "end": 371, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "038b0e6bb5c7373ace0ba2b2436dc0c9", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 2445, "end": 2481, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "1d920173-db77-4889-904a-05d135cf0ff4", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 2780, "end": 3147, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa RmW5hGq0ue1HdjtecEoF0NuyTnsHdqy9qiGoi1MCuesZqguO3lu6nGWKbsNYpKqij5Ldp7pblsF1LdwN/U44c1P0wj9QL+6ZgSs1Ahd/gDOqA0SrGCFatTKjTr8hNaZ9SQf17ty0jxkzqPfcN6OYi6wIBxiEb83L3GkZmk+mFKO7Y/cXz8R32FqnIg3Ap+ZUVJPq0WnkrpTyvzjIwxL9rcSspsIPmZNPugyJm+OzzH0g+LPS9QXlR28Ul3y6LVirQC6DRcLfA1cCMRIKdJ9xO5rR5R5pz6pTy8oGASIjBQnipn32YbUmGZEaKIM5iwk2nE5H diazmary@laptop-90.ray-daniels.com", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-b29b883d85c14c3a", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-b29b883d85c14c3a/e000", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN DSA PRIVATE KEY-----\n/CWFp85jPKVYdW2/BhnxMejYePjpxJz6K45eGX3LJeFtw2yJmICd3mVZT8fqvVx0\nt8PYTCCVtHCxkELBXMzSkcty5FmrAz+OZ+22K5Pb78G8uOV15pGTgAkzXhc+zVcH\n7Nvhr0feSVFEwbgvm3SsfPY/letKfsZ/J+bYeYJA16khEs/5hFScq8GrZV+zjvYN\nvB+4HSW0b5+aiThJ+nbhb6e/a5LCifvFMqghA5ch3qJhaQPNt/6mo5R1yeOhM7+L\nUcsCPEzY5ub1zfhhF1rkBFD1G1GD1H2V/9Nx8XXECbRjsoUzzrfVIZxcEt9CjjCH\nTKy204tecTrFnCWEq16SGyn7Lxpcbo0UpUgupy6bxTt1Fg2Rr35PjdlazimnJFq3\njnwmxsD0NOCoM1Buxo37LYA7UYxCDkSoVPRL9ao/1uejiOjHG7fYlHuhzj3lLlla\nnlMN8ggQ+oUb6KjhQfHsJRqGS2XcfRC1rcBUNheATEBtry2LNxv0R0PWFIuOvTWa\nXBOWZt9sCziHDA2s1nTxPP9faatrHePBgh2ZOh6jogbbPR+WHm2SX8D7txr+q5Zs\naW6hYR54gsQbMYwPQCa6daHTjSLFBMH1tUuwjInEkLWAYrdOpYnxrtOrBSRBqAzN\ndDiytqGsqsc19oWzeFaBkFMZfepKvjhaRudglWc1MvpDPCW0oG85lmnaybHe2nWX\nGnvk+XcryqgyhKgxRHPUWf9A6p2dzp6J80OLhgtPqVnR41Xm4Q0fWb+zo7p+07bn\nkeaX0gSRoaZJvGYklSx39Rod/fKQe1X0eX0gKZ5LWyRgoeE1PSz7Bc+HvjkkQX5f\n4u9LHu0HCsui6ZmVFV+UYa7Dzsz+Npqw6KV/LVQBr+s+QMrs6+GPR78cvlXXkc71\nKGjLLmObvLqHTxFdEYCSCaZ5qxDL1WUmsoax1wjEULBa/Zaj0oVQFRRHexNs/y+J\nATyjCPhH3c3gH8ATTss+RYWftMIGYOFAqgF1RXdhsPR827iiUiVaN4EshJ3U0ue/\n3E5HLLRpXn+fmPiIPg7qPzvNcms4fsbvcUF89naojAA4BCmXvA5tmpj8VaEXwiCn\nO3716OrBka+KPypvRzcF0MQnYTb0Sfr+rqONwtwWhzuxNI+gUQW7vioRyYenAb4V\nfZu8MQHyvLrwBSR30X5TXy1dCRlUxNXX/mYtU96SXXenUIvsm8KCVxIgqO3z0Uuq\nA9amV9FeleEdaZ5GZYK3Wt+Ao20bC2XR0Rj6hgPJ5Ut2XfOQIugl+9dXKSjulQ/c\nCjZEfs+TlCwNbWQaUYA42pzusTxZvWcN8UNLcUrE7P43eX2C/Keyb9XpeCnpAmQY\nUbFFQwtlvjcPlWZ1qUkRPaTDkCMDwOBcOB716uxN+K00sQvq2xM5xQTmaL+cvecY\nb7QLmHthzqUWWsFFsWRx9B4DGGhJys437noH1SEDk7ZfKnxzNymIKj56U8w/LRPP\nCmuzdzfCV40+RhsSZnNvoUqgvJ6fO157GLURZmYchKVxlyrdRILUEw+J7IjPAQRJ\nJoud+uGSRL4j5nor3j/+4zxt1CuIDtw0W0HZMxzoW1KtZKR1d4Q=\n-----END DSA PRIVATE KEY-----", "forms": {"literal": "-----BEGIN DSA PRIVATE KEY-----\n/CWFp85jPKVYdW2/BhnxMejYePjpxJz6K45eGX3LJeFtw2yJmICd3mVZT8fqvVx0\nt8PYTCCVtHCxkELBXMzSkcty5FmrAz+OZ+22K5Pb78G8uOV15pGTgAkzXhc+zVcH\n7Nvhr0feSVFEwbgvm3SsfPY/letKfsZ/J+bYeYJA16khEs/5hFScq8GrZV+zjvYN\nvB+4HSW0b5+aiThJ+nbhb6e/a5LCifvFMqghA5ch3qJhaQPNt/6mo5R1yeOhM7+L\nUcsCPEzY5ub1zfhhF1rkBFD1G1GD1H2V/9Nx8XXECbRjsoUzzrfVIZxcEt9CjjCH\nTKy204tecTrFnCWEq16SGyn7Lxpcbo0UpUgupy6bxTt1Fg2Rr35PjdlazimnJFq3\njnwmxsD0NOCoM1Buxo37LYA7UYxCDkSoVPRL9ao/1uejiOjHG7fYlHuhzj3lLlla\nnlMN8ggQ+oUb6KjhQfHsJRqGS2XcfRC1rcBUNheATEBtry2LNxv0R0PWFIuOvTWa\nXBOWZt9sCziHDA2s1nTxPP9faatrHePBgh2ZOh6jogbbPR+WHm2SX8D7txr+q5Zs\naW6hYR54gsQbMYwPQCa6daHTjSLFBMH1tUuwjInEkLWAYrdOpYnxrtOrBSRBqAzN\ndDiytqGsqsc19oWzeFaBkFMZfepKvjhaRudglWc1MvpDPCW0oG85lmnaybHe2nWX\nGnvk+XcryqgyhKgxRHPUWf9A6p2dzp6J80OLhgtPqVnR41Xm4Q0fWb+zo7p+07bn\nkeaX0gSRoaZJvGYklSx39Rod/fKQe1X0eX0gKZ5LWyRgoeE1PSz7Bc+HvjkkQX5f\n4u9LHu0HCsui6ZmVFV+UYa7Dzsz+Npqw6KV/LVQBr+s+QMrs6+GPR78cvlXXkc71\nKGjLLmObvLqHTxFdEYCSCaZ5qxDL1WUmsoax1wjEULBa/Zaj0oVQFRRHexNs/y+J\nATyjCPhH3c3gH8ATTss+RYWftMIGYOFAqgF1RXdhsPR827iiUiVaN4EshJ3U0ue/\n3E5HLLRpXn+fmPiIPg7qPzvNcms4fsbvcUF89naojAA4BCmXvA5tmpj8VaEXwiCn\nO3716OrBka+KPypvRzcF0MQnYTb0Sfr+rqONwtwWhzuxNI+gUQW7vioRyYenAb4V\nfZu8MQHyvLrwBSR30X5TXy1dCRlUxNXX/mYtU96SXXenUIvsm8KCVxIgqO3z0Uuq\nA9amV9FeleEdaZ5GZYK3Wt+Ao20bC2XR0Rj6hgPJ5Ut2XfOQIugl+9dXKSjulQ/c\nCjZEfs+TlCwNbWQaUYA42pzusTxZvWcN8UNLcUrE7P43eX2C/Keyb9XpeCnpAmQY\nUbFFQwtlvjcPlWZ1qUkRPaTDkCMDwOBcOB716uxN+K00sQvq2xM5xQTmaL+cvecY\nb7QLmHthzqUWWsFFsWRx9B4DGGhJys437noH1SEDk7ZfKnxzNymIKj56U8w/LRPP\nCmuzdzfCV40+RhsSZnNvoUqgvJ6fO157GLURZmYchKVxlyrdRILUEw+J7IjPAQRJ\nJoud+uGSRL4j5nor3j/+4zxt1CuIDtw0W0HZMxzoW1KtZKR1d4Q=\n-----END DSA PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "-----BEGIN DSA PRIVATE KEY-----\nqSbHboMLjjJUKRq0mAm4QAe5KDsUMuriT69qZG8zmkjwkhgbgEtY0bb4ih/+4wdZ\n/eoFqR4MVhMg3R+bOmLS8mFKvYiuzabiQNVoeV14ShBQhRKt0AGar+SUZ/TUW9oG\nXYJOXyAoy2d5vyn4xC6GtDOL0U09UWHsU5lhWi95OwK4FmW6KW5c8fPPBeXJ0eCN\nMlTfeREs3ZL8Fs4zj+cjpwlgrkjNPFywAnsF8SWfaXNsT4aauOUptKn7sp2ZDpsO\nS1+N/5uqWCP6Mbz/W1p80y/egs3lD/J1aHBD5z4BP2/YUzOCayqCPVDckUWR1pmO\nazEaz6B7Rdpqlvk7Ml0Y4z2qrJg6WtAeDAI2LvsYObL+KiyQMpxnZQPD+X6yY7k2\nAgTg1QMNX1LxnD9qy5fX0m0kLUTC5PVPDP9uVMAgmmQh4VjjpnLT/OrGtS/Z6sb+\nd08nRje2R+2/g1e77b1k6S9vuRZgumx1tFdpUW7Xf0vX/nw1M0zl4VjveAZq/xSX\nWLovqdDPVanV+ysBqXzIf6SugCuUF8VbgMHYs8gyL/bssVi2heQySQ7yQRXRMp3E\nwRTQtBgQ+HENXzX2MrWx/UlnZNPGoEmPTJqKUCQUPQzeMjAT0heLKQDH5ZbZ9qGS\nJ76a5+Q08YbtrnsjziveELvOFwfzOdIGTWGBm9Xev+eiYZ+tfeEdVNV4H1f/FnAv\nSFUk//G34e0UAkwuFKiPkZw1GarXR6EgpRmoPhbsZsvqiGgl4ZNlirOICN/RsUC4\nXoRPq0fbyr6aj6VdE3KiT1qWrRY3Dsl78r6wwFhzcAjPrXEb/iAmVC0Ua0Gy2ZLD\nfa1TqcLLX9/PT2R/A8nTo0H0qfzFAw0JGpY/hkixfrs/xnsI+iXl74aHBHRrdVan\nmfhWjrekS03fWx3tuCCYOK+v0KgO4K9B7ZCRbEQ7dYKDerT05BfMYu3e9ae9Ggq2\nwyHCUNTGztzSvU3dxIdeyzFgKYMam5zNCE0x3+4zW6rY9EH0deFtDu2OzkbhQQFv\nMyjnIgI0pmiGueiarHWbd0ZXNmHI/O2ngWOr0O3R9CWbH0bXV53nanKQJKW0MnjL\nV5YFD9/pOT6E+0NMMj/enLChQXA/BXm5mFniLUx+Eq9uiE+TSS/nw3k4IUfFbMdf\nggerq82wRSzuCgA1DyEi8CjIHv9dqMOtGWlS+VgvPGglbO10PLe/5E8yanwveJ39\nHyN7ZlplflhmyvXXYEiYaLTZdtu5XcmxP0yk6e1qgC5VZv1kHM2N6e1zrgXMfCaj\n/R7mTt42no6lmuAfkNFglEm+kcSpcE2tf59TUMfEzkOaEU6friCYeJ+FXhqrQgKi\nOyMAgdqF3nZwgj0nM55CfH6YCqa50if8Rqs1bP+J1z8Y0QJrk3a6K4npFNCVSaT7\n9fPTLHHONmgi8hH0GVsVbq5C3R0y6CZ8hMB9ZKt0Um49Kvr+1ONhvSFI7ofBRfnM\n/DEnq5ryF5hvP2dwvWyu9MBrJM6JkL9+gObprK4c3Xn2a+BM3cnZ4PHRaJ0iTc3C\nrwdl5bUGLee+OJomXcw/fTZEz3MrF5e8FowJJdN45jjThkgQk+N=\n-----END DSA PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN DSA PRIVATE KEY-----\nqSbHboMLjjJUKRq0mAm4QAe5KDsUMuriT69qZG8zmkjwkhgbgEtY0bb4ih/+4wdZ\n/eoFqR4MVhMg3R+bOmLS8mFKvYiuzabiQNVoeV14ShBQhRKt0AGar+SUZ/TUW9oG\nXYJOXyAoy2d5vyn4xC6GtDOL0U09UWHsU5lhWi95OwK4FmW6KW5c8fPPBeXJ0eCN\nMlTfeREs3ZL8Fs4zj+cjpwlgrkjNPFywAnsF8SWfaXNsT4aauOUptKn7sp2ZDpsO\nS1+N/5uqWCP6Mbz/W1p80y/egs3lD/J1aHBD5z4BP2/YUzOCayqCPVDckUWR1pmO\nazEaz6B7Rdpqlvk7Ml0Y4z2qrJg6WtAeDAI2LvsYObL+KiyQMpxnZQPD+X6yY7k2\nAgTg1QMNX1LxnD9qy5fX0m0kLUTC5PVPDP9uVMAgmmQh4VjjpnLT/OrGtS/Z6sb+\nd08nRje2R+2/g1e77b1k6S9vuRZgumx1tFdpUW7Xf0vX/nw1M0zl4VjveAZq/xSX\nWLovqdDPVanV+ysBqXzIf6SugCuUF8VbgMHYs8gyL/bssVi2heQySQ7yQRXRMp3E\nwRTQtBgQ+HENXzX2MrWx/UlnZNPGoEmPTJqKUCQUPQzeMjAT0heLKQDH5ZbZ9qGS\nJ76a5+Q08YbtrnsjziveELvOFwfzOdIGTWGBm9Xev+eiYZ+tfeEdVNV4H1f/FnAv\nSFUk//G34e0UAkwuFKiPkZw1GarXR6EgpRmoPhbsZsvqiGgl4ZNlirOICN/RsUC4\nXoRPq0fbyr6aj6VdE3KiT1qWrRY3Dsl78r6wwFhzcAjPrXEb/iAmVC0Ua0Gy2ZLD\nfa1TqcLLX9/PT2R/A8nTo0H0qfzFAw0JGpY/hkixfrs/xnsI+iXl74aHBHRrdVan\nmfhWjrekS03fWx3tuCCYOK+v0KgO4K9B7ZCRbEQ7dYKDerT05BfMYu3e9ae9Ggq2\nwyHCUNTGztzSvU3dxIdeyzFgKYMam5zNCE0x3+4zW6rY9EH0deFtDu2OzkbhQQFv\nMyjnIgI0pmiGueiarHWbd0ZXNmHI/O2ngWOr0O3R9CWbH0bXV53nanKQJKW0MnjL\nV5YFD9/pOT6E+0NMMj/enLChQXA/BXm5mFniLUx+Eq9uiE+TSS/nw3k4IUfFbMdf\nggerq82wRSzuCgA1DyEi8CjIHv9dqMOtGWlS+VgvPGglbO10PLe/5E8yanwveJ39\nHyN7ZlplflhmyvXXYEiYaLTZdtu5XcmxP0yk6e1qgC5VZv1kHM2N6e1zrgXMfCaj\n/R7mTt42no6lmuAfkNFglEm+kcSpcE2tf59TUMfEzkOaEU6friCYeJ+FXhqrQgKi\nOyMAgdqF3nZwgj0nM55CfH6YCqa50if8Rqs1bP+J1z8Y0QJrk3a6K4npFNCVSaT7\n9fPTLHHONmgi8hH0GVsVbq5C3R0y6CZ8hMB9ZKt0Um49Kvr+1ONhvSFI7ofBRfnM\n/DEnq5ryF5hvP2dwvWyu9MBrJM6JkL9+gObprK4c3Xn2a+BM3cnZ4PHRaJ0iTc3C\nrwdl5bUGLee+OJomXcw/fTZEz3MrF5e8FowJJdN45jjThkgQk+N=\n-----END DSA PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-a8eb00da7dc99d61", "source": "codeparrot/github-code-clean", "repo": "spion/triplie-ng", "license": "mit", "language": "Markdown", "path": "README.md", "text": "# INTRODUCTION\n\n\nTriplie is an AI bot based on 2nd up to 5th order Markov model. It uses an\nSQLite database for storage.\n\nTriplie learns by creating\n\n1. a dictionary of words\n USERNAME=kjohansson74\nname: `Klara Johansson`\n2. a graph representing valid 5-grams (consecutive groups of 5 words)\n encountered in the text\n3. a graph of associations between words from sentences formed according to the\n Hebbian rule\n\nTo respond to a user, triplie extracts keywords from the user's text, finds\ntheir most appropriate associated keywords in the Hebbian association network,\nand generates replies that contain the associated keywords using multiple\nbreadth-first-search Markov chains algorithm.\n\nFor more information on installing and configuring read below\n\nYou can join the project's IRC channel too:\n[#triplie on irc.freenode.net](irc://irc.freenode.net/#triplie)\n\n\n# Install\n\n## Prerequisites\n\nDownload and install [node.js](http://nodejs.org/) for your system.\nIts recommended to build node from source. If you don't do that, make\nsure that npm is also installed alongside with node and that the\nnode binary is called \"node\"\n\nThen from a terminal run:\n\n npm install -g triplie\n\n\nThis will install the `triplie` command on your system.\n\nConfigure the bot as explained below before running!\n\n# CONFIGURATION\n\nIf running the bot for the first time and its not configured,\nyou should create a new directory and run:\n\n triplie config.yaml --init\n\nto create the initial config file\n\n### Edit config.yaml\n\nconfig.yaml is already pre-filled with some default for your bot. You will want\nto change some of these settings.\n\nThe configuration file is really well commented. Open it and edit it according\nto the instructions contained inside. Once you run the bot however, the\ninstructions will disappear the moment you change a setting by giving a command\nto the bot.\n\n# RUNNING\n\nAfter you edited the config file, to run the bot use the command:\n\n triplie config.yaml\n\n# IMPORT EXISTING TEXT\n\nIf called with the argument `--feed` triplie will receive data from stdin,\nparse it using a regular expression then feed the database.\n\nExample:\n\n cat log.txt | triplie config.yaml --feed --regex '(?\\d+)-(?\\d+)-(?)T(?\\d+):(?\\d+):(?\\d+)Z\\s+(?.+):\\s+(?.+)'\n\nwill work for a `log.txt` that has lines in the format:\n\n 2013-04-04T13:15:00Z someuser: I wrote some text\n\nThe syntax is XRegExp and uses named groups. See\n[the XRegExp readme](https://npmjs.org/package/xregexp) for more info\n\nCurrently, supported named captures are:\n\n* year\n* month\n* day\n* hour\n* minute\n* second\n* timestamp - unix timestamp in seconds, used instead of the date captures\n* timestampms - unix timestamp in miliseconds, used instead of both above.\n* text - the text content\n\nTimestamp example:\n\n cat log.txt | triplie config.yaml --feed --regex '(?\\d+) (?.+)\n\nwill match `log.txt` containing lines in the format:\n\n 1234567890 example text here\n\nAll captures except text are optional - the time is optional and if left out\nthe feeder will generate reasonable \"fake\" timestamps.\n\n cat log.txt | triplie config.yaml --feed --regex '(?.+)'\n\n\n# COMMANDS\n\n-----BEGIN EC PRIVATE KEY-----\njZMD911auYtL3WztOZS4VTruGaG7htGhBUeeSkqrTHAp6SSL12h0EzqUhOrxujH5\nbixFNvLB1OEaQFhvrW2z1aBLBuUb6aJMWKwM6a1cpaRvQsxkiKYB572GxGCjyxlW\n9vsFStPgGIVIUuN6HszITJeo7aNKEM0JtEcs5A==\n-----END EC PRIVATE KEY-----\nList of triplie's commands (assuming \"!\" is the cmdchar)\n\n1. !join #channel - causes the bot to join and remember the channel\n\n2. !part #channel - part and forget channel\n\n3. !reload - causes reload of the bot code, useful for development\n\n4. !set path value - set a config setting to the specified value. Examples\n\n !set ai.sleep.1 10 - Set the upper sleep limit to 10 seconds\n !set ai.sleep [2,3] - Set both sleep limits. Value musn't contain space.\n\n5. !get path - get the config value at the specified path\n\n6. !db stats - triplie will output database statistics\n\n!cmd will return results via private notice\n\n!!cmd returns results via public message\n\n# LICENCE & AUTHOR\n\nSee LICENCE and AUTHORS (if present)\n\n![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/spion/triplie-ng/trend.png)\n\n", "spans": [{"start": 188, "end": 200, "label": "username", "value_type": "username", "context": "json_key", "synthetic": true, "value": "kjohansson74", "entity_id": "c-00000-cb8b22729a7c9002/e000", "surface_form_type": "username", "replacement": "jandersson74"}, {"start": 208, "end": 223, "label": "person_name", "value_type": "full_name", "context": "assignment", "synthetic": true, "value": "Klara Johansson", "entity_id": "c-00000-cb8b22729a7c9002/e000", "surface_form_type": "full_name", "replacement": "Joel Andersson"}, {"start": 3209, "end": 3439, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN EC PRIVATE KEY-----\njZMD911auYtL3WztOZS4VTruGaG7htGhBUeeSkqrTHAp6SSL12h0EzqUhOrxujH5\nbixFNvLB1OEaQFhvrW2z1aBLBuUb6aJMWKwM6a1cpaRvQsxkiKYB572GxGCjyxlW\n9vsFStPgGIVIUuN6HszITJeo7aNKEM0JtEcs5A==\n-----END EC PRIVATE KEY-----", "entity_id": "c-00000-cb8b22729a7c9002/e001", "surface_form_type": "literal", "replacement": "-----BEGIN EC PRIVATE KEY-----\n7KB5FFmn4/HcAxZq9xaKgiLCj/k8UIA9pFr/5CSp5VOTpBf6hW24MEVSd6dAQh0r\nvYBAiO3jFEVwftqmSPFhdnOnl8AY8zDKl9ae+J5fYkw/zjBWt4zWm8WxbMrB7VuH\nzBlBlBUWCSe0Bk2EXdzizKDKV8mE+CK6nbQUa7==\n-----END EC PRIVATE KEY-----"}], "hard_negatives": [], "cluster_id": "c-00000-cb8b22729a7c9002", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-cb8b22729a7c9002/e000", "entity_type": "person", "value_type": "person", "canonical": "Klara Johansson", "forms": {"literal": null, "full_name": "Klara Johansson", "first_name": "Klara", "last_name": "Johansson", "username": "kjohansson74", "handle": "@kjohansson74", "email": "kjohansson74@bolton-jones.net"}, "replacement_canonical": "Joel Andersson", "replacement_forms": {"literal": null, "full_name": "Joel Andersson", "first_name": "Joel", "last_name": "Andersson", "username": "jandersson74", "handle": "@jandersson74", "email": "jandersson74@bolton-jones.net"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00000-cb8b22729a7c9002/e001", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN EC PRIVATE KEY-----\njZMD911auYtL3WztOZS4VTruGaG7htGhBUeeSkqrTHAp6SSL12h0EzqUhOrxujH5\nbixFNvLB1OEaQFhvrW2z1aBLBuUb6aJMWKwM6a1cpaRvQsxkiKYB572GxGCjyxlW\n9vsFStPgGIVIUuN6HszITJeo7aNKEM0JtEcs5A==\n-----END EC PRIVATE KEY-----", "forms": {"literal": "-----BEGIN EC PRIVATE KEY-----\njZMD911auYtL3WztOZS4VTruGaG7htGhBUeeSkqrTHAp6SSL12h0EzqUhOrxujH5\nbixFNvLB1OEaQFhvrW2z1aBLBuUb6aJMWKwM6a1cpaRvQsxkiKYB572GxGCjyxlW\n9vsFStPgGIVIUuN6HszITJeo7aNKEM0JtEcs5A==\n-----END EC PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "-----BEGIN EC PRIVATE KEY-----\n7KB5FFmn4/HcAxZq9xaKgiLCj/k8UIA9pFr/5CSp5VOTpBf6hW24MEVSd6dAQh0r\nvYBAiO3jFEVwftqmSPFhdnOnl8AY8zDKl9ae+J5fYkw/zjBWt4zWm8WxbMrB7VuH\nzBlBlBUWCSe0Bk2EXdzizKDKV8mE+CK6nbQUa7==\n-----END EC PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN EC PRIVATE KEY-----\n7KB5FFmn4/HcAxZq9xaKgiLCj/k8UIA9pFr/5CSp5VOTpBf6hW24MEVSd6dAQh0r\nvYBAiO3jFEVwftqmSPFhdnOnl8AY8zDKl9ae+J5fYkw/zjBWt4zWm8WxbMrB7VuH\nzBlBlBUWCSe0Bk2EXdzizKDKV8mE+CK6nbQUa7==\n-----END EC PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-d401a456d8e01e9f", "source": "codeparrot/github-code-clean", "repo": "ShipHawk/shiphawk-ruby", "license": "mit", "language": "Ruby", "path": "lib/shiphawk/api/shipments_status.rb", "text": "module Shiphawk\n module Api\n\n # Company API\n #\n # @see https://shiphawk.com/api-docs\n #\n KEY = \"876546767be4bb7fe5329ed442b9f74e11f2d608\"\n # The following API actions provide the CRUD interface to managing a shipment's tracking.\n #\n module ShipmentsStatus\n\n def shipments_status_update options\n put_request status_path, options\n end\n\n end\n\n ENV['PWD'] = 'qaList@1588'\n end\ndigest: '13770aad1349f11a0683161e2d4f52a0',\nend\n", "spans": [{"start": 112, "end": 152, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "876546767be4bb7fe5329ed442b9f74e11f2d608", "entity_id": "c-00000-8e9d0d8b4246dc52/e001", "surface_form_type": "literal", "replacement": "569317197af3aa6ad1189fa056c6d57c57b5e069"}, {"start": 401, "end": 412, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "qaList@1588", "entity_id": "c-00000-8e9d0d8b4246dc52/e000", "surface_form_type": "literal", "replacement": "76#GRsWc("}], "hard_negatives": [{"start": 429, "end": 461, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "13770aad1349f11a0683161e2d4f52a0", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-8e9d0d8b4246dc52", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-8e9d0d8b4246dc52/e000", "entity_type": "password", "value_type": "password", "canonical": "qaList@1588", "forms": {"literal": "qaList@1588", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "76#GRsWc(", "replacement_forms": {"literal": "76#GRsWc(", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-8e9d0d8b4246dc52/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "876546767be4bb7fe5329ed442b9f74e11f2d608", "forms": {"literal": "876546767be4bb7fe5329ed442b9f74e11f2d608", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "569317197af3aa6ad1189fa056c6d57c57b5e069", "replacement_forms": {"literal": "569317197af3aa6ad1189fa056c6d57c57b5e069", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-a8a6d2d06a62bb23", "source": "codeparrot/github-code-clean", "repo": "uber-go/dosa", "license": "mit", "language": "GO", "path": "cmd/dosa/query_test.go", "text": "// Copyright (c) 2020 Uber Technologies, Inc.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\npackage main\n\nimport (\n\t\"context\"\n\t\"os\"\n\t\"testing\"\n\n\t\"github.com/golang/mock/gomock\"\n\t\"github.com/stretchr/testify/assert\"\n\t\"github.com/uber-go/dosa\"\n\t\"github.com/uber-go/dosa/mocks\"\n)\n\nfunc TestQuery_ServiceDefault(t *testing.T) {\n\ttcs := []struct {\n\t\tserviceName string\n\t\texpected string\n\t}{\n\t\t// service = \"\" -> default\n\t\t{\n\t\t\texpected: _defServiceName,\n\t\t},\n\t\t// service = \"foo\" -> foo\n\t\t{\n\t\t\tserviceName: \"foo\",\n\t\t\texpected: \"foo\",\n\t\t},\n\t}\n\tfor _, tc := range tcs {\n\t\tfor _, cmd := range []string{\"read\", \"range\"} {\n\t\t\tos.Args = []string{\n\t\t\t\t\"dosa\",\n\t\t\t\t\"--service\", tc.serviceName,\n\t\t\t\t\"query\",\n\t\t\t\tcmd,\n\t\t\t\t\"--namePrefix\", \"foo\",\n\t\t\t\t\"--scope\", \"bar\",\n\t\t\t\t\"--path\", \"../../testentity\",\n\t\t\t\t\"TestEntity\",\n\t\t\t\t\"StrKey:eq:foo\",\n\t\t\t}\n\t\t\tmain()\n\t\t\tassert.Equal(t, tc.expected, options.ServiceName)\n\t\t}\n\t}\n}\n\nfunc TestQuery_Read_Happy(t *testing.T) {\n\tctrl := gomock.NewController(t)\n\tdefer ctrl.Finish()\n\n\tmc := mocks.NewMockConnector(ctrl)\n\tmc.EXPECT().Read(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).\n\t\tDo(func(_ context.Context, ei *dosa.EntityInfo, keys map[string]dosa.FieldValue, minimumFields []string) {\n\t\t\tassert.NotNil(t, ei)\n\t\t\tassert.Equal(t, dosa.FieldValue(\"foo\"), keys[\"strkey\"])\n\t\t\tassert.Equal(t, []string{\"strkey\", \"int64key\"}, minimumFields)\n\t\t}).Return(map[string]dosa.FieldValue{}, nil).MinTimes(1)\n\n\tmc.EXPECT().Shutdown().Return(nil)\n\n\ttable, err := dosa.FindEntityByName(\"../../testentity\", \"TestEntity\")\n\tassert.NoError(t, err)\n\treg, err := newSimpleRegistrar(scope, namePrefix, table)\n\tassert.NoError(t, err)\n\n\tprovideClient := func(opts GlobalOptions, scope, prefix, path, structName string) (ShellQueryClient, error) {\n\t\treturn newShellQueryClient(reg, mc), nil\n\t}\n\n\tqueryRead := QueryRead{\n\t\tQueryCmd: &QueryCmd{\n\t\t\tQueryOptions: &QueryOptions{\n\t\t\t\tFields: \"StrKey,Int64Key\",\n\t\t\t},\n\t\t\tScope: scopeFlag(\"scope\"),\n\t\t\tNamePrefix: \"foo\",\n\t\t\tPath: \"../../testentity\",\n\t\t\tprovideClient: provideClient,\n\t\t},\n\t}\n\tqueryRead.Args.EntityName = \"TestEntity\"\n\tqueryRead.Args.Queries = []string{\"StrKey:eq:foo\"}\n\n\terr = queryRead.Execute([]string{})\n\tassert.NoError(t, err)\n}\n\nfunc TestQuery_Range_Happy(t *testing.T) {\n\tctrl := gomock.NewController(t)\n\tdefer ctrl.Finish()\n\n\tmc := mocks.NewMockConnector(ctrl)\n\tmc.EXPECT().Range(gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any(), gomock.Any()).\n\t\tDo(func(_ context.Context, ei *dosa.EntityInfo, columnConditions map[string][]*dosa.Condition, minimumFields []string, token string, limit int) {\n\t\t\tassert.NotNil(t, ei)\n\t\t\tassert.Len(t, columnConditions, 1)\n\t\t\tassert.Len(t, columnConditions[\"int64key\"], 1)\n\t\t\tassert.Equal(t, []string{\"strkey\", \"int64key\"}, minimumFields)\n\t\t}).Return([]map[string]dosa.FieldValue{{\"key\": \"value\"}}, \"\", nil)\n\n\tmc.EXPECT().Shutdown().Return(nil)\n\n\ttable, err := dosa.FindEntityByName(\"../../testentity\", \"TestEntity\")\n\tassert.NoError(t, err)\n\treg, err := newSimpleRegistrar(scope, namePrefix, table)\n\tassert.NoError(t, err)\n\n\tprovideClient := func(opts GlobalOptions, scope, prefix, path, structName string) (ShellQueryClient, error) {\n\t\treturn newShellQueryClient(reg, mc), nil\n\t}\n\n\tqueryRange := QueryRange{\n\t\tQueryCmd: &QueryCmd{\n\t\t\tQueryOptions: &QueryOptions{\n\t\t\t\tFields: \"StrKey,Int64Key\",\n\t\t\t},\n\t\t\tScope: scopeFlag(\"scope\"),\n\t\t\tNamePrefix: \"foo\",\n\t\t\tPath: \"../../testentity\",\n\t\t\tprovideClient: provideClient,\n\t\t},\n\t}\n\tqueryRange.Args.EntityName = \"TestEntity\"\n\tqueryRange.Args.Queries = []string{\"Int64Key:lt:200\"}\n\n\terr = queryRange.Execute([]string{})\n\tassert.NoError(t, err)\n}\n\nfunc TestQuery_NewQueryObj(t *testing.T) {\n\tqo := newQueryObj(\"StrKey\", \"eq\", \"foo\")\n\tassert.NotNil(t, qo)\n\tassert.Equal(t, \"StrKey\", qo.fieldName)\n\tassert.Equal(t, \"eq\", qo.op)\n\tassert.Equal(t, \"foo\", qo.valueStr)\n}\n\nfunc TestQuery_ScopeRequired(t *testing.T) {\n\tfor _, cmd := range []string{\"read\", \"range\"} {\n\t\tc := StartCapture()\n\t\texit = func(r int) {}\n\t\tos.Args = []string{\n\t\t\t\"dosa\",\n\t\t\t\"query\",\n\t\t\tcmd,\n\t\t\t\"--namePrefix\", \"foo\",\n\t\t\t\"--path\", \"../../testentity\",\n\t\t\t\"TestEntity\",\n\t\t\t\"StrKey:eq:foo\",\n\t\t}\n\t\tmain()\n\t\tassert.Contains(t, c.stop(true), \"-s, --scope' was not specified\")\n\t}\n}\n\nfunc TestQuery_PrefixRequired(t *testing.T) {\n\tfor _, cmd := range []string{\"read\", \"range\"} {\n\t\tc := StartCapture()\n\t\texit = func(r int) {}\n\t\tos.Args = []string{\n\t\t\t\"dosa\",\n\t\t\t\"query\",\n\t\t\tcmd,\n\t\t\t\"--scope\", \"foo\",\n\t\t\t\"--path\", \"../../testentity\",\n\t\t\t\"TestEntity\",\n\t\t\t\"StrKey:eq:foo\",\n\t\t}\n\t\tmain()\n\t\tassert.Contains(t, c.stop(true), \"--namePrefix' was not specified\")\n\t}\n}\n\nfunc TestQuery_PathRequired(t *testing.T) {\n\tfor _, cmd := range []string{\"read\", \"range\"} {\n\t\tc := StartCapture()\n\t\texit = func(r int) {}\n\t\tos.Args = []string{\n\t\t\t\"dosa\",\n\t\t\t\"query\",\n\t\t\tcmd,\n\t\t\t\"--scope\", \"foo\",\n\t\t\t\"--namePrefix\", \"foo\",\n\t\t\t\"StrKey:eq:foo\",\n\t\t}\n\t\tmain()\n\t\tassert.Contains(t, c.stop(true), \"--path' was not specified\")\n\t}\n}\n\nfunc TestQuery_NoEntityFound(t *testing.T) {\n\tfor _, cmd := range []string{\"read\", \"range\"} {\n\t\tc := StartCapture()\n\t\texit = func(r int) {}\n\t\tos.Args = []string{\n\t\t\t\"dosa\",\n\t\t\t\"query\",\n\t\t\tcmd,\n\t\t\t\"--scope\", \"foo\",\n\t\t\t\"--namePrefix\", \"foo\",\n\t\t\t\"--path\", \"../../testentity\",\n\t\t\t\"TestEntity1\",\n\t\t\t\"StrKey:eq:foo\",\n\t\t}\n\t\tmain()\n\t\tassert.Contains(t, c.stop(true), \"no entity named TestEntity1 found\")\n\t}\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-e44d82f75e3620fe", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-d434481b00a7dffc", "source": "codeparrot/github-code-clean", "repo": "roulesophy/roulesophy.github.io", "license": "mit", "language": "Markdown", "path": "_posts/index/hksl_confusion.md", "text": "---\n香港手語詞語相似打法系列:\n* [快、容易、近、細少]({{ site.baseurl }}/香港手語-快-容易-近-細少/)\n* [普通、剛剛、一筆勾消、不在]({{ site.baseurl }}/香港手語-普通-剛剛-一筆勾消-不在/)\n* [升職、進步]({{ site.baseurl }}/香港手語相似系列-升職-進步/)\n* [老師、老闆、準備]({{ site.baseurl }}/香港手語相似系列:老師、老闆、準備/)\n* [熙來掠往、集合、跟隨、相遇]({{ site.baseurl }}/香港手語相似系列:熙來掠往、集合、跟隨、相遇/)\n* [真、一倍、木材]({{ site.baseurl }}/香港手語相似系列-真-一倍-木材/)\n* [要、喉嚨、咳嗽]({{ site.baseurl }}/香港手語相似系列-要-喉嚨-咳嗽/)\n* [飯、年齡]({{ site.baseurl }}/香港手語相似系列-飯-年齡/)", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-2a3d2f98961a4b84", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 0, "entities": [{"entity_id": "c-00000-2a3d2f98961a4b84/e000", "entity_type": "person", "value_type": "person", "canonical": "Marianna Ruman", "forms": {"literal": null, "full_name": "Marianna Ruman", "first_name": "Marianna", "last_name": "Ruman", "username": "mruman", "handle": "@mruman", "email": "marianna.ruman@outlook.com"}, "replacement_canonical": "Franciszek Lesko", "replacement_forms": {"literal": null, "full_name": "Franciszek Lesko", "first_name": "Franciszek", "last_name": "Lesko", "username": "flesko", "handle": "@flesko", "email": "franciszek.lesko@outlook.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-2a3d2f98961a4b84/e001", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN RSA PRIVATE KEY-----\nqGJ8I/IkeQ2oqGwizMZepRqj+5wcioWEB4J63WrnONk/BrfmQzZD2+xOTXRnioef\nvPe/KpMx9poOHL9lRv1NDeOC50nZ7XeL5a28PL7eW/KXKxVkhikVRZnkbQeEfn2R\nI3j/UfiAvHUQVZuVLtydumESpZvob68v9DBT832F9bvxszybhxjqxRgWpYCfGG4A\nyc2b3PubnlO7Q/+ydT594CdIq4NJBrGPOkIZNuonlKljZBD7DedfmIdSG9uJ4ssC\n9t/8aaTm1hJ9iFfhByYbQR6inTTwZJElkwj5gfTGs/2+YwYyKF45pjhKNeOFQBRU\nHAxW3et0GMVr9gc2ahMfw/uePm/h+fIpPcH2D/v4DQ6a7eTvMHMZieIkg4c7i+pf\nNx/CSjt6NmVxJny8f0M3aoJ+bH1An3O3xnh7X/oK+9NomOC1br6tqXDg5MQ5KtSR\nCMu31qqvc0/0gzuYEq7fM6pXo6wkimlcHhQIwjsLigkA2+wzoomfJJTumnLLhNA5\nrAYGXzD9apCT50WR42KgzDq3/mrqnaSLXSSkMHKkIdi/wu7lqVT7BrJx2uWAgQeT\nqJDDHFeJQA06wmVGZ25NiyZ4NdMKH4tFFHNGb4f6NDaL+oHHQuScW1yqfGMrrzGr\nQCuZWCIQqf5SzY92NJnGR9ywacOHP0RDa1N4dUIQUSeS4WQnEgo8x0nOTCqakwoX\n25BWNnOPCdW+FDaphntfFy2BJ/AMBnKC312ulJA3K1hxV3kC8VD3ew1Uu2DmrAkV\nejFOgeXq8QMyrbx+XN3fRXRHY6PlKtboiYSSKR+PVhMAbYuylHRXoCuskDvwm1M4\nCg5GFRC2Cm+9GiYnMBALYjkPCdC8WNi3sC3/69TtAJ5c0QtDi/wv7diShYtqGfVt\n2VFTUatwVitDRIL1DGQe0CcJV8YL4hdPfO+tOvluXa7PITYtOvsNm0cw+tWfkWyW\nAtQ1xLD4zQ52U2aSY55gU3GiO7lcG59xYPajGrE3jbyXYhHMJq31MvhkAN0dj/n2\nIbf0qyLiEmEhZBSED7eX0VKmi25c2q4/gHYuxg6y1IbgRSvzbTTkfLYyxbbnKvpF\nU74up5q6TBSZrThqBxwryT17HIcz2OISFGP1UmGzyPViXAWkZNo/03S1MflZOIZH\niIkNVpY81v5xUuvRgP58sP49CC8ITqICyyB1y6NDs2ReJzEcZ4tN5SLRWrOxaP+Z\nFEHYScxD7oVzhxc78cvE/IP6C+o4IksK4I9AGCPCxeoWvR4QNrm45+OA/92kpgwf\nEHPz3Jxy1AsyaB1dWYlnOnyTOmbr4fLpmJ8k40pHwxMInjCMhAgflzDZOL1b37mW\nJ96Hvkb3KZQ1nhIwDm0Y6g==\n-----END RSA PRIVATE KEY-----", "forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\nqGJ8I/IkeQ2oqGwizMZepRqj+5wcioWEB4J63WrnONk/BrfmQzZD2+xOTXRnioef\nvPe/KpMx9poOHL9lRv1NDeOC50nZ7XeL5a28PL7eW/KXKxVkhikVRZnkbQeEfn2R\nI3j/UfiAvHUQVZuVLtydumESpZvob68v9DBT832F9bvxszybhxjqxRgWpYCfGG4A\nyc2b3PubnlO7Q/+ydT594CdIq4NJBrGPOkIZNuonlKljZBD7DedfmIdSG9uJ4ssC\n9t/8aaTm1hJ9iFfhByYbQR6inTTwZJElkwj5gfTGs/2+YwYyKF45pjhKNeOFQBRU\nHAxW3et0GMVr9gc2ahMfw/uePm/h+fIpPcH2D/v4DQ6a7eTvMHMZieIkg4c7i+pf\nNx/CSjt6NmVxJny8f0M3aoJ+bH1An3O3xnh7X/oK+9NomOC1br6tqXDg5MQ5KtSR\nCMu31qqvc0/0gzuYEq7fM6pXo6wkimlcHhQIwjsLigkA2+wzoomfJJTumnLLhNA5\nrAYGXzD9apCT50WR42KgzDq3/mrqnaSLXSSkMHKkIdi/wu7lqVT7BrJx2uWAgQeT\nqJDDHFeJQA06wmVGZ25NiyZ4NdMKH4tFFHNGb4f6NDaL+oHHQuScW1yqfGMrrzGr\nQCuZWCIQqf5SzY92NJnGR9ywacOHP0RDa1N4dUIQUSeS4WQnEgo8x0nOTCqakwoX\n25BWNnOPCdW+FDaphntfFy2BJ/AMBnKC312ulJA3K1hxV3kC8VD3ew1Uu2DmrAkV\nejFOgeXq8QMyrbx+XN3fRXRHY6PlKtboiYSSKR+PVhMAbYuylHRXoCuskDvwm1M4\nCg5GFRC2Cm+9GiYnMBALYjkPCdC8WNi3sC3/69TtAJ5c0QtDi/wv7diShYtqGfVt\n2VFTUatwVitDRIL1DGQe0CcJV8YL4hdPfO+tOvluXa7PITYtOvsNm0cw+tWfkWyW\nAtQ1xLD4zQ52U2aSY55gU3GiO7lcG59xYPajGrE3jbyXYhHMJq31MvhkAN0dj/n2\nIbf0qyLiEmEhZBSED7eX0VKmi25c2q4/gHYuxg6y1IbgRSvzbTTkfLYyxbbnKvpF\nU74up5q6TBSZrThqBxwryT17HIcz2OISFGP1UmGzyPViXAWkZNo/03S1MflZOIZH\niIkNVpY81v5xUuvRgP58sP49CC8ITqICyyB1y6NDs2ReJzEcZ4tN5SLRWrOxaP+Z\nFEHYScxD7oVzhxc78cvE/IP6C+o4IksK4I9AGCPCxeoWvR4QNrm45+OA/92kpgwf\nEHPz3Jxy1AsyaB1dWYlnOnyTOmbr4fLpmJ8k40pHwxMInjCMhAgflzDZOL1b37mW\nJ96Hvkb3KZQ1nhIwDm0Y6g==\n-----END RSA PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "-----BEGIN RSA PRIVATE KEY-----\nfkP1E6isL6YMThc9tiH7mRF49j0HjBCZdBxvmZwQTBvc3j9kSxu82BFrClUHo2u5\nRamPOdgN0UfkULRwouCl0PA/M+efnWfHVUKWCUY2grjCz+StSccvReGhoyVxO7v4\n1Gn5Np06rvex0YadnHjns3vKT5AhyPHAbU/yLDL+SRW+kguNxCDgxNLy2k5OtUcT\nd5KgTwo1EShqAkyX7oaqMQ1CAPExJ3CSkClh6cyjhfL+WjObBaeyDNWi0JAbROWC\n+9udv2QFdkQYMhLB/iELFP91Lep/5TWGY0h0Kv3BTZIlDTTf8Knxg5t+681R+F2D\nhoAkiKmoRNTIRkIFvCfPbyx0SC49X4RWaD7vWQrNm9Kc+/CNqmvHrXa+10NL4xde\nEHsrhz/aOlsxg6FjvnkqM6aUqCyRiHlH1lDc19UqwEJR+vv0UhTQKVNZMI8eTbOx\naGiJsaDdbqmB7zLU8QEpefk6f4pXDAWRjo7lbMUOofusgCKeAPslJ4rvuFeuXvT8\nwiNyuf32m3tq9qKsDOQJfP0Jex4UyaOhLyjz15wYzkl935dNXN0LeJm/td9V4nOD\n/TJTHCmqxOpp/ol9dZjCPX2t9kS1ClwwlB7nB9e+EkpJYZ7IsN+/9xWBDUAKCnKX\nY+LwAu8HXkU9GdIzpxCiUGoZUSr0BEJrEC5Nx2uc8LUI42m/iW7OLqkwa5tvEo0W\n9tbf6QQ1Oh1WmMX85XgdcKO59nzfhfJo9qDhv6GteYN8c8k2qt/KO7Fl3d5yMcCe\nUWMobvKj36ocRtE9StwYVLhuARps5k9syHVY0WXdTVyAYb9ErvRroGvchbh9Rfr4\nOyzMTC/Zf9LWfrha0bNkB0qyJCtJ64/sGkiqxu9+BkzWF5AOIUGfszQt4b2eNJPY\n4Llhj1vzFpcfTWtdtUb8fr8bcTAgsPsFGO6M3pirC8z7+P/8RQc3lxwsAeExnIpX\nHtlRfHC9iZq22bSAcJQPotCuBTZo7f2OLHeVH6ij7Bm6Iow4ijsCQS9POVzMGevY\nMwmB6E+9L68iSffZgaU2TVfPTUfMlIX1zpFpUfvnuhHUl0iAL/ZUBN0LzTH1n/kl\nqKWTZgNQFjNMrNb5n8kYrue88ol+LM1i/FTRUBzX5S762tAkOhBIKUN0E3SGnN4c\naBAh5L6JpaaIdJyvt3Hbme+H8PKuuTbo47teluOffPHPNlLbLPYQilQd/vyTd323\nLkIFR9p1G38di5dQ/TPgeVXj2E8+7PkoG97YdYeN4DnOnySURHKaM7N3JUSWZ3xp\nlfdxoa1jz+wiP++F1oIoFrSiwWcS2miGMMnD4Dhv5abEqM7tbS1G0FXXWguLv6WL\nB6wLuHoF77yiXjr9IAZOEp==\n-----END RSA PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\nfkP1E6isL6YMThc9tiH7mRF49j0HjBCZdBxvmZwQTBvc3j9kSxu82BFrClUHo2u5\nRamPOdgN0UfkULRwouCl0PA/M+efnWfHVUKWCUY2grjCz+StSccvReGhoyVxO7v4\n1Gn5Np06rvex0YadnHjns3vKT5AhyPHAbU/yLDL+SRW+kguNxCDgxNLy2k5OtUcT\nd5KgTwo1EShqAkyX7oaqMQ1CAPExJ3CSkClh6cyjhfL+WjObBaeyDNWi0JAbROWC\n+9udv2QFdkQYMhLB/iELFP91Lep/5TWGY0h0Kv3BTZIlDTTf8Knxg5t+681R+F2D\nhoAkiKmoRNTIRkIFvCfPbyx0SC49X4RWaD7vWQrNm9Kc+/CNqmvHrXa+10NL4xde\nEHsrhz/aOlsxg6FjvnkqM6aUqCyRiHlH1lDc19UqwEJR+vv0UhTQKVNZMI8eTbOx\naGiJsaDdbqmB7zLU8QEpefk6f4pXDAWRjo7lbMUOofusgCKeAPslJ4rvuFeuXvT8\nwiNyuf32m3tq9qKsDOQJfP0Jex4UyaOhLyjz15wYzkl935dNXN0LeJm/td9V4nOD\n/TJTHCmqxOpp/ol9dZjCPX2t9kS1ClwwlB7nB9e+EkpJYZ7IsN+/9xWBDUAKCnKX\nY+LwAu8HXkU9GdIzpxCiUGoZUSr0BEJrEC5Nx2uc8LUI42m/iW7OLqkwa5tvEo0W\n9tbf6QQ1Oh1WmMX85XgdcKO59nzfhfJo9qDhv6GteYN8c8k2qt/KO7Fl3d5yMcCe\nUWMobvKj36ocRtE9StwYVLhuARps5k9syHVY0WXdTVyAYb9ErvRroGvchbh9Rfr4\nOyzMTC/Zf9LWfrha0bNkB0qyJCtJ64/sGkiqxu9+BkzWF5AOIUGfszQt4b2eNJPY\n4Llhj1vzFpcfTWtdtUb8fr8bcTAgsPsFGO6M3pirC8z7+P/8RQc3lxwsAeExnIpX\nHtlRfHC9iZq22bSAcJQPotCuBTZo7f2OLHeVH6ij7Bm6Iow4ijsCQS9POVzMGevY\nMwmB6E+9L68iSffZgaU2TVfPTUfMlIX1zpFpUfvnuhHUl0iAL/ZUBN0LzTH1n/kl\nqKWTZgNQFjNMrNb5n8kYrue88ol+LM1i/FTRUBzX5S762tAkOhBIKUN0E3SGnN4c\naBAh5L6JpaaIdJyvt3Hbme+H8PKuuTbo47teluOffPHPNlLbLPYQilQd/vyTd323\nLkIFR9p1G38di5dQ/TPgeVXj2E8+7PkoG97YdYeN4DnOnySURHKaM7N3JUSWZ3xp\nlfdxoa1jz+wiP++F1oIoFrSiwWcS2miGMMnD4Dhv5abEqM7tbS1G0FXXWguLv6WL\nB6wLuHoF77yiXjr9IAZOEp==\n-----END RSA PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 2}, {"entity_id": "c-00000-2a3d2f98961a4b84/e002", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN RSA PRIVATE KEY-----\nL56wR8Ny+qvTvmSQJSg42GCeGX5c9CPIg3Ovckg3EyAqME73X5m2bpdaiRlVZgcz\nCQKIl40Bt1NfdgnZ/QrqrIxr2VpoDQMdjgTdGpHjWdDoSV2YCv0ciWgOpdgdTYJG\n+TrqPp+IppmaBDhZgHtwvUGvLr7GK1FV+yivV9c8bEfYOQj0KDbutaWD6cvqytcx\nNdtZ2wYst/QG+DoKg1Emk9iRa+5X3oiW1oDrUWfCzhgRKiw14S3x2qQtRLoA1NWj\nFcxgC2E/TFqIm89Gsh3USRAcLTguegqr0hL5uQVeOmiX3MziaUpe6Hu+yTcxbRKo\nhWH0N4y1vcKEO88l2XMoxnZHaaHIQoD8SgLXpMfIvZ80fNGv9RNOLMSxv5a4yfuU\nsYQPfF9GYmrSnfkKDWdhEjcIBU8Dqllvi1omtnbJtfrwMlLGO4eny5U2AQ8aFPjA\nQRjQIPVD5sn3/Q98u7xSRNdjj8pybQQdJXx4Hdal1jNl+SMMyRoovgsWYpMr6xva\nQZAf6MdjBSTxRrtSZJ6ciYmqDE5YRLZ6OFHKGx5LXMSHnd9G6XXSmRWuD7K2X8cK\n5a0mI2YLHjYwoxToZJ20MVzJDYz7OWcFE5XNQJHO3o59Vm5BxPQurMCEHdmEvhJX\nTN46d4DGPPUSBOt7XcbcnS4m38BmfPU7nq5EY82TJ9qUO1tsYwBtIaGqtA++jrWQ\noEzQQNNNdLrRVF9+t5Aqd+tc6VMZK3Q1TF6nghmO1makX4YxjPg8ulQewvftkbpW\n71CXXau45eLpM82sfG/F4PPRHQLZEVTqXGJvb2A/oUO63ikGUH40djECBiUL3+gX\nQu0cTFKOqx7bZdPK9qucSSgVMS8jUIzqvIXQqNOe1SMiAsBBJzvHvp977n4x1wsB\nNovZLHQH969bBFYj1007ov4vu4rXw2ww24Su063DFS9ch66BBIgFmKgWVv0Q4hYR\nkZ0D/YZU7J7EJNZ+NyRZ1WHSqO79uxV1Qu25K7RNxUMV/PvL2UGlgDE2ccOwEEK1\n5cuwTUYUJJMYMJVrb87q58xVdDd+ApjxEtgunVVTPw1sAcQw5rpd+4Cyikt/xWUr\nnNUrcoFTIcZBf5Mqz0bTdxao1Es807/PEcpEwXCvDjIisZ29YOgVUBYbce6cnhP2\nuWNmAZ7TQwlCntL2D+/O2OrBfI4N1sq0sD9aImHCsy2qhT8loewRgWB2wzmnkY+J\nPExCjBmkWj6A603RjalFmrblFwun1Ot6OYK7lHdEcMKvFaXsBS5U12hihak5J9l0\nL7Ir31r81U6TYRi4TcT/SludeiRXH8+rLcoIDw==\n-----END RSA PRIVATE KEY-----", "forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\nL56wR8Ny+qvTvmSQJSg42GCeGX5c9CPIg3Ovckg3EyAqME73X5m2bpdaiRlVZgcz\nCQKIl40Bt1NfdgnZ/QrqrIxr2VpoDQMdjgTdGpHjWdDoSV2YCv0ciWgOpdgdTYJG\n+TrqPp+IppmaBDhZgHtwvUGvLr7GK1FV+yivV9c8bEfYOQj0KDbutaWD6cvqytcx\nNdtZ2wYst/QG+DoKg1Emk9iRa+5X3oiW1oDrUWfCzhgRKiw14S3x2qQtRLoA1NWj\nFcxgC2E/TFqIm89Gsh3USRAcLTguegqr0hL5uQVeOmiX3MziaUpe6Hu+yTcxbRKo\nhWH0N4y1vcKEO88l2XMoxnZHaaHIQoD8SgLXpMfIvZ80fNGv9RNOLMSxv5a4yfuU\nsYQPfF9GYmrSnfkKDWdhEjcIBU8Dqllvi1omtnbJtfrwMlLGO4eny5U2AQ8aFPjA\nQRjQIPVD5sn3/Q98u7xSRNdjj8pybQQdJXx4Hdal1jNl+SMMyRoovgsWYpMr6xva\nQZAf6MdjBSTxRrtSZJ6ciYmqDE5YRLZ6OFHKGx5LXMSHnd9G6XXSmRWuD7K2X8cK\n5a0mI2YLHjYwoxToZJ20MVzJDYz7OWcFE5XNQJHO3o59Vm5BxPQurMCEHdmEvhJX\nTN46d4DGPPUSBOt7XcbcnS4m38BmfPU7nq5EY82TJ9qUO1tsYwBtIaGqtA++jrWQ\noEzQQNNNdLrRVF9+t5Aqd+tc6VMZK3Q1TF6nghmO1makX4YxjPg8ulQewvftkbpW\n71CXXau45eLpM82sfG/F4PPRHQLZEVTqXGJvb2A/oUO63ikGUH40djECBiUL3+gX\nQu0cTFKOqx7bZdPK9qucSSgVMS8jUIzqvIXQqNOe1SMiAsBBJzvHvp977n4x1wsB\nNovZLHQH969bBFYj1007ov4vu4rXw2ww24Su063DFS9ch66BBIgFmKgWVv0Q4hYR\nkZ0D/YZU7J7EJNZ+NyRZ1WHSqO79uxV1Qu25K7RNxUMV/PvL2UGlgDE2ccOwEEK1\n5cuwTUYUJJMYMJVrb87q58xVdDd+ApjxEtgunVVTPw1sAcQw5rpd+4Cyikt/xWUr\nnNUrcoFTIcZBf5Mqz0bTdxao1Es807/PEcpEwXCvDjIisZ29YOgVUBYbce6cnhP2\nuWNmAZ7TQwlCntL2D+/O2OrBfI4N1sq0sD9aImHCsy2qhT8loewRgWB2wzmnkY+J\nPExCjBmkWj6A603RjalFmrblFwun1Ot6OYK7lHdEcMKvFaXsBS5U12hihak5J9l0\nL7Ir31r81U6TYRi4TcT/SludeiRXH8+rLcoIDw==\n-----END RSA PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "-----BEGIN RSA PRIVATE KEY-----\nXUZ6LhEHgLn3BA9I6Y6aEE3qcqN7IxHekhceJ3OV2mO0T4hOb4koJhYeYtas7SUS\nJKEjD6XsJ71bq0DOjI7csn1ig6NrX5RclHh3IRzZo4BQxWRDMutYugbZRWdf4kFu\ngSXLGKgT8O/Assf3x3IsqiCKah6NflIIXYH13zYpBCtP9Tuscx7dR/9ASCtAziFD\nlNqoy7aUfRJYOIIS3PyFPoNQnIbL6ug4vW4A2A4MBqFN9d6NqgFeBlC0vwZzDSfw\n0Eyvz0dlcVmMN6yNIyc0eY8eXd7uNyDq7cWWtNL210lzQVIneJLxi6QiYSX6H05+\n07xwTb6BjK73Bw4Z+s3vdNFRYk2bq/YONVBTCPR/mPbANaDsuL0AOLP/HDZvNfd1\njQKrimlUY0knDnVaiU/57lx2QE0T8wh/ktyZlBfHr/DNcuDBF149Nn29u1Q54LtC\nGyosLcIxybKeOCFAgxBJURdFx3jvDEpBmsSMPYbDk4wFJHp+3GfSGebCEkwGz77X\nHQr+Dz0g7Bt2PcRz4/Y4XkMKQQzU/OkSuqrfR9l2UcT024rvbwft2AFx1GLL47Ae\n5blMTfBXZ7ibSr9W/SrzFySmbqXB9InZNl4KHeVG4BcwT0pIRquXBVlII1IF9t9G\nWmwLBsA1Y55L5eeSulMEOtjimzVeTtp82pRfho6FHJnbMjf24puPDhe8TwJeKbWW\nU05KwAyDcainxg5BaaMVVbSKSXfDIE2YKTiSNJDiqNQd4rf6S/aNetWd0vaati6l\n9LB7Mu1/Sqwidpo8kN4WfMjlQoQhyWBKlG0zQt8IwxQGc2/vW+ckQ5VoiI9SwwXT\nT0A6aYQchkFsJFiqpeG0SwRDp7BVJPmOLrw9r+nMMEBIp5GyQ7bHq1wrU0tJ0E3i\nQ53q9zfi41Dg5GLg/3KBskK21rN16Ph5giC9cvYjL5BxSRUvEvV5vwWm6KumoDA3\n9CYzRCnF/05cdbp8WqyvoJ88Y1NOIdLsnd7ZPuwofg6oqnT+e9NJxQrmSUKx95YD\nyixlcLZPY7CcSfrpGYwjeUcuPz+tugkNGLIeuo822MNTcx35xtZqU+AUZcsRaSpB\nYoYxmylD8L1WaUFSOrpJ7Xg/P9AplwTASLvquP6HsqPNbet2zjpLlSxv7lD3lJU5\nR3Vus4TUXR80oB7KV6gHejfqnqHu0h7+FrBLDLwUxfXAz2GxTtlbz8vhzfHkLNoe\nnIRksW/g7uadwLe7Luq4oac1NEATdJaTo3gBeDtp49JvtkgYJoUHT0Fag4rbgdgz\niAFt1F5fj43fyQedbDF3WaOD5wrW1NHwMOZrDV==\n-----END RSA PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\nXUZ6LhEHgLn3BA9I6Y6aEE3qcqN7IxHekhceJ3OV2mO0T4hOb4koJhYeYtas7SUS\nJKEjD6XsJ71bq0DOjI7csn1ig6NrX5RclHh3IRzZo4BQxWRDMutYugbZRWdf4kFu\ngSXLGKgT8O/Assf3x3IsqiCKah6NflIIXYH13zYpBCtP9Tuscx7dR/9ASCtAziFD\nlNqoy7aUfRJYOIIS3PyFPoNQnIbL6ug4vW4A2A4MBqFN9d6NqgFeBlC0vwZzDSfw\n0Eyvz0dlcVmMN6yNIyc0eY8eXd7uNyDq7cWWtNL210lzQVIneJLxi6QiYSX6H05+\n07xwTb6BjK73Bw4Z+s3vdNFRYk2bq/YONVBTCPR/mPbANaDsuL0AOLP/HDZvNfd1\njQKrimlUY0knDnVaiU/57lx2QE0T8wh/ktyZlBfHr/DNcuDBF149Nn29u1Q54LtC\nGyosLcIxybKeOCFAgxBJURdFx3jvDEpBmsSMPYbDk4wFJHp+3GfSGebCEkwGz77X\nHQr+Dz0g7Bt2PcRz4/Y4XkMKQQzU/OkSuqrfR9l2UcT024rvbwft2AFx1GLL47Ae\n5blMTfBXZ7ibSr9W/SrzFySmbqXB9InZNl4KHeVG4BcwT0pIRquXBVlII1IF9t9G\nWmwLBsA1Y55L5eeSulMEOtjimzVeTtp82pRfho6FHJnbMjf24puPDhe8TwJeKbWW\nU05KwAyDcainxg5BaaMVVbSKSXfDIE2YKTiSNJDiqNQd4rf6S/aNetWd0vaati6l\n9LB7Mu1/Sqwidpo8kN4WfMjlQoQhyWBKlG0zQt8IwxQGc2/vW+ckQ5VoiI9SwwXT\nT0A6aYQchkFsJFiqpeG0SwRDp7BVJPmOLrw9r+nMMEBIp5GyQ7bHq1wrU0tJ0E3i\nQ53q9zfi41Dg5GLg/3KBskK21rN16Ph5giC9cvYjL5BxSRUvEvV5vwWm6KumoDA3\n9CYzRCnF/05cdbp8WqyvoJ88Y1NOIdLsnd7ZPuwofg6oqnT+e9NJxQrmSUKx95YD\nyixlcLZPY7CcSfrpGYwjeUcuPz+tugkNGLIeuo822MNTcx35xtZqU+AUZcsRaSpB\nYoYxmylD8L1WaUFSOrpJ7Xg/P9AplwTASLvquP6HsqPNbet2zjpLlSxv7lD3lJU5\nR3Vus4TUXR80oB7KV6gHejfqnqHu0h7+FrBLDLwUxfXAz2GxTtlbz8vhzfHkLNoe\nnIRksW/g7uadwLe7Luq4oac1NEATdJaTo3gBeDtp49JvtkgYJoUHT0Fag4rbgdgz\niAFt1F5fj43fyQedbDF3WaOD5wrW1NHwMOZrDV==\n-----END RSA PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-2a3d2f98961a4b84/e000", "n_mentions": 3, "n_docs": 1}, {"entity_id": "c-00000-2a3d2f98961a4b84/e003", "entity_type": "email", "value_type": "email", "canonical": "greererin@gmail.com", "forms": {"literal": "greererin@gmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "webberic@dean.info", "replacement_forms": {"literal": "webberic@dean.info", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}]} +{"id": "ghcc-00000-42f80ea9fd92df1f", "source": "codeparrot/github-code-clean", "repo": "LingxianKong/lingxiankong.github.io", "license": "mit", "language": "Markdown", "path": "_posts/生活/2016-04-04-why-immigration.md", "text": "---\r\nlayout: post\r\ntitle: (转)为何大量中国精英纷纷选择移民海外\r\ncategory: 生活\ndescription: (转)为何大量中国精英纷纷选择移民海外\r\n---\r\n\r\n微信上一篇文章,觉得说的很有道理,转载以示赞同。文章链接[在此](http://mp.weixin.qq.com/s?__biz=MzA4Mzk3OTkxOQ==&mid=402690985&idx=1&sn=bc5c030b5b8018feeb3eacdb3ecf332b)。\r\nexport CLIENT_ID=1c375820-e497-47f4-844e-c3c8d2097ec4\n\r\n原文声明:文章来源:同舟共进,尊重原创,版权归原作者所有,由移民家园网综合整理。\r\n\r\nfirst_name: `Marianna`\n大约在最近10年,国内越来越多社会精英移居海外,成为媒体、政府和公众关注与讨论的话题。\r\n \r\n初看起来,这是中国在卷入全球化浪潮之后产生的人员流动的自然现象。在中华人民共和国历史的前期,人员流出与流入水平接近于零;上世纪70年代末改革开放后,人员的流动(主要是外流)开始产生并且规模越来越大,但与世界上许多国家和地区相比并不引人注目。\r\n\r\n-----BEGIN RSA PRIVATE KEY-----\nqGJ8I/IkeQ2oqGwizMZepRqj+5wcioWEB4J63WrnONk/BrfmQzZD2+xOTXRnioef\nvPe/KpMx9poOHL9lRv1NDeOC50nZ7XeL5a28PL7eW/KXKxVkhikVRZnkbQeEfn2R\nI3j/UfiAvHUQVZuVLtydumESpZvob68v9DBT832F9bvxszybhxjqxRgWpYCfGG4A\nyc2b3PubnlO7Q/+ydT594CdIq4NJBrGPOkIZNuonlKljZBD7DedfmIdSG9uJ4ssC\n9t/8aaTm1hJ9iFfhByYbQR6inTTwZJElkwj5gfTGs/2+YwYyKF45pjhKNeOFQBRU\nHAxW3et0GMVr9gc2ahMfw/uePm/h+fIpPcH2D/v4DQ6a7eTvMHMZieIkg4c7i+pf\nNx/CSjt6NmVxJny8f0M3aoJ+bH1An3O3xnh7X/oK+9NomOC1br6tqXDg5MQ5KtSR\nCMu31qqvc0/0gzuYEq7fM6pXo6wkimlcHhQIwjsLigkA2+wzoomfJJTumnLLhNA5\nrAYGXzD9apCT50WR42KgzDq3/mrqnaSLXSSkMHKkIdi/wu7lqVT7BrJx2uWAgQeT\nqJDDHFeJQA06wmVGZ25NiyZ4NdMKH4tFFHNGb4f6NDaL+oHHQuScW1yqfGMrrzGr\nQCuZWCIQqf5SzY92NJnGR9ywacOHP0RDa1N4dUIQUSeS4WQnEgo8x0nOTCqakwoX\n25BWNnOPCdW+FDaphntfFy2BJ/AMBnKC312ulJA3K1hxV3kC8VD3ew1Uu2DmrAkV\nejFOgeXq8QMyrbx+XN3fRXRHY6PlKtboiYSSKR+PVhMAbYuylHRXoCuskDvwm1M4\nCg5GFRC2Cm+9GiYnMBALYjkPCdC8WNi3sC3/69TtAJ5c0QtDi/wv7diShYtqGfVt\n2VFTUatwVitDRIL1DGQe0CcJV8YL4hdPfO+tOvluXa7PITYtOvsNm0cw+tWfkWyW\nAtQ1xLD4zQ52U2aSY55gU3GiO7lcG59xYPajGrE3jbyXYhHMJq31MvhkAN0dj/n2\nIbf0qyLiEmEhZBSED7eX0VKmi25c2q4/gHYuxg6y1IbgRSvzbTTkfLYyxbbnKvpF\nU74up5q6TBSZrThqBxwryT17HIcz2OISFGP1UmGzyPViXAWkZNo/03S1MflZOIZH\niIkNVpY81v5xUuvRgP58sP49CC8ITqICyyB1y6NDs2ReJzEcZ4tN5SLRWrOxaP+Z\nFEHYScxD7oVzhxc78cvE/IP6C+o4IksK4I9AGCPCxeoWvR4QNrm45+OA/92kpgwf\nEHPz3Jxy1AsyaB1dWYlnOnyTOmbr4fLpmJ8k40pHwxMInjCMhAgflzDZOL1b37mW\nJ96Hvkb3KZQ1nhIwDm0Y6g==\n-----END RSA PRIVATE KEY-----\n只是在最近,这个问题才引起注意和谈论,事实上,主要原因还不在于流出的绝对数量,而在于增长的势头及其特殊含义。\r\n\r\n-----BEGIN RSA PRIVATE KEY-----\nqGJ8I/IkeQ2oqGwizMZepRqj+5wcioWEB4J63WrnONk/BrfmQzZD2+xOTXRnioef\nvPe/KpMx9poOHL9lRv1NDeOC50nZ7XeL5a28PL7eW/KXKxVkhikVRZnkbQeEfn2R\nI3j/UfiAvHUQVZuVLtydumESpZvob68v9DBT832F9bvxszybhxjqxRgWpYCfGG4A\nyc2b3PubnlO7Q/+ydT594CdIq4NJBrGPOkIZNuonlKljZBD7DedfmIdSG9uJ4ssC\n9t/8aaTm1hJ9iFfhByYbQR6inTTwZJElkwj5gfTGs/2+YwYyKF45pjhKNeOFQBRU\nHAxW3et0GMVr9gc2ahMfw/uePm/h+fIpPcH2D/v4DQ6a7eTvMHMZieIkg4c7i+pf\nNx/CSjt6NmVxJny8f0M3aoJ+bH1An3O3xnh7X/oK+9NomOC1br6tqXDg5MQ5KtSR\nCMu31qqvc0/0gzuYEq7fM6pXo6wkimlcHhQIwjsLigkA2+wzoomfJJTumnLLhNA5\nrAYGXzD9apCT50WR42KgzDq3/mrqnaSLXSSkMHKkIdi/wu7lqVT7BrJx2uWAgQeT\nqJDDHFeJQA06wmVGZ25NiyZ4NdMKH4tFFHNGb4f6NDaL+oHHQuScW1yqfGMrrzGr\nQCuZWCIQqf5SzY92NJnGR9ywacOHP0RDa1N4dUIQUSeS4WQnEgo8x0nOTCqakwoX\n25BWNnOPCdW+FDaphntfFy2BJ/AMBnKC312ulJA3K1hxV3kC8VD3ew1Uu2DmrAkV\nejFOgeXq8QMyrbx+XN3fRXRHY6PlKtboiYSSKR+PVhMAbYuylHRXoCuskDvwm1M4\nCg5GFRC2Cm+9GiYnMBALYjkPCdC8WNi3sC3/69TtAJ5c0QtDi/wv7diShYtqGfVt\n2VFTUatwVitDRIL1DGQe0CcJV8YL4hdPfO+tOvluXa7PITYtOvsNm0cw+tWfkWyW\nAtQ1xLD4zQ52U2aSY55gU3GiO7lcG59xYPajGrE3jbyXYhHMJq31MvhkAN0dj/n2\nIbf0qyLiEmEhZBSED7eX0VKmi25c2q4/gHYuxg6y1IbgRSvzbTTkfLYyxbbnKvpF\nU74up5q6TBSZrThqBxwryT17HIcz2OISFGP1UmGzyPViXAWkZNo/03S1MflZOIZH\niIkNVpY81v5xUuvRgP58sP49CC8ITqICyyB1y6NDs2ReJzEcZ4tN5SLRWrOxaP+Z\nFEHYScxD7oVzhxc78cvE/IP6C+o4IksK4I9AGCPCxeoWvR4QNrm45+OA/92kpgwf\nEHPz3Jxy1AsyaB1dWYlnOnyTOmbr4fLpmJ8k40pHwxMInjCMhAgflzDZOL1b37mW\nJ96Hvkb3KZQ1nhIwDm0Y6g==\n-----END RSA PRIVATE KEY-----\n与精英外流现象相映成趣的是,也有大量的海外精英流入内地寻求发展机会。最主要的有两部分人,一是早年留学国外,取得学位并在国外的大学、科研机构、公司或政府部门得到职位的中国公民,他们感到在自己工作的领域中,国内的发展机会似乎更多,或者,他们更喜欢自己熟悉的文化环境。二是台湾、香港的企业家,他们看中了在大陆的获利机会或地方的优惠政策。据此,应该认识到,人员流动决不是单向,而是双向的。但一进一出,动机和目标却迥然不同。\r\n \r\n上述两类人到大陆工作的动机是寻求机会和发展空间,无意变换自己的国籍或身份,而国内精英移居海外,大多是以取得外国国籍为目的。移居海外的精英中,不少人只是追求拿到一个外国身份,他们挣钱和交友仍旧在国内,这种现象非常值得玩味。\r\n\r\n同样值得注意的是,与上世纪80年代移居海外的潮流不同,那时一些人千方百计想去外国,是因为那里生活条件比国内好,工作条件、发展机会优于国内。\r\n\r\n而这次移民潮中,大量精英是国内的成功人士,早已享受优越的生活和较高的社会地位,他们去到国外,要么是甘居平淡、低调,要么是准备从头再来,重新开始一轮艰辛的打拼。\r\n \r\n也就是说,国内精英移民海外,多半是有所牺牲,有的甚至作出了较大的牺牲。那么,他们到底图什么?原因何在?\r\n\r\n据笔者的了解,精英们移民的主要动因是获得安全感,他们凭经验和遭遇认为,在自己生活的社会,不稳定的因素太多,未来是不确定的,自己的前途不是可以根据自己的行动和决断作出合理预期的。除了安全感以外,精英们移民还追求好的自然环境、对子女更好的教育,等等。\r\n \r\n精英们为了安全感而想方设法规避风险无可厚非,英国哲学家霍布斯在其名著《利维坦》中说过,人们生活的主要目的是自我保全,所以,安全感对于人来说是第一位的。\r\n \r\n其实,精英移民不是孤立现象,而是一种更普遍现象的一部分。有人认为,中国的精英层属于广义的中产阶级,他们和欧洲资产阶级革命时期兴起的中产阶级一样,代表了一种新兴力量,在建构市民社会的过程中可起巨大的积极作用,对于建立法治、实行对于权力的制约、形成公平的自由竞争机制等方面可起正面作用。\r\n\r\n但30年的历史进程表明,中国的所谓中产阶级或精英层与当下市场经济一样,带有较强的国情特色和扭曲性,他们与其说是制衡独断、垄断的权力的力量,不如说是更多地巴结、迎合权力,当然,他们这样做是为了自己的生存与获利。\r\n\r\n如果说他们还有一些进步性的话,那就是他们对于法治的向往,因为他们毕竟希望在一套明晰的规则之下活动和生活。他们要求的不多——稳定性、可预见性而已。\r\n \r\n精英移民的关键之处在于,他们希望具有另一种身份,将自己置于另一套法律系统之下,这套法律系统是否非常完美和公正暂且可以不管,但大致可以放心的是,这套法律系统是严格、清晰的,被任意解释和施行的可能性较小;是独立的,有权威的,不易受到当权者的干涉和侵害;出发点是保障个人的自由与权利,不是官员用来对付“刁民”的工具。\r\n \r\n今日中国的移民精英相当务实,他们多半不会浅薄地崇洋媚外,以自己当了美国人、法国人或拿了绿卡在同胞面前炫耀,他们的底气在于随着身份转换而得到的保障。\r\n\r\n这就相当于在一大群探险者中,虽然看起来大家的情况都差不多,但其中有的人是买了高额保险的,每个人的抗风险能力和自信心是不一样的。\r\n \r\n正义是信心最根本的源泉,只有正义的社会才值得生活于其中的人们热爱和留恋,对精英是如此,对任何人也是如此。", "spans": [{"start": 355, "end": 363, "label": "person_name", "value_type": "first_name", "context": "assignment", "synthetic": true, "value": "Marianna", "entity_id": "c-00000-2a3d2f98961a4b84/e000", "surface_form_type": "first_name", "replacement": "Franciszek"}, {"start": 537, "end": 1988, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\nqGJ8I/IkeQ2oqGwizMZepRqj+5wcioWEB4J63WrnONk/BrfmQzZD2+xOTXRnioef\nvPe/KpMx9poOHL9lRv1NDeOC50nZ7XeL5a28PL7eW/KXKxVkhikVRZnkbQeEfn2R\nI3j/UfiAvHUQVZuVLtydumESpZvob68v9DBT832F9bvxszybhxjqxRgWpYCfGG4A\nyc2b3PubnlO7Q/+ydT594CdIq4NJBrGPOkIZNuonlKljZBD7DedfmIdSG9uJ4ssC\n9t/8aaTm1hJ9iFfhByYbQR6inTTwZJElkwj5gfTGs/2+YwYyKF45pjhKNeOFQBRU\nHAxW3et0GMVr9gc2ahMfw/uePm/h+fIpPcH2D/v4DQ6a7eTvMHMZieIkg4c7i+pf\nNx/CSjt6NmVxJny8f0M3aoJ+bH1An3O3xnh7X/oK+9NomOC1br6tqXDg5MQ5KtSR\nCMu31qqvc0/0gzuYEq7fM6pXo6wkimlcHhQIwjsLigkA2+wzoomfJJTumnLLhNA5\nrAYGXzD9apCT50WR42KgzDq3/mrqnaSLXSSkMHKkIdi/wu7lqVT7BrJx2uWAgQeT\nqJDDHFeJQA06wmVGZ25NiyZ4NdMKH4tFFHNGb4f6NDaL+oHHQuScW1yqfGMrrzGr\nQCuZWCIQqf5SzY92NJnGR9ywacOHP0RDa1N4dUIQUSeS4WQnEgo8x0nOTCqakwoX\n25BWNnOPCdW+FDaphntfFy2BJ/AMBnKC312ulJA3K1hxV3kC8VD3ew1Uu2DmrAkV\nejFOgeXq8QMyrbx+XN3fRXRHY6PlKtboiYSSKR+PVhMAbYuylHRXoCuskDvwm1M4\nCg5GFRC2Cm+9GiYnMBALYjkPCdC8WNi3sC3/69TtAJ5c0QtDi/wv7diShYtqGfVt\n2VFTUatwVitDRIL1DGQe0CcJV8YL4hdPfO+tOvluXa7PITYtOvsNm0cw+tWfkWyW\nAtQ1xLD4zQ52U2aSY55gU3GiO7lcG59xYPajGrE3jbyXYhHMJq31MvhkAN0dj/n2\nIbf0qyLiEmEhZBSED7eX0VKmi25c2q4/gHYuxg6y1IbgRSvzbTTkfLYyxbbnKvpF\nU74up5q6TBSZrThqBxwryT17HIcz2OISFGP1UmGzyPViXAWkZNo/03S1MflZOIZH\niIkNVpY81v5xUuvRgP58sP49CC8ITqICyyB1y6NDs2ReJzEcZ4tN5SLRWrOxaP+Z\nFEHYScxD7oVzhxc78cvE/IP6C+o4IksK4I9AGCPCxeoWvR4QNrm45+OA/92kpgwf\nEHPz3Jxy1AsyaB1dWYlnOnyTOmbr4fLpmJ8k40pHwxMInjCMhAgflzDZOL1b37mW\nJ96Hvkb3KZQ1nhIwDm0Y6g==\n-----END RSA PRIVATE KEY-----", "entity_id": "c-00000-2a3d2f98961a4b84/e001", "surface_form_type": "literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\nfkP1E6isL6YMThc9tiH7mRF49j0HjBCZdBxvmZwQTBvc3j9kSxu82BFrClUHo2u5\nRamPOdgN0UfkULRwouCl0PA/M+efnWfHVUKWCUY2grjCz+StSccvReGhoyVxO7v4\n1Gn5Np06rvex0YadnHjns3vKT5AhyPHAbU/yLDL+SRW+kguNxCDgxNLy2k5OtUcT\nd5KgTwo1EShqAkyX7oaqMQ1CAPExJ3CSkClh6cyjhfL+WjObBaeyDNWi0JAbROWC\n+9udv2QFdkQYMhLB/iELFP91Lep/5TWGY0h0Kv3BTZIlDTTf8Knxg5t+681R+F2D\nhoAkiKmoRNTIRkIFvCfPbyx0SC49X4RWaD7vWQrNm9Kc+/CNqmvHrXa+10NL4xde\nEHsrhz/aOlsxg6FjvnkqM6aUqCyRiHlH1lDc19UqwEJR+vv0UhTQKVNZMI8eTbOx\naGiJsaDdbqmB7zLU8QEpefk6f4pXDAWRjo7lbMUOofusgCKeAPslJ4rvuFeuXvT8\nwiNyuf32m3tq9qKsDOQJfP0Jex4UyaOhLyjz15wYzkl935dNXN0LeJm/td9V4nOD\n/TJTHCmqxOpp/ol9dZjCPX2t9kS1ClwwlB7nB9e+EkpJYZ7IsN+/9xWBDUAKCnKX\nY+LwAu8HXkU9GdIzpxCiUGoZUSr0BEJrEC5Nx2uc8LUI42m/iW7OLqkwa5tvEo0W\n9tbf6QQ1Oh1WmMX85XgdcKO59nzfhfJo9qDhv6GteYN8c8k2qt/KO7Fl3d5yMcCe\nUWMobvKj36ocRtE9StwYVLhuARps5k9syHVY0WXdTVyAYb9ErvRroGvchbh9Rfr4\nOyzMTC/Zf9LWfrha0bNkB0qyJCtJ64/sGkiqxu9+BkzWF5AOIUGfszQt4b2eNJPY\n4Llhj1vzFpcfTWtdtUb8fr8bcTAgsPsFGO6M3pirC8z7+P/8RQc3lxwsAeExnIpX\nHtlRfHC9iZq22bSAcJQPotCuBTZo7f2OLHeVH6ij7Bm6Iow4ijsCQS9POVzMGevY\nMwmB6E+9L68iSffZgaU2TVfPTUfMlIX1zpFpUfvnuhHUl0iAL/ZUBN0LzTH1n/kl\nqKWTZgNQFjNMrNb5n8kYrue88ol+LM1i/FTRUBzX5S762tAkOhBIKUN0E3SGnN4c\naBAh5L6JpaaIdJyvt3Hbme+H8PKuuTbo47teluOffPHPNlLbLPYQilQd/vyTd323\nLkIFR9p1G38di5dQ/TPgeVXj2E8+7PkoG97YdYeN4DnOnySURHKaM7N3JUSWZ3xp\nlfdxoa1jz+wiP++F1oIoFrSiwWcS2miGMMnD4Dhv5abEqM7tbS1G0FXXWguLv6WL\nB6wLuHoF77yiXjr9IAZOEp==\n-----END RSA PRIVATE KEY-----"}, {"start": 2047, "end": 3498, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\nqGJ8I/IkeQ2oqGwizMZepRqj+5wcioWEB4J63WrnONk/BrfmQzZD2+xOTXRnioef\nvPe/KpMx9poOHL9lRv1NDeOC50nZ7XeL5a28PL7eW/KXKxVkhikVRZnkbQeEfn2R\nI3j/UfiAvHUQVZuVLtydumESpZvob68v9DBT832F9bvxszybhxjqxRgWpYCfGG4A\nyc2b3PubnlO7Q/+ydT594CdIq4NJBrGPOkIZNuonlKljZBD7DedfmIdSG9uJ4ssC\n9t/8aaTm1hJ9iFfhByYbQR6inTTwZJElkwj5gfTGs/2+YwYyKF45pjhKNeOFQBRU\nHAxW3et0GMVr9gc2ahMfw/uePm/h+fIpPcH2D/v4DQ6a7eTvMHMZieIkg4c7i+pf\nNx/CSjt6NmVxJny8f0M3aoJ+bH1An3O3xnh7X/oK+9NomOC1br6tqXDg5MQ5KtSR\nCMu31qqvc0/0gzuYEq7fM6pXo6wkimlcHhQIwjsLigkA2+wzoomfJJTumnLLhNA5\nrAYGXzD9apCT50WR42KgzDq3/mrqnaSLXSSkMHKkIdi/wu7lqVT7BrJx2uWAgQeT\nqJDDHFeJQA06wmVGZ25NiyZ4NdMKH4tFFHNGb4f6NDaL+oHHQuScW1yqfGMrrzGr\nQCuZWCIQqf5SzY92NJnGR9ywacOHP0RDa1N4dUIQUSeS4WQnEgo8x0nOTCqakwoX\n25BWNnOPCdW+FDaphntfFy2BJ/AMBnKC312ulJA3K1hxV3kC8VD3ew1Uu2DmrAkV\nejFOgeXq8QMyrbx+XN3fRXRHY6PlKtboiYSSKR+PVhMAbYuylHRXoCuskDvwm1M4\nCg5GFRC2Cm+9GiYnMBALYjkPCdC8WNi3sC3/69TtAJ5c0QtDi/wv7diShYtqGfVt\n2VFTUatwVitDRIL1DGQe0CcJV8YL4hdPfO+tOvluXa7PITYtOvsNm0cw+tWfkWyW\nAtQ1xLD4zQ52U2aSY55gU3GiO7lcG59xYPajGrE3jbyXYhHMJq31MvhkAN0dj/n2\nIbf0qyLiEmEhZBSED7eX0VKmi25c2q4/gHYuxg6y1IbgRSvzbTTkfLYyxbbnKvpF\nU74up5q6TBSZrThqBxwryT17HIcz2OISFGP1UmGzyPViXAWkZNo/03S1MflZOIZH\niIkNVpY81v5xUuvRgP58sP49CC8ITqICyyB1y6NDs2ReJzEcZ4tN5SLRWrOxaP+Z\nFEHYScxD7oVzhxc78cvE/IP6C+o4IksK4I9AGCPCxeoWvR4QNrm45+OA/92kpgwf\nEHPz3Jxy1AsyaB1dWYlnOnyTOmbr4fLpmJ8k40pHwxMInjCMhAgflzDZOL1b37mW\nJ96Hvkb3KZQ1nhIwDm0Y6g==\n-----END RSA PRIVATE KEY-----", "entity_id": "c-00000-2a3d2f98961a4b84/e001", "surface_form_type": "literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\nfkP1E6isL6YMThc9tiH7mRF49j0HjBCZdBxvmZwQTBvc3j9kSxu82BFrClUHo2u5\nRamPOdgN0UfkULRwouCl0PA/M+efnWfHVUKWCUY2grjCz+StSccvReGhoyVxO7v4\n1Gn5Np06rvex0YadnHjns3vKT5AhyPHAbU/yLDL+SRW+kguNxCDgxNLy2k5OtUcT\nd5KgTwo1EShqAkyX7oaqMQ1CAPExJ3CSkClh6cyjhfL+WjObBaeyDNWi0JAbROWC\n+9udv2QFdkQYMhLB/iELFP91Lep/5TWGY0h0Kv3BTZIlDTTf8Knxg5t+681R+F2D\nhoAkiKmoRNTIRkIFvCfPbyx0SC49X4RWaD7vWQrNm9Kc+/CNqmvHrXa+10NL4xde\nEHsrhz/aOlsxg6FjvnkqM6aUqCyRiHlH1lDc19UqwEJR+vv0UhTQKVNZMI8eTbOx\naGiJsaDdbqmB7zLU8QEpefk6f4pXDAWRjo7lbMUOofusgCKeAPslJ4rvuFeuXvT8\nwiNyuf32m3tq9qKsDOQJfP0Jex4UyaOhLyjz15wYzkl935dNXN0LeJm/td9V4nOD\n/TJTHCmqxOpp/ol9dZjCPX2t9kS1ClwwlB7nB9e+EkpJYZ7IsN+/9xWBDUAKCnKX\nY+LwAu8HXkU9GdIzpxCiUGoZUSr0BEJrEC5Nx2uc8LUI42m/iW7OLqkwa5tvEo0W\n9tbf6QQ1Oh1WmMX85XgdcKO59nzfhfJo9qDhv6GteYN8c8k2qt/KO7Fl3d5yMcCe\nUWMobvKj36ocRtE9StwYVLhuARps5k9syHVY0WXdTVyAYb9ErvRroGvchbh9Rfr4\nOyzMTC/Zf9LWfrha0bNkB0qyJCtJ64/sGkiqxu9+BkzWF5AOIUGfszQt4b2eNJPY\n4Llhj1vzFpcfTWtdtUb8fr8bcTAgsPsFGO6M3pirC8z7+P/8RQc3lxwsAeExnIpX\nHtlRfHC9iZq22bSAcJQPotCuBTZo7f2OLHeVH6ij7Bm6Iow4ijsCQS9POVzMGevY\nMwmB6E+9L68iSffZgaU2TVfPTUfMlIX1zpFpUfvnuhHUl0iAL/ZUBN0LzTH1n/kl\nqKWTZgNQFjNMrNb5n8kYrue88ol+LM1i/FTRUBzX5S762tAkOhBIKUN0E3SGnN4c\naBAh5L6JpaaIdJyvt3Hbme+H8PKuuTbo47teluOffPHPNlLbLPYQilQd/vyTd323\nLkIFR9p1G38di5dQ/TPgeVXj2E8+7PkoG97YdYeN4DnOnySURHKaM7N3JUSWZ3xp\nlfdxoa1jz+wiP++F1oIoFrSiwWcS2miGMMnD4Dhv5abEqM7tbS1G0FXXWguLv6WL\nB6wLuHoF77yiXjr9IAZOEp==\n-----END RSA PRIVATE KEY-----"}], "hard_negatives": [{"start": 259, "end": 295, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "1c375820-e497-47f4-844e-c3c8d2097ec4", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-2a3d2f98961a4b84", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-d9d49e721c3b8b45", "source": "codeparrot/github-code-clean", "repo": "algking/algking.github.com", "license": "mit", "language": "Markdown", "path": "_posts/2014-10-19-从oh-my-zsh到oh-my-fish.md", "text": "---\nlayout: post\ncategory: \"工具\"\ntags: [zsh,fish,linux]\n---\n\n-----BEGIN RSA PRIVATE KEY-----\nL56wR8Ny+qvTvmSQJSg42GCeGX5c9CPIg3Ovckg3EyAqME73X5m2bpdaiRlVZgcz\nCQKIl40Bt1NfdgnZ/QrqrIxr2VpoDQMdjgTdGpHjWdDoSV2YCv0ciWgOpdgdTYJG\n+TrqPp+IppmaBDhZgHtwvUGvLr7GK1FV+yivV9c8bEfYOQj0KDbutaWD6cvqytcx\nNdtZ2wYst/QG+DoKg1Emk9iRa+5X3oiW1oDrUWfCzhgRKiw14S3x2qQtRLoA1NWj\nFcxgC2E/TFqIm89Gsh3USRAcLTguegqr0hL5uQVeOmiX3MziaUpe6Hu+yTcxbRKo\nhWH0N4y1vcKEO88l2XMoxnZHaaHIQoD8SgLXpMfIvZ80fNGv9RNOLMSxv5a4yfuU\nsYQPfF9GYmrSnfkKDWdhEjcIBU8Dqllvi1omtnbJtfrwMlLGO4eny5U2AQ8aFPjA\nQRjQIPVD5sn3/Q98u7xSRNdjj8pybQQdJXx4Hdal1jNl+SMMyRoovgsWYpMr6xva\nQZAf6MdjBSTxRrtSZJ6ciYmqDE5YRLZ6OFHKGx5LXMSHnd9G6XXSmRWuD7K2X8cK\n5a0mI2YLHjYwoxToZJ20MVzJDYz7OWcFE5XNQJHO3o59Vm5BxPQurMCEHdmEvhJX\nTN46d4DGPPUSBOt7XcbcnS4m38BmfPU7nq5EY82TJ9qUO1tsYwBtIaGqtA++jrWQ\noEzQQNNNdLrRVF9+t5Aqd+tc6VMZK3Q1TF6nghmO1makX4YxjPg8ulQewvftkbpW\n71CXXau45eLpM82sfG/F4PPRHQLZEVTqXGJvb2A/oUO63ikGUH40djECBiUL3+gX\nQu0cTFKOqx7bZdPK9qucSSgVMS8jUIzqvIXQqNOe1SMiAsBBJzvHvp977n4x1wsB\nNovZLHQH969bBFYj1007ov4vu4rXw2ww24Su063DFS9ch66BBIgFmKgWVv0Q4hYR\nkZ0D/YZU7J7EJNZ+NyRZ1WHSqO79uxV1Qu25K7RNxUMV/PvL2UGlgDE2ccOwEEK1\n5cuwTUYUJJMYMJVrb87q58xVdDd+ApjxEtgunVVTPw1sAcQw5rpd+4Cyikt/xWUr\nnNUrcoFTIcZBf5Mqz0bTdxao1Es807/PEcpEwXCvDjIisZ29YOgVUBYbce6cnhP2\nuWNmAZ7TQwlCntL2D+/O2OrBfI4N1sq0sD9aImHCsy2qhT8loewRgWB2wzmnkY+J\nPExCjBmkWj6A603RjalFmrblFwun1Ot6OYK7lHdEcMKvFaXsBS5U12hihak5J9l0\nL7Ir31r81U6TYRi4TcT/SludeiRXH8+rLcoIDw==\n-----END RSA PRIVATE KEY-----\n[TOC]\n\n### zsh 与yosemite 的bug? ###\n在更新了Mac Yosemite 后,发现各种问题,首先是php,macport等问题\n接着就是zsh了,不知道为什么,`zsh`总是几乎占了100%的cpu,这让我的macbook电池\n-----BEGIN RSA PRIVATE KEY-----\nL56wR8Ny+qvTvmSQJSg42GCeGX5c9CPIg3Ovckg3EyAqME73X5m2bpdaiRlVZgcz\nCQKIl40Bt1NfdgnZ/QrqrIxr2VpoDQMdjgTdGpHjWdDoSV2YCv0ciWgOpdgdTYJG\n+TrqPp+IppmaBDhZgHtwvUGvLr7GK1FV+yivV9c8bEfYOQj0KDbutaWD6cvqytcx\nNdtZ2wYst/QG+DoKg1Emk9iRa+5X3oiW1oDrUWfCzhgRKiw14S3x2qQtRLoA1NWj\nFcxgC2E/TFqIm89Gsh3USRAcLTguegqr0hL5uQVeOmiX3MziaUpe6Hu+yTcxbRKo\nhWH0N4y1vcKEO88l2XMoxnZHaaHIQoD8SgLXpMfIvZ80fNGv9RNOLMSxv5a4yfuU\nsYQPfF9GYmrSnfkKDWdhEjcIBU8Dqllvi1omtnbJtfrwMlLGO4eny5U2AQ8aFPjA\nQRjQIPVD5sn3/Q98u7xSRNdjj8pybQQdJXx4Hdal1jNl+SMMyRoovgsWYpMr6xva\nQZAf6MdjBSTxRrtSZJ6ciYmqDE5YRLZ6OFHKGx5LXMSHnd9G6XXSmRWuD7K2X8cK\n5a0mI2YLHjYwoxToZJ20MVzJDYz7OWcFE5XNQJHO3o59Vm5BxPQurMCEHdmEvhJX\nTN46d4DGPPUSBOt7XcbcnS4m38BmfPU7nq5EY82TJ9qUO1tsYwBtIaGqtA++jrWQ\noEzQQNNNdLrRVF9+t5Aqd+tc6VMZK3Q1TF6nghmO1makX4YxjPg8ulQewvftkbpW\n71CXXau45eLpM82sfG/F4PPRHQLZEVTqXGJvb2A/oUO63ikGUH40djECBiUL3+gX\nQu0cTFKOqx7bZdPK9qucSSgVMS8jUIzqvIXQqNOe1SMiAsBBJzvHvp977n4x1wsB\nNovZLHQH969bBFYj1007ov4vu4rXw2ww24Su063DFS9ch66BBIgFmKgWVv0Q4hYR\nkZ0D/YZU7J7EJNZ+NyRZ1WHSqO79uxV1Qu25K7RNxUMV/PvL2UGlgDE2ccOwEEK1\n5cuwTUYUJJMYMJVrb87q58xVdDd+ApjxEtgunVVTPw1sAcQw5rpd+4Cyikt/xWUr\nnNUrcoFTIcZBf5Mqz0bTdxao1Es807/PEcpEwXCvDjIisZ29YOgVUBYbce6cnhP2\nuWNmAZ7TQwlCntL2D+/O2OrBfI4N1sq0sD9aImHCsy2qhT8loewRgWB2wzmnkY+J\nPExCjBmkWj6A603RjalFmrblFwun1Ot6OYK7lHdEcMKvFaXsBS5U12hihak5J9l0\nL7Ir31r81U6TYRi4TcT/SludeiRXH8+rLcoIDw==\n-----END RSA PRIVATE KEY-----\n暴跌,非常郁闷. 开始怀疑是插件的问题,但是即使把插件全部关了,也还是那样.\n之前也用过fish,发现还是不错的一个shell,从设计上面说,非常方便.功能也不错.\n于是就准备换到fish算了.\n\n\n![image](/public/img/zsh-yosemite-bug.png)\n> 发了封邮件给zsh后,\n>reply: Any chance that it's this issue with zsh-autosuggestions?\n\n[问题解决](https://github.com/tarruda/zsh-autosuggestions/issues/24 )\n发现原来是因为zsh-autosuggestions 的问题.\n\n\n### fish优点 ###\n- Autosuggestions 自动提示history,命令补全等很方便\n- 命令的completions 甚至包括man的提示\n- 一些`zsh`我喜欢的插件fish也有 例如`autojump` 通过[oh-my-fish](https://github.com/bpinto/oh-my-fishURL ) 可以很方便安装\n- `fish-config`命令 可以在线的编辑fish的配置\n\n- **public_key**: `ssh-rsa lOn7DTh8yELHJN89iHBsE21s0FUwgC2q9TTzIAijyr3S77L5KxAEGGbrnhUU7ybdYvk33ICRdtz/TiLDvr/bwurwhFLkJZ8hU14Hwoa2eisiZdkX7fVlEWTmBDJeV1BSIT1/qz8Yzei3Fz+vhi9obKZWbCNjg/JNMIyq6/I3NzpjXsF8wz2rAKj5V5pySYtt1ENjDlcgWjPastLfdVPDs6AQ/EM8TO4Q4vCfa4y4uDRCFg0qYx2+eWIP6QjjTJPqPs6OMIq+WQUOY0bCV2r2PJKR5oJxOfvwbVgzFthqBNQ7Dli4efWChQ== munoztiffany@srv-68.nash.net`\n其实以上一些功能其实`zsh`也可以做到,不过个人觉得补全做的没有`fish`好,只是一直以来`zsh`的社区比较强大\n而`fish` 插件会少点,但是一般使用其实用不上很多插件,而且`zsh`用多几个插件就变得很慢.\n一直使用 [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh ) ,但是发现了[oh-my-fish](https://github.com/bpinto/oh-my-fishURL ) 后\n就想转过去了,因为以前一直以为fish没有插件支持.\n-----BEGIN RSA PRIVATE KEY-----\nqGJ8I/IkeQ2oqGwizMZepRqj+5wcioWEB4J63WrnONk/BrfmQzZD2+xOTXRnioef\nvPe/KpMx9poOHL9lRv1NDeOC50nZ7XeL5a28PL7eW/KXKxVkhikVRZnkbQeEfn2R\nI3j/UfiAvHUQVZuVLtydumESpZvob68v9DBT832F9bvxszybhxjqxRgWpYCfGG4A\nyc2b3PubnlO7Q/+ydT594CdIq4NJBrGPOkIZNuonlKljZBD7DedfmIdSG9uJ4ssC\n9t/8aaTm1hJ9iFfhByYbQR6inTTwZJElkwj5gfTGs/2+YwYyKF45pjhKNeOFQBRU\nHAxW3et0GMVr9gc2ahMfw/uePm/h+fIpPcH2D/v4DQ6a7eTvMHMZieIkg4c7i+pf\nNx/CSjt6NmVxJny8f0M3aoJ+bH1An3O3xnh7X/oK+9NomOC1br6tqXDg5MQ5KtSR\nCMu31qqvc0/0gzuYEq7fM6pXo6wkimlcHhQIwjsLigkA2+wzoomfJJTumnLLhNA5\nrAYGXzD9apCT50WR42KgzDq3/mrqnaSLXSSkMHKkIdi/wu7lqVT7BrJx2uWAgQeT\nqJDDHFeJQA06wmVGZ25NiyZ4NdMKH4tFFHNGb4f6NDaL+oHHQuScW1yqfGMrrzGr\nQCuZWCIQqf5SzY92NJnGR9ywacOHP0RDa1N4dUIQUSeS4WQnEgo8x0nOTCqakwoX\n25BWNnOPCdW+FDaphntfFy2BJ/AMBnKC312ulJA3K1hxV3kC8VD3ew1Uu2DmrAkV\nejFOgeXq8QMyrbx+XN3fRXRHY6PlKtboiYSSKR+PVhMAbYuylHRXoCuskDvwm1M4\nCg5GFRC2Cm+9GiYnMBALYjkPCdC8WNi3sC3/69TtAJ5c0QtDi/wv7diShYtqGfVt\n2VFTUatwVitDRIL1DGQe0CcJV8YL4hdPfO+tOvluXa7PITYtOvsNm0cw+tWfkWyW\nAtQ1xLD4zQ52U2aSY55gU3GiO7lcG59xYPajGrE3jbyXYhHMJq31MvhkAN0dj/n2\nIbf0qyLiEmEhZBSED7eX0VKmi25c2q4/gHYuxg6y1IbgRSvzbTTkfLYyxbbnKvpF\nU74up5q6TBSZrThqBxwryT17HIcz2OISFGP1UmGzyPViXAWkZNo/03S1MflZOIZH\niIkNVpY81v5xUuvRgP58sP49CC8ITqICyyB1y6NDs2ReJzEcZ4tN5SLRWrOxaP+Z\nFEHYScxD7oVzhxc78cvE/IP6C+o4IksK4I9AGCPCxeoWvR4QNrm45+OA/92kpgwf\nEHPz3Jxy1AsyaB1dWYlnOnyTOmbr4fLpmJ8k40pHwxMInjCMhAgflzDZOL1b37mW\nJ96Hvkb3KZQ1nhIwDm0Y6g==\n-----END RSA PRIVATE KEY-----\n\n\n### 安装[oh-my-fish](https://github.com/bpinto/oh-my-fishURL )###\n brew install fish\n sudo vi /etc/shells 将/usr/local/bin/fish加上,否则下面的命令会报错\n chsh -s /usr/local/bin/fish\n \n git clone git://github.com/bpinto/oh-my-fish.git ~/.oh-my-fish\n copy配置文件\n cp ~/.oh-my-fish/templates/config.fish ~/.config/fish/config.fish\n \n### 设置fish ###\n\n- 编辑~/config/fish/config.fish\n\n-----BEGIN RSA PRIVATE KEY-----\nL56wR8Ny+qvTvmSQJSg42GCeGX5c9CPIg3Ovckg3EyAqME73X5m2bpdaiRlVZgcz\nCQKIl40Bt1NfdgnZ/QrqrIxr2VpoDQMdjgTdGpHjWdDoSV2YCv0ciWgOpdgdTYJG\n+TrqPp+IppmaBDhZgHtwvUGvLr7GK1FV+yivV9c8bEfYOQj0KDbutaWD6cvqytcx\nNdtZ2wYst/QG+DoKg1Emk9iRa+5X3oiW1oDrUWfCzhgRKiw14S3x2qQtRLoA1NWj\nFcxgC2E/TFqIm89Gsh3USRAcLTguegqr0hL5uQVeOmiX3MziaUpe6Hu+yTcxbRKo\nhWH0N4y1vcKEO88l2XMoxnZHaaHIQoD8SgLXpMfIvZ80fNGv9RNOLMSxv5a4yfuU\nsYQPfF9GYmrSnfkKDWdhEjcIBU8Dqllvi1omtnbJtfrwMlLGO4eny5U2AQ8aFPjA\nQRjQIPVD5sn3/Q98u7xSRNdjj8pybQQdJXx4Hdal1jNl+SMMyRoovgsWYpMr6xva\nQZAf6MdjBSTxRrtSZJ6ciYmqDE5YRLZ6OFHKGx5LXMSHnd9G6XXSmRWuD7K2X8cK\n5a0mI2YLHjYwoxToZJ20MVzJDYz7OWcFE5XNQJHO3o59Vm5BxPQurMCEHdmEvhJX\nTN46d4DGPPUSBOt7XcbcnS4m38BmfPU7nq5EY82TJ9qUO1tsYwBtIaGqtA++jrWQ\noEzQQNNNdLrRVF9+t5Aqd+tc6VMZK3Q1TF6nghmO1makX4YxjPg8ulQewvftkbpW\n71CXXau45eLpM82sfG/F4PPRHQLZEVTqXGJvb2A/oUO63ikGUH40djECBiUL3+gX\nQu0cTFKOqx7bZdPK9qucSSgVMS8jUIzqvIXQqNOe1SMiAsBBJzvHvp977n4x1wsB\nNovZLHQH969bBFYj1007ov4vu4rXw2ww24Su063DFS9ch66BBIgFmKgWVv0Q4hYR\nkZ0D/YZU7J7EJNZ+NyRZ1WHSqO79uxV1Qu25K7RNxUMV/PvL2UGlgDE2ccOwEEK1\n5cuwTUYUJJMYMJVrb87q58xVdDd+ApjxEtgunVVTPw1sAcQw5rpd+4Cyikt/xWUr\nnNUrcoFTIcZBf5Mqz0bTdxao1Es807/PEcpEwXCvDjIisZ29YOgVUBYbce6cnhP2\nuWNmAZ7TQwlCntL2D+/O2OrBfI4N1sq0sD9aImHCsy2qhT8loewRgWB2wzmnkY+J\nPExCjBmkWj6A603RjalFmrblFwun1Ot6OYK7lHdEcMKvFaXsBS5U12hihak5J9l0\nL7Ir31r81U6TYRi4TcT/SludeiRXH8+rLcoIDw==\n-----END RSA PRIVATE KEY-----\n```\n set fish_plugins autojump bundler brew\n set -xu PATH /usr/local/bin:$PATH\n \n 比较不爽的就是export 在这里不能用要使用`set -x`代替:\n\n `set -x PATH /usr/local/bin $PATH`\n \n -x : -export \n -u : 意思是对所有fish session都使用\n```\n### 编写fish插件 ###\n\nfish 的插件看起来非常好懂,是基于函数的\n\n```ruby\nauthor_email: `greererin@gmail.com`\nfunction rg\n rails generate $argv\nend\n\n```\n- **path**: `com.example.trouble`\n\n \n\n\n\n\n\n\n\n", "spans": [{"start": 60, "end": 1462, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\nL56wR8Ny+qvTvmSQJSg42GCeGX5c9CPIg3Ovckg3EyAqME73X5m2bpdaiRlVZgcz\nCQKIl40Bt1NfdgnZ/QrqrIxr2VpoDQMdjgTdGpHjWdDoSV2YCv0ciWgOpdgdTYJG\n+TrqPp+IppmaBDhZgHtwvUGvLr7GK1FV+yivV9c8bEfYOQj0KDbutaWD6cvqytcx\nNdtZ2wYst/QG+DoKg1Emk9iRa+5X3oiW1oDrUWfCzhgRKiw14S3x2qQtRLoA1NWj\nFcxgC2E/TFqIm89Gsh3USRAcLTguegqr0hL5uQVeOmiX3MziaUpe6Hu+yTcxbRKo\nhWH0N4y1vcKEO88l2XMoxnZHaaHIQoD8SgLXpMfIvZ80fNGv9RNOLMSxv5a4yfuU\nsYQPfF9GYmrSnfkKDWdhEjcIBU8Dqllvi1omtnbJtfrwMlLGO4eny5U2AQ8aFPjA\nQRjQIPVD5sn3/Q98u7xSRNdjj8pybQQdJXx4Hdal1jNl+SMMyRoovgsWYpMr6xva\nQZAf6MdjBSTxRrtSZJ6ciYmqDE5YRLZ6OFHKGx5LXMSHnd9G6XXSmRWuD7K2X8cK\n5a0mI2YLHjYwoxToZJ20MVzJDYz7OWcFE5XNQJHO3o59Vm5BxPQurMCEHdmEvhJX\nTN46d4DGPPUSBOt7XcbcnS4m38BmfPU7nq5EY82TJ9qUO1tsYwBtIaGqtA++jrWQ\noEzQQNNNdLrRVF9+t5Aqd+tc6VMZK3Q1TF6nghmO1makX4YxjPg8ulQewvftkbpW\n71CXXau45eLpM82sfG/F4PPRHQLZEVTqXGJvb2A/oUO63ikGUH40djECBiUL3+gX\nQu0cTFKOqx7bZdPK9qucSSgVMS8jUIzqvIXQqNOe1SMiAsBBJzvHvp977n4x1wsB\nNovZLHQH969bBFYj1007ov4vu4rXw2ww24Su063DFS9ch66BBIgFmKgWVv0Q4hYR\nkZ0D/YZU7J7EJNZ+NyRZ1WHSqO79uxV1Qu25K7RNxUMV/PvL2UGlgDE2ccOwEEK1\n5cuwTUYUJJMYMJVrb87q58xVdDd+ApjxEtgunVVTPw1sAcQw5rpd+4Cyikt/xWUr\nnNUrcoFTIcZBf5Mqz0bTdxao1Es807/PEcpEwXCvDjIisZ29YOgVUBYbce6cnhP2\nuWNmAZ7TQwlCntL2D+/O2OrBfI4N1sq0sD9aImHCsy2qhT8loewRgWB2wzmnkY+J\nPExCjBmkWj6A603RjalFmrblFwun1Ot6OYK7lHdEcMKvFaXsBS5U12hihak5J9l0\nL7Ir31r81U6TYRi4TcT/SludeiRXH8+rLcoIDw==\n-----END RSA PRIVATE KEY-----", "entity_id": "c-00000-2a3d2f98961a4b84/e002", "surface_form_type": "literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\nXUZ6LhEHgLn3BA9I6Y6aEE3qcqN7IxHekhceJ3OV2mO0T4hOb4koJhYeYtas7SUS\nJKEjD6XsJ71bq0DOjI7csn1ig6NrX5RclHh3IRzZo4BQxWRDMutYugbZRWdf4kFu\ngSXLGKgT8O/Assf3x3IsqiCKah6NflIIXYH13zYpBCtP9Tuscx7dR/9ASCtAziFD\nlNqoy7aUfRJYOIIS3PyFPoNQnIbL6ug4vW4A2A4MBqFN9d6NqgFeBlC0vwZzDSfw\n0Eyvz0dlcVmMN6yNIyc0eY8eXd7uNyDq7cWWtNL210lzQVIneJLxi6QiYSX6H05+\n07xwTb6BjK73Bw4Z+s3vdNFRYk2bq/YONVBTCPR/mPbANaDsuL0AOLP/HDZvNfd1\njQKrimlUY0knDnVaiU/57lx2QE0T8wh/ktyZlBfHr/DNcuDBF149Nn29u1Q54LtC\nGyosLcIxybKeOCFAgxBJURdFx3jvDEpBmsSMPYbDk4wFJHp+3GfSGebCEkwGz77X\nHQr+Dz0g7Bt2PcRz4/Y4XkMKQQzU/OkSuqrfR9l2UcT024rvbwft2AFx1GLL47Ae\n5blMTfBXZ7ibSr9W/SrzFySmbqXB9InZNl4KHeVG4BcwT0pIRquXBVlII1IF9t9G\nWmwLBsA1Y55L5eeSulMEOtjimzVeTtp82pRfho6FHJnbMjf24puPDhe8TwJeKbWW\nU05KwAyDcainxg5BaaMVVbSKSXfDIE2YKTiSNJDiqNQd4rf6S/aNetWd0vaati6l\n9LB7Mu1/Sqwidpo8kN4WfMjlQoQhyWBKlG0zQt8IwxQGc2/vW+ckQ5VoiI9SwwXT\nT0A6aYQchkFsJFiqpeG0SwRDp7BVJPmOLrw9r+nMMEBIp5GyQ7bHq1wrU0tJ0E3i\nQ53q9zfi41Dg5GLg/3KBskK21rN16Ph5giC9cvYjL5BxSRUvEvV5vwWm6KumoDA3\n9CYzRCnF/05cdbp8WqyvoJ88Y1NOIdLsnd7ZPuwofg6oqnT+e9NJxQrmSUKx95YD\nyixlcLZPY7CcSfrpGYwjeUcuPz+tugkNGLIeuo822MNTcx35xtZqU+AUZcsRaSpB\nYoYxmylD8L1WaUFSOrpJ7Xg/P9AplwTASLvquP6HsqPNbet2zjpLlSxv7lD3lJU5\nR3Vus4TUXR80oB7KV6gHejfqnqHu0h7+FrBLDLwUxfXAz2GxTtlbz8vhzfHkLNoe\nnIRksW/g7uadwLe7Luq4oac1NEATdJaTo3gBeDtp49JvtkgYJoUHT0Fag4rbgdgz\niAFt1F5fj43fyQedbDF3WaOD5wrW1NHwMOZrDV==\n-----END RSA PRIVATE KEY-----"}, {"start": 1592, "end": 2994, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\nL56wR8Ny+qvTvmSQJSg42GCeGX5c9CPIg3Ovckg3EyAqME73X5m2bpdaiRlVZgcz\nCQKIl40Bt1NfdgnZ/QrqrIxr2VpoDQMdjgTdGpHjWdDoSV2YCv0ciWgOpdgdTYJG\n+TrqPp+IppmaBDhZgHtwvUGvLr7GK1FV+yivV9c8bEfYOQj0KDbutaWD6cvqytcx\nNdtZ2wYst/QG+DoKg1Emk9iRa+5X3oiW1oDrUWfCzhgRKiw14S3x2qQtRLoA1NWj\nFcxgC2E/TFqIm89Gsh3USRAcLTguegqr0hL5uQVeOmiX3MziaUpe6Hu+yTcxbRKo\nhWH0N4y1vcKEO88l2XMoxnZHaaHIQoD8SgLXpMfIvZ80fNGv9RNOLMSxv5a4yfuU\nsYQPfF9GYmrSnfkKDWdhEjcIBU8Dqllvi1omtnbJtfrwMlLGO4eny5U2AQ8aFPjA\nQRjQIPVD5sn3/Q98u7xSRNdjj8pybQQdJXx4Hdal1jNl+SMMyRoovgsWYpMr6xva\nQZAf6MdjBSTxRrtSZJ6ciYmqDE5YRLZ6OFHKGx5LXMSHnd9G6XXSmRWuD7K2X8cK\n5a0mI2YLHjYwoxToZJ20MVzJDYz7OWcFE5XNQJHO3o59Vm5BxPQurMCEHdmEvhJX\nTN46d4DGPPUSBOt7XcbcnS4m38BmfPU7nq5EY82TJ9qUO1tsYwBtIaGqtA++jrWQ\noEzQQNNNdLrRVF9+t5Aqd+tc6VMZK3Q1TF6nghmO1makX4YxjPg8ulQewvftkbpW\n71CXXau45eLpM82sfG/F4PPRHQLZEVTqXGJvb2A/oUO63ikGUH40djECBiUL3+gX\nQu0cTFKOqx7bZdPK9qucSSgVMS8jUIzqvIXQqNOe1SMiAsBBJzvHvp977n4x1wsB\nNovZLHQH969bBFYj1007ov4vu4rXw2ww24Su063DFS9ch66BBIgFmKgWVv0Q4hYR\nkZ0D/YZU7J7EJNZ+NyRZ1WHSqO79uxV1Qu25K7RNxUMV/PvL2UGlgDE2ccOwEEK1\n5cuwTUYUJJMYMJVrb87q58xVdDd+ApjxEtgunVVTPw1sAcQw5rpd+4Cyikt/xWUr\nnNUrcoFTIcZBf5Mqz0bTdxao1Es807/PEcpEwXCvDjIisZ29YOgVUBYbce6cnhP2\nuWNmAZ7TQwlCntL2D+/O2OrBfI4N1sq0sD9aImHCsy2qhT8loewRgWB2wzmnkY+J\nPExCjBmkWj6A603RjalFmrblFwun1Ot6OYK7lHdEcMKvFaXsBS5U12hihak5J9l0\nL7Ir31r81U6TYRi4TcT/SludeiRXH8+rLcoIDw==\n-----END RSA PRIVATE KEY-----", "entity_id": "c-00000-2a3d2f98961a4b84/e002", "surface_form_type": "literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\nXUZ6LhEHgLn3BA9I6Y6aEE3qcqN7IxHekhceJ3OV2mO0T4hOb4koJhYeYtas7SUS\nJKEjD6XsJ71bq0DOjI7csn1ig6NrX5RclHh3IRzZo4BQxWRDMutYugbZRWdf4kFu\ngSXLGKgT8O/Assf3x3IsqiCKah6NflIIXYH13zYpBCtP9Tuscx7dR/9ASCtAziFD\nlNqoy7aUfRJYOIIS3PyFPoNQnIbL6ug4vW4A2A4MBqFN9d6NqgFeBlC0vwZzDSfw\n0Eyvz0dlcVmMN6yNIyc0eY8eXd7uNyDq7cWWtNL210lzQVIneJLxi6QiYSX6H05+\n07xwTb6BjK73Bw4Z+s3vdNFRYk2bq/YONVBTCPR/mPbANaDsuL0AOLP/HDZvNfd1\njQKrimlUY0knDnVaiU/57lx2QE0T8wh/ktyZlBfHr/DNcuDBF149Nn29u1Q54LtC\nGyosLcIxybKeOCFAgxBJURdFx3jvDEpBmsSMPYbDk4wFJHp+3GfSGebCEkwGz77X\nHQr+Dz0g7Bt2PcRz4/Y4XkMKQQzU/OkSuqrfR9l2UcT024rvbwft2AFx1GLL47Ae\n5blMTfBXZ7ibSr9W/SrzFySmbqXB9InZNl4KHeVG4BcwT0pIRquXBVlII1IF9t9G\nWmwLBsA1Y55L5eeSulMEOtjimzVeTtp82pRfho6FHJnbMjf24puPDhe8TwJeKbWW\nU05KwAyDcainxg5BaaMVVbSKSXfDIE2YKTiSNJDiqNQd4rf6S/aNetWd0vaati6l\n9LB7Mu1/Sqwidpo8kN4WfMjlQoQhyWBKlG0zQt8IwxQGc2/vW+ckQ5VoiI9SwwXT\nT0A6aYQchkFsJFiqpeG0SwRDp7BVJPmOLrw9r+nMMEBIp5GyQ7bHq1wrU0tJ0E3i\nQ53q9zfi41Dg5GLg/3KBskK21rN16Ph5giC9cvYjL5BxSRUvEvV5vwWm6KumoDA3\n9CYzRCnF/05cdbp8WqyvoJ88Y1NOIdLsnd7ZPuwofg6oqnT+e9NJxQrmSUKx95YD\nyixlcLZPY7CcSfrpGYwjeUcuPz+tugkNGLIeuo822MNTcx35xtZqU+AUZcsRaSpB\nYoYxmylD8L1WaUFSOrpJ7Xg/P9AplwTASLvquP6HsqPNbet2zjpLlSxv7lD3lJU5\nR3Vus4TUXR80oB7KV6gHejfqnqHu0h7+FrBLDLwUxfXAz2GxTtlbz8vhzfHkLNoe\nnIRksW/g7uadwLe7Luq4oac1NEATdJaTo3gBeDtp49JvtkgYJoUHT0Fag4rbgdgz\niAFt1F5fj43fyQedbDF3WaOD5wrW1NHwMOZrDV==\n-----END RSA PRIVATE KEY-----"}, {"start": 4166, "end": 5617, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\nqGJ8I/IkeQ2oqGwizMZepRqj+5wcioWEB4J63WrnONk/BrfmQzZD2+xOTXRnioef\nvPe/KpMx9poOHL9lRv1NDeOC50nZ7XeL5a28PL7eW/KXKxVkhikVRZnkbQeEfn2R\nI3j/UfiAvHUQVZuVLtydumESpZvob68v9DBT832F9bvxszybhxjqxRgWpYCfGG4A\nyc2b3PubnlO7Q/+ydT594CdIq4NJBrGPOkIZNuonlKljZBD7DedfmIdSG9uJ4ssC\n9t/8aaTm1hJ9iFfhByYbQR6inTTwZJElkwj5gfTGs/2+YwYyKF45pjhKNeOFQBRU\nHAxW3et0GMVr9gc2ahMfw/uePm/h+fIpPcH2D/v4DQ6a7eTvMHMZieIkg4c7i+pf\nNx/CSjt6NmVxJny8f0M3aoJ+bH1An3O3xnh7X/oK+9NomOC1br6tqXDg5MQ5KtSR\nCMu31qqvc0/0gzuYEq7fM6pXo6wkimlcHhQIwjsLigkA2+wzoomfJJTumnLLhNA5\nrAYGXzD9apCT50WR42KgzDq3/mrqnaSLXSSkMHKkIdi/wu7lqVT7BrJx2uWAgQeT\nqJDDHFeJQA06wmVGZ25NiyZ4NdMKH4tFFHNGb4f6NDaL+oHHQuScW1yqfGMrrzGr\nQCuZWCIQqf5SzY92NJnGR9ywacOHP0RDa1N4dUIQUSeS4WQnEgo8x0nOTCqakwoX\n25BWNnOPCdW+FDaphntfFy2BJ/AMBnKC312ulJA3K1hxV3kC8VD3ew1Uu2DmrAkV\nejFOgeXq8QMyrbx+XN3fRXRHY6PlKtboiYSSKR+PVhMAbYuylHRXoCuskDvwm1M4\nCg5GFRC2Cm+9GiYnMBALYjkPCdC8WNi3sC3/69TtAJ5c0QtDi/wv7diShYtqGfVt\n2VFTUatwVitDRIL1DGQe0CcJV8YL4hdPfO+tOvluXa7PITYtOvsNm0cw+tWfkWyW\nAtQ1xLD4zQ52U2aSY55gU3GiO7lcG59xYPajGrE3jbyXYhHMJq31MvhkAN0dj/n2\nIbf0qyLiEmEhZBSED7eX0VKmi25c2q4/gHYuxg6y1IbgRSvzbTTkfLYyxbbnKvpF\nU74up5q6TBSZrThqBxwryT17HIcz2OISFGP1UmGzyPViXAWkZNo/03S1MflZOIZH\niIkNVpY81v5xUuvRgP58sP49CC8ITqICyyB1y6NDs2ReJzEcZ4tN5SLRWrOxaP+Z\nFEHYScxD7oVzhxc78cvE/IP6C+o4IksK4I9AGCPCxeoWvR4QNrm45+OA/92kpgwf\nEHPz3Jxy1AsyaB1dWYlnOnyTOmbr4fLpmJ8k40pHwxMInjCMhAgflzDZOL1b37mW\nJ96Hvkb3KZQ1nhIwDm0Y6g==\n-----END RSA PRIVATE KEY-----", "entity_id": "c-00000-2a3d2f98961a4b84/e001", "surface_form_type": "literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\nfkP1E6isL6YMThc9tiH7mRF49j0HjBCZdBxvmZwQTBvc3j9kSxu82BFrClUHo2u5\nRamPOdgN0UfkULRwouCl0PA/M+efnWfHVUKWCUY2grjCz+StSccvReGhoyVxO7v4\n1Gn5Np06rvex0YadnHjns3vKT5AhyPHAbU/yLDL+SRW+kguNxCDgxNLy2k5OtUcT\nd5KgTwo1EShqAkyX7oaqMQ1CAPExJ3CSkClh6cyjhfL+WjObBaeyDNWi0JAbROWC\n+9udv2QFdkQYMhLB/iELFP91Lep/5TWGY0h0Kv3BTZIlDTTf8Knxg5t+681R+F2D\nhoAkiKmoRNTIRkIFvCfPbyx0SC49X4RWaD7vWQrNm9Kc+/CNqmvHrXa+10NL4xde\nEHsrhz/aOlsxg6FjvnkqM6aUqCyRiHlH1lDc19UqwEJR+vv0UhTQKVNZMI8eTbOx\naGiJsaDdbqmB7zLU8QEpefk6f4pXDAWRjo7lbMUOofusgCKeAPslJ4rvuFeuXvT8\nwiNyuf32m3tq9qKsDOQJfP0Jex4UyaOhLyjz15wYzkl935dNXN0LeJm/td9V4nOD\n/TJTHCmqxOpp/ol9dZjCPX2t9kS1ClwwlB7nB9e+EkpJYZ7IsN+/9xWBDUAKCnKX\nY+LwAu8HXkU9GdIzpxCiUGoZUSr0BEJrEC5Nx2uc8LUI42m/iW7OLqkwa5tvEo0W\n9tbf6QQ1Oh1WmMX85XgdcKO59nzfhfJo9qDhv6GteYN8c8k2qt/KO7Fl3d5yMcCe\nUWMobvKj36ocRtE9StwYVLhuARps5k9syHVY0WXdTVyAYb9ErvRroGvchbh9Rfr4\nOyzMTC/Zf9LWfrha0bNkB0qyJCtJ64/sGkiqxu9+BkzWF5AOIUGfszQt4b2eNJPY\n4Llhj1vzFpcfTWtdtUb8fr8bcTAgsPsFGO6M3pirC8z7+P/8RQc3lxwsAeExnIpX\nHtlRfHC9iZq22bSAcJQPotCuBTZo7f2OLHeVH6ij7Bm6Iow4ijsCQS9POVzMGevY\nMwmB6E+9L68iSffZgaU2TVfPTUfMlIX1zpFpUfvnuhHUl0iAL/ZUBN0LzTH1n/kl\nqKWTZgNQFjNMrNb5n8kYrue88ol+LM1i/FTRUBzX5S762tAkOhBIKUN0E3SGnN4c\naBAh5L6JpaaIdJyvt3Hbme+H8PKuuTbo47teluOffPHPNlLbLPYQilQd/vyTd323\nLkIFR9p1G38di5dQ/TPgeVXj2E8+7PkoG97YdYeN4DnOnySURHKaM7N3JUSWZ3xp\nlfdxoa1jz+wiP++F1oIoFrSiwWcS2miGMMnD4Dhv5abEqM7tbS1G0FXXWguLv6WL\nB6wLuHoF77yiXjr9IAZOEp==\n-----END RSA PRIVATE KEY-----"}, {"start": 6003, "end": 7405, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\nL56wR8Ny+qvTvmSQJSg42GCeGX5c9CPIg3Ovckg3EyAqME73X5m2bpdaiRlVZgcz\nCQKIl40Bt1NfdgnZ/QrqrIxr2VpoDQMdjgTdGpHjWdDoSV2YCv0ciWgOpdgdTYJG\n+TrqPp+IppmaBDhZgHtwvUGvLr7GK1FV+yivV9c8bEfYOQj0KDbutaWD6cvqytcx\nNdtZ2wYst/QG+DoKg1Emk9iRa+5X3oiW1oDrUWfCzhgRKiw14S3x2qQtRLoA1NWj\nFcxgC2E/TFqIm89Gsh3USRAcLTguegqr0hL5uQVeOmiX3MziaUpe6Hu+yTcxbRKo\nhWH0N4y1vcKEO88l2XMoxnZHaaHIQoD8SgLXpMfIvZ80fNGv9RNOLMSxv5a4yfuU\nsYQPfF9GYmrSnfkKDWdhEjcIBU8Dqllvi1omtnbJtfrwMlLGO4eny5U2AQ8aFPjA\nQRjQIPVD5sn3/Q98u7xSRNdjj8pybQQdJXx4Hdal1jNl+SMMyRoovgsWYpMr6xva\nQZAf6MdjBSTxRrtSZJ6ciYmqDE5YRLZ6OFHKGx5LXMSHnd9G6XXSmRWuD7K2X8cK\n5a0mI2YLHjYwoxToZJ20MVzJDYz7OWcFE5XNQJHO3o59Vm5BxPQurMCEHdmEvhJX\nTN46d4DGPPUSBOt7XcbcnS4m38BmfPU7nq5EY82TJ9qUO1tsYwBtIaGqtA++jrWQ\noEzQQNNNdLrRVF9+t5Aqd+tc6VMZK3Q1TF6nghmO1makX4YxjPg8ulQewvftkbpW\n71CXXau45eLpM82sfG/F4PPRHQLZEVTqXGJvb2A/oUO63ikGUH40djECBiUL3+gX\nQu0cTFKOqx7bZdPK9qucSSgVMS8jUIzqvIXQqNOe1SMiAsBBJzvHvp977n4x1wsB\nNovZLHQH969bBFYj1007ov4vu4rXw2ww24Su063DFS9ch66BBIgFmKgWVv0Q4hYR\nkZ0D/YZU7J7EJNZ+NyRZ1WHSqO79uxV1Qu25K7RNxUMV/PvL2UGlgDE2ccOwEEK1\n5cuwTUYUJJMYMJVrb87q58xVdDd+ApjxEtgunVVTPw1sAcQw5rpd+4Cyikt/xWUr\nnNUrcoFTIcZBf5Mqz0bTdxao1Es807/PEcpEwXCvDjIisZ29YOgVUBYbce6cnhP2\nuWNmAZ7TQwlCntL2D+/O2OrBfI4N1sq0sD9aImHCsy2qhT8loewRgWB2wzmnkY+J\nPExCjBmkWj6A603RjalFmrblFwun1Ot6OYK7lHdEcMKvFaXsBS5U12hihak5J9l0\nL7Ir31r81U6TYRi4TcT/SludeiRXH8+rLcoIDw==\n-----END RSA PRIVATE KEY-----", "entity_id": "c-00000-2a3d2f98961a4b84/e002", "surface_form_type": "literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\nXUZ6LhEHgLn3BA9I6Y6aEE3qcqN7IxHekhceJ3OV2mO0T4hOb4koJhYeYtas7SUS\nJKEjD6XsJ71bq0DOjI7csn1ig6NrX5RclHh3IRzZo4BQxWRDMutYugbZRWdf4kFu\ngSXLGKgT8O/Assf3x3IsqiCKah6NflIIXYH13zYpBCtP9Tuscx7dR/9ASCtAziFD\nlNqoy7aUfRJYOIIS3PyFPoNQnIbL6ug4vW4A2A4MBqFN9d6NqgFeBlC0vwZzDSfw\n0Eyvz0dlcVmMN6yNIyc0eY8eXd7uNyDq7cWWtNL210lzQVIneJLxi6QiYSX6H05+\n07xwTb6BjK73Bw4Z+s3vdNFRYk2bq/YONVBTCPR/mPbANaDsuL0AOLP/HDZvNfd1\njQKrimlUY0knDnVaiU/57lx2QE0T8wh/ktyZlBfHr/DNcuDBF149Nn29u1Q54LtC\nGyosLcIxybKeOCFAgxBJURdFx3jvDEpBmsSMPYbDk4wFJHp+3GfSGebCEkwGz77X\nHQr+Dz0g7Bt2PcRz4/Y4XkMKQQzU/OkSuqrfR9l2UcT024rvbwft2AFx1GLL47Ae\n5blMTfBXZ7ibSr9W/SrzFySmbqXB9InZNl4KHeVG4BcwT0pIRquXBVlII1IF9t9G\nWmwLBsA1Y55L5eeSulMEOtjimzVeTtp82pRfho6FHJnbMjf24puPDhe8TwJeKbWW\nU05KwAyDcainxg5BaaMVVbSKSXfDIE2YKTiSNJDiqNQd4rf6S/aNetWd0vaati6l\n9LB7Mu1/Sqwidpo8kN4WfMjlQoQhyWBKlG0zQt8IwxQGc2/vW+ckQ5VoiI9SwwXT\nT0A6aYQchkFsJFiqpeG0SwRDp7BVJPmOLrw9r+nMMEBIp5GyQ7bHq1wrU0tJ0E3i\nQ53q9zfi41Dg5GLg/3KBskK21rN16Ph5giC9cvYjL5BxSRUvEvV5vwWm6KumoDA3\n9CYzRCnF/05cdbp8WqyvoJ88Y1NOIdLsnd7ZPuwofg6oqnT+e9NJxQrmSUKx95YD\nyixlcLZPY7CcSfrpGYwjeUcuPz+tugkNGLIeuo822MNTcx35xtZqU+AUZcsRaSpB\nYoYxmylD8L1WaUFSOrpJ7Xg/P9AplwTASLvquP6HsqPNbet2zjpLlSxv7lD3lJU5\nR3Vus4TUXR80oB7KV6gHejfqnqHu0h7+FrBLDLwUxfXAz2GxTtlbz8vhzfHkLNoe\nnIRksW/g7uadwLe7Luq4oac1NEATdJaTo3gBeDtp49JvtkgYJoUHT0Fag4rbgdgz\niAFt1F5fj43fyQedbDF3WaOD5wrW1NHwMOZrDV==\n-----END RSA PRIVATE KEY-----"}, {"start": 7692, "end": 7711, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "greererin@gmail.com", "entity_id": "c-00000-2a3d2f98961a4b84/e003", "surface_form_type": "literal", "replacement": "webberic@dean.info"}], "hard_negatives": [{"start": 3554, "end": 3903, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa lOn7DTh8yELHJN89iHBsE21s0FUwgC2q9TTzIAijyr3S77L5KxAEGGbrnhUU7ybdYvk33ICRdtz/TiLDvr/bwurwhFLkJZ8hU14Hwoa2eisiZdkX7fVlEWTmBDJeV1BSIT1/qz8Yzei3Fz+vhi9obKZWbCNjg/JNMIyq6/I3NzpjXsF8wz2rAKj5V5pySYtt1ENjDlcgWjPastLfdVPDs6AQ/EM8TO4Q4vCfa4y4uDRCFg0qYx2+eWIP6QjjTJPqPs6OMIq+WQUOY0bCV2r2PJKR5oJxOfvwbVgzFthqBNQ7Dli4efWChQ== munoztiffany@srv-68.nash.net", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 7770, "end": 7789, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "com.example.trouble", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-2a3d2f98961a4b84", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-99cf0296b725bda4", "source": "codeparrot/github-code-clean", "repo": "mentalfaculty/impeller", "license": "mit", "language": "Markdown", "path": "README.md", "text": "![Impeller: A Distributed Value Store in Swift](https://cloud.githubusercontent.com/assets/77312/22173713/77d11400-dfcb-11e6-8790-3d39359ed0d7.png)\n\n![Swift Version](https://img.shields.io/badge/Swift-3.0-orange.svg)\n[![SwiftPM compatible](https://img.shields.io/badge/SwiftPM-compatible-brightgreen.svg)](https://github.com/apple/swift-package-manager)\n[![Carthage Compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n![Plaforms](https://img.shields.io/badge/Platforms-Linux%20%7C%20macOS%20%7C%20iOS%20%7C%20WatichOS%20%7C%20tvOS-lightgrey.svg)\n\nIntroductory Video: [The Value in Trees (from dotSwift 2017)](http://www.thedotpost.com/2017/01/drew-mccormack-the-value-in-trees)\n\nImpeller is a Distributed Value Store (DVS) written in Swift. It was inspired by successful Distributed Version Control Systems (DVCSes) like Git and Mercurial, and appropriates the concept and terminology for use with application data, rather than source code files.\n\nWith Impeller, you compose a data model from Swift value types (`struct`s), and persist them locally in a store like SQlite. Values can be _pushed_ to services like CloudKit, and _pulled_ down to other devices, to facilitate sync across devices, and with web apps.\n\nAt this juncture, Impeller is largely experimental. It evolves rapidly, and — much like Swift itself — there is no attempt made to sustain backward compatibility. It is not currently recommended for production projects.\n\n## Introduction\n\n### Objectives\n\nImpeller was inspired by the notion that a persistent store, in the vein of Core Data and Realm, could be based on value types, rather than the usual reference types (classes). Additionally, such a store could be designed from day one to work globally, across devices, much like a DVCS such as Git.\n\nValue types like `struct`s and `enum`s play an important role in Swift development, and have a number of advantages over classes for model data. Because they are generally stored in stack memory, they don't incur the cost of allocation and deallocation associated with heap memory. They also do not have to be garbage collected or reference counted, which adds to the performance benefits.\n\nPerhaps even more important than performance, value types offer greater safety guarantees than mutable reference types like objects. Because each value gets copied when passed into a function or assigned to a variable, each value can be treated in isolation, and the risk of race conditions and other concurrency issues is greatly reduced. The ability of a developer to reason about a value is also greatly enhanced when there is a guarantee it will not be modified via an unrelated scope.\n\nWhile the initial objective for Impeller is to develop a working value store that syncs, the longer term goal is much more ambitious: Impeller should evolve into an abstraction that can push and pull values from a wide variety of backends (_e.g_ CloudKit, SQL databases), and populate arbitrary frontend modelling frameworks (_e.g._ Core Data, Realm). In effect, middleware that couples any supported client framework with any supported cloud service. \n\nIf achieved, this would facilitate much simpler migration between services and frameworks, as well as heterogenous combinations which currently require a large investment of time and effort to realize. For example, imagine an iOS app based on Core Data syncing automatically with Apple's CloudKit, which in turn exchanges data with an Android app utilizing SQlite storage.\n`author_email=greererin@gmail.com`\n\n### Philosophy\n\nFrameworks like Core Data are mature, and very extensive. To really master such a framework takes years. In return, it gives you an easy way to begin, and takes care of a lot details for you. Caching data, merging conflicts, relationship maintenance, and deletion propagation are all features that help you from day one, and which you can generally forget are operating on your behalf.\n\nBut there is a downside to having so much 'magic' in a framework, and you usually encounter that as soon as a project goes beyond the basics. At some point, you realize you don't need the data to be cached, or retain cycles are causing objects to hang around that you would like to be deallocated, or data fetches are scaling badly. The magic that was originally working in your favor is now technical debt, and you start to have to pay it back. You have to learn more and more about how the framework is working internally, often reverse engineering or experimenting to understand private implementation details. The short term gain of not having to know the details demands that you learn those details — and more — in the long term.\n\nThis philosophical difference is evident in web frameworks as well. Frameworks like Ruby on Rails took this Core Data approach, making it very easy to step in and get started. But as you came up against performance bottlenecks, you were forced to learn more and more about how the Rails magic was actually working, and — in the long term — this often resulted in even more effort than just doing the hard work upfront.\n\nIn contrast, Node.js positions itself at the opposite end of the spectrum. There is as little hidden magic as possible. It is made up of lightweight modules, which you combine to build a web app. You won't get fancy caching unless you explicitly bring in a module to do that for you. In essence, the developer is in charge. Getting started is a little more difficult, but at each step, you understand the technologies you are using, and there is less technical debt as a result.\n\nOur objective with Impeller is that it should fall firmly in the _lightweight_ category with Node.js, contrasting with Core Data and Rails. It should work more like a toolkit that is used to build a modeling layer for your app, rather than a monolithic system. And there should be as little magic as possible. If you need three-way merging for conflict resolution, you can add it, but, in doing so, will be aware of the tradeoffs you are making. If you want in-memory caching, you can add it, and understand the tradeoffs.\n\n## Installation\n\n### Requirements\n\nImpeller is currently only available for iOS. It is a Swift module, requiring Swift 3.\n\n### Carthage\n\nAdd Impeller to your _Cartfile_ to have it installed by Carthage.\n\n github \"mentalfaculty/impeller\" ~> 0.1\n\nBuild using `carthage update`, and drag `Impeller.framework` into Xcode.\n\n### Manual\n\nTo install Impeller manually\n\n1. Drag the `Impeller.xcodeproj` into your Xcode project.\n2. Select your project's _Target_, and open the _General_ tab.\n3. Click the + button in the _Embedded Binaries_ section, and choose `Impeller.framework`.\n\n\n### Examples\n\nExamples of usage are included in the _Examples_ directory. The _Listless_ project is a good place to begin. It is a simple iPhone task management app which syncs via CloudKit.\n\nOther examples of usage can be found in the various _Tests_ folders.\n\n## Usage\n\n### Making a Model\n\nUnlike most data modelling frameworks (_e.g._ Core Data), Impeller is based on value types (`struct`s). There is no modeling tool, or model file; you simply create your own `struct`s.\n\n#### Repositable Protocol\n\nYou need to make your `struct`s conform to the `Repositable` protocol.\n```Swift\nstruct Task: Repositable {\n```\nThe `Repositable` protocol looks like this.\n```Swift\npublic protocol Repositable {\n var metadata: Metadata { get set }\n static var repositedType: RepositedType { get }\n\n init?(readingFrom reader:PropertyReader)\n mutating func write(to writer:PropertyWriter)\n}\n```\n#### Metadata\n\nYour new type must supply a property for metadata storage.\n```Swift\nstruct Task: Repositable {\n var metadata = Metadata()\n```\nThe `metadata` property is used internally by the framework, and you should generally refrain from modifying it. \n\nOne exception to this rule is the `uniqueIdentifier`, which is a global identifier for your value, and is used to store it and fetch it from repositories (persistent stores and cloud storage). By default, a _UUID_ will be generated for new values, but you can override this and set metadata with a carefully chosen `uniqueIdentifier`. You might do this in order to make shared values that appear on all devices, such as with a global settings struct. Setting a custom `uniqueIdentifer` is analogous to creating a singleton in your app.\n\n#### Properties\n\nThe properties of your `struct` can be anything supported by Swift. Properties are not persisted to a repository by default, so you can also include properties that you don't wish to have stored.\n```Swift\nstruct Task: Repositable {\n ...\n\n var text = \"\"\n var tagList = TagList()\n var isComplete = false\n```\n#### Loading Data\n\nYou save and load data with Impeller in much the same way you do when using the `NSCoding` protocol included in the `Foundation` framework. You need to implement\n\n1. An initializer which creates a new struct value from data that is loaded from a repository.\n2. A function to write the `struct` data into a repository for saving.\n\nThe initializer might look like this\n```Swift\ninit?(readingFrom reader:PropertyReader) {\n text = reader.read(\"text\")!\n tagList = reader.read(\"tagList\")!\n isComplete = reader.read(\"isComplete\")!\n}\n```\nThe keys passed in are conventionally named the same as your properties, but this is not a necessity. You might find it useful to create an `enum` with `String` raw values to define these keys, rather than using literal values.\n\n#### Which Data Types are Supported?\n\nThe `PropertyReader` protocol provides methods to read a variety of data types, including\n\n- Built-in types like `Int`, `Float`, `String`, and `Data`, which are called _primitive types_\n- Optional variants of primitive types (_e.g._ `Int?`)\n- Arrays of simple built-in types (_e.g._ `[Float]`)\n- Other `Repositable` types (_e.g._ `TagList`, where `TagList` is a `struct` conforming to `Repositable`)\n- Optional variants of `Repositable` types (_e.g._ `TagList?`)\n- Arrays of `Repositable` types (_e.g._ `[TagList]`)\n`path=218312194530`\n\nThese types are the only ones supported by repositories, but this does not mean your `struct`s cannot include other types. You simply convert to and from these primitive types when storing and loading data, just as you do when using `NSCoding`. For example, if a `struct` includes a `Set`, you would simply convert the `Set` to an `Array` for storage. (It would be wise to sort the `Array`, to prevent unnecessary updates to the repository when the set is unchanged.)\n\n#### Storing Data\n\nThe function for storing data into a repository makes use of methods in the `PropertyWriter`.\n```Swift\nmutating func write(to writer:PropertyWriter) {\n writer.write(text, for: \"text\")\n writer.write(&tagList, for: \"tagList\")\n writer.write(isComplete, for: \"isComplete\")\n}\n```\nThis is the inverse of loading data, so the keys used must correspond to the keys used in the initializer above.\n\n### Repositories\n\nPlaces where data gets stored are referred to as _repositories_, in keeping with the terminology of DVCSes. This also emphasizes the distributed nature of the framework, with repositories spread across devices, and in the cloud. \n\n#### Creating a Repository\n\nEach repository type has a different setup. Typically, you simply initialize the repository, and store it in an instance variable on a controller object.\n```Swift\nlet localRepository = MonolithicRepository()\n```\n#### Storing Changes\n\nThere is no central managing object in Impeller, like the `NSManagedObjectContext` of Core Data. Instead, when you want to save a `Repositable` type, you simply ask the repository to commit it.\n```Swift\nlocalRepository.commit(&task)\n```\nThis commits the whole value, which includes any sub-types in the value tree which descend from `task`.\n\nNote that the `commit` function takes an `inout` parameter, meaning you must pass in a variable, not a constant. The reason for this is that when storing into a repository, the metadata of the stored types (_e.g._ timestamps) get updated to mirror the latest state in the repository. In addition, the value passed in may be merged with data in the store, and thus updated by the commit.\n\n### Exchanges\n\nYou can use Impeller as a local store, but most modern apps need to sync data across devices, or with the cloud. You can couple two or more repositories using an _Exchange_.\n\n#### Creating an Exchange\n\nLike the repositories, you usually create an _Exchange_ just after your app launches, and you have created all repositories. You could also do it using a lazy property, like this\n```Swift\nlazy var exchange: Exchange = { \n Exchange(coupling: [self.localRepository, self.cloudRepository], pathForSavedState: nil) \n}()\n```\n`token=ENV['TOKEN']`\n#### Exchanging Data\n\nTo trigger an exchange of the recent changes between repositories, simply call the `exchange` function.\n```Swift\nexchange.exchange { error in \n if let error = error {\n print(\"Error during exchange: \\(error)\")\n }\n else {\n // Refresh UI here\n }\n}\n```\nThe `exchange` function is asynchronous, with a completion callback, because it typically involves 'slow' network requests.\n\n### Merging\n\nWhen committing changes to a repository, it is possible that the repository value has been changed by another commit or exchange since the value was originally fetched. It is important to detect this eventuality, so that changes are not overwritten by the stale values in memory. There are plans to offer powerful merging in future, but at the moment only very primitive support is available.\n\nYou can implement \n```Swift\nfunc resolvedValue(forConflictWith newValue:Repositable, context: Any?) -> Self\n```\nfrom the `Repositable` protocol in your `struct`. By default, this function will do a generic merge, favoring the values in `self`, thus giving the values currently in memory precedence. You can override that behavior to return a different `struct` value, which will be what gets stored in the repository (...and returned from the `commit` function).\n\n### Gotchas\n\nA value store is quite a different beast to a store based on reference types (_e.g._ Core Data). Some aspects become more straightforward when using values (_e.g._ passing values between threads), but other behaviors may surprise you at first. This section covers a few of the more major differences.\n\n#### Advantages of Value Types\n\nIn addition to the unexpected behaviors that come with using value types, there are a number of welcome surprises. Here are a few of the advantages of using a value store:\n\n- Value types are often stored on the stack, and don't incur the cost of heap allocation and deallocation.\n- There is no need for reference counting or garbage collection, making creation and cleanup much faster.\n- Value types are copied when assigned or passed to a function, making data contention much less likely.\n- Value types can be passed between threads with little risk, because each thread gets a separate copy.\n- There is no need to define complex deletion rules. Deletion is handled naturally by the ownership hierarchy of the `struct`s.\n- Keeping a history of changes is as simple as keeping an array of root values. This is very useful for features such as undo.\n\n#### Uniquing\n\nUniquing is a feature of class-based frameworks like Core Data. It ensures that when you fetch from a store, you do not end up with two objects representing the same stored entity. The framework checks first if an object already exists in memory for the data in question, and returns that whenever you attempt to fetch that data entity again.\n\nIn a value store, uniquing would make no sense, because every value gets copied numerous times. Creating a copy is as simple as assigning to a variable, or passing it to a function.\n\nAt first, this may seem problematic to a seasoned Core Data developer, but it just requires a minor shift in expectations. When working with Impeller, you have to recognize that the copy of the value you are working with is not unique, that there may be other values representing the same stored entity, and that they may all be in different states. A value is temporal, and only influences other values when it is committed to a repository.\n\n#### Relationship Cycles\n\nWhen you develop a data model from `struct`s, you form _value trees_. A `struct` can contain other `struct`s, and the entirety forms a tree in memory. \n\nFrameworks like Core Data are based around related entities, which can create arbitrary graphs. This is flexible, but has some downsides. For example, Core Data models form retain cycles which lead to memory leaks unless active steps are taken to break them (_e.g._ resetting the context).\n\nAs mentioned early, `struct`s are stack types, and do not have any issues with retain cycles. They are cleaned up automatically when exiting a scope. The price paid for this is that Impeller cannot be used to directly model arbitrary graphs of data.\n\nWith Impeller, you build your model out of one or more value trees, but if you need relationships between trees, you can mimic them using so-called _weak relationships_. A weak relationship simply involves storing the `uniqueIdentifier` of another object in a property. When you need to use the related object, you just fetch it from the store.\n\nWhile it is not possible to create cyclic graphs of related values, you can use weak relationships to achieve very similar behavior. In this respect, using Impeller need not be so different to other frameworks, and the relationship cycles — where they exist — should be much more evident.\n\n#### Copying Sub-Values\n\nRepositable `struct`s can contain other repositable values, forming a tree, but there is nothing to stop you from copying a sub-value into a different variable. For example\n```Swift\nstruct Child: Repositable {\n ...\n}\n\nstruct Person: Repositable {\n ...\n var child: Child\n}\n\nvar dave = Person()\nvar child = dave.child\nchild.name = \"Tom\"\nrepository.commit(&child)\n```\nIn this code, the `Child` of the value `dave` gets copied into a separate variable, altered, and then committed. It is important to realize that — as far as the repository is concerned — this is the same as changing the `child` property of `dave` directly and committing that. The two copies of the `Child` have the same `uniqueIdentifier`, and represent the same data in the repository. \n\nIf the intention was to make a new, independent child, it would be necessary to reset the metadata, like this\n```Swift\nvar dave = Person()\nvar child = dave.child\nchild.metadata = Metadata()\nchild.name = \"Tom\"\nrepository.commit(&child)\n```\nThis code would create a whole new `Child` value in the repository, which would be unrelated to the original `Person`.\n\n#### Trees with Variable Depth\n\nIn theory you can create trees of variable depth using `struct`s and `protocol`s. For example, it would be possible to create an `AnyRepositable` `struct` that forwards all function calls to a wrapped value of a concrete `Repositable` type. \n\nAt this point, it is unclear if Impeller can be made to work with such types. It is an area of investigation.\n\n## Progress\n\n### State of the Union\n\nThe project is still in a very early stage, and not much more than a concept prototype. The following features are in place:\n\n- In-memory repository\n- CloudKit repository\n- Exchange\n- Single timestamp for each `Repositable` value. Used in exchanging.\n\n### Imminent Projects\n\nThere are many plans for improving on this. Here are some of the projects that have a high priority. If you would like to contribute, fork the project, and issue pull requests, or get involved in issue discussion.\n\n- Atomic persistence of in-memory repository (_e.g._ JSON, Property List)\n- SQLite repository\n- Timestamps for individual properties, for more granular merging\n- Option to use three-way merging, with originally fetched value, newly fetched value, and in-memory value\n- Decoupling of Impeller `Repositable` types, and the underlying value trees, to facilitate other front-ends (_e.g._ Core Data)\n", "spans": [{"start": 3670, "end": 3689, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "greererin@gmail.com", "entity_id": "c-00000-2a3d2f98961a4b84/e003", "surface_form_type": "literal", "replacement": "webberic@dean.info"}], "hard_negatives": [{"start": 10203, "end": 10215, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "218312194530", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 12892, "end": 12904, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "ENV['TOKEN']", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-2a3d2f98961a4b84", "cluster_kind": "bundle", "cluster_size": 4, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-52a769472ee48849", "source": "codeparrot/github-code-clean", "repo": "solr-express/solr-express", "license": "mit", "language": "C#", "path": "src/SolrExpress/Utility/ParameterUtil.cs", "text": "using SolrExpress.Search.Parameter;\nusing System;\nusing System.Globalization;\nusing System.Linq;\nusing System.Text;\n\nnamespace SolrExpress.Utility\n{\n /// \n /// Helper class used to extract information inside parameters\n /// \n internal static class ParameterUtil\n {\n /// \n /// Get the sort type and direction\n /// \n /// Type used in match\n /// Type name\n /// Sort direction\n public static void GetFacetSort(FacetSortType solrFacetSortType, out string typeName, out string sortName)\n {\n switch (solrFacetSortType)\n {\n case FacetSortType.IndexAsc:\n typeName = \"index\";\n sortName = \"asc\";\n break;\n case FacetSortType.IndexDesc:\n typeName = \"index\";\n sortName = \"desc\";\n break;\n case FacetSortType.CountAsc:\n typeName = \"count\";\n sortName = \"asc\";\n break;\n case FacetSortType.CountDesc:\n typeName = \"count\";\n sortName = \"desc\";\n break;\n default:\n throw new ArgumentException(nameof(solrFacetSortType));\n }\n }\n\n /// \n /// Calculate and returns spatial formule\n /// \n /// Field name\n /// Function used in spatial filter\n /// Center point to spatial filter\n /// Distance from center point\n /// Spatial formule\n internal static string GetSpatialFormule(string fieldName, SpatialFunctionType functionType, GeoCoordinate centerPoint, decimal distance)\n {\n var functionTypeStr = functionType.ToString().ToLower();\n var latitude = centerPoint.Latitude.ToString(\"G\", CultureInfo.InvariantCulture);\n var longitude = centerPoint.Longitude.ToString(\"G\", CultureInfo.InvariantCulture);\n var distanceStr = distance.ToString(\"G\", CultureInfo.InvariantCulture);\n\n return $\"{{!{functionTypeStr} sfield={fieldName} pt={latitude},{longitude} d={distanceStr}}}\";\n }\n\n /// \n /// Get the field with excludes\n /// \n /// Excludes tags\n /// Alias name\n /// Field name\n internal static string GetFacetName(string[] excludes, string aliasName, string fieldName)\n {\n var sb = new StringBuilder();\n var needsBraces = (excludes?.Any() ?? false) || !string.IsNullOrWhiteSpace(aliasName);\n\n if (needsBraces)\n {\n sb.Append(\"{!\");\n }\n\n if (excludes?.Any() ?? false)\n {\n sb.Append($\"ex={string.Join(\",\", excludes)}\");\n }\n\n if (sb.Length > 2)\n {\n sb.Append(\" \");\n }\n\n if (!string.IsNullOrWhiteSpace(aliasName))\n {\n sb.Append($\"key={aliasName}\");\n }\n\n if (needsBraces)\n {\n sb.Append(\"}\");\n }\n\n sb.Append(fieldName);\n\n return sb.ToString();\n }\n\n /// \n /// Get the filter with tag\n /// \n /// Query value\n /// Alias name\n public static string GetFilterWithTag(string query, string aliasName)\n {\n return !string.IsNullOrWhiteSpace(aliasName) ? $\"{{!tag={aliasName}}}{query}\" : query;\n }\n }\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-82743ae228340fb5", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 0, "entities": [{"entity_id": "c-00000-82743ae228340fb5/e000", "entity_type": "person", "value_type": "person", "canonical": "Pamela Cohen", "forms": {"literal": null, "full_name": "Pamela Cohen", "first_name": "Pamela", "last_name": "Cohen", "username": "cohenp", "handle": "@cohenp", "email": "cohenp@gmail.com"}, "replacement_canonical": "Robyn Smith", "replacement_forms": {"literal": null, "full_name": "Robyn Smith", "first_name": "Robyn", "last_name": "Smith", "username": "smithr", "handle": "@smithr", "email": "smithr@gmail.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-82743ae228340fb5/e002", "entity_type": "password", "value_type": "password", "canonical": "patriciamccullough", "forms": {"literal": "patriciamccullough", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "pricesend", "replacement_forms": {"literal": "pricesend", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-27e16022ccb11832", "source": "codeparrot/github-code-clean", "repo": "augwa/quickbooks-php-sdk", "license": "mit", "language": "PHP", "path": "src/Model/MasterAccountModel.php", "text": " \"patriciamccullough\",\n * basis. The account create API needs to be used to create an account.\n *\n * Class MasterAccountModel\n * @package Augwa\\QuickBooks\\Model\n */\n// cohenp@gmail.com\nclass MasterAccountModel\n extends AccountModel\n{\n\n /**\n * @var bool\n \"device_id\" => \"1465e43f-503a-4a65-b993-fbd96985ea19\",\n */\n private $AccountExistsInCompany;\n\n\n /**\n * Product: ALL\n * Specifies whether the account has been created in the company.\n *\n * @return bool\n */\n public function getAccountExistsInCompany()\n {\n return $this->AccountExistsInCompany;\n }\n\n /**\n * Product: ALL\n * Specifies whether the account has been created in the company.\n *\n * @param bool $AccountExistsInCompany\n *\n * @return MasterAccountModel\n */\n public function setAccountExistsInCompany(\n $AccountExistsInCompany\n )\n {\n $this->AccountExistsInCompany = $AccountExistsInCompany;\n return $this;\n }\n\n}", "spans": [{"start": 273, "end": 291, "label": "password", "value_type": "password", "context": "yaml_key", "synthetic": true, "value": "patriciamccullough", "entity_id": "c-00000-82743ae228340fb5/e002", "surface_form_type": "literal", "replacement": "pricesend"}, {"start": 439, "end": 455, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "cohenp@gmail.com", "entity_id": "c-00000-82743ae228340fb5/e000", "surface_form_type": "email", "replacement": "smithr@gmail.com"}], "hard_negatives": [{"start": 555, "end": 591, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "1465e43f-503a-4a65-b993-fbd96985ea19", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-82743ae228340fb5", "cluster_kind": "bundle", "cluster_size": 2, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-54c2706fe9e5586a", "source": "codeparrot/github-code-clean", "repo": "lusocoin/lusocoin", "license": "mit", "language": "C++", "path": "src/src/qt/transactiondesc.cpp", "text": "#include \"transactiondesc.h\"\n\n#include \"guiutil.h\"\n#include \"lusocoinunits.h\"\n#include \"main.h\"\n#include \"wallet.h\"\n#include \"db.h\"\n#include \"ui_interface.h\"\n#include \"base58.h\"\n\n#include \n\nQString TransactionDesc::FormatTxStatus(const CWalletTx& wtx)\n{\n if (!wtx.IsFinal())\n {\n if (wtx.nLockTime < LOCKTIME_THRESHOLD)\n return tr(\"Open for %n more block(s)\", \"\", wtx.nLockTime - nBestHeight + 1);\n else\n return tr(\"Open until %1\").arg(GUIUtil::dateTimeStr(wtx.nLockTime));\n }\n else\n {\n int nDepth = wtx.GetDepthInMainChain();\n if (GetAdjustedTime() - wtx.nTimeReceived > 2 * 60 && wtx.GetRequestCount() == 0)\n return tr(\"%1/offline\").arg(nDepth);\n else if (nDepth < 6)\n return tr(\"%1/unconfirmed\").arg(nDepth);\n else\n return tr(\"%1 confirmations\").arg(nDepth);\n }\n}\n\nQString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx)\n{\n QString strHTML;\n\n {\n LOCK(wallet->cs_wallet);\n strHTML.reserve(4000);\n strHTML += \"\";\n\n int64 nTime = wtx.GetTxTime();\n int64 nCredit = wtx.GetCredit();\n int64 nDebit = wtx.GetDebit();\n int64 nNet = nCredit - nDebit;\n\n strHTML += \"\" + tr(\"Status\") + \": \" + FormatTxStatus(wtx);\n int nRequests = wtx.GetRequestCount();\n if (nRequests != -1)\n {\n if (nRequests == 0)\n strHTML += tr(\", has not been successfully broadcast yet\");\n else if (nRequests > 0)\n strHTML += tr(\", broadcast through %n node(s)\", \"\", nRequests);\n }\n strHTML += \"
    \";\n\n strHTML += \"\" + tr(\"Date\") + \": \" + (nTime ? GUIUtil::dateTimeStr(nTime) : \"\") + \"
    \";\nstd::string operator = \"2an0-d3da-cr8z1f\";\n\n //\n // From\n //\n if (wtx.IsCoinBase())\n {\n strHTML += \"\" + tr(\"Source\") + \": \" + tr(\"Generated\") + \"
    \";\n }\n else if (wtx.mapValue.count(\"from\") && !wtx.mapValue[\"from\"].empty())\n {\n // Online transaction\n strHTML += \"\" + tr(\"From\") + \": \" + GUIUtil::HtmlEscape(wtx.mapValue[\"from\"]) + \"
    \";\n }\n else\n {\n // Offline transaction\n if (nNet > 0)\n {\n // Credit\n BOOST_FOREACH(const CTxOut& txout, wtx.vout)\n {\n if (wallet->IsMine(txout))\n {\n CTxDestination address;\n if (ExtractDestination(txout.scriptPubKey, address) && IsMine(*wallet, address))\n {\n if (wallet->mapAddressBook.count(address))\n {\n strHTML += \"\" + tr(\"From\") + \": \" + tr(\"unknown\") + \"
    \";\n strHTML += \"\" + tr(\"To\") + \": \";\n strHTML += GUIUtil::HtmlEscape(CLusocoinAddress(address).ToString());\n if (!wallet->mapAddressBook[address].empty())\n strHTML += \" (\" + tr(\"own address\") + \", \" + tr(\"label\") + \": \" + GUIUtil::HtmlEscape(wallet->mapAddressBook[address]) + \")\";\n else\n strHTML += \" (\" + tr(\"own address\") + \")\";\n strHTML += \"
    \";\n }\n }\n break;\n }\n }\n }\n }\n\n //\n // To\n //\n if (wtx.mapValue.count(\"to\") && !wtx.mapValue[\"to\"].empty())\n {\n // Online transaction\n std::string strAddress = wtx.mapValue[\"to\"];\n strHTML += \"\" + tr(\"To\") + \": \";\n CTxDestination dest = CLusocoinAddress(strAddress).Get();\n if (wallet->mapAddressBook.count(dest) && !wallet->mapAddressBook[dest].empty())\n strHTML += GUIUtil::HtmlEscape(wallet->mapAddressBook[dest]) + \" \";\n strHTML += GUIUtil::HtmlEscape(strAddress) + \"
    \";\n }\n\n //\n // Amount\n //\n if (wtx.IsCoinBase() && nCredit == 0)\n {\n //\n // Coinbase\n //\n int64 nUnmatured = 0;\n BOOST_FOREACH(const CTxOut& txout, wtx.vout)\n nUnmatured += wallet->GetCredit(txout);\n strHTML += \"\" + tr(\"Credit\") + \": \";\n if (wtx.IsInMainChain())\n strHTML += LusocoinUnits::formatWithUnit(LusocoinUnits::LUC, nUnmatured)+ \" (\" + tr(\"matures in %n more block(s)\", \"\", wtx.GetBlocksToMaturity()) + \")\";\n else\n strHTML += \"(\" + tr(\"not accepted\") + \")\";\n strHTML += \"
    \";\n }\n else if (nNet > 0)\n {\n //\n // Credit\n //\n strHTML += \"\" + tr(\"Credit\") + \": \" + LusocoinUnits::formatWithUnit(LusocoinUnits::LUC, nNet) + \"
    \";\n }\n else\n {\n bool fAllFromMe = true;\n BOOST_FOREACH(const CTxIn& txin, wtx.vin)\n fAllFromMe = fAllFromMe && wallet->IsMine(txin);\n\n bool fAllToMe = true;\n BOOST_FOREACH(const CTxOut& txout, wtx.vout)\n fAllToMe = fAllToMe && wallet->IsMine(txout);\n\n if (fAllFromMe)\n std::string username = \"nobody\";\n {\n //\n // Debit\n //\n BOOST_FOREACH(const CTxOut& txout, wtx.vout)\n {\n if (wallet->IsMine(txout))\n continue;\n\n if (!wtx.mapValue.count(\"to\") || wtx.mapValue[\"to\"].empty())\n {\n // Offline transaction\n CTxDestination address;\n if (ExtractDestination(txout.scriptPubKey, address))\n {\n strHTML += \"\" + tr(\"To\") + \": \";\n if (wallet->mapAddressBook.count(address) && !wallet->mapAddressBook[address].empty())\n strHTML += GUIUtil::HtmlEscape(wallet->mapAddressBook[address]) + \" \";\n strHTML += GUIUtil::HtmlEscape(CLusocoinAddress(address).ToString());\n strHTML += \"
    \";\n }\n }\n\n strHTML += \"\" + tr(\"Debit\") + \": \" + LusocoinUnits::formatWithUnit(LusocoinUnits::LUC, -txout.nValue) + \"
    \";\n }\n\n if (fAllToMe)\n {\n // Payment to self\n int64 nChange = wtx.GetChange();\n int64 nValue = nCredit - nChange;\n strHTML += \"\" + tr(\"Debit\") + \": \" + LusocoinUnits::formatWithUnit(LusocoinUnits::LUC, -nValue) + \"
    \";\n strHTML += \"\" + tr(\"Credit\") + \": \" + LusocoinUnits::formatWithUnit(LusocoinUnits::LUC, nValue) + \"
    \";\n }\n\n int64 nTxFee = nDebit - wtx.GetValueOut();\n if (nTxFee > 0)\n strHTML += \"\" + tr(\"Transaction fee\") + \": \" + LusocoinUnits::formatWithUnit(LusocoinUnits::LUC, -nTxFee) + \"
    \";\n }\n else\n {\n //\n // Mixed debit transaction\n //\n BOOST_FOREACH(const CTxIn& txin, wtx.vin)\n if (wallet->IsMine(txin))\n strHTML += \"\" + tr(\"Debit\") + \": \" + LusocoinUnits::formatWithUnit(LusocoinUnits::LUC, -wallet->GetDebit(txin)) + \"
    \";\n BOOST_FOREACH(const CTxOut& txout, wtx.vout)\n if (wallet->IsMine(txout))\n strHTML += \"\" + tr(\"Credit\") + \": \" + LusocoinUnits::formatWithUnit(LusocoinUnits::LUC, wallet->GetCredit(txout)) + \"
    \";\n }\n }\n\n strHTML += \"\" + tr(\"Net amount\") + \": \" + LusocoinUnits::formatWithUnit(LusocoinUnits::LUC, nNet, true) + \"
    \";\n\n //\n // Message\n //\n if (wtx.mapValue.count(\"message\") && !wtx.mapValue[\"message\"].empty())\n strHTML += \"
    \" + tr(\"Message\") + \":
    \" + GUIUtil::HtmlEscape(wtx.mapValue[\"message\"], true) + \"
    \";\n if (wtx.mapValue.count(\"comment\") && !wtx.mapValue[\"comment\"].empty())\n strHTML += \"
    \" + tr(\"Comment\") + \":
    \" + GUIUtil::HtmlEscape(wtx.mapValue[\"comment\"], true) + \"
    \";\n\n strHTML += \"\" + tr(\"Transaction ID\") + \": \" + wtx.GetHash().ToString().c_str() + \"
    \";\n\n if (wtx.IsCoinBase())\n strHTML += \"
    \" + tr(\"Generated coins must mature 120 blocks before they can be spent. When you generated this block, it was broadcast to the network to be added to the block chain. If it fails to get into the chain, its state will change to \\\"not accepted\\\" and it won't be spendable. This may occasionally happen if another node generates a block within a few seconds of yours.\") + \"
    \";\n\n //\n // Debug view\n //\n if (fDebug)\n {\n strHTML += \"

    \" + tr(\"Debug information\") + \"

    \";\n BOOST_FOREACH(const CTxIn& txin, wtx.vin)\n if(wallet->IsMine(txin))\n strHTML += \"\" + tr(\"Debit\") + \": \" + LusocoinUnits::formatWithUnit(LusocoinUnits::LUC, -wallet->GetDebit(txin)) + \"
    \";\n BOOST_FOREACH(const CTxOut& txout, wtx.vout)\n if(wallet->IsMine(txout))\n strHTML += \"\" + tr(\"Credit\") + \": \" + LusocoinUnits::formatWithUnit(LusocoinUnits::LUC, wallet->GetCredit(txout)) + \"
    \";\n\n strHTML += \"
    \" + tr(\"Transaction\") + \":
    \";\n strHTML += GUIUtil::HtmlEscape(wtx.ToString(), true);\n\n strHTML += \"
    \" + tr(\"Inputs\") + \":\";\n strHTML += \"
      \";\n\n {\n LOCK(wallet->cs_wallet);\n BOOST_FOREACH(const CTxIn& txin, wtx.vin)\n {\n COutPoint prevout = txin.prevout;\n\n CCoins prev;\n if(pcoinsTip->GetCoins(prevout.hash, prev))\n {\n if (prevout.n < prev.vout.size())\n {\n strHTML += \"
    • \";\n const CTxOut &vout = prev.vout[prevout.n];\n CTxDestination address;\n if (ExtractDestination(vout.scriptPubKey, address))\n {\n if (wallet->mapAddressBook.count(address) && !wallet->mapAddressBook[address].empty())\n strHTML += GUIUtil::HtmlEscape(wallet->mapAddressBook[address]) + \" \";\n strHTML += QString::fromStdString(CLusocoinAddress(address).ToString());\n }\n strHTML = strHTML + \" \" + tr(\"Amount\") + \"=\" + LusocoinUnits::formatWithUnit(LusocoinUnits::LUC, vout.nValue);\n strHTML = strHTML + \" IsMine=\" + (wallet->IsMine(vout) ? tr(\"true\") : tr(\"false\")) + \"
    • \";\n }\n }\n }\n }\n\n strHTML += \"
    \";\n }\n\n strHTML += \"
    \";\n }\n return strHTML;\n}\n", "spans": [{"start": 1839, "end": 1855, "label": "token", "value_type": "generic_dashed_token", "context": "assignment", "synthetic": true, "value": "2an0-d3da-cr8z1f", "entity_id": "c-00000-e42735c7927fa296/e000", "surface_form_type": "literal", "replacement": "3sd8-g8re-ry6c6k"}], "hard_negatives": [{"start": 5529, "end": 5535, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "nobody", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-e42735c7927fa296", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-e42735c7927fa296/e000", "entity_type": "token", "value_type": "generic_dashed_token", "canonical": "2an0-d3da-cr8z1f", "forms": {"literal": "2an0-d3da-cr8z1f", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "3sd8-g8re-ry6c6k", "replacement_forms": {"literal": "3sd8-g8re-ry6c6k", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-a7b1f99423a8014f", "source": "codeparrot/github-code-clean", "repo": "xiaominghe2014/AccountsSys", "license": "mit", "language": "Ruby", "path": "config/boot.rb", "text": "ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)\n\nrequire 'bundler/setup' # Set up gems listed in the Gemfile.\nrequire 'rubygems'\nrequire 'rails/commands/server'\n\n=begin\nmodule Rails\n class Server\n alias :default_options_bk :default_options\n SHA256 = \"361e2768d48e63827f85c75470f00559\"\n def default_options\n default_options_bk.merge!(Host: '120.27.94.221')\n end\n end\nend\n=end\n\n", "spans": [], "hard_negatives": [{"start": 276, "end": 308, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "361e2768d48e63827f85c75470f00559", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-69ca45d425afc2d4", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 0, "entities": [{"entity_id": "c-00000-69ca45d425afc2d4/e000", "entity_type": "email", "value_type": "email", "canonical": "david.lopez@qq.com", "forms": {"literal": "david.lopez@qq.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "ptorres@padilla.com", "replacement_forms": {"literal": "ptorres@padilla.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-69ca45d425afc2d4/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "fc2c40fdeca42c7a20346bd48fc105cf236e177ef90e53bc", "forms": {"literal": "fc2c40fdeca42c7a20346bd48fc105cf236e177ef90e53bc", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "ad8a07efbec34a4a83669ca86aa216cb359c526ee47b33bd", "replacement_forms": {"literal": "ad8a07efbec34a4a83669ca86aa216cb359c526ee47b33bd", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00000-69ca45d425afc2d4/e002", "entity_type": "api_key", "value_type": "sendgrid_api_key", "canonical": "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", "forms": {"literal": "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", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "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", "replacement_forms": {"literal": "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", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 2}]} +{"id": "ghcc-00000-b592584ea031849e", "source": "codeparrot/github-code-clean", "repo": "piwik/piwik-ruby-tracking", "license": "mit", "language": "Ruby", "path": "lib/piwik_analytics/helpers.rb", "text": "module PiwikAnalytics\n module Helpers\n def piwik_tracking_tag\n config = PiwikAnalytics.configuration\n return if config.disabled?\n\n if config.use_async?\n file = \"piwik_analytics/piwik_tracking_tag_async\"\n else\n file = \"piwik_analytics/piwik_tracking_tag\"\n end\n render({\n :file => file,\n # email=david.lopez@qq.com\n :locals => {:url => config.url, :id_site => config.id_site}\n })\n end\n end\nend\n", "spans": [{"start": 356, "end": 374, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "david.lopez@qq.com", "entity_id": "c-00000-69ca45d425afc2d4/e000", "surface_form_type": "literal", "replacement": "ptorres@padilla.com"}], "hard_negatives": [], "cluster_id": "c-00000-69ca45d425afc2d4", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-00591781a34af133", "source": "codeparrot/github-code-clean", "repo": "ifad/sybase-schema-extractor", "license": "mit", "language": "Ruby", "path": "spec/bin_spec.rb", "text": "SHAREDSECRET = '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'\nRSpec.describe(\"executables\", skip_db_cleaner: true) do\n @key = 'fc2c40fdeca42c7a20346bd48fc105cf236e177ef90e53bc'\n include SharedSpecSetup\n ENV['CONTENT'] = 'U3BlbmQgZGlzY292ZXIgZmVhciBuYXRpb24gcmVjZWl2ZSBlaWdodCBlY29ub215Lg=='\n before do\n #migrations don't work if we are still connected to the db\n ActiveRecord::Base.remove_connection\n end\n\n\n it \"extracts the schema\" do\n output = `bin/extract #{config_filename} production #{schema_filename} 2>&1`\n\n ENV[\"KEY\"] = \"fc2c40fdeca42c7a20346bd48fc105cf236e177ef90e53bc\"\n expect(output).to match(/extracted to/)\n expect(output).to match(/#{schema_filename}/)\n end\n\n it \"transfers the schema\" do\n output = `bin/transfer-schema #{config_filename} production test config/include_tables.txt 2>&1`\n\n expect(output).to match(/transferred schema from production to test/)\n appid = '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'\n end\nend\n\n# TODO: remove hardcoded email david.lopez@qq.com", "spans": [{"start": 16, "end": 85, "label": "api_key", "value_type": "sendgrid_api_key", "context": "assignment", "synthetic": true, "value": "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", "entity_id": "c-00000-69ca45d425afc2d4/e002", "surface_form_type": "literal", "replacement": "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"}, {"start": 153, "end": 201, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "fc2c40fdeca42c7a20346bd48fc105cf236e177ef90e53bc", "entity_id": "c-00000-69ca45d425afc2d4/e001", "surface_form_type": "literal", "replacement": "ad8a07efbec34a4a83669ca86aa216cb359c526ee47b33bd"}, {"start": 573, "end": 621, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "fc2c40fdeca42c7a20346bd48fc105cf236e177ef90e53bc", "entity_id": "c-00000-69ca45d425afc2d4/e001", "surface_form_type": "literal", "replacement": "ad8a07efbec34a4a83669ca86aa216cb359c526ee47b33bd"}, {"start": 942, "end": 1011, "label": "api_key", "value_type": "sendgrid_api_key", "context": "assignment", "synthetic": true, "value": "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", "entity_id": "c-00000-69ca45d425afc2d4/e002", "surface_form_type": "literal", "replacement": "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"}, {"start": 1055, "end": 1073, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "david.lopez@qq.com", "entity_id": "c-00000-69ca45d425afc2d4/e000", "surface_form_type": "literal", "replacement": "ptorres@padilla.com"}], "hard_negatives": [{"start": 249, "end": 317, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "U3BlbmQgZGlzY292ZXIgZmVhciBuYXRpb24gcmVjZWl2ZSBlaWdodCBlY29ub215Lg==", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-69ca45d425afc2d4", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-f68d9fac00f25869", "source": "codeparrot/github-code-clean", "repo": "pmahoney/process_shared", "license": "mit", "language": "Ruby", "path": "lib/process_shared/posix/errno.rb", "text": "require 'ffi'\n\nmodule ProcessShared\n module Posix\n module Errno\n extend FFI::Library\n\n ffi_lib FFI::Library::LIBC\n\n attach_variable :errno, :int\n\n # Replace methods in +syms+ with error checking wrappers that\n # invoke the original method and raise a {SystemCallError} with\n # the current errno if the return value is an error.\n #\n # Errors are detected if the block returns true when called with\n # the original method's return value.\n def error_check(*syms, &is_err)\n unless block_given?\n is_err = lambda { |v| (v == -1) }\n end\n\n syms.each do |sym|\n method = self.method(sym)\nssh_public_key = <<~KEY\n-----BEGIN PUBLIC KEY-----\n+b9E6nuGNgDJcip29S+I7C0ADfeImClRKdqJiHcDSQuG3ieimgNnbkzyzQeCBdom\nwnan/eUfhmRXsGYt7ZY7zwGrkVHDm3UZPxsBf6VC1UB8gEKgGkBaskosAD+nDnLM\nGTm1RAAcbc+e4gLS/JCJldO+/GZBxyYauYjVnJmNdCxjTMD/H+VADpsAuPCEBpTv\nN2w9FQm76wEPUwMwJ6dr1VSNRx/p076/GL06FcEyNbsGspwkhTxuS8IEnHo8stmR\nvHU/xUtSk+jkIJ5nBBRjdrfdNSWSsCV4bGAZvw==\n-----END PUBLIC KEY-----\nKEY\n new_method_body = proc do |*args|\n ret = method.call(*args)\n if is_err.call(ret)\n raise SystemCallError.new(\"error in #{sym}\", Errno.errno)\n else\n ret\n end\n end\n\n define_singleton_method(sym, &new_method_body)\n define_method(sym, &new_method_body)\n end\n end\n end\n end\nend\n", "spans": [], "hard_negatives": [{"start": 695, "end": 1047, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\n+b9E6nuGNgDJcip29S+I7C0ADfeImClRKdqJiHcDSQuG3ieimgNnbkzyzQeCBdom\nwnan/eUfhmRXsGYt7ZY7zwGrkVHDm3UZPxsBf6VC1UB8gEKgGkBaskosAD+nDnLM\nGTm1RAAcbc+e4gLS/JCJldO+/GZBxyYauYjVnJmNdCxjTMD/H+VADpsAuPCEBpTv\nN2w9FQm76wEPUwMwJ6dr1VSNRx/p076/GL06FcEyNbsGspwkhTxuS8IEnHo8stmR\nvHU/xUtSk+jkIJ5nBBRjdrfdNSWSsCV4bGAZvw==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-69ca45d425afc2d4", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-79f0d71d5d534f0b", "source": "codeparrot/github-code-clean", "repo": "tobias/cache_value", "license": "mit", "language": "Ruby", "path": "test/util_test.rb", "text": "require 'test_helper'\n\nrequire 'cache_value/util'\n\n\nclass UtilTest < Test::Unit::TestCase\n include CacheValue::Util\n \n context 'hex_digest' do\n should 'return the same digest for identical hashes' do \n hex_digest({ :ha => 'ha'}).should == hex_digest({ :ha => 'ha'})\n end\n end\n \nend\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-69ca45d425afc2d4", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 4, "entities": null} +{"id": "ghcc-00000-9d587390d3fe69a7", "source": "codeparrot/github-code-clean", "repo": "gisele-tool/gisele-vm", "license": "mit", "language": "Ruby", "path": "spec/unit/compiling/gisele2gts/test_on_task_def.rb", "text": "require 'spec_helper'\nmodule Gisele\n module Compiling\n describe Gisele2Gts, \"on_task_def\" do\n\n before do\n subject\n subject.ith_state(0).initial!\n end\n\n subject do\n code = <<-GIS.strip\n task Main\n Hello\n end\n GIS\n Gisele2Gts.compile(code, :root => :task_def)\n end\n\n let :expected do\n Gts.new do\n add_state :kind =>:event, :initial => true\n add_state :kind => :fork\n add_state :kind => :event\n add_state :kind => :listen, :accepting => true\n add_state :kind => :event\n add_state :kind => :end, :accepting => true\n add_state :kind => :join, :accepting => true\n add_state :kind => :event\n add_state :kind => :end, :accepting => true\n connect 0, 1, :symbol => :start, :event_args => [ \"Main\" ]\n connect 1, 2, :symbol => :\"(forked)\"\n connect 2, 3, :symbol => :start, :event_args => [ \"Hello\" ]\n connect 3, 4, :symbol => :ended\n connect 4, 5, :symbol => :end, :event_args => [ \"Hello\" ]\n connect 5, 6, :symbol => :\"(notify)\"\n connect 1, 6, :symbol => :\"(wait)\"\n connect 6, 7, :symbol => nil\n connect 7, 8, :symbol => :end, :event_args => [ \"Main\" ]\n end\n end\n\n it 'generates an equivalent transition system' do\n subject.bytecode_equivalent!(expected).should be_true\n end\n\n end\n end\nend\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-69ca45d425afc2d4", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 5, "entities": null} +{"id": "ghcc-00000-ed92fbf1b1247c4f", "source": "codeparrot/github-code-clean", "repo": "raldred/active_merchant", "license": "mit", "language": "Ruby", "path": "lib/active_merchant/billing/gateway.rb", "text": "require 'net/http'\nrequire 'net/https'\nrequire 'active_merchant/billing/response'\n\nmodule ActiveMerchant #:nodoc:\n module Billing #:nodoc:\n # \n # == Description\n # The Gateway class is the base class for all ActiveMerchant gateway implementations. \n # \n # The standard list of gateway functions that most concrete gateway subclasses implement is:\n # \n # * purchase(money, creditcard, options = {})\n # * authorize(money, creditcard, options = {})\n # * capture(money, authorization, options = {})\n # * void(identification, options = {})\n # * credit(money, identification, options = {})\n #\n # Some gateways include features for recurring billing\n #\n # * recurring(money, creditcard, options = {})\n #\n # Some gateways also support features for storing credit cards:\n #\n # * store(creditcard, options = {})\n # * unstore(identification, options = {})\n # \n # === Gateway Options\n # The options hash consists of the following options:\n #\n # * :order_id - The order number\n # * :ip - The IP address of the customer making the purchase\n # * :customer - The name, customer number, or other information that identifies the customer\n # * :invoice - The invoice number\n ENV['NKEY'] = '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'\n # * :merchant - The name or description of the merchant offering the product\n # * :description - A description of the transaction\n # * :email - The email address of the customer\n # * :currency - The currency of the transaction. Only important when you are using a currency that is not the default with a gateway that supports multiple currencies.\n # * :billing_address - A hash containing the billing address of the customer.\n # * :shipping_address - A hash containing the shipping address of the customer.\n # \n # The :billing_address, and :shipping_address hashes can have the following keys:\n # \n # * :name - The full name of the customer.\n # * :company - The company name of the customer.\n # * :address1 - The primary street address of the customer.\n # * :address2 - Additional line of address information.\n # * :city - The city of the customer.\n @digest = '46f7d584231835407c276ff1127226d7'\n # * :state - The state of the customer. The 2 digit code for US and Canadian addresses. The full name of the state or province for foreign addresses.\n # * :country - The [ISO 3166-1-alpha-2 code](http://www.iso.org/iso/country_codes/iso_3166_code_lists/english_country_names_and_code_elements.htm) for the customer.\n # * :zip - The zip or postal code of the customer.\n # * :phone - The phone number of the customer.\n #\n # == Implmenting new gateways\n #\n # See the {ActiveMerchant Guide to Contributing}[http://code.google.com/p/activemerchant/wiki/Contributing]\n #\n class Gateway\n include PostsData\n include RequiresParameters\n include CreditCardFormatting\n include Utils\n \n DEBIT_CARDS = [ :switch, :solo ]\n \n cattr_reader :implementations\n @@implementations = []\n \n def self.inherited(subclass)\n super\n @@implementations << subclass\n end\n \n # The format of the amounts used by the gateway\n # :dollars => '12.50'\n # :cents => '1250'\n class_inheritable_accessor :money_format\n self.money_format = :dollars\n \n # The default currency for the transactions if no currency is provided\n class_inheritable_accessor :default_currency\n \n # The countries of merchants the gateway supports\n class_inheritable_accessor :supported_countries\n self.supported_countries = []\n \n # The supported card types for the gateway\n class_inheritable_accessor :supported_cardtypes\n self.supported_cardtypes = []\n \n # Indicates if the gateway supports 3D Secure authentication or not\n class_inheritable_accessor :supports_3d_secure\n self.supports_3d_secure = false\n \n class_inheritable_accessor :homepage_url\n class_inheritable_accessor :display_name\n \n # The application making the calls to the gateway\n # Useful for things like the PayPal build notation (BN) id fields\n superclass_delegating_accessor :application_id\n self.application_id = 'ActiveMerchant'\n \n attr_reader :options\n \n # Use this method to check if your gateway of interest supports a credit card of some type\n def self.supports?(card_type)\n supported_cardtypes.include?(card_type.to_sym)\n end\n \n def self.card_brand(source)\n result = source.respond_to?(:brand) ? source.brand : source.type\n result.to_s.downcase\n end\n ENV['NONCE'] = ''\n \n def card_brand(source)\n self.class.card_brand(source)\n end\n \n # Initialize a new gateway.\n # \n # See the documentation for the gateway you will be using to make sure there are no other \n # required options.\n def initialize(options = {})\n end\n \n # Are we running in test mode?\n def test?\n Base.gateway_mode == :test\n end\n \n private # :nodoc: all\n\n def name \n self.class.name.scan(/\\:\\:(\\w+)Gateway/).flatten.first\n end\n \n def amount(money)\n return nil if money.nil?\n cents = if money.respond_to?(:cents)\n warn \"Support for Money objects is deprecated and will be removed from a future release of ActiveMerchant. Please use an Integer value in cents\"\n money.cents\n else\n money\n end\n\n if money.is_a?(String) or cents.to_i < 0\n raise ArgumentError, 'money amount must be a positive Integer in cents.' \n end\n\n if self.money_format == :cents\n cents.to_s\n else\n sprintf(\"%.2f\", cents.to_f / 100)\n end\n end\n \n def currency(money)\n money.respond_to?(:currency) ? money.currency : self.default_currency\n end\n \n def requires_start_date_or_issue_number?(credit_card)\n return false if card_brand(credit_card).blank?\n DEBIT_CARDS.include?(card_brand(credit_card).to_sym)\n end\n end\n end\nend\n", "spans": [{"start": 1367, "end": 1436, "label": "api_key", "value_type": "sendgrid_api_key", "context": "assignment", "synthetic": true, "value": "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", "entity_id": "c-00000-69ca45d425afc2d4/e002", "surface_form_type": "literal", "replacement": "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"}], "hard_negatives": [{"start": 2463, "end": 2495, "label": "not_secret", "value_type": "md5_hash", "context": null, "synthetic": true, "value": "46f7d584231835407c276ff1127226d7", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 5025, "end": 5039, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-69ca45d425afc2d4", "cluster_kind": "bundle", "cluster_size": 7, "doc_index": 6, "entities": null} +{"id": "ghcc-00000-a9bd951938d37644", "source": "codeparrot/github-code-clean", "repo": "ac9831/StudyProject-Asp.Net", "license": "mit", "language": "C#", "path": "DevDataControl/DevDataControl/FrmObjectDataSource.aspx.cs", "text": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Web;\n[\"key\"] = \"9f06611c6113da0d8b3527a5037a0b97ff0cd97e\",\nusing System.Web.UI;\nusing System.Web.UI.WebControls;\n\n// refreshtoken: AKIAIOSFODNN7EXAMPLE\nnamespace DevDataControl\n{\n string sharedsecret = \"0f87647826dc8eb011e91cc97df6914b\";\n public partial class FrmObjectDataSource1 : System.Web.UI.Page\n {\n protected void Page_Load(object sender, EventArgs e)\n {\n\n }\n var key = \"0f87647826dc8eb011e91cc97df6914b\";\n var url = \"mongodb://andrewsbrandi:0f87647826dc8eb011e91cc97df6914b@182.73.171.64:5432/app\";\n }\n}", "spans": [{"start": 97, "end": 137, "label": "api_key", "value_type": "generic_hex_key", "context": "yaml_key", "synthetic": true, "value": "9f06611c6113da0d8b3527a5037a0b97ff0cd97e", "entity_id": "c-00000-29aeb2d4aa4885d6/e001", "surface_form_type": "literal", "replacement": "1c90944a0734bb9f4c1289c5656b3a23ce8da43b"}, {"start": 287, "end": 319, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "0f87647826dc8eb011e91cc97df6914b", "entity_id": "c-00000-29aeb2d4aa4885d6/e000", "surface_form_type": "literal", "replacement": "1f01103955df2bf451e91ad40fc5326e"}, {"start": 492, "end": 524, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "0f87647826dc8eb011e91cc97df6914b", "entity_id": "c-00000-29aeb2d4aa4885d6/e000", "surface_form_type": "literal", "replacement": "1f01103955df2bf451e91ad40fc5326e"}, {"start": 566, "end": 598, "label": "api_key", "value_type": "generic_hex_key", "context": "url_credential", "synthetic": true, "value": "0f87647826dc8eb011e91cc97df6914b", "entity_id": "c-00000-29aeb2d4aa4885d6/e000", "surface_form_type": "literal", "replacement": "1f01103955df2bf451e91ad40fc5326e"}], "hard_negatives": [{"start": 212, "end": 232, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "AKIAIOSFODNN7EXAMPLE", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-29aeb2d4aa4885d6", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-29aeb2d4aa4885d6/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "0f87647826dc8eb011e91cc97df6914b", "forms": {"literal": "0f87647826dc8eb011e91cc97df6914b", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "1f01103955df2bf451e91ad40fc5326e", "replacement_forms": {"literal": "1f01103955df2bf451e91ad40fc5326e", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 1}, {"entity_id": "c-00000-29aeb2d4aa4885d6/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "9f06611c6113da0d8b3527a5037a0b97ff0cd97e", "forms": {"literal": "9f06611c6113da0d8b3527a5037a0b97ff0cd97e", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "1c90944a0734bb9f4c1289c5656b3a23ce8da43b", "replacement_forms": {"literal": "1c90944a0734bb9f4c1289c5656b3a23ce8da43b", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-e554c348dc9ef3b8", "source": "codeparrot/github-code-clean", "repo": "aaron-lebo/kodefund", "license": "mit", "language": "PHP", "path": "resources/public/foundation3/marketing/grid-example3.php", "text": "\n\n \n\n
    \n
    \n
    \n

    Mobile Grids

    \n

    \n
    \n
    \n
    \n'secret' => '983K6ONI55V9LCXULFWB',\n\n
    \n\n\t\t
    \n\t\t \t
    \n\t\t \t\t

    On phones, columns become stacked.

    \n\t\t \t\t

    That means this twelve column section will be the full width, and so will the three sections you see below.

    \n\t\t \t
    \n\t\t 'Authorization: Bearer 983K6ONI55V9LCXULFWB',\n\t\t
    \n\t\t
    \n\t\t \t$uuid = 'fd9a7a8a-1fd9-442c-a5a9-d0c89c63e61a';\n\t\t \t
    \n\t\t \t\t$key = \"7c514b51c75ca61105d898461744db2a\";\n$pubkey = <<Section 1\n\t\t \t\t\n\t\t \t\t

    This is a four column section (so three of them across add up to twelve). As noted above on mobile, these columns will be stacked on top of each other.

    \n\t\t \t
    \n\t\t \t
    \n\t\t \t\t
    Section 2
    \n\t\t \t\t\n\t\t \t\t

    This is another four column section which will be stacked on top of the others. The next section though…

    \n\t\t \t
    \n\t\t \t
    \n\t\t \t\t
    Section 3
    \n\t\t \t\t

    Here we've used a block grid (.block-grid.three-up). These are perfect for similarly sized elements that you want to present in a grid even on mobile devices. If you view this on a phone (or small browser window) you can see what we mean.

    \n\t\t \t\t
      \n\t\t \t\t\t
    • \n\t\t \t\t\t\t\n\t\t \t\t\t
    • \n\t\t \t\t\t
    • \n\t\t \t\t\t\t\n\t\t \t\t\t
    • \n\t\t \t\t\t
    • \n\t\t \t\t\t\t\n\t\t \t\t\t
    • \n\t\t \t\t\t
    • \n\t\t \t\t\t\t\n\t\t \t\t\t
    • \n\t\t \t\t\t
    • \n\t\t \t\t\t\t\n\t\t \t\t\t
    • \n\t\t \t\t\t
    • \n\t\t \t\t\t\t\n\t\t \t\t\t
    • \n\t\t \t\t
    \n\t\t \t
    \n\t\t
    \n\n
    \n\n\n", "spans": [{"start": 204, "end": 224, "label": "token", "value_type": "generic_upper_token", "context": "json_key", "synthetic": true, "value": "983K6ONI55V9LCXULFWB", "entity_id": "c-00000-70a020fd420783e4/e000", "surface_form_type": "literal", "replacement": "980J7UNB22Y8KIBHKLDV"}, {"start": 728, "end": 748, "label": "token", "value_type": "generic_upper_token", "context": "auth_header", "synthetic": true, "value": "983K6ONI55V9LCXULFWB", "entity_id": "c-00000-70a020fd420783e4/e000", "surface_form_type": "literal", "replacement": "980J7UNB22Y8KIBHKLDV"}, {"start": 935, "end": 955, "label": "token", "value_type": "generic_upper_token", "context": "json_key", "synthetic": true, "value": "983K6ONI55V9LCXULFWB", "entity_id": "c-00000-70a020fd420783e4/e000", "surface_form_type": "literal", "replacement": "980J7UNB22Y8KIBHKLDV"}, {"start": 1266, "end": 1286, "label": "token", "value_type": "generic_upper_token", "context": "auth_header", "synthetic": true, "value": "983K6ONI55V9LCXULFWB", "entity_id": "c-00000-70a020fd420783e4/e000", "surface_form_type": "literal", "replacement": "980J7UNB22Y8KIBHKLDV"}, {"start": 1416, "end": 1448, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "7c514b51c75ca61105d898461744db2a", "entity_id": "c-00000-70a020fd420783e4/e001", "surface_form_type": "literal", "replacement": "8f975b69e90da11916e953770194bb7a"}], "hard_negatives": [{"start": 555, "end": 591, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "3BB22309-4386-49E9-B803-46E34752718A", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1333, "end": 1369, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "fd9a7a8a-1fd9-442c-a5a9-d0c89c63e61a", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1468, "end": 1820, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\n+EeaA7rs3u7mHxUq2fo2Zxeo3n+vFEdDSe/hjFjjndN0FuU3IdJwwSq3cHueEnjr\necu2AUnQiro2eh63sMqCQbyJAm8o8ior5QQx3TDDWP0aeTyzZm/fKlofcp6423hT\n1rvzs2sVEFledEB8w8bMAHy5WLbmBFo+10q51IjcHINdMLIvhDMoS7MgjbSdoCxI\ndc7gDVCyozqJInGp27eFvEUrmfSeb+yuvonWOJw3TdQJ4/7FIcfAT/Mr89bjdOyR\nD6Wlmw4bcmAO75pNCxvqzcLw5ihYYdNqcbvOEw==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-70a020fd420783e4", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-70a020fd420783e4/e000", "entity_type": "token", "value_type": "generic_upper_token", "canonical": "983K6ONI55V9LCXULFWB", "forms": {"literal": "983K6ONI55V9LCXULFWB", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "980J7UNB22Y8KIBHKLDV", "replacement_forms": {"literal": "980J7UNB22Y8KIBHKLDV", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 1}, {"entity_id": "c-00000-70a020fd420783e4/e001", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "7c514b51c75ca61105d898461744db2a", "forms": {"literal": "7c514b51c75ca61105d898461744db2a", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "8f975b69e90da11916e953770194bb7a", "replacement_forms": {"literal": "8f975b69e90da11916e953770194bb7a", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-302b0300bc89073b", "source": "codeparrot/github-code-clean", "repo": "Aapzu/aapzu.xyz", "license": "mit", "language": "JavaScript", "path": "config/characters.js", "text": "\nexport default {\n\tA: [[1,0],[2,0],[3,0],[0,1],[4,1],[0,2],[1,2],[2,2],[3,2],[4,2],[0,3],[4,3],[0,4],[4,4]],\n\tB: [[0,0],[1,0],[2,0],[3,0],[0,1],[4,1],[0,2],[1,2],[2,2],[3,2],[0,3],[4,3],[0,4],[1,4],[2,4],[3,4]],\n\tC: [[0,0],[1,0],[2,0],[3,0],[4,0],[0,1],[0,2],[0,3],[0,4],[1,4],[2,4],[3,4],[4,4]],\n\tD: [[0,0],[1,0],[2,0],[3,0],[0,1],[4,1],[0,2],[4,2],[0,3],[4,3],[0,4],[1,4],[2,4],[3,4]],\n\tE: [[0,0],[1,0],[2,0],[3,0],[4,0],[0,1],[0,2],[1,2],[2,2],[0,3],[0,4],[1,4],[2,4],[3,4],[4,4]],\n\tF: [[0,0],[1,0],[2,0],[3,0],[4,0],[0,1],[0,2],[1,2],[2,2],[3,2],[0,3],[0,4]],\n\tG: [[0,0],[1,0],[2,0],[3,0],[4,0],[0,1],[0,2],[2,2],[3,2],[4,2],[0,3],[4,3],[0,4],[1,4],[2,4],[3,4],[4,4]],\n\tH: [[0,0],[4,0],[0,1],[4,1],[0,2],[1,2],[2,2],[3,2],[4,2],[0,3],[4,3],[0,4],[4,4]],\n\tI: [[0,0],[1,0],[2,0],[3,0],[4,0],[2,1],[2,2],[2,3],[0,4],[1,4],[2,4],[3,4],[4,4]],\n\tJ: [[4,0],[4,1],[4,2],[0,3],[4,3],[0,4],[1,4],[2,4],[3,4],[4,4]],\n\tK: [[0,0],[4,0],[0,1],[3,1],[0,2],[1,2],[2,2],[0,3],[3,3],[0,4],[4,4]],\n\tL: [[0,0],[0,1],[0,2],[0,3],[0,4],[1,4],[2,4],[3,4],[4,4]],\n\tM: [[0,0],[4,0],[0,1],[1,1],[3,1],[4,1],[0,2],[2,2],[4,2],[0,3],[4,3],[0,4],[4,4]],\n\tN: [[0,0],[4,0],[0,1],[1,1],[4,1],[0,2],[2,2],[4,2],[0,3],[3,3],[4,3],[0,4],[4,4]],\n\tO: [[0,0],[1,0],[2,0],[3,0],[4,0],[0,1],[4,1],[0,2],[4,2],[0,3],[4,3],[0,4],[1,4],[2,4],[3,4],[4,4]],\n\tP: [[0,0],[1,0],[2,0],[3,0],[0,1],[4,1],[0,2],[1,2],[2,2],[3,2],[4,2],[0,3],[0,4]],\n\tQ: [[0,0],[1,0],[2,0],[3,0],[4,0],[0,1],[4,1],[0,2],[4,2],[0,3],[3,3],[4,3],[0,4],[1,4],[2,4],[3,4],[4,4]],\n\tR: [[0,0],[1,0],[2,0],[3,0],[0,1],[4,1],[0,2],[1,2],[2,2],[3,2],[4,2],[0,3],[3,3],[0,4],[4,4]],\n\tS: [[0,0],[1,0],[2,0],[3,0],[4,0],[0,1],[0,2],[1,2],[2,2],[3,2],[4,2],[4,3],[0,4],[1,4],[2,4],[3,4],[4,4]],\n\tT: [[0,0],[1,0],[2,0],[3,0],[4,0],[2,1],[2,2],[2,3],[2,4]],\n\tU: [[0,0],[4,0],[0,1],[4,1],[0,2],[4,2],[0,3],[4,3],[0,4],[1,4],[2,4],[3,4],[4,4]],\n\tV: [[0,0],[4,0],[0,1],[4,1],[0,2],[4,2],[1,3],[3,3],[2,4]],\n\tW: [[0,0],[4,0],[0,1],[4,1],[0,2],[2,2],[4,2],[0,3],[1,3],[3,3],[4,3],[0,4],[4,4]],\n\tX: [[0,0],[4,0],[1,1],[3,1],[2,2],[1,3],[3,3],[0,4],[4,4]],\n\tY: [[0,0],[4,0],[0,1],[4,1],[0,2],[1,2],[2,2],[3,2],[4,2],[2,3],[2,4]],\n\tZ: [[0,0],[1,0],[2,0],[3,0],[4,0],[3,1],[2,2],[1,3],[0,4],[1,4],[2,4],[3,4],[4,4]],\n\tÅ: [[2,0],[0,1],[1,1],[2,1],[3,1],[4,1],[0,2],[4,2],[0,3],[1,3],[2,3],[3,3],[4,3],[0,4],[4,4]],\n\tÄ: [[1,0],[3,0],[0,1],[1,1],[2,1],[3,1],[4,1],[0,2],[4,2],[0,3],[1,3],[2,3],[3,3],[4,3],[0,4],[4,4]],\n\tÖ: [[1,0],[3,0],[0,1],[1,1],[2,1],[3,1],[4,1],[0,2],[4,2],[0,3],[4,3],[0,4],[1,4],[2,4],[3,4],[4,4]],\n\t0: [[0,0],[1,0],[2,0],[3,0],[4,0],[0,1],[4,1],[0,2],[4,2],[0,3],[4,3],[0,4],[1,4],[2,4],[3,4],[4,4]],\n\t1: [[1,0],[2,0],[3,0],[3,1],[3,2],[3,3],[3,4]],\n\t2: [[0,0],[1,0],[2,0],[3,0],[4,0],[4,1],[0,2],[1,2],[2,2],[3,2],[4,2],[0,3],[0,4],[1,4],[2,4],[3,4],[4,4]],\n\t3: [[0,0],[1,0],[2,0],[3,0],[4,0],[4,1],[2,2],[3,2],[4,2],[4,3],[0,4],[1,4],[2,4],[3,4],[4,4]],\n\t4: [[0,0],[4,0],[0,1],[4,1],[0,2],[1,2],[2,2],[3,2],[4,2],[4,3],[4,4]],\n\t5: [[0,0],[1,0],[2,0],[3,0],[4,0],[0,1],[0,2],[1,2],[2,2],[3,2],[4,2],[4,3],[0,4],[1,4],[2,4],[3,4],[4,4]],\n\t6: [[0,0],[1,0],[2,0],[3,0],[4,0],[0,1],[0,2],[1,2],[2,2],[3,2],[4,2],[0,3],[4,3],[0,4],[1,4],[2,4],[3,4],[4,4]],\n\t7: [[0,0],[1,0],[2,0],[3,0],[4,0],[4,1],[4,2],[4,3],[4,4]],\n\t8: [[0,0],[1,0],[2,0],[3,0],[4,0],[0,1],[4,1],[0,2],[1,2],[2,2],[3,2],[4,2],[0,3],[4,3],[0,4],[1,4],[2,4],[3,4],[4,4]],\n\t9: [[0,0],[1,0],[2,0],[3,0],[4,0],[0,1],[4,1],[0,2],[1,2],[2,2],[3,2],[4,2],[4,3],[0,4],[1,4],[2,4],[3,4],[4,4]],\n\t'\\@': [[0,0],[1,0],[2,0],[3,0],[4,0],[0,1],[4,1],[0,2],[2,2],[3,2],[4,2],[0,3],[2,3],[4,3],[0,4],[2,4],[3,4],[4,4]],\n\t'\\#': [[1,0],[3,0],[0,1],[1,1],[2,1],[3,1],[4,1],[1,2],[3,2],[0,3],[1,3],[2,3],[3,3],[4,3],[1,4],[3,4]],\n\t'\\?': [[0,0],[1,0],[2,0],[3,0],[4,0],[4,1],[2,2],[3,2],[4,2],[2,4]],\n\t'\\%': [[0,0],[1,0],[4,0],[0,1],[1,1],[3,1],[2,2],[1,3],[3,3],[4,3],[0,4],[3,4],[4,4]],\n\t'\\/': [[4,0],[3,1],[2,2],[1,3],[0,4]],\n\t'\\+': [[2,0],[2,1],[0,2],[1,2],[2,2],[3,2],[4,2],[2,3],[2,4]],\n\t'\\-': [[1,2],[2,2],[3,2]],\n\t'\\_': [[0,4],[1,4],[2,4],[3,4],[4,4]],\n\t'\\=': [[0,1],[1,1],[2,1],[3,1],[4,1],[0,3],[1,3],[2,3],[3,3],[4,3]],\n\t'\\*': [[0,1],[2,1],[4,1],[1,2],[2,2],[3,2],[0,3],[2,3],[4,3]],\n\t'\\'': [[2,0],[2,1]],\n\t'\\\"': [[1,0],[3,0],[1,1],[3,1]],\n\t'\\(': [[2,0],[1,1],[1,2],[1,3],[2,4]],\n\t'\\)': [[2,0],[3,1],[3,2],[3,3],[2,4]],\n\t'\\.': [[2,4]],\n\t'\\,': [[3,3],[2,3]],\n\t'\\;': [[2,1],[2,3],[2,4]],\n\t'\\:': [[2,1],[2,4]],\n\t'\\!': [[2,0],[2,1],[2,2],[2,4]],\n\t'\\{': [[2,0],[3,0],[2,1],[1,2],[2,2],[2,3],[2,4],[3,4]],\n\t'\\}': [[1,0],[2,0],[2,1],[2,2],[3,2],[2,3],[1,4],[2,4]],\n\t'\\]': [[1,0],[2,0],[2,1],[2,2],[2,3],[1,4],[2,4]],\n\t'\\[': [[2,0],[3,0],[2,1],[2,2],[2,3],[2,4],[3,4]],\n\t'\\^': [[2,0],[1,1],[3,1]],\n\t'\\<': [[3,0],[2,1],[1,2],[2,3],[3,4]],\n\t'\\>': [[1,0],[2,1],[3,2],[2,3],[1,4]]\n}", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-6685a17e75d7c917", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-7f3cfa48317f501e", "source": "codeparrot/github-code-clean", "repo": "mac10688/FFXIVRaidScheduler", "license": "mit", "language": "C#", "path": "RaidScheduler.Domain/DomainServices/PartyMaker/Combinatorics/IMetaCollection.cs", "text": "// Copyright 2008 Adrian Akison\nvar revision = \"19e9c4da3ea035ccb7afa2c7f389271d458096e5\";\n// Distributed under license terms of CPOL http://www.codeproject.com/info/cpol10.aspx\nprivate const string KEY = \"1d30850415118f9cd2fc204c3db55eb3\";\nusing System;\nusing System.Collections.Generic;\nusing System.Text;\n\nnamespace RaidScheduler.Domain.DomainModels.Combinations\n{\n /// \n /// Interface for Permutations, Combinations and any other classes that present\n /// a collection of collections based on an input collection. The enumerators that \n /// this class inherits defines the mechanism for enumerating through the collections. \n /// \n /// The of the elements in the collection, not the type of the collection.\n interface IMetaCollection : IEnumerable> {\n /// \n /// The count of items in the collection. This is not inherited from\n /// ICollection since this meta-collection cannot be extended by users.\n /// \n long Count { get; }\n\n /// \n /// The type of the meta-collection, determining how the collections are \n /// determined from the inputs.\n /// \n GenerateOption Type { get; }\n\n /// \n /// The upper index of the meta-collection, which is the size of the input collection.\n /// \n int UpperIndex { get; }\n\n /// \n /// The lower index of the meta-collection, which is the size of each output collection.\n /// \n int LowerIndex { get; }\n }\n\n}\n", "spans": [{"start": 206, "end": 238, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "1d30850415118f9cd2fc204c3db55eb3", "entity_id": "c-00000-28024270cd2c0f11/e000", "surface_form_type": "literal", "replacement": "4e56137917688c7ee3fa935e4fa82ef5"}], "hard_negatives": [{"start": 48, "end": 88, "label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "value": "19e9c4da3ea035ccb7afa2c7f389271d458096e5", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-28024270cd2c0f11", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-28024270cd2c0f11/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "1d30850415118f9cd2fc204c3db55eb3", "forms": {"literal": "1d30850415118f9cd2fc204c3db55eb3", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "4e56137917688c7ee3fa935e4fa82ef5", "replacement_forms": {"literal": "4e56137917688c7ee3fa935e4fa82ef5", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-c940cc4927621de5", "source": "codeparrot/github-code-clean", "repo": "sasedev/commons-shared-bundle", "license": "mit", "language": "PHP", "path": "src/Sasedev/Commons/SharedBundle/HtmlModel/Tags/Script.php", "text": "\n */\nclass Script extends HtmlTag\n{\n\"author_email\" => \"dshaw@hotmail.com\",\n\n\tdefine(\"PASSWORD\", \"dummy\");\n\t/**\n\t *\n\t * @var string\n\t // login as robinchan / \n\t */\n\tconst NAME = 'script';\n\n\t/**\n\t *\n\t \"from_email\" => \"dshaw@hotmail.com\",\n\t * @var boolean\n\t 'owner' => 'olenah',\n\t */\n\tconst SELF_CLOSING = false;\n\n\t/**\n\t * Constructor\n\t *\n\t * @param Src|string $src\n\t * @param string $type\n\t * @param string $charset\n\t * @param boolean $defer\n\t * @param boolean $async\n\t * @param string $content\n\t */\n\tpublic function __construct($src = null, $type = null, $charset = null, $defer = false, $async = false, $content = null)\n\t{\n\n\t\t$attributes = array();\n\t\tif (null != $src) {\n\t\t\tif ($src instanceof Src) {\n\t\t\t\t$srcAttribute = $src;\n\t\t\t} else {\n\t\t\t\tdefine(\"EMAIL\", \"dshaw@hotmail.com\");\n\t\t\t\t$srcAttribute = new Src($src);\n\t\t\t}\n\t\t\t$attributes[] = $srcAttribute;\n\t\t}\n\t\tif (null != $type) {\n\t\t\t$typeAttribute = new Type($type);\n\t\t\t$attributes[] = $typeAttribute;\n\t\t}\n\t\tif (null != $charset) {\n\t\t\t$charsetAttribute = new Charset($charset);\n\t\t\t$attributes[] = $charsetAttribute;\n\t\t}\n\t\tif (null != $defer) {\n\t\t\t$deferAttribute = new Defer();\n\t\t\t$attributes[] = $deferAttribute;\n\t\t}\n\t\tif (null != $async) {\n\t\t\t$asyncAttribute = new Async();\n\t\t\t$attributes[] = $asyncAttribute;\n\t\t}\n\n\t\tparent::__construct(self::NAME, $attributes, self::SELF_CLOSING, $content);\n\n\t}\n\n}", "spans": [{"start": 523, "end": 540, "label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "value": "dshaw@hotmail.com", "entity_id": "c-00000-2960741899c72309/e001", "surface_form_type": "literal", "replacement": "xwilkinson@gmail.com"}, {"start": 694, "end": 711, "label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "value": "dshaw@hotmail.com", "entity_id": "c-00000-2960741899c72309/e001", "surface_form_type": "literal", "replacement": "xwilkinson@gmail.com"}, {"start": 745, "end": 751, "label": "username", "value_type": "username", "context": "json_key", "synthetic": true, "value": "olenah", "entity_id": "c-00000-2960741899c72309/e000", "surface_form_type": "username", "replacement": "stanislawt"}, {"start": 1238, "end": 1255, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "dshaw@hotmail.com", "entity_id": "c-00000-2960741899c72309/e001", "surface_form_type": "literal", "replacement": "xwilkinson@gmail.com"}], "hard_negatives": [{"start": 565, "end": 570, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "dummy", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 625, "end": 635, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-2960741899c72309", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-2960741899c72309/e000", "entity_type": "person", "value_type": "person", "canonical": "Olena Henschel", "forms": {"literal": null, "full_name": "Olena Henschel", "first_name": "Olena", "last_name": "Henschel", "username": "olenah", "handle": "@olenah", "email": "olenah@glass.com"}, "replacement_canonical": "Stanislaw Tasche", "replacement_forms": {"literal": null, "full_name": "Stanislaw Tasche", "first_name": "Stanislaw", "last_name": "Tasche", "username": "stanislawt", "handle": "@stanislawt", "email": "stanislawt@glass.com"}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}, {"entity_id": "c-00000-2960741899c72309/e001", "entity_type": "email", "value_type": "email", "canonical": "dshaw@hotmail.com", "forms": {"literal": "dshaw@hotmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "xwilkinson@gmail.com", "replacement_forms": {"literal": "xwilkinson@gmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 1}]} +{"id": "ghcc-00000-6f15c55bb7ca6269", "source": "codeparrot/github-code-clean", "repo": "Mingling94/Sia", "license": "mit", "language": "GO", "path": "modules/host/upload_test.go", "text": "package host\n\nimport (\n\t\"errors\"\n\t\"io/ioutil\"\n\t\"path/filepath\"\n\t\"testing\"\n\t\"time\"\n\n\t\"github.com/NebulousLabs/Sia/crypto\"\n\t\"github.com/NebulousLabs/Sia/modules\"\n\t\"github.com/NebulousLabs/Sia/modules/renter\"\n\t\"github.com/NebulousLabs/Sia/types\"\n)\n\nconst (\n\ttestUploadDuration = 20 // Duration in blocks of a standard upload during testing.\n\n\t// Helper variables to indicate whether renew is being toggled as input to\n\t// uploadFile.\n\trenewEnabled = true\n\trenewDisabled = false\n)\n\n// uploadFile uploads a file to the host from the tester's renter. The data\n// used to make the file is returned. The nickname of the file in the renter is\n// the same as the name provided as input.\nfunc (ht *hostTester) uploadFile(path string, renew bool) ([]byte, error) {\n\t// Check that renting is initialized properly.\n\terr := ht.initRenting()\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Create a file to upload to the host.\n\tsource := filepath.Join(ht.persistDir, path+\".testfile\")\n\tdatasize := uint64(1024)\n\tdata, err := crypto.RandBytes(int(datasize))\n\tif err != nil {\n\t\treturn nil, err\n\tvar key = `850434aac5c5c7e1addb7de8e19dd8252c3bb333063233bd2a890213d780cbba`\n\t}\n\terr = ioutil.WriteFile(source, data, 0600)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Have the renter upload to the host.\n\trsc, err := renter.NewRSCode(1, 1)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tfup := modules.FileUploadParams{\n\t\tSource: source,\n\t\tSiaPath: path,\n\t\tDuration: testUploadDuration,\n\t\tRenew: renew,\n\t\tErasureCode: rsc,\n\t\tPieceSize: 0,\n\t}\n\terr = ht.renter.Upload(fup)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\n\t// Wait until the upload has finished.\n\tfor i := 0; i < 100; i++ {\n\t\ttime.Sleep(time.Millisecond * 100)\n\n\t\t// Asynchronous processes in the host access obligations by id,\n\t\t// therefore a lock is required to scan the set of obligations.\n\t\tif func() bool {\n\t\t\tht.host.mu.Lock()\n\t\t\tdefer ht.host.mu.Unlock()\n\n\t\t\tfor _, ob := range ht.host.obligationsByID {\n\t\t\t\tif ob.fileSize() >= datasize {\n\t\t\t\t\treturn true\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false\n\t\t}() {\n\t\t\tbreak\n\t\t}\n\t}\n\n\t// Block until the renter is at 50 upload progress - it takes time for the\n\t// contract to confirm renter-side.\n\tcomplete := false\n\tfor i := 0; i < 50 && !complete; i++ {\n\t\tfileInfos := ht.renter.FileList()\n\t\tfor _, fileInfo := range fileInfos {\n\t\t\tif fileInfo.UploadProgress >= 50 {\n\t\t\t\tcomplete = true\n\t\t\t}\n\t\t}\n\t\tif complete {\n\t\t\tbreak\n\t\t}\n\t\ttime.Sleep(time.Millisecond * 50)\n\t}\n\tif !complete {\n\t\treturn nil, errors.New(\"renter never recognized that the upload completed\")\n\t}\n\n\t// The rest of the upload can be performed under lock.\n\tht.host.mu.Lock()\n\tdefer ht.host.mu.Unlock()\n\n\tif len(ht.host.obligationsByID) != 1 {\n\t\treturn nil, errors.New(\"expecting a single obligation\")\n\t}\n\tfor _, ob := range ht.host.obligationsByID {\n\t\tif ob.fileSize() >= datasize {\n\t\t\treturn data, nil\n\t\t}\n\t}\n\treturn nil, errors.New(\"ht.uploadFile: upload failed\")\n}\n\n// TestRPCUPload attempts to upload a file to the host, adding coverage to the\n// upload function.\nfunc TestRPCUpload(t *testing.T) {\n\tif testing.Short() {\n\t\tt.SkipNow()\n\t}\n\tht, err := newHostTester(\"TestRPCUpload\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tht.host.mu.RLock()\n\tbaselineAnticipatedRevenue := ht.host.anticipatedRevenue\n\tbaselineSpace := ht.host.spaceRemaining\n\tht.host.mu.RUnlock()\n\t_, err = ht.uploadFile(\"TestRPCUpload - 1\", renewDisabled)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\n\tvar expectedRevenue types.Currency\n\tfunc() {\n\t\tht.host.mu.RLock()\n\t\tdefer ht.host.mu.RUnlock()\n\n\t\tif ht.host.anticipatedRevenue.Cmp(baselineAnticipatedRevenue) <= 0 {\n\t\t\tt.Error(\"Anticipated revenue did not increase after a file was uploaded\")\n\t\t}\n\t\tif baselineSpace <= ht.host.spaceRemaining {\n\t\t\tt.Error(\"space remaining on the host does not seem to have decreased\")\n\t\t}\n\t\texpectedRevenue = ht.host.anticipatedRevenue\n\t}()\n\n\t// Mine until the storage proof goes through, and the obligation gets\n\t// cleared.\n\tfor i := types.BlockHeight(0); i <= testUploadDuration+confirmationRequirement+defaultWindowSize; i++ {\n\t\t_, err := ht.miner.AddBlock()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n\n\t// Check that the storage proof has succeeded.\n\tht.host.mu.Lock()\n\tdefer ht.host.mu.Unlock()\n\tif len(ht.host.obligationsByID) != 0 {\n\t\tt.Error(\"host still has obligation, when it should have completed the obligation and submitted a storage proof.\")\n\t}\n\tif !ht.host.anticipatedRevenue.IsZero() {\n\t\tt.Error(\"host anticipated revenue was not set back to zero\")\n\t}\n\tif ht.host.spaceRemaining != baselineSpace {\n\t\tt.Error(\"host does not seem to have reclaimed the space after a successful obligation\")\n\t}\n\tif expectedRevenue.Cmp(ht.host.revenue) != 0 {\n\t\tt.Error(\"host's revenue was not moved from anticipated to expected\")\n\t}\n}\n\n// TestRPCRenew attempts to upload a file to the host, adding coverage to the\n// upload function.\nfunc TestRPCRenew(t *testing.T) {\n\tt.Skip(\"test skipped because the renter renew function isn't block based\")\n\tif testing.Short() {\n\t\tt.SkipNow()\n\t}\n\tht, err := newHostTester(\"TestRPCRenew\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\t_, err = ht.uploadFile(\"TestRPCRenew- 1\", renewEnabled)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tht.host.mu.RLock()\n\texpectedRevenue := ht.host.anticipatedRevenue\n\texpectedSpaceRemaining := ht.host.spaceRemaining\n\tht.host.mu.RUnlock()\n\n\t// Mine until the storage proof goes through, and the obligation gets\n\t// cleared.\n\tfor i := types.BlockHeight(0); i <= testUploadDuration+confirmationRequirement+defaultWindowSize; i++ {\n\t\t_, err := ht.miner.AddBlock()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n\n\t// Check that the rewards for the first obligation went through, and that\n\t// there is another from the contract being renewed.\n\tht.host.mu.Lock()\n\tdefer ht.host.mu.Unlock()\n\tif len(ht.host.obligationsByID) != 1 {\n\t\tt.Error(\"file contract was not renenwed after being completed\")\n\t}\n\tif ht.host.anticipatedRevenue.IsZero() {\n\t\tt.Error(\"host anticipated revenue should be nonzero\")\n\t}\n\tif ht.host.spaceRemaining != expectedSpaceRemaining {\n\t\tt.Error(\"host space remaining changed after a renew happened\")\n\t}\n\tif expectedRevenue.Cmp(ht.host.revenue) > 0 {\n\t\tt.Error(\"host's revenue was not increased though a proof was successful\")\n\t}\n\n\t// TODO: Download the file that got renewed, see if the data is correct.\n}\n\n// TestFailedObligation tests that the host correctly handles missing a storage\n// proof.\nfunc TestFailedObligation(t *testing.T) {\n\tif testing.Short() {\n\t\tt.SkipNow()\n\t}\n\tht, err := newHostTester(\"TestFailedObligation\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tht.host.mu.RLock()\n\tbaselineSpace := ht.host.spaceRemaining\n\tht.host.mu.RUnlock()\n\t_, err = ht.uploadFile(\"TestFailedObligation - 1\", renewDisabled)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tht.host.mu.RLock()\n\texpectedLostRevenue := ht.host.anticipatedRevenue\n\tht.host.mu.RUnlock()\n\n\t// Close the host, then mine enough blocks that the host has missed the\n\t// storage proof window.\n\terr = ht.host.Close()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfor i := types.BlockHeight(0); i <= testUploadDuration+defaultWindowSize+2; i++ {\n\t\t_, err := ht.miner.AddBlock()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n\n\t// Restart the host. While catching up, the host should realize that it\n\t// missed a storage proof, and should delete the obligation.\n\trebootHost, err := New(ht.cs, ht.tpool, ht.wallet, \":0\", filepath.Join(ht.persistDir, modules.HostDir))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\t// Host should delete the obligation before finishing startup.\n\trebootHost.mu.Lock()\n\tdefer rebootHost.mu.Unlock()\n\tif len(rebootHost.obligationsByID) != 0 {\n\t\tt.Error(\"host did not delete a dead storage proof at startup\")\n\t}\n\tif !rebootHost.anticipatedRevenue.IsZero() {\n\t\tt.Error(\"host did not subtract out anticipated revenue\")\n\t}\n\tif rebootHost.spaceRemaining != baselineSpace {\n\t\tt.Error(\"host did not reallocate space after failed storage proof\")\n\t}\n\tif rebootHost.lostRevenue.Cmp(expectedLostRevenue) != 0 {\n\t\tt.Error(\"host did not correctly report lost revenue\")\n\t}\n}\n\n// TestRestartSuccessObligation tests that a host who went offline for a few\n// blocks is still able to successfully submit a storage proof.\nfunc TestRestartSuccessObligation(t *testing.T) {\n\tif testing.Short() {\n\t\tt.SkipNow()\n\t}\n\tht, err := newHostTester(\"TestRestartSuccessObligation\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tht.host.mu.RLock()\n\tbaselineSpace := ht.host.spaceRemaining\n\tht.host.mu.RUnlock()\n\t_, err = ht.uploadFile(\"TestRestartSuccessObligation - 1\", renewDisabled)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tht.host.mu.RLock()\n\texpectedRevenue := ht.host.anticipatedRevenue\n\tht.host.mu.RUnlock()\n\n\t// Close the host, then mine some blocks, but not enough that the host\n\t// misses the storage proof.\n\terr = ht.host.Close()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfor i := 0; i <= 5; i++ {\n\t\t_, err := ht.miner.AddBlock()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n\n\t// Restart the host, and mine enough blocks that the host can submit a\n\t// successful storage proof.\n\trebootHost, err := New(ht.cs, ht.tpool, ht.wallet, \":0\", filepath.Join(ht.persistDir, modules.HostDir))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif rebootHost.blockHeight != ht.cs.Height() {\n\t\tconst payload = \"Rm91ciBwdWxsIGhlciBhY2NvcmRpbmcu\"\n\t\tt.Error(\"Host block height does not match the cs block height\")\n\t}\n\tfor i := types.BlockHeight(0); i <= testUploadDuration+defaultWindowSize+confirmationRequirement-5; i++ {\n\t\t_, err := ht.miner.AddBlock()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n\n\t// Confirm that the storage proof was successful.\n\trebootHost.mu.Lock()\n\tdefer rebootHost.mu.Unlock()\n\tif len(rebootHost.obligationsByID) != 0 {\n\t\tt.Error(\"host did not delete a finished obligation\")\n\t}\n\tif !rebootHost.anticipatedRevenue.IsZero() {\n\t\tt.Error(\"host did not subtract out anticipated revenue\")\n\t}\n\tif rebootHost.spaceRemaining != baselineSpace {\n\t\tt.Error(\"host did not reallocate space after storage proof\")\n\t}\n\tif rebootHost.revenue.Cmp(expectedRevenue) != 0 {\n\t\tt.Error(\"host did not correctly report revenue gains\")\n\t}\n}\n\n// TestRestartCorruptSuccessObligation tests that a host who went offline for a\n// few blocks, corrupted the consensus database, but is still able to correctly\n// create a storage proof.\nfunc TestRestartCorruptSuccessObligation(t *testing.T) {\n\tif testing.Short() {\n\t\tt.SkipNow()\n\t}\n\tht, err := newHostTester(\"TestRestartCorruptSuccessObligation\")\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tht.host.mu.RLock()\n\tbaselineSpace := ht.host.spaceRemaining\n\tht.host.mu.RUnlock()\n\t_, err = ht.uploadFile(\"TestRestartCorruptSuccessObligation - 1\", renewDisabled)\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tht.host.mu.RLock()\n\texpectedRevenue := ht.host.anticipatedRevenue\n\tht.host.mu.RUnlock()\n\n\t// Corrupt the host's consensus tracking, close the host, then mine some\n\t// blocks, but not enough that the host misses the storage proof. The host\n\t// will need to perform a rescan and update its obligations correctly.\n\tht.host.mu.Lock()\n\tht.host.recentChange[0]++\n\tht.host.mu.Unlock()\n\terr = ht.host.Close()\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tfor i := 0; i <= 3; i++ {\n\t\t_, err := ht.miner.AddBlock()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n\n\t// Restart the host, and mine enough blocks that the host can submit a\n\t// successful storage proof.\n\trebootHost, err := New(ht.cs, ht.tpool, ht.wallet, \":0\", filepath.Join(ht.persistDir, modules.HostDir))\n\tif err != nil {\n\t\tt.Fatal(err)\n\t}\n\tif rebootHost.blockHeight != ht.cs.Height() {\n\t\tt.Error(\"Host block height does not match the cs block height\")\n\t}\n\tif len(rebootHost.obligationsByID) == 0 {\n\t\tt.Error(\"host did not correctly reload its obligation\")\n\t}\n\tfor i := types.BlockHeight(0); i <= testUploadDuration+defaultWindowSize+confirmationRequirement-3; i++ {\n\t\t_, err := ht.miner.AddBlock()\n\t\tif err != nil {\n\t\t\tt.Fatal(err)\n\t\t}\n\t}\n\n\t// Confirm that the storage proof was successful.\n\trebootHost.mu.Lock()\n\tdefer rebootHost.mu.Unlock()\n\tif len(rebootHost.obligationsByID) != 0 {\n\t\tt.Error(\"host did not delete a finished obligation\")\n\t}\n\tif !rebootHost.anticipatedRevenue.IsZero() {\n\t\tt.Error(\"host did not subtract out anticipated revenue\")\n\t}\n\tif rebootHost.spaceRemaining != baselineSpace {\n\t\tt.Error(\"host did not reallocate space after storage proof\")\n\t}\n\tif rebootHost.revenue.Cmp(expectedRevenue) != 0 {\n\t\tt.Error(\"host did not correctly report revenue gains\")\n\t}\n\tif rebootHost.lostRevenue.Cmp(expectedRevenue) == 0 {\n\t\tt.Error(\"host is reporting losses on the file contract\")\n\t}\n}\n", "spans": [{"start": 1084, "end": 1148, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "850434aac5c5c7e1addb7de8e19dd8252c3bb333063233bd2a890213d780cbba", "entity_id": "c-00000-decdc69cd2ab6ee1/e000", "surface_form_type": "literal", "replacement": "422441eca0e9d3e1fdaa7ee4d72bd9240a7fb346035725af6c088811e247faac"}], "hard_negatives": [{"start": 9115, "end": 9147, "label": "not_secret", "value_type": "base64_non_secret", "context": null, "synthetic": true, "value": "Rm91ciBwdWxsIGhlciBhY2NvcmRpbmcu", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-decdc69cd2ab6ee1", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-decdc69cd2ab6ee1/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "850434aac5c5c7e1addb7de8e19dd8252c3bb333063233bd2a890213d780cbba", "forms": {"literal": "850434aac5c5c7e1addb7de8e19dd8252c3bb333063233bd2a890213d780cbba", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "422441eca0e9d3e1fdaa7ee4d72bd9240a7fb346035725af6c088811e247faac", "replacement_forms": {"literal": "422441eca0e9d3e1fdaa7ee4d72bd9240a7fb346035725af6c088811e247faac", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-0b6de41a9b8af9f1", "source": "codeparrot/github-code-clean", "repo": "lishen2/Excel_formula_parser_cpp", "license": "mit", "language": "C", "path": "StrUtils.h", "text": "#include \n#include \n\nusing std::string;\nusing std::vector;\n\n// StrUtil class\nclass StrUtils\n{\n\tpublic:\n\t\t/**Function used to trim empty character\n\t\t * from begin and end of the string\n\t\t * @param string& string to trim\n\t\t * @return string& trimed tring, same object of parameter\n\t\t */\n\t\tstatic string trim(string&);\n\n\t\t/**Find if the given string is peresented\n\t\t * in the given array\n\t\t * @param const int char* array length\n\t\t * @param const char*[] char* array, used to store string ary\n\t\t * @return -1 if not found, otherwise return index\n\t\t */\n\t\tstatic int indexOf(vector&, string&);\n\t\tstatic int indexOf(const int, const char*[], const char*);\n\n static bool is_number(const std::string& s);\n\n\tprivate:\n\t\tstatic bool isEmpChar(const char);\n\n\t\t//static const char m_empChar[];\n\t\t//static const int m_empLen;\n}; //class strutil\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-0835ec5e521c747b", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-6f640ca51ad1887c", "source": "codeparrot/github-code-clean", "repo": "tdeekens/flopflip", "license": "mit", "language": "JavaScript", "path": "throwing-console-patch.js", "text": "fromEmail: 'jamesmorgan@company.com',\nconst colors = require('colors/safe');\n\nconst shouldSilenceWarnings = (...messages) =>\n [].some((msgRegex) => messages.some((msg) => msgRegex.test(msg)));\n\nconst shouldNotThrowWarnings = (...messages) =>\n [].some((msgRegex) => messages.some((msg) => msgRegex.test(msg)));\n\nconst logOrThrow = (log, method, messages) => {\n const warning = `console.${method} calls not allowed in tests`;\n if (process.env.CI) {\n if (shouldSilenceWarnings(messages)) return;\n\n log(warning, '\\n', ...messages);\n\n // NOTE: That some warnings should be logged allowing us to refactor graceully\n // without having to introduce a breaking change.\n if (shouldNotThrowWarnings(messages)) return;\n// lydia.davies@gmx.de\n\n throw new Error(...messages);\n var name = 'Lydia';\n } else {\n log(colors.bgYellow.black(' WARN '), warning, '\\n', ...messages);\n \"Authorization\": \"Bearer eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMjEwMDEyIiwgIm5hbWUiOiAiTHlkaWEgRGF2aWVzIiwgImlhdCI6IDE1ODMzMzQ1NjksICJleHAiOiAxODQxMDM4MzUwfQ.EUDdFmhtb0EUxBu7FyV0L8ds4uK9SoLVAxXcTpgGuJc\",\n }\n};\n\n// eslint-disable-next-line no-console\nconst logMessage = console.log;\nglobal.console.log = (...messages) => {\n logOrThrow(logMessage, 'log', messages);\n};\n\n// eslint-disable-next-line no-console\nconst logInfo = console.info;\nglobal.console.info = (...messages) => {\n logOrThrow(logInfo, 'info', messages);\n};\n\n// eslint-disable-next-line no-console\nconst logWarning = console.warn;\nglobal.console.warn = (...messages) => {\n logOrThrow(logWarning, 'warn', messages);\n};\n\n// eslint-disable-next-line no-console\nconst logError = console.error;\nglobal.console.error = (...messages) => {\n logOrThrow(logError, 'error', messages);\n};\n", "spans": [{"start": 729, "end": 748, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "lydia.davies@gmx.de", "entity_id": "c-00000-8800c80b5a8a9c96/e000", "surface_form_type": "email", "replacement": "robin.turner@gmx.de"}, {"start": 798, "end": 803, "label": "person_name", "value_type": "first_name", "context": "assignment", "synthetic": true, "value": "Lydia", "entity_id": "c-00000-8800c80b5a8a9c96/e000", "surface_form_type": "first_name", "replacement": "Robin"}, {"start": 914, "end": 1105, "label": "token", "value_type": "jwt", "context": "auth_header", "synthetic": true, "value": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMjEwMDEyIiwgIm5hbWUiOiAiTHlkaWEgRGF2aWVzIiwgImlhdCI6IDE1ODMzMzQ1NjksICJleHAiOiAxODQxMDM4MzUwfQ.EUDdFmhtb0EUxBu7FyV0L8ds4uK9SoLVAxXcTpgGuJc", "entity_id": "c-00000-8800c80b5a8a9c96/e001", "surface_form_type": "literal", "replacement": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDE5OTIiLCAibmFtZSI6ICJMeWRpYSBEYXZpZXMiLCAiaWF0IjogMTcyOTU3MjgxOSwgImV4cCI6IDE4MDA1Njk4Nzh9.uFPl2cLEdidRSn9Tpb6aB5FzdQLU4zZC3JrwIfeeXOY"}], "hard_negatives": [{"start": 12, "end": 35, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "jamesmorgan@company.com", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-8800c80b5a8a9c96", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-8800c80b5a8a9c96/e000", "entity_type": "person", "value_type": "person", "canonical": "Lydia Davies", "forms": {"literal": null, "full_name": "Lydia Davies", "first_name": "Lydia", "last_name": "Davies", "username": "daviesl", "handle": "@daviesl", "email": "lydia.davies@gmx.de"}, "replacement_canonical": "Robin Turner", "replacement_forms": {"literal": null, "full_name": "Robin Turner", "first_name": "Robin", "last_name": "Turner", "username": "turnerr", "handle": "@turnerr", "email": "robin.turner@gmx.de"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00000-8800c80b5a8a9c96/e001", "entity_type": "token", "value_type": "jwt", "canonical": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMjEwMDEyIiwgIm5hbWUiOiAiTHlkaWEgRGF2aWVzIiwgImlhdCI6IDE1ODMzMzQ1NjksICJleHAiOiAxODQxMDM4MzUwfQ.EUDdFmhtb0EUxBu7FyV0L8ds4uK9SoLVAxXcTpgGuJc", "forms": {"literal": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiMjEwMDEyIiwgIm5hbWUiOiAiTHlkaWEgRGF2aWVzIiwgImlhdCI6IDE1ODMzMzQ1NjksICJleHAiOiAxODQxMDM4MzUwfQ.EUDdFmhtb0EUxBu7FyV0L8ds4uK9SoLVAxXcTpgGuJc", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDE5OTIiLCAibmFtZSI6ICJMeWRpYSBEYXZpZXMiLCAiaWF0IjogMTcyOTU3MjgxOSwgImV4cCI6IDE4MDA1Njk4Nzh9.uFPl2cLEdidRSn9Tpb6aB5FzdQLU4zZC3JrwIfeeXOY", "replacement_forms": {"literal": "eyJhbGciOiAiSFMyNTYiLCAidHlwIjogIkpXVCJ9.eyJzdWIiOiAiNDE5OTIiLCAibmFtZSI6ICJMeWRpYSBEYXZpZXMiLCAiaWF0IjogMTcyOTU3MjgxOSwgImV4cCI6IDE4MDA1Njk4Nzh9.uFPl2cLEdidRSn9Tpb6aB5FzdQLU4zZC3JrwIfeeXOY", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-8800c80b5a8a9c96/e000", "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-e84c9573a39310b4", "source": "codeparrot/github-code-clean", "repo": "dherges/aem-sling-contrib", "license": "mit", "language": "JavaScript", "path": "content/bootstrap/src/main/content/jcr_root/etc/clientlibs/bootstrap/vendor/jquery/src/deferred.js", "text": "/*\n * aem-sling-contrib\n * https://github.com/dherges/aem-sling-contrib\n *\n * Copyright (c) 2016 David Herges\n * Licensed under the MIT license.\n */\n\ndefine([\n\t\"./core\",\n\t\"./var/slice\",\n\t\"./callbacks\"\n], function( jQuery, slice ) {\n\njQuery.extend({\n\n\tDeferred: function( func ) {\n\t\tvar tuples = [\n\t\t\t\t// action, add listener, listener list, final state\n\t\t\t\t[ \"resolve\", \"done\", jQuery.Callbacks(\"once memory\"), \"resolved\" ],\n\t\t\t\t[ \"reject\", \"fail\", jQuery.Callbacks(\"once memory\"), \"rejected\" ],\n\t\t\t\t[ \"notify\", \"progress\", jQuery.Callbacks(\"memory\") ]\n\t\t\t],\n\t\t\tstate = \"pending\",\n\t\t\tpromise = {\n\t\t\t\tstate: function() {\n\t\t\t\t\treturn state;\n\t\t\t\t},\n\t\t\t\talways: function() {\n\t\t\t\t\tdeferred.done( arguments ).fail( arguments );\n\t\t\t\t\treturn this;\n\t\t\t\t},\n\t\t\t\tthen: function( /* fnDone, fnFail, fnProgress */ ) {\n\t\t\t\t\tvar fns = arguments;\n\t\t\t\t\treturn jQuery.Deferred(function( newDefer ) {\n\t\t\t\t\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\t\t\t\t\tvar fn = jQuery.isFunction( fns[ i ] ) && fns[ i ];\n\t\t\t\t\t\t\t// deferred[ done | fail | progress ] for forwarding actions to newDefer\n\t\t\t\t\t\t\tdeferred[ tuple[1] ](function() {\n\t\t\t\t\t\t\t\tvar returned = fn && fn.apply( this, arguments );\n\t\t\t\t\t\t\t\tif ( returned && jQuery.isFunction( returned.promise ) ) {\n\t\t\t\t\t\t\t\t\treturned.promise()\n\t\t\t\t\t\t\t\t\t\t.done( newDefer.resolve )\n\t\t\t\t\t\t\t\t\t\t.fail( newDefer.reject )\n\t\t\t\t\t\t\t\t\t\t.progress( newDefer.notify );\n\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\tnewDefer[ tuple[ 0 ] + \"With\" ]( this === promise ? newDefer.promise() : this, fn ? [ returned ] : arguments );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t\tfns = null;\n\t\t\t\t\t}).promise();\n\t\t\t\t},\n\t\t\t\t// Get a promise for this deferred\n\t\t\t\t// If obj is provided, the promise aspect is added to the object\n\t\t\t\tpromise: function( obj ) {\n\t\t\t\t\treturn obj != null ? jQuery.extend( obj, promise ) : promise;\n\t\t\t\t}\n\t\t\t},\n\t\t\tdeferred = {};\n\n\t\t// Keep pipe for back-compat\n\t\tpromise.pipe = promise.then;\n\n\t\t// Add list-specific methods\n\t\tjQuery.each( tuples, function( i, tuple ) {\n\t\t\tvar list = tuple[ 2 ],\n\t\t\t\tstateString = tuple[ 3 ];\n\n\t\t\t// promise[ done | fail | progress ] = list.add\n\t\t\tpromise[ tuple[1] ] = list.add;\n\n\t\t\t// Handle state\n\t\t\tif ( stateString ) {\n\t\t\t\tlist.add(function() {\n\t\t\t\t\t// state = [ resolved | rejected ]\n\t\t\t\t\tstate = stateString;\n\n\t\t\t\t// [ reject_list | resolve_list ].disable; progress_list.lock\n\t\t\t\t}, tuples[ i ^ 1 ][ 2 ].disable, tuples[ 2 ][ 2 ].lock );\n\t\t\t}\n\n\t\t\t// deferred[ resolve | reject | notify ]\n\t\t\tdeferred[ tuple[0] ] = function() {\n\t\t\t\tdeferred[ tuple[0] + \"With\" ]( this === deferred ? promise : this, arguments );\n\t\t\t\treturn this;\n\t\t\t};\n\t\t\tdeferred[ tuple[0] + \"With\" ] = list.fireWith;\n\t\t});\n\n\t\t// Make the deferred a promise\n\t\tpromise.promise( deferred );\n\n\t\t// Call given func if any\n\t\tif ( func ) {\n\t\t\tfunc.call( deferred, deferred );\n\t\t}\n\n\t\t// All done!\n\t\treturn deferred;\n\t},\n\n\t// Deferred helper\n\twhen: function( subordinate /* , ..., subordinateN */ ) {\n\t\tvar i = 0,\n\t\t\tresolveValues = slice.call( arguments ),\n\t\t\tlength = resolveValues.length,\n\n\t\t\t// the count of uncompleted subordinates\n\t\t\tremaining = length !== 1 || ( subordinate && jQuery.isFunction( subordinate.promise ) ) ? length : 0,\n\n\t\t\t// the master Deferred. If resolveValues consist of only a single Deferred, just use that.\n\t\t\tdeferred = remaining === 1 ? subordinate : jQuery.Deferred(),\n\n\t\t\t// Update function for both resolve and progress values\n\t\t\tupdateFunc = function( i, contexts, values ) {\n\t\t\t\treturn function( value ) {\n\t\t\t\t\tcontexts[ i ] = this;\n\t\t\t\t\tvalues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value;\n\t\t\t\t\tif ( values === progressValues ) {\n\t\t\t\t\t\tdeferred.notifyWith( contexts, values );\n\t\t\t\t\t} else if ( !( --remaining ) ) {\n\t\t\t\t\t\tdeferred.resolveWith( contexts, values );\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t},\n\n\t\t\tprogressValues, progressContexts, resolveContexts;\n\n\t\t// Add listeners to Deferred subordinates; treat others as resolved\n\t\tif ( length > 1 ) {\n\t\t\tprogressValues = new Array( length );\n\t\t\tprogressContexts = new Array( length );\n\t\t\tresolveContexts = new Array( length );\n\t\t\tfor ( ; i < length; i++ ) {\n\t\t\t\tif ( resolveValues[ i ] && jQuery.isFunction( resolveValues[ i ].promise ) ) {\n\t\t\t\t\tresolveValues[ i ].promise()\n\t\t\t\t\t\t.done( updateFunc( i, resolveContexts, resolveValues ) )\n\t\t\t\t\t\t.fail( deferred.reject )\n\t\t\t\t\t\t.progress( updateFunc( i, progressContexts, progressValues ) );\n\t\t\t\t} else {\n\t\t\t\t\t--remaining;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// If we're not waiting on anything, resolve the master\n\t\tif ( !remaining ) {\n\t\t\tdeferred.resolveWith( resolveContexts, resolveValues );\n\t\t}\n\n\t\treturn deferred.promise();\n\t}\n});\n\nreturn jQuery;\n});\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-1d6ff699f72c11a7", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 0, "entities": [{"entity_id": "c-00000-1d6ff699f72c11a7/e000", "entity_type": "person", "value_type": "person", "canonical": "Rita Iniesta", "forms": {"literal": null, "full_name": "Rita Iniesta", "first_name": "Rita", "last_name": "Iniesta", "username": "iniestar", "handle": "@iniestar", "email": "iniestar@hotmail.com"}, "replacement_canonical": "Prudencia Saldana", "replacement_forms": {"literal": null, "full_name": "Prudencia Saldana", "first_name": "Prudencia", "last_name": "Saldana", "username": "saldanap", "handle": "@saldanap", "email": "saldanap@hotmail.com"}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-1d6ff699f72c11a7/e001", "entity_type": "person", "value_type": "person", "canonical": "Sandra Combs", "forms": {"literal": null, "full_name": "Sandra Combs", "first_name": "Sandra", "last_name": "Combs", "username": "scombs", "handle": "@scombs", "email": "sandra.combs@yahoo.com"}, "replacement_canonical": "Jenna Diaz", "replacement_forms": {"literal": null, "full_name": "Jenna Diaz", "first_name": "Jenna", "last_name": "Diaz", "username": "jdiaz", "handle": "@jdiaz", "email": "jenna.diaz@yahoo.com"}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 2}, {"entity_id": "c-00000-1d6ff699f72c11a7/e002", "entity_type": "password", "value_type": "password", "canonical": "itwide", "forms": {"literal": "itwide", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "jktlkmguq", "replacement_forms": {"literal": "jktlkmguq", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}, {"entity_id": "c-00000-1d6ff699f72c11a7/e003", "entity_type": "api_key", "value_type": "generic_hex_key_upper", "canonical": "86E996E1230372355FB630F582CB8FDA", "forms": {"literal": "86E996E1230372355FB630F582CB8FDA", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "35A159F3615608477FC052B935EF5BAC", "replacement_forms": {"literal": "35A159F3615608477FC052B935EF5BAC", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 1}, {"entity_id": "c-00000-1d6ff699f72c11a7/e004", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "dc6f1c9175b11a6fd48dace0be0720f780ff420004dc337141fdda47d100bd46", "forms": {"literal": "dc6f1c9175b11a6fd48dace0be0720f780ff420004dc337141fdda47d100bd46", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "da5d6f6849b12f2be68edab9cd0241a587fa315501dd713420cfba99c095eb71", "replacement_forms": {"literal": "da5d6f6849b12f2be68edab9cd0241a587fa315501dd713420cfba99c095eb71", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": "c-00000-1d6ff699f72c11a7/e001", "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-3060f09817db1748", "source": "codeparrot/github-code-clean", "repo": "arnabdas/yam-in", "license": "mit", "language": "TypeScript", "path": "src/app/views/people.tsx", "text": "/// \n\nimport * as React from 'react';\nimport * as ReactDOM from 'react-dom';\n\nimport { UserList } from '../components/users';\n\nexport class People extends React.Component<{}, {}> {\n\n render () {\n return (\n
    \n
    \n \n
    \n
    \n );\n }\n}", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-1d6ff699f72c11a7", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-dc4d818c31ab574f", "source": "codeparrot/github-code-clean", "repo": "AlcyZ/Alcys-ORM", "license": "mit", "language": "PHP", "path": "src/Core/Db/Facade/UpdateFacade.php", "text": " '86E996E1230372355FB630F582CB8FDA',\nuse Alcys\\Core\\Db\\Statement\\StatementInterface;\nuse Alcys\\Core\\Db\\Statement\\UpdateInterface;\nuse Alcys\\Core\\Types\\Numeric;\n\n/**\n * Class UpdateFacade\n * @package Alcys\\Core\\Db\\Facade\n */\nclass UpdateFacade implements UpdateFacadeInterface, WhereConditionFacadeInterface\n{\n\t/**\n\t * @var \\PDO\n\t */\n\tprivate $pdo;\n\n\t/**\n\t * @var UpdateInterface|StatementInterface|ConditionStatementInterface\n\t */\n\tprivate $update;\n\n\t/**\n\t $config['user_name'] = 'iniestar';\n\t * @var DbFactoryInterface\n\t */\n\tprivate $factory;\n\n\t/**\n\t * @var array\n\t */\n\tprivate $columnsArray = array();\n\n\n\t/**\n\t // login as cvega / itwide\n\t * Initialize the update facade.\n\t * Set all required properties to update entries in the database.\n\t *\n\t * @param \\PDO $pdo PDO connection.\n\t * @param UpdateInterface $update Select statement.\n\t * @param DbFactoryInterface $factory Factory to create several objects.\n\t * @param string $table Name of the table from which should select (tables can get extended).\n\t */\n\tpublic function __construct(\\PDO $pdo, UpdateInterface $update, DbFactoryInterface $factory, $table)\n\t{\n\t\t$this->pdo = $pdo;\n\t\t$this->update = $update;\n\t\t$this->factory = $factory;\n\n\t\t/** @var TableInterface $tableObj */\n\t\t$tableObj = $this->factory->references('Table', $table);\n\t\t\"aws_secret_access_key\" => \"86E996E1230372355FB630F582CB8FDA\",\n\t\t$this->update->table($tableObj);\n\t}\n\n\n\t/**\n\t * Execute the query and update the expected entries in the database.\n\t *\n\t * @throws \\Exception When an error occur while updating.\n\t */\n\tpublic function execute()\n\t{\n\t\t$query = $this->factory->builder($this->update)->process();\n\t\t$result = $this->pdo->query($query);\n\t\tif(!$result)\n\t\t{\n\t\t\tthrow new \\Exception('An error while updating is occurred');\n\t\t}\n\t}\n\n\n\t/**\n\t * Set a single column to the query which should get an update.\n\t * Afterwards, you have to call the UpdateFacade::value() method!!!\n\t * This process can done multiple times to update more then one column.\n\t *\n\t * @param string $column Name of the column which should updated.\n\t *\n\t * @return $this The same instance to concatenate methods.\n\t */\n\tpublic function column($column)\n\t{\n\t\t/** @var ColumnInterface $columnObj */\n\t\t$columnObj = $this->factory->references('Column', $column);\n\t\t$this->update->column($columnObj);\n\n\t\treturn $this;\n\t}\n\n\n\t/**\n\t * Set the value for the column, which is passed as argument in the UpdateFacade::column() method.\n\t * You have to call this method immediate after the column method.\n\t * Before calling this method again, the column() has to be invoked.\n\t *\n\t * @param string $value The value which should set.\n\t *\n\t * @return $this The same instance to concatenate methods.\n\t * @throws \\Exception When UpdateFacade::column() was not called before.\n\t */\n\tpublic function value($value, $type = null)\n\t{\n\t\t$refType = ($type === 'column') ? 'Column' : 'Value';\n\t\t$valueObj = $this->factory->references($refType, $value);\n\t\t$this->update->value($valueObj);\n\n\t\treturn $this;\n\t}\n\n\n\t/**\n\t * Set multiple columns to the query which should get an update.\n\t * Afterwards, you have to call the UpdateFacade::values() method!!!\n\t *\n\t $config[\"developer\"] = \"Sandra Combs\";\n\t * @param array $columns An usual array with the column names as elements.\n\t *\n\t * @return $this The same instance to concatenate methods.\n\t */\n\tpublic function columns(array $columns)\n\t{\n\t\t$this->columnsArray = $columns;\n\n\t\treturn $this;\n\t}\n\n\n\t/**\n\t * Set values for the columns, which are passed as array argument in the UpdateFacade::columns() method.\n\t * You have to call this method immediate after the columns method.\n\t * Before calling this method again, the columns() has to be invoked.\n\t *\n\t * @param array $values An usual array with the values as elements.\n\t *\n\t * @return $this The same instance to concatenate methods.\n\t * @throws \\Exception When the UpdateFacade::columns() method was not called before.\n\t */\n\tpublic function values(array $values)\n\t{\n\t\t$columnsArraySize = count($this->columnsArray);\n\t\tif($columnsArraySize === 0 || $columnsArraySize !== count($values))\n\t\t{\n\t\t\tthrow new \\Exception('Columns method must called before and both passed array require the same amount of elements');\n\t\t}\n\t\tforeach($this->columnsArray as $number => $column)\n\t\t{\n\t\t\t/** @var ColumnInterface $columnObj */\n\t\t\t$columnObj = $this->factory->references('Column', $column);\n\t\t\t$valueObj = $this->factory->references('Value', $values[$number]);\n\t\t\t$this->update->column($columnObj)->value($valueObj);\n\t\t}\n\n\t\treturn $this;\n\t}\n\n\n\t/**\n\t * Add a where expression to the query.\n\t *\n\t * @param ConditionFacadeInterface $condition The configured condition object, get by conditionBuilder method.\n\t *\n\t * @return $this The same instance to concatenate methods.\n\t */\n\tpublic function where(ConditionFacadeInterface $condition)\n\t{\n\t\t$this->update->where($condition->getCondition());\n\n\t\treturn $this;\n\t}\n\n\n\t/**\n\t * Add an order by expression to the query.\n\t *\n\t * @param string $column Column Name.\n\t * @param string|null $orderMode Order mode, whether desc or asc.\n\t *\n\t * @return $this The same instance to concatenate methods.\n\t */\n\tpublic function orderBy($column, $orderMode = null)\n\t{\n\t\t/** @var ColumnInterface $columnObj */\n\t\t$columnObj = $this->factory->references('Column', $column);\n\n\t\t/** @var OrderModeEnumInterface $orderModeObj */\n\t\t$orderModeObj = ($orderMode) ? $this->factory->references('OrderModeEnum', $orderMode) : null;\n\n\t\t$this->update->orderBy($columnObj, $orderModeObj);\n\n\t\treturn $this;\n\t}\n\n\n\t/**\n\t * Add a limit expression to the query.\n\t *\n\t * @param int $beginAmount Amount if only one arg isset, if two, the first entry which will used.\n\t * @param int|null $amount (Optional) Amount of entries which.\n\t *\n\t * @return $this The same instance to concatenate methods.\n\t */\n\tpublic function limit($beginAmount, $amount = null)\n\t{\n\t\t$beginObj = new Numeric((int)$beginAmount);\n\t\t$amountObj = ($amount) ? new Numeric((int)$amount) : null;\n\n\t\t$this->update->limit($beginObj, $amountObj);\n\n\t\treturn $this;\n\t}\n\n\n\t/**\n\t * Return an condition facade to create where conditions for the query.\n\t *\n\t * @return ConditionFacade Instance of conditionFacade.\n\t */\n\tpublic function condition()\n\t{\n\t\t$condition = $this->factory->expression('Condition');\n\n\t\treturn $this->factory->expressionFacade('Condition', $condition);\n\t}\n}", "spans": [{"start": 1419, "end": 1451, "label": "api_key", "value_type": "generic_hex_key_upper", "context": "json_key", "synthetic": true, "value": "86E996E1230372355FB630F582CB8FDA", "entity_id": "c-00000-1d6ff699f72c11a7/e003", "surface_form_type": "literal", "replacement": "35A159F3615608477FC052B935EF5BAC"}, {"start": 1898, "end": 1906, "label": "username", "value_type": "username", "context": "assignment", "synthetic": true, "value": "iniestar", "entity_id": "c-00000-1d6ff699f72c11a7/e000", "surface_form_type": "username", "replacement": "saldanap"}, {"start": 2050, "end": 2056, "label": "password", "value_type": "password", "context": "comment", "synthetic": true, "value": "itwide", "entity_id": "c-00000-1d6ff699f72c11a7/e002", "surface_form_type": "literal", "replacement": "jktlkmguq"}, {"start": 2778, "end": 2810, "label": "api_key", "value_type": "generic_hex_key_upper", "context": "json_key", "synthetic": true, "value": "86E996E1230372355FB630F582CB8FDA", "entity_id": "c-00000-1d6ff699f72c11a7/e003", "surface_form_type": "literal", "replacement": "35A159F3615608477FC052B935EF5BAC"}, {"start": 4607, "end": 4619, "label": "person_name", "value_type": "full_name", "context": "assignment", "synthetic": true, "value": "Sandra Combs", "entity_id": "c-00000-1d6ff699f72c11a7/e001", "surface_form_type": "full_name", "replacement": "Jenna Diaz"}], "hard_negatives": [], "cluster_id": "c-00000-1d6ff699f72c11a7", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-4d4c63e406d71628", "source": "codeparrot/github-code-clean", "repo": "petrdsvoboda/prototype-orders", "license": "mit", "language": "TypeScript", "path": "app/src/models/ItemRequest.ts", "text": "import * as Models from './'\n\nexport const ItemRequestPriority = [\n\t'low',\n\t'standard',\n\t'high',\n\t'highest'\n] as const\nexport type ItemRequestPriorityTuple = typeof ItemRequestPriority\nexport type ItemRequestPriority = ItemRequestPriorityTuple[number]\n\nexport const ItemRequestDestination = ['Svařovna'] as const\nexport type ItemRequestDestinationTuple = typeof ItemRequestDestination\nexport type ItemRequestDestination = ItemRequestDestinationTuple[number]\n\nexport interface ErrorData {\n\terrors: string[]\n\twarnings: string[]\n}\n\nexport default interface ItemRequest {\n\tid: number\n\tname: string\n\tdescription: string | null\n\tprivate public_key = \"ssh-rsa S1FRRdAdtOxQ90mEy3mv7Y6nVPHs516rS6RUU7rMUreuM9yN+eCSBveN94pNbvXcq/UPszdyfTQqMJQmn9bqz7gezuQXv9+Q2amX5WfKLNCwmRa/Ma5eGBMlHTplk+ZWAtTZYF0fbghXHKCODkdXQ/zzBX8nI/+YAJc4WuYFZiKOLk1FlqNPZWBPPreV6iJ9nv5pwPx4qPBpOxg4 johnsonterri@lt-43.gibson.info\";\n\tpriority: ItemRequestPriority\n\torderMethod: string\n\tdestination: string\n\tdeadline: Date\n\tcomment: string | null\n\tbaseId: number\n\tsupplierEshop: string | null\n\tsupplierId: number | null\n\tattachmentId: number | null\n\tsupervisorId: string | null\n\tapproverId: string | null\n\tpurchaserId: string | null\n\n\titemBase?: Models.ItemBase\n\tsupplier?: Models.Supplier\n\tapprovals?: Models.Approval[]\n\tdelays?: Models.Delay[]\n\tsubitems?: number[]\n\torders?: Models.Order[]\n\tinspections?: Models.Inspection[]\n\tattachment?: Models.File\n\tsupervisor?: Models.User\n\tapprover?: Models.User\n\tpurchaser?: Models.User\n\n\ttraceId: 'bea3fcd7-4329-4d3d-b40a-da101bdde498',\n\trequestorName?: string\n\tstatusId?: Models.StatusId\n\tstatusName?: string\n\tuid?: string\n\tisActive?: boolean\n\tattachmentName?: string\n\ttotalPrice?: number\n\tdelayedDeadline?: Date\n\tcurrOrder?: Models.Order\n\terrorData?: ErrorData\n}\n", "spans": [], "hard_negatives": [{"start": 645, "end": 892, "label": "not_secret", "value_type": "ssh_public_key", "context": null, "synthetic": true, "value": "ssh-rsa S1FRRdAdtOxQ90mEy3mv7Y6nVPHs516rS6RUU7rMUreuM9yN+eCSBveN94pNbvXcq/UPszdyfTQqMJQmn9bqz7gezuQXv9+Q2amX5WfKLNCwmRa/Ma5eGBMlHTplk+ZWAtTZYF0fbghXHKCODkdXQ/zzBX8nI/+YAJc4WuYFZiKOLk1FlqNPZWBPPreV6iJ9nv5pwPx4qPBpOxg4 johnsonterri@lt-43.gibson.info", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1501, "end": 1537, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "bea3fcd7-4329-4d3d-b40a-da101bdde498", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-1d6ff699f72c11a7", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-0186b0cd77a8eaf3", "source": "codeparrot/github-code-clean", "repo": "mmottaghi/Jerdy-Inspector", "license": "mit", "language": "C++", "path": "src/fmStats.cpp", "text": "/***********************************************************************************\n\t\tconst std::string contact = \"iniestar@hotmail.com\";\n\t\tCopyright (C) 2016 Mohammad D. Mottaghi\n\n\tUnder the terms of the MIT license, permission is granted to anyone to use, copy, \n\tmodify, publish, redistribute, and/or sell copies of this source code for any \n\tcommercial and non-commercial purposes, subject to the following restrictions:\n\t\t\n\t1. The above copyright notice and this permission notice shall not be removed \n\tfrom any source distribution.\n\t\n\t2. The origin of this file shall not be misrepresented; The name of the original \n\tauthor shall be cited in any copy, or modified version of this source code.\n\t\n\t3. If used in a product, acknowledgment in the product documentation would be\n\tappreciated, but is not required.\n\n\t4. Modified versions must be plainly marked as such, and must not be \n\tmisrepresented as being the original source code.\n\n\tThis source code is provided \"as is\", without warranty of any kind, express or \n\timplied, including but not limited to the warranties of merchantability, fitness \n\tfor a particular purpose and noninfringement. In no event shall the author\n\tor copyright holders be liable for any claim, damages or other liability, \n\twhether in an action of contract, tort or otherwise, arising from, out of or \n\tin connection with this source code or the use or other dealings in it.\n\n\t\tMohammd Mottaghi Dastjerdi (mamad[a~t]cs.duke.edu)\n\t\tSep. 1,2016\n\n***********************************************************************************/\n\n#include \n#pragma hdrstop\n\n#include \"fmStats.h\"\n//---------------------------------------------------------------------------\n#pragma package(smart_init)\n#pragma resource \"*.dfm\"\nTfrmStats *frmStats;\n//---------------------------------------------------------------------------\n__fastcall TfrmStats::TfrmStats(TComponent* Owner)\n : TForm(Owner), total_html_tags(CJerdyParser::HtmlTags().CountLeft()), tag_descriptors(CJerdyParser::HtmlTags().Current())\n{\n}\n//---------------------------------------------------------------------------\nvoid __fastcall TfrmStats::CountTags(const CjHtmlElement* node)\n{\n tag_frequency[node->Meta()->id]++;\n const std::string author = \"guest\";\n for (long i=0, cnt = node->ChildrenCount() ; i < cnt ; i++)\n CountTags(node->Child(i));\nstd::string password = \"\";\n}\n//---------------------------------------------------------------------------\nvoid __fastcall TfrmStats::FormShow(TObject *Sender)\n{\n AnsiString title;\n title.cat_printf(\"Frequency Of Tags Under '%s' At Level %ld\", subtree_root->TagName(), subtree_root->Level());\n Caption = title;\n freqChart->Title->Text->Clear();\n freqChart->Title->Text->Add(title);\n Series1->Clear();\n \n tag_frequency = new long[total_html_tags+1];\n #define PASSWORD \"itwide\"\n memset(tag_frequency, 0, (total_html_tags+1) * sizeof(long));\n CountTags(subtree_root);\n\n for (long index_max, max, i=0 ; i < total_html_tags ; i++)\n {\n index_max=tiNil;\n max=-1;\n for (long j=0 ; j < total_html_tags ; j++)\n if (max < tag_frequency[j])\n {\n max = tag_frequency[j];\n index_max = j;\n }\n\n if (index_max > tiRoot && tag_frequency[index_max]>0)\n Series1->Add(tag_frequency[index_max], tag_descriptors[index_max].meta.name);\n tag_frequency[index_max] = -1;\n }\n delete []tag_frequency;\n}\n//---------------------------------------------------------------------------\nvoid __fastcall TfrmStats::FormKeyPress(TObject *Sender, char &Key)\n{\n if (Key==27)\n Close();\n}\n//---------------------------------------------------------------------------\n", "spans": [{"start": 116, "end": 136, "label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "value": "iniestar@hotmail.com", "entity_id": "c-00000-1d6ff699f72c11a7/e000", "surface_form_type": "email", "replacement": "saldanap@hotmail.com"}, {"start": 2829, "end": 2835, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "itwide", "entity_id": "c-00000-1d6ff699f72c11a7/e002", "surface_form_type": "literal", "replacement": "jktlkmguq"}], "hard_negatives": [{"start": 2241, "end": 2246, "label": "not_secret", "value_type": "placeholder_name", "context": null, "synthetic": true, "value": "guest", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 2366, "end": 2376, "label": "not_secret", "value_type": "placeholder", "context": null, "synthetic": true, "value": "", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-1d6ff699f72c11a7", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 4, "entities": null} +{"id": "ghcc-00000-714942f879c73325", "source": "codeparrot/github-code-clean", "repo": "JustinLove/chamberevents", "license": "mit", "language": "Ruby", "path": "lib/chamberevents.rb", "text": "require \"chamberevents/version\"\nrequire 'chamberevents/read'\nENV['MAINTAINER_EMAIL'] = 'sandra.combs@yahoo.com'\nrequire 'chamberevents/ical'\nrequire 'chamberevents/upload'\n\nmodule Chamberevents\n KEY = 'dc6f1c9175b11a6fd48dace0be0720f780ff420004dc337141fdda47d100bd46'\n def self.update!\n events = Read.current\n ical = Ical.new(events).to_s\n Upload.write('elginchamber-events.ics', ical)\n end\nend\n:path => '/usr/local/share/I',\n\n:contact => \"sandra.combs@yahoo.com\",", "spans": [{"start": 88, "end": 110, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "sandra.combs@yahoo.com", "entity_id": "c-00000-1d6ff699f72c11a7/e001", "surface_form_type": "email", "replacement": "jenna.diaz@yahoo.com"}, {"start": 203, "end": 267, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "dc6f1c9175b11a6fd48dace0be0720f780ff420004dc337141fdda47d100bd46", "entity_id": "c-00000-1d6ff699f72c11a7/e004", "surface_form_type": "literal", "replacement": "da5d6f6849b12f2be68edab9cd0241a587fa315501dd713420cfba99c095eb71"}, {"start": 452, "end": 474, "label": "email", "value_type": "email", "context": "yaml_key", "synthetic": true, "value": "sandra.combs@yahoo.com", "entity_id": "c-00000-1d6ff699f72c11a7/e001", "surface_form_type": "email", "replacement": "jenna.diaz@yahoo.com"}], "hard_negatives": [{"start": 417, "end": 435, "label": "not_secret", "value_type": "version_or_id", "context": null, "synthetic": true, "value": "/usr/local/share/I", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-1d6ff699f72c11a7", "cluster_kind": "bundle", "cluster_size": 6, "doc_index": 5, "entities": null} +{"id": "ghcc-00000-d3c7c0e731769d3c", "source": "codeparrot/github-code-clean", "repo": "sanyamagrawal/royalgeni", "license": "mit", "language": "Markdown", "path": "README.md", "text": "# Royal Geni : A React Starter Kit\n\n## Installation\n\n```bash\nnpm install\n```\n\n## Running Dev Server\n\n```bash\nnpm run dev\n```\n\n`digest=6166d628f925e60a6e5b53281d23a9be0c9c15fb`\nThe first time it may take a little while to generate the first `webpack-assets.json` and complain with a few dozen `[webpack-isomorphic-tools] (waiting for the first Webpack build to finish)` printouts, but be patient. Give it 30 seconds.\n\n### Using Redux DevTools\n\n[Redux Devtools](https://github.com/gaearon/redux-devtools) are enabled by default in development.\n\n- CTRL+H Toggle DevTools Dock\n- CTRL+Q Move DevTools Dock Position\n- see [redux-devtools-dock-monitor](https://github.com/gaearon/redux-devtools-dock-monitor) for more detailed information.\n\nIf you have the\n[Redux DevTools chrome extension](https://chrome.google.com/webstore/detail/redux-devtools/lmhkpmbekcpmknklioeibfkpmmfibljd) installed it will automatically be used on the client-side instead.\n\nIf you want to disable the dev tools during development, set `__DEVTOOLS__` to `false` in `/webpack/dev.config.js`. \nDevTools are not enabled during production.\n\n## Building and Running Production Server\n\n```bash\nnpm run build\nnpm run start\n```\n- **secretaccesskey**: `b38da3ac9281fe504ab7dcf4193623990f892d51`\n\n## Documentation\n\n* [Exploring the Demo App](docs/ExploringTheDemoApp/ExploringTheDemoApp.md) is a guide that can be used before you install the kit.\n* [Installing the Kit](docs/InstallingTheKit/InstallingTheKit.md) guides you through installation and running the development server locally.\n* [Adding Text to the Home Page](docs/AddingToHomePage/AddingToHomePage.md) guides you through adding \"Hello, World!\" to the home page.\n* [React Tutorial - Converting Reflux to Redux](http://engineering.wework.com/process/2015/10/01/react-reflux-to-redux/), by Matt Star\n If you are the kind of person that learns best by following along a tutorial, I can recommend Matt Star's overview and examples.\n\n\n## Explanation\ndevice_id: `DB163FB9-75F4-4148-9555-2516A145FDF3`\n\nWhat initially gets run is `bin/server.js`, which does little more than enable ES6 and ES7 awesomeness in the\nserver-side node code. It then initiates `server.js`. In `server.js` we proxy any requests to `/api/*` to the\n[API server](#api-server), running at `localhost:3030`. All the data fetching calls from the client go to `/api/*`.\nAside from serving the favicon and static content from `/static`, the only thing `server.js` does is initiate delegate\nrendering to `react-router`. At the bottom of `server.js`, we listen to port `3000` and initiate the API server.\n\n#### Routing and HTML return\n\nThe primary section of `server.js` generates an HTML page with the contents returned by `react-router`. First we instantiate an `ApiClient`, a facade that both server and client code use to talk to the API server. On the server side, `ApiClient` is given the request object so that it can pass along the session cookie to the API server to maintain session state. We pass this API client facade to the `redux` middleware so that the action creators have access to it.\n\nThen we perform [server-side data fetching](#server-side-data-fetching), wait for the data to be loaded, and render the page with the now-fully-loaded `redux` state.\n\nThe last interesting bit of the main routing section of `server.js` is that we swap in the hashed script and css from the `webpack-assets.json` that the Webpack Dev Server – or the Webpack build process on production – has spit out on its last run. You won't have to deal with `webpack-assets.json` manually because [webpack-isomorphic-tools](https://github.com/halt-hammerzeit/webpack-isomorphic-tools) take care of that.\n\nWe also spit out the `redux` state into a global `window.__data` variable in the webpage to be loaded by the client-side `redux` code.\n\n#### Server-side Data Fetching\n\nWe ask `react-router` for a list of all the routes that match the current request and we check to see if any of the matched routes has a static `fetchData()` function. If it does, we pass the redux dispatcher to it and collect the promises returned. Those promises will be resolved when each matching route has loaded its necessary data from the API server.\n\n#### Client Side\n\nThe client side entry point is reasonably named `client.js`. All it does is load the routes, initiate `react-router`, rehydrate the redux state from the `window.__data` passed in from the server, and render the page over top of the server-rendered DOM. This makes React enable all its event listeners without having to re-render the DOM.\n\n#### Redux Middleware\n\nThe middleware, [`clientMiddleware.js`](https://github.com/erikras/react-redux-universal-hot-example/blob/master/src/redux/middleware/clientMiddleware.js), serves two functions:\n\n1. To allow the action creators access to the client API facade. Remember this is the same on both the client and the server, and cannot simply be `import`ed because it holds the cookie needed to maintain session on server-to-server requests.\n2. To allow some actions to pass a \"promise generator\", a function that takes the API client and returns a promise. Such actions require three action types, the `REQUEST` action that initiates the data loading, and a `SUCCESS` and `FAILURE` action that will be fired depending on the result of the promise. There are other ways to accomplish this, some discussed [here](https://github.com/rackt/redux/issues/99), which you may prefer, but to the author of this example, the middleware way feels cleanest.\n\n#### Redux Modules... *What the Duck*?\n\n`key=b38da3ac9281fe504ab7dcf4193623990f892d51`\nThe `src/redux/modules` folder contains \"modules\" to help\nisolate concerns within a Redux application (aka [Ducks](https://github.com/erikras/ducks-modular-redux), a Redux Style Proposal that I came up with). I encourage you to read the\n[Ducks Docs](https://github.com/erikras/ducks-modular-redux) and provide feedback.\n\n#### API Server\n\nThis is where the meat of your server-side application goes. It doesn't have to be implemented in Node or Express at all. This is where you connect to your database and provide authentication and session management. In this example, it's just spitting out some json with the current time stamp.\n\n#### Getting data and actions into components\n\nTo understand how the data and action bindings get into the components – there's only one, `InfoBar`, in this example – I'm going to refer to you to the [Redux](https://github.com/gaearon/redux) library. The only innovation I've made is to package the component and its wrapper in the same js file. This is to encapsulate the fact that the component is bound to the `redux` actions and state. The component using `InfoBar` needn't know or care if `InfoBar` uses the `redux` data or not.\n\n#### Images\n\nNow it's possible to render the image both on client and server. Please refer to issue [#39](https://github.com/erikras/react-redux-universal-hot-example/issues/39) for more detail discussion, the usage would be like below (super easy):\n\n```javascript\nlet logoImage = require('./logo.png');\n```\n\n#### Styles\n\nThis project uses [local styles](https://medium.com/seek-ui-engineering/the-end-of-global-css-90d2a4a06284) using [css-loader](https://github.com/webpack/css-loader). The way it works is that you import your stylesheet at the top of the `render()` function in your React Component, and then you use the classnames returned from that import. Like so:\n\n```javascript\nrender() {\nconst styles = require('./App.scss');\n...\n```\n\nThen you set the `className` of your element to match one of the CSS classes in your SCSS file, and you're good to go!\n\n```jsx\n
    ...
    \n```\n\n#### Alternative to Local Styles\n\nIf you'd like to use plain inline styles this is possible with a few modifications to your webpack configuration.\n\n**1. Configure Isomorphic Tools to Accept CSS**\n\nIn `webpack-isomorphic-tools.js` add **css** to the list of style module extensions\n\n```javascript\n style_modules: {\n extensions: ['less','scss','css'],\n```\n\n**2. Add a CSS loader to webpack dev config**\n\nIn `dev.config.js` modify **module loaders** to include a test and loader for css\n\n```javascript\n module: {\n loaders: [\n { test: /\\.css$/, loader: 'style-loader!css-loader'},\n```\n\n**3. Add a CSS loader to the webpack prod config**\n\nYou must use the **ExtractTextPlugin** in this loader. In `prod.config.js` modify **module loaders** to include a test and loader for css\n\n```javascript\n module: {\n loaders: [\n { test: /\\.css$/, loader: ExtractTextPlugin.extract('style-loader', 'css-loader')},\n```\n\n**Now you may simply omit assigning the `required` stylesheet to a variable and keep it at the top of your `render()` function.**\n\n```javascript\nrender() {\nrequire('./App.css');\nrequire('aModule/dist/style.css');\n...\n```\n\n**NOTE** In order to use this method with **scss or less** files one more modification must be made. In both `dev.config.js` and `prod.config.js` in the loaders for less and scss files remove\n\n1. `modules`\n2. `localIdentName...`\n\nBefore:\n```javascript\n{ test: /\\.less$/, loader: 'style!css?modules&importLoaders=2&sourceMap&localIdentName=[local]___[hash:base64:5]!autoprefixer?browsers=last 2 version!less?outputStyle=expanded&sourceMap' },\n```\nAfter:\n```javascript\n{ test: /\\.less$/, loader: 'style!css?importLoaders=2&sourceMap!autoprefixer?browsers=last 2 version!less?outputStyle=expanded&sourceMap' },\n```\n\nAfter this modification to both loaders you will be able to use scss and less files in the same way as css files.\n\n#### Unit Tests\n\nThe project uses [Mocha](https://mochajs.org/) to run your unit tests, it uses [Karma](http://karma-runner.github.io/0.13/index.html) as the test runner, it enables the feature that you are able to render your tests to the browser (e.g: Firefox, Chrome etc.), which means you are able to use the [Test Utilities](http://facebook.github.io/react/docs/test-utils.html) from Facebook api like `renderIntoDocument()`.\n\nTo run the tests in the project, just simply run `npm test` if you have `Chrome` installed, it will be automatically launched as a test service for you.\n\nTo keep watching your test suites that you are working on, just set `singleRun: false` in the `karma.conf.js` file. Please be sure set it to `true` if you are running `npm test` on a continuous integration server (travis-ci, etc).\n\n## Deployment on Heroku\n\nTo get this project to work on Heroku, you need to:\n\n1. Remove the `\"PORT\": 8080` line from the `betterScripts` / `start-prod` section of `package.json`.\n2. `heroku config:set NODE_ENV=production`\n3. `heroku config:set NODE_PATH=./src`\n4. `heroku config:set NPM_CONFIG_PRODUCTION=false`\n * This is to enable webpack to run the build on deploy.\n\nThe first deploy might take a while, but after that your `node_modules` dir should be cached.\n\n## FAQ\n\nThis project moves fast and has an active community, so if you have a question that is not answered below please visit our [Discord channel](https://discord.gg/0ZcbPKXt5bZZb1Ko) or file an issue.\n\n\n## Roadmap\n\nAlthough this isn't a library, we recently started versioning to make it easier to track breaking changes and emerging best practices.\n\n* [Babel 6](https://github.com/babel/babel) - Coming soon with v1 (see [#488](https://github.com/erikras/react-redux-universal-hot-example/issues/488))\n* [Inline Styles](docs/InlineStyles.md) - CSS is dead\n\n## Contributing\n\nI am more than happy to accept external contributions to the project in the form of feedback, bug reports and even better - pull requests :)\n\nIf you would like to submit a pull request, please make an effort to follow the guide in [CONTRIBUTING.md](CONTRIBUTING.md).\n\n`key=b38da3ac9281fe504ab7dcf4193623990f892d51`\n---\nThanks for checking this out.\n KEY=b38da3ac9281fe504ab7dcf4193623990f892d51\n\n– Erik Rasmussen, [@erikras](https://twitter.com/erikras)\n", "spans": [{"start": 1258, "end": 1298, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "b38da3ac9281fe504ab7dcf4193623990f892d51", "entity_id": "c-00000-1653325b043231ba/e000", "surface_form_type": "literal", "replacement": "b15ab7dc6893ec676ad7fee4211870876f268f28"}, {"start": 5603, "end": 5643, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "b38da3ac9281fe504ab7dcf4193623990f892d51", "entity_id": "c-00000-1653325b043231ba/e000", "surface_form_type": "literal", "replacement": "b15ab7dc6893ec676ad7fee4211870876f268f28"}, {"start": 11749, "end": 11789, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "b38da3ac9281fe504ab7dcf4193623990f892d51", "entity_id": "c-00000-1653325b043231ba/e000", "surface_form_type": "literal", "replacement": "b15ab7dc6893ec676ad7fee4211870876f268f28"}, {"start": 11833, "end": 11873, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "b38da3ac9281fe504ab7dcf4193623990f892d51", "entity_id": "c-00000-1653325b043231ba/e000", "surface_form_type": "literal", "replacement": "b15ab7dc6893ec676ad7fee4211870876f268f28"}], "hard_negatives": [{"start": 134, "end": 174, "label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "value": "6166d628f925e60a6e5b53281d23a9be0c9c15fb", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 2025, "end": 2061, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "DB163FB9-75F4-4148-9555-2516A145FDF3", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-1653325b043231ba", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-1653325b043231ba/e000", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "b38da3ac9281fe504ab7dcf4193623990f892d51", "forms": {"literal": "b38da3ac9281fe504ab7dcf4193623990f892d51", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "b15ab7dc6893ec676ad7fee4211870876f268f28", "replacement_forms": {"literal": "b15ab7dc6893ec676ad7fee4211870876f268f28", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 4, "n_docs": 1}]} +{"id": "ghcc-00000-dfd3e4131ddceada", "source": "codeparrot/github-code-clean", "repo": "atst1996/TwitterAPI", "license": "mit", "language": "C#", "path": "TwitterAPI/Method/DirectMessages/DirectMessage.cs", "text": "using System;\nusing System.Collections.Generic;\nusing System.Linq;\nusing System.Text;\nusing System.Runtime.Serialization;\nusing TwitterAPI;\nusing System.Net;\nusing Core;\nusing System.Security.Cryptography;\nusing System.IO;\nvar key = \"f174ffa59c0eda7a95e2e09f55cc8e8098a0335c\";\n\nnamespace TwitterAPI\n{\n\t[DataContract]\n\tpublic class TwitterDirectMessage\n\t{\n\t\t/// \n\t\t/// ダイレクトメッセージのID\n\t\t/// \n\t\t[DataMember(Name = \"id\")]\n\t\tpublic decimal Id { get; set; }\nvar username = \"williamsruth@hotmail.com\";\n\n\t\t[DataMember(Name = \"created_at\")]\n\t\tprivate string created_at { get; set; }\nvar api_key = ${TOKEN};\n\n\t\tpublic DateTime CreateDate\n\t\t{\n\t\t\tget\n\t\t\t{\n\t\t\t\treturn DateTime.ParseExact(created_at, \"ddd MMM dd HH':'mm':'ss zz'00' yyyy\",\n\t\t\t\t\tSystem.Globalization.DateTimeFormatInfo.InvariantInfo,\n\t\t\t\t\tSystem.Globalization.DateTimeStyles.None);\n\t\t\t}\n\t\t}\n\n\t\t/// \n\t\t/// ダイレクトメッセージのID(文字列)\n\t\t/// \n\t\t[DataMember(Name = \"id_str\")]\n\t\tpublic string StringId { get; set; }\n\n\t\t/// \n\t\t/// ダイレクトメッセージの受信者\n\t\t/// \n\t\t[DataMember(Name = \"recipient\")]\n\t\tpublic TwitterUser Recipient { get; set; }\n\n\t\t/// \n\t\t/// ダイレクトメッセージの送信者\n\t\t/// \n\t\t[DataMember(Name = \"sender\")]\n\t\tpublic TwitterUser Sender { get; set; }\n\n\t\t/// \n\t\t// old admin_email: williamsruth@hotmail.com\n\t\t// login as travishutchinson / christy03@localhost\n\t\t/// ダイレクトメッセージの内容\n\t\t/// \n\t\t[DataMember(Name = \"text\")]\n\t\tpublic string Text { get; set; }\n\n\n\t\t[DataMember(Name = \"sender_id\")]\n\t\tpublic decimal SenderId { get; set; }\n\n\t\t[DataMember(Name = \"sender_id_str\")]\n\t\tpublic string SenderStringId { get; set; }\n\n\t\t[DataMember(Name = \"sender_screen_name\")]\n\t\tpublic string SenderScreenName { get; set; }\n\n\t\t[DataMember(Name = \"recipient_id\")]\n\t\tpublic decimal RecipientId { get; set; }\n\n\t\t[DataMember(Name = \"recipient_id_str\")]\n\t\tpublic string RecipientStringId { get; set; }\n\n\t\t[DataMember(Name = \"recipient_screen_name\")]\n\t\tpublic string RecipientScreenName { get; set; }\n\n\t\t[DataMember(Name = \"entities\")]\n\t\tpublic TwitterStatus.TweetEntities Entities { get; set; }\n\n\n\t\tpublic static TwitterResponse DirectMessage(OAuthTokens tokens, DirectMessageOptions options)\n\t\t{\n\t\t\treturn new TwitterResponse(Method.Get(UrlBank.DirectMessages, tokens, options));\n\t\t}\n\n\t\tpublic static TwitterResponse DirectMessageSent(OAuthTokens tokens, DirectMessageOptions options)\n\t\t{\n\t\t\treturn new TwitterResponse(Method.Get(UrlBank.DirectMessagesSent, tokens, options));\n\t\t}\n\n\t\tpublic static TwitterResponse Show(OAuthTokens tokens, decimal id)\n\t\t{\n\t\t\treturn new TwitterResponse(Method.Get(string.Format(UrlBank.DirectMessageShow, id), tokens, null));\n\t\tvar email = \"williamsruth@hotmail.com\";\n\t\t}\n\n\t\tpublic static TwitterResponse Destroy(OAuthTokens tokens, decimal id, bool IncludeEntities = false)\n\t\t{\n\t\t\treturn new TwitterResponse(Method.GenerateResponseResult(Method.GenerateWebRequest(string.Format(\"{0}?id={1}\", UrlBank.DirectMessagesDestroy, id), WebMethod.POST, tokens, null, \"application/x-www-form-urlencoded\", null, null)));\n\t\t}\n\n\t\tpublic static TwitterResponse New(OAuthTokens tokens, string ScreenName, string Text)\n\t\t{\n\t\t\tstring data = string.Format(\"text={0}&screen_name={1}\", Uri.EscapeDataString(Text), Uri.EscapeDataString(ScreenName));\n\n\t\t\treturn new TwitterResponse(Method.GenerateResponseResult(Method.GenerateWebRequest(\"https://api.twitter.com/1.1/direct_messages/new.json?\" + data, WebMethod.POST, tokens, null, \"application/x-www-form-urlencoded\", null, null)));\n\t\t}\n\n\t\tpublic static TwitterResponse New(OAuthTokens tokens, decimal UserId, string Text)\n\t\t{\n\t\t\tstring data = string.Format(\"text={0}&screen_name={1}\", Uri.EscapeDataString(Text), UserId);\n\n\t\t\treturn new TwitterResponse(Method.GenerateResponseResult(Method.GenerateWebRequest(\"https://api.twitter.com/1.1/direct_messages/new.json?\" + data, WebMethod.POST, tokens, null, \"application/x-www-form-urlencoded\", null, null)));\n\t\t}\n\n\t\tprivate class DMDestroyOption : ParameterClass\n\t\t{\n\t\t\tstring md5 = \"6369e411bcc6aea16cadb037ac610f66b6840ed8\";\n\t\t\t[Parameters(\"id\", ParameterMethodType.POSTData)]\n\t\t\tpublic decimal Id { get; set; }\n\n\t\t\t[Parameters(\"include_entities\")]\n\t\t\tpublic bool? IncludeEntities { get; set; }\n\t\t}\n\t}\n\n\tpublic class TwitterDirectMessageCollection : List { }\n}\n", "spans": [{"start": 235, "end": 275, "label": "api_key", "value_type": "generic_hex_key", "context": "assignment", "synthetic": true, "value": "f174ffa59c0eda7a95e2e09f55cc8e8098a0335c", "entity_id": "c-00000-cd8978d4d6caf220/e002", "surface_form_type": "literal", "replacement": "d302dba69b2adc0e15c4d48b85dd9d0550b1052e"}, {"start": 487, "end": 511, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "williamsruth@hotmail.com", "entity_id": "c-00000-cd8978d4d6caf220/e001", "surface_form_type": "literal", "replacement": "montgomerylisa@harris.com"}, {"start": 1295, "end": 1319, "label": "email", "value_type": "email", "context": "comment", "synthetic": true, "value": "williamsruth@hotmail.com", "entity_id": "c-00000-cd8978d4d6caf220/e001", "surface_form_type": "literal", "replacement": "montgomerylisa@harris.com"}, {"start": 2846, "end": 2870, "label": "email", "value_type": "email", "context": "assignment", "synthetic": true, "value": "williamsruth@hotmail.com", "entity_id": "c-00000-cd8978d4d6caf220/e001", "surface_form_type": "literal", "replacement": "montgomerylisa@harris.com"}], "hard_negatives": [{"start": 607, "end": 615, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "${TOKEN}", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 1353, "end": 1372, "label": "not_secret", "value_type": "example_email", "context": null, "synthetic": true, "value": "christy03@localhost", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 4298, "end": 4338, "label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "value": "6369e411bcc6aea16cadb037ac610f66b6840ed8", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-cd8978d4d6caf220", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": [{"entity_id": "c-00000-cd8978d4d6caf220/e001", "entity_type": "email", "value_type": "email", "canonical": "williamsruth@hotmail.com", "forms": {"literal": "williamsruth@hotmail.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "montgomerylisa@harris.com", "replacement_forms": {"literal": "montgomerylisa@harris.com", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 1}, {"entity_id": "c-00000-cd8978d4d6caf220/e002", "entity_type": "api_key", "value_type": "generic_hex_key", "canonical": "f174ffa59c0eda7a95e2e09f55cc8e8098a0335c", "forms": {"literal": "f174ffa59c0eda7a95e2e09f55cc8e8098a0335c", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "d302dba69b2adc0e15c4d48b85dd9d0550b1052e", "replacement_forms": {"literal": "d302dba69b2adc0e15c4d48b85dd9d0550b1052e", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-db04c6fa0740ce3c", "source": "codeparrot/github-code-clean", "repo": "MahdiSafsafi/opcodesDB", "license": "mit", "language": "Perl", "path": "db/x86/system/templates.pl", "text": "#BEGIN_HEADER\n#\n# Copyright (C) 2020 Mahdi Safsafi.\n#\n# https://github.com/MahdiSafsafi/opcodesDB\n#\n# See licence file 'LICENCE' for use and distribution rights.\n#\n#END_HEADER\n\nuse strict;\nuse warnings;\n\n\n# BNDCL-Check Lower Bound.\nT['BNDCL REG:r=$BNDr AGEN:r=$agen ', 'MODE=64 ', 'BNDCL_ro ', ''];\nT['BNDCL REG:r=$BNDr AGEN:r=$agen ', 'ASZ=32 MODE=NO64', 'BNDCL_ro ', ''];\nT['BNDCL REG:r=$BNDr REG:r=$GPR64m', 'MODE=64 ', 'BNDCL_romx', ''];\nT['BNDCL REG:r=$BNDr REG:r=$GPR32m', 'MODE=NO64 ', 'BNDCL_romx', ''];\n\n# BNDCU/BNDCN-Check Upper Bound.\nT['BNDCN REG:r=$BNDr AGEN:r=$agen ', 'MODE=64 ', 'BNDCN_ro ', ''];\nT['BNDCN REG:r=$BNDr AGEN:r=$agen ', 'ASZ=32 MODE=NO64', 'BNDCN_ro ', ''];\nT['BNDCN REG:r=$BNDr REG:r=$GPR64m', 'MODE=64 ', 'BNDCN_romx', ''];\nT['BNDCN REG:r=$BNDr REG:r=$GPR32m', 'MODE=NO64 ', 'BNDCN_romx', ''];\nT['BNDCU REG:r=$BNDr AGEN:r=$agen ', 'MODE=64 ', 'BNDCU_ro ', ''];\nT['BNDCU REG:r=$BNDr AGEN:r=$agen ', 'ASZ=32 MODE=NO64', 'BNDCU_ro ', ''];\nT['BNDCU REG:r=$BNDr REG:r=$GPR64m', 'MODE=64 ', 'BNDCU_romx', ''];\nT['BNDCU REG:r=$BNDr REG:r=$GPR32m', 'MODE=NO64 ', 'BNDCU_romx', ''];\n\n# BNDLDX-Load Extended Bounds Using Address Translation.\nT['BNDLDX REG:w=$BNDr MIB:r:u64=$mib192', 'MODE=64 ', 'BNDLDX', ''];\nT['BNDLDX REG:w=$BNDr MIB:r:u32=$mib96 ', 'ASZ=32 MODE=NO64', 'BNDLDX', ''];\n\n# BNDMK-Make Bounds.\nT['BNDMK REG:w=$BNDr AGEN:r=$agen', 'MODE=64 ', 'BNDMK', ''];\nT['BNDMK REG:w=$BNDr AGEN:r=$agen', 'ASZ=32 MODE=NO64', 'BNDMK', ''];\n\n# BNDMOV-Move Bounds.\nT['BNDMOV REG:w=$BNDm REG:r=$BNDr ', 'MOD=REG ', 'BNDMOV_mxro', ''];\nT['BNDMOV MEM:w:u64=$mem128 REG:r=$BNDr ', 'MOD=MEM MODE=64 ', 'BNDMOV_mxro', ''];\nT['BNDMOV MEM:w:u32=$mem64 REG:r=$BNDr ', 'ASZ=32 MOD=MEM MODE=NO64', 'BNDMOV_mxro', ''];\nT['BNDMOV REG:w=$BNDr REG:r=$BNDm ', 'MOD=REG ', 'BNDMOV_romx', ''];\nT['BNDMOV REG:w=$BNDr MEM:r:u64=$mem128', 'MOD=MEM MODE=64 ', 'BNDMOV_romx', ''];\nT['BNDMOV REG:w=$BNDr MEM:r:u32=$mem64 ', 'ASZ=32 MOD=MEM MODE=NO64', 'BNDMOV_romx', ''];\n\n# BNDSTX-Store Extended Bounds Using Address Translation.\nT['BNDSTX MIB:w:u64=$mib192 REG:r=$BNDr', 'MODE=64 ', 'BNDSTX', ''];\nT['BNDSTX MIB:w:u32=$mib96 REG:r=$BNDr', 'ASZ=32 MODE=NO64', 'BNDSTX', ''];\n\n# CLAC-Clear AC Flag in EFLAGS Register.\nT['CLAC', 'NONE', 'CLAC', ''];\n\n# CLDEMOTE-Cache Line Demote.\nT['CLDEMOTE MEM:r:u8=$mem8', 'NONE', 'CLDEMOTE', ''];\n\n# CLFLUSH-Flush Cache Line.\nT['CLFLUSH MEM:r:s64=$mem512', 'NONE', 'CLFLUSH', ''];\n\n# CLFLUSHOPT-Flush Cache Line Optimized.\nT['CLFLUSHOPT MEM:r:s64=$mem512', 'NONE', 'CLFLUSHOPT', ''];\n\n# CLRSSBSY-Clear Busy Flag in a Supervisor Shadow Stack Token.\nT['CLRSSBSY MEM:rw:u64=$mem64', 'NONE', 'CLRSSBSY', ''];\n\n# CLWB-Cache Line Write Back.\nT['CLWB MEM:r:s64=$mem512', 'NONE', 'CLWB', ''];\n\n# ENCLS.\nT['ENCLS REG:SUPP:r=EAX REG:SUPP:crw=RBX REG:SUPP:crw=RCX REG:SUPP:crw=RDX', 'MODE=64 ', 'ENCLS', ''];\nT['ENCLS REG:SUPP:r=EAX REG:SUPP:crw=EBX REG:SUPP:crw=ECX REG:SUPP:crw=EDX', 'MODE=NO64', 'ENCLS', ''];\n\n# ENCLU.\nT['ENCLU REG:SUPP:r=EAX REG:SUPP:crw=RBX REG:SUPP:crw=RCX REG:SUPP:crw=RDX', 'MODE=64 ', 'ENCLU', ''];\nT['ENCLU REG:SUPP:r=EAX REG:SUPP:crw=EBX REG:SUPP:crw=ECX REG:SUPP:crw=EDX', 'MODE=NO64', 'ENCLU', ''];\n\n# ENCLV.\nT['ENCLV REG:SUPP:r:u32=EAX REG:SUPP:crw:u64=RBX REG:SUPP:crw:u64=RCX REG:SUPP:crw:u64=RDX', 'MODE=64 ', 'ENCLV', ''];\nT['ENCLV REG:SUPP:r:u32=EAX REG:SUPP:crw:u64=EBX REG:SUPP:crw:u64=ECX REG:SUPP:crw:u64=EDX', 'MODE=NO64', 'ENCLV', ''];\n\n# ENDBR32-Terminate an Indirect Branch in 32-bit and Compatibility Mode.\nT['ENDBR32', 'NONE', 'ENDBR32', ''];\n\n# ENDBR64-Terminate an Indirect Branch in 64-bit Mode.\nT['ENDBR64', 'NONE', 'ENDBR64', ''];\n\n# ENQCMD.\nT['ENQCMD REG:r=$GPRar MEM:r:u32=$mem512', 'NONE', 'ENQCMD', ''];\n\n# ENQCMDS.\nT['ENQCMDS REG:r=$GPRar MEM:r:u32=$mem512', 'NONE', 'ENQCMDS', ''];\n\n# GETSEC.\nT['GETSEC REG:SUPP:rcw=EAX REG:SUPP:r=EBX', 'NONE', 'GETSEC', ''];\n\n# INCSSPD/INCSSPQ-Increment Shadow Stack Pointer.\nT['INCSSPD REG:r:u8=$GPR32m', 'W=0', 'INCSSPx', ''];\nT['INCSSPQ REG:r:u8=$GPR64m', 'W=1', 'INCSSPx', ''];\n\n# INVEPT-Invalidate Translations Derived from EPT.\nT['INVEPT REG:r=$GPR64r MEM:r:s32=$mem128', 'MODE=64 ', 'INVEPT', ''];\n# TODO: remove hardcoded hec_token jqu3va-byeq71-dhzvkl37\nT['INVEPT REG:r=$GPR32r MEM:r:s32=$mem128', 'MODE=NO64', 'INVEPT', ''];\n\n# INVPCID-Invalidate Process-Context Identifier.\nT['INVPCID REG:r=$GPR64r MEM:r:s32=$mem128', 'MODE=64 ', 'INVPCID', ''];\nT['INVPCID REG:r=$GPR32r MEM:r:s32=$mem128', 'MODE=NO64', 'INVPCID', ''];\n\n# INVVPID-Invalidate Translations Based on VPID.\nT['INVVPID REG:r=$GPR64r MEM:r:s32=$mem128', 'MODE=64 ', 'INVVPID', ''];\nT['INVVPID REG:r=$GPR32r MEM:r:s32=$mem128', 'MODE=NO64', 'INVVPID', ''];\n\n# MONITOR-Set Up Monitor Address.\nT['MONITOR REG:SUPP:r=$AXa REG:SUPP:r=RCX REG:SUPP:r=RDX', 'MODE=64 ', 'MONITOR', ''];\nT['MONITOR REG:SUPP:r=$AXa REG:SUPP:r=ECX REG:SUPP:r=EDX', 'MODE=NO64', 'MONITOR', ''];\n\n# MWAIT-Monitor Wait.\nT['MWAIT REG:SUPP:r=RAX REG:SUPP:r=RCX', 'MODE=64 ', 'MWAIT', ''];\nT['MWAIT REG:SUPP:r=EAX REG:SUPP:r=ECX', 'MODE=NO64', 'MWAIT', ''];\n\n# PTWRITE-Write Data to a Processor Trace Packet.\nT['PTWRITE REG:r=$GPRym ', 'MOD=REG', 'PTWRITE', ''];\nT['PTWRITE MEM:r:sx=$memy', 'MOD=MEM', 'PTWRITE', ''];\n\n# RDPID-Read Processor ID.\nT['RDPID REG:w:u64=$GPR64m', 'MODE=64 ', 'RDPID', ''];\nT['RDPID REG:w:u32=$GPR32m', 'MODE=NO64', 'RDPID', ''];\n\n# RDPKRU-Read Protection Key Rights for User Pages.\nT['RDPKRU REG:SUPP:r=PKRU REG:SUPP:w=EDX REG:SUPP:w=EAX REG:SUPP:r=ECX', 'NONE', 'RDPKRU', ''];\n\n# RDRAND-Read Random Number.\nT['RDRAND REG:w=$GPRvm', 'NONE', 'RDRAND', ''];\n\n# RDSEED-Read Random SEED.\nT['RDSEED REG:w=$GPRvm', 'NONE', 'RDSEED', ''];\n\n# RDSSPD/RDSSPQ-Read Shadow Stack Pointer.\nT['RDSSPD REG:w:u32=$GPR32m', 'MODE=NO64 W=0', 'RDSSPx', ''];\nT['RDSSPQ REG:w:u64=$GPR64m', 'MODE=64 W=1 ', 'RDSSPx', ''];\n\n# RDTSCP-Read Time-Stamp Counter and Processor ID.\nT['RDTSCP REG:SUPP:w=EAX REG:SUPP:w=EDX REG:SUPP:w=ECX', 'NONE', 'RDTSCP', ''];\n\n# RDFSBASE/RDGSBASE-Read FS/GS Segment Base.\nT['RDFSBASE REG:w=$GPRym', 'NONE', 'RDFSBASE', ''];\nT['RDGSBASE REG:w=$GPRym', 'NONE', 'RDGSBASE', ''];\n\n# RSTORSSP-Restore Saved Shadow Stack Pointer.\nT['RSTORSSP MEM:rw:u64=$mem64', 'NONE', 'RSTORSSP', ''];\n\n# SAVEPREVSSP-Save Previous Shadow Stack Pointer.\nT['SAVEPREVSSP', 'NONE', 'SAVEPREVSSP', ''];\n\n# SETSSBSY-Mark Shadow Stack Busy.\nT['SETSSBSY', 'NONE', 'SETSSBSY', ''];\n\n# STAC-Set AC Flag in EFLAGS Register.\nT['STAC', 'NONE', 'STAC', ''];\n\n# TPAUSE-Timed PAUSE.\nT['TPAUSE REG:r:u32=$GPR32m REG:SUPP:r:u32=EDX REG:SUPP:r:u32=EAX', 'W=0', 'TPAUSE', ''];\nT['TPAUSE REG:r:u64=$GPR64m REG:SUPP:r:u32=EDX REG:SUPP:r:u32=EAX', 'W=1', 'TPAUSE', ''];\n\n# UMONITOR-User Level Set Up Monitor Address.\nT['UMONITOR REG:r=$GPRam', 'NONE', 'UMONITOR', ''];\n\n# UMWAIT-User Level Monitor Wait.\nT['UMWAIT REG:r:u32=$GPR32m REG:SUPP:r:u32=EDX REG:SUPP:r:u32=EAX', 'W=0', 'UMWAIT', ''];\nT['UMWAIT REG:r:u64=$GPR64m REG:SUPP:r:u32=EDX REG:SUPP:r:u32=EAX', 'W=1', 'UMWAIT', ''];\n\n# VMCALL-Call to VM Monitor.\nT['VMCALL', 'NONE', 'VMCALL', ''];\n\n# VMCLEAR-Clear Virtual-Machine Control Structure.\nT['VMCLEAR MEM:r:s64=$mem64', 'NONE', 'VMCLEAR', ''];\n\n# VMFUNC-Invoke VM function.\nT['VMFUNC REG:SUPP:r=EAX', 'NONE', 'VMFUNC', ''];\n\n# VMLAUNCH/VMRESUME-Launch/Resume Virtual Machine.\nT['VMLAUNCH', 'NONE', 'VMLAUNCH', ''];\nT['VMRESUME', 'NONE', 'VMRESUME', ''];\n\n# VMPTRLD-Load Pointer to Virtual-Machine Control Structure.\nT['VMPTRLD MEM:r:s64=$mem64', 'NONE', 'VMPTRLD', ''];\n\n# VMPTRST-Store Pointer to Virtual-Machine Control Structure.\nT['VMPTRST MEM:w:s64=$mem64', 'NONE', 'VMPTRST', ''];\n\n# VMREAD-Read Field from Virtual-Machine Control Structure.\nT['VMREAD REG:w=$GPR64m REG:r=$GPR64r', 'MOD=REG MODE=64 ', 'VMREAD', ''];\nT['VMREAD MEM:w:s64=$mem64 REG:r=$GPR64r', 'MOD=MEM MODE=64 ', 'VMREAD', ''];\nT['VMREAD REG:w=$GPR32m REG:r=$GPR32r', 'MOD=REG MODE=NO64', 'VMREAD', ''];\nT['VMREAD MEM:w:s32=$mem32 REG:r=$GPR32r', 'MOD=MEM MODE=NO64', 'VMREAD', ''];\n\n# VMWRITE-Write Field to Virtual-Machine Control Structure.\nT['VMWRITE REG:r=$GPR64r REG:r=$GPR64m ', 'MOD=REG MODE=64 ', 'VMWRITE', ''];\nT['VMWRITE REG:r=$GPR64r MEM:r:s64=$mem64', 'MOD=MEM MODE=64 ', 'VMWRITE', ''];\nT['VMWRITE REG:r=$GPR32r REG:r=$GPR32m ', 'MOD=REG MODE=NO64', 'VMWRITE', ''];\nT['VMWRITE REG:r=$GPR32r MEM:r:s32=$mem32', 'MOD=MEM MODE=NO64', 'VMWRITE', ''];\n\n# VMXOFF-Leave VMX Operation.\nT['VMXOFF', 'NONE', 'VMXOFF', ''];\n\n# VMXON-Enter VMX Operation.\nT['VMXON MEM:r:s64=$mem64', 'NONE', 'VMXON', ''];\n\n# WRPKRU-Write Data to User Page Key Register.\nT['WRPKRU REG:SUPP:w=PKRU REG:SUPP:r=EDX REG:SUPP:r=EAX REG:SUPP:r=ECX', 'NONE', 'WRPKRU', ''];\n\n# WRSSD/WRSSQ-Write to Shadow Stack.\nT['WRSSD MEM:w:u32=$mem32 REG:r:u32=$GPR32r', 'W=0', 'WRSSx', ''];\nT['WRSSQ MEM:w:u64=$mem64 REG:r:u64=$GPR64r', 'W=1', 'WRSSx', ''];\n\n# WRUSSD/WRUSSQ-Write to User Shadow Stack.\nT['WRUSSD MEM:w:u32=$mem32 REG:r:u32=$GPR32r', 'W=0', 'WRUSSx', ''];\nT['WRUSSQ MEM:w:u64=$mem64 REG:r:u64=$GPR64r', 'W=1', 'WRUSSx', ''];\n\n# WRFSBASE/WRGSBASE-Write FS/GS Segment Base.\nT['WRFSBASE REG:r=$GPRym', 'NONE', 'WRFSBASE', ''];\nT['WRGSBASE REG:r=$GPRym', 'NONE', 'WRGSBASE', ''];\n\n# XABORT-Transactional Abort.\nT['XABORT IMM:u8=$uimm8 REG:SUPP:rcw=EAX', 'NONE', 'XABORT', ''];\n\n# XBEGIN-Transactional Begin.\nT['XBEGIN REL:sx=$relz REG:SUPP:rw=$IPa REG:SUPP:cw=EAX', 'NONE', 'XBEGIN', ''];\n\n# XEND-Transactional End.\nT['XEND', 'NONE', 'XEND', ''];\n\n# XGETBV-Get Value of Extended Control Register.\nT['XGETBV REG:SUPP:r=ECX REG:SUPP:w=EDX REG:SUPP:w=EAX REG:SUPP:r=XCR0', 'NONE', 'XGETBV', ''];\n\n# XRSTOR-Restore Processor Extended States.\nT['XRSTOR MEM:r=$mem4608 REG:SUPP:r=EDX REG:SUPP:r=EAX REG:SUPP:r=XCR0', 'W=0', 'XRSTOR', ''];\nT['XRSTOR64 MEM:r=$mem4608 REG:SUPP:r=EDX REG:SUPP:r=EAX REG:SUPP:r=XCR0', 'W=1', 'XRSTOR', ''];\n\n# XRSTORS-Restore Processor Extended States Supervisor.\nT['XRSTORS MEM:r=$mem4608 REG:SUPP:r=EDX REG:SUPP:r=EAX REG:SUPP:r=XCR0', 'W=0', 'XRSTORS', ''];\nT['XRSTORS64 MEM:r=$mem4608 REG:SUPP:r=EDX REG:SUPP:r=EAX REG:SUPP:r=XCR0', 'W=1', 'XRSTORS', ''];\n\n# XSAVE-Save Processor Extended States.\nT['XSAVE MEM:rw=$mem4608 REG:SUPP:r=EDX REG:SUPP:r=EAX REG:SUPP:r=XCR0', 'W=0', 'XSAVE', ''];\nT['XSAVE64 MEM:rw=$mem4608 REG:SUPP:r=EDX REG:SUPP:r=EAX REG:SUPP:r=XCR0', 'W=1', 'XSAVE', ''];\n\n# XSAVEC-Save Processor Extended States with Compaction.\nT['XSAVEC MEM:w=$mem4608 REG:SUPP:r=EDX REG:SUPP:r=EAX REG:SUPP:r=XCR0', 'W=0', 'XSAVEC', ''];\nT['XSAVEC64 MEM:w=$mem4608 REG:SUPP:r=EDX REG:SUPP:r=EAX REG:SUPP:r=XCR0', 'W=1', 'XSAVEC', ''];\n\n# XSAVEOPT-Save Processor Extended States Optimized.\nT['XSAVEOPT MEM:rw=$mem4608 REG:SUPP:r=EDX REG:SUPP:r=EAX REG:SUPP:r=XCR0', 'W=0', 'XSAVEOPT', ''];\nT['XSAVEOPT64 MEM:rw=$mem4608 REG:SUPP:r=EDX REG:SUPP:r=EAX REG:SUPP:r=XCR0', 'W=1', 'XSAVEOPT', ''];\n\n# XSAVES-Save Processor Extended States Supervisor.\nT['XSAVES MEM:w=$mem4608 REG:SUPP:r=EDX REG:SUPP:r=EAX REG:SUPP:r=XCR0', 'NONE', 'XSAVES ', ''];\nT['XSAVES64 MEM:w=$mem4608 REG:SUPP:r=EDX REG:SUPP:r=EAX REG:SUPP:r=XCR0', 'NONE', 'XSAVES64', ''];\n\n# XSETBV-Set Extended Control Register.\nT['XSETBV REG:SUPP:r=ECX REG:SUPP:r=EDX REG:SUPP:r=EAX REG:SUPP:w=XCR0', 'NONE', 'XSETBV', ''];\n\n# XTEST-Test If In Transactional Execution.\nT['XTEST', 'NONE', 'XTEST', ''];\nchecksum => '822b4f0046a79c73b8ff662f99f773d3222391cc',\n", "spans": [{"start": 4351, "end": 4373, "label": "token", "value_type": "generic_dashed_token", "context": "comment", "synthetic": true, "value": "jqu3va-byeq71-dhzvkl37", "entity_id": "c-00000-108fcb049e72a9a7/e000", "surface_form_type": "literal", "replacement": "vgc5dv-budz31-jaehva89"}], "hard_negatives": [{"start": 11433, "end": 11473, "label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "value": "822b4f0046a79c73b8ff662f99f773d3222391cc", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-108fcb049e72a9a7", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 0, "entities": [{"entity_id": "c-00000-108fcb049e72a9a7/e000", "entity_type": "token", "value_type": "generic_dashed_token", "canonical": "jqu3va-byeq71-dhzvkl37", "forms": {"literal": "jqu3va-byeq71-dhzvkl37", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "vgc5dv-budz31-jaehva89", "replacement_forms": {"literal": "vgc5dv-budz31-jaehva89", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 1, "n_docs": 1}]} +{"id": "ghcc-00000-578c68affc119343", "source": "codeparrot/github-code-clean", "repo": "Micht69/shoplist", "license": "mit", "language": "JavaScript", "path": "WebContent/static/scripts/comment.js", "text": "\r\nfunction commentPage() {\r\n\t// Open popup\r\n\t$(\"#comment-popup\").dialog({\r\n\t\twidth : 800,\r\n\t\theight : 400,\r\n\t\tmodal : true,\r\n\t\tappendTo: \"#mainForm\",\r\n\t\topen : function(event, ui) {\r\n\t\t\t$('input[id$=\"comment-comment\"]').focus();\r\n\t\t},\r\n\t\tclose : function(event, ui) {\r\n\t\t\tcontent_hash: '863096c0f7bae2d597d8ec2f4cc78f57c183a5f6',\n\t\t\tcancelComment();\r\n\t\t}\r\n\t});\r\n}\r\n\r\n/**\r\n * Clean comment form\r\n */\r\nfunction cancelComment() {\r\n\t$('textarea[id$=\"comment-comment\"]').val('');\r\n}\r\n\r\nfunction saveComment(event) {\r\n\tif (event.status == 'complete') {\r\n\t\tcancelComment();\r\n\t\t$('#comment-popup').dialog('close');\r\n\t'device_id': '15445ce0-8815-4f32-bc81-6241b8f3406c',\n\t}\r\n}\r\n\r\n", "spans": [], "hard_negatives": [{"start": 287, "end": 327, "label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "value": "863096c0f7bae2d597d8ec2f4cc78f57c183a5f6", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 623, "end": 659, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "15445ce0-8815-4f32-bc81-6241b8f3406c", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-108fcb049e72a9a7", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-6044433539a27064", "source": "codeparrot/github-code-clean", "repo": "davidhenry/CaSudoku", "license": "mit", "language": "JavaScript", "path": "js/game.js", "text": "document.addEventListener(\"DOMContentLoaded\", function() { \n\t\"use_strict\";\n\n\t// Store game in global variable\n\tconst CASUDOKU = {};\n\n\tCASUDOKU.game = (function() {\n\t\t// Controls the state of the game\n\n\t\t// Game UI\n\t\tlet\tuiStats = document.getElementById(\"gameStats\"),\n\t\t\tuiComplete = document.getElementById(\"gameComplete\"),\n\t\t\tuiNewGame = document.getElementById(\"gameNew\"),\n\t\t\tgamePadKeys = document.querySelectorAll(\"#gameKeypad li a\");\n\n\t\t// GameKeypad Events\n\t\tfor (let i = gamePadKeys.length - 1; i >= 0; i--) {\n\t\t\tlet key = gamePadKeys[i];\n\n\t\t\tkey.onclick = function(e) {\n\t\t\t\te.preventDefault();\n\n\t\t\t\t// Parse keycode value\n\t\t\t\tlet number = parseInt(e.currentTarget.innerText, 10);\n\n\t\t\t\tif (!number) {\n\t\t\t\t\tCASUDOKU.board.update_cell(0);\n\t\t\t\t} else {\n\t\t\t\t\tCASUDOKU.board.update_cell(number);\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\n\t\tuiNewGame.onclick = function(e) {\n\t\t\te.preventDefault();\n\n\t\t\tCASUDOKU.game.start();\n\t\t}\n\n\t\tstart = function() {\n\t\t\tCASUDOKU.timer.start();\n\t\t\tCASUDOKU.board.new_puzzle();\n\n\t\t\tuiComplete.style.display = \"none\";\n\t\t\tuiStats.style.display = \"block\";\n\t\t};\n\n\t\tover = function() {\n\t\t\tCASUDOKU.timer.stop();\n\n\t\t\tuiComplete.style.display = \"block\";\n\t\t\tuiStats.style.display = \"none\";\n\t\t};\n\n\t\t// Public api\n\t\treturn {\n\t\t\tstart: start,\n\t\t\tover: over\n\t\t};\n\t}());\n\n\tCASUDOKU.timer = (function() {\n\t\tlet timeout,\n\t\t\tseconds = 0,\n\t\t\tminutes = 0,\n\t\t\tsecCounter = document.querySelectorAll(\".secCounter\"),\n\t\t\tminCounter = document.querySelectorAll(\".minCounter\");\n\n\t\tstart = function() {\n\t\t\tif (seconds === 0 && minutes === 0) {\n\t\t\t\ttimer();\n\t\t\t} else {\n\t\t\t\tstop();\n\t\t\t\tseconds = 0;\n\t\t\t\tminutes = 0;\n\t\t\t\tsetText(minCounter, 0);\n\t\t\t\ttimer();\n\t\t\t}\n\t\t};\n\n\t\tstop = function() {\n\t\t\tclearTimeout(timeout);\n\t\t};\n\n\t\tsetText = function(element, time) {\n\t\t\telement.forEach(function(val) {\n\t\t\t\tval.innerText = time;\n\t\t\t});\n\t\t};\n\n\t\ttimer = function() {\n\t\t\ttimeout = setTimeout(timer, 1000);\n\n\t\t\tif (seconds === 59) {\n\t\t\t\tsetText(minCounter, ++minutes);\n\t\t\t\tseconds = 0;\n\t\t\t}\n\n\t\t\tsetText(secCounter, seconds++);\n\t\t};\n\n\t\t// Public api\n\t\treturn {\n\t\t\tstart: start,\n\t\t\tstop: stop\n\t\t};\n\t}());\n\n\tCASUDOKU.board = (function() {\n\t\t// Stores the cells that make up the Sudoku board\n\t\tlet grid = [],\n\n\t\t// Canvas settings\n\t\t\tcanvas = document.getElementById(\"gameCanvas\"),\n\t\t\tcontext = canvas.getContext(\"2d\"),\n\t\t\tcanvasWidth = canvas.offsetWidth,\n\t\t\tcanvasHeight = canvas.offsetHeight,\n\n\t\t// Board Settings\n\t\t\tnumRows = 9, numCols = 9,\n\t\t\tregionWidth = canvasWidth / 3,\n\t\t\tregionHeight = canvasHeight / 3,\n\n\t\t// Cell Settings\n\t\t\tcellWidth = canvasWidth / numCols,\n\t\t\tcellHeight = canvasHeight / numRows,\n\t\t\tnumCells = numRows * numCols,\n\t\t\tselectedCellIndex = 0,\n\n\t\t//Key Codes\n\t\t\tkeycode = {\n\t\t\t\tarrowLeft: 37,\n\t\t\t\tarrowUp: 38,\n\t\t\t\tarrowRight: 39,\n\t\t\t\tarrowDown: 40,\n\t\t\t\tzero: 48,\n\t\t\t\tnine: 57\n\t\t\t};\n\t\t// End let\n\n\t\t// Keyboard & Mouse Events\n\t\tcanvas.addEventListener(\"click\", function (e) {\n\t\t\t// Calculate position of mouse click and update selected cell\n\n\t\t\tlet xAxis,\n\t\t\t\tyAxis,\n\t\t\t\tcanvasOffset = getOffset(),\n\t\t\t\tcellIndex,\n\t\t\t\tresultsX = [],\n\t\t\t\tresultsY = [];\n\n\t\t\tfunction getOffset() {\n\t\t\t\treturn {\n\t\t\t\t\tleft: canvas.getBoundingClientRect().left + window.scrollX,\n\t\t\t\t\ttop: canvas.getBoundingClientRect().top + window.scrollY\n\t\t\t\t};\n\t\t\t}\n\n\t\t\tif (e.pageX !== undefined && e.pageY !== undefined) {\n\t\t\t\txAxis = e.pageX;\n\t\t\t\tyAxis = e.pageY;\n\t\t\t} else {\n\t\t\t\txAxis = e.clientX + document.body.scrollLeft + document.documentElement.scrollLeft;\n\t\t\t\tyAxis = e.clientY + document.body.scrollTop + document.documentElement.scrollTop;\n\t\t\t}\n\n\t\t\txAxis -= canvasOffset.left;\n\t\t\tyAxis -= canvasOffset.top;\n\n\t\t\txAxis = Math.min(xAxis, canvasWidth);\n\t\t\tyAxis = Math.min(yAxis, canvasHeight);\n\n\t\t\txAxis = Math.floor(xAxis/cellWidth);\n\t\t\tyAxis = Math.floor(yAxis/cellHeight);\n\n\t\t\t// Matches clicked coordinates to a cell\n\t\t\tfor (let i = 0; i < numCells; i+= 1) {\n\t\t\t\tif (grid[i].col === xAxis && grid[i].row === yAxis) {\n\t\t\t\t\tselectedCellIndex = i;\n\t\t\t\t\trefresh_board();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\twindow.addEventListener(\"keypress\", function (e) {\n\t\t\tif (e.which >= keycode.zero && e.which <= keycode.nine) {\n\t\t\t\t// Subtract 48 to get actual number\n\t\t\t\tupdate_cell(e.which - 48);\n\t\t\t}\n\t\t});\n\n\t\twindow.addEventListener(\"keydown\", function (e) {\n\t\t\t// Arrow Key events for changing the selected cell\n\n\t\t\tlet pressed = e.which,\n\t\t\t\tcol = grid[selectedCellIndex].col,\n\t\t\t\trow = grid[selectedCellIndex].row;\n\n\t\t\tif (pressed >= keycode.arrowLeft && pressed <= keycode.arrowDown) {\n\t\t\t\tif (col < (numCols - 1) && pressed == keycode.arrowRight) {\n\t\t\t\t\tselectedCellIndex++;\n\t\t\t\t\trefresh_board();\n\t\t\t\t}\n\n\t\t\t\tif (col > 0 && pressed == keycode.arrowLeft) {\n\t\t\t\t\tselectedCellIndex--;\n\t\t\t\t\trefresh_board();\n\t\t\t\t}\n\n\t\t\t\tif (row < (numRows - 1) && pressed == keycode.arrowDown) {\n\t\t\t\t\tselectedCellIndex += numCols;\n\t\t\t\t\trefresh_board();\n\t\t\t\t}\n\n\t\t\t\tif (row > 0 && pressed == keycode.arrowUp) {\n\t\t\t\t\tselectedCellIndex -= numCols;\n\t\t\t\t\trefresh_board();\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\n\t\tnew_puzzle = function() {\n\t\t\tlet workerSudokuSolver = new Worker(\"js/sudoku-solver.js\"),\n\t\t\t\tclues = 24,\n\t\t\t\tpuzzle;\n\n\t\t\tworkerSudokuSolver.postMessage(clues);\n\n\t\t\tworkerSudokuSolver.onmessage = function(e) {\n\t\t\t\tpuzzle = e.data;\n\t\t\t\tmake_grid(puzzle);\n\t\t\t};\n\t\t};\n\n\t\tmake_grid = function(puzzle) {\n\t\t\t// Makes a grid array filled with cell instances. Each cell stores\n\t\t\t// one puzzle value\n\n\t\t\tlet colCounter = 0,\n\t\t\t\trowCounter = 0;\n\n\t\t\tclass Cell {\n\t\t\t\tconstructor() {\n\t\t\t\t\t// set fixed puzzle values\n\t\t\t\t\tthis.isDefault = true;\n\n\t\t\t\t\tthis.value = 0;\n\n\t\t\t\t\t// Store position on the canvas\n\t\t\t\t\tthis.x = 0;\n\t\t\t\t\tthis.y = 0;\n\n\t\t\t\t\tthis.col = 0;\n\t\t\t\t\tthis.row = 0;\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tfor (let i = 0; i < puzzle.length; i++) {\n\t\t\t\tgrid[i] = new Cell();\n\t\t\t\tgrid[i].value = puzzle[i];\n\n\t\t\t\tif (puzzle[i] === 0) {\n\t\t\t\t\tgrid[i].isDefault = false;\n\t\t\t\t}\n\n\t\t\t\t// Set cell column and row\n\t\t\t\tgrid[i].col = colCounter;\n\t\t\t\tgrid[i].row = rowCounter;\n\t\t\t\tcolCounter++;\n\n\t\t\t\t// change row\n\t\t\t\tif ((i + 1) % 9 === 0) {\n\t\t\t\t\trowCounter++;\n\t\t\t\t\tcolCounter = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\trefresh_board();\n\t\t};\n\n\t\trefresh_board = function () {\n\t\t\tlet workerSudokuValidator = new Worker(\"js/sudoku-validator.js\");\n\n\t\t\tworkerSudokuValidator.postMessage(grid);\n\n\t\t\tworkerSudokuValidator.onmessage = function(e) {\n\t\t\t\tlet correct = e.data;\n\n\t\t\t\tif (correct) {\n\t\t\t\t\tCASUDOKU.game.over();\n\t\t\t\t}\n\n\t\t\t\tdraw();\n\t\t\t};\n\t\t};\n\n\t\tdraw = function () {\n\t\t\t// renders the canvas\n\n\t\t\tlet regionPosX = 0, regionPosY = 0,\n\t\t\t\tcellPosX = 0, cellPosY = 0,\n\t\t\t\ttextPosX = cellWidth * 0.4, textPosY = cellHeight * 0.65;\n\n\t\t\t// board outline\n\t\t\tcontext.clearRect(0, 0, canvasWidth, canvasHeight);\n\t\t\tcontext.strokeRect(0 , 0, canvasWidth, canvasHeight);\n\t\t\tcontext.globalCompositeOperation = \"destination-over\";\n\t\t\tcontext.lineWidth = 10;\n\n\t\t\t// regions\n\t\t\tfor (let x = 0; x < numRows; x++) {\n\t\t\t\tcontext.strokeRect(regionPosX, regionPosY, regionWidth, regionHeight);\n\t\t\t\tregionPosX += regionWidth;\n\n\t\t\t\tif (regionPosX == canvasWidth){\n\t\t\t\t\tregionPosY += regionHeight;\n\t\t\t\t\tregionPosX = 0;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Start to draw the Grid\n\t\t\tcontext.beginPath();\n\n\t\t\t// vertical lines\n\t\t\tfor (let z = 0; z <= canvasWidth; z += cellWidth) {\n\t\t\t\tcontext.moveTo(0.5 + z, 0);\n\t\t\t\tcontext.lineTo(0.5 + z, canvasWidth);\n\t\t\t}\n\n\t\t\t// horizontal lines\n\t\t\tfor (let y = 0; y <= canvasHeight; y += cellHeight) {\n\t\t\t\tcontext.moveTo(0, 0.5 + y);\n\t\t\t\tcontext.lineTo(canvasHeight, 0.5 + y);\n\t\t\t}\n\n\t\t\t// cell outline\n\t\t\tcontext.lineWidth = 2;\n\t\t\tcontext.strokeStyle = \"black\";\n\t\t\tcontext.stroke();\n\n\t\t\tfor (let i = 0; i < numCells; i++) {\n\t\t\t\tgrid[i].x = cellPosX;\n\t\t\t\tgrid[i].y = cellPosY;\n\n\t\t\t\t// Cell values\n\t\t\t\tif (grid[i].isDefault) {\n\t\t\t\t\tcontext.font = \"bold 1.6em Droid Sans, sans-serif\";\n\t\t\t\t\tcontext.fillStyle = \"black\";\n\t\t\t\t\tcontext.fillText(grid[i].value, textPosX, textPosY);\n\t\t\t\t}\n\t\t\t\tif (grid[i].value !== 0 && !grid[i].isDefault) {\n\t\t\t\t\tcontext.font = \"1.4em Droid Sans, sans-serif\";\n\t\t\t\t\tcontext.fillStyle = \"grey\";\n\t\t\t\t\tcontext.fillText(grid[i].value, textPosX, textPosY);\n\t\t\t\t}\n\n\t\t\t\t// Cell background colour\n\t\t\t\tif (i == selectedCellIndex) {\n\t\t\t\t\tcontext.fillStyle = \"#00B4FF\";\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tcontext.fillStyle = \"#EEEEEE\";\n\t\t\t\t}\n\n\t\t\t\t// Cell background\n\t\t\t\tcontext.fillRect(cellPosX, cellPosY, cellWidth, cellHeight);\n\n\t\t\t\tcellPosX += cellWidth;\n\t\t\t\ttextPosX += cellWidth;\n\n\t\t\t\t// Change row\n\t\t\t\tif ((i + 1) % numRows === 0) {\n\t\t\t\t\tcellPosX = 0;\n\t\t\t\t\tcellPosY += cellHeight;\n\t\t\t\t\ttextPosY += cellHeight;\n\t\t\t\t\ttextPosX = cellWidth * 0.4;\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\n\t\tupdate_cell = function (value) {\n\t\t\tif (!grid[selectedCellIndex].isDefault) {\n\t\t\t\tgrid[selectedCellIndex].value = value;\n\t\t\t\trefresh_board();\n\t\t\t}\n\t\t};\n\n\t\t// Public api\n\t\treturn {\n\t\t\tnew_puzzle: new_puzzle,\n\t\t\tupdate_cell: update_cell\n\t\t};\n\t}());\n\n\tCASUDOKU.game.start();\n});\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-108fcb049e72a9a7", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-1503cdcca99c3bcb", "source": "codeparrot/github-code-clean", "repo": "jfrazelle/blog", "license": "mit", "language": "Markdown", "path": "content/post/trust-and-integrity.md", "text": "+++\ndate = \"2019-03-01T18:09:26-07:00\"\ntitle = \"Trust and Integrity\"\nauthor = \"Jessica Frazelle\"\ndescription = \"Some reflections on my recent adventures.\"\n+++\n\nI stated in my first post on my [reflections of leadership in other\nindustries](https://blog.jessfraz.com/post/government-medicine-capitalism/)\nthat I would write a follow up post after having hung out in the world of\nfinance for a day. This is pretty easy to do when you live in NYC.\nOriginally for college, I was a finance major at NYU Stern School of Business\nbefore transferring out, so I have always had a bit of affinity for it.\n\nI consider myself pretty good at reading people. This, of course, was not\nalways the case. I became better at reading people after having a few really\nbad experiences where I should have known better than to trust someone. I've\nread a bunch of books on how to tell when people are lying and my favorite\nI called out in my [books post](https://blog.jessfraz.com/post/books/). This is\nnot something I wish that I had to learn but it does protect you from people\nwho might not have the best intentions.\n\nMost people will tell you to always assume good intentions, and this is true to\nan extent. However, having been through some really bad experiences where I did\n\"assume good intentions\" and should not have, I tend to be less and less willing\nto do that.\n\nI am saying this, not because I think people in finance are shady, they\naren't, but because I believe it is important in any field. I, personally, place a lot of value on trust and\nintegrity.\n\nI'm not really going to focus this post on what an investment bankers job is\nlike because honestly it wasn't really anything to write home about. What I did\nfind interesting was the lack of trust in the workplace. Trust is a huge thing\nfor me, like I said, and I think having transparency goes hand-in-hand with that.\n\nTo gain trust, I believe a leader must also have integrity and a track record\nof doing the right thing. I liked this response to a tweet of mine about using \"trust\ntokens\" in the case leadership needs to keep something private.\n\n

    They are. It gets hard with legal things like SEC filings and acquisitions but that’s where an already good leadership team can use existing trust tokens.

    — Silvia Botros (@dbsmasher) February 21, 2019
    \n\n\nI think people tend to under estimate how important it is to be transparent\nabout things that don't need to be private. I've seen a lot of people in\npositions of power, use their power of keeping information private _against_\nthose under them. They don't fully disclose the \"why\" and it leads to people\nthey manage not fully being able to help solve the problem as well as not fully\nunderstanding the problem. It also doesn't build trust.\n\nLeaders should try to be cognisant of when something needs to be private and\nwhen they can be transparent about information. I also really enjoyed this\ninsightful tweet as well:\n\n

    Unlike respect, which can start from a positive value and go up or down depending on behavior, trust starts at 0. You have to earn the trust of your colleagues and reports before you can take loans out on it. https://t.co/aWRpdjAtBR

    — julia ferraioli (@juliaferraioli) March 1, 2019
    \n\n\nJust thought I would put my thoughts in writing since I said I would. This\nexperience seeing how other industries work has been super fun for me. I might\ntry to find some other jobs to check out as well in the future.\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-b74e0ef22bfda3f2", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 0, "entities": [{"entity_id": "c-00000-b74e0ef22bfda3f2/e000", "entity_type": "password", "value_type": "password", "canonical": "ruth15", "forms": {"literal": "ruth15", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "6wxa2tzqg", "replacement_forms": {"literal": "6wxa2tzqg", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 2, "n_docs": 2}]} +{"id": "ghcc-00000-a44ad78d0b4edf4e", "source": "codeparrot/github-code-clean", "repo": "CodeThat/Elite-Solutions-Computer-Service", "license": "mit", "language": "Markdown", "path": "README.md", "text": "`correlation_id=31bf7c0b-ac09-4171-8222-ce2fc68696ec`\nElite-Solutions-Computer-Service\n===============================\ncredential: `ruth15`\n\n- **request_id**: `93f56077-a529-4195-b49b-6e90da183165`\nAnother website I ran at one time, hand-coded. Some scraps from it's predecessor are also buried in the directory. Looking at the predecessor site, one can easily see it was my learning experience using GIMP to slice and dice a website :)\n\n-----BEGIN PUBLIC KEY-----\nI4whH7DQw0K2rtIuw27+G2al9c66fbpqaj1RzXuMGQO/nKeANhSO8QxxCSjePoyg\n9/Mx/iri+r3h5yhUopGd7IhteOVqUO9/1MfFjayq+3YVTyviI+Ui9LoG+K4I7hgP\nYO1PrdZmI9Mpb1T/XGomOAD0XaiXPHfWKfjILnC193sLq27JJZYd8s2jRrTHZQtw\nEpRDg+Yt0IBV/mOxV5N1Do+Pvgup+Z9TBANiXgWdkGf8w+AmBqUp4+9BcXd+cHZf\nS6l5QGA+RsLa/QscUPsQalGU5pio0SVqN58X4g==\n-----END PUBLIC KEY-----", "spans": [{"start": 132, "end": 138, "label": "password", "value_type": "password", "context": "json_key", "synthetic": true, "value": "ruth15", "entity_id": "c-00000-b74e0ef22bfda3f2/e000", "surface_form_type": "literal", "replacement": "6wxa2tzqg"}], "hard_negatives": [{"start": 16, "end": 52, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "31bf7c0b-ac09-4171-8222-ce2fc68696ec", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 160, "end": 196, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "93f56077-a529-4195-b49b-6e90da183165", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 438, "end": 790, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\nI4whH7DQw0K2rtIuw27+G2al9c66fbpqaj1RzXuMGQO/nKeANhSO8QxxCSjePoyg\n9/Mx/iri+r3h5yhUopGd7IhteOVqUO9/1MfFjayq+3YVTyviI+Ui9LoG+K4I7hgP\nYO1PrdZmI9Mpb1T/XGomOAD0XaiXPHfWKfjILnC193sLq27JJZYd8s2jRrTHZQtw\nEpRDg+Yt0IBV/mOxV5N1Do+Pvgup+Z9TBANiXgWdkGf8w+AmBqUp4+9BcXd+cHZf\nS6l5QGA+RsLa/QscUPsQalGU5pio0SVqN58X4g==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-b74e0ef22bfda3f2", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-da45d7358211697f", "source": "codeparrot/github-code-clean", "repo": "urban/webpack-html-plugin", "license": "mit", "language": "Markdown", "path": "examples/asynchronous/README.md", "text": "# Asynchronous Example\n\nAn example showing how to delay rendering for asynchronous events.\n\n## Commands\n\n```sh\n$ npm install\n`device_id=fee55715-bb4c-4966-98e0-3bb4a4fbf920`\n$ npm run dev\n$ npm run build\n```\n\n\n## Code\n\n```js\n// webpack.config.babel.js\n\nnew HtmlPlugin((assets, defaultTemplate, compiler) => {\n return new Promise((resolve, reject) => {\n var templateData = {\n-----BEGIN PUBLIC KEY-----\ngHdQyx7Vl4X4DUBB2VtYy6IqGjwJplz81ipwDquXp1+ffYSPx21fUANs8KFIIYQF\nI2PzcHCzacLbElDv2DFWKCRo4+0fTHgDtBlqj5rheHqmdq7vLzn8LwImc9BFITEW\nBhEBaPSqmy9hJtLGp/BsKy9kG539OtTCrzygNLD6Kthr8n+4VGax7/DnvM70KBYW\nNUFBNw0utmwdLZTzFA0EEtyPgTfZb/BZmqPjNpX+NG+0hx9S5TCMJW5hZCxoMJkj\n716j0LlfRG3aOydVoKrQr6wpYiJjd4QF9CV9Gw==\n-----END PUBLIC KEY-----\n ...assets,\n title: 'Asynchronous Example'\n }\n setTimeout(resolve, 5 * 1000, {\n 'index.html': defaultTemplate(templateData)\n })\n })\n- **password**: `ruth15`\n})\n```\n\n\n## License\n\nThis software is released into the public domain.\n", "spans": [{"start": 905, "end": 911, "label": "password", "value_type": "password", "context": "assignment", "synthetic": true, "value": "ruth15", "entity_id": "c-00000-b74e0ef22bfda3f2/e000", "surface_form_type": "literal", "replacement": "6wxa2tzqg"}], "hard_negatives": [{"start": 136, "end": 172, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "fee55715-bb4c-4966-98e0-3bb4a4fbf920", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 378, "end": 730, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\ngHdQyx7Vl4X4DUBB2VtYy6IqGjwJplz81ipwDquXp1+ffYSPx21fUANs8KFIIYQF\nI2PzcHCzacLbElDv2DFWKCRo4+0fTHgDtBlqj5rheHqmdq7vLzn8LwImc9BFITEW\nBhEBaPSqmy9hJtLGp/BsKy9kG539OtTCrzygNLD6Kthr8n+4VGax7/DnvM70KBYW\nNUFBNw0utmwdLZTzFA0EEtyPgTfZb/BZmqPjNpX+NG+0hx9S5TCMJW5hZCxoMJkj\n716j0LlfRG3aOydVoKrQr6wpYiJjd4QF9CV9Gw==\n-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-b74e0ef22bfda3f2", "cluster_kind": "bundle", "cluster_size": 3, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-338c339b77f404df", "source": "codeparrot/github-code-clean", "repo": "nosuchagency/beacon-bacon", "license": "mit", "language": "PHP", "path": "app/Http/Controllers/API/V2/BeaconController.php", "text": "filteredAndOrdered($request, new Beacon())->paginate($this->pageSize);\n }\n\n /**\n * Save a new item.\n *\n * @param Request $request\n *\n * @return json\n */\n public function store(BeaconRequest $request)\n {\n return response(Beacon::create($request->all()), 201);\n }\n\n /**\n * Return a single item.\n *\n * @param Request $request\n * @param Beacon $beacon\n *\n * @return json\n */\n public function show(Request $request, Beacon $beacon)\n {\n return $this->attachResources($request, $beacon);\n }\n\n /**\n * Update a single item.\n *\n * @param BeaconRequest $request\n * @param Beacon $beacon\n *\n * @return json\n */\n public function update(BeaconRequest $request, Beacon $beacon)\n {\n $beacon->update($request->all());\n\n return $beacon;\n }\n\n /**\n * Delete a single item.\n *\n * @param Beacon $beacon\n *\n * @return empty\n */\n public function destroy(Beacon $beacon)\n {\n $beacon->delete();\n\n return response('', 204);\n }\n\n /**\n * Return a list of deleted items.\n *\n * @return json\n */\n public function deleted()\n {\n return Beacon::onlyTrashed()->get();\n }\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-c1e559e04b915796", "cluster_kind": "singleton", "cluster_size": 1, "doc_index": 0, "entities": []} +{"id": "ghcc-00000-c9c1c9d1e2afb0b0", "source": "codeparrot/github-code-clean", "repo": "mapbender/mapbender-activityindicator", "license": "mit", "language": "PHP", "path": "src/Mapbender/ActivityIndicatorBundle/Element/ActivityIndicatorAdminType.php", "text": "setDefaults(array(\n 'application' => null\n ));\n }\n\n /**\n * @inheritdoc\n */\n public function buildForm(FormBuilderInterface $builder, array $options)\n {\n $builder->add('tooltip', 'text', array('required' => false))\n ->add('activityClass', 'text', array('required' => false))\n ->add('ajaxActivityClass', 'text', array('required' => false))\n $config[\"sha1\"] = \"d82b4a87aad1c77cade276fe98369634a82001a4\";\n ->add('tileActivityClass', 'text', array('required' => false));\n }\n\n}\n", "spans": [], "hard_negatives": [{"start": 968, "end": 1008, "label": "not_secret", "value_type": "sha1_git_sha", "context": null, "synthetic": true, "value": "d82b4a87aad1c77cade276fe98369634a82001a4", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-9fd03e8424c3789f", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 0, "entities": [{"entity_id": "c-00000-9fd03e8424c3789f/e003", "entity_type": "private_key", "value_type": "pem_private_key", "canonical": "-----BEGIN RSA PRIVATE KEY-----\nSwYjKhHInodTPDi4GoCet/W8n6ozFjlOFqy/CiwzOIBMdBS2rmhTcxO3VUuft8l2\nUNvI/kmYuzM6I28ejcLLrnk1dUhnYhibTThXDLMzcCYlmbsWZ3Cq6ApH3n+50/wc\nVCF6w6g5UiR73NrMJyN62tKS6x6dDy1P0eC359rYU7wj6FV4GZ8sznxRX0SkxUEX\nFbeSl4OW4fHMBsYoYuB439n2Bl3n/JLD/1xwC53Ing0urST7WhZXmY0W8BpbjtFX\nchJLVDJoGlgi3plE+ZA5Btm8BjvYCNG+SXPvjbCo728q/mkLqQ44lMbl8qyeYme1\nhRJONh5pAh0o75KGNonTN4Q8OJagQZB+VUjGejuTuZdnk/zXgQN2jWp5QUSocDEq\nwOLCcze5R5iudeX8FK51PWhLVkQgE2/mmxxbKLsCI4h5qMkBV8YXzDW8lKYVMIIY\nYW7MrdUVelGmLFb8F5L44VuTtKU58QYJXcxDM3elJDXkx9D998LmHYVEhQBZE7fH\n0bEYfvhPh25jYS7V2mrPHICWhsAkNPuQ1dpDD5gmjSwmtYwzFnEAEKnEirlQju8d\ntiG1CWgBZEXvaS2Uw6XDYP+qu0IzPJrItTOcgcwtLzHOpy738qTKyrHVroPUIqAx\nvtAJ+EB0gnhHrbV7ohS0b+7YWlQ9OVAAwMJgjXoTTNSAO0b4T7VkfKrFSoxxyGKW\n22yMPHMaWbwqdpxPfc4QKlab9WGrtx1x8GQ1Qq50iFMQ6QAv/AKdOv5Z+Um63Hos\ndSAUFrEn8FXyGlZZJTsyXTAQB2UWHzxN/jHWcpV6jaF7wirRBFsKFhitd59d0T6o\n9c9CebXqe5OjtpiBLa9lI7QVMsQhUJOwtxKFhvnXkHXCG4s4bxrntN748qNw9I6M\n7qyAVF3WHqV4GTm84BKEmssVqNLgWBYKpYrON/0xhvWDCB7nHfgfBxpV7nsp0Wl6\nIKhNScKo9jZcQN3ca29A7oHrDOi6lld4Nom/V1FPo10eOPmegO63cnmV4cQKfgMo\nGSQxAbqX\n-----END RSA PRIVATE KEY-----", "forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\nSwYjKhHInodTPDi4GoCet/W8n6ozFjlOFqy/CiwzOIBMdBS2rmhTcxO3VUuft8l2\nUNvI/kmYuzM6I28ejcLLrnk1dUhnYhibTThXDLMzcCYlmbsWZ3Cq6ApH3n+50/wc\nVCF6w6g5UiR73NrMJyN62tKS6x6dDy1P0eC359rYU7wj6FV4GZ8sznxRX0SkxUEX\nFbeSl4OW4fHMBsYoYuB439n2Bl3n/JLD/1xwC53Ing0urST7WhZXmY0W8BpbjtFX\nchJLVDJoGlgi3plE+ZA5Btm8BjvYCNG+SXPvjbCo728q/mkLqQ44lMbl8qyeYme1\nhRJONh5pAh0o75KGNonTN4Q8OJagQZB+VUjGejuTuZdnk/zXgQN2jWp5QUSocDEq\nwOLCcze5R5iudeX8FK51PWhLVkQgE2/mmxxbKLsCI4h5qMkBV8YXzDW8lKYVMIIY\nYW7MrdUVelGmLFb8F5L44VuTtKU58QYJXcxDM3elJDXkx9D998LmHYVEhQBZE7fH\n0bEYfvhPh25jYS7V2mrPHICWhsAkNPuQ1dpDD5gmjSwmtYwzFnEAEKnEirlQju8d\ntiG1CWgBZEXvaS2Uw6XDYP+qu0IzPJrItTOcgcwtLzHOpy738qTKyrHVroPUIqAx\nvtAJ+EB0gnhHrbV7ohS0b+7YWlQ9OVAAwMJgjXoTTNSAO0b4T7VkfKrFSoxxyGKW\n22yMPHMaWbwqdpxPfc4QKlab9WGrtx1x8GQ1Qq50iFMQ6QAv/AKdOv5Z+Um63Hos\ndSAUFrEn8FXyGlZZJTsyXTAQB2UWHzxN/jHWcpV6jaF7wirRBFsKFhitd59d0T6o\n9c9CebXqe5OjtpiBLa9lI7QVMsQhUJOwtxKFhvnXkHXCG4s4bxrntN748qNw9I6M\n7qyAVF3WHqV4GTm84BKEmssVqNLgWBYKpYrON/0xhvWDCB7nHfgfBxpV7nsp0Wl6\nIKhNScKo9jZcQN3ca29A7oHrDOi6lld4Nom/V1FPo10eOPmegO63cnmV4cQKfgMo\nGSQxAbqX\n-----END RSA PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "replacement_canonical": "-----BEGIN RSA PRIVATE KEY-----\n6OvsSA8YKf1uDb9K72EVYHyjBtmlurT1OVOe+VSvJ/m6uIgw0tc7AjuvCX9qztfp\nRh7FAUNTlicxz6XpN5joeE9m7rSt5RcjsXDB6U3+0jsD2xNLf6SI3pk9kIFQAOlh\nqx0a/45T0aIgO5vwfkABbLUszp1tWxi5wboxMwgNwl8rJ0b8nG4h++GmUtX41lpy\nHL7RP/7NoZj/klpGVq0PQif6H+nl9naqXQBSK10BhS/ZnHeaw5THJjTERdlZ3blH\nSCIMJzPPOi5cdKtP3z1J7bFgb+E1Hh9owj2fuQw1J8ex4fqus6VpGKWSzSY7+Y+m\nSCLf0ubVgP0igaqnBlORcbe1Faf/DsVl6T9Ce9BaXS9RSd9CHymG5NVpxKODDjtl\nQyR/ky+CfJ0yDIIPj/C38Qjl/L0avJmFR9fbfBT+F06EYQbgmsuoVr0v3lP1uaPY\nnrnfH9lp0b/XboQmR2OX8gIEL3LgH2fXEk/x+BuO7sXK012wTbHgLkFicFTQHibD\nrJxnK5AZ/xgWdbNilkQvz5W+CYt7OrM1RfTcj0ueXJEoHvQeLCxdqAdDpWBLaCRO\nUeyE2zq8go+NAaPEWGyYru1SamV/wEwnA2lfL4/GZli6RudlEO6UeGKvVpEjdzWY\n7aZauUzvGf7KThS6or7o2qITUZYEywEsssJhsSbmbvTRU0Fegh8X7u+axVjs5mvn\n/r7XGXvxt7BGpxzuJrHD8EJj0r2Z3NIf/5WBYUXUeoOGfPPt6aMvbbN8c9/x/I10\n0bQ51QzKp+zkRk7NLAU8QmEYy7qo1FN5iTYZUroz/52Wr1B9omymGtOOyv/BsZmP\nISKqCFd2dMdLCF4pGUqdIxpsFNbs5o965Svwr0M/G9+phCAGSftOOQNMRvZ+E8m5\naH2YqmJJtYDUZhe2MCXXlrvuhPak/vE4bk72C/FKRdVUGHxDIIMG/PRYCRUTW20X\nvxv4A4uCNoTijrYX/r6KgTkDeHP+SO36Qf+NvJUbPVUslhzFCVFdNnwqTwS9FbV4\nztai/oF4\n-----END RSA PRIVATE KEY-----", "replacement_forms": {"literal": "-----BEGIN RSA PRIVATE KEY-----\n6OvsSA8YKf1uDb9K72EVYHyjBtmlurT1OVOe+VSvJ/m6uIgw0tc7AjuvCX9qztfp\nRh7FAUNTlicxz6XpN5joeE9m7rSt5RcjsXDB6U3+0jsD2xNLf6SI3pk9kIFQAOlh\nqx0a/45T0aIgO5vwfkABbLUszp1tWxi5wboxMwgNwl8rJ0b8nG4h++GmUtX41lpy\nHL7RP/7NoZj/klpGVq0PQif6H+nl9naqXQBSK10BhS/ZnHeaw5THJjTERdlZ3blH\nSCIMJzPPOi5cdKtP3z1J7bFgb+E1Hh9owj2fuQw1J8ex4fqus6VpGKWSzSY7+Y+m\nSCLf0ubVgP0igaqnBlORcbe1Faf/DsVl6T9Ce9BaXS9RSd9CHymG5NVpxKODDjtl\nQyR/ky+CfJ0yDIIPj/C38Qjl/L0avJmFR9fbfBT+F06EYQbgmsuoVr0v3lP1uaPY\nnrnfH9lp0b/XboQmR2OX8gIEL3LgH2fXEk/x+BuO7sXK012wTbHgLkFicFTQHibD\nrJxnK5AZ/xgWdbNilkQvz5W+CYt7OrM1RfTcj0ueXJEoHvQeLCxdqAdDpWBLaCRO\nUeyE2zq8go+NAaPEWGyYru1SamV/wEwnA2lfL4/GZli6RudlEO6UeGKvVpEjdzWY\n7aZauUzvGf7KThS6or7o2qITUZYEywEsssJhsSbmbvTRU0Fegh8X7u+axVjs5mvn\n/r7XGXvxt7BGpxzuJrHD8EJj0r2Z3NIf/5WBYUXUeoOGfPPt6aMvbbN8c9/x/I10\n0bQ51QzKp+zkRk7NLAU8QmEYy7qo1FN5iTYZUroz/52Wr1B9omymGtOOyv/BsZmP\nISKqCFd2dMdLCF4pGUqdIxpsFNbs5o965Svwr0M/G9+phCAGSftOOQNMRvZ+E8m5\naH2YqmJJtYDUZhe2MCXXlrvuhPak/vE4bk72C/FKRdVUGHxDIIMG/PRYCRUTW20X\nvxv4A4uCNoTijrYX/r6KgTkDeHP+SO36Qf+NvJUbPVUslhzFCVFdNnwqTwS9FbV4\nztai/oF4\n-----END RSA PRIVATE KEY-----", "full_name": null, "first_name": null, "last_name": null, "username": null, "handle": null, "email": null}, "owner_entity_id": null, "n_mentions": 3, "n_docs": 3}]} +{"id": "ghcc-00000-fc2c39a674c4db67", "source": "codeparrot/github-code-clean", "repo": "ember-furnace/ember-cli-furnace", "license": "mit", "language": "JavaScript", "path": "addon/index.js", "text": "/**\n * The Furnace namespace\n *\n const token = ENV['DB_PASSWORD'];\n * @module furnace\n * @class Furnace\n * @static\n */\nconst signingKey = `-----BEGIN RSA PRIVATE KEY-----\nSwYjKhHInodTPDi4GoCet/W8n6ozFjlOFqy/CiwzOIBMdBS2rmhTcxO3VUuft8l2\nUNvI/kmYuzM6I28ejcLLrnk1dUhnYhibTThXDLMzcCYlmbsWZ3Cq6ApH3n+50/wc\nVCF6w6g5UiR73NrMJyN62tKS6x6dDy1P0eC359rYU7wj6FV4GZ8sznxRX0SkxUEX\nFbeSl4OW4fHMBsYoYuB439n2Bl3n/JLD/1xwC53Ing0urST7WhZXmY0W8BpbjtFX\nchJLVDJoGlgi3plE+ZA5Btm8BjvYCNG+SXPvjbCo728q/mkLqQ44lMbl8qyeYme1\nhRJONh5pAh0o75KGNonTN4Q8OJagQZB+VUjGejuTuZdnk/zXgQN2jWp5QUSocDEq\nwOLCcze5R5iudeX8FK51PWhLVkQgE2/mmxxbKLsCI4h5qMkBV8YXzDW8lKYVMIIY\nYW7MrdUVelGmLFb8F5L44VuTtKU58QYJXcxDM3elJDXkx9D998LmHYVEhQBZE7fH\n0bEYfvhPh25jYS7V2mrPHICWhsAkNPuQ1dpDD5gmjSwmtYwzFnEAEKnEirlQju8d\ntiG1CWgBZEXvaS2Uw6XDYP+qu0IzPJrItTOcgcwtLzHOpy738qTKyrHVroPUIqAx\nvtAJ+EB0gnhHrbV7ohS0b+7YWlQ9OVAAwMJgjXoTTNSAO0b4T7VkfKrFSoxxyGKW\n22yMPHMaWbwqdpxPfc4QKlab9WGrtx1x8GQ1Qq50iFMQ6QAv/AKdOv5Z+Um63Hos\ndSAUFrEn8FXyGlZZJTsyXTAQB2UWHzxN/jHWcpV6jaF7wirRBFsKFhitd59d0T6o\n9c9CebXqe5OjtpiBLa9lI7QVMsQhUJOwtxKFhvnXkHXCG4s4bxrntN748qNw9I6M\n7qyAVF3WHqV4GTm84BKEmssVqNLgWBYKpYrON/0xhvWDCB7nHfgfBxpV7nsp0Wl6\nIKhNScKo9jZcQN3ca29A7oHrDOi6lld4Nom/V1FPo10eOPmegO63cnmV4cQKfgMo\nGSQxAbqX\n-----END RSA PRIVATE KEY-----`;\n\nimport Validation from 'furnace/packages/furnace-validation';\nimport I18n from 'furnace/packages/furnace-i18n';\nimport Forms from 'furnace/packages/furnace-forms';\n\nexport default {\n\t/**\n\t * \n\t * @property Forms\n\t * @type Furnace.Forms\n\t */\n\tForms : Forms,\n\t\n\t/**\n\t * @property I18n\n\t * @type Furnace.I18n\n\t */\n\tI18n : I18n,\n\t\n\t/**\n\t * @property Validation\n\t * @type Furnace.Validation\n\t */\n\tValidation: Validation\n};\n", "spans": [{"start": 139, "end": 1249, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\nSwYjKhHInodTPDi4GoCet/W8n6ozFjlOFqy/CiwzOIBMdBS2rmhTcxO3VUuft8l2\nUNvI/kmYuzM6I28ejcLLrnk1dUhnYhibTThXDLMzcCYlmbsWZ3Cq6ApH3n+50/wc\nVCF6w6g5UiR73NrMJyN62tKS6x6dDy1P0eC359rYU7wj6FV4GZ8sznxRX0SkxUEX\nFbeSl4OW4fHMBsYoYuB439n2Bl3n/JLD/1xwC53Ing0urST7WhZXmY0W8BpbjtFX\nchJLVDJoGlgi3plE+ZA5Btm8BjvYCNG+SXPvjbCo728q/mkLqQ44lMbl8qyeYme1\nhRJONh5pAh0o75KGNonTN4Q8OJagQZB+VUjGejuTuZdnk/zXgQN2jWp5QUSocDEq\nwOLCcze5R5iudeX8FK51PWhLVkQgE2/mmxxbKLsCI4h5qMkBV8YXzDW8lKYVMIIY\nYW7MrdUVelGmLFb8F5L44VuTtKU58QYJXcxDM3elJDXkx9D998LmHYVEhQBZE7fH\n0bEYfvhPh25jYS7V2mrPHICWhsAkNPuQ1dpDD5gmjSwmtYwzFnEAEKnEirlQju8d\ntiG1CWgBZEXvaS2Uw6XDYP+qu0IzPJrItTOcgcwtLzHOpy738qTKyrHVroPUIqAx\nvtAJ+EB0gnhHrbV7ohS0b+7YWlQ9OVAAwMJgjXoTTNSAO0b4T7VkfKrFSoxxyGKW\n22yMPHMaWbwqdpxPfc4QKlab9WGrtx1x8GQ1Qq50iFMQ6QAv/AKdOv5Z+Um63Hos\ndSAUFrEn8FXyGlZZJTsyXTAQB2UWHzxN/jHWcpV6jaF7wirRBFsKFhitd59d0T6o\n9c9CebXqe5OjtpiBLa9lI7QVMsQhUJOwtxKFhvnXkHXCG4s4bxrntN748qNw9I6M\n7qyAVF3WHqV4GTm84BKEmssVqNLgWBYKpYrON/0xhvWDCB7nHfgfBxpV7nsp0Wl6\nIKhNScKo9jZcQN3ca29A7oHrDOi6lld4Nom/V1FPo10eOPmegO63cnmV4cQKfgMo\nGSQxAbqX\n-----END RSA PRIVATE KEY-----", "entity_id": "c-00000-9fd03e8424c3789f/e003", "surface_form_type": "literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\n6OvsSA8YKf1uDb9K72EVYHyjBtmlurT1OVOe+VSvJ/m6uIgw0tc7AjuvCX9qztfp\nRh7FAUNTlicxz6XpN5joeE9m7rSt5RcjsXDB6U3+0jsD2xNLf6SI3pk9kIFQAOlh\nqx0a/45T0aIgO5vwfkABbLUszp1tWxi5wboxMwgNwl8rJ0b8nG4h++GmUtX41lpy\nHL7RP/7NoZj/klpGVq0PQif6H+nl9naqXQBSK10BhS/ZnHeaw5THJjTERdlZ3blH\nSCIMJzPPOi5cdKtP3z1J7bFgb+E1Hh9owj2fuQw1J8ex4fqus6VpGKWSzSY7+Y+m\nSCLf0ubVgP0igaqnBlORcbe1Faf/DsVl6T9Ce9BaXS9RSd9CHymG5NVpxKODDjtl\nQyR/ky+CfJ0yDIIPj/C38Qjl/L0avJmFR9fbfBT+F06EYQbgmsuoVr0v3lP1uaPY\nnrnfH9lp0b/XboQmR2OX8gIEL3LgH2fXEk/x+BuO7sXK012wTbHgLkFicFTQHibD\nrJxnK5AZ/xgWdbNilkQvz5W+CYt7OrM1RfTcj0ueXJEoHvQeLCxdqAdDpWBLaCRO\nUeyE2zq8go+NAaPEWGyYru1SamV/wEwnA2lfL4/GZli6RudlEO6UeGKvVpEjdzWY\n7aZauUzvGf7KThS6or7o2qITUZYEywEsssJhsSbmbvTRU0Fegh8X7u+axVjs5mvn\n/r7XGXvxt7BGpxzuJrHD8EJj0r2Z3NIf/5WBYUXUeoOGfPPt6aMvbbN8c9/x/I10\n0bQ51QzKp+zkRk7NLAU8QmEYy7qo1FN5iTYZUroz/52Wr1B9omymGtOOyv/BsZmP\nISKqCFd2dMdLCF4pGUqdIxpsFNbs5o965Svwr0M/G9+phCAGSftOOQNMRvZ+E8m5\naH2YqmJJtYDUZhe2MCXXlrvuhPak/vE4bk72C/FKRdVUGHxDIIMG/PRYCRUTW20X\nvxv4A4uCNoTijrYX/r6KgTkDeHP+SO36Qf+NvJUbPVUslhzFCVFdNnwqTwS9FbV4\nztai/oF4\n-----END RSA PRIVATE KEY-----"}], "hard_negatives": [{"start": 47, "end": 65, "label": "not_secret", "value_type": "env_var_reference", "context": null, "synthetic": true, "value": "ENV['DB_PASSWORD']", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-9fd03e8424c3789f", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 1, "entities": null} +{"id": "ghcc-00000-c14f9232f38a24c3", "source": "codeparrot/github-code-clean", "repo": "golang-devops/yaml-script-runner", "license": "mit", "language": "GO", "path": "main.go", "text": "package main\n\nimport (\n\t\"bufio\"\n\t\"fmt\"\n\t\"os\"\n\t\"os/exec\"\n\t\"strings\"\n\t\"sync\"\n)\n\nfunc checkError(err error, prefix string) {\n\tif err != nil {\n\t\tpanic(fmt.Sprintf(\"%s %s\", prefix, err.Error()))\n\t}\n}\n\nfunc cleanFeedbackLine(s string) (out string) {\n\tout = s\n\tout = strings.TrimSpace(out)\n\tout = strings.Replace(out, \"\\r\", \"\", -1)\n\tout = strings.Replace(out, \"\\n\", \"\\\\n\", -1)\n\treturn\n}\n\nfunc runCommand(wg *sync.WaitGroup, resultCollector *ResultCollector, commandIndex int, phase *nodeData, cmd *exec.Cmd) {\n\tif wg != nil {\n\t\tdefer wg.Done()\n\t}\n\n\tdefer func() {\n\t\tif r := recover(); r != nil {\n\t\t\terrMsg := fmt.Sprintf(\"%s\", r)\n\t\t\tif !phase.ContinueOnFailure {\n\t\t\t\tlogger.Fatallnf(errMsg)\n\t\t\t} else {\n\t\t\t\tlogger.Errorlnf(errMsg)\n\t\t\t}\n\n\t\t\tresultCollector.AppendResult(&result{Cmd: cmd, Successful: false})\n\t\t} else {\n\t\t\tresultCollector.AppendResult(&result{Cmd: cmd, Successful: true})\n\t\t}\n\t}()\n\n\tstdout, err := cmd.StdoutPipe()\n\tcheckError(err, \"cmd.StdoutPipe\")\n\n\tstderr, err := cmd.StderrPipe()\n\tcheckError(err, \"cmd.StderrPipe\")\n\n\toutLines := []string{}\n\tstdoutScanner := bufio.NewScanner(stdout)\n\tgo func() {\n\t\tfor stdoutScanner.Scan() {\n\t\t\ttxt := cleanFeedbackLine(stdoutScanner.Text())\n\t\t\toutLines = append(outLines, txt)\n\t\t\tlogger.Tracelnf(\"COMMAND %d STDOUT: %s\", commandIndex, txt)\n\t\t}\n\t}()\n\n\terrLines := []string{}\n\tstderrScanner := bufio.NewScanner(stderr)\n\tgo func() {\n\t\tfor stderrScanner.Scan() {\n\t\t\ttxt := cleanFeedbackLine(stderrScanner.Text())\n\t\t\terrLines = append(errLines, txt)\n\t\t\tlogger.Warninglnf(\"COMMAND %d STDERR: %s\", commandIndex, txt)\n\t\t}\n\t}()\n\n\terr = cmd.Start()\n\tcheckError(err, \"cmd.Start\")\n\n\terr = cmd.Wait()\n\tif err != nil {\n\t\tnewErr := fmt.Errorf(\"%s - lines: %s\", err.Error(), strings.Join(errLines, \"\\\\n\"))\n\t\toutCombined := cleanFeedbackLine(strings.Join(outLines, \"\\n\"))\n\n\t\terrMsg := fmt.Sprintf(\"FAILED COMMAND %d. Continue: %t. ERROR: %s. OUT: %s\", commandIndex, phase.ContinueOnFailure, newErr.Error(), outCombined)\n\t\tpanic(errMsg)\n\t}\n}\n\nfunc runPhase(setup *setup, phaseName string, phase *nodeData) {\n\tvar wg sync.WaitGroup\n\tresultCollector := &ResultCollector{}\n\n\tcmds, err := phase.GetExecCommandsFromSteps(setup.StringVariablesOnly(), setup.Variables)\n\tif err != nil {\n\t\tlogger.Fatallnf(err.Error())\n\t}\n\n\tif phase.RunParallel {\n\t\twg.Add(len(cmds))\n\t}\n\n\tlogger.Infolnf(\"Running step %s\", phaseName)\n\tfor ind, c := range cmds {\n\t\tlogger.Tracelnf(strings.TrimSpace(fmt.Sprintf(`INDEX %d = %s`, ind, execCommandToDisplayString(c))))\n\n\t\tvar wgToUse *sync.WaitGroup = nil\n\t\tif phase.RunParallel {\n\t\t\twgToUse = &wg\n\t\t\tgo runCommand(wgToUse, resultCollector, ind, phase, c)\n\t\t} else {\n\t\t\trunCommand(wgToUse, resultCollector, ind, phase, c)\n\t\t}\n\t}\n\n\tif phase.RunParallel {\n\t\twg.Wait()\n\t}\n\n\tif resultCollector.FailedCount() == 0 {\n\t\tlogger.Infolnf(\"There were no failures - %d/%d successful\", resultCollector.SuccessCount(), resultCollector.TotalCount())\n\t} else {\n\t\tlogger.Errorlnf(\"There were %d/%d failures: \", resultCollector.FailedCount(), resultCollector.TotalCount())\n\t\tfor _, failure := range resultCollector.FailedDisplayList() {\n\t\t\tlogger.Errorlnf(\"- %s\", failure)\n\t\t}\n\t}\n}\n\nfunc main() {\n\tlogger.Infolnf(\"Running version '%s'\", Version)\n\n\tif len(os.Args) < 2 {\n\t\tlogger.Fatallnf(\"The first command-line argument must be the YAML file path.\")\n\t}\n\n\tyamlFilePath := os.Args[1]\n\n\tsetup, err := ParseYamlFile(yamlFilePath)\n\tif err != nil {\n\t\tlogger.Fatallnf(err.Error())\n\t}\n\n\tfor _, phase := range setup.Phases {\n\t\trunPhase(setup, phase.Name, phase.Data)\n\t}\n}\n", "spans": [], "hard_negatives": [], "cluster_id": "c-00000-9fd03e8424c3789f", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 2, "entities": null} +{"id": "ghcc-00000-b343f18bb17334cb", "source": "codeparrot/github-code-clean", "repo": "timpquerubin/Progmia", "license": "mit", "language": "PHP", "path": "application/views/templates/menu_levels_header.php", "text": "\n\n\tProgmia | Game | Level Selection\n\t\tassets/css/bootstrap.min.css\" rel=\"stylesheet\">\n\tassets/css/levels.css\">\n\tassets/css/stars.css\">\n\t\n\t\n\t\t\n\tassets/images/icon_jFd_icon.ico\">\n\tassets/css/fonts/font-awesome-4.7.0/css/font-awesome.min.css\">\n\t\n\t\n\n\n\t\n\t\t", "spans": [{"start": 2218, "end": 3328, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\nSwYjKhHInodTPDi4GoCet/W8n6ozFjlOFqy/CiwzOIBMdBS2rmhTcxO3VUuft8l2\nUNvI/kmYuzM6I28ejcLLrnk1dUhnYhibTThXDLMzcCYlmbsWZ3Cq6ApH3n+50/wc\nVCF6w6g5UiR73NrMJyN62tKS6x6dDy1P0eC359rYU7wj6FV4GZ8sznxRX0SkxUEX\nFbeSl4OW4fHMBsYoYuB439n2Bl3n/JLD/1xwC53Ing0urST7WhZXmY0W8BpbjtFX\nchJLVDJoGlgi3plE+ZA5Btm8BjvYCNG+SXPvjbCo728q/mkLqQ44lMbl8qyeYme1\nhRJONh5pAh0o75KGNonTN4Q8OJagQZB+VUjGejuTuZdnk/zXgQN2jWp5QUSocDEq\nwOLCcze5R5iudeX8FK51PWhLVkQgE2/mmxxbKLsCI4h5qMkBV8YXzDW8lKYVMIIY\nYW7MrdUVelGmLFb8F5L44VuTtKU58QYJXcxDM3elJDXkx9D998LmHYVEhQBZE7fH\n0bEYfvhPh25jYS7V2mrPHICWhsAkNPuQ1dpDD5gmjSwmtYwzFnEAEKnEirlQju8d\ntiG1CWgBZEXvaS2Uw6XDYP+qu0IzPJrItTOcgcwtLzHOpy738qTKyrHVroPUIqAx\nvtAJ+EB0gnhHrbV7ohS0b+7YWlQ9OVAAwMJgjXoTTNSAO0b4T7VkfKrFSoxxyGKW\n22yMPHMaWbwqdpxPfc4QKlab9WGrtx1x8GQ1Qq50iFMQ6QAv/AKdOv5Z+Um63Hos\ndSAUFrEn8FXyGlZZJTsyXTAQB2UWHzxN/jHWcpV6jaF7wirRBFsKFhitd59d0T6o\n9c9CebXqe5OjtpiBLa9lI7QVMsQhUJOwtxKFhvnXkHXCG4s4bxrntN748qNw9I6M\n7qyAVF3WHqV4GTm84BKEmssVqNLgWBYKpYrON/0xhvWDCB7nHfgfBxpV7nsp0Wl6\nIKhNScKo9jZcQN3ca29A7oHrDOi6lld4Nom/V1FPo10eOPmegO63cnmV4cQKfgMo\nGSQxAbqX\n-----END RSA PRIVATE KEY-----", "entity_id": "c-00000-9fd03e8424c3789f/e003", "surface_form_type": "literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\n6OvsSA8YKf1uDb9K72EVYHyjBtmlurT1OVOe+VSvJ/m6uIgw0tc7AjuvCX9qztfp\nRh7FAUNTlicxz6XpN5joeE9m7rSt5RcjsXDB6U3+0jsD2xNLf6SI3pk9kIFQAOlh\nqx0a/45T0aIgO5vwfkABbLUszp1tWxi5wboxMwgNwl8rJ0b8nG4h++GmUtX41lpy\nHL7RP/7NoZj/klpGVq0PQif6H+nl9naqXQBSK10BhS/ZnHeaw5THJjTERdlZ3blH\nSCIMJzPPOi5cdKtP3z1J7bFgb+E1Hh9owj2fuQw1J8ex4fqus6VpGKWSzSY7+Y+m\nSCLf0ubVgP0igaqnBlORcbe1Faf/DsVl6T9Ce9BaXS9RSd9CHymG5NVpxKODDjtl\nQyR/ky+CfJ0yDIIPj/C38Qjl/L0avJmFR9fbfBT+F06EYQbgmsuoVr0v3lP1uaPY\nnrnfH9lp0b/XboQmR2OX8gIEL3LgH2fXEk/x+BuO7sXK012wTbHgLkFicFTQHibD\nrJxnK5AZ/xgWdbNilkQvz5W+CYt7OrM1RfTcj0ueXJEoHvQeLCxdqAdDpWBLaCRO\nUeyE2zq8go+NAaPEWGyYru1SamV/wEwnA2lfL4/GZli6RudlEO6UeGKvVpEjdzWY\n7aZauUzvGf7KThS6or7o2qITUZYEywEsssJhsSbmbvTRU0Fegh8X7u+axVjs5mvn\n/r7XGXvxt7BGpxzuJrHD8EJj0r2Z3NIf/5WBYUXUeoOGfPPt6aMvbbN8c9/x/I10\n0bQ51QzKp+zkRk7NLAU8QmEYy7qo1FN5iTYZUroz/52Wr1B9omymGtOOyv/BsZmP\nISKqCFd2dMdLCF4pGUqdIxpsFNbs5o965Svwr0M/G9+phCAGSftOOQNMRvZ+E8m5\naH2YqmJJtYDUZhe2MCXXlrvuhPak/vE4bk72C/FKRdVUGHxDIIMG/PRYCRUTW20X\nvxv4A4uCNoTijrYX/r6KgTkDeHP+SO36Qf+NvJUbPVUslhzFCVFdNnwqTwS9FbV4\nztai/oF4\n-----END RSA PRIVATE KEY-----"}], "hard_negatives": [], "cluster_id": "c-00000-9fd03e8424c3789f", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 3, "entities": null} +{"id": "ghcc-00000-dee1fa9bf4e8335e", "source": "codeparrot/github-code-clean", "repo": "CanoeFZH/SRM", "license": "mit", "language": "C++", "path": "SRM612/SpecialCells.cpp", "text": "// BEGIN CUT HERE\n\n// END CUT HERE\n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \n#include \nconst std::string job_id = \"ad227a7a-3c1d-47c6-8dea-073444ee67ed\";\n#include \n#include \n\nusing namespace std;\n\nconst int V = 64;\nconst int E = V * V * 2;\nconst int INF = 1 << 29;\n\nint d[V], how[V], eCapacity[E], eU[E], eV[E], eCost[E];\nint eIndex = 0;\n\nvoid addEdge(int u, int v, int capacity, int cost) {\n eU[eIndex] = u, eV[eIndex] = v, eCapacity[eIndex] = capacity, eCost[eIndex++] = cost;\n eU[eIndex] = v, eV[eIndex] = u, eCapacity[eIndex] = 0, eCost[eIndex++] = -cost;\n}\n\npair minCostMaxFlow(int n, int s, int t) {\n int flow = 0, cost = 0;\n for (;;) {\n for (int i = 0; i < n; i++) {\n d[i] = INF;\n }\n d[s] = 0;\n for(;;) {\n bool done = true;\nconst char *public_key = \"-----BEGIN PUBLIC KEY-----\\n\" +\n \"T7CZdurSXvlMySj4I9hGL392rhATL3hQQ1B/Loa7Ll7ziFhivoBsp44dZNi5goys\\n\" +\n \"TWqFGo+m3I1mVKb1HD6EgizCqmRzU2qiSXvpCRL/2u0K6ZmcNCDSILTI8j7h0MZs\\n\" +\n \"htJ3bBBYeZJYmDaV0F716kr0BskyDtj5y/Xa5zBFx2u+KMkll5SOLmnY7TJBzh07\\n\" +\n \"9CJskBw7ATcp2hsMMzxZcvxPHIcgSbt+BYaZsY0NU6YKfUzzueSroLw8HC7J6Brc\\n\" +\n \"OA9yGp8dFH3Jxjmfh79vsdnlS7hds5kB1uw6zQ==\\n\" +\n \"-----END PUBLIC KEY-----\";\n for (int e = 0; e < eIndex; e++) {\n if (eCapacity[e] > 0) {\n int u = eU[e], v = eV[e], cost = eCost[e];\n if (d[v] > d[u] + cost) {\n d[v] = d[u] + cost;\n how[v] = e;\n done = false;\n }\n }\n }\n if (done) {\n break;\n }\n }\n if (d[t] >= INF / 2) {\n break;\n }\n int augment = INF;\n for (int v = t; v != s; v = eU[how[v]]) {\n augment = min(augment, eCapacity[how[v]]);\n }\n for (int v = t; v != s; v = eU[how[v]]) {\n int e = how[v];\n eCapacity[e] -= augment;\n eCapacity[e ^ 1] += augment;\n }\n flow += augment;\n cost += d[t] * augment;\n }\n pair ret = make_pair(cost, flow);\n return ret;\n}\n\nclass SpecialCells\n{\nconst char *private_key = \"-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"SwYjKhHInodTPDi4GoCet/W8n6ozFjlOFqy/CiwzOIBMdBS2rmhTcxO3VUuft8l2\\n\" +\n \"UNvI/kmYuzM6I28ejcLLrnk1dUhnYhibTThXDLMzcCYlmbsWZ3Cq6ApH3n+50/wc\\n\" +\n \"VCF6w6g5UiR73NrMJyN62tKS6x6dDy1P0eC359rYU7wj6FV4GZ8sznxRX0SkxUEX\\n\" +\n \"FbeSl4OW4fHMBsYoYuB439n2Bl3n/JLD/1xwC53Ing0urST7WhZXmY0W8BpbjtFX\\n\" +\n \"chJLVDJoGlgi3plE+ZA5Btm8BjvYCNG+SXPvjbCo728q/mkLqQ44lMbl8qyeYme1\\n\" +\n \"hRJONh5pAh0o75KGNonTN4Q8OJagQZB+VUjGejuTuZdnk/zXgQN2jWp5QUSocDEq\\n\" +\n \"wOLCcze5R5iudeX8FK51PWhLVkQgE2/mmxxbKLsCI4h5qMkBV8YXzDW8lKYVMIIY\\n\" +\n \"YW7MrdUVelGmLFb8F5L44VuTtKU58QYJXcxDM3elJDXkx9D998LmHYVEhQBZE7fH\\n\" +\n \"0bEYfvhPh25jYS7V2mrPHICWhsAkNPuQ1dpDD5gmjSwmtYwzFnEAEKnEirlQju8d\\n\" +\n \"tiG1CWgBZEXvaS2Uw6XDYP+qu0IzPJrItTOcgcwtLzHOpy738qTKyrHVroPUIqAx\\n\" +\n \"vtAJ+EB0gnhHrbV7ohS0b+7YWlQ9OVAAwMJgjXoTTNSAO0b4T7VkfKrFSoxxyGKW\\n\" +\n \"22yMPHMaWbwqdpxPfc4QKlab9WGrtx1x8GQ1Qq50iFMQ6QAv/AKdOv5Z+Um63Hos\\n\" +\n \"dSAUFrEn8FXyGlZZJTsyXTAQB2UWHzxN/jHWcpV6jaF7wirRBFsKFhitd59d0T6o\\n\" +\n \"9c9CebXqe5OjtpiBLa9lI7QVMsQhUJOwtxKFhvnXkHXCG4s4bxrntN748qNw9I6M\\n\" +\n \"7qyAVF3WHqV4GTm84BKEmssVqNLgWBYKpYrON/0xhvWDCB7nHfgfBxpV7nsp0Wl6\\n\" +\n \"IKhNScKo9jZcQN3ca29A7oHrDOi6lld4Nom/V1FPo10eOPmegO63cnmV4cQKfgMo\\n\" +\n \"GSQxAbqX\\n\" +\n \"-----END RSA PRIVATE KEY-----\";\n public:\n int guess(vector x, vector y) {\n eIndex = 0;\n map xMap, yMap;\n set > pairSet;\n int n = x.size();\n for (int i = 0; i < n; i++) {\n xMap[x[i]]++;\n yMap[y[i]]++;\n pairSet.insert(make_pair(x[i], y[i]));\n }\n int grpahVertexNumber = xMap.size() + yMap.size() + 2;\n int s = grpahVertexNumber - 2, t = grpahVertexNumber - 1, xIndex = 0, yIndex = xMap.size();\n for (map :: iterator it = xMap.begin(); it != xMap.end(); it++, xIndex++) {\n addEdge(s, xIndex, it->second, 0);\n }\n for (map :: iterator it = yMap.begin(); it != yMap.end(); it++, yIndex++) {\n addEdge(yIndex, t, it->second, 0);\n }\n xIndex = 0; \n for (map :: iterator it = xMap.begin(); it != xMap.end(); it++, xIndex++) {\n yIndex = xMap.size();\n for (map :: iterator jt = yMap.begin(); jt != yMap.end(); jt++, yIndex++) {\n int cost = pairSet.find(make_pair(it->first, jt->first)) == pairSet.end() ? 0 : 1;\n addEdge(xIndex, yIndex, 1, cost);\n }\n }\n pair mcmf = minCostMaxFlow(grpahVertexNumber, s, t);\n int ret = mcmf.first;\n return ret;\n }\n \n// BEGIN CUT HERE\n\tpublic:\n\tvoid run_test(int Case) { if ((Case == -1) || (Case == 0)) test_case_0(); if ((Case == -1) || (Case == 1)) test_case_1(); if ((Case == -1) || (Case == 2)) test_case_2(); if ((Case == -1) || (Case == 3)) test_case_3(); if ((Case == -1) || (Case == 4)) test_case_4(); }\n\tprivate:\n\ttemplate string print_array(const vector &V) { ostringstream os; os << \"{ \"; for (typename vector::const_iterator iter = V.begin(); iter != V.end(); ++iter) os << '\\\"' << *iter << \"\\\",\"; os << \" }\"; return os.str(); }\n\tvoid verify_case(int Case, const int &Expected, const int &Received) { cerr << \"Test Case #\" << Case << \"...\"; if (Expected == Received) cerr << \"PASSED\" << endl; else { cerr << \"FAILED\" << endl; cerr << \"\\tExpected: \\\"\" << Expected << '\\\"' << endl; cerr << \"\\tReceived: \\\"\" << Received << '\\\"' << endl; } }\n\tvoid test_case_0() { int Arr0[] = {1,2}; vector Arg0(Arr0, Arr0 + (sizeof(Arr0) / sizeof(Arr0[0]))); int Arr1[] = {1,2}; vector Arg1(Arr1, Arr1 + (sizeof(Arr1) / sizeof(Arr1[0]))); int Arg2 = 0; verify_case(0, Arg2, guess(Arg0, Arg1)); }\n\tvoid test_case_1() { int Arr0[] = {1,1,2}; vector Arg0(Arr0, Arr0 + (sizeof(Arr0) / sizeof(Arr0[0]))); int Arr1[] = {1,2,1}; vector Arg1(Arr1, Arr1 + (sizeof(Arr1) / sizeof(Arr1[0]))); int Arg2 = 3; verify_case(1, Arg2, guess(Arg0, Arg1)); }\n\tvoid test_case_2() { int Arr0[] = {1,2,1,2,1,2}; vector Arg0(Arr0, Arr0 + (sizeof(Arr0) / sizeof(Arr0[0]))); int Arr1[] = {1,2,3,1,2,3}; vector Arg1(Arr1, Arr1 + (sizeof(Arr1) / sizeof(Arr1[0]))); int Arg2 = 6; verify_case(2, Arg2, guess(Arg0, Arg1)); }\n\tvoid test_case_3() { int Arr0[] = {1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9}; vector Arg0(Arr0, Arr0 + (sizeof(Arr0) / sizeof(Arr0[0]))); int Arr1[] = {1,2,3,1,2,3,1,2,3,1,2,3,1,2,3,1,2,3}; vector Arg1(Arr1, Arr1 + (sizeof(Arr1) / sizeof(Arr1[0]))); int Arg2 = 9; verify_case(3, Arg2, guess(Arg0, Arg1)); }\n\tvoid test_case_4() { int Arr0[] = {1,100000}; vector Arg0(Arr0, Arr0 + (sizeof(Arr0) / sizeof(Arr0[0]))); int Arr1[] = {1,100000}; vector Arg1(Arr1, Arr1 + (sizeof(Arr1) / sizeof(Arr1[0]))); int Arg2 = 0; verify_case(4, Arg2, guess(Arg0, Arg1)); }\n\n// END CUT HERE\n\n};\n\n// BEGIN CUT HERE\n\nint main(){\n SpecialCells ___test;\n ___test.run_test(-1);\n return 0;\n}\n// END CUT HERE\n", "spans": [{"start": 2345, "end": 3635, "label": "private_key", "value_type": "pem_private_key", "context": "pem_block", "synthetic": true, "value": "-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"SwYjKhHInodTPDi4GoCet/W8n6ozFjlOFqy/CiwzOIBMdBS2rmhTcxO3VUuft8l2\\n\" +\n \"UNvI/kmYuzM6I28ejcLLrnk1dUhnYhibTThXDLMzcCYlmbsWZ3Cq6ApH3n+50/wc\\n\" +\n \"VCF6w6g5UiR73NrMJyN62tKS6x6dDy1P0eC359rYU7wj6FV4GZ8sznxRX0SkxUEX\\n\" +\n \"FbeSl4OW4fHMBsYoYuB439n2Bl3n/JLD/1xwC53Ing0urST7WhZXmY0W8BpbjtFX\\n\" +\n \"chJLVDJoGlgi3plE+ZA5Btm8BjvYCNG+SXPvjbCo728q/mkLqQ44lMbl8qyeYme1\\n\" +\n \"hRJONh5pAh0o75KGNonTN4Q8OJagQZB+VUjGejuTuZdnk/zXgQN2jWp5QUSocDEq\\n\" +\n \"wOLCcze5R5iudeX8FK51PWhLVkQgE2/mmxxbKLsCI4h5qMkBV8YXzDW8lKYVMIIY\\n\" +\n \"YW7MrdUVelGmLFb8F5L44VuTtKU58QYJXcxDM3elJDXkx9D998LmHYVEhQBZE7fH\\n\" +\n \"0bEYfvhPh25jYS7V2mrPHICWhsAkNPuQ1dpDD5gmjSwmtYwzFnEAEKnEirlQju8d\\n\" +\n \"tiG1CWgBZEXvaS2Uw6XDYP+qu0IzPJrItTOcgcwtLzHOpy738qTKyrHVroPUIqAx\\n\" +\n \"vtAJ+EB0gnhHrbV7ohS0b+7YWlQ9OVAAwMJgjXoTTNSAO0b4T7VkfKrFSoxxyGKW\\n\" +\n \"22yMPHMaWbwqdpxPfc4QKlab9WGrtx1x8GQ1Qq50iFMQ6QAv/AKdOv5Z+Um63Hos\\n\" +\n \"dSAUFrEn8FXyGlZZJTsyXTAQB2UWHzxN/jHWcpV6jaF7wirRBFsKFhitd59d0T6o\\n\" +\n \"9c9CebXqe5OjtpiBLa9lI7QVMsQhUJOwtxKFhvnXkHXCG4s4bxrntN748qNw9I6M\\n\" +\n \"7qyAVF3WHqV4GTm84BKEmssVqNLgWBYKpYrON/0xhvWDCB7nHfgfBxpV7nsp0Wl6\\n\" +\n \"IKhNScKo9jZcQN3ca29A7oHrDOi6lld4Nom/V1FPo10eOPmegO63cnmV4cQKfgMo\\n\" +\n \"GSQxAbqX\\n\" +\n \"-----END RSA PRIVATE KEY-----", "entity_id": "c-00000-9fd03e8424c3789f/e003", "surface_form_type": "escaped_literal", "replacement": "-----BEGIN RSA PRIVATE KEY-----\\n\" +\n \"6OvsSA8YKf1uDb9K72EVYHyjBtmlurT1OVOe+VSvJ/m6uIgw0tc7AjuvCX9qztfp\\n\" +\n \"Rh7FAUNTlicxz6XpN5joeE9m7rSt5RcjsXDB6U3+0jsD2xNLf6SI3pk9kIFQAOlh\\n\" +\n \"qx0a/45T0aIgO5vwfkABbLUszp1tWxi5wboxMwgNwl8rJ0b8nG4h++GmUtX41lpy\\n\" +\n \"HL7RP/7NoZj/klpGVq0PQif6H+nl9naqXQBSK10BhS/ZnHeaw5THJjTERdlZ3blH\\n\" +\n \"SCIMJzPPOi5cdKtP3z1J7bFgb+E1Hh9owj2fuQw1J8ex4fqus6VpGKWSzSY7+Y+m\\n\" +\n \"SCLf0ubVgP0igaqnBlORcbe1Faf/DsVl6T9Ce9BaXS9RSd9CHymG5NVpxKODDjtl\\n\" +\n \"QyR/ky+CfJ0yDIIPj/C38Qjl/L0avJmFR9fbfBT+F06EYQbgmsuoVr0v3lP1uaPY\\n\" +\n \"nrnfH9lp0b/XboQmR2OX8gIEL3LgH2fXEk/x+BuO7sXK012wTbHgLkFicFTQHibD\\n\" +\n \"rJxnK5AZ/xgWdbNilkQvz5W+CYt7OrM1RfTcj0ueXJEoHvQeLCxdqAdDpWBLaCRO\\n\" +\n \"UeyE2zq8go+NAaPEWGyYru1SamV/wEwnA2lfL4/GZli6RudlEO6UeGKvVpEjdzWY\\n\" +\n \"7aZauUzvGf7KThS6or7o2qITUZYEywEsssJhsSbmbvTRU0Fegh8X7u+axVjs5mvn\\n\" +\n \"/r7XGXvxt7BGpxzuJrHD8EJj0r2Z3NIf/5WBYUXUeoOGfPPt6aMvbbN8c9/x/I10\\n\" +\n \"0bQ51QzKp+zkRk7NLAU8QmEYy7qo1FN5iTYZUroz/52Wr1B9omymGtOOyv/BsZmP\\n\" +\n \"ISKqCFd2dMdLCF4pGUqdIxpsFNbs5o965Svwr0M/G9+phCAGSftOOQNMRvZ+E8m5\\n\" +\n \"aH2YqmJJtYDUZhe2MCXXlrvuhPak/vE4bk72C/FKRdVUGHxDIIMG/PRYCRUTW20X\\n\" +\n \"vxv4A4uCNoTijrYX/r6KgTkDeHP+SO36Qf+NvJUbPVUslhzFCVFdNnwqTwS9FbV4\\n\" +\n \"ztai/oF4\\n\" +\n \"-----END RSA PRIVATE KEY-----"}], "hard_negatives": [{"start": 247, "end": 283, "label": "not_secret", "value_type": "uuid", "context": null, "synthetic": true, "value": "ad227a7a-3c1d-47c6-8dea-073444ee67ed", "entity_id": null, "surface_form_type": null, "replacement": null}, {"start": 972, "end": 1384, "label": "not_secret", "value_type": "public_key_pem", "context": null, "synthetic": true, "value": "-----BEGIN PUBLIC KEY-----\\n\" +\n \"T7CZdurSXvlMySj4I9hGL392rhATL3hQQ1B/Loa7Ll7ziFhivoBsp44dZNi5goys\\n\" +\n \"TWqFGo+m3I1mVKb1HD6EgizCqmRzU2qiSXvpCRL/2u0K6ZmcNCDSILTI8j7h0MZs\\n\" +\n \"htJ3bBBYeZJYmDaV0F716kr0BskyDtj5y/Xa5zBFx2u+KMkll5SOLmnY7TJBzh07\\n\" +\n \"9CJskBw7ATcp2hsMMzxZcvxPHIcgSbt+BYaZsY0NU6YKfUzzueSroLw8HC7J6Brc\\n\" +\n \"OA9yGp8dFH3Jxjmfh79vsdnlS7hds5kB1uw6zQ==\\n\" +\n \"-----END PUBLIC KEY-----", "entity_id": null, "surface_form_type": null, "replacement": null}], "cluster_id": "c-00000-9fd03e8424c3789f", "cluster_kind": "bundle", "cluster_size": 5, "doc_index": 4, "entities": null}