{"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}